agentleFS
Sapere-IASapere-IA/sdd-onboarding-kit/skills/optional/failure-learning/SKILL.md

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.

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
  1. Distinctive:

    Write only where the developer chose:

    line 66
  2. Distinctive:

    If the developer does not answer, write nothing.

    line 76
  3. Distinctive:

    If the same lesson is proposed twice, that is a signal it belongs in a more visible place (e.g.

    line 77
  4. Distinctive:

    Never write any memory (project or global) without explicit approval of the specific entry text.

    line 88
  5. Distinctive:

    Prefer project memory; global memory only via option 1 above.

    line 90
  6. Distinctive:

    Never record secrets, credentials, or personal data in a lesson.

    line 91

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 in templates/memory/failure-learning-entry.md. When installing this pack, the entry template is copied next to this file as entry-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

  1. 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).
  2. 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.
  3. 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 per reference/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.md or history.md; no memory write.
    • Revise (option 4): rewrite and ask again. If the developer does not answer, write nothing.
  4. If the same lesson is proposed twice, that is a signal it belongs in a more visible place (e.g. an AGENTS.md rule) — 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.

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.