
Principle subtract before you add
Guides an agent to remove dead code and extra guards before adding new work
Principle subtract before you add is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 5.1K
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Principle subtract before you add
This skill sets an ordering rule for changes to a codebase: when an addition, refactor or rewrite is planned, the agent first strips out dead code, redundant validators and stub references, then builds on the simpler base. It treats simplification as an ongoing habit, aiming to leave a design a little leaner and more capable while keeping the same or a smaller public surface.
The instructions push the agent toward a minimal first version. Work is sequenced so removal comes before construction and polish comes after the minimum is in place. Validators, parsers and guards are kept to what the specification requires rather than speculative edge cases, and prompts or templates are trimmed of repeated instructions. Reference files with no new content are deleted instead of left as placeholders.
The skill is written as plain guidance with no scripts or bundled tools. It applies to any codebase the agent is working in, and it is packaged as part of the pstack Claude Code plugin marketplace.
When your agent uses it
Apply when sequencing an addition, refactor, or rewrite. Remove dead code, redundant validators, and stub references first, then build on the simpler base.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 2 files (943 bytes) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the pstack plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add michael-denyer/pstack-claude
/plugin install pstack@pstack-claudeOr copy only this skill to ~/.claude/skills/principle-subtract-before-you-add:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/principle-subtract-before-you-add &&
cp -R "$tmp/plugins/pstack/skills/principle-subtract-before-you-add" ~/.claude/skills/principle-subtract-before-you-add &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/principle-subtract-before-you-add inside it instead.
Copy the skill folder to ~/.agents/skills/principle-subtract-before-you-add to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/principle-subtract-before-you-add &&
cp -R "$tmp/plugins/pstack/skills/principle-subtract-before-you-add" ~/.agents/skills/principle-subtract-before-you-add &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/principle-subtract-before-you-add inside it instead.
Copy the skill folder to ~/.cursor/skills/principle-subtract-before-you-add to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/principle-subtract-before-you-add &&
cp -R "$tmp/plugins/pstack/skills/principle-subtract-before-you-add" ~/.cursor/skills/principle-subtract-before-you-add &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/principle-subtract-before-you-add inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/michael-denyer/pstack-claude.git --path plugins/pstack/skills/principle-subtract-before-you-addOr copy the folder to ~/.gemini/skills/principle-subtract-before-you-add yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/principle-subtract-before-you-add:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/principle-subtract-before-you-add &&
cp -R "$tmp/plugins/pstack/skills/principle-subtract-before-you-add" ~/.copilot/skills/principle-subtract-before-you-add &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/principle-subtract-before-you-add inside it instead.
Get the folder:
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.gitThen copy pstack-claude/plugins/pstack/skills/principle-subtract-before-you-add into your agent's skills folder as principle-subtract-before-you-add. Agents that support SKILL.md read one folder per skill.
What it does
- Removal before construction
- Sets the order of work so dead code and stale references are cleared before new code is written.
- Minimal first version
- Pushes the agent to reach a working minimum before investing in polish or quality.
- Lean validation
- Limits validators, parsers and guards to what the specification actually requires.
- Prompt trimming
- Removes redundant instructions and excessive templates from prompts the agent maintains.
- Stub cleanup
- Deletes reference files that add no novel content rather than leaving empty stubs behind.
Good for
- Refactor a module by first deleting unused functions and imports
- Plan a new feature starting from a smaller, cleaned-up base
- Strip redundant input validation before adding a new parser
- Trim bloated prompt templates in an AI application
- Remove placeholder reference docs before rewriting a project's documentation
Principle subtract before you add FAQ
Does Principle subtract before you add need any scripts or extra tools?
No. It ships as instructions only, with no scripts, and it does not set any allowed tools.
When does the agent use Principle subtract before you add?
It applies when the agent is sequencing an addition, refactor or rewrite, as described in its trigger description.
Is Principle subtract before you add tied to one AI client?
It is packaged as a Claude Code plugin skill in the pstack-claude marketplace, so it is listed for Claude Code.
How do I install Principle subtract before you add in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/principle-subtract-before-you-add to use it in all your projects, or to .claude/skills/principle-subtract-before-you-add in one project. Or install the pstack plugin, which includes it: /plugin marketplace add michael-denyer/pstack-claude, then /plugin install pstack@pstack-claude.
Does Principle subtract before you add run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Principle subtract before you add?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to Principle subtract before you add?
The closest alternatives to Principle subtract before you add are Principle laziness protocol, Code simplifier, Principle build the lever, Principle foundational thinking and Principle never block on the human.
Where this comes from
- Description: from the skill's own SKILL.md.
More from michael-denyer/pstack-claude

Makes the agent read pstack's poteto-mode skill first and follow its routing
- Open source
- 5.1K GitHub stars
- Developer tools

Has the agent restate your goals and the problem you're solving in its own words
- Open source
- 5.1K GitHub stars
- Productivity

Prototype 2-3 competing designs and compare them before committing to one
- Open source
- 5.1K GitHub stars
- Developer tools

Sketches types, signatures and module layout before the agent writes code
- Open source
- 5.1K GitHub stars
- Developer tools

Runs parallel candidate attempts at a task, then merges the best parts into one artifact
- Open source
- 5.1K GitHub stars
- Developer tools

Drafts a personal working-style skill from your past agent conversations
- Open source
- 5.1K GitHub stars
- Developer tools


