skills/citation-fixer/SKILL.md
Audit and fix citation formatting across brain pages. Ensures every fact has an inline [Source: ...] citation matching the standard format. Extended in v0.25.1: scans for broken tweet/post references that lack actual URLs and resolves them via the host's X / Twitter API integration.
npx skillsauth add garrytan/gbrain citation-fixerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Convention: see conventions/quality.md for the canonical citation format every fix should match.
Output rule: all links MUST be deterministic (built from API data, not composed by LLM). See _output-rules.md.
This skill guarantees:
https://x.com/<handle>/status/<id>
links.[Source: ...] citations.x.com URLsconventions/quality.md.For each broken tweet reference, follow this chain. The actual API call
goes through whatever X integration the host has configured (typical
shape: a recipe under recipes/x-api/ with handle / search-all
endpoints).
Scan the page for patterns that indicate tweet references without URLs:
tweeted, posted, said on X, RT, retweet,
X post[Source: ... X/Twitter ...] without an x.com URLFrom each broken reference, extract:
@<username>)Use the host's X API integration. Query patterns:
# Handle + quoted text:
from:<handle> "<exact quote fragment>"
# Quoted text only:
"<exact quote fragment>"
# Original of a retweet:
"<exact quote>" -is:retweet
Once a candidate is found:
https://x.com/<handle>/status/<tweet_id>.Replace the broken citation with a proper one:
Before:
"<quote fragment>" [Source: <some hand-wavy attribution>]
After:
"<full verified quote>" — <N> likes, <N> RTs, <N> impressions
[Source: [X/<handle>, YYYY-MM-DD](https://x.com/<handle>/status/<tweet_id>)]
When sweeping many pages:
# Pages mentioning tweets but with no x.com links
for f in $(find . -name "*.md" -not -path "./node_modules/*"); do
refs=$(grep -ci "tweet\|posted\|x post\|RT\|retweet\|said on X" "$f")
links=$(grep -c "x.com/.*/status/" "$f")
if [ "$refs" -gt 2 ] && [ "$links" -eq 0 ]; then
echo "$f"
fi
done
Citation Audit Report
=====================
Pages scanned: N
Citations found: N
Issues fixed: N
Tweet links resolved: N
Remaining gaps: N (pages with uncitable facts)
conventions/test-before-bulk.md).This skill can be called:
enrich or media-ingest can call citation-fixer
before commit to validate outputIf running as a recurring batch, track state in a small JSON file under
~/.gbrain/citation-fixer-state.json:
{
"last_run": "2026-04-15T...",
"pages_scanned": 0,
"citations_fixed": 0,
"tweet_links_resolved": 0,
"citations_unresolvable": 0,
"pages_remaining": 1424
}
The skill's output shape is documented inline in the body sections above (see "Output", "Brain page format", or equivalent). The literal section header here exists for the conformance test (test/skills-conformance.test.ts).
research
Self-evolving skill optimization via SkillOpt-paper-grounded text-space optimizer.
development
Keep gbrain current. When a `gbrain` invocation prints an `UPGRADE_AVAILABLE <old> <new>` marker (or `gbrain self-upgrade --check-only` reports an update), apply it per the configured self_upgrade.mode: notify (prompt the operator with a 4-option question + snooze) or auto (apply silently). The action is always the hardcoded `gbrain self-upgrade` — never a command read from the marker.
data-ai
Set up GBrain with auto-provision Supabase or PGLite, AGENTS.md injection, first import
tools
--- name: query-helper triggers: - find a page tools: - search - query writes_pages: false --- # query-helper This skill helps you query the brain. The first prose line becomes the description when no `description:` frontmatter is present.