Skills

Correction Pipeline

When the user corrects a factual error, root-cause it immediately.

Install

npx skills add garrytan/gbrain --skill correction-pipeline -g -a claude-code -y
Repository
garrytan/gbrain31.4k
Category
AI and agents
Updated
3d ago
License
MIT
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

When the user corrects a factual error, root-cause it immediately. Don't just note the correction, trace the error to its source, fix the source, and prevent recurrence. Every factual error is either a data error (bad brain page, bad memory file, bad rendered SOUL/USER identity, bad facts row) or a hallucination (LLM confabulated from partial signals).

Correction Pipeline

Convention: see conventions/brain-first.md , Step 1 of the root-cause chain IS the brain-first lookup chain (search for exact tokens, query for concept-shaped questions) before anything else.

Convention: see _brain-filing-rules.md, > corrections edit pages in place; the page stays filed by primary subject.

Trigger

ANY factual error the user identifies. No exceptions. No "I'll note that."

(Routing here is a harness convention, not a mechanical guarantee, but once this skill is in play, the no-exceptions contract above is the discipline.)

Immediate Response

  1. Acknowledge the error. Don't defend. Don't explain. Just: "You're right. I got that wrong."
  2. Quote the specific wrong claim so the user can see you know exactly what was wrong.
  3. State the correct fact as the user gave it.

Root Cause Analysis (do THIS, not just a memory note)

Run these steps IN ORDER. Report findings to the user.

Step 1: Search the brain

gbrain search "<relevant terms>" --limit 10

For concept-shaped or synonym-phrased claims, escalate to gbrain query "<question>" (LLM expansion recovers phrasings search misses). To list every indexed page carrying the claim, use a keyword search (it pages every match); grep the checkout only for edits not yet synced:

gbrain search '"<wrong claim terms>"' --match keyword
BRAIN_DIR=$(gbrain config get sync.repo_path)
grep -ri "<wrong claim terms>" "$BRAIN_DIR/people/" "$BRAIN_DIR/companies/" "$BRAIN_DIR/concepts/" 2>/dev/null

Question: Is the wrong fact IN the brain? If yes → the brain is the contamination source. Fix the brain page (Step 6).

Step 2: Search memory files

Grep the harness's always-loaded memory files (e.g. the workspace MEMORY.md and any memory/*.md companions, the exact location depends on your harness):

Read the whole SKILL.md on GitHub

More in AI and agents