agentleFS
wrg32786wrg32786/aigent-os/skills/learn-from-failure/SKILL.md

learn-from-failure

Skill19 starsChanged 4 months agoMITView on GitHub

When a failure occurs, classify it, check for repetition, and produce a durable artifact that prevents recurrence. /learn-from-failure or /learn-from-failure <failure description> Caddy auto-surfaces on: "same issue", "happened again", "recurring", "third time", "keeps happening" Per [[Self-Learning Doctrine]]: a failure logged without an artifact is a false resolution. The ledger grows, the failure recurs, the system learns nothing.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When a failure occurs, classify it, check for repetition, and produce a durable artifact that prevents recurrence.

    line 3
  2. Distinctive:

    If argument provided: use it

    line 14
  3. Distinctive:

    If no argument: ask "What failed?"

    line 15
  4. Very specific:

    Read $AIGENT_VAULT/memory/FAILURE_MODES.md.

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

/learn-from-failure — Convert failure to reusable artifact

When a failure occurs, classify it, check for repetition, and produce a durable artifact that prevents recurrence.

Trigger

/learn-from-failure or /learn-from-failure <failure description>

Caddy auto-surfaces on: "same issue", "happened again", "recurring", "third time", "keeps happening"

Flow

1. Identify failure

  • If argument provided: use it
  • If no argument: ask "What failed?"

2. Classify failure mode

ModeDescriptionExample
routingTask sent to wrong agent/model/toolOpus used for a read-only task
verificationOutput accepted without checking data flowVideo "looked fine" but spec was wrong
toolTool unavailable, broken API, wrong usageGmail MCP auth expired
knowledgeAgent lacked domain knowledgeDidn't know SDK v6 changed type strings
authorityAgent acted outside delegation zonethe AIgent made a Level 3 decision

3. Check for repetition

Read $AIGENT_VAULT/memory/FAILURE_MODES.md. Search for Pattern lines matching the current failure's root cause.

  • 0-1 prior occurrences: Phase 1 — log and monitor
  • 2+ occurrences: Phase 2 — mandatory artifact. A log entry is not enough.
  • 3+ occurrences: The prior artifact failed. Diagnose why and fix or replace it.

4. Log to FAILURE_MODES.md

Append a new entry following the existing format:

## {YYYY-MM-DD} — {short symptom name}

**Symptom:** {what went wrong, user-visible}
**Verified cause:** {exact mechanism}
**Fix:** {what was done}
**Layer:** {which system layer}
**Pattern:** {one-line category — this is the load-bearing piece for repetition detection}

5. Determine artifact type

Failure modeArtifactTarget
routingCaddy trigger or hook.claude/hooks/ or .claude/skill-index.json
verificationChecklist item in doctrineRelevant doctrine note
toolSKILL_GAPS entry + skill specmemory/SKILL_GAPS.md
knowledgeVault note or memory candidateconcepts/ or memory/
authorityFlag to the operatoraigent_authority_matrix.md

6. Create artifact

  • For routing: draft a Caddy enrollment entry with 3+ trigger phrases
  • For verification: append a concrete, runnable check to the relevant doctrine
  • For tool: log to SKILL_GAPS.md, suggest /skill-hunt if external capability needed
  • For knowledge: write a memory candidate or vault note
  • For authority: surface to the operator with recommendation

7. Output

Failure logged: {classification}
Pattern: {pattern line}
Repeated: {yes/no, count}
Artifact: {type} at {path}

Boundary

Per [[Self-Learning Doctrine]]: a failure logged without an artifact is a false resolution. The ledger grows, the failure recurs, the system learns nothing.

Related

  • [[concepts/Self-Learning Doctrine]] — the doctrine this skill implements
  • [[memory/FAILURE_MODES.md]] — the ledger
  • [[concepts/Capability Expansion Doctrine]] — tool failures feed the expansion loop
  • [[Self-Improving CLAUDE.md]] — the broader self-improvement cycle

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.