principle-subtract-before-you-add

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

6.6k|542|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/cursor/plugins --skill principle-subtract-before-you-add
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: principle-subtract-before-you-add
Source: https://github.com/cursor/plugins/tree/main/pstack/skills/principle-subtract-before-you-add
Command: npx skills add https://github.com/cursor/plugins --skill principle-subtract-before-you-add

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding features to an already complex codebase compounds complexity and makes every subsequent change more brittle. This Skill provides a sequencing principle that removes dead weight, redundant validators, and stub references first, so new work builds on a simpler base.

Core Features & Use Cases

  • Removal-First Sequencing: Directs deletion of unused code, speculative validators, and empty stubs before any addition, refactor, or rewrite.
  • Simplification Heuristics: Encourages designing for observed usage rather than speculative edge cases, and cutting to the minimum before polishing.
  • Prompt Simplification: Applies the same subtraction principle to prompts by removing redundant instructions and excessive templates.
  • Use Case: Before adding a new persistence feature to a module, first delete the unused retry-on-startup guards and orphaned schema migration stubs, then implement the feature against the reduced surface.

Quick Start

Ask the agent to apply the subtract-before-you-add principle to simplify this module before implementing the planned 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 a codebase before adding a new feature?

Remove dead code, redundant validators, and stub references first, then build the feature on the simplified base. Deletion reduces surface area and usually makes the next design obvious.

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

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 shrinks the change.

When should I delete speculative validators and guards?

Delete validators, parsers, and guards that go beyond what the spec demands. Out-of-spec features like persistence or retry-on-startup drag defensive guards behind them, so removing the feature removes the need for its guards.

When is subtraction the wrong approach before refactoring?

Subtraction is wrong when the code is actively used or when removal would break observed behavior. The principle targets dead weight and speculative complexity, not functioning features with real usage.

Can this principle apply to prompts and documentation?

Yes. The same rule applies to prompts by removing redundant instructions and excessive templates, and to references by deleting stubs that contain no novel content.