Strict Types Until Zero
Tighten type checking one directory at a time, fix the new type errors with real types instead of any or ignore comments, and repeat until the checker passes.
Copy the Strict Types Until Zero loop
Stops when the type checker passes with strict settings across the whole scope, or after 10 iterations. Edit the settings block, then paste the whole prompt into your agent.
You are running the "Strict Types Until Zero" loop. Settings (edit before running): - Strict check command: npx tsc --noEmit --strict - Test command: npm test - Scope: src/ - Max iterations (directories): 10 Goal: zero type errors under strict settings for the scope above. Before the loop: run the strict check and group errors by directory. Order directories so leaf modules (few importers) come first. Each iteration: 1. Take the next directory from the list. 2. Fix its type errors with accurate types: explicit parameter and return types, type guards and narrowing, null and undefined checks, and generics where they remove duplication. 3. Run the strict check for the whole scope to make sure fixes did not create errors elsewhere. 4. Run the test command. 5. Log: directory, errors fixed, errors remaining overall. Stop when: - The strict check reports zero errors. Success. Propose the config change that turns strict mode on permanently. - You reach the max iteration count. Rules: - Do not use "any", "as unknown as", non-null assertions (!), ts-ignore, or ts-expect-error to silence errors. If one is truly unavoidable, leave a comment explaining why and list it in the report. - When a type error reveals a real bug (for example a possible null), fix the bug and call it out. - Do not change runtime behavior except to fix those bugs. Final report: error counts before and after, real bugs found, and any remaining escape hatches with reasons.
When this loop fits
- You want to switch a TypeScript project to strict mode, or a Python project to strict mypy or Pyright.
- A codebase is full of implicit any or untyped functions that keep hiding bugs.
- You want the migration split into small, reviewable directory-sized steps.
What happens on each pass
The agent repeats these steps until the stop condition holds or it runs out of iterations.
- Baseline. Run the type checker with strict settings and count errors per directory.
- Pick a directory. Start with the directory that has the fewest dependents, such as utilities or leaf modules.
- Add real types. Fix each error with accurate types, narrowing, or null checks.
- Check and test. Run the type checker and tests, then move to the next directory.
MCP servers for this loop
The 6 strongest of 800 matching servers, ranked by how closely they fit and then by trust score.
- 50Trust score 50 of 100, Fair
agentcat
by agentcathq · TypeScript
Analytics tool for MCP (Model Context Protocol) servers and AI agents - tracks tool usage patterns and provides insights
LicenseQualityMaintenanceLicense: A. MIT is a permissive open source license.Quality: Not graded. No README or tool list has been captured yet.Maintenance: A. Last commit or release 27 days ago. - 50Trust score 50 of 100, Fair
An MCP server for weather information updating this value now.
RegistryLicenseQualityMaintenanceLicense: Not graded. No license is recorded for this server.Quality: C. 55/100 for listing completeness. Lost points: short README, no listed tools, short summary.Maintenance: Not graded. No commit or release date has been recorded.
47Trust score 47 of 100, FairPriority — TypeScript Compiler Intelligence
Unknown author
Stateless TS/JS compiler facts for agents: references, imports, impact. No repo index or OAuth.
RegistryRemoteLicenseQualityMaintenanceLicense: Not graded. No license is recorded for this server.Quality: Not graded. No README or tool list has been captured yet.Maintenance: Not graded. No commit or release date has been recorded.- 40Trust score 40 of 100, Fair
AI-powered meeting scheduling with intelligent auto-scheduling for Claude and AI agents.
RegistryLicenseQualityMaintenanceLicense: Not graded. No license is recorded for this server.Quality: Not graded. No README or tool list has been captured yet.Maintenance: Not graded. No commit or release date has been recorded. - 40Trust score 40 of 100, Fair
AST for TypeScript, supports creating JSON representations of React components
RegistryLicenseQualityMaintenanceLicense: Not graded. No license is recorded for this server.Quality: Not graded. No README or tool list has been captured yet.Maintenance: Not graded. No commit or release date has been recorded. - 40Trust score 40 of 100, Fair
MCP server that exposes Pyright language server functionality
RegistryLicenseQualityMaintenanceLicense: Not graded. No license is recorded for this server.Quality: Not graded. No README or tool list has been captured yet.Maintenance: Not graded. No commit or release date has been recorded.
How to run this loop
- Connect the tools. Install a server the loop can use, for example agentcat, or rely on your agent's built-in terminal and file access.
- Edit the settings block. Replace the example commands, targets, and limits with your project's own. Keep the iteration cap low on the first run.
- Paste it into an agent session. Start a fresh session in Claude Code, Cursor, or VS Code agent mode, in the repository root, and paste the prompt.
- Review before you merge. Read the final report and the diff. The loop leaves its work for you to review rather than shipping it.
Strict Types Until Zero questions
When does the Strict Types Until Zero loop stop?
It stops as soon as the type checker passes with strict settings across the whole scope. It also stops after 10 iterations by default, or earlier when the prompt's own stop rules say it is stuck, and then reports what changed and what is left. Change the cap in the settings block at the top of the prompt.
Can I use this loop for Python type checking?
Yes. Use mypy --strict or pyright in strict mode as the check command and the loop works the same way. The banned escape hatches become Any, cast, and type: ignore comments.
Will strict typing find real bugs?
Usually, yes. Strict null checks in particular surface code paths where a value can be missing and nothing handles it. The prompt asks the agent to fix and report those separately, so they do not get lost inside a large typing diff.