---
name: Citation Anchoring
slug: citation-anchoring
category: Quality
description: "Citation Anchoring checks that citation keys stay in the same ### subsection after polishing. Use it to catch drift that breaks claim-to-evidence alignment."
github: "https://github.com/WILLOSCAR/research-units-pipeline-skills/tree/main/.codex/skills/citation-anchoring"
language: Python
stars: 499
forks: 39
install: "npx degit https://github.com/WILLOSCAR/research-units-pipeline-skills/tree/main/.codex/skills/citation-anchoring ~/.claude/skills/citation-anchoring"
installs_to: ~/.claude/skills/citation-anchoring
source_path: .codex/skills/citation-anchoring/SKILL.md
collection_size: 25
category_size: 1354
collection_url: "https://dirskills.com/collections/WILLOSCAR/research-units-pipeline-skills"
added: 2026-08-26T05:12:53.267Z
last_synced: 2026-08-26T05:12:53.267Z
canonical_url: "https://dirskills.com/skills/citation-anchoring"
---

# Citation Anchoring

Citation Anchoring checks that citation keys stay in the same ### subsection after polishing. Use it to catch drift that breaks claim-to-evidence alignment.

**Install:**

```bash
npx degit https://github.com/WILLOSCAR/research-units-pipeline-skills/tree/main/.codex/skills/citation-anchoring ~/.claude/skills/citation-anchoring
```

## README

# Citation Anchoring (regression)

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.md`
- `output/citation_anchors.prepolish.jsonl` (baseline; created by `draft-polisher` on first run)

## Outputs

- `output/CITATION_ANCHORING_REPORT.md` (PASS/FAIL + drift examples)

## Baseline policy

- `draft-polisher` captures 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:

1) Load the baseline anchors.
2) Parse the current `output/DRAFT.md` into `###` subsections and extract citation keys per subsection.
3) Compare current sets to baseline sets:
- keys added/removed within a subsection
- keys that migrated across subsections
4) Write `output/CITATION_ANCHORING_REPORT.md`:
- `- Status: PASS` only if no drift is detected
- otherwise, `- Status: FAIL` with a short diff table + examples

## Notes

If you intentionally restructure across subsections:
- delete `output/citation_anchors.prepolish.jsonl` and regenerate a new baseline (then treat that as the new regression anchor).

## Troubleshooting

### Issue: baseline anchor file is missing

Fix:
- Run `draft-polisher` once to generate `output/citation_anchors.prepolish.jsonl`, then rerun the anchoring check.

### Issue: citations intentionally moved across subsections

Fix:
- Delete `output/citation_anchors.prepolish.jsonl` and regenerate a new baseline (then treat that as the new regression anchor).
