agent-failure-to-eval
Skill0 starsChanged 4 months agoMITView on GitHub
Turn a production failure (a bad agent run/trace, a user complaint, a near-miss) into a permanent regression guard — a new eval case, an optional guardrail update, and a ledger entry. Use every time the running agent does something wrong and you want to make sure it can't silently come back. Trigger on "this run went wrong", "the agent did X it shouldn't", "add an eval for this", "turn this bug into a test", "post-mortem this trace", even without those words. This is the growth-loop step of the agent-dev-framework pipeline — the one you run weekly forever, not once.
In this repository14 other files it gives its agents.
- agent-altitudeSkill
- agent-brainstormSkill
- agent-build-planSkill
- agent-competitiveSkill
- agent-data-and-evalsSkill
- agent-guardrailsSkill
- agent-monitoringSkill
- agent-prd-gateSkill
- agent-prdSkill
- agent-prompt-and-contractSkill
- agent-security-and-constraintsSkill
- agent-system-designSkill
- agent-tech-specSkill
- agent-ux-specSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
(2) an optional guardrail update: if it's a new *kind* of failure, and (3) a ledger line so the loop itself is auditable.
- Very specific: line 20
Follow _conventions.md (read-first order, docs/ vs artifacts/, don't-clobber guard, the decisions ledger, and — especially here — the …
- Very specific: line 24
Read PROJECT.md (esp. §4 success definition and the unacceptable-failure list), artifacts/evals/eval-cases.jsonl (the case format you'll …
≈ “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 → Eval (the growth loop)
Steps 00–12 run roughly once per project. This one runs every week for the life of the product. It is the engine behind the single most important sentence in the framework — "every production failure becomes an eval case so the same mistake can't silently return" — and for a solo founder it's the highest-ROI skill in the set, because it's the one you'll actually run over and over.
The job: take one thing the agent got wrong and convert it into a permanent guard, so a future change can't quietly reintroduce it. Three outputs, in priority order: (1) a new eval case, (2) an optional guardrail update if it's a new kind of failure, and (3) a ledger line so the loop itself is auditable.
Conventions
Follow _conventions.md (read-first order, docs/ vs artifacts/, don't-clobber guard,
the decisions ledger, and — especially here — the append-only rule for ledgers).
Before you start
Read PROJECT.md (esp. §4 success definition and the unacceptable-failure list),
artifacts/evals/eval-cases.jsonl (the case format you'll append to), and
artifacts/guardrails.md (the failure taxonomy and handling policy — the modes you'll classify
against). The input is one concrete failure: a bad trace/run, a user complaint, or a
near-miss the user describes. If there's no trace, reconstruct the minimal input that triggered it.
Steps
- Triage — what actually went wrong, in one line. Name the failure precisely (not "it was bad" — "it recommended an action with no supporting evidence and the user almost approved it"). Distinguish the symptom from the cause where you can.
- Classify against the failure taxonomy. Match it to an existing mode in
artifacts/guardrails.md. Two outcomes:- Known mode → this is a new instance of a failure you already anticipated. Good — the guardrail exists; you just need the regression case (step 3).
- New mode → the taxonomy didn't predict this. Flag it for a guardrail update (step 4). A new mode is the more valuable find; say so.
- Reduce to a minimal eval case and append it. Strip the incident to the smallest input
that reproduces the failure, then write a case in the same shape as
evals/eval-cases.jsonl:input— the concrete task/trace that triggered it (minimal, real).expected— the correct behavior, OR a grading rubric.check— deterministic (right tool? valid output? under budget? refused when it should?) or judgment-based (LLM-judge / human) — prefer deterministic where the failure allows it.mode— offline (runs before every release) — a caught production failure almost always becomes an offline regression guard.source—"incident:<id/date>"so the case traces back to why it exists. Append toartifacts/evals/eval-cases.jsonl(never rewrite the file). If it maps to an unacceptable-failure line in PRD §4, note that — those deserve deterministic checks.
- If it's a new mode — propose a guardrail update (don't silently apply). Draft the row it
adds to
artifacts/guardrails.md: the failure mode + the handling policy (retry / fallback / escalate / refuse). Present it to the user; updateguardrails.mdonly on their nod, then record the change in the decisions ledger (artifacts/decisions.md). - Log the loop. Append one line to
artifacts/evals/failure-ledger.jsonlso the growth loop is itself auditable and you can see the failure rate trend over time:{"incident": "<id/date>", "trace": "<ref or 'described'>", "failure": "<one line>", "mode_status": "known | new", "eval_case_id": "<id>", "guardrail_changed": false, "timestamp": "<ISO-8601>"}
Feeds
This step is where agent-guardrails and agent-data-and-evals keep growing after
launch. It closes the loop agent-monitoring opens: monitoring finds the bad runs, this
step converts them into guards. The eval set that began in the PRD (§5 acceptance evals) and
expanded in the data-and-evals step grows here, one production failure at a time, forever.
Output
- Append one case to
artifacts/evals/eval-cases.jsonl(apply guard: append, never overwrite). - Optionally, a proposed/approved row in
artifacts/guardrails.md(+ adecisions.mdline). - Append one line to
artifacts/evals/failure-ledger.jsonl.
End by stating: the one-line failure, whether it was a known or new mode (new modes are the ones worth celebrating — the taxonomy just got smarter), the id of the eval case you added, and whether a guardrail changed. If the same mode is showing up repeatedly in the ledger, say so — a recurring mode means the guardrail isn't holding and needs rethinking, not another eval case.
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.

