← ClaudeAtlas

type-tightenerlisted

Strip `any` (and its cousins `unknown`-without-narrowing, `as` casts, `@ts-ignore`) from a TypeScript codebase. Adds real types where they're missing, enables strict mode safely, and produces a migration plan rather than a Big Bang rewrite. Use when the user says "add types", "remove any", "enable strict mode", "fix the typescript", "tighten the types", or "we have too many `any`s".
ashishkumar14/fullstack-agent-skills · ★ 0 · AI & Automation · score 72
Install: claude install-skill ashishkumar14/fullstack-agent-skills
# type-tightener — types that catch bugs, not types that pretend to ## When to use this skill Trigger when the goal is type safety, not just "make TS shut up". Strong signals: - "remove `any` from this file" - "enable `strict` mode without breaking everything" - "we have 500 ts-ignore comments, help" - "type this function properly" - "the types are lying — `.user` is sometimes undefined" Do *not* trigger for: type errors that are real runtime bugs (those need code changes, not type changes), or for "make this build green" requests where the user wants you to suppress, not fix. ## The output contract Type changes that: 1. **Reduce the lie surface** — fewer `any`s, fewer unjustified casts, fewer suppressions 2. **Compile** — `tsc --noEmit` green 3. **Don't introduce false confidence** — never replace `any` with a type that's *wider* than reality (e.g., typing JSON.parse output as a specific interface without runtime validation) 4. **Land in safe slices** — one file or one module at a time, never a Big Bang 5. **Document the residue** — every remaining `any` or suppression has a comment explaining why ## Workflow ### 1 — Inventory Before touching anything, count the debt: ```bash # count any (excluding type-fest, third-party d.ts) rg -t ts ': any\b|<any>|as any' --no-heading -c | head # count suppressions rg -t ts '@ts-ignore|@ts-expect-error|@ts-nocheck' --no-heading -c | head # count casts rg -t ts ' as [A-Z]' --no-heading -c | head ``` Show the numbers to the us