agentleFS
benjaminardbenjaminard/fable-skills/skills/minimal-diff/SKILL.md

minimal-diff

Skill30 starsChanged 4 months agoMITView on GitHub

Scope discipline for code changes. Use whenever writing or editing code: implementing a feature, fixing a bug, or modifying existing files. Trigger especially when tempted to refactor, clean up, add error handling, add configuration options, or restructure code beyond what the task asked for.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    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:

    Do the simplest thing that works well, and only the thing that was asked.

    line 8
  2. Distinctive:

    No hypothetical futures: Do not design for requirements that do not exist yet.

    line 13
  3. Distinctive:

    No impossible-scenario handling: Do not add error handling, fallbacks, or validation for situations that cannot happen.

    line 14
  4. Distinctive:

    Change the code, not around it: Do not add feature flags, compatibility shims, wrapper layers, or "v2" copies when you can simply change …

    line 15
  5. Distinctive:

    Match the surroundings: Write code that reads like the file it lives in: same naming, same idiom, same comment density.

    line 16
  6. Distinctive:

    Before finishing, read your own diff hunk by hunk and ask of each one: *does the task fail without this?*

    line 21
  7. Distinctive:

    If yes, keep it.

    line 23
  8. Distinctive:

    If no, but it fixes something real and separate: revert it, and note the finding in your summary as a suggested follow-up.

    line 24
  9. Distinctive:

    If no, and it is stylistic: revert it without comment.

    line 25

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Minimal Diff

Do the simplest thing that works well, and only the thing that was asked. The size of your diff should be proportional to the size of the request.

The rules

  1. No unrequested work. Do not add features, refactor, or introduce abstractions beyond what the task requires. A bug fix does not need surrounding cleanup. A one-shot operation does not need a helper function. If you notice something worth fixing nearby, mention it in your summary; do not fix it in the same change.
  2. No hypothetical futures. Do not design for requirements that do not exist yet. Avoid premature abstraction and half-finished generalization. The second use case, when it arrives, will tell you what the abstraction should be; guessed abstractions are usually wrong.
  3. No impossible-scenario handling. Do not add error handling, fallbacks, or validation for situations that cannot happen. Trust internal code and framework guarantees. Validate at system boundaries (user input, external APIs) and nowhere else.
  4. Change the code, not around it. Do not add feature flags, compatibility shims, wrapper layers, or "v2" copies when you can simply change the code. Dead paths and parallel versions are debt from the moment they land.
  5. Match the surroundings. Write code that reads like the file it lives in: same naming, same idiom, same comment density. A correct change in a foreign style is still a costly change.
  6. Comments state constraints, not narration. Only write a comment for something the code cannot show, like an external constraint or a non-obvious invariant. Never comment what the next line does, where the code came from, or why your change is correct. That last kind is you talking to a reviewer, and it is noise the moment the change merges.

The pre-submit check

Before finishing, read your own diff hunk by hunk and ask of each one: does the task fail without this?

  • If yes, keep it.
  • If no, but it fixes something real and separate: revert it, and note the finding in your summary as a suggested follow-up.
  • If no, and it is stylistic: revert it without comment.

Why this matters

Every line you touch is a line someone must review, a line that can conflict, and a line that can break. Reviewers trust agents whose diffs contain exactly what was asked. The fastest way to lose that trust is a ten-line fix arriving inside a two-hundred-line cleanup.

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.