principle-subtract-before-you-add

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

1|Updated Aug 27, 2025
One-click install
npx skills add https://github.com/IgorGanapolsky/Random-Timer --skill principle-subtract-before-you-add-igorganapolsky
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: principle-subtract-before-you-add
Source: https://github.com/IgorGanapolsky/Random-Timer/tree/main/.cursor/skills/principle-subtract-before-you-add
Command: npx skills add https://github.com/IgorGanapolsky/Random-Timer --skill principle-subtract-before-you-add-igorganapolsky

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When evolving a codebase, adding features on top of existing complexity compounds technical debt and obscures the essential design. This Skill enforces a subtraction-first discipline so refactors and additions start from a simpler, clearer base. ## Core Features & Use Cases - Removal-First Sequencing: Directs you to delete dead code, redundant validators, and stub references before constructing anything new. - Complexity Reduction Heuristics: Provides concrete rules such as cutting before polishing, designing for observed usage rather than speculative edge cases, and avoiding speculative parsers or guards. - Prompt Simplification: Applies the same subtraction 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 stub references, then build the feature on the simplified base. ## Quick Start Apply the subtract-before-you-add principle to review my planned refactor and identify what should be removed before I add 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 without increasing complexity?▼

Remove dead code, redundant validators, and stub references before adding anything new. Sequencing removal before construction leaves a simpler base, 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 design discipline that sequences removal before construction when evolving a system. You cut speculative validators, parsers, and guards first, then build on the simplified base rather than compounding existing complexity.

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

Delete a stub reference when it contains no novel content beyond what already exists elsewhere. Keeping empty stubs adds surface area without value, so removal keeps the design simpler behind the same or smaller footprint.

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

No. Design for observed usage rather than speculative edge cases, and avoid validators, parsers, or guards beyond what the spec demands. Speculative defenses add complexity without proven need.

When is subtraction-first the wrong approach?▼

It fits additions, refactors, and rewrites where existing complexity is the bottleneck. It is less relevant for greenfield work with no legacy code to remove, since there is nothing to subtract before building.