agentleFS
chalk-labchalk-lab/Mooncake.jl/.claude/skills/minimise/SKILL.md

minimise

Skill413 starsChanged 5 months agoMITView on GitHub

Prune a bug fix or new tests down to the smallest correct diff through multiple elimination passes. Use before committing any fix or test addition.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the diff: Run git diff HEAD (or git diff --cached if staged) and read every changed file in full.

    line 15
  2. Distinctive:

    If so, drop the new test entirely.

    line 22
  3. Distinctive:

    Remove non-essential changes: Delete anything that does not answer "yes" to the first question above.

    line 24
  4. Very specific:

    Run the minimal test group: Use the smallest focused test group that exercises the changed code (see test/runtests.jl for group names).

    line 28
  5. Distinctive:

    Stop when every remaining line answers "yes" to: *if I remove this, the targeted bug reappears or the targeted test fails*.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Minimise

The goal is to remove every line that is not strictly required for correctness, then verify the result still passes the relevant tests.

Process

Repeat the following until no further reductions are possible:

  1. Read the diff. Run git diff HEAD (or git diff --cached if staged) and read every changed file in full.
  2. Challenge each change. For every changed line ask:
    • Would removing this line cause a test to fail or a bug to reappear?
    • Is this a cleanup, rename, refactor, or comment that is not load-bearing?
    • For new tests: does an existing test already cover this behaviour? If so, drop the new test entirely.
  3. Remove non-essential changes. Delete anything that does not answer "yes" to the first question above. Prefer shrinking an existing case over adding a new one.
  4. Run the minimal test group. Use the smallest focused test group that exercises the changed code (see test/runtests.jl for group names). Confirm all tests pass before continuing.
  5. Repeat from step 1 until a full pass produces no further removals.

Heuristics

  • A one-line fix is better than a five-line fix.
  • A new test case added to an existing @testset is better than a new @testset.
  • A new value constructor in src/test_resources.jl should be the minimum needed to instantiate the type under test; no extra fields or variants.
  • Comments and blank lines added alongside a fix are not load-bearing; remove them unless they explain something non-obvious.
  • Helper functions introduced solely for the fix are a red flag; inline them.

When to stop

Stop when every remaining line answers "yes" to: if I remove this, the targeted bug reappears or the targeted test fails. At that point report the final diff and suggest committing.

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.