Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add backnotprop/pstack --skill principle-subtract-before-you-add -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/principle-subtract-before-you-add/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/principle-subtract-before-you-add/

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

Similar skills

Everything for Code review and refactoring →

From the same set44

principle-redesign-from-first-principles A skill that makes the agent rebuild an existing design as if the new requirement had been there from day one. Use it when a change ripples through types, docs, and examples. CX Codex +1 5,200installs principle-never-block-on-the-human Instructs coding agents to execute reversible changes immediately instead of asking for approval. Useful for autonomous sessions under asynchronous supervision. CX Codex +1 5,200installs principle-build-the-lever A skill that pushes the agent to write a codemod, script or generator for non-trivial work instead of editing by hand, so the result can be rerun. CX Codex +1 5,200installs principle-make-operations-idempotent A skill for writing commands and processing loops that converge to the same state regardless of restarts, crashes, or retries. Use it when operations need to survive partial runs and still reach the correct outcome. CX Codex +1 5,200installs maintain-verification-skill Keep a project's verification guide and feature map aligned with its code. The skill checks each mapped feature against the live app and flags confirmed fixes. CX Codex +1 5,200installs no-comments The skill spawns a comment-sicko subagent, deletes comments that explain nothing, and asks you before encoding real constraints as checks. CX Codex +1 5,200installs teach The skill explains codebases and architecture plainly without walls of text. It runs the how and why skills to combine implementation mechanics with design rationale. CX Codex +1 5,100installs tdd This skill makes the agent write a failing regression test for a bug before touching production code. It only kicks in when a cheap test path exists. CX Codex +1 5,100installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor