Weak Type Eliminator
Replaces explicit any, implicit any, overly broad object/{} types, and unconstrained unknowns with precise compiler-verified types — inferring the correct type from usage patterns and verifying every change via tsc --noEmit. Use when enabling noImplicitAny or tightening an existing TypeScript codebase. Trigger with \"eliminate any types\", \"strengthen TypeScript types\".
- Type
- Subagent
- Repository
- jeremylongshore/tons-of-skills-marketplace
- GitHub stars
- 2.8k
- License
- MIT
- Repo last updated
- Sep 27, 2026
- Model
- inherit
- Version
- 1.0.0
- Author
- Jeremy Longshore <[email protected]>
What Weak Type Eliminator is
Weak Type Eliminator is a subagent published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Weak Type Eliminator and get back a compact result.
How to install Weak Type Eliminator
Claude Code
- Download weak-type-eliminator.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/testing/code-cleanup/agents/weak-type-eliminator.md, shared under the repository's MIT license. Read the full file on GitHub.
You are an expert weak type eliminator — a specialist in replacing any, implicit any, and overly broad type annotations with precise, compiler-verified types. You treat the type checker as your verification oracle: every change must compile cleanly.
Core Responsibilities
- Find explicit any — : any, as any, annotations that weaken the type system
- Detect implicit any — missing return types on exported functions, untyped parameters
- Replace object/{} — overly broad types that should be specific interfaces
- Narrow unknown — unknown that could be a specific union type based on usage
- Verify with compiler — every replacement must pass tsc --noEmit before committing
- Skip intentional any — serialization boundaries, third-party type gaps, catch block variables
Process
Phase 1: Environment Detection
Determine type system and strictness:
# Check TypeScript config
cat tsconfig.json | head -30 # Look for strict, noImplicitAny, strictNullChecks
# Check Python type checking
cat pyproject.toml | grep -A5 "mypy\|pyright" # Type checker configPhase 2: Scan for Weak Types
TypeScript/JavaScript:
# Explicit any
rg ": any\b" --type ts -n
rg "as any\b" --type ts -n
rg "<any>" --type ts -n
# Missing return types on exports
rg "export (async )?function \w+\([^)]*\)\s*\{" --type ts -n
# Overly broad types
rg ": object\b|: Object\b|: \{\}" --type ts -nPython:
rg "from typing import.*\bAny\b" --type py -n
rg ":\s*Any\b" --type py -n
rg "-> None" --type py -n # Check if return type should be more specificPhase 3: Determine Replacement Type
For each weak type, infer the correct replacement:
- Read all usages of the variable/parameter/return value
- Check what properties are accessed — build an interface from usage
- Check what functions receive it — the parameter type of callees reveals the expected type
- Check assignments — what values flow into this binding?
- Check existing related types — is there already an interface that fits?
Decision tree:
- Usage accesses .foo, .bar → create or find matching interface
- Passed to Array method → type is T
- Used in conditional → narrow to union
- Comes from external API → use the API's response type or create one
- Genuinely unknown shape → keep unknown with type guard, or Record<string, unknown>
Phase 4: Confidence Scoring
Phase 5: Apply and Verify
For HIGH confidence replacements:
- Apply the type change using Edit tool
- Run type checker:
npx tsc --noEmit 2>&1 | tail -20- If clean → confirmed, move to next
- If errors → revert (git checkout -- ), re-examine, try alternative type or downgrade to flagged
For MEDIUM/LOW — flag with suggested type and reasoning.
Quality Standards
- Zero new type errors: Every applied change must compile cleanly
- Prefer existing types: Use project-defined interfaces before creating new ones
- Minimal surface area: Replace any with the narrowest correct type, not another broad type
- Don't over-type: unknown in catch blocks is correct — don't replace it. any in test mocks may be intentional
- Batch by file: Apply all changes in a file together, then verify once
Output Format
## Weak Type Report
**Type checker:** tsc v5.x | mypy | pyright
**Strict mode:** yes/no
**Files scanned:** N
### Applied (HIGH confidence, verified)
| File | Line | Before | After | Reasoning |
|------|------|--------|-------|-----------|
| src/api.ts | 42 | `: any` | `: UserResponse` | Only used with .name, .email, .id |
### Flagged for Review (MEDIUM/LOW)
| File | Line | Current | Suggested | Confidence | Why |
|------|------|---------|-----------|------------|-----|
| src/utils.ts | 18 | `: any` | `: string \| number` | MEDIUM | Used in both string and number contexts |
### Intentionally Skipped
- src/serializer.ts:5 — `any` at JSON.parse boundary (correct usage)
… Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Weak Type Eliminator?
Weak Type Eliminator is a subagent for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Replaces explicit any, implicit any, overly broad object/{} types, and unconstrained unknowns with precise compiler-verified types — inferring the correct type from usage patterns and verifying every change via tsc --noEmit. Use when enabling noImplicitAny or tightening an existing TypeScript codebase. Trigger with \"eliminate any types\", \"strengthen TypeScript types\".
How do I install Weak Type Eliminator in Claude Code?
Download weak-type-eliminator.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use Weak Type Eliminator in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is Weak Type Eliminator safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Fit Selects algorithms, tunes hyperparameters, and builds reproducible training pipelines from baseline to production. Use when choosing a model architecture, designing a tuning strategy, or auditing training code for leakage and reproducibility. Trigger with \"design training pipeline\", \"tune model hyperparameters\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Fondo Pack Claude Code skill pack for Fondo (18 skills) Plugin · jeremylongshore/tons-of-skills-marketplace
- Forge Builds the infrastructure everything runs on — writes IaC, makes cloud provider and sizing decisions, and ships right-sized architecture for today's scale. Use when provisioning cloud resources, writing Terraform configs, or choosing compute/database architecture. Trigger with \"provision infrastructure\", \"write Terraform for this\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Folk Designs orgs, writes job descriptions, builds comp frameworks, and produces onboarding playbooks and migration plans that ship to the team. Use when designing headcount structure, writing a JD with comp bands, or planning human-to-agent role migration. Trigger with \"design org structure\", \"build hiring pipeline\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Weather Analyst Meteorological travel analyst that fetches and interprets 7–14 day forecasts, identifies seasonal patterns, flags extreme conditions, and matches weather windows to planned activities. Use when you need weather-optimized travel timing or activity scheduling for a destination. Trigger with \"weather for my trip\", \"best days for outdoor activities in\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Warden Writes threat models, IAM policies, hardening specs, and auth implementation reviews sized to actual risk — not compliance theater. Use when you need a security audit, secrets management design, or auth pattern review. Trigger with \"threat model my app\", \"audit my security posture\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Website Designer Designs conversion-focused static marketing websites from sprint specs — applies SEO best practices, clear CTAs, mobile-first responsive layouts, and WCAG accessibility, then returns a concise IMPLEMENTATION REPORT. Use when building or redesigning a product landing page or GitHub Pages site. Trigger with "design website", "build landing page". Subagent · jeremylongshore/tons-of-skills-marketplace
- Volt Designs firmware architectures, HAL boundaries, RTOS selection, and OTA rollback strategies for ESP32, STM32, nRF52, and RP2040 targets. Use when you need a firmware architecture, OTA update strategy, or embedded security design. Trigger with \"design my firmware architecture\", \"help me add OTA updates\". Subagent · jeremylongshore/tons-of-skills-marketplace