- Home
- Skills
- APIs & Backend
- TypeScript Strict Migration: Remove any, Stay Green
TypeScript Strict Migration: Remove any, Stay Green
by Ignasi
Incrementally migrate JS to TS and enable strict mode flags without breaking the build.
Free
TypeScript Strict Migration: Remove any, Stay Green
Example session with this skill installed
Run a baseline audit on my src directory and suggest the first three steps to enable strictNullChecks in this React project.
- Read your context and instructions
- Compiled the typescript strict migration
I have completed the baseline audit of your src directory. The codebase currently has a significant number of implicit any types and unhandled null/undefined values.
Migration Audit & Strategy
| Metric | Current Count |
|---|---|
| Total TS Errors | 412 |
any / as any usages | 87 |
@ts-ignore instances | 14 |
| JS to TS coverage | 65% |
Error Distribution
- TS2532 (Object is possibly undefined): 156 instances
- TS7006 (Implicit any): 92 instances
- TS2339 (Property does not exist): 44 instances
Suggested Implementation Plan
- Initialize Flag Ladder: Set
skipLibCheck: trueandcheckJs: falseintsconfig.jsonto stabilize the current build environment while we target specific modules. - Leaf Module Conversion: Begin renaming
.jsfiles to.tsxinsrc/utilsandsrc/components/ui. I will add explicit return types to these utility functions first to allow the compiler to infer types in the calling components. - Zod Boundary Protection: Replace the three main
fetchcalls insrc/api/user.tswith Zod schemas. This will transformanyresponses into validated types, clearing approximately 40% of theTS2532errors in the downstream data flow.
Next steps
- Run the baseline script:
npx tsc --noEmit --pretty false | tee .ts-baseline.txt. - Apply
noImplicitAnyto theutilsfolder using a nestedtsconfig.strict.json. - Review the
zodschema definitions for theUserandProfileinterfaces.
Connects securely to your tools. The creator never sees your data.
About this skill
Struggling with a codebase full of any types, suppressed errors, or legacy JavaScript? Migrating to strict TypeScript is a slog that often breaks the build or stalls due to the sheer volume of errors. This skill manages the incremental conversion of JavaScript to TypeScript and the systematic activation of strict compiler flags without halting development.
What it does
- Baseline auditing generates a precise count of
TSerrors andanyescape hatches to track progress. - Incremental flag migration sequences the activation of
noImplicitAny,strictNullChecks, andnoUncheckedIndexedAccess. - Type-safe boundary enforcement implements Zod schemas for API and JSON inputs to replace unsafe
anytypes. - Pattern-based fixing replaces
@ts-ignoreand type assertions with narrowing, guards, and discriminated unions. - Framework-specific typing applies best practices for React props, Vue script setup, and Next.js server actions.
How it works
- Analyze the current state using
tscand grep to identify the highest concentration of type debt. - Execute the flag ladder, enabling one strict compiler flag at a time and resolving resulting errors.
- Refactor leaf modules first, converting
.jsto.tsand replacing JSDoc with native types. - Lock progress by configuring ESLint rules and CI ratcheting to prevent new
anydeclarations.
Frameworks & tools
Works with TypeScript, React, Vue (vue-tsc), Next.js, and Node.js. Uses Zod for runtime validation and @typescript-eslint for linting enforcement.
Why this beats prompting it yourself
Standard LLM prompts often suggest "any" or "as" assertions to silence errors quickly. This skill enforces a "correct over silent" philosophy, ensuring that type safety actually improves runtime reliability instead of just hiding compiler warnings.
Use cases
- Converting a legacy Node/Express JS project to a typed TypeScript codebase.
- Enabling
strictNullCheckson a large React repo without breaking the build. - Replacing unsafe
JSON.parseresults with validated Zod schemas. - Setting up a CI ratchet to force a decreasing count of
anytypes over time.
Known limitations
Does not change runtime behavior during typing; logic bugs found during migration are reported but not auto-fixed to avoid regressions. Requires an existing npm/yarn environment.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 11 days ago
- Free with an Agensi account
- Software
- tsc
Node.js
Permissions
What's inside
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.