|
| 1 | +# Skill-Documentation-008: Amnesiac-Proof Documentation Verification |
| 2 | + |
| 3 | +**Statement**: Verify agent documentation with critic before commit using amnesiac execution test. |
| 4 | + |
| 5 | +**Context**: After updating agent documentation (*.md files in src/claude/, templates/agents/, AGENTS.md, or .agents/agents/) |
| 6 | + |
| 7 | +**Evidence**: Session 2025-12-23 (Issue #307) - Critic verification caught 4 gaps in skillbook.md and 5 gaps in memory.md before commit. All [FAIL] items converted to [PASS] with objective fixes. |
| 8 | + |
| 9 | +**Atomicity**: 98% | **Impact**: 10/10 |
| 10 | + |
| 11 | +**Tags**: #P0, #BLOCKING (for documentation quality) |
| 12 | + |
| 13 | +## Pattern |
| 14 | + |
| 15 | +Before committing agent documentation, run this 5-step protocol: |
| 16 | + |
| 17 | +### Step 1: Self-Review |
| 18 | + |
| 19 | +Ask: "What would an amnesiac agent NOT know from this documentation?" |
| 20 | + |
| 21 | +List specific gaps (file naming, numbering, decision criteria, etc.) |
| 22 | + |
| 23 | +### Step 2: Invoke Critic |
| 24 | + |
| 25 | +```python |
| 26 | +Task( |
| 27 | + subagent_type="critic", |
| 28 | + prompt="""Review [file] for completeness. An amnesiac agent will read ONLY this file. |
| 29 | +
|
| 30 | + Can they: |
| 31 | + 1. [Specific capability question 1] |
| 32 | + 2. [Specific capability question 2] |
| 33 | + 3. [...] |
| 34 | +
|
| 35 | + Report [PASS]/[FAIL] for each with objective gap identification.""" |
| 36 | +) |
| 37 | +``` |
| 38 | + |
| 39 | +### Step 3: Fix All [FAIL] Items |
| 40 | + |
| 41 | +For each [FAIL], apply objective fixes: |
| 42 | + |
| 43 | +| Gap Type | Fix Pattern | |
| 44 | +|----------|-------------| |
| 45 | +| Undefined criteria | Add decision tree with explicit branches | |
| 46 | +| Missing procedure | Add numbered steps with actual commands | |
| 47 | +| Vague terms | Replace with quantified thresholds or mapping tables | |
| 48 | +| Ambiguous references | Add grep commands or file path examples | |
| 49 | + |
| 50 | +**Required fix quality**: |
| 51 | +- NOT "when appropriate" → INSTEAD "when X > threshold Y" |
| 52 | +- NOT "similar to" → INSTEAD "grep command: `grep -r 'pattern' path/`" |
| 53 | +- NOT "as needed" → INSTEAD "if condition A then action B, else action C" |
| 54 | + |
| 55 | +### Step 4: Re-Run Critic |
| 56 | + |
| 57 | +Invoke critic again with same questions. Repeat Step 3 until all [PASS]. |
| 58 | + |
| 59 | +### Step 5: Commit With Verification Evidence |
| 60 | + |
| 61 | +Include in commit message: |
| 62 | +``` |
| 63 | +[PASS] Critic verification: all amnesiac execution tests |
| 64 | +
|
| 65 | +Verified: [list of capability questions] |
| 66 | +``` |
| 67 | + |
| 68 | +## Anti-Pattern |
| 69 | + |
| 70 | +**NEVER**: |
| 71 | +- Commit documentation without critic verification |
| 72 | +- Accept vague terms ("when appropriate", "as needed", "similar to") |
| 73 | +- Assume prior context will be available to future agents |
| 74 | + |
| 75 | +**Example of vague (REJECT)**: |
| 76 | +> "Choose the appropriate index for your skill" |
| 77 | +
|
| 78 | +**Example of objective (ACCEPT)**: |
| 79 | +> "Match skill keywords to memory-index.md Task Keywords column. If >50% overlap exists, use that domain's index. If <50% overlap AND 5+ skills expected, create new domain index. Else use closest related domain." |
| 80 | +
|
| 81 | +## Related |
| 82 | + |
| 83 | +- **ENABLES**: Skill-Documentation-007 (provides HOW to achieve self-containment principle) |
| 84 | +- **ENABLES**: All agent documentation updates |
| 85 | +- **REFERENCES**: Skill-Quality-002 (QA routing pattern, critic-as-gate) |
0 commit comments