/vibe-types:cleanfrom vibe-types
Refactors source files in place using vibe-types catalog and use-case knowledge. Supports TypeScript, Python, Rust, Java, and more. Does not change behavior or public APIs. Invoke with /vibe-clean.
Ships in vibe-types. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Skill root:
${CLAUDE_PLUGIN_ROOT}/skills
Refactor source files by applying every relevant technique from the vibe-types
catalog and use-case library. Work through (knowledge-file × source-file) pairs
sequentially, editing files in place with your native tools.
/vibe-clean --skill <lang> (--file <path> | --dir <path> | --branch <name>) [OPTIONS]
Exactly one of --file, --dir, or --branch must be given.
Either --skill or --skill-dir must be given.
| Flag | Default | Description |
|---|---|---|
--skill <lang> | — | Language: typescript, python, rust, scala3, lean, haskell, ocaml, java, agda, tlaplus |
--skill-dir <path> | — | Override: explicit path to skill directory |
--file <path> | — | Single source file |
--dir <path> | — | All matching files in directory (recursive) |
--branch <name> | — | Files changed on this branch vs. merge-base |
--build <cmd> | none | Shell command to verify after each edit |
--max-retries N | 3 | Fix attempts per build failure |
--commit | false | Commit after each (knowledge × source) pair |
--only T01,UC03,... | all | Process only these knowledge IDs |
--dry-run | false | Print plan without editing |
--consolidate | false | Final coherence pass after all techniques |
--principles <file> | built-in | Custom principles file for consolidation |
--base-branch <name> | main | Base for --branch diff |
--progress <file> | .vibe-clean-progress | Progress tracking file |
typescript → .ts .tsx .mts .cts
python → .py
rust → .rs
scala3 → .scala .sc
lean → .lean
haskell → .hs
ocaml → .ml .mli
java → .java
agda → .agda .lagda .lagda.md .lagda.tex
tlaplus → .tla
SKILL_DIR = ${CLAUDE_PLUGIN_ROOT}/skills/<lang>/ # --skill given
SKILL_DIR = <path> # --skill-dir given
Verify SKILL_DIR exists. If not, list the directories under
${CLAUDE_PLUGIN_ROOT}/skills/ and stop.
.md files under SKILL_DIR/catalog/ and SKILL_DIR/usecases/
(maxdepth 1 each), sorted by basename.00-overview.md.--only is given, keep only files whose basename starts with one of the
provided IDs — e.g. T01 matches T01-algebraic-data-types.md;
UC03 matches UC03-exhaustiveness.md.kid = leading segment before first -; ktitle =
first # heading line.--file: verify the single path exists and matches the language extension.
--dir: run Bash find from the resolved directory, pruning these names:
node_modules dist build target .git __pycache__ .next out coverage .cache .tox .eggs .mypy_cache. Keep only regular files matching the language
extensions. Sort output.
--branch: run git diff --name-only <merge-base> <branch> (where
merge-base = git merge-base <branch> <base-branch>), filter paths to language
extensions, verify each file exists on disk.
--commit or --branch requires a git repository.--dry-run: verify the target git repo has no uncommitted changes
(excluding the progress file). If dirty, stop and ask the user to commit or
stash first.run_start_head = git rev-parse HEAD for prior-diff tracking.If --dry-run: print every planned (knowledge-file, source-file) pair, the
total count, and stop. Make no edits.
Read the progress file at the --progress path. Each line is either
done <kfile> <sfile> or failed <kfile>.
Outer loop — knowledge files (sorted order):
failed <kfile> is in the progress file: log "skipping (previously
failed)" and continue to the next knowledge file.Inner loop — source files (sorted order):
done <kfile> <sfile> is in the progress file: log "skip" and continue.prior_diff — changes already made to this source file during the
current run:
--commit mode: git diff <run_start_head>..HEAD -- <sfile>git diff HEAD -- <sfile>prior_diff is non-empty, treat those changes as settled — do not
revert or contradict them.--build)Run the build command via Bash. If it fails:
for attempt in 1 .. max-retries:
read the build errors
edit <sfile> to fix them (preserve the intent of prior changes)
re-run the build
if build passes → break
If the build still fails after max-retries:
git restore --source=HEAD --worktree -- <sfile>failed <kfile> to the progress file.Append done <kfile> <sfile> to the progress file.
--commit)Stage only the source file for this pair (do not use git add -A — --build
may produce artifacts, lockfile drift, or generated files that must stay out
of the commit; the progress file must also stay unstaged):
git add -- <sfile>
If there are staged changes, commit:
cleanup(<kid>): <ktitle>
Knowledge: <github-blob-url-to-kfile> # if determinable
Source: <relative-path-to-sfile>
--consolidate)For each source file, compute its full diff across the run. If empty (file unchanged), skip.
--principles <file> if given; otherwise use the
built-in text below.--build: verify build; retry up to --max-retries; if still failing,
revert and skip (non-fatal — continue to the next file).--commit: commit as consolidate: <rel-path>.S — Single Responsibility: each type, function, and module has one clear reason to change.
O — Open/Closed: extend through new types or functions; avoid modifying stable abstractions.
L — Liskov Substitution: subtypes must honour the contracts of their interfaces.
I — Interface Segregation: keep interfaces narrow; callers depend only on what they use.
D — Dependency Inversion: high-level modules depend on abstractions, not concrete implementations.
DRY (Don't Repeat Yourself): extract shared logic and types rather than duplicating them.
KISS (Keep It Simple): prefer the simplest correct solution; avoid unnecessary abstraction.
Cohesion: group related types and functions; a module should have a single, clear purpose.
Print:
Knowledge files: N
Source files targeted: N
Pairs attempted: N
Pairs skipped (resuming): N
Build errors fixed: N
Files consolidated: N (only if --consolidate)
Commits created: N (only if --commit)
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
TypeScript, Python, Rust, Java
7 skills in this plugin
/leanvibe-types:leanLean 4 compile-time safety techniques — dependent types, inductive types, type classes, termination checking, propositions as types, proof automation. Use this skill whenever the user writes Lean 4 code, mentions dependent types, asks about theorem proving, discusses inductive types, type classes, tactics (simp, omega, decide), subtypes, termination proofs, or any Lean type system feature. Also use when formalizing invariants, writing proof-carrying code, or porting type patterns from Scala, Rust, or Haskell to Lean./pythonvibe-types:pythonPython type-checking constraint techniques — annotations, Union, Literal, TypedDict, Protocol, generics, TypeGuard, Final, dataclasses. Use this skill whenever the user writes Python with type hints, mentions mypy or pyright, asks about typing module features, discusses Protocol, TypedDict, NewType, dataclasses, Literal, overload, ParamSpec, or any type annotation. Also use when adding types to untyped code or debugging type checker errors./rustvibe-types:rustRust compile-time safety techniques — ownership, borrowing, lifetimes, traits, generics, Send/Sync, const generics. Use this skill whenever the user writes Rust code, mentions ownership or borrowing, asks about lifetime errors, discusses trait bounds, Send/Sync, derive macros, PhantomData, newtype patterns, or any Rust type system feature. Also use when debugging borrow checker errors or porting type patterns from Scala, Python, or Haskell to Rust./scalavibe-types:scalaScala 3 compile-time safety techniques — opaque types, enums/ADTs/GADTs, givens, match types, inline, capture checking. Use this skill whenever the user writes Scala 3 code, mentions type safety, asks about compiler errors, discusses ADTs, opaque types, given instances, context functions, match types, extension methods, or any Scala type system feature. Also use when porting type patterns from Rust, Python, or Haskell to Scala 3./typescriptvibe-types:typescriptTypeScript compile-time safety techniques — discriminated unions/exhaustive narrowing, structural typing, conditional types (keyof, infer, extends), mapped and utility types (Partial/Required/Readonly/Pick/Omit, DeepPartial), template literal types, branded/nominal types, satisfies/const assertions, strictNullChecks/noUncheckedIndexedAccess, generics. Use this skill whenever the user writes TypeScript/TS code; wants to derive static types from validation schemas (Zod z.infer, io-ts, Valibot, TypeBox) to keep schema and types in sync; mentions mapped/utility types (“make every field readonly and optional”), keyof/infer/generic constraints, template literal types, discriminated unions/narrowing or exhaustiveness checks, or asks about tsc/tsserver errors like TS2322/TS2345/TS2559/TS2367; also when porting type-level patterns from Scala, Rust, Python, or Haskell to TypeScript. Do not use for JavaScript runtime code, framework behavior (Node/React), build tooling, performance, or schema parsing/validation runtime concerns./verify-markdown-snippetsVerify every code snippet embedded in a markdown file for syntactic and type correctness, using the language-specific project under `projects/`. Use this skill proactively whenever the user asks to check, verify, validate, lint, or type-check code examples inside markdown — docs, tutorials, PR reviews of documentation changes, skill catalogs, blog posts, README files, anything with fenced code blocks. Also use it when the user is reviewing a pull request that touches markdown files containing code examples, or when they mention wanting to make sure their documentation code is "runnable" or "doesn't lie". The skill produces a per-snippet report (both markdown and JSON) listing exact syntax errors, type errors, and any snippets that lack a language tag.npx claudepluginhub jpablo/vibe-types --plugin vibe-typesOther plugins' skills for the same job