agentleFS
requierequie/endostack/skills/principle-subtract-before-you-add/SKILL.md

principle-subtract-before-you-add

Skill4 starsChanged 16 days agoMITView on GitHub

Use when planning the order of an addition, refactor, or rewrite. Clear out dead code and redundancy before building, so the system ends up simpler and no less capable, with a surface the same size or smaller.

47 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-pstack, poteto-help and 3 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • bnemaSkill

    setup-pstack

    Configure which Pi models pstack uses per role. Detects available provider/model specs and writes pstack's user configuration. Use for /setup-pstack, "configure pstack models", or changing pstack model choices.

    Also in 25 projects that use this

  • ianclearySkill

    poteto-help

    Guides users through pstack setup, /poteto-mode, and picking the skill, playbook, or principle for a task. Type /poteto-help with a question.

    Also in 14 projects that use this

  • tristanphvnSkill

    ketchup-video

    Catch the user up like /keel:ketchup, with a short silent video of slides for what happened and the waiting calls as text under it. Use for /keel:ketchup-video.

    Also in 10 projects that use this

  • JoshueOsunaSkill

    Poteto Mode

    poteto's agent style for concise, detailed responses, deliberate subagents, unslopped prose, simple code, and verified work. Use for poteto, /poteto-mode, or requests to work in this style.

    Also in 3 projects that use this

  • instructureSkill

    ketchup

    Rebuild context after /clear by analyzing uncommitted changes across Canvas LMS and all plugin repositories

    Also in 17 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 47 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write only the validators, parsers, and guards that the spec and the real trust boundaries call for.

    line 20
  2. Distinctive:

    When a doc, file, or link target adds nothing new, delete it.

    line 22

“Common” is measured: kept by at least 6 in 10 of the 47 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Subtract before you add

As a system changes, take complexity out before you put new code in. Make simplifying a habit, so every change leaves a design that is simpler, does at least as much, and exposes no more surface than before.

When it applies

Sequencing any addition, refactor, or rewrite. Subtraction is the default.

What to do

  1. Schedule removal work before construction work, and land it in its own commit.
  2. Cut to the minimum before polishing.
  3. Design for observed usage, not hypothetical edge cases.
  4. Write only the validators, parsers, and guards that the spec and the real trust boundaries call for. Validation at a genuine boundary is required (principle-boundary-discipline); a third copy of it deeper in is not.
  5. Apply the same rule to prompts and agent instructions: delete redundant instructions and oversized templates.
  6. When a doc, file, or link target adds nothing new, delete it. Do not leave a stub.

Subtraction shrinks attack surface. Before adding a new admin endpoint, remove the two unused debug endpoints beside it. Dead routes, unused dependencies, and orphaned feature flags are code that still runs, or still ships, with nobody watching it.

The failure it prevents

Building on dead weight, speculative defensive code, and stub files that mislead readers.

Done when

Dead code and redundancy are gone before new code lands.

Related: principle-foundational-thinking, principle-laziness-protocol, principle-sequence-verifiable-units.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.