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.
In this repository6 other files it gives its agents.
- templates/AGENTS.mdAGENTS.md
- handoffSkill
- refute-reviewSkill
- release-gateSkill
- risk-tiersSkill
- sprint-specSkill
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
- Distinctive: line 22
Keep
AGENTS.mdshort: Add a line only if removing it would cause a mistake.
≈ “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.
Files
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
- Reconstruct from evidence (diff, logs, transcript excerpts), not from the agent's account of itself. Note how late it was detected.
- Find the mechanism. Why did the process allow this (not who did it).
- 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. - Build it with two fixtures: one that must fail and one that must pass. The failure message states the fix.
- 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.
- 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.
- Log it in
FAILURE-LOG.md: mechanism, guardrail, where it lives, the break-it proof, twins found, a review date. - Keep
AGENTS.mdshort. 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.
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
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.

