typescript-compile-check-resilient-fallback
하는 일
이 스킬은 평소 명령이 고장 났을 때 TypeScript 코드의 오류를 검사하는 방법을 설명합니다. 대체 경로를 보여 주고, 실제 코드 오류와 설정 문제를 구분하는 방법을 알려 줍니다. TypeScript 프로젝트에서 일하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓평소 TypeScript 검사 명령이 코드와 무관한 오류를 낼 때.
- ✓작업을 끝내기 전에 변경 사항이 컴파일되는지 알고 싶을 때.
- ✓실제 타입 오류와 도구나 환경 문제를 구분하고 싶을 때.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/typescript-compile-check-resilient-fallback/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“평소 검사 명령이 작동하지 않더라도, 제 TypeScript 변경 사항이 컴파일되는지 확인해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 먼저 표준 검사를 실행합니다. 도구 자체가 실패하면 대체 방법을 사용하도록 도우미에게 맡기고, 실제 코드 오류와 설정 문제를 가려냅니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
TypeScript Compile-Check Resilient Fallback
Use this workflow whenever you need to verify that TypeScript files compile
cleanly after creating or modifying them, especially in environments where
npx or direct ./node_modules/.bin/tsc invocations may return unexpected
errors.
Step 1 — Attempt Primary Invocation
Run the compile check with run_shell using the standard approach:
npx tsc --noEmit
or, if you already know the project root:
./node_modules/.bin/tsc --noEmit
Evaluate the result:
- If it exits cleanly (exit code 0, no unexpected output) → done.
- If it exits with TypeScript diagnostic errors → proceed to Step 3.
- If it exits with an unknown / tool-level error (e.g.,
npxnot found, permission denied, spawn error, unclear non-zero exit unrelated to TS diagnostics) → proceed to Step 2.
Step 2 — Fallback via shell_agent
When the primary invocation fails with an unknown error, delegate to
shell_agent so it can resolve environment issues automatically:
Task: "From the project directory
<PROJECT_DIR>, runnode node_modules/typescript/bin/tsc --noEmitand report all TypeScript diagnostic errors."
Example shell_agent task string:
From /path/to/project, run:
node node_modules/typescript/bin/tsc --noEmit
Capture the full stdout/stderr output and return it.
shell_agent will handle PATH issues, working-directory changes, and
retry on transient failures automatically.
Step 3 — Filter Pre-Existing Errors
TypeScript projects frequently have pre-existing errors in files you did not touch. To avoid false regressions:
- Identify the baseline error count for the project (e.g., determined at task start or documented in task context). A common baseline is 11 pre-existing errors in unrelated files.
- Collect the full diagnostic list from tsc output.
- Filter to keep only errors whose file path matches a file you created or modified in this task.
- Evaluate:
- Zero errors in your new/modified files → ✅ no regression introduced.
- One or more errors in your new/modified files → ❌ fix them before proceeding.
Filtering heuristic (pseudocode)
all_errors = parse_tsc_output(tsc_stdout)
my_files = [list of files created/modified in this task]
new_errors = [e for e in all_errors if e.file in my_files]
if len(new_errors) == 0:
print("✅ No new TypeScript errors introduced.")
else:
for err in new_errors:
print(f"❌ {err.file}:{err.line} — {err.message}")
raise Exception("Fix TypeScript errors before continuing.")
Step 4 — Fix and Re-Run
If new errors are found:
- Fix the errors in your file(s).
- Repeat from Step 1.
Decision Tree Summary
run_shell: npx tsc --noEmit
│
├─ clean exit ──────────────────────────────► ✅ Done
│
├─ TS diagnostic errors ────────────────────► Step 3 (filter)
│
└─ unknown/tool error
│
└─ shell_agent: node .../tsc --noEmit
│
├─ TS diagnostic errors ────► Step 3 (filter)
└─ clean exit ──────────────► ✅ Done
Notes
- Always run tsc from the project root (where
tsconfig.jsonlives). - The
node node_modules/typescript/bin/tscinvocation is the most portable fallback because it bypassesnpx, shell PATH lookups, and binary permission issues entirely. - When the baseline error count is unknown, run tsc before making any changes and record the count; that becomes your baseline.
- Only report/act on errors in files you own; never attempt to fix pre-existing errors in third-party or unrelated project files unless explicitly asked.
자주 묻는 질문
대체 방법은 무엇인가요?
코드와 무관한 이유로 일반 명령이 실패하면, 에이전트가 도우미에게 다른 방식으로 검사하도록 요청합니다.
에이전트는 오류가 진짜인지 어떻게 아나요?
실제 오류에는 TypeScript 진단 메시지가 함께 나오고, 도구 실패에는 그런 메시지가 없습니다.
이 방법이 코드를 바꾸나요?
아니요. 검사는 코드를 읽고 오류를 보고할 뿐입니다.
상세 정보
작성자의 원본 설명
A resilient workflow for running TypeScript compile checks (tsc --noEmit) that falls back gracefully when npx or direct binary invocations fail, and distinguishes pre-existing errors from newly introduced ones.
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #13083
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
agentpilot
7.8k작업을 준비하고 AgentPilot 루프를 실행해 변경을 제안, 테스트, 점수화하면서 프로젝트를 단계적으로 개선하도록 돕습니다.
openspace
7.8k에이전트 스킬을 저장하고 가져오는 도구인 OpenSpace를 설정하고, MCP를 통해 AI 앱에 연결하도록 돕습니다.
rsi-arena
7.8kAIME나 Terminal-Bench 같은 표준 AI 벤치마크 테스트를 설정하고 실행해 서로 다른 개선 방법을 비교하도록 돕습니다.
experiment-guide
7.8k프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.