failure-learning
Skill19 starsChanged 37 days agoMITView on GitHub
Propose a reusable lesson after a meaningful implementation mistake. Use when a wrong assumption, convention violation, or repeated error was corrected by tests, the reviewer, or the developer.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- broSkill
- closingSkill
- context-auditSkill
- decision-logSkill
- dependency-freshnessSkill
- documentation-updateSkill
- git-disciplineSkill
- goblin-modeSkill
- project-mapSkill
- run-and-verifySkill
- spec-from-screenshotSkill
- ui-qaSkill
- sdd-updateSkill
- sdd-workflowSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
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 66
Write only where the developer chose:
- Distinctive: line 76
If the developer does not answer, write nothing.
- Distinctive: line 77
If the same lesson is proposed twice, that is a signal it belongs in a more visible place (e.g.
- Distinctive: line 88
Never write any memory (project or global) without explicit approval of the specific entry text.
- Distinctive: line 90
Prefer project memory; global memory only via option 1 above.
- Distinctive: line 91
Never record secrets, credentials, or personal data in a lesson.
≈ “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 learning
Purpose
Capture reusable lessons from real mistakes so they are not repeated — always as a proposal to the developer, never as a silent memory write.
Kit source note: the full memory policy (layers, storage rules, security) lives in
reference/memory-policy.md; the entry format lives intemplates/memory/failure-learning-entry.md. When installing this pack, the entry template is copied next to this file asentry-template.md.
When to use
A memorable failure happened, such as:
- failed tests caused by a wrong project convention;
- the reviewer found an architectural violation;
- the developer corrected a repeated assumption;
- the wrong command/tool was used;
- code was edited outside the approved scope;
- the wrong API/framework pattern was used;
- the same error happened more than once.
When not to use
Do not memorize:
- one-off syntax mistakes or typos;
- secrets, credentials, or tokens — never, in any layer;
- personal/private data unrelated to the project;
- speculative conclusions the developer has not confirmed;
- project-specific rules in global memory, unless the developer explicitly approved exactly that.
Required inputs
- What went wrong, the root cause, and the correction.
- The source task/spec/review where it happened.
Procedure
- Draft the entry using
entry-template.md(title, date, scope, trigger, what went wrong, root cause, rule to remember, where to apply, where not to apply, source task/spec/review). Show the exact proposed text and ask — this prompt is mandatory before any memory write:
I found a reusable lesson from this mistake: <proposed memory entry> Do you want me to add this to memory? 1. Yes, global memory. 2. Yes, project memory only. 3. No, keep it only in the review/history. 4. Revise the wording first.- Write only where the developer chose:
- Global memory (option 1): append to the user memory file
the harness's user-level instruction file (Claude Code
~/.claude/CLAUDE.md, Codex~/.codex/AGENTS.md, others perreference/memory-policy.md). Only after this explicit choice; verify the entry is project-independent and contains no project internals. - Project memory (option 2, the default recommendation): append to
the project's decision log (e.g.
decisions/failure-learnings.md). - Review/history (option 3): record in the task's
review.mdorhistory.md; no memory write. - Revise (option 4): rewrite and ask again. If the developer does not answer, write nothing.
- Global memory (option 1): append to the user memory file
the harness's user-level instruction file (Claude Code
- If the same lesson is proposed twice, that is a signal it belongs in a
more visible place (e.g. an
AGENTS.mdrule) — suggest that explicitly, still requiring approval.
Output artifact
An approved lesson entry in the layer the developer chose — nothing if the developer declines.
Safety constraints
- Never write any memory (project or global) without explicit approval of the specific entry text.
- Prefer project memory; global memory only via option 1 above.
- Never record secrets, credentials, or personal data in a lesson.
- Advisory hooks may suggest running this skill; they never write memory.
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.

