tsc-error-triage
Diagnose and resolve TypeScript compiler errors by finding the smallest root-cause fix before editing call sites.
Version
1.1.0
Maturity
stable
Repository
agent-skills
License
Proprietary
Skill metadata
SKILL.md
TSC error triage
Use this skill when
- The user asks you to fix TypeScript compiler errors or strict-mode regressions.
- A refactor, dependency upgrade, or config change causes a burst of
tscfailures. tsconfighardening or module-resolution changes have already been made and the next task is fixing the resulting compiler errors in root-cause order.- You need to identify the root cause instead of patching each leaf error one by one.
Do not use this skill when
- The task is primarily about runtime bugs with no TypeScript compiler signal.
- The repository is not using TypeScript or does not have a meaningful typecheck command.
- The request is to redesign the type model broadly rather than to triage concrete compiler failures.
Inputs to gather
Required before editing
- The repository's typecheck command.
- The current compiler output or the files showing the failing errors.
- The recent change that likely introduced the failures, if known.
- The relevant
tsconfigchain for the failing files.
Helpful if present
- Existing type suppression patterns such as
@ts-expect-erroror wrapper helpers. - Adjacent tests covering the affected module.
- Whether the failures are isolated to one package or shared across a workspace.
First move
- Find the repository's typecheck command by checking the existing scripts, workspace commands, or TypeScript build setup.
- If the command is still ambiguous, use
tsc --noEmitfor a single-project setup ortsc -bfor a project-references setup as the safest fallback. - Run that command and capture the full compiler output.
- Group the errors by root symbol, module, or config boundary instead of treating every error as independent.
- Start with the earliest high-fanout error before fixing downstream call sites.
Workflow
- Reproduce the failures with the same command the repository already uses.
- Find the first causal error in the chain, such as a bad export, a broken generic constraint, or a config mismatch.
- Inspect the defining type, imports, and nearby helpers before editing consumers.
- Apply the smallest truthful fix at the source of the error.
- Re-run the typecheck to see which follow-on errors disappear.
- Only then fix any remaining leaf errors that still reflect real type problems.
Guardrails
- Must not silence compiler errors with
any,@ts-ignore, or unsafe assertions unless the repository already documents that escape hatch. - Must not patch leaf errors first when a shared root cause is still unresolved.
- Should prefer fixing exported types, generic constraints, and config boundaries before editing many call sites.
- Should preserve runtime behavior while improving type correctness.
Validation
- Re-run the same typecheck command and confirm the targeted errors are gone.
- Check that no new class of compiler error was introduced nearby.
- Run targeted tests for the touched surface when the repository has them.
Examples
- "TypeScript exploded after this refactor. Find the root cause instead of patching every call site."
- "Fix the
tsc --noEmiterrors after upgrading this dependency." - "I enabled a stricter TS flag and now there are 80 errors. Triage them in the right order."
Reference files
references/error-patterns.md- common compiler error families, likely root causes, and preferred first checks.