principle-subtract-before-you-add

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

1|Updated Jul 5, 2026
One-click install
npx skills add https://github.com/yersonargotev/packy --skill principle-subtract-before-you-add-yersonargotev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: principle-subtract-before-you-add
Source: https://github.com/yersonargotev/packy/tree/main/bundle/skills/principle-subtract-before-you-add
Command: npx skills add https://github.com/yersonargotev/packy --skill principle-subtract-before-you-add-yersonargotev

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 provides a decision framework for sequencing removals before additions so each change lands on a simpler base. ## Core Features & Use Cases - Subtraction-first sequencing: Remove dead weight, redundant validators, and stub references before building new functionality. - Spec-driven scoping: Avoid speculative validators, parsers, and guards beyond what the specification demands. - Prompt and reference simplification: Strip redundant instructions, excessive templates, and empty reference stubs. - Use Case: Before adding a retry mechanism to a service, apply this principle to delete unused persistence guards and stale schema migration code, then implement the retry on the reduced surface. ## Quick Start Ask the AI to review the current module and identify what can be removed 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 refactor code before adding a new feature?▼

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

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

It is a design principle that sequences deletion ahead of construction when evolving a system. Cutting complexity first reveals the essential structure and keeps each addition smaller and less brittle.

When should I remove speculative validators and guards?▼

Remove validators, parsers, and guards that go beyond what the specification demands. Out-of-spec features like unneeded persistence or retry logic drag defensive code behind them, so deleting the feature removes the guards too.

When is subtraction-first refactoring not appropriate?▼

It is less appropriate when the existing complexity is load-bearing and covered by real usage, or when a deadline requires a minimal additive patch. The principle targets dead weight and speculative code, not essential behavior.