code-simplification
Skill1 starsChanged 30 days agoMITView on GitHub
Simplifies code for clarity without changing behavior. Runs before a PR over the branch's changes, or on request. Use when code works but is harder to read, maintain or extend than it should be.
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, performance-optimization and 9 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
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 47 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
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 repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-and-interface-designSkill
- browser-testing-with-devtoolsSkill
- buildSkill
- code-review-and-qualitySkill
- debugging-and-error-recoverySkill
- deploySkill
- design-motion-principlesSkill
- exploreSkill
- flow-documentSkill
- front-end-designSkill
- frontend-ui-engineeringSkill
- incremental-implementationSkill
- observability-and-instrumentationSkill
- planSkill
- playwright-cliSkill
- publishSkill
- pushSkill
- security-and-hardeningSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 77 edited versions we read keep these.
5
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
- Very specific: line 8
Project rules first: If the project has .agents/rules/ (installed with the SaaS playbook), read .agents/rules/git.md and …
- Distinctive: line 19
On request: when the user asks, or acts on a review recommendation.
- Distinctive: line 21
Don't simplify code that is already clean, code you don't yet understand, performance-critical code where the simpler version is measurably …
- Distinctive: line 25
Scope: only code changed on the branch.
- Distinctive: line 38
Follow project conventions,: not your preferences. Read agent instructions, rules and linter config.
- Distinctive: line 40
Don't over-simplify: don't inline a helper that names a concept, merge unrelated functions, remove the wrapper tests fake around an outside …
“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
<!-- Adapted from addyosmani/agent-skills@1401c8b (MIT, see licenses/). Changes: a short pass before each PR, separate steps/commits instead of separate PRs, project conventions, language-agnostic examples, trimmed; layered: general guidance here, playbook decisions in .agents/rules/. -->Project rules first. If the project has .agents/rules/ (installed with the SaaS playbook), read .agents/rules/git.md and .agents/rules/repo-structure.md and follow them: they override this skill where they differ. Without them, follow this skill as written.
Code Simplification
Inspired by the Claude Code Simplifier plugin.
Make code easier to read, change and debug while keeping its behaviour exactly the same. The goal is faster comprehension, not fewer lines. Test for each change: would someone new understand it faster than the original?
When it runs
- Before a PR: a short pass over code changed on the branch (
git diff <base>...HEAD), before tests and review (in the playbook, step 1 of the pre-PR check). - On request: when the user asks, or acts on a review recommendation.
Don't simplify code that is already clean, code you don't yet understand, performance-critical code where the simpler version is measurably slower, or code outside the branch's changes unless asked.
Before a PR
- Scope: only code changed on the branch. Never tests, generated code (e.g. the OpenAPI client), migrations already applied anywhere, or config.
- One simplification at a time, running the relevant tests after each.
- Commit what passes separately from other work, e.g.
Simplify <area>(one per area, or one for a small pass). - If a test fails, revert that simplification and move on. Simplification never blocks the PR.
- Keep it short: a few minutes, never longer than the reviews. Only obvious, high-value changes. Judgement calls (restructuring UI data flow, splitting a module, changing a public interface) go in the report as suggestions, not applied.
- Run the full suite, build and linter afterwards: all pass, no new warnings, tests unmodified.
- Report what was simplified (commits) and what was reverted or only suggested.
Rules
- Preserve behaviour exactly: same output for every input (including empty, null, zero), same errors, same side effects and ordering. If unsure, don't.
- If a test needs changing, you changed behaviour. Revert.
- Never remove or weaken error handling to make code look cleaner.
- Follow project conventions, not your preferences. Read agent instructions, rules and linter config; copy how neighbouring code handles imports, function style, naming, errors and type annotations. Don't rename things to suit your taste.
- Clarity over cleverness. A compact expression that needs a mental pause loses to explicit code.
- Don't over-simplify: don't inline a helper that names a concept, merge unrelated functions, remove the wrapper tests fake around an outside service, or chase line count.
- Remove speculative abstractions that nothing uses now.
- Leave no dead code behind (unused imports, unreachable branches).
- Keep refactoring separate from feature or bug-fix work: separate steps and commits. The diff contains only simplifications.
- Rule of 500: a refactor touching more than 500 lines uses automation (codemods, AST transforms, scripted replacements) and is its own piece of work (its own plan), not part of a pre-PR pass.
Process
- Understand first (Chesterton's Fence). Know the code's responsibility, its callers and callees, edge cases and error paths, the tests that define it, and why it was written this way (check git blame and the plan or issue). If you can't answer these, read more.
- Find opportunities:
- Nesting 3+ levels → guard clauses or helpers.
- Functions 50+ lines with several jobs → split into named functions.
- Nested ternaries → if/else, switch/match, or a lookup table.
- Boolean flag params (
do_thing(true, false)) → named options or separate functions. - Same check in several places → a named predicate.
- Same 5+ lines in several places → a shared function.
- Generic, abbreviated or misleading names → descriptive names (universal abbreviations like
id,urlare fine). - Comments saying what → delete. Comments saying why → keep.
- Dead code, pass-through wrappers (unless tests fake them), one-strategy patterns, redundant casts → remove.
- Apply incrementally: change, test, keep or revert. Never batch untested changes.
- Step back: is the result genuinely easier to read, consistent with the codebase, and a clean diff a reviewer would approve? If not, revert.
For before/after examples of each pattern, read references/patterns.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.

