weiping/gbrain-cn/citation-fixer
Claude Code and agent skill by weiping/gbrain-cn
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install weiping/gbrain-cn/citation-fixerSKILL.md
The same SKILL.md was published earlier as weiping/gbrain-cn/citation-fixer.
Citation Fixer Skill
Convention: see conventions/quality.md forthe 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.
Contract
This skill guarantees:
- Every brain page is scanned for citation compliance.
- Missing citations are flagged with specific location.
- Malformed citations are fixed to match the standard format.
- (v0.25.1) Tweet / post references without URLs are resolved via
X API and patched with deterministic https://x.com/<handle>/status/<id> links.
- Results reported with counts (scanned, fixed, remaining).
Phases
- Scan pages. List pages and read each one, checking for inline
[Source: ...] citations.
- Identify issues:
- Facts without any citation
- Citations missing date
- Citations missing source type
- Citations with wrong format
- (v0.25.1) Tweet references without
x.comURLs
- Fix format issues. Rewrite malformed citations to match
conventions/quality.md.
- (v0.25.1) Resolve tweet references via the X API integration.
- Report results. Count: pages scanned, citations found, issues
fixed, tweets resolved, remaining gaps.
Tweet resolution pipeline (v0.25.1 extension)
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).
Step 1: Identify broken references
Scan the page for patterns that indicate tweet references without URLs:
- Contains words like
tweeted,posted,said on X,RT,retweet,
X post
- Contains quoted text that looks like a tweet (short, punchy, often
starts with a quote)
- Has
[Source: ... X/Twitter ...]without anx.comURL - References engagement metrics (likes, impressions) without a link
Step 2: Extract searchable content
From each broken reference, extract:
- The handle (if mentioned:
@<username>) - The quoted text (if available)
- The approximate date (often present in surrounding timeline entries)
Step 3: Search for the actual tweet
Use the host's X API integration. Query patterns:
Step 4: Verify and extract metadata
Once a candidate is found:
- Confirm the text matches the quoted fragment.
- Pull the tweet id, author handle, engagement metrics (likes / RTs /
impressions).
- Construct the URL:
https://x.com/<handle>/status/<tweet_id>.
Step 5: Patch the brain page
Replace the broken citation with a proper one:
Before:
After:
Batch mode
When sweeping many pages:
Find candidate pages
Priority order
- Recently created / updated pages — fresh broken refs are easiest to
resolve while context is fresh.
- High-traffic pages (frequent reads / writes from other skills).
- Everything else — bulk cleanup over time.
Rate limiting
- X API: respect the host's tier limits; don't hammer.
- Target ~50 pages per batch run.
- 1-3 API calls per page (search + verify).
- Batch-commit every 10-20 pages so a partial failure doesn't lose
progress.
Output format
When it fails
Follow the agent operator protocol for any gbrain error code, exit code, [AGENT] block or notice block. Specific to this skill:
put_pagereturnsrevision_conflictmid-batch: re-read that page, re-apply only the citation fix, and continue; never overwrite with the copy you read earlier.get_pagereturnspage_not_foundfor a cited source: mark the citation unresolvable in the report instead of rewriting it to a guessed slug.- A batch commit is interrupted: already-committed pages stay fixed; resume from the last committed page rather than starting over.
Anti-Patterns
- ❌ Inventing citations for facts that have no source. Flag them.
- ❌ Removing facts that lack citations (flag them; don't delete).
- ❌ Fixing citations without reading the full page context.
- ❌ Batch-fixing without checking quality on a sample first
(see conventions/test-before-bulk.md).
- ❌ Composing tweet URLs by guessing the tweet id. Always go through
the X API; deterministic links only.
Integration
This skill can be called:
- Manually — "fix citations on this page"
- As a batch cron — weekly sweep of pages with broken refs
- By other skills —
enrichormedia-ingestcan call citation-fixer
before commit to validate output
Metrics
If running as a recurring batch, track state in a small JSON file under ~/.gbrain/citation-fixer-state.json:
Output Format
The skill's output shape is documented inline in the body sections above (see "Output", "Brain page format", or equivalent).
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/citation-fixer/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/weiping/gbrain-cn/citation-fixer)