code-simplification
Skill4 starsChanged 3 months agoMITView on GitHub
Simplify application code for clarity without changing behavior — refactor after tests pass, reduce nesting and duplication, match project conventions. Load when refactoring for readability, cleaning up after a feature ships, or when code review flags complexity. Also triggers on "simplify this code", "code simplification", "make this easier to read", "reduce complexity", "refactor for clarity". Not for compress/split/prune-skill (skill-library files). Pairs with technical-debt-audit.
84 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 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.
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
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
Also in 3 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
Other versions84 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 84
- 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
74 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 repository125 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/agent-loom-routing.mdcCursor rule
- .cursor/rules/agent-loom-skills-index.mdcCursor rule
- adversarial-hatSkill
- agent-builderSkill
- agent-launcherSkill
- agent-loom-syncSkill
- agent-observabilitySkill
- agent-run-retroSkill
- agent-system-architectureSkill
- api-and-interface-designSkill
- api-deprecation-and-migrationSkill
- apply-paper-to-projectSkill
- app-security-hardeningSkill
- architectural-decision-logSkill
- assumption-mappingSkill
- brainstormingSkill
- browser-testing-with-devtoolsSkill
- business-modelingSkill
- ci-cd-and-automationSkill
- codebase-understandingSkill
- code-review-crspSkill
- compress-skillSkill
- context-engineeringSkill
- create-agent-promptSkill
- cross-link-skillsSkill
- customer-discoverySkill
- debug-and-fixSkill
- deep-thinkingSkill
- dependency-mappingSkill
- deploy-anywhereSkill
- deprecate-skillSkill
- design-directionSkill
- design-reviewSkill
- design-systemSkill
- dynamic-routingSkill
- eval-judgeSkill
- eval-outputSkill
- eval-pipelineSkill
- eval-rubric-designSkill
- experimentationSkill
- experiment-backlogSkill
- experiment-readoutSkill
- experiment-runbookSkill
- experiment-specSkill
- fault-localizeSkill
- feature-specSkill
- fermiSkill
- first-principlesSkill
- frontend-designSkill
- generate-changelogSkill
- git-workflow-and-versioningSkill
- gsap-animationSkill
- harness-engineeringSkill
- harness-evolutionSkill
- harness-generationSkill
- idea-evaluationSkill
- idea-generationSkill
- implementation-planSkill
- improve-skillsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 9 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 78 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Never change observable behavior — same inputs, outputs, errors, side effects, ordering.
- Distinctive: line 30
Run tests after each simplification.
- Distinctive: line 31
Default scope: code touched in the current task — no drive-by refactors unless asked.
- Distinctive: line 33
Do not simplify code you do not understand — read callers, tests, and blame first.
- Very specific: line 43
If simplifying code with annotated simplify-ignore blocks, register hooks from hooks/SIMPLIFY-IGNORE.md before reads/edits.
- Distinctive: line 47
Before changing anything, answer:
- Distinctive: line 51
Do tests define expected behavior?
- Distinctive: line 54
If you cannot answer, read more context — do not simplify yet.
- Distinctive: line 70
If "simplified" code is harder to read, revert.
- Very specific: line 124
Read tests + callers. Extract guard clauses (one commit, tests green).
- Distinctive: line 158
No changes — citation audit passed.
“Common” is measured: kept by at least 6 in 10 of the 78 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
You reduce application-code complexity while preserving exact behavior. Goal: faster comprehension for the next reader — not fewer lines for its own sake.
Hard Rules
Never change observable behavior — same inputs, outputs, errors, side effects, ordering. Run tests after each simplification; revert if tests fail or need changing to pass. Default scope: code touched in the current task — no drive-by refactors unless asked. Separate refactoring commits from feature/bugfix commits. Do not simplify code you do not understand — read callers, tests, and blame first.
500 lines touched → prefer codemods/AST tools over manual edits. Protected blocks (
simplify-ignore-start/end) must stay hidden — wirehooks/simplify-ignore.shin Claude Code or readreferences/simplify-ignore.md.
Workflow
Step 0 — Optional: protect hot paths (Claude Code)
If simplifying code with annotated simplify-ignore blocks, register hooks from hooks/SIMPLIFY-IGNORE.md before reads/edits. Crash recovery: echo '{}' | bash hooks/simplify-ignore.sh.
Step 1 — Understand (Chesterton's Fence)
Before changing anything, answer:
- What is this code's responsibility? Who calls it?
- What edge cases and error paths exist?
- Do tests define expected behavior?
- Why might it look this way? (performance, platform, history)
If you cannot answer, read more context — do not simplify yet.
Step 2 — Identify opportunities
Scan for structural complexity, naming issues, redundancy — see references/simplification-patterns.md for the signal table.
Step 3 — Apply incrementally
For each change: edit → run test suite → commit or continue. One simplification per commit when possible.
Step 4 — Verify the whole
- Is the result genuinely easier to understand?
- Consistent with project conventions (AGENTS.md, neighboring files)?
- Diff reviewable with no unrelated changes?
- If "simplified" code is harder to read, revert.
When NOT to use
- Code already clear — don't simplify for sport
- Performance-critical path where simpler code is measurably slower
- About to delete/rewrite the module entirely
- Skill-library SKILL.md files — use
compress-skill/split-skillinstead
Gotchas
- Simplification that requires test changes usually changed behavior.
- Inlining a well-named helper hurts readability.
- Fewer lines ≠ simpler (nested ternaries prove this).
- Mixed refactor + feature PRs are hard to review and revert.
Common Rationalizations
| Excuse | Reality |
| "It works, don't touch it" | Hard-to-read working code is expensive on every future fix. |
| "Fewer lines is always simpler" | Comprehension speed matters, not line count. |
| "I'll simplify unrelated code too" | Unscoped diffs risk regressions outside the task. |
| "Types make it self-documenting" | Types show structure; names show intent. |
| "Refactor while adding the feature" | Split PRs — mixed changes hide bugs. |
Output Format
## Code simplification — [scope]
Before: [brief complexity summary]
Changes: [numbered list]
Tests: [command] → [pass/fail]
Commits: [advised messages]
Reverted: [any attempts that failed verification]Examples
<examples>
<example>
<input>This handler has four levels of nesting after the feature landed; tests pass.</input>
<output>
Read tests + callers. Extract guard clauses (one commit, tests green). Rename `data` → `orderPayload` (second commit). Stop — out of scope for unrelated modules.
</output>
</example>
</examples>Verification
- All existing tests pass without modification
- Build/lint clean; no new warnings
- Each change is incremental and reviewable
- Scope limited to task-related files (unless user broadened)
- No error handling removed or weakened
- Simplified code matches project conventions
Red Flags
- Simplification required test changes that alter behavior
- Well-named helper inlined for fewer lines only
- Nested ternaries introduced to reduce line count
- Refactor bundled unrelated behavior changes
Reference Files
references/simplification-patterns.md: Pattern signal table — read at Step 2.references/simplify-ignore.md: Block protection hooks + annotation syntax — read when code hassimplify-ignoremarkers.hooks/SIMPLIFY-IGNORE.md: Full setup, examples, limitations (repo root).
Prune Log
Last pruned: 2026-07-04
- No changes — citation audit passed; content current (improve-skills full pass 2026-07-04)
Impact Report
Scope: [files] | Simplifications: N | Tests: [pass/fail]
Reverts: N | Separate refactor commit: [yes/no]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.

