occams-razor

Remove unnecessary code and abstractions after verifying references and running tests.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/calvyntwh/karu-custom-skills --skill occams-razor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: occams-razor
Source: https://github.com/calvyntwh/karu-custom-skills/tree/main/skills/occams-razor
Command: npx skills add https://github.com/calvyntwh/karu-custom-skills --skill occams-razor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Occam's Razor helps teams identify and remove unnecessary abstractions, dependencies, and boilerplate that increase maintenance cost and slow development, restoring clarity to code and systems.

Core Features & Use Cases

  • Structured Pruning Protocol: A four-step Subtraction Method that includes problem verification, hypothesis, safety checks, pruning, and verification.
  • Safety-first Checks: Grep for references, run test suites, and invoke Chesterton's Fence for unknown components before removal.
  • Second-order Analysis & Logging: Anticipates developer workarounds, prevents over-pruning, and prescribes a minimal learnings log for failures and regressions.

Quick Start

Apply occams-razor by identifying a suspected over-engineered component, verifying its purpose and references, removing the minimal piece, running tests, and recording any negative outcomes.

Frequently Asked Questions about occams-razor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove unnecessary abstractions from a codebase?

To remove unnecessary abstractions, apply a structured pruning protocol: verify the problem, grep for dynamic references, run tests, remove the minimal piece, and verify outcomes. This reduces codebase complexity and maintenance burden.

When should I simplify over-engineered legacy systems?

Simplify over-engineered legacy systems during refactoring, code reviews, or dependency audits when unnecessary boilerplate increases maintenance cost. Invoke Chesterton's Fence for unclear components to prevent removing code that serves an unknown purpose.

What is the best way to prevent breaking code when pruning technical debt?

Prevent breaking code by running safety checks before pruning: grep for dynamic references, execute test suites, and apply second-order analysis to anticipate developer workarounds. Record any regressions in a learnings log.

How does Chesterton's Fence apply to code simplification?

Chesterton's Fence applies to code simplification by requiring you to verify the purpose of unclear components before removal. If you cannot establish why an abstraction exists, you must investigate it to avoid over-pruning and causing regressions.

Can I use this pruning method on both frontend and backend systems?

Yes, you can apply this structured subtraction method to both over-engineered frontend and backend systems. It targets unnecessary code, abstractions, and dependencies regardless of the stack to restore clarity and reduce maintenance.

What are the limitations of subtractive refactoring for technical debt?

Subtractive refactoring risks over-pruning if second-order effects are ignored. Limitations include unexpected developer workarounds and regressions, which require safety checks and a learnings log to capture failures and prevent future issues.