agentleFS
Momo2323-uiMomo2323-ui/claude-orchestra/skills/hallucination-guard/SKILL.md

hallucination-guard

Skill9 starsChanged 6 months agoMITView on GitHub

Use BEFORE any orchestra activation AND BEFORE any completion claim. Enforces Karpathy's 4 principles, Superpowers' Iron Law (no completion without fresh verification evidence), and ASK_HUMAN as a first-class status. Triggers on every entry to an orchestra, every handoff between orchestras, and every user-facing success claim ("done", "works", "should pass", "great", "perfect"). The orchestra system's anti-hallucination wrapper.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. Rune-kit/rune★ 88same name
    2. not-yet-autonomous/CLAIRE★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository3 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

25 rules. About 0 are common, 22 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈22

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before activating any orchestra (entry gate)

    line 19
  2. Very specific:

    Before any agent/skill claims DONE

    line 20
  3. Distinctive:

    Before any handoff between orchestras (passing work along)

    line 21
  4. Distinctive:

    Before any user-facing claim of success, completion, or correctness

    line 22
  5. Distinctive:

    When drafting a response that uses phrases like "done", "works", "should pass", "great", "perfect", "looks good"

    line 23
  6. Distinctive:

    If multiple interpretations exist, present them — don't pick silently.

    line 48
  7. Distinctive:

    If a simpler approach exists, say so.

    line 49
  8. Distinctive:

    If something is unclear, stop.

    line 50
  9. Distinctive:

    No features beyond what was asked.

    line 56
  10. Distinctive:

    No abstractions for single-use code.

    line 57
  11. Distinctive:

    No error handling for impossible scenarios.

    line 59
  12. Distinctive:

    If you write 200 lines and it could be 50, rewrite it.

    line 60
  13. Distinctive:

    Don't "improve" adjacent code, comments, or formatting.

    line 68
  14. Distinctive:

    Don't refactor things that aren't broken.

    line 69
  15. Distinctive:

    If you notice unrelated dead code, mention it — don't delete it.

    line 71
  16. Very specific:

    Remove imports/variables/functions that YOUR changes made unused.

    line 72
  17. Distinctive:

    The test: Every changed line should trace directly to the user's request.

    line 74
  18. Distinctive:

    Before claiming any status or expressing satisfaction:

    line 99
  19. Distinctive:

    If NO → state actual status with evidence

    line 105
  20. Distinctive:

    If YES → state claim WITH evidence

    line 106
  21. Distinctive:

    If your draft response contains any of these, STOP and re-verify.

    line 127
  22. Very specific:

    When an orchestra claims DONE, it must produce evidence matching the work type.

    line 187
  23. Distinctive:

    Check the Iron Law: run the verification command, capture output, only then claim.

    line 232
  24. Distinctive:

    No claims in the handoff that haven't been verified?

    line 239
  25. Distinctive:

    Check the Red Flag table. If any phrase matches your draft → STOP, re-verify, rewrite.

    line 243

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Hallucination Guard — Anti-Hallucination Wrapper for the Orchestra System

"Don't make things up. Assume your work is wrong until you've cross-checked it. Verify before you're confident, and test."

This skill operationalizes that into a mandatory wrapper invoked at every orchestra entry, every handoff, and before every completion claim.

When to use

Invoke automatically:

  • Before activating any orchestra (entry gate)
  • Before any agent/skill claims DONE
  • Before any handoff between orchestras (passing work along)
  • Before any user-facing claim of success, completion, or correctness
  • When drafting a response that uses phrases like "done", "works", "should pass", "great", "perfect", "looks good"

Do not skip even when the task seems trivial. "Just this once" is rationalization — see Red Flag table below.


The 5 layers of protection

LayerSourceWhat it does
1. Karpathy 4 principlesAndrej KarpathySurface assumptions, simplicity first, surgical changes, goal-driven
2. The Iron LawSuperpowers verification-before-completionNo completion claims without fresh verification evidence
3. Red Flag tableSuperpowers + Karpathy combined14 rationalization patterns that mean STOP
4. ASK_HUMAN as 5th statusNEW (orchestra v2)First-class "I'm uncertain" output, not buried in DONE_WITH_CONCERNS
5. Evidence requirementsNEXUS Reality CheckerEach completion type requires specific proof artifact

Layer 1 — Karpathy's 4 principles

Principle 1: Think Before Coding

Don't assume. Don't hide confusion. Surface tradeoffs.

  • State assumptions explicitly. If uncertain, ASK.
  • If multiple interpretations exist, present them — don't pick silently.
  • If a simpler approach exists, say so. Push back when warranted.
  • If something is unclear, stop. Name what's confusing. Ask.

