principle-subtract-before-you-add

Guides removal of dead code and redundant logic before building additions or refactors.

2|Updated Jun 27, 2026
One-click install
npx skills add https://github.com/imjasonh/playground --skill principle-subtract-before-you-add-imjasonh
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: principle-subtract-before-you-add
Source: https://github.com/imjasonh/playground/tree/main/.cursor/skills/principle-subtract-before-you-add
Command: npx skills add https://github.com/imjasonh/playground --skill principle-subtract-before-you-add-imjasonh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When evolving a codebase, adding features on top of accumulated complexity compounds technical debt and obscures the essential design. This Skill enforces a subtraction-first sequencing principle so changes land on a simpler, clearer base. ## Core Features & Use Cases - Removal-First Sequencing: Directs deletion of dead code, redundant validators, and stub references before any addition, refactor, or rewrite begins. - Anti-Speculation Guardrails: Blocks speculative parsers, guards, and edge-case handling beyond what the spec actually demands. - Prompt Simplification: Applies the same principle to prompts by removing redundant instructions and excessive templates. - Use Case: Before adding a new validation layer to a service, use this Skill to first strip unused validators and dead branches, then design the addition against the simplified structure. ## Quick Start Apply the subtract-before-you-add principle to plan my next refactor by identifying dead code and redundant logic to remove first.

Frequently Asked Questions about principle-subtract-before-you-add

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

FAQPage Schema
How do I simplify code before adding a new feature?▼

Remove dead code, redundant validators, and stub references first, then build the feature on the simplified base. Sequencing removal before construction reveals the essential structure and usually makes the next design obvious.

What is the subtract before you add principle in refactoring?▼

It is a sequencing rule: delete complexity before building anything new. Adding to a complex system compounds complexity, while removing first leaves less code and a smaller surface to design against.

When should I delete stub references instead of keeping them?▼

Delete a reference when it contains no novel content. Leaving stubs adds surface area without value, so the principle favors removal over placeholder preservation.

Should I add validators for edge cases that might occur later?▼

No. The principle prohibits speculative validators, parsers, or guards beyond what the spec demands. Design for observed usage, not hypothetical edge cases.

When not to use a subtraction-first approach?▼

Avoid it when removal risks breaking observed behavior without test coverage to verify safety, or when the addition is urgent and independent of the complex area. Subtraction works best as a continual investment, not a blocking ritual.