fact-check-and-citation
Verify every statistical claim by fetching cited URLs + checking the data appears on the page. Crossref-first for academic; Tavily-fallback for industry. Replaces fabricated/unsourced stats. Builds APA 7 References block, ≤10 entries, all link-resolvable. The single most important anti-hallucination gate in the pipeline. Use after section-drafter (before humanizer if humanizer might break citations) or after humanizer (preferred — humanizer doesn't touch quoted material).
XuanRanL · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add XuanRanL/loamwright-SEO-Skill --skill fact-check-and-citationAbout this skill
name: fact-check-and-citation description: Verify every statistical claim by fetching cited URLs + checking the data appears on the page. Crossref-first for academic; Tavily-fallback for industry. Replaces fabricated/unsourced stats. Builds APA 7 References block, ≤10 entries, all link-resolvable. The single most important anti-hallucination gate in the pipeline. Use after section-drafter (before humanizer if humanizer might break citations) or after humanizer (preferred — humanizer doesn't touch quoted material). allowed-tools: [Read, Write, Edit, Bash, Task, WebFetch] disable-model-invocation: false user-invocable: true
Fact-Check and Citation
The single most important anti-hallucination step. Without it, LLM-fabricated statistics make it to publication. With it, every cited fact is real and verifiable. Without exception.
When to invoke
- After
section-draftercompletes (Stage: humanizer-complete OR section-drafted) - Before
assembly(final draft.md assembly) - Auto-triggered by
repair-orchestratorwhen any C01 (fabricated citation) veto fires - User can manually invoke
/factcheck workspace/{task_id}/draft.md
Inputs
workspace/{task_id}/sections/*.json— each hasclaims[]arrayworkspace/{task_id}/research.json— Tier-1 source candidates already discoveredreferences/apa-citation-rules.md
Workflow
Step 1: Extract all statistical claims
Scan the draft for every claim that includes a number, percentage, dollar amount, or named source. Build claims list:
| Field | Description |
|---|---|
| claim_text | The exact sentence or phrase containing the statistic |
| value | The numeric value (e.g., "42%", "$1.2M", "3x") |
| attribution | Named source if present (e.g., "HubSpot", "Gartner 2025") |
| url | Cited URL if present (markdown link or parenthetical) |
| location | Heading or line number where the claim appears |
Step 2: Spawn fact-checker agent
# Internal — fact-checker is the agent that does the actual verification work
Invoke agents/fact-checker.md with:
sections_dir = workspace/{task}/sections/mode = "fact-check"max_refs = 10(or 15 for case-study / data-research formats)
The fact-checker has the tool whitelist: Read, Write, WebFetch, Bash.
Step 3: Per-claim verification pipeline
For each claim with needs_source=true:
-
Crossref lookup (academic preference, free, fast)
python -m scripts.fetch.crossref_lookup "{hint_query}" --rows 5 --apaIf hit + DOI → step 4.
-
Link resolver check on DOI URL
python -m scripts.validate.link_resolver "https://doi.org/{doi}"If 200 OK → USE IT.
-
Tavily advanced fallback (for industry, news, recent statistics)
python -m scripts.fetch.tavily_search "{hint_query}" --depth advancedFor top-3 results → run link_resolver. First passing → USE IT.
-
If nothing resolves → mark claim as
deleted. Surface to writer to rewrite the paragraph without the unsupportable claim.
Step 4: Verification scoring (per claim)
| Score | Status | Criteria |
|---|---|---|
| 1.0 | VERIFIED | Exact number found on cited page in matching context |
| 0.7-0.9 | PARAPHRASE | Similar data with different wording, rounding, or timeframe |
| 0.3-0.6 | WEAK | Source page covers topic but specific stat not visible |
| 0.0 | NOT FOUND | Cited page does not contain the claimed data anywhere |
| N/A | UNVERIFIED | No source URL provided for the claim |
Scoring guidance:
- "43%" when source says "nearly half" → 0.8
- "2024" data when source has "2023" → 0.7
- Citation to homepage when stat lives on subpage → 0.3
- 404 / unreachable URL → 0.0
Step 5: Claim extraction patterns (regex hints)
Fully cited (highest confidence):
[Number]% [claim] ([Source], [Year])— parenthetical citation[claim] [Number]% ... [markdown link to source]— inline linkAccording to [Source], [Number]...— attribution lead
Uncited statistics (flag for sourcing):
[Number]% of [noun phrase]— standalone percentage[Number]x more/less/higher/lower— multiplier claims$[Number] [claim]— dollar figures without attribution
Weak signals (check context before extracting):
- "studies show", "research indicates", "data suggests" + nearby number
- "survey found", "report reveals", "analysis shows" + nearby number
- Round numbers in isolation ("millions of users") — skip unless specific
Step 6: Build References section
Output workspace/{task_id}/citations.json per schemas/citations.schema.json, AND
workspace/{task_id}/fact-check.json per schemas/fact-check.schema.json — its verdict
is EXACTLY one of CLEAN | CLEAN_WITH_NOTES | FIX_REQUIRED | BLOCK_PUBLISH (any other
string fails closed at the orchestrator gate and pre_publish_gate; CLEAN_WITH_NOTES is
the canonical "issues found and fixed in place" verdict — 2026-08-02,
scripts/pipeline/fc_verdict.py).
Canonical top-level key is citations (matches wp_publisher._load_citation_entries
canonical reader path). Legacy/alternate keys also accepted by the publisher:
refs, references, items, or bare top-level list — but new emitters
should write citations for clarity and forward-compat.
URL-resolution recording (v3.38.3, mandatory): a ref that is REAL but
bot-walled (Taylor & Francis / MDPI / ASTM return HEAD 403 to script UAs) gets
url_verified: true + resolved_status: "bot-403" (the STRING — never the bare
int 403, which reads as a broken ref and fires the C01 fabricated-citation
veto) + a resolution_note naming how it was verified (Crossref masthead /
browser UA). url_verified: true is authoritative for the C01 scorer. A ref you
could not verify anywhere gets url_verified: false. Full contract:
agents/fact-checker.md §"URL resolution recording".
{
"task_id": "abc123",
"citations": [
{
"id": 1,
"apa_7": "Smith, J. (2024). Title of work. Publisher. https://doi.o
Read the complete source ↗