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:
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-citation-fixer-c65537822923 ,按照其中的说明把「citation-fixer」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
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).