principle-subtract-before-you-add

Guides removal of dead code and redundant logic before adding new features.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When evolving a codebase, teams often add features on top of existing complexity, which compounds technical debt and makes every subsequent change harder. This Skill enforces a subtraction-first discipline so additions land on a simpler, smaller base. ## Core Features & Use Cases - Removal-First Sequencing: Orders deletion of dead weight, redundant validators, and stub references before any construction begins. - 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 Simplification: Applies the same subtraction principle to prompts by removing redundant instructions and excessive templates. - Use Case: Before refactoring a module or adding a new endpoint, apply this Skill to strip unused code paths and stub references first, making the actual change smaller and less brittle. ## Quick Start Apply the subtract-before-you-add principle to review my planned refactor and identify what should be deleted 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 code, redundant validators, and stub references first, then build on the simplified base. Deletion cuts the surface area and usually makes the next design obvious, so the addition ends up smaller and less brittle.

What is the subtract before you add principle in refactoring?

It is a sequencing rule: remove complexity before constructing anything new. Adding to a complex system compounds complexity, while subtracting first reveals the essential structure and reduces the cost of the change.

When should I delete speculative validators and guards?

Delete validators, parsers, and guards that go beyond what the spec actually demands. Out-of-spec features like unneeded persistence or retry-on-startup drag defensive guards behind them, so cutting the feature removes the guard burden too.

Should I keep stub references for future use?

No. When a reference has no novel content, delete it rather than leaving a stub. Stubs add surface area without value and mislead future readers about what the system actually does.

When is subtraction-first the wrong approach?

It is less suitable when the existing complexity is load-bearing and actively used, since removing it would break observed behavior. The principle targets dead weight and speculative code, not features with real usage.