typescript-typecheck-fallback
O que ela faz
Esta skill descreve uma forma de verificar código TypeScript em duas etapas, com um método alternativo caso a primeira tentativa falhe. É para desenvolvedores que verificam TypeScript como parte de um build ou de uma revisão.
Quando usar
- ✓Quando você alterou arquivos TypeScript e quer confirmar que não há erros de tipo.
- ✓Quando um comando de verificação de tipo expira ou retorna um erro pouco claro.
- ✓Quando você quer uma verificação que rode como parte de uma revisão antes de terminar.
Link da skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/typescript-typecheck-fallback/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Pode rodar uma verificação de tipos nos meus arquivos TypeScript e me dizer se há erros?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente primeiro tenta a verificação rápida. Se ela falhar de forma pouco clara, passa a verificação para um auxiliar de reserva que consegue contornar o problema.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
TypeScript Type-Check with shell_agent Fallback
When verifying TypeScript compilation as part of a build or validation workflow, run_shell may fail with unknown errors due to shell environment issues, missing PATH entries, timeout constraints, or other transient problems. This skill describes a two-step pattern: attempt the check with run_shell first, then fall back to shell_agent if it fails.
When to Use
- After creating or modifying TypeScript source files and you need to confirm there are no type errors.
- As part of a CI-like verification step inside an autonomous workflow.
- Any time
run_shellreturns an unexpected or unclear error for atscinvocation.
Step-by-Step Pattern
Step 1 — Attempt with run_shell (fast path)
Try the direct command first. This is fast and gives immediate output when the environment is well-configured.
run_shell: npx tsc --noEmit
Evaluate the result:
- ✅ Exit code 0, no errors → Type-check passed. Done.
- ❌ Exit code non-zero with TypeScript diagnostics → Real type errors exist; surface them and fix.
- ⚠️ Unknown error, timeout, or no useful output → Proceed to Step 2.
Step 2 — Fall back to shell_agent (reliable path)
When run_shell fails in an ambiguous or environmental way, delegate to shell_agent with a natural-language task. shell_agent can autonomously:
- Locate the correct
npx/tscbinary - Retry on transient failures
- Navigate PATH or permission issues
- Return a structured summary of any type errors
Task string to pass to shell_agent:
Run `npx tsc --noEmit` in the project root and report all TypeScript type errors found. If there are no errors, confirm the compilation succeeded. If tsc is not available, attempt to install TypeScript locally with `npm install --save-dev typescript` first.
Evaluate the result:
- ✅ "No errors found" / exit 0 → Type-check passed.
- ❌ Type errors listed → Collect and fix the reported diagnostics, then re-run.
- ⚠️
tsconfig.jsonmissing → Ensure the file exists in the project root before re-running.
Decision Flowchart
run_shell("npx tsc --noEmit")
│
├─ success (exit 0) ──────────────────► ✅ PASS
│
├─ type errors reported ──────────────► ❌ Fix errors, retry
│
└─ unknown/env error ─────────────────► shell_agent(natural-language task)
│
├─ success ───► ✅ PASS
└─ errors ───► ❌ Fix & retry
Example Implementation
# Pseudo-code for an autonomous agent loop
result = run_shell("npx tsc --noEmit", timeout=60)
if result.exit_code == 0:
print("TypeScript check passed.")
elif result.exit_code != 0 and result.stderr contains "TS\d+":
# Real TypeScript diagnostics — surface and fix them
raise TypeScriptError(result.stderr)
else:
# Ambiguous failure — delegate to shell_agent
shell_agent(
task="Run `npx tsc --noEmit` in the project root and report all TypeScript "
"type errors found. If there are no errors, confirm compilation succeeded. "
"If tsc is not available, install it first with `npm install --save-dev typescript`."
)
Tips
- Always have a
tsconfig.json:tsc --noEmitrequires a valid config. If none exists, generate one first withnpx tsc --init. - Set a reasonable timeout: TypeScript compilation on large projects can take 30–120 seconds. Give
run_shellat leasttimeout=90. - Scope to changed files when possible: Use
--project tsconfig.jsonor a path glob to limit what tsc checks if only a subset of files changed. - Prefer
shell_agentfor first-time setups: If the project environment is freshly created and dependencies may not be fully installed, start withshell_agentdirectly to avoid a predictablerun_shellfailure.
Generalizing Beyond TypeScript
This same fallback pattern applies to any build/lint/type-check command that may be sensitive to shell environment:
| Tool | Primary run_shell command |
shell_agent fallback task |
|---|---|---|
| TypeScript | npx tsc --noEmit |
"Run npx tsc --noEmit and report errors" |
| ESLint | npx eslint src/ |
"Run npx eslint on the src directory and report lint errors" |
| Python mypy | python -m mypy src/ |
"Run mypy on the sr |
Perguntas frequentes
E se a verificação rápida funcionar?
Então o agente terminou, e os erros que ele relatar são problemas reais a corrigir.
O método alternativo pode alterar o meu código?
A verificação em si apenas relata erros. As correções são uma etapa separada.
Por que existe um método alternativo?
Alguns ambientes têm limites de tempo ou problemas de caminho que impedem a verificação rápida de rodar.
Detalhes
Descrição original do autor
Reliably run TypeScript type-checking (npx tsc --noEmit) by using shell_agent as a fallback when run_shell fails due to environment or timeout issues.
repo: HKUDS/AgentPilot
Popularidade
- Estrelas no GitHub
- 7,8 mil
- Posição no ranking
- #13086
- Licença
- MIT
- Atualizada em
- 01/11/2026
Comentários
- …
Mais skills deste repositório
agentpilot
7,8 milAjuda seu agente a melhorar um projeto passo a passo, preparando uma tarefa e executando o ciclo do AgentPilot, que propõe, testa e pontua mudanças.
openspace
7,8 milAjuda seu agente a configurar o OpenSpace, uma ferramenta que armazena e busca skills de agentes, e a conectá-la ao seu app de IA pelo MCP.
rsi-arena
7,8 milAjuda seu agente a configurar e rodar testes padrão de benchmark de IA, como AIME e Terminal-Bench, para comparar diferentes métodos de melhoria.
experiment-guide
7,8 milAjuda seu agente a planejar pequenos experimentos, ler seus resultados e registrar descobertas enquanto investiga como melhorar um programa.
Skills parecidas
diffs
394 milPermite que seu agente gere um diff real e compartilhável das edições, como link de visualização ou arquivo de imagem, em vez de um resumo escrito à mão.
coding-agent
394 milAjuda seu agente a passar um trabalho grande de programação para o Codex, Claude Code ou OpenCode em segundo plano e acompanhar o andamento.
gh-issues
394 milAjuda seu agente a encontrar issues do GitHub, escolher quais resolver e abrir pull requests com correções, acompanhando os comentários de revisão.