Behavior-preserving simplification of TypeScript and JavaScript: deletes dead code, single-use abstractions, duplicate helpers, needless indirection and impossible-state branches while features, public behavior, exact types and speed stay unchanged, one checked step at a time. Use to simplify, clean up or de-duplicate TypeScript, or to tidy a branch before review. Not for bug hunting or redesign.
Ships in ts-simplify. 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.
The goal is less code that does exactly the same thing at the same speed or faster. A simplification that changes observable behavior is not a simplification; it is a change that needs its own request.
Apply this skill yourself for a target of one or two files you already have in
context. For a directory, a whole branch diff, or code you have not read yet,
dispatch the ts-simplifier agent from this pack, which binds this skill:
dispatch(agent="ts-simplifier", task="..."). The task names:
<branch> against <base>".verify checks or commands that prove behavior and types
for that target (typecheck, lint, the focused tests), and any benchmark or
bundle-size command if the target sits on a hot path or in the startup import
graph.Review its result before you accept the edits: read the diff with git
(op=diff), and rerun at least one of the checks it claims.
Hold every step to all of these.
any, no new as casts or !
assertions, no widened exported types. Prefer narrowing and satisfies.
Deleting code must not delete a type guarantee callers rely on.code_nav dependents and a search across the
repository, including string-based lookups, re-exports, tests and scripts.Check each of these before calling two forms equivalent.
|| versus ??, and truthiness tests on 0, "", NaN and false.forEach(async ...) versus for ... of with await: concurrency and error
propagation differ.await inside try moves a rejection out of the catch; removing
async turns a rejection back into a synchronous throw.JSON.stringify output and snapshots.export removal, which breaks consumers outside this repository (published
packages, scripts, dynamic imports by string).await import() turned into a static import, which moves a module into the
startup path or the entry chunk.map/filter/reduce or spread copies replacing a loop on a hot path.any, cast or assertion was added.For each step: what was removed or inlined, why it is equivalent, the check that proves it and its result. Then the candidates you declined, each with the behavior it would change or the risk that stopped you. Then lines removed and added overall.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/ts-simplify:ts-simplifyfrom ts-simplify
npx claudepluginhub panstudio/pancode --plugin ts-simplify