grounded-citations

Manages numbered source citations and verbatim evidence quotes for grounded research documents.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/CHENHUI-X/toolbox --skill grounded-citations-chenhui-x
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grounded-citations
Source: https://github.com/CHENHUI-X/toolbox/tree/main/official-skills/research/grounded-citations
Command: npx skills add https://github.com/CHENHUI-X/toolbox --skill grounded-citations-chenhui-x

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? When an AI writes answers or reports based on fetched web content, it can hallucinate URLs or attribute claims to sources that never said them. This Skill eliminates that risk by keeping a persistent ledger that owns the URL-to-number mapping, so the model only ever emits small integer ids it was handed at retrieval time, and every citation can be mechanically verified against the ledger. ## Core Features & Use Cases - Citation Ledger: Registers URLs at retrieval time with stable, idempotent numbering, then renders Sources blocks in markdown, plain, footnotes, bibtex, or evidence styles. - Draft Verification: Checks that every [n] in a draft exists in the ledger, that the Sources block matches, and that citation coverage meets a configurable threshold. - Fact-Checking Mode: Attaches verbatim quotes to sources (rejected unless they literally appear in the fetched page text) and fails drafts whose cited sources carry no evidence. - Use Case: While writing a market research report from web searches, Reddit threads, and RSS feeds, register each URL as you fetch it, cite claims inline as [1][2], then run verify before delivering so no fabricated or mismatched citation reaches the reader. ## Quick Start Ask the agent to research a topic across the web and write a cited report, registering every fetched source in the citation ledger and verifying the draft before delivery.

Frequently Asked Questions about grounded-citations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add citations to AI-generated research answers?

Register each fetched URL with the sources.py add command at retrieval time, which returns a stable numeric id. Cite claims inline as [n] while writing, then run render --cited-in to generate the Sources block mechanically from the ledger instead of typing URLs by hand.

How do I verify citations in a markdown draft?

Run sources.py verify draft.md to check that every [n] exists in the ledger and the Sources block matches it. Add --min-coverage 0.5 to enforce a cited-sentence ratio, or --evidence to require verbatim quotes on every cited source.

Does the citation ledger work with multiple AI subagents?

Yes, parallel subagents can share one ledger by passing --ledger PATH or setting the HERMES_CITATION_LEDGER environment variable. The script uses a lockfile to prevent concurrent adds from assigning duplicate ids.

What citation formats does the ledger render?

The render command supports markdown, plain, footnotes, bibtex, and evidence styles. Bibtex output produces @misc entries keyed source<N> for LaTeX pipelines, while evidence style prints each source's verbatim quotes beneath its URL.

Why does the quote command reject my evidence text?

The quote command only accepts text that appears verbatim in the fetched page file you pass with --from, ignoring whitespace, case, and markdown markup. Paraphrased or retyped quotes are rejected, so copy the exact sentence from the extracted page text.

When should I skip inline citations in AI answers?

Skip citations when retrieval is incidental, such as quick syntax lookups during coding, casual conversation, or creative writing. The skill targets deliverables that rest on fetched information the reader may want to check.