principle-subtract-before-you-add

Guides removal of dead code and redundant validators before building new features.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding features to an already complex system compounds complexity and makes every subsequent change more brittle. This Skill enforces a sequencing principle: remove dead weight, redundant validators, and stub references first, then build on the simpler base. ## Core Features & Use Cases - Subtraction-first sequencing: Orders removal before construction so refactors and rewrites start from a minimal surface. - Anti-speculation rules: Blocks speculative validators, parsers, and guards beyond what the spec demands, and cuts out-of-spec features like unneeded persistence or retry logic. - Prompt and reference simplification: Removes redundant instructions, excessive templates, and stub references with no novel content. - Use Case: Before adding a new schema migration feature to a module, apply this principle to delete unused validators and dead code paths first, making the migration smaller and less error-prone. ## Quick Start Apply the subtract-before-you-add principle to review my planned refactor and identify what should be removed before I build the new feature.

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 weight, redundant validators, and stub references first, then build on the simpler base. Deletion cuts the surface area, reveals the essential structure, and usually makes the next design obvious.

What is the subtract before you add principle in software design?▼

It is a sequencing rule: when evolving a system, remove complexity before constructing anything new. Adding to a complex system compounds complexity, while subtracting first makes the next addition smaller and less brittle.

When should I remove validators and guards from my code?▼

Remove validators, parsers, and guards that go beyond what the spec demands. Out-of-spec features like persistence, retry-on-startup, and schema migration each drag defensive guards behind them, so cutting the feature lets you cut the guards too.

Should I design for edge cases that might happen later?▼

No. Design for observed usage, not speculative edge cases. Speculative handling adds surface area and validators that must be maintained, and it can be added later if real usage demands it.

When should I delete a stub reference instead of keeping it?▼

Delete a reference when it has no novel content. Keeping stubs adds noise and surface area without value; removal keeps the design simpler and more capable behind the same or smaller surface.