Agent skill
dehallucination
Use when verifying that claims, references, or assertions are grounded in reality rather than fabricated. Triggers: 'does this actually exist', 'is this real', 'did you hallucinate', 'verify these references', 'check if this is fabricated', 'reality check', 'ground truth'. Also invoked as quality gate by roundtable feedback, the Forged workflow, and after deep-research verification.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/dehallucination
SKILL.md
Dehallucination
Reasoning Schema
Before verification: artifact under review, context sources, specific concerns, verification scope.
After verification: all claims assessed, confidence levels assigned, hallucinations flagged, recovery actions defined.
Invariant Principles
- Claims Require Evidence: Every factual assertion needs citation or explicit confidence level.
- Uncertainty Is Honest: "I don't know" beats confident wrong answer.
- Hallucinations Compound: One false claim in requirements → many bugs in implementation.
- Context Grounds Truth: Verify against available context, not assumed knowledge.
- Recovery Is Mandatory: Detected hallucinations require explicit correction, not silent fixes.
Inputs / Outputs
| Input | Required | Description |
|---|---|---|
artifact_path |
Yes | Path to artifact to verify |
context_sources |
No | Paths to context files for verification |
feedback |
No | Roundtable feedback indicating hallucination concerns |
| Output | Type | Description |
|---|---|---|
verification_report |
Inline | Claims and their status |
corrected_artifact |
File | Artifact with hallucinations corrected |
confidence_map |
Inline | Map of claims to confidence levels |
Hallucination Categories
| Category | Pattern | Detection |
|---|---|---|
| Fabricated References | Citing non-existent files, functions, APIs | Check if path/function/endpoint exists |
| Invented Capabilities | Asserting features that don't exist | Verify against actual library/framework API |
| False Constraints | Stating non-existent limitations | Check if constraint is documented |
| Phantom Dependencies | Assuming unavailable dependencies | Check requirements, config |
| Temporal Confusion | Mixing planned vs implemented | Check current codebase state |
Confidence Levels
| Level | Evidence Required |
|---|---|
| VERIFIED | Direct evidence (file, code, docs) |
| HIGH | Multiple supporting signals |
| MEDIUM | Context supports but not confirmed |
| LOW | Limited or conflicting evidence |
| UNVERIFIED | No supporting evidence |
| HALLUCINATION | Evidence contradicts claim |
Assessment Process
- Identify claim type: existence, behavior, constraint, or relationship
- Gather evidence: codebase, docs, deps, config
- Assign confidence: based on evidence strength
- Document:
CLAIM: "[text]" | TYPE: [type] | EVIDENCE: [checked] | CONFIDENCE: [level]
Detection Protocol
- Extract claims: existence, capability, constraint, relationship statements
- Categorize by risk: Critical (security, deps, APIs) > High (implementation) > Medium (config) > Low (docs)
- Verify critical first: Check, document, assign confidence, flag HALLUCINATION if contradicted
- Report: Summary stats, critical hallucinations (blocking), warnings, coverage
Recovery Protocol
When HALLUCINATION detected:
- Isolate: Exact text, location, dependents
- Trace propagation: Other artifacts referencing this claim
- Correct at source: Mark as corrected with reason and evidence
- Update dependents: Flag for re-validation
- Document lesson: Record in accumulated_knowledge
Example
- Extract claim: existence (UserValidator in src/validators.py)
- Check:
grep -n "class UserValidator" src/validators.py - Result: File exists but class does not
- Assessment:
CLAIM: "UserValidator exists" | TYPE: existence | EVIDENCE: grep found no match | CONFIDENCE: HALLUCINATION - Recovery: Correct to "Create new UserValidator class" or find actual validator location
Integration with Forge
When to invoke:
- After gathering-requirements (verify codebase claims)
- After brainstorming (verify technical capabilities)
- After writing-plans (verify implementation assumptions)
- When roundtable flags hallucination concerns
Self-Check
- Critical claims extracted and categorized
- Verification attempted for critical/high-risk claims
- Confidence levels assigned with evidence
- HALLUCINATION findings have corrections
- Propagation checked
- Report generated
If ANY unchecked: complete before returning.
<FINAL_EMPHASIS> Hallucinations are confident lies. Every claim needs evidence or explicit uncertainty. When you find one, trace its spread and correct at source. The forge pipeline depends on factual grounding. </FINAL_EMPHASIS>
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?