code-simplification
Skill1 starsChanged 2 months agoMITView on GitHub
Cut a diff's complexity without moving behaviour — deep nesting, dead code, duplication, one-caller abstractions, generic names — one change per finding, one verdict, nothing edited. Reach for it code-cold when a slice is green but reads heavy. Five-axis defect hunting is `code-review`; vulnerabilities are `security-and-hardening`.
83 other projects use a version of this.
Adopted by
Most recently taken up by
- ishandutta2007/Awesome-Agent-Skillstheir own version, first seen Nov 8, 2026
- dmoreq/agent-grimoiretheir own version, first seen Nov 8, 2026
- Mehul72/skillstheir own version, first seen Nov 8, 2026
- Anish59312/skillstheir own version, first seen Nov 8, 2026
- MMACABRE/SKILLStheir own version, first seen Nov 8, 2026
- gopalparashar421/agent-skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use constraint-driven-development, architecture-decision-records and 7 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MrCipherSmithSkillconstraint-driven-development
Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.
Also in 16 projects that use this
GSA-TTSSkillarchitecture-decision-records
Load when a user wants architecture decision records (ADRs) drafted from requirements or a design discussion, asks which decisions need an ADR, or wants an ADR draft reviewed for one-sided trade-offs, weak alternatives or missing requirement links. Not for setting up a project's whole documentation system (project-documentation-system).
Also in 4 projects that use this
OpenAISkillsecurity-best-practices
Perform language and framework specific security best-practice reviews and suggest improvements. Trigger only when the user explicitly requests security best practices guidance, a security review/report, or secure-by-default coding help. Trigger only for supported languages (python, javascript/typescript, go). Do not trigger for general code review, debugging, or non-security tasks.
Also in 3 projects that use this
GitHubSkillconventional-commit
Prompt and workflow for generating conventional commit messages using a structured XML format. Guides users to create standardized, descriptive commit messages in line with the Conventional Commits specification, including instructions, examples, and validation.
Also in 3 projects that use this
silvainfmSkillmarketing-ideas
When the user needs marketing ideas, inspiration, or strategies for their SaaS or software product. Also use when the user asks for 'marketing ideas,' 'growth ideas,' 'how to market,' 'marketing strategies,' 'marketing tactics,' 'ways to promote,' or 'ideas to grow.' This skill provides 140 proven marketing approaches organized by category.
Also in 4 projects that use this
IgorGanapolskySkillgraphify
Query the local Graphify-Labs AST knowledge graph for ThumbGate architecture questions (what connects X to Y, explain a symbol, PreToolUse/gates/adapters). Slash: /graphify.
Also in 5 projects that use this
Other versions83 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 83
- addyosmani/agent-skills★ 114ksame name
- sanity-io/sanity★ 6.4ksame name
- luxury-yacht/app★ 446same name
- shashankswe2020-ux/whoop-mcp★ 174same name
- sammcj/agentic-coding★ 169same name
- HybridAIOne/hybridclaw★ 159same name
- muratgur/ordinus★ 111same name
- tranhieutt/software_development_department★ 71same name
- lgbarn/shipyard★ 66same name
- c-kick/hnl-agent-skills★ 56same name
73 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- acceptance-criteriaSkill
- aim-higherSkill
- api-designSkill
- architecture-designSkill
- browser-testing-with-devtoolsSkill
- ci-cdSkill
- codebase-designSkill
- codebase-researchSkill
- code-reviewSkill
- comprehension-quizSkill
- debugging-and-error-recoverySkill
- deprecation-and-migrationSkill
- documentation-and-adrsSkill
- doubt-driven-developmentSkill
- environment-manifestSkill
- gauntlet-loopSkill
- git-workflowSkill
- handoffSkill
- idea-refineSkill
- incremental-implementationSkill
- interview-meSkill
- literate-explainerSkill
- observability-and-instrumentationSkill
- orchestratorSkill
- performance-optimizationSkill
- plan-breakdownSkill
- preflight-readinessSkill
- project-setupSkill
- pull-requestSkill
- quality-verificationSkill
- security-and-hardeningSkill
- shipping-and-launchSkill
- source-driven-developmentSkill
- spec-grillingSkill
- spec-reviewSkill
- test-driven-developmentSkill
- to-prdSkill
- using-agent-skillsSkill
- worktreeSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 77 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Read a slice's diff for what carries more weight than it has to, and return a ranked findings list and one verdict.
- Very specific: line 25
Not this: defects across five axes — code-review.
“Common” is measured: kept by at least 6 in 10 of the 77 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code simplification
Adapted from the Claude Code Simplifier plugin, rewritten here as a model-agnostic process.
Purpose
Stage: Review. Principles 1, 6, 7, 8.
Read a slice's diff for what carries more weight than it has to, and return a ranked findings list and one verdict. It edits nothing: sibling axes are mid-read in those same files, and a checker that rewrites what it graded has stopped being a checker.
When to use / when to skip
- A slice is verify-green and its pull request opens next; the Review fan-out dispatches you code-cold
beside
code-review,security-and-hardeningandperformance-optimization(references/safety-rails.md, Code-cold dispatch). - Working code reads heavier than it should — a long function, copy-paste, a wrapper that only forwards, two spellings of one rule after a rushed merge.
- Not this: defects across five axes —
code-review. Secrets, OWASP, dependencies —security-and-hardening. A profiled hot path —performance-optimization. A seam before the code exists —codebase-design. - Skip code you cannot yet explain, code about to be rewritten wholesale, and a hot path where the plainer version measurably costs more. Clean code needs no pass; returning nothing is a result.
Inputs
On a code-cold pass nobody is present, so derive what is absent and name it in the findings; with a person there, ask at most three questions, only where the gap changes the shape of the pass.
- the diff — helps: the material in scope, and its edge is where scope ends · without it: read
git diff <base>..HEADor the working tree and name the range,derived. An empty range is apass. - the slice's row in
docs/features/<slug>/plan.md— helps: itsRegression surface, the file set a finding may land in · without it: bound the findings by the diff's own paths,derived. - the changed files' tests, passing — helps: the oracle that makes a finding safe to take · without
them, or with them red: mark which findings rest on reading alone,
derived. CLAUDE.md,CONTEXT.md, the neighbouring code — helps: the house style a finding converges on, so the report is this codebase's taste and not yours · without them: read the files around the diff,derived.
The simplification process
- Understand a candidate before cutting it — its responsibility, callers and callees, edge and
error paths, the tests that pin it, what
git blamesays. Read further where an answer is missing (Chesterton's Fence: an odd branch is often a platform workaround, and cutting it ships a regression under a cleanup's name). - Preserve behaviour exactly — same output per input, same errors at the same points, same side effects in the same order. Drop a candidate you cannot say that about, and never trade error handling away for tidiness.
Scan the changed lines for the concrete signals, not for a feeling — and leave untouched code alone, since a drive-by refactor is diff noise and unowned regression risk.
Axis The signal, and the shape it wants Structure nesting three deep, or a function past ~50 lines → guard clauses and focused functions · nested ternaries → if/else, a switch, a lookup · a boolean flag parameter → an options object, or two functions · one conditional repeated across call sites → a named predicate Naming data,tmp,val→ a name for the content ·usr,cfg,evt→ full words, keepingid,url,api· agetthat also mutates → a name that admits the write · a comment restating the line under it → deleted, and every "why" comment keptRedundancy the same five-plus lines twice → one shared function · unreachable branches, unused variables, commented-out blocks → deleted once confirmed dead · a forwarding wrapper, or a factory for one product → the direct call · a cast to an already-inferred type → nothing - Prefer the explicit version wherever the compact one costs the reader a pause — if/else over a nested ternary, a named intermediate over a chained reduce. Watch the far end too: inlining a helper that named a concept, merging two simple functions into one complex one, cutting an abstraction that exists for testability. Comprehension, not line count, is the goal.
- Write the proposed version out and hold it against the original. Drop it where it reads or reviews worse, or imports a pattern this codebase does not use — a dropped attempt costs nobody, a reported one costs a round.
- Give each finding exactly one change:
path:line, the before, an after that leaves no unused import or unreachable branch behind, the tests that pin the behaviour, and what the reader gains — never a line count, never four rewrites bundled as "clean this up", since the implementer runs the suite against one change and needs to know which one broke it. Say that the refactor lands apart from feature or bug-fix work, and recommend a codemod over hand edits where it would touch more than ~500 lines. - Name what a finding would move. Nothing here is frozen, so one wanting a test rewritten, an
assertion re-shaped or a file outside the surface touched is still legitimate — report what it moves
and the disclosure the pull request owes (
pull-request). - Rank structural first, cosmetic last, and return one verdict —
pass · concerns · block:passwhere every finding is taste the author may ignore (code-review'sOptional:/Nit:band),concernswhere one should be taken before merge,blockfor a stop-list item alone (references/safety-rails.md), a secret read in passing being the likeliest.
Rationalizations
| The excuse | The reality |
| "Fewer lines is simpler." | A one-line nested ternary parses slower than a five-line if/else. |
| "The original author had a reason." | git blame says whether they did; accumulated complexity often has none. |
| "This abstraction might be useful later." | One caller is not a pattern — it is complexity carried without payment. |
| "I'll tidy the neighbouring file too." | It belongs to a slice nobody is reviewing, and its regression lands unowned. |
| "This one is small enough to just apply." | A sibling axis is mid-read in that file, and the fix is the implementer's. |
Red flags
- A finding with no
path:line, or one outside what the diff changed. - A proposed "after" longer and harder to follow than the before.
- Renaming toward personal taste rather than the conventions around the file.
- Error handling gone in the name of cleanliness.
- Several rewrites bundled into one "clean this up" item.
- A working-tree edit made after this pass began.
Verification
- Every finding cites a
path:lineinside the changed files, carries one change with its before and its after, and names the tests pinning the behaviour — or says it rests on reading alone. - Every finding preserves behaviour exactly, or names what it moves and the disclosure the pull request owes.
- Proposals reading worse than the original were dropped rather than reported.
- The list runs structural first, cosmetic last, and the derived inputs are named.
- The verdict is one of
pass · concerns · block,blocka stop-list item alone. - Code and tests are byte-identical to what arrived.
Outputs & handoff
Writes nothing, so there is no cap to measure. The findings and the verdict come back in conversation
under ## Findings and ## Verdict, structural first, for the Review fan-out to merge with the sibling
axes' lists. No code and no test is edited, the ones a finding names included — the implementer applies
the fix on the route-back. No board row, no gate flip: the caller owns the transition
(state-schema.md).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

