About citation-anchoring
citation-anchoring is an audit skill for checking whether citation keys remain in their original Markdown subsections after editing. It compares a pre-polish baseline with the current draft and reports citation drift without changing the text.
Key features
- 01Extract citation keys by subsection
- 02Compare against a saved baseline
- 03Detect added or removed keys
- 04Identify citations moved across sections
- 05Write a PASS/FAIL report
Use cases
- 01Check citations after draft polishing
- 02Verify claim-to-evidence alignment
- 03Review intentional subsection restructuring
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ willoscar/ research-units-pipeline-skills --skill citation-anchoringAfter installing, type/citation-anchoringin Claude Code to confirm it loaded.
Details
From the project READMECitation Anchoring (regression)
Triggers & routing
- Trigger: citation anchoring, citation drift, regression, cite stability, 引用锚定, 引用漂移.
- Use when: after editing/polishing, you want to confirm citations did not migrate across
###subsections.
Purpose: prevent a common failure mode: polishing rewrites text and accidentally moves citation markers into a different ### subsection, breaking claim→evidence alignment.
Inputs
output/DRAFT.mdoutput/citation_anchors.prepolish.jsonl(baseline; created bydraft-polisheron first run)
Outputs
output/CITATION_ANCHORING_REPORT.md(PASS/FAIL + drift examples)
Baseline policy
draft-polishercaptures a baseline once per run:output/citation_anchors.prepolish.jsonl.- Subsequent polish runs should keep per-H3 citation sets stable.
Workflow (analysis-only)
Role:
- Auditor: only checks and reports; does not edit.
Steps:
- Load the baseline anchors.
- Parse the current
output/DRAFT.mdinto###subsections and extract citation keys per subsection. - Compare current sets to baseline sets:
- keys added/removed within a subsection
- keys that migrated across subsections
- Write
output/CITATION_ANCHORING_REPORT.md:
- Status: PASSonly if no drift is detected- otherwise,
- Status: FAILwith a short diff table + examples
Notes
If you intentionally restructure across subsections:
- delete
output/citation_anchors.prepolish.jsonland regenerate a new baseline (then treat that as the new regression anchor).
Troubleshooting
Issue: baseline anchor file is missing
Fix:
- Run
draft-polisheronce to generateoutput/citation_anchors.prepolish.jsonl, then rerun the anchoring check.
Issue: citations intentionally moved across subsections
Fix:
- Delete
output/citation_anchors.prepolish.jsonland regenerate a new baseline (then treat that as the new regression anchor).
Comments
Markdown supported