mcpField
C
citation-anchoring

citation-anchoring

github.com/willoscarDocuments51746 installsUpdated 3w ago
Repository

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

  1. 01Extract citation keys by subsection
  2. 02Compare against a saved baseline
  3. 03Detect added or removed keys
  4. 04Identify citations moved across sections
  5. 05Write a PASS/FAIL report

Use cases

  1. 01Check citations after draft polishing
  2. 02Verify claim-to-evidence alignment
  3. 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-anchoring

After installing, type/citation-anchoringin Claude Code to confirm it loaded.

Details

From the project README

Citation 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.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
  1. 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).

Comments

Markdown supported