agentleFS
takealook97takealook97/vat/.agents/skills/change-a-command-contract/SKILL.md

change-a-command-contract

Skill1 starsChanged 3 months agoMITView on GitHub

Change a vat command's output, exit code, or flags without breaking a published contract.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write the failing test first.

    line 29
  2. Very specific:

    Update the command's Usage string so it names every flag the command registers, and no flag it does not.

    line 32
  3. Very specific:

    Update the ## vat <name> section in docs/COMMANDS.md.

    line 34
  4. Very specific:

    If the change alters a file vat writes, update docs/SPEC.md in the same commit.

    line 35
  5. Distinctive:

    If a subcommand was added or removed, update the command table in README.md.

    line 37

≈ “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

Change a command contract

When to use this

A change touches what a command prints, what it exits with, which flags it accepts, what its --json emits, or what it writes to disk. All five are contracts somebody else may already depend on, including scripts nobody in this repository can see.

The --json shape is the easiest to change by accident, because it is usually a struct in another package with no test naming the command it serves. Adding a field is safe. Renaming or removing one is not, and neither is adding rows to a list a consumer filters — if the new rows need different handling, give them a field that says so rather than leaving a consumer to guess from the others.

The rule this implements

A change to a command's output, exit code, or flags needs, in the same commit: the code, its test, and the matching row in docs/COMMANDS.md. Split across two commits, the reference describes a program that does not exist yet.

Steps

  1. Write the failing test first. For CLI behaviour that means a real command against a real temporary workspace — see the fixtures in internal/cli.
  2. Make the change.
  3. Update the command's Usage string so it names every flag the command registers, and no flag it does not.
  4. Update the ## vat <name> section in docs/COMMANDS.md.
  5. If the change alters a file vat writes, update docs/SPEC.md in the same commit. It is normative and other tools may already read what it describes.
  6. If a subcommand was added or removed, update the command table in README.md.
  7. make check.

What catches you if you skip a step

  • TestEveryTopLevelCommandHasASectionInTheReference — a new top-level command with no ## vat <name> heading.
  • TestTheReferenceDocumentsNoCommandThatDoesNotExist — a heading left behind after a removal.
  • TestEveryFlagACommandRegistersAppearsInItsUsageLine and TestEveryUsageLineAdvertisesOnlyFlagsThatExist — the Usage string and the registered flags, compared in both directions.
  • TestTheReferenceStatesTheExitCodesTheCodeUses — the documented exit codes against the ones the code can return.

Shell completion is generated by walking the command tree, so a new subcommand needs no completion edit.

When it must stop

An exit code is the loudest part of the contract, because CI reads it and a human does not. Changing what a code means — rather than adding a new one — is a decision about everybody's pipelines, not a refactor. Report it and let a human choose.

The same applies to removing a flag. Deprecating it in the help text costs nothing; removing it breaks a script silently.

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.