simplify
Skill0 starsChanged 5 months agoMITView on GitHub
Removes accidental complexity — dead code, duplication, needless indirection, and over-engineering. Use when refactoring, after a feature lands, when code is harder to read than the problem warrants, or before extending a messy area.
119 other projects use a version of this.
Adopted by
Most recently taken up by
- thistleknot/skillstheir own version, first seen Nov 8, 2026
- PeanutGT/NutsSkillstheir own version, first seen Nov 8, 2026
- Ovich/charrettetheir own version, first seen Nov 8, 2026
- caidanw/skillstheir own version, first seen Nov 8, 2026
- Ovich/swarmstormtheir own version, first seen Nov 8, 2026
- alexandrosandre/agentic-engineeringtheir own version, first seen Nov 8, 2026
Used with
Projects with it also use codex-system, design-tracker 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.
gaebalaiSkillcodex-system
PROACTIVELY consult Codex CLI, your highly capable supporter with exceptional reasoning and task completion abilities. Codex is a trusted expert you should ALWAYS consult BEFORE making decisions on: design choices, implementation approaches, debugging strategies, refactoring plans, or any non-trivial problem. When uncertain, consult Codex. Don't hesitate - Codex provides better analysis. Explicit triggers: "think deeper", "analyze", "second opinion", "consult codex".
Also in 3 projects that use this
gaebalaiSkilldesign-tracker
PROACTIVELY track and document project design decisions without being asked. Activate automatically when detecting architecture discussions, implementation decisions, pattern choices, library selections, or any technical decisions. Also use when user explicitly says "記録して", "設計どうなってる", "record this". Do NOT wait for user to ask - record important decisions immediately.
Also in 3 projects that use this
mike22890Skillclonedeps
将项目依赖的第三方库源码克隆到本地,便于深入阅读和调试。当需要查看库的实现细节、阅读源码、调试第三方依赖、理解 SDK/framework 内部机制、查看 node_modules 之外的原始代码、分析开源库架构、学习他人代码、查看依赖的 TypeScript 类型定义时使用。
Also in 3 projects that use this
mdrubelamin2Skillverification-planning
Plans how to prove a change works or broke nothing: frames the claim, designs an evidence path from the system itself, and requires every check to be able to fail.
Also in 3 projects that use this
devbrother2024Skillartifact-design
단독 self-contained HTML 산출물(랜딩 페이지, 정적 문서·리포트, 독립 대시보드, 데모·게임, 개발 전 UX/UI 대안 비교 목업)을 만들 때 팔레트·타이포그래피·레이아웃을 의도적으로 설계하고 템플릿·AI스러운 디자인을 피하도록 돕는 디자인 가이드. HTML/CSS를 쓰기 전에 로드한다. "랜딩 만들어줘", "이 내용 단일 HTML로 예쁘게", "UX 대안 HTML로 비교해줘", "디자인 잡아줘"처럼 단독 HTML 아티팩트를 만들거나 비교하는 요청에 활성화하고, 기존 앱(React·Vue 등)의 인앱 컴포넌트 수정이나 순수 백엔드·로직 작업에는 쓰지 않는다.
Also in 3 projects that use this
codebycoreySkillbatch
Create multiple proposals from free-form feature descriptions. Use when planning several features at once, batch creating proposals, or setting up related changes.
Also in 4 projects that use this
- +3 more from gaebalai
Other versions119 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 119
- Z3Prover/z3★ 13ksame name
- aaddrick/claude-desktop-debian★ 5.5ksame name
- CherryHQ/cherry-studio-app★ 4.1ksame name
- elliothux/open-compute★ 3.3ksame name
- meta-pytorch/OpenEnv★ 2.8ksame name
- huggingface/OpenEnv★ 2.8ksame name
- bholmesdev/hubble.md★ 1.5ksame name
- kdlbs/kandev★ 1.1ksame name
- truffle-ai/dexto★ 659same name
- deadlock-mod-manager/deadlock-mod-manager★ 584same name
109 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 repository68 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/engineering-skills.mdcCursor rule
- marketing-routerSkill
- accessibilitySkill
- agent-guardrailsSkill
- agent-memorySkill
- agent-verificationSkill
- autonomous-loopsSkill
- browser-checksSkill
- caching-strategySkill
- context-curationSkill
- contract-testingSkill
- data-modelingSkill
- decision-docsSkill
- dependency-hygieneSkill
- design-handoffSkill
- e2e-testingSkill
- experimentationSkill
- fault-recoverySkill
- feature-flagsSkill
- finops-budgetSkill
- git-flowSkill
- hardeningSkill
- i18n-l10nSkill
- idea-shapingSkill
- incident-responseSkill
- incremental-deliverySkill
- interface-designSkill
- launch-campaignSkill
- launch-readinessSkill
- llm-feature-engineeringSkill
- long-running-agentsSkill
- community-engagementSkill
- content-marketingSkill
- email-nurtureSkill
- growth-strategySkill
- paid-adsSkill
- referral-loopSkill
- seo-growthSkill
- social-distributionSkill
- micro-interactionsSkill
- migration-pathSkill
- mobile-patternsSkill
- observabilitySkill
- orchestrated-deliverySkill
- parallel-subagentsSkill
- perf-budgetSkill
- pipeline-opsSkill
- product-briefSkill
- product-discoverySkill
- product-groomingSkill
- react-patternsSkill
- resilienceSkill
- review-gateSkill
- skill-creatorSkill
- skill-harvestSkill
- skill-routerSkill
- source-firstSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. 0 are common, 19 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 111 edited versions we read keep these.
19
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 25
Before extending a messy area — simplify first, then add
- Distinctive: line 26
After [[review-gate]] flags unnecessary indirection or duplication
- Distinctive: line 60
Read the code end-to-end — inputs, outputs, side effects, error paths.
- Distinctive: line 65
Ask: what is the smallest description of what this does?
- Distinctive: line 68
Don't simplify what you don't understand — you'll delete load-bearing code.
- Distinctive: line 72
Start here. Deletion is the purest simplification.
- Distinctive: line 83
Run the test suite and linter after each deletion batch.
- Distinctive: line 95
When duplication is real:
- Very specific: line 101
Prefer one obvious home for shared logic — utils module, domain service, not a new helpers2.
- Distinctive: line 103
When not to extract:
- Distinctive: line 110
Every layer must earn its keep — hide a seam, swap implementations, or isolate a trust boundary.
- Distinctive: line 125
Test seam (inject dependency) with more than one production path
- Distinctive: line 127
If removing a layer makes testing harder, keep a thin seam — not a cathedral.
- Distinctive: line 149
Prefer obvious constructs over terse tricks — readable loop over chained one-liner.
- Distinctive: line 152
Delete comments that restate the code.
- Distinctive: line 153
If you need a comment to explain *what* a line does, rewrite the line.
- Distinctive: line 161
Flatten deep JSON: only when callers need it flat — don't map-unmap-map for sport.
- Distinctive: line 169
Before adding or keeping a package for a trivial job ([[dependency-hygiene]]):
- Distinctive: line 181
Keep the dependency when security, correctness, or maintenance cost clearly favors it (crypto, parsing complex formats).
- Distinctive: line 194
Never combine behavior change + structural refactor in one commit — reviewers and bisect can't tell what broke.
“Common” is measured: kept by at least 6 in 10 of the 111 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
Simplify
The goal is the simplest code that correctly solves the actual problem — not the most flexible, most abstract, or most clever. Most complexity is accidental: abstractions built for futures that never arrived, duplication from copy-paste, and indirection that hides intent. Delete it, don't decorate it.
Essential complexity stays — the problem really is hard. Accidental complexity is optional and your job is to remove it without changing behavior.
Pair with [[test-first]] for the safety net, [[incremental-delivery]] for small refactor PRs, [[review-gate]] when the cleanup is ready to merge, [[interface-design]] when simplifying public APIs, [[dependency-hygiene]] when deciding to own code vs import a package, and [[perf-budget]] before "optimizing" structure on hot paths — simpler isn't always faster; measure if latency matters.
When to Use
- Cleaning up after a feature lands or a spike becomes production code
- Code that takes more effort to read than the problem deserves
- A reviewer or you keep getting lost following the flow
- Before extending a messy area — simplify first, then add
- After [[review-gate]] flags unnecessary indirection or duplication
- Choosing between a new dependency and a small amount of owned code ([[dependency-hygiene]])
Skip as the primary skill when:
- The area is under active feature development — finish the behavior, simplify in a follow-up PR
- You don't understand the code yet and have no tests — understand and cover first ([[test-first]])
- The change would alter public contracts without a migration ([[interface-design]], [[migration-path]])
Not a substitute for [[fault-recovery]] — if something is broken, fix the bug first; don't refactor around it blindly.
Process
Work in order. Safety and understanding before deletion.
1. Define scope and the safety net
- Bound the refactor — one module, one flow, one PR. "Simplify the whole app" never finishes.
- Behavior must stay the same unless the task explicitly includes a behavior change — simplification is not a stealth feature.
- Tests green before you start ([[test-first]]). No tests? Add characterization tests for critical paths first — even coarse ones beat refactoring blind.
- Small commits — delete dead code in one commit, extract duplication in the next; easy to bisect if something breaks ([[git-flow]]).
- For public APIs, note callers — simplifying internals is free; changing exports needs care ([[interface-design]]).
Good scope: "Simplify checkout total calculation — one module, tests in checkout.test.ts"
Bad scope: "Clean up the codebase while I'm here"2. Understand it fully before changing anything
- Read the code end-to-end — inputs, outputs, side effects, error paths.
- Trace one real scenario through the maze — if you can't, neither can the next reader.
- Identify essential vs accidental complexity:
- Essential — required by the domain (tax rules, auth rules, protocol spec)
- Accidental — wrappers, unused options, duplicate paths, "just in case" layers
- Ask: what is the smallest description of what this does? If the code is 10× longer than that description, most of the gap is accidental.
Don't simplify what you don't understand — you'll delete load-bearing code.
3. Delete what isn't used (highest ROI, lowest risk)
Start here. Deletion is the purest simplification.
Remove:
- Dead code — unreachable branches, unused functions, orphaned files
- Unused parameters and variables — including "reserved for later" args
- Commented-out blocks — git history remembers; comments rot
- Feature flags and config options nothing sets anymore
- Imports and dependencies pulled in but unused ([[dependency-hygiene]])
- Speculative types/interfaces with no implementations or callers
Run the test suite and linter after each deletion batch. If nothing breaks, it wasn't load-bearing.
Red flag: export function handleLegacyV1() { ... } // zero callers in repo
Action: delete (or confirm external consumer first)4. Remove real duplication — not coincidental similarity
Duplication is two places that change for the same reason. Similar-looking code that evolves independently should stay separate ([[interface-design]] — don't force false coupling).
When duplication is real:
- Rule of Three — first occurrence, second duplicate, third time extract a shared helper. Premature extraction creates the wrong abstraction.
- Extract the idea, not the lines — name the helper for what it means (
computeLineTax), notdoStuffFromCartAndCheckout. - Prefer one obvious home for shared logic — utils module, domain service, not a new
helpers2.
When not to extract:
- Two snippets look alike but have different failure modes or change triggers
- Extraction would require boolean flags (
if (forCheckout)) — worse than two clear functions
5. Collapse needless indirection
Every layer must earn its keep — hide a seam, swap implementations, or isolate a trust boundary.
| Smell | Action |
| Wrapper with one caller, no interface | Inline it |
| Service that only delegates to one repo | Call the repo directly or merge |
| Abstract base with one subclass | Delete the hierarchy |
| Factory that returns one type | Construct directly |
| "Manager/Handler/Processor" pass-through | Collapse to the layer that decides |
| Generic framework for one use case | Replace with plain code |
Indirection that's worth keeping:
- Multiple real implementations behind one interface
- Clear module boundary between teams or deploy units
- Test seam (inject dependency) with more than one production path
If removing a layer makes testing harder, keep a thin seam — not a cathedral.
6. Simplify control flow and state
- Replace deep nesting with early returns (guard clauses) — fewer variables in scope at once.
- Collapse boolean explosion — five params × three flags → config object or explicit types/states.
- Replace state machines drawn with flags —
isLoading && !isError && hasData→ enum/status field with valid transitions only. - Fewer mutable variables — prefer deriving values during render/calculation over sync effects ([[react-patterns]]).
- Remove special cases by making the general case handle them — often the data model is wrong ([[data-modeling]]).
Before: if (x) { if (y) { if (!z) { doThing(); } } }
After: if (!x || !y || z) return; doThing();7. Replace clever with clear
Clever code is read many times and understood once.
- Prefer obvious constructs over terse tricks — readable loop over chained one-liner.
- Name for intent —
retryCountnotn,expiredTokennott. - Replace magic numbers/strings with named constants when meaning isn't obvious.
- Delete comments that restate the code; keep comments that explain why a non-obvious rule exists.
- If you need a comment to explain what a line does, rewrite the line.
Clarity is not "more lines" — often the clear version is shorter.
8. Simplify data and API surfaces
- Fewer parameters — if a function takes 8 args, group related ones or pass a typed object with a small surface ([[interface-design]]).
- Flatten deep JSON only when callers need it flat — don't map-unmap-map for sport.
- Remove optional fields nobody passes — YAGNI on API shape.
- Prefer plain data over objects with behavior when behavior is one function away.
- Delete unused exports — public surface is a promise; shrink it when callers allow ([[migration-path]] if breaking).
9. Prefer owning small code over heavy dependencies
Before adding or keeping a package for a trivial job ([[dependency-hygiene]]):
Ask: Would ~20 lines of boring code be simpler than this dependency + its upgrade path?Simplify by removing dependencies when:
- You use one function from a large library
- The dependency pulls transitive weight for a one-liner
- The API is harder to learn than the problem
Keep the dependency when security, correctness, or maintenance cost clearly favors it (crypto, parsing complex formats). Document the choice in [[decision-docs]] if non-obvious.
10. Refactor in small, behavior-preserving steps
The sequence that works:
- Green tests
- One simplification (delete, inline, extract, rename)
- Green tests again
- Commit
- Repeat
Never combine behavior change + structural refactor in one commit — reviewers and bisect can't tell what broke. If simplification reveals a bug, fix in a separate commit with a regression test ([[fault-recovery]]).
For large messes, strangler approach ([[incremental-delivery]]): simplify the path you're about to touch; leave unrelated tangles for later scoped PRs.
11. Know when to stop
Stop simplifying when:
- Further change needs a behavior decision — that's product/spec, not cleanup
- You're adding abstraction to make it "more flexible" — YAGNI
- Perf-critical path — measure before restructuring ([[perf-budget]]); clearer code that doubles allocations on the hot path may need a different trade-off
- The result is smaller but harder to read — wrong extract; revert and try again
- Diminishing returns — two readable functions beat one "elegant" meta-function
Ship the PR when behavior is unchanged, tests green, and a stranger could follow the flow faster.
Common Rationalizations
- "We might need it later." — Add it later when "later" is real; YAGNI beats speculative flexibility.
- "It's clever, leave it." — Clever code is cursed on every read; clear wins.
- "Touching it is risky." — With tests, the bigger risk is leaving the maze for the next hurried edit.
- "It works, don't refactor." — Working but unreadable code is a future bug factory.
- "One more abstraction will make it clean." — Abstractions accumulate; deletion and inlining clean better.
- "I'll simplify while adding the feature." — Mixed PRs are hard to review; separate cleanup when possible.
- "Duplication is DRY violation — extract now." — Wrong abstraction is worse than two clear copies.
- "Removing the dependency is too much work." — Transitive deps are permanent work; weigh honestly.
Red Flags
- Abstractions with exactly one implementation or caller
- Same logic copy-pasted in several places with no extract plan
- Layers that only pass calls through unchanged
- Functions you re-read three times to follow
- Flags and config options nothing sets
- "Flexible" frameworks built for requirements that don't exist
- Refactor PR with no tests and wide diff
- Public API changed without caller updates or migration note
- New helper file created for one 3-line function used once
utils,helpers,commonfolders growing without domain meaning- Simplification that adds more lines than it removes
Verification
- Scope bounded; behavior unchanged unless explicitly in scope
- Tests green before and after; characterization tests added if none existed
- Dead code, unused params, orphaned flags, and unused deps removed
- Real duplication extracted (Rule of Three); coincidental similarity left alone
- Single-use indirection inlined; remaining layers earn their keep
- Control flow and state reduced — early returns, fewer flags, clearer status
- Clever constructs replaced with clear names and obvious logic
- Public API surface not accidentally shrunk or expanded without [[interface-design]] / [[migration-path]]
- Refactor in small commits; no behavior change mixed with structural cleanup
- Result is smaller or same size, strictly easier to read — not a new abstraction maze
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.

