principle-subtract-before-you-add

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

136|8|Updated May 9, 2026
One-click install
npx skills add https://github.com/Sma1lboy/rove --skill principle-subtract-before-you-add-sma1lboy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: principle-subtract-before-you-add
Source: https://github.com/Sma1lboy/rove/tree/main/.agents/skills/pstack/skills/principle-subtract-before-you-add
Command: npx skills add https://github.com/Sma1lboy/rove --skill principle-subtract-before-you-add-sma1lboy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When evolving a codebase, adding features on top of existing complexity compounds technical debt and makes every change more brittle. This Skill provides a decision framework for sequencing refactors: remove dead weight, redundant validators, and stub references first, then build on the simplified base. ## Core Features & Use Cases - Subtraction-First Sequencing: Orders removal before construction so additions land on a smaller, clearer surface. - Speculative-Code Elimination: Identifies and removes validators, parsers, and guards that defend against edge cases the spec never demands. - Prompt and Reference Simplification: Strips redundant instructions, excessive templates, and stub references with no novel content. - Use Case: Before adding a retry-on-startup feature to a service, apply this Skill to delete unused persistence guards and schema-migration stubs, reducing the surface area the new feature must defend. ## 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 refactor code before adding a new feature?▼

Remove dead code, redundant validators, and stub references first, then build the addition on the simplified base. Sequencing removal before construction cuts 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: delete complexity before building new functionality. Adding to a complex system compounds complexity, while subtraction reveals the essential structure and keeps the design smaller and less brittle.

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

Remove validators, parsers, and guards when they defend against edge cases the spec does not demand. Out-of-spec features like persistence or schema migration drag defensive guards behind them, so cutting the feature cuts the guards too.

When is subtraction-first refactoring not the right approach?▼

It is less suitable when the existing complexity is load-bearing and actively used, or when deletion risk exceeds the benefit of a simpler base. Design for observed usage, not speculative cases, but verify usage before deleting.

How do I simplify prompts and templates in an AI system?▼

Remove redundant instructions and excessive templates, and delete references that contain no novel content rather than leaving stubs. Simpler prompts reduce the surface the model must reconcile.