principle-subtract-before-you-add
An agent skill by cursor, from cursor/plugins. Tags: cleanup, code-quality, development, optimization, refactoring.
What it does
Apply when sequencing an addition, refactor, or rewrite. Remove dead code, redundant validators, and stub references first, then build on the simpler base.
Install
With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:
npx skills add cursor/plugins --skill principle-subtract-before-you-add
Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):
git clone --depth 1 https://github.com/cursor/plugins
cp -r plugins/pstack/skills/principle-subtract-before-you-add ~/.claude/skills/principle-subtract-before-you-add
Safety box score
Grade A, minimal risk: 0 of 100 risk points, rated 2026-10-16. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.
This is a documentation-only refactoring skill: it does not ship scripts, fetch remote content, or touch the machine directly. Its main effect is to steer an agent toward deleting code and simplifying prompts before adding new behavior, so the only real risk is over-aggressive removal in the target project.
| Category | Level | Why |
|---|---|---|
| Code & shell execution | 0 (none) | `SKILL.md` contains guidance only; there are no shell commands, scripts, or code evaluation paths. |
| Network access | 0 (none) | No downloads, API calls, or remote fetches are present in the skill file. |
| Filesystem reach | 0 (none) | The skill does not name any paths to read, write, or delete outside the project, only general refactoring advice. |
| Secrets & credentials | 0 (none) | It does not request tokens, keys, `.env` files, logins, or other credentials. |
| Privilege & persistence | 0 (none) | There is no sudo, global install, service registration, or OS/git setting change in the skill. |
| Instruction hijack surface | 0 (none) | The text is ordinary design guidance; it does not tell the agent to ignore instructions, hide actions, or follow untrusted remote content. |
| Irreversible actions | 0 (none) | The skill does not trigger deployments, posts, payments, deletions, or other external actions on its own. |
| Transparency | 0 (none) | There are no binaries, encoded blobs, installers, or generated runtime code; the file is fully readable Markdown. |
Before installing
- Review the skill’s deletion-first guidance against the project’s actual change scope before using it.
- Try it on a throwaway branch first if the target repo has fragile code or stubs you might want to keep.
- Confirm the agent should not remove code unless the person has explicitly approved that cleanup in the current task.
Rated 2026-10-16 by an automated review of 1 file from the skill's repository.
Source
- Repository
- cursor/plugins (all skills from this repository)
- Path
- pstack/skills/principle-subtract-before-you-add/SKILL.md
- Branch
- main
- Collection
- cursor
- Updated
- 2026-09-23
Related skills
- principle-laziness-protocol — Apply when refactoring, evaluating diff size, or tempted to add abstractions, layers, or signal threading.
- deslop — Remove AI-generated code slop and clean up code style
- principle-migrate-callers-then-delete-legacy-apis — Apply when introducing a new internal API while old callers still exist.
- safe-refactor — Restructure code while preserving behavior. Use for extraction, consolidation, ownership moves, or cleanup where verification must bracket structural edits.
- principle-type-system-discipline — Apply when designing types, reviewing a function signature, or writing code in any statically-typed language.
- typescript-best-practices — TypeScript best practices. Use when reading or editing any .ts or .tsx file.