{
  "name": "shared-failure-to-skill",
  "family": "the loop",
  "description": "Use when the owner reports a recurring failure, repeated fix, or systemic issue. Convert the failure into a skill and a mechanical gate so it stops repeating.",
  "body": "\n# Failure → Skill — stop the same problem from recurring\n\n## Overview\nWhen the owner has to fix the same thing twice, the build has failed to learn. This skill turns every recurring failure into a durable skill/article plus a mechanical gate so the failure cannot happen again.\n\n## When to Use\n- The owner says \"this keeps happening\", \"I already fixed this\", \"same problem as last time\", or expresses anger about repeated failures.\n- A governor/audit report shows the same error class, collision type, or owner-restatement count recurring.\n- You find yourself about to apply the same fix more than once.\n\n## Core Pattern\n\n```\nVerify failure exists → Fix root cause → Add mechanical gate → Write skill → Verify counts drop\n```\n\n1. **Verify the failure with fresh evidence.** Do not trust a summary that says \"done\". Run the governor, read the ledger, or reproduce the failure yourself.\n2. **Fix the root cause, not the symptom.** One fix. If the fix touches shared files, claim them first.\n3. **Add a mechanical gate** so the failure is blocked automatically:\n   - Code pattern failures → pre-commit check or protected-feature check.\n   - Owner-restatement failures → `shared-rule-capture` skill + governor detector.\n   - Write collisions → `shared-write-law` + `FILE_CLAIM` enforcement.\n   - Published garbage → cleanup script + check.\n4. **Write the skill** that encodes the detection + fix + gate. The skill is the article. It must load automatically for every future agent.\n5. **Verify the failure count drops** before declaring anything fixed. Evidence only.\n\n## Rules\n\n- **Do not ask permission to fix a failure.** The owner asked you to fix it. Fix it.\n- **Do not bring new problems.** A fix that creates a new failure mode is not a fix.\n- **A skill without a gate is half-done.** Abstract advice does not stop recurrence; code does.\n- **Verify before declaring.** Run the governor, run the checks, look at the ledger. Numbers must move.\n- **Capture the owner's meta-rules in the same turn.** If the owner states a principle (\"don't use my name\", \"convert failures to skills\"), write a skill for it immediately.\n\n## Red Flags\n\n- \"I can just patch this now and document later.\"\n- \"The owner can approve the skill after I write it.\"\n- \"This is a one-time issue, no need for a skill.\"\n- \"The fix is obvious, I don't need to verify.\"\n- Declaring work complete while checks still fail or counts haven't dropped.\n\n## Verify\n\nBefore saying a failure is fixed:\n- The mechanical gate runs and blocks the failure mode.\n- The skill is written and placed where all agents load it.\n- Governor/ledger evidence shows the recurrence count dropped.\n",
  "raw": "---\nname: shared-failure-to-skill\ndescription: Use when the owner reports a recurring failure, repeated fix, or systemic issue. Convert the failure into a skill and a mechanical gate so it stops repeating.\n---\n\n# Failure → Skill — stop the same problem from recurring\n\n## Overview\nWhen the owner has to fix the same thing twice, the build has failed to learn. This skill turns every recurring failure into a durable skill/article plus a mechanical gate so the failure cannot happen again.\n\n## When to Use\n- The owner says \"this keeps happening\", \"I already fixed this\", \"same problem as last time\", or expresses anger about repeated failures.\n- A governor/audit report shows the same error class, collision type, or owner-restatement count recurring.\n- You find yourself about to apply the same fix more than once.\n\n## Core Pattern\n\n```\nVerify failure exists → Fix root cause → Add mechanical gate → Write skill → Verify counts drop\n```\n\n1. **Verify the failure with fresh evidence.** Do not trust a summary that says \"done\". Run the governor, read the ledger, or reproduce the failure yourself.\n2. **Fix the root cause, not the symptom.** One fix. If the fix touches shared files, claim them first.\n3. **Add a mechanical gate** so the failure is blocked automatically:\n   - Code pattern failures → pre-commit check or protected-feature check.\n   - Owner-restatement failures → `shared-rule-capture` skill + governor detector.\n   - Write collisions → `shared-write-law` + `FILE_CLAIM` enforcement.\n   - Published garbage → cleanup script + check.\n4. **Write the skill** that encodes the detection + fix + gate. The skill is the article. It must load automatically for every future agent.\n5. **Verify the failure count drops** before declaring anything fixed. Evidence only.\n\n## Rules\n\n- **Do not ask permission to fix a failure.** The owner asked you to fix it. Fix it.\n- **Do not bring new problems.** A fix that creates a new failure mode is not a fix.\n- **A skill without a gate is half-done.** Abstract advice does not stop recurrence; code does.\n- **Verify before declaring.** Run the governor, run the checks, look at the ledger. Numbers must move.\n- **Capture the owner's meta-rules in the same turn.** If the owner states a principle (\"don't use my name\", \"convert failures to skills\"), write a skill for it immediately.\n\n## Red Flags\n\n- \"I can just patch this now and document later.\"\n- \"The owner can approve the skill after I write it.\"\n- \"This is a one-time issue, no need for a skill.\"\n- \"The fix is obvious, I don't need to verify.\"\n- Declaring work complete while checks still fail or counts haven't dropped.\n\n## Verify\n\nBefore saying a failure is fixed:\n- The mechanical gate runs and blocks the failure mode.\n- The skill is written and placed where all agents load it.\n- Governor/ledger evidence shows the recurrence count dropped.\n",
  "files": [
    {
      "path": "SKILL.md",
      "bytes": 2869
    }
  ],
  "has_license_file": false,
  "source": {
    "repo": "this build",
    "url": "/a/skill-law",
    "license": "site"
  },
  "prevents": [
    {
      "date": "2026-07-22",
      "failure": "The owner had to report the same failure twice; recurring failures were fixed in chat and forgotten instead of converted into a skill plus a mechanical gate."
    }
  ],
  "canonical_source": ".claude/skills/shared-failure-to-skill/SKILL.md",
  "sibling": ".agents/skills/shared-failure-to-skill/SKILL.md"
}