code-simplification
Skill3 starsChanged 6 months agoMITView on GitHub
Reduce code without changing behavior. Apply Chesterton's Fence (don't remove what you don't understand) and the Rule of 500 (files over 500 lines usually need splitting). Use when the user says "simplify this", "clean up", "remove dead code", "tighten", or invokes /simplify. Composes polish (review-fix loop) and blunder-hunt (regression risk).
46 other projects use a version of this.
Adopted by
Most recently taken up by
- GuillemRoca/agent-skills-androidtheir own version, first seen Oct 3, 2026
- addyosmani/agent-skillstheir own version, first seen Oct 3, 2026
- weisser-dev/agentic-skillstheir own version, first seen Oct 3, 2026
- JPeetz/agent-skillstheir own version, first seen Sep 29, 2026
- iuliandita/skillstheir own version, first seen Sep 24, 2026
- ZeroTokenClaw/agents-skillstheir own version, first seen Sep 21, 2026
Used with
Projects with it also use constraint-driven-development, observability-and-instrumentation and 10 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.
vinvcnSkillconstraint-driven-development
把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。
Also in 4 projects that use this
borhen68Skillobservability-and-instrumentation
Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.
Also in 13 projects that use this
mycelium-hqSkilldoubt-driven-development
Use when correctness matters more than speed: about to commit non-trivial code, make an architectural call under uncertainty, work in unfamiliar code, or assert what the compiler cannot check (''this is safe'', ''thread-safe'', ''this scales'', ''matches the spec''). Strongest on high-stakes surfaces (production deploys, security-sensitive logic, data migrations, irreversible operations) and when the user asks to sanity-check, red-team, double-check, or get a second opinion on a decision.
Also in 19 projects that use this
galandoSkillsource-driven-development
Version-aware, source-driven development — fetch official docs before writing framework code
Also in 23 projects that use this
luischanciSkillinterview-me
Interactive interview to formalize a research idea into a structured specification with hypotheses and empirical strategy.
Also in 16 projects that use this
Jonathan0823Skillminimalist-ui
Clean editorial-style interfaces. Warm monochrome palette, typographic contrast, flat bento grids, muted pastels. No gradients, no heavy shadows.
Also in 4 projects that use this
Other versions46 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 46
- addyosmani/agent-skills★ 101ksame name
- shashankswe2020-ux/whoop-mcp★ 165same name
- HybridAIOne/hybridclaw★ 157same name
- muratgur/ordinus★ 109same name
- thiientv/godmode★ 96same name
- tranhieutt/software_development_department★ 72same name
- lgbarn/shipyard★ 66same name
- c-kick/hnl-agent-skills★ 51same name
- az9713/addyosmani-agent-skills★ 38same name
- vinvcn/addyosmani-agent-skills-zh★ 38same name
36 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 repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- dcgSkill
- editorial-reviewSkill
- journalSkill
- readme-updateSkill
- security-and-hardeningSkill
- session-retroSkill
- autopilotSkill
- blunder-huntSkill
- brainstormSkill
- convergence-detectSkill
- deslopSkill
- dispatch-parallelSkill
- doc-reviewSkill
- dreamSkill
- incremental-implementationSkill
- planning-and-task-breakdownSkill
- polishSkill
- pr-reviewSkill
- refactor-planSkill
- scope-checkSkill
- security-auditSkill
- spec-driven-developmentSkill
- unstuckSkill
- verification-before-completionSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 45 edited versions we read keep these.
6
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 28
If you can't answer all three, DO NOT remove it.
- Distinctive: line 40
If a single file exceeds 500 LOC:
- Distinctive: line 50
No public API change (or if there is one, it's marked breaking)
- Distinctive: line 53
If the diff exceeds 500 LOC, you've gone too far — split the simplification into multiple PRs.
- Very specific: line 67
Run polish on the simplification PR.
- Distinctive: line 81
Never delete what you don't understand: Read the commit history first.
- Distinctive: line 82
Behavior-preserving means tests pass: If your "simplification" changes behavior, it's a refactor — different skill.
“Common” is measured: kept by at least 6 in 10 of the 45 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
addyosmani/agent-skillsunder the MIT License. Copyright (c) Addy Osmani. Modifications by kaijutsu maintainers — composed withpolishandblunder-hunt.
Goal: smaller code, same behavior. The deliverable is a diff that reduces LOC, removes abstractions that earn nothing, and consolidates near-duplicates.
When to invoke
- A file is over 500 lines
- A module's surface has more functions than it has callers per function
- Duplicate logic spotted in 2+ places
- User says "this feels overengineered" or "clean this up"
Process
Step 1: Read before deleting (Chesterton's Fence)
For every candidate removal, ask:
- Why is this here? Find the original commit (
git log -p <file>) and read the message. - Who calls it?
grep -r '<symbol>'or use LSP find-references. - What test covers it?
If you can't answer all three, DO NOT remove it. The fence exists for a reason; first understand the reason, then decide.
Step 2: Find candidates
- Dead code: unreferenced exports, unreachable branches, unused imports
- Duplicate logic: 2+ functions doing the same thing with minor variations
- Premature abstraction: a base class / generic with one concrete subclass / instance
- Leaky helper: a util that exposes implementation details its only caller could inline
- File-over-500: split by cohesion (related functions stay together; orthogonal concerns split out)
Step 3: Apply Rule of 500
If a single file exceeds 500 LOC:
- Identify cohesion clusters within the file
- Split into 2-3 files of <500 LOC each
- Move tests with their code
- Verify imports compile
Step 4: Behavior-preservation gate
After every change:
- Tests still pass
- No public API change (or if there is one, it's marked breaking)
- Diff is reviewable in <10 minutes
If the diff exceeds 500 LOC, you've gone too far — split the simplification into multiple PRs.
Step 5: Compose blunder-hunt for regression risk
Invoke blunder-hunt with a "what might I have broken" lens specifically:
- Caller signatures unchanged?
- Error semantics preserved?
- Concurrency invariants intact?
- Public APIs (HTTP routes, exported types, library entry points) unchanged?
Findings become test additions or revert candidates.
Step 6: Compose polish
Run polish on the simplification PR. Polish's review-fix loop catches the small breakages introduced during the cleanup.
Anti-rationalization table
| Excuse | Rebuttal |
| "Nobody uses this anymore" | Verify with grep + reverse-deps. Internal repo + public API + dynamic call sites all count. |
| "This is dead code" | If it has a test, the test wouldn't be passing if the code were truly dead. Read the test first. |
| "This abstraction is over-engineered" | Maybe. Or maybe a future caller is planned. Check the git blame; check the issues tracker. |
| "I'll DRY this up" | DAMP > DRY. Tests benefit from descriptiveness over de-duplication. Check each candidate for actual cost-of-duplication vs cost-of-abstraction. |
| "The file is too big" | Length isn't always the right metric — cohesion is. A 600-LOC file with one focused concern beats two 300-LOC files with split-brain logic. |
Hard rules
- Never delete what you don't understand. Read the commit history first.
- Behavior-preserving means tests pass. If your "simplification" changes behavior, it's a refactor — different skill.
- Public APIs are sacred unless the user explicitly requested a breaking change.
- One simplification per PR. Multiple unrelated cleanups in one PR = unreviewable.
- Compose
blunder-huntANDpolishbefore declaring done.
Composes
polish— review-and-fix loop after the simplificationblunder-hunt— regression-risk lens
When NOT to use
- Code you've never read before in a domain you don't understand (read first, simplify later)
- Code under active feature development (wait until the feature lands)
- Code with no tests (write tests first, then simplify)
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.

