TypeScript Post-Implementation Check (Agent Skill)
Use this skill after implementation/refactoring is complete to ensure the codebase passes the core quality gates: TypeScript type checking, linting, and tests. Convert failures into actionable, minimal fix steps and re-run gates until everything passes.
Writing rules reference: Follow the code-writing conventions and standards defined in skills/typescript-write/SKILL.md.
When to Use
- Right after finishing a feature implementation, before opening a PR
- After refactoring, to ensure no type boundary regressions
- After bug fixes, to confirm no new TS/lint/test failures
- When CI fails and you need a local/agent triage + fix loop
Autonomous Verification Workflow
- Do not read or modify files outside the project folder.
- Work autonomously in small, verifiable increments.
- Prefer targeted checks first, then full checks.
- Do not commit changes; leave commits to the user after review.
- After every fix, re-run the relevant gate(s) to confirm progress.
- When proposing or applying code changes, follow the writing rules in
skills/typescript-write/SKILL.md.
Gate Order (Fast → Slow)
- Type Check (required)
- Lint (required)
- Targeted Tests (required for touched areas)
- (Optional) Build/Bundle (if the repo requires it)
Rationale: type errors often cascade; fix the compilation surface first, then style rules, then behavior.
Default Commands (Prefer Repo Scripts)
Always prefer existing repo scripts; only fall back when missing.
1) Type Check (primary)
npm run typecheck
pnpm -s run typecheck
yarn -s typecheck
npm run type-check-pure (if the repo uses this naming)
2) Lint
npm run lint
npm run lint -- --fix (or repo-specific flagging)
3) Tests
npm test
- Targeted:
npm test -- <pattern> / jest <pattern> (per repo conventions)
4) Fallback Type Check (if no script exists)
npx tsc -p tsconfig.json --noEmit (or repo-specific tsconfig path)
Diagnostics Triage Strategy
When a gate fails:
Classify failures
- TypeScript:
TSxxxx, incompatible types, missing properties, implicit any, etc.
- ESLint: rule violations, unused vars,
no-floating-promises, etc.
- Tests: assertion failures, timeouts, mocks not aligned
Fix upstream blockers first
- Fix the first/root TypeScript error before chasing cascades.
- If multiple errors in one file: prioritize type declarations, exported APIs, return types, and generic constraints.
Minimal diffs
- Avoid drive-by refactors.
- Avoid new abstractions unless they clearly reduce repetition and improve correctness.
- Avoid
any; use unknown + narrowing or a dedicated parsing layer if needed.
- Ensure all code changes adhere to
skills/typescript-write/SKILL.md.
Re-run gates
- After each fix, re-run the same gate.
- Only proceed to the next gate when the current gate passes.
Type Boundary Rules (Must Enforce)
Treat these boundaries as untrusted:
- API responses
JSON.parse(...) / localStorage
URLSearchParams / query params
- event payloads (DOM/custom events, message buses)
Approach:
- Use
unknown at the boundary
- Narrow via runtime checks / validators / type guards
- Prefer explicit, readable failure modes over silent coercion
Anti-Patterns to Avoid
- Silencing failures with
any
- Widening unions until they lose meaning just to appease the compiler
- Large unrelated changes to satisfy lint rules
- Moving all helpers to the bottom of the file by default (prefer proximity to usage)
Required Output Format (Deliverable)
Each run of this skill must output:
Commands executed (with pass/fail)
Failure summary:
- Top 3–10 most relevant diagnostics per gate (include file, line/col, TS code / ESLint rule)
Fix plan: an ordered, minimal step list
(If allowed to edit code) Minimal patch addressing only what is necessary, following skills/typescript-write/SKILL.md
Re-run results: until all gates pass or a clear external blocker is identified (missing deps, environment mismatch, etc.)
Suggested Checklist
- Run
typecheck (or repo-specific type-check script)
- Fix until typecheck passes
- Run
lint (use --fix if appropriate)
- Run targeted tests covering touched paths
- Confirm all gates pass, then deliver / open PR
1---2name: typescript-postcheck3description: Run post-implementation quality gates for TypeScript/JavaScript: type-checking, linting, and tests. Use after finishing an implementation or refactor to validate correctness and produce actionable diagnostics + minimal fixes.4---56# TypeScript Post-Implementation Check (Agent Skill)78Use this skill **after implementation/refactoring is complete** to ensure the codebase passes the core quality gates: **TypeScript type checking, linting, and tests**. Convert failures into **actionable, minimal fix steps** and re-run gates until everything passes.910> **Writing rules reference:** Follow the code-writing conventions and standards defined in `skills/typescript-write/SKILL.md`.1112## When to Use1314- Right after finishing a feature implementation, before opening a PR15- After refactoring, to ensure no type boundary regressions16- After bug fixes, to confirm no new TS/lint/test failures17- When CI fails and you need a local/agent triage + fix loop1819---2021## Autonomous Verification Workflow2223- Do not read or modify files outside the project folder.24- Work autonomously in small, verifiable increments.25- Prefer targeted checks first, then full checks.26- Do not commit changes; leave commits to the user after review.27- After every fix, re-run the relevant gate(s) to confirm progress.28- When proposing or applying code changes, follow the writing rules in `skills/typescript-write/SKILL.md`.2930---3132## Gate Order (Fast → Slow)33341. **Type Check (required)**352. **Lint (required)**363. **Targeted Tests (required for touched areas)**374. _(Optional)_ **Build/Bundle** (if the repo requires it)3839Rationale: type errors often cascade; fix the compilation surface first, then style rules, then behavior.4041---4243## Default Commands (Prefer Repo Scripts)4445Always prefer existing repo scripts; only fall back when missing.4647### 1) Type Check (primary)4849- `npm run typecheck`50- `pnpm -s run typecheck`51- `yarn -s typecheck`52- `npm run type-check-pure` _(if the repo uses this naming)_5354### 2) Lint5556- `npm run lint`57- `npm run lint -- --fix` _(or repo-specific flagging)_5859### 3) Tests6061- `npm test`62- Targeted: `npm test -- <pattern>` / `jest <pattern>` _(per repo conventions)_6364### 4) Fallback Type Check (if no script exists)6566- `npx tsc -p tsconfig.json --noEmit` _(or repo-specific tsconfig path)_6768---6970## Diagnostics Triage Strategy7172When a gate fails:73741. **Classify failures**75 - TypeScript: `TSxxxx`, incompatible types, missing properties, implicit any, etc.76 - ESLint: rule violations, unused vars, `no-floating-promises`, etc.77 - Tests: assertion failures, timeouts, mocks not aligned78792. **Fix upstream blockers first**80 - Fix the first/root TypeScript error before chasing cascades.81 - If multiple errors in one file: prioritize type declarations, exported APIs, return types, and generic constraints.82833. **Minimal diffs**84 - Avoid drive-by refactors.85 - Avoid new abstractions unless they clearly reduce repetition and improve correctness.86 - Avoid `any`; use `unknown` + narrowing or a dedicated parsing layer if needed.87 - Ensure all code changes adhere to `skills/typescript-write/SKILL.md`.88894. **Re-run gates**90 - After each fix, re-run the same gate.91 - Only proceed to the next gate when the current gate passes.9293---9495## Type Boundary Rules (Must Enforce)9697Treat these boundaries as **untrusted**:9899- API responses100- `JSON.parse(...)` / `localStorage`101- `URLSearchParams` / query params102- event payloads (DOM/custom events, message buses)103104Approach:105106- Use `unknown` at the boundary107- Narrow via runtime checks / validators / type guards108- Prefer explicit, readable failure modes over silent coercion109110---111112## Anti-Patterns to Avoid113114- Silencing failures with `any`115- Widening unions until they lose meaning just to appease the compiler116- Large unrelated changes to satisfy lint rules117- Moving all helpers to the bottom of the file by default (prefer proximity to usage)118119---120121## Required Output Format (Deliverable)122123Each run of this skill must output:1241251. **Commands executed** (with pass/fail)1261272. **Failure summary**:128 - Top 3–10 most relevant diagnostics per gate (include file, line/col, TS code / ESLint rule)1291303. **Fix plan**: an ordered, minimal step list1311324. _(If allowed to edit code)_ **Minimal patch** addressing only what is necessary, following `skills/typescript-write/SKILL.md`1331345. **Re-run results**: until all gates pass or a clear external blocker is identified (missing deps, environment mismatch, etc.)135136---137138## Suggested Checklist1391401. Run `typecheck` (or repo-specific type-check script)1412. Fix until typecheck passes1423. Run `lint` (use `--fix` if appropriate)1434. Run targeted tests covering touched paths1445. Confirm all gates pass, then deliver / open PR