principle-subtract-before-you-add — Claude Code skill: how to install
A development skill that enforces removing dead code, stubs, and unused validators before writing new features or refactoring.
npx skills add backnotprop/pstack --skill principle-subtract-before-you-add -a claude-codeWhat principle-subtract-before-you-add does
This skill directs coding agents to remove complexity before adding new logic. During refactors or rewrites, the assistant cuts dead code, speculative parsers, and empty stubs before drafting any new implementations. It prioritizes observed usage over imagined edge cases.
The file sets disable-model-invocation to true, so it acts as persistent architectural guidance rather than an invocable tool. It also targets prompts by stripping redundant instructions and bloated templates.
Because it explicitly bans speculative guards and unneeded stubs, any boilerplate written just in case gets stripped out early.
What it helps with
- clean up dead code before starting a refactor
- eliminate speculative guards and parsers not required by specs
- remove empty stub references instead of keeping placeholders
- trim bloated prompts by cutting repeated templates
Example prompts for the agent
- Apply subtract-before-you-add to refactor our billing module.
- Prepare the user service for a new feature by deleting dead code first.
- Simplify our agent prompts and strip out redundant instructions.
How to install principle-subtract-before-you-add
1Skills CLI (Vercel)
npx skills add backnotprop/pstack --skill principle-subtract-before-you-add -a claude-code2Manually: put the files in place
~/.claude/skills/principle-subtract-before-you-add/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/principle-subtract-before-you-add/
1Skills CLI (Vercel)
npx skills add backnotprop/pstack --skill principle-subtract-before-you-add -a codex2Manually: put the files in place
.agents/skills/principle-subtract-before-you-add/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add backnotprop/pstack --skill principle-subtract-before-you-add -a cursor2Manually: put the files in place
.cursor/skills/principle-subtract-before-you-add/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install backnotprop/pstack principle-subtract-before-you-add2Manually: put the files in place
.github/skills/principle-subtract-before-you-add/SKILL.md1Skills CLI (Vercel)
npx skills add backnotprop/pstack --skill principle-subtract-before-you-add -a gemini-cli2Platform CLI
gemini skills install https://github.com/backnotprop/pstack --path skills/principle-subtract-before-you-addManually: put the files in place
.devin/skills/principle-subtract-before-you-add/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add backnotprop/pstack --skill principle-subtract-before-you-add -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about principle-subtract-before-you-add
How to install principle-subtract-before-you-add in Claude Code?
Run npx skills add backnotprop/pstack --skill principle-subtract-before-you-add -a claude-code.
What does principle-subtract-before-you-add do?
It instructs the assistant to eliminate dead code, stubs, and speculative validators before building new features.
Why is disable-model-invocation set to true?
The disable-model-invocation: true setting keeps the skill as a context guideline rather than exposing it as an agent-callable function.
Source text
SKILL.md · MIT
--- name: principle-subtract-before-you-add description: "Apply when sequencing an addition, refactor, or rewrite. Remove dead code, redundant validators, and stub references first, then build on the simpler base." disable-model-invocation: true --- # Subtract Before You Add When evolving a system, remove complexity first, then build. Default to subtraction. Make simplification a continual investment. Leave the design slightly simpler and more capable behind the same or smaller surface than you found it. - Sequence removal before construction - Cut before you polish (get to the minimum before investing in quality) - Design for observed usage, not speculative edge cases - No speculative validators, parsers, or guards beyond what the spec demands - Simplify prompts (remove redundant instructions, excessive templates) - When a reference has no novel content, delete it rather than leaving a stub
© backnotprop · MIT · backnotprop/pstack