AGENT SKILL

failure-to-rule

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.

License 许可
MIT
最近更新
2026-10-04
Stars
★ 0
Forks
0

01 前言 Front Matter

name
failure-to-rule
description
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.

03 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.

04 同仓库更多 Skills

mepotts
mepotts/agent-operating-kit

sprint-spec

Write a sprint spec before any code (outcome, file boundaries, risk tier, acceptance checks, isolation). Use when the user wants to plan, scope or spec work for an AI coding agent, asks for a definition of done or acceptance criteria, or is about to start a feature, fix, refactor or migration.

★ 0
mepotts
mepotts/agent-operating-kit

risk-tiers

Pick how much review a change needs by risk tier 0 to 4 (docs, feature code, schema or shared state, production data or irreversible actions, security surface). Use when asked how much review, testing or sign-off a change needs, or before merging anything that touches migrations, auth, deletes, publishing, spending or user data.

★ 0
mepotts
mepotts/agent-operating-kit

release-gate

Run an exact-candidate release gate (freeze one source revision, run the declared checks once each, keep hashed evidence, get an independent evidence review, and only then call it ready). Use when asked whether something is ready to release or ship, to freeze a candidate, or to set up or run a release gate.

★ 0
mepotts
mepotts/agent-operating-kit

refute-review

Verify that an agent's work is really done by trying to refute it (re-run the checks, read the assertions, run a red-green proof, demand evidence). Use when an agent or person claims work is done, fixed, passing or ready to merge, when asked to review, double-check, audit or independently verify a change, or when asked how to check an agent's claim.

★ 0
mepotts
mepotts/agent-operating-kit

handoff

Make work resumable across sessions, agents and vendors (write a checkpoint before stopping and resume from one cold). Use when a usage or context limit is near, when switching to another agent or tool, when stopping mid-task, when picking up unfinished work, or when running parallel agent lanes.

★ 0