Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add wrg32786/aigent-os --skill learn-from-failuregit clone --depth 1 https://github.com/wrg32786/aigent-osWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/wrg32786/aigent-os/learn-from-failure)<a href="https://agentmods.dev/skills/wrg32786/aigent-os/learn-from-failure"><img src="https://agentmods.dev/badge/skills/wrg32786/aigent-os/learn-from-failure/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/wrg32786/aigent-os/learn-from-failure"><img src="https://agentmods.dev/badge/skills/wrg32786/aigent-os/learn-from-failure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Excessive Agency · line 22 Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00781 |
| Opus 5.5 | $0.00000 | $0.00312 |
| Sonnet 5.5 | $0.00000 | $0.00156 |
| Haiku 4.5 | $0.00000 | $0.00078 |
Grade A, and why
learn-from-failure scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/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
| Mode | Description | Example |
|---|---|---|
routing |
Task sent to wrong agent/model/tool | Opus used for a read-only task |
verification |
Output accepted without checking data flow | Video "looked fine" but spec was wrong |
tool |
Tool unavailable, broken API, wrong usage | Gmail MCP auth expired |
knowledge |
Agent lacked domain knowledge | Didn't know SDK v6 changed type strings |
authority |
Agent acted outside delegation zone | the 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 mode | Artifact | Target |
|---|---|---|
routing |
Caddy trigger or hook | .claude/hooks/ or .claude/skill-index.json |
verification |
Checklist item in doctrine | Relevant doctrine note |
tool |
SKILL_GAPS entry + skill spec | memory/SKILL_GAPS.md |
knowledge |
Vault note or memory candidate | concepts/ or memory/ |
authority |
Flag to the operator | aigent_authority_matrix.md |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 82 lines · 0 tokens per session scan A 78451ac18e14
learn-from-failure is a skill published in the GitHub repository wrg32786/aigent-os (23 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 781 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.
Other skills, from other repositories
skillify-meta-loop
Use when a recurring bug, support question, client incident, or manual task surfaces 2+ times, when a codified rule keeps getting violated despite being written down, when a teammate or client hits an issue anyone could hit, or when delivery/setup friction repeats. Triggers: "skillify this", "this keeps happening"…
diagnose
Use when an AI Brain vault needs a health check or something feels off: Claude ignores CLAUDE.md, journal entries missing from /weekly, hooks not firing, something broke after a git pull, a friend's install misbehaves, Obsidian crashes or pegs the CPU, a .claude/worktrees folder appeared, Granola/WhatsApp/Slack/Gmail…
error-recovery
A guide to detecting and recovering from failures in long-running AI agents. It covers API outages, bad tool calls, broken conversation state, stalled streams, repeated loops, retries, fallback models, and circuit breakers that stop repeated failure.
coding-agent-harness
A guide to building the surrounding system that lets an AI agent safely work on code. This system provides tools, rules, tests, feedback, permissions, and ways to undo changes.
graphify
Use when the user invokes /graphify or asks to build, update, or query a knowledge graph from a folder of files (code, docs, papers, notes, images). Triggers: 'map this codebase', 'graph my notes', 'what is connected across these files', 'community detection', 'GraphRAG', incremental graph update, Neo4j/SVG/GraphML…
insights
Use when the user types /weekly or /monthly, asks for a weekly or monthly journal review or retrospective, asks 'how was my week' or 'how was my month', or wants trends, anomalies, or patterns across recent journal entries. Also fires when regenerating an insight report for a past week or month. NOT for writing…