Sponsor Suno AI Music arrow_forward
Subagent

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
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

  1. Download weak-type-eliminator.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. 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

  1. 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.
  2. 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

  1. Find explicit any — : any, as any, annotations that weaken the type system
  2. Detect implicit any — missing return types on exported functions, untyped parameters
  3. Replace object/{} — overly broad types that should be specific interfaces
  4. Narrow unknown — unknown that could be a specific union type based on usage
  5. Verify with compiler — every replacement must pass tsc --noEmit before committing
  6. 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 config

Phase 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 -n

Python:

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 specific

Phase 3: Determine Replacement Type

For each weak type, infer the correct replacement:

  1. Read all usages of the variable/parameter/return value
  2. Check what properties are accessed — build an interface from usage
  3. Check what functions receive it — the parameter type of callees reveals the expected type
  4. Check assignments — what values flow into this binding?
  5. 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:

  1. Apply the type change using Edit tool
  2. Run type checker:
   npx tsc --noEmit 2>&1 | tail -20
  1. If clean → confirmed, move to next
  2. 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

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.