code-simplification
Skill1 starsChanged 21 days agoMITView on GitHub
Reduces complexity without changing observable behavior. Use when code is hard to read, duplicated, over-abstracted, or when a review asks for simplification and the existing tests must stay green.
101 other projects use a version of this.
Adopted by
Most recently taken up by
- dzikrisyairozi/agent-skillstheir own version, first seen Nov 29, 2026
- aakash1552005/universal-agent-skillstheir own version, first seen Nov 29, 2026
- karanmrn/karanagentskillstheir own version, first seen Nov 29, 2026
- karanmrn/kstacktheir own version, first seen Nov 29, 2026
- alexj11324/Mikkatheir own version, first seen Nov 29, 2026
- e-landeros/gauntlettheir own version, first seen Nov 29, 2026
Used with
Projects with it also use performance-optimization, security-ownership-map and 8 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.
barisariburnuSkillperformance-optimization
Complete performance optimization guide for Next.js applications including frontend, backend, database, caching, and general optimization strategies. Use when improving performance, reducing bundle size, optimizing queries, or implementing caching.
Also in 51 projects that use this
OpenAISkillsecurity-ownership-map
Analyze git repositories to build a security ownership topology (people-to-file), compute bus factor and sensitive-code ownership, and export CSV/JSON for graph databases and visualization. Trigger only when the user explicitly wants a security-oriented ownership or bus-factor analysis grounded in git history (for example: orphaned sensitive code, security maintainers, CODEOWNERS reality checks for risk, sensitive hotspots, or ownership clusters). Do not trigger for general maintainer lists or non-security ownership questions.
Also in 3 projects that use this
arkanSkillbreak-ui
Try to break a piece of UI by feeding it worst-case data — long names, unbreakable emails, one-letter names, missing fields, huge counts, zero items, long labels, non-Latin text, emoji, extreme numbers — then render it behind a "Demo data / Worst case" toggle and report everything that broke, with the fix for each. Use when the user asks to stress-test, break, or find edge cases in a component or screen, or to "try the worst case". For visual design critique use emil-design-eng; for motion use review-animations.
Also in 4 projects that use this
AJBcodingSkillsql-optimization-patterns
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.
Also in 3 projects that use this
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
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 4 projects that use this
Other versions101 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 101
- addyosmani/agent-skills★ 121ksame name
- sanity-io/sanity★ 6.4ksame name
- luxury-yacht/app★ 448same name
- shashankswe2020-ux/whoop-mcp★ 181same name
- sammcj/agentic-coding★ 172same name
- HybridAIOne/hybridclaw★ 165same name
- muratgur/ordinus★ 111same name
- alexj11324/Mikka★ 90same name
- aspectly-labs/Mikka★ 90same name
- tranhieutt/software_development_department★ 71same name
91 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 repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- code-review-and-qualitySkill
- constraint-driven-developmentSkill
- debugging-and-error-recoverySkill
- git-workflow-and-versioningSkill
- incremental-implementationSkill
- planning-and-task-breakdownSkill
- shipping-and-launchSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- using-agent-skillsSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 95 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Use this skill when:
- Distinctive: line 40
Do not use it for:
- Distinctive: line 54
Run the relevant suite and record the result.
- Distinctive: line 81
Run the tests after every step, not at the end.
- Distinctive: line 84
When the behavior is not covered, add a characterization test first.
- Distinctive: line 90
Prefer removing a layer to adding one.
- Distinctive: line 93
Ask of every new abstraction: what would make this worth its indirection?
- Distinctive: line 104
Run the full relevant suite, lint, types, and build.
- Distinctive: line 134
No before-and-after evidence is recorded.
“Common” is measured: kept by at least 6 in 10 of the 95 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
Overview
Complexity is a cost paid on every future change. Simplification is the disciplined removal of that cost without changing what the code does. It is not a rewrite, and it is not an opportunity to add the feature you noticed was missing.
The test suite is the boundary. If behavior changes, even in a way that seems like an improvement, this is no longer simplification. It is a behavior change and needs its own spec and red test.
The best simplification usually deletes code. Extraction, renaming, and deduplication are tools, not goals. A new abstraction that is used once has made the code harder, not simpler.
When to Use
Use this skill when:
- A reviewer says the change is hard to follow.
- The same logic appears in three or more places.
- A function is long, deeply nested, or does several unrelated things.
- An abstraction has one caller, or its interface is harder than the code it hides.
- Dead code, commented-out blocks, or feature flags have accumulated.
- You are about to extend code that is already difficult to change.
Do not use it for:
- Code you do not understand yet. Read it and add a characterization test first.
- A module with no tests that you cannot test cheaply. Build the safety net before the refactor.
- A rewrite of the architecture disguised as cleanup.
Related: use the test-driven-development skill to build the safety net, and
the code-review-and-quality skill to review the result.
Core Process
1. Establish a green baseline
Run the relevant suite and record the result. If it is already red, stop: you cannot distinguish your regressions from the baseline. Fix or scope the baseline first.
2. Name the complexity
Be specific. "It is messy" is not actionable. Identify the move:
| Smell | Candidate move |
| Long function with mixed levels of detail | Extract one behavior per function |
| Deep nesting | Early returns or guard clauses |
| Repeated conditionals | A lookup table or a named predicate |
| Duplicated logic | Extract once, then call it |
| One-use abstraction | Inline it |
| Misleading name | Rename it |
| Dead or commented-out code | Delete it |
| Boolean parameter that changes behavior | Split into two functions |
| Mutable shared state | Pass the value or return a new one |
3. Choose the smallest transformation
One move at a time. Do not rename, extract, and change the algorithm in the same step. Each step should be easy to review and easy to revert.
4. Refactor under green
Run the tests after every step, not at the end. If a test fails, you changed behavior; revert the step and split it.
When the behavior is not covered, add a characterization test first. It does not need to assert that the current behavior is correct, only that it is the behavior you are preserving.
5. Delete rather than add
Prefer removing a layer to adding one. A helper used once is usually noise. A config option with one value is a decision waiting to be wrong.
Ask of every new abstraction: what would make this worth its indirection? If the answer is speculative, do not add it.
6. Stop when clarity improves
Simplification has diminishing returns and a real risk of churn. When a reviewer can follow the code without explanation and the diff is small, stop. Do not reformat unrelated files.
7. Verify and report
Run the full relevant suite, lint, types, and build. Report what was removed, what was renamed, and confirm that observable behavior is unchanged.
Exit condition: the code is measurably simpler, the suite is green, and the diff contains no behavior change.
Common Rationalizations
| Rationalization | Why it is wrong | Required action |
| "I will rewrite it properly." | A rewrite changes behavior and destroys reviewability. | Refactor in small, tested steps. |
| "It works; do not touch it." | Working code can still be too expensive to change safely. | Simplify only where it reduces a named cost. |
| "More abstraction is cleaner." | Abstraction has a cost and is only worth it when it removes duplication or hides a real detail. | Add an abstraction when there is a second caller or a genuine boundary. |
| "The tests will catch any change." | Tests catch covered behavior, not everything. | Add characterization tests at the boundary first. |
| "I will simplify and fix the bug at once." | Two changes in one diff make both unverifiable. | Land the behavior change first, then simplify. |
| "I will reformat the file while I am here." | Formatting noise hides the real change. | Keep formatting in a separate commit. |
| "Fewer lines always means simpler." | Dense one-liners can be harder to read. | Optimize for comprehension, not line count. |
| "I understand it well enough." | Understanding without a test is a guess about preserved behavior. | Prove it with the suite before and after. |
Red Flags
- The diff changes behavior as well as structure.
- Tests were added after the refactor, not before.
- The change touches files unrelated to the named complexity.
- A new abstraction has one caller.
- A public interface changed without a compatibility plan.
- The baseline suite was red before the work started.
- Formatting or renames dominate the diff.
- The refactor is large enough that it cannot be reviewed in one sitting.
- The code is shorter but harder to follow.
- No before-and-after evidence is recorded.
Verification
- The complexity being removed is named and specific.
- The baseline suite was green and its result recorded.
- Characterization tests cover behavior that was untested.
- Each step changed one thing.
- The suite stayed green after every step.
- No observable behavior changed.
- No new abstraction has a single caller.
- Dead code, debug output, and commented-out blocks were removed.
- The full relevant suite, lint, types, and build pass.
- The diff contains no unrelated formatting or renames.
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.

