cleanup-types

Installation
SKILL.md

Find type definitions that should be shared but are duplicated across files. Consolidate into a single source of truth. Conservative by default — type consolidation looks safe but can hide intentional divergence.

Preflight

  1. Language detect: TS/JS (primary), Python (dataclass, TypedDict, Pydantic), Go (struct), Rust (struct/enum).
  2. Git state: refuse auto-apply on dirty tree.
  3. Report dir: ensure exists.
  4. Identify type homes: where does the project already keep shared types? Look for types/, models/, schema/, package boundaries (e.g., monorepos often colocate DB types under packages/db/src/schema/).

Detect

No off-the-shelf tool reliably finds semantically equivalent types across languages. Use AST scanning + grep + structural comparison.

TypeScript

# Find every `interface Foo` and `type Foo =` declaration
# Group by name, then by structural shape
grep -rn --include="*.ts" --include="*.tsx" -E "^export (interface|type) [A-Z]" . > /tmp/ts-types.txt
Installs
2
GitHub Stars
78
First Seen
2 days ago
cleanup-types — raintree-technology/claude-starter