agentleFS
mepottsmepotts/agent-operating-kit/skills/failure-to-rule/SKILL.md

failure-to-rule

Skill0 starsChanged 43 days agoMITView on GitHub

Turn an agent failure into a mechanical guardrail instead of 'be more careful' (log the incident, find the mechanism, add a check that fails and states the fix, and prove it goes red). Use after an agent makes a mistake or a bug ships, or when asked how to stop something recurring, run a postmortem, or add a rule or lint.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 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.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep AGENTS.md short: Add a line only if removing it would cause a mistake.

    line 22

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

Failure to rule

"Be more careful" is not a fix. Each failure becomes a mechanism that makes the same mistake fail loudly next time.

Template: ${CLAUDE_PLUGIN_ROOT}/templates/FAILURE-LOG.md. Command: /agent-operating-kit:postmortem.

If the incident is only described, with no repository, logs or diff at hand, work from the description: say what you could not verify, and give the guardrail as a design the user can adopt, including how to prove it goes red on a failing fixture and the FAILURE-LOG.md entry to record.

Steps

  1. Reconstruct from evidence (diff, logs, transcript excerpts), not from the agent's account of itself. Note how late it was detected.
  2. Find the mechanism. Why did the process allow this (not who did it).
  3. Pick the strongest guardrail that fits, in this order: (a) a deterministic check in the verify or gate command. (b) a hard guard, such as a permission deny rule or a script that refuses by default. (c) a required field in a template that forces the evidence. (d) one line in AGENTS.md.
  4. Build it with two fixtures: one that must fail and one that must pass. The failure message states the fix.
  5. Break it, confirm red. Show the check going red on the failing fixture. A gate with no observed red is unproven. Suites generated from a directory or manifest can go silent when the target disappears, so drive cases from live discovery plus a committed snapshot, and never regenerate the snapshot to silence a failure.
  6. Search for twins: the same defect shape nearby, such as duplicate implementations, sibling call sites, or the same guard at a small size. Fix or log each.
  7. Log it in FAILURE-LOG.md: mechanism, guardrail, where it lives, the break-it proof, twins found, a review date.
  8. Keep AGENTS.md short. Add a line only if removing it would cause a mistake. After review, merge or delete rules that no longer earn their place.

Never

  • Weaken or skip a gate to get a candidate through.
  • Regenerate a snapshot or a baseline to silence a failure.
  • Count rules as progress. Count failures that can no longer recur.
  • Change shared files (AGENTS.md, CI config) without the owner's approval. Propose the diff.

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.