occams-razor
Skill1 starsChanged 2 months agoMITView on GitHub
Complexity Pruning and Simplification using the Subtraction Method. Use when refactoring, reducing boilerplate, or challenging over-engineered solutions.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- davidondrej/skillstheir own version, first seen Nov 15, 2026
- michaelwjohnson/claude-skillstheir own version, first seen Nov 1, 2026
- skad0/skillstheir own version, first seen Oct 11, 2026
- qiulin/skillstheir own version, first seen Sep 10, 2026
- shinybrar/skillstheir own version, first seen Jul 30, 2026
- deciqAI/knowledge-skillstheir own version, first seen Jul 7, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- davidondrej/skills★ 4.3ksame name
- deciqAI/knowledge-skills★ 13same name
- meetvenkat1-code/claude_skills★ 0same name
- michaelwjohnson/claude-skills★ 0same name
- qiulin/skills★ 0same name
- shinybrar/skills★ 0same name
- skad0/skills★ 0same name
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 repository10 other files it gives its agents.
- chestertons-fenceSkill
- decision-matrixSkill
- first-principles-thinkingSkill
- humanizer-karu-customSkill
- inversion-thinkingSkill
- map-vs-territorySkill
- pareto-principleSkill
- rubber-duckingSkill
- second-order-thinkingSkill
- systems-thinkingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 14 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
14
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
Do not ask "What can I add?".
- Distinctive: line 29
Follow these 4 steps explicitly.
- Distinctive: line 32
Before pruning, verify the problem statement is correct.
- Distinctive: line 33
Ask: "What problem does this solve for the user?" If you can't answer, do not prune.
- Distinctive: line 41
Grep Test: Search for the string/symbol in the entire codebase.
- Distinctive: line 42
Test Suite: Run the project's tests. Do they pass?
- Very specific: line 43
Chesterton Check: If uncertain about purpose, invoke chestertons-fence protocol first.
- Distinctive: line 50
Delete unused config/boilerplate.
- Distinctive: line 54
If YES: You are done.
- Distinctive: line 55
If NO: Restore only the *minimum* necessary piece.
- Distinctive: line 65
Before pruning, anticipate workarounds:
- Distinctive: line 73
If workaround complexity > removed complexity, do not prune.
- Distinctive: line 85
Rule: If systems-thinking identifies a reinforcing loop involving this component, do not prune without tracing the full loop.
- Distinctive: line 89
After applying Occam's Razor, log only failures:
- Distinctive: line 135
Pass criteria: MUST identify missing problem statement before any pruning action.
“Common” is measured: kept by at least 6 in 10 of the 6 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
Occam's Razor (The Subtraction Method)
"Entities should not be multiplied without necessity." - William of Ockham
When to Use
- Before adding a new library or dependency.
- When refactoring legacy code.
- When a solution feels "heavy", "boilerplate-y", or hard to explain.
- During Code Review to challenge over-engineering.
When NOT to Use
- Performance-critical paths where the "simpler" solution has worse algorithmic complexity.
- Security boundaries where simplicity traded for readability may introduce vulnerabilities.
- Multi-team APIs where your simplicity creates complexity for consumers.
- Stable, well-tested code with low bug rates — pruning risk exceeds benefit.
- During active incidents — focus on recovery, not refactoring.
- Novel architectures — you don't yet know which complexity is load-bearing.
The Protocol: The Subtraction Method
Do not ask "What can I add?". Ask "What can I remove?". Follow these 4 steps explicitly.
0. Problem Verification
Before pruning, verify the problem statement is correct. Ask: "What problem does this solve for the user?" If you can't answer, do not prune.
1. The Hypothesis
Assume the current solution is over-engineered. State: "This solution is too complex. It can be simpler."
2. The "Why" Test (Safety Check)
Iterate through every component. Prune ruthlessly, but verify safety.
- Grep Test: Search for the string/symbol in the entire codebase. Is it referenced dynamically?
- Test Suite: Run the project's tests. Do they pass?
- Chesterton Check: If uncertain about purpose, invoke
chestertons-fenceprotocol first. Mandatory for non-trivial components. - Rubber Duck Test: Can you explain in one sentence why this component exists? If not, invoke chestertons-fence.
3. The Prune
Actively remove the unnecessary components.
- Replace heavy libraries with native language features (e.g.,
lodash->Array.map). - Collapse "Passthrough" classes (Manager/Service/impl/Interface) into a single function if they don't add logic.
- Delete unused config/boilerplate.
4. Verification
Does the bare metal system still solve the user's Core Problem?
- If YES: You are done.
- If NO: Restore only the minimum necessary piece.
Stop Conditions
Stop pruning when:
- Tests fail and you don't understand why
- You cannot explain the component's purpose in plain English
- The component is referenced by code you don't own
- You've reached the "Core Problem" boundary — removing further breaks user value
Second-Order Check
Before pruning, anticipate workarounds:
Ask: "If I remove this, what will developers likely do instead?"
- Over-pruning pattern: Removed abstraction → developers add inline duplication across 10 callers → more complexity than removed
- Contract breach: Removing validation layer → callers must add checks → distributed complexity
- Knowledge loss: Removing documentation → tribal knowledge only → fragility
If workaround complexity > removed complexity, do not prune.
Skill Integration Matrix
| Skill | When to Chain |
chestertons-fence | Always before pruning non-trivial components |
systems-thinking | Before pruning components with downstream dependencies |
second-order-thinking | Before pruning widely-used abstractions |
rubber-ducking | When you can't explain why something exists |
decision-matrix | When simplicity vs. robustness trade-off is unclear |
Rule: If systems-thinking identifies a reinforcing loop involving this component, do not prune without tracing the full loop.
Self-Improvement Protocol
After applying Occam's Razor, log only failures:
Log to .learnings/CORRECTIONS.md:
- [YYYY-MM-DD] {what was removed} → {outcome}Log if:
- Pruning caused a bug
- Over-pruning required restoration
- Second-order workaround created more complexity
Do NOT log routine successful prunes — this overhead exceeds value.
Pattern Categories (Prioritized)
High-Impact (Prune First):
- Unused exports / dead code
- Passthrough classes with no logic
- Wrapper libraries around native features
Medium-Impact (Verify Before):
- Abstraction layers over stable internals
- Configuration that could be hardcoded
- Boilerplate that exceeds code it wraps
Low-Impact (Leave Alone):
- Code referenced by unknown callers
- Security-sensitive validation
- Multi-team API boundaries
Resources
- Detailed Research Notes
- Complexity Indicators Reference
Evaluations
Eval 1: Problem Verification Before Pruning
Scenario: User says "this library does X, we should remove it." You cannot explain what X solves for the user. Expected: Stops, verifies problem statement. If no clear user problem exists, does NOT prune. Pass criteria: MUST identify missing problem statement before any pruning action.
Eval 2: Over-Pruning Cascade Prevention
Scenario: Removing a shared utility function would require 10 callers to add inline code. Expected: Identifies that workaround complexity > removed complexity, does NOT prune. Pass criteria: Calculates second-order cost, refuses prune that creates net-more complexity.
Eval 3: Security Boundary Respect
Scenario: User wants to remove "redundant" input validation in a public API endpoint. Expected: Identifies as security boundary, does NOT prune without chestertons-fence investigation. Pass criteria: Correctly identifies validation as potentially load-bearing security fence.
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.

