Skip to content
Agentmart
Submit a tool

type-cleanup

Fix type issues by updating type definitions to match code, not vice versa.

Skill by justinfleek

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/justinfleek-type-cleanup

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Fix type issues by updating type definitions to match code, not vice versa. Use when working with types, type systems, typing, or fixing type errors.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/type-cleanup

What's inside

Skill name
type-cleanup
Description
Fix type issues by updating type definitions to match code, not vice versa. Use when working with types, type systems, typing, or fixing type errors.
License
MIT
Compatibility
opencode
Instructions
46 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Type Cleanup Skill

## When to Use
Fixing `any`, `as any`, `as unknown as`, type assertions

## CRITICAL RULE
**CODE IS TRUTH. TYPES DESCRIBE CODE.**

## Process

### Step 1: Audit the Pattern
```bash
grep -rn "as unknown as" src/ --include="*.ts" | grep -v node_modules
```
Get the FULL list. Don't fix one file.

### Step 2: Categorize
- INPUT BOUNDARY (file import, API response, user input) → Use validation.ts
- NUMERIC CODE (math, interpolation, physics) → Use numericSafety.ts
- INTERNAL (store access, component props) → Use typeGuards.ts

### Step 3: For Each Instance
1. Read the FULL file
2. Understand WHY the assertion exists
3. Trace the data flow
4. Fix the TYPE DEFINITION to match actual usage
5. The assertion becomes unnecessary

### Step 4: Verify
- TypeScript compiles
- Tests pass
- No properties were deleted
- No functionality changed

## NEVER DO
- Delete properties to match types
- Change code behavior to satisfy TypeScript
- Use `as any` to "fix" a type error
- Fix one file and move on

## ALWAYS DO
- Update interface/type definitions
- Add missing properties to types
- Expand union types to cover actual usage

From justinfleek/ComfyUI-Lattice-Compositor, MIT.

More from justinfleek/ComfyUI-Lattice-Compositor

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Feb 7, 2026 (8 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from justinfleek

Cite this page

type-cleanup skill. Agent Mart. https://agentmart.dev/skills/justinfleek-type-cleanup (last updated 2026-10-24)