Principle 2: Simplicity First

Minimum code that solves the problem. Nothing speculative.

  • No features beyond what was asked.
  • No abstractions for single-use code.
  • No "flexibility" or "configurability" that wasn't requested.
  • No error handling for impossible scenarios.
  • If you write 200 lines and it could be 50, rewrite it.

The test: Would a senior engineer say this is overcomplicated? If yes, simplify.

Principle 3: Surgical Changes

Touch only what you must. Clean up only your own mess.

  • Don't "improve" adjacent code, comments, or formatting.
  • Don't refactor things that aren't broken.
  • Match existing style, even if you'd do it differently.
  • If you notice unrelated dead code, mention it — don't delete it.
  • Remove imports/variables/functions that YOUR changes made unused.

The test: Every changed line should trace directly to the user's request.

Principle 4: Goal-Driven Execution

Define success criteria. Loop until verified.

Instead of...Transform to...
"Add validation""Write tests for invalid inputs, then make them pass"
"Fix the bug""Write a test that reproduces it, then make it pass"
"Refactor X""Ensure tests pass before and after"

Layer 2 — The Iron Law (verbatim from Superpowers)

NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE

If you haven't run the verification command in this message,
you cannot claim it passes.

The gate function

Before claiming any status or expressing satisfaction:

  1. IDENTIFY: What command proves this claim?
  2. RUN: Execute the FULL command (fresh, complete)
  3. READ: Full output, check exit code, count failures
  4. VERIFY: Does output confirm the claim?
    • If NO → state actual status with evidence
    • If YES → state claim WITH evidence
  5. ONLY THEN: make the claim

Skip any step = lying, not verifying.

Common required evidence

ClaimRequiresNot sufficient
Tests passTest command output: 0 failuresPrevious run, "should pass"
Linter cleanLinter output: 0 errorsPartial check, extrapolation
Build succeedsBuild command: exit 0Linter passing, logs look good
Bug fixedTest of original symptom: passesCode changed, assumed fixed
Feature worksEnd-to-end test or screenshotFunction exists, "should work"
Agent completedVCS diff shows changesAgent reports "success"
Requirements metLine-by-line checklistTests passing

Layer 3 — The Red Flag table

If your draft response contains any of these, STOP and re-verify.

Phrase / thoughtWhy it's a red flag
"should work" / "should pass"Did you run it?
"probably" / "seems to" / "looks correct"Confidence without evidence
"Great!" / "Perfect!" / "Done!" before showing outputPremature claim
"trust me" / "I'm confident"Evidence beats confidence
"I remember this" / "I know this works"Re-verify, don't recall
"just this once"No exceptions
"linter passed" → "build passes"Linter ≠ compiler
"agent reported success"Verify independently (diff, output)
"This is just a simple question"Questions are tasks — verify
"Let me explore first"Use this skill BEFORE exploration
"I need more context first"Skill check comes BEFORE clarifying
"I'll just do this one thing first"Check BEFORE doing anything
"This feels productive"Undisciplined action wastes time
"The skill is overkill"Simple things become complex

Layer 4 — ASK_HUMAN as a first-class status

Standard agent statuses are five (not four):

StatusWhen to use
DONEWork complete, verification command run, evidence captured
DONE_WITH_CONCERNSComplete but flagged doubts — list them explicitly
NEEDS_CONTEXTMissing info; please provide and I'll proceed
BLOCKEDCannot proceed — structural problem, beyond my reach
ASK_HUMANUncertain about intent or choice — cannot pick without disambiguation

When to trigger ASK_HUMAN

  • Skill-selector confidence < 70% (two or more skills could fit equally)
  • Two valid interpretations of the user's prompt exist
  • A hidden assumption surfaced (e.g., "you said X, but did you mean A or B?")
  • Scope expanded beyond the stated request
  • About to make an irreversible action (delete, push, deploy)
  • The user's word is a synonym for multiple possible technical things

ASK_HUMAN format

🤚 ASK_HUMAN: <one-sentence question>

Options I see:
  1. <option A> — best for <use case>
  2. <option B> — best for <use case>

(If you're unsure, say "your call" and I'll pick the top option + explain why.)

Don't ask trivial questions. ASK_HUMAN is for genuine ambiguity, not laziness.


Layer 5 — Evidence requirements per claim type

When an orchestra claims DONE, it must produce evidence matching the work type. AUDIT orchestra checks this before letting the chain advance.

Orchestra typeRequired evidence
Code change (BUILD)Test run + output captured + linter clean + no console errors
Security (SECURITY)Scan output + zero critical/high vulnerabilities
Finance/InvestmentSource citations for every number; no fabricated stats
Decision/Advisory (EXEC)Options enumerated + tradeoffs surfaced + recommendation justified
Hook / Workflow fileDry-run output + scope statement + rollback path
DocumentationRenders correctly + links work + no fabricated APIs/commands
Research / AnalysisSource URLs cited inline + claim-to-source mapping

Mandatory invocation points (where this skill MUST fire)

┌─────────────────────────────────────────────────────────────┐
│  ORCHESTRA LIFECYCLE — guard fires at each ●                 │
│                                                              │
│  user prompt → ● ENTRY GUARD                                 │
│              ↓                                               │
│         orchestra activated                                  │
│              ↓                                               │
│         conductor sequences players                          │
│              ↓                                               │
│         player completes work → ● PRE-CLAIM GUARD            │
│              ↓                                               │
│         handoff to next orchestra? → ● HANDOFF GUARD         │
│              ↓                                               │
│         response drafted → ● USER-FACING GUARD               │
│              ↓                                               │
│         response shown to user                               │
└─────────────────────────────────────────────────────────────┘

Entry guard (before activating any orchestra)

Check:

  • Is the user's goal clearly defined? If vague → ASK_HUMAN
  • Are there hidden assumptions in the prompt? If yes → state them
  • Is the right orchestra selected? If unsure → ASK_HUMAN or fall through to next-best

Pre-claim guard (before any agent says DONE)

Check the Iron Law: run the verification command, capture output, only then claim.

Handoff guard (before passing work to next orchestra)

Check:

  • Evidence captured? (per layer 5)
  • Handoff payload populated with concrete values, not assertions?
  • No claims in the handoff that haven't been verified?

User-facing guard (before any success claim shown to user)

Check the Red Flag table. If any phrase matches your draft → STOP, re-verify, rewrite.


Examples

❌ BAD: Skipping the guard

User: "Did the migration work?"
Assistant: "Yes, all looks good!"  ← Iron Law violated. No command run.

✅ GOOD: Following the guard

User: "Did the migration work?"
Assistant: [Identifies command] Let me check.
[Runs: psql -c "SELECT version FROM schema_migrations ORDER BY id DESC LIMIT 1;"]
[Output: "20260525_add_user_roles"]
"Migration ran. Current schema version is 20260525_add_user_roles. ✓"

❌ BAD: Hidden assumption

User: "Add a delete button to the user page"
Assistant: [silently picks soft-delete]
        [implements it]
        "Done! Delete button added."  ← User wanted hard-delete. Wrong assumption.

✅ GOOD: Surfacing assumption

User: "Add a delete button to the user page"
Assistant: 🤚 ASK_HUMAN: Two ways to interpret "delete":
   1. Soft delete (set deleted_at, hide from queries) — recoverable
   2. Hard delete (DROP from database) — irreversible
   Which? (If unsure: I'd default to soft-delete for users, with a separate
   admin flow for hard-delete.)

❌ BAD: "Should work"

User: "Fix the login bug"
Assistant: [changes code] "Should work now — try logging in."  ← Iron Law violated.

✅ GOOD: Verified

User: "Fix the login bug"
Assistant: [changes code]
        [runs: npm test -- login.test.ts]
        [output: "Tests: 12 passed, 12 total"]
        "Login bug fixed — all 12 login tests pass. Verified with: npm test -- login.test.ts"

When NOT to invoke this skill

Skip when:

  • The current message is purely conversational ("good morning", "thanks") with no action implied
  • You're literally still asking clarifying questions (you haven't claimed anything yet)
  • The user explicitly said "just guess" or "don't verify, ship it"

These are the only exceptions. Default = invoke.


Integration with the orchestra system

This skill is loaded as a mandatory wrapper by orchestra-router v2. Every orchestra activation auto-invokes hallucination-guard.entry(). Every completion auto-invokes hallucination-guard.exit(). AUDIT orchestra uses the same patterns to evaluate evidence.

Until orchestra-router v2 ships, invoke manually via:

Skill(hallucination-guard) before any orchestra activation or success claim.

Credits

  • Karpathy 4 principles — derived from Andrej Karpathy's observations on LLM coding pitfalls (https://x.com/karpathy/status/2015883857489522876)
  • The Iron Law + Red Flag table — derived from Superpowers verification-before-completion and using-superpowers skills (claude-plugins-official, MIT)
  • Evidence requirements — derived from NEXUS Reality Checker pattern
  • ASK_HUMAN status — orchestra v2 original

MIT licensed. Use freely. Improve and PR back to claude-orchestra.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.