~/.claude/skills/typescript-strict-mode/SKILL.mdTypeScript Strict Mode
Finds and fixes TypeScript type issues: replaces `any`, adds missing types, removes `@ts-ignore`, enforces strict patterns.
--- name: typescript-strict-mode description: | Finds and fixes TypeScript type safety issues across the codebase. IMPORTANT: Activate this skill whenever the user asks to "fix types", "add types", "remove any types", "typescript strict", or "type safety". This skill MUST be used for all TypeScript strictness requests. --- # TypeScript Strict Mode Scans your codebase for TypeScript type safety issues and fixes them: replaces `any` with proper types, adds missing type annotations, remov
Scans your codebase for TypeScript type safety issues and fixes them: replaces any with proper types, adds missing type annotations, removes @ts-ignore comments, and enforces strict patterns.
Say any of these to activate this skill: - "fix the types" - "remove all any types" - "make TypeScript stricter" - "Use skill: typescript strict mode"
1. Search the codebase for any types, @ts-ignore comments, and @ts-expect-error without descriptions
2. For each any, read the surrounding code to infer the correct type
3. Replace any with the specific type (interface, union, generic, etc.)
4. For @ts-ignore, determine the underlying type error and fix it properly
5. Check for functions missing return types on exported functions
6. Run tsc --noEmit after each batch of fixes to verify no new errors
7. Report the count of issues fixed and any remaining that need manual review
- Replace
anywith the most specific type possible, notunknowneverywhere - If a type is genuinely unknowable at compile time,
unknownwith a type guard is correct - Do not add return types to internal/private functions (only exported ones)
- Preserve
@ts-expect-errorcomments that have a description explaining why - Fix issues in batches by file, running the type checker between batches
- Best with: Claude Code CLI (can run tsc and iterate on type errors)
- Also works: Cursor, Windsurf
- Expects: A TypeScript project (tsconfig.json present)
- Summary: count of
anytypes,@ts-ignorecomments, and missing return types found - Fixes applied file-by-file
- Final
tsc --noEmitoutput confirming clean compilation