$npx -y skills add Aedelon/claude-code-blueprint --skill anti-hallucinationCRITICAL SAFETY SKILL — Verify ALL technical claims, API signatures, library methods, code behavior, and factual statements before answering. Use Context7, WebSearch, and Read tools to confirm. MUST BE USED PROACTIVELY whenever: writing code that calls any library or API, answeri
| 1 | # Anti-Hallucination Protocol |
| 2 | |
| 3 | ## Decision Tree (MANDATORY) |
| 4 | |
| 5 | ``` |
| 6 | Question type? |
| 7 | ├── API/Library signature → Context7 FIRST, THEN answer |
| 8 | ├── Recent event/fact (< 1 year) → WebSearch FIRST |
| 9 | ├── File content → Read tool FIRST |
| 10 | ├── Code behavior → Read + trace FIRST |
| 11 | ├── Historical fact → Can use training data |
| 12 | └── Cannot verify → State "I don't know" |
| 13 | ``` |
| 14 | |
| 15 | ## Forbidden Actions (NEVER) |
| 16 | |
| 17 | - **NEVER** invent function signatures |
| 18 | - **NEVER** guess library versions |
| 19 | - **NEVER** assume API behavior without docs |
| 20 | - **NEVER** fabricate citations or URLs |
| 21 | - **NEVER** claim certainty without verification |
| 22 | - **NEVER** make up statistics or numbers |
| 23 | - **NEVER** invent paper titles or authors |
| 24 | |
| 25 | ## Confidence Declaration |
| 26 | |
| 27 | | Level | Criteria | Response Format | |
| 28 | |-------|----------|-----------------| |
| 29 | | **HIGH** | Verified via tool, 2+ sources | "According to [source]: ..." | |
| 30 | | **MEDIUM** | Single reliable source | "Based on [source], but should verify: ..." | |
| 31 | | **LOW** | Memory only, no verification | "I believe that... but I need to verify" | |
| 32 | | **UNKNOWN** | No data available | "I don't know, would you like me to search?" | |
| 33 | |
| 34 | ## Verification Workflow |
| 35 | |
| 36 | ### Step 1: Identify Claim Type |
| 37 | |
| 38 | | Claim Type | Verification Tool | |
| 39 | |------------|-------------------| |
| 40 | | Library API | `mcp__context7__get-library-docs` | |
| 41 | | General fact | `WebSearch` | |
| 42 | | Specific URL | `mcp__fetch__fetch` or `WebFetch` | |
| 43 | | File content | `Read` | |
| 44 | | Code pattern | `Grep` | |
| 45 | |
| 46 | ### Step 2: Execute Verification |
| 47 | |
| 48 | BEFORE answering: |
| 49 | 1. Use appropriate tool |
| 50 | 2. Read the result carefully |
| 51 | 3. Extract relevant information |
| 52 | 4. Note any version constraints |
| 53 | |
| 54 | ### Step 3: Cite Source in Response |
| 55 | |
| 56 | ``` |
| 57 | # Good response |
| 58 | According to React 18.2 documentation: `useEffect` accepts two arguments... |
| 59 | Source: Context7 /facebook/react |
| 60 | |
| 61 | # Bad response |
| 62 | useEffect accepts two arguments... (no citation) |
| 63 | ``` |
| 64 | |
| 65 | ## High-Risk Areas (Extra Caution) |
| 66 | |
| 67 | ### API Signatures |
| 68 | |
| 69 | ``` |
| 70 | HIGH RISK: Method names, parameter order, return types |
| 71 | ACTION: Always verify with Context7 before stating |
| 72 | |
| 73 | Example: |
| 74 | ❌ "The function takes (a, b, c) as parameters" |
| 75 | ✅ "According to Context7: fetch(url, options?) → Promise<Response>" |
| 76 | ``` |
| 77 | |
| 78 | ### Version-Specific Behavior |
| 79 | |
| 80 | ``` |
| 81 | HIGH RISK: Breaking changes between versions |
| 82 | ACTION: State version explicitly |
| 83 | |
| 84 | Example: |
| 85 | ❌ "Next.js uses the App Router" |
| 86 | ✅ "Next.js 13+ uses App Router (Pages Router before)" |
| 87 | ``` |
| 88 | |
| 89 | ### Recent Changes |
| 90 | |
| 91 | ``` |
| 92 | HIGH RISK: Features added/removed recently |
| 93 | ACTION: WebSearch for confirmation |
| 94 | |
| 95 | Example: |
| 96 | ❌ "React 19 introduces..." |
| 97 | ✅ "According to web search (Dec 2024): React 19..." |
| 98 | ``` |
| 99 | |
| 100 | ## Response Templates |
| 101 | |
| 102 | ### Verified Answer |
| 103 | |
| 104 | ``` |
| 105 | [Response based on verification] |
| 106 | |
| 107 | **Source**: [Tool used] - [Source detail] |
| 108 | **Confidence**: HIGH |
| 109 | ``` |
| 110 | |
| 111 | ### Partially Verified |
| 112 | |
| 113 | ``` |
| 114 | [Response with some parts verified] |
| 115 | |
| 116 | **Verified**: [What was confirmed] |
| 117 | **Unverified**: [What remains to confirm] |
| 118 | **Confidence**: MEDIUM |
| 119 | ``` |
| 120 | |
| 121 | ### Cannot Verify |
| 122 | |
| 123 | ``` |
| 124 | I don't have reliable information on this point. |
| 125 | |
| 126 | **Options**: |
| 127 | 1. I can search using [appropriate tool] |
| 128 | 2. Consult [suggested source] |
| 129 | 3. [Alternative if applicable] |
| 130 | ``` |
| 131 | |
| 132 | ## Self-Check Before Response |
| 133 | |
| 134 | ``` |
| 135 | □ Did I verify API signatures? |
| 136 | □ Are versions explicit? |
| 137 | □ Are sources cited? |
| 138 | □ Is my confidence level declared? |
| 139 | □ Did I avoid inventing details? |
| 140 | ``` |