plugins/research/skills/citation-backfill/SKILL.md
Rebuild bidirectional citation edges in a research corpus. Scans outgoing citations, computes the inverse map, rewrites incoming tables. Fixes one-directional graphs.
npx skillsauth add jmagly/aiwg citation-backfillInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Rebuild bidirectional citation edges across the entire research corpus. After batch inductions or outgoing citation table updates, incoming citation tables across the corpus become stale. This command computes the inverse citation map and rewrites all incoming tables to match.
/citation-backfill--dry-run (optional)Report what would change without writing any files.
--scope REF-XXX (optional)Only propagate edges from a specific paper. Useful after inducting a single new source.
--format (optional)Output format: full (default), summary, or json.
Glob all citation sidecar files:
.aiwg/research/citations/REF-*.yaml (if YAML sidecars exist).aiwg/research/findings/REF-*.md — scan "Outgoing Citations" / "References" / "Cites" sections.aiwg/research/documentation/citations/REF-*.md — scan citation tablesExtract outgoing edges from each source:
REF-016 → cites → [REF-018, REF-024, REF-121]
REF-018 → cites → [REF-016, REF-024]
REF-024 → cites → [REF-016]
Build the outgoing map: Map<source, Set<target>>
Invert the outgoing map to produce the incoming map:
REF-016 ← cited-by ← [REF-018, REF-024]
REF-018 ← cited-by ← [REF-016]
REF-024 ← cited-by ← [REF-016, REF-018]
REF-121 ← cited-by ← [REF-016]
Result: Map<target, Set<source>>
For each target in the incoming map:
For each target with changes:
If --dry-run: report changes without writing.
Citation Backfill Complete
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Sources scanned: 372
Outgoing edges found: 1,247
Incoming edges computed: 1,247
Sidecars updated: 89
New edges propagated: 134
Stale edges removed: 3
Targets not found: 2 (REF-999, REF-888 — referenced but no note exists)
Updated files:
documentation/citations/REF-016.md (+3 incoming)
documentation/citations/REF-018.md (+1 incoming)
documentation/citations/REF-024.md (+2 incoming)
...
The backfill command recognizes citations in these formats:
| Pattern | Example | Context |
|---------|---------|---------|
| Table row | \| REF-016 \| Title \| relationship \| | Citation sidecar tables |
| Inline reference | REF-016 in body text | Finding doc body |
| YAML list | - REF-016 under outgoing: or cites: | Citation YAML sidecars |
| Markdown link | [REF-016](../findings/REF-016.md) | Cross-reference links |
| Frontmatter | related_refs: [REF-016, REF-018] | YAML frontmatter |
| Component | Relationship |
|-----------|-------------|
| induct-research | Should auto-run backfill after batch induction (Phase 3.5) |
| address-issues | Should auto-run when citation sidecars are modified |
| research-lint | cross-ref-bidirectional rule validates what backfill fixes |
| corpus-health | Reports citation completeness as a health metric |
| research-gap-detect | Uses the completed graph for cluster analysis |
When called from other skills:
# After induct-research batch:
post-induction:
- /citation-backfill --scope <newly-inducted-refs>
# After address-issues modifies citations:
post-issue-resolution:
- /citation-backfill --dry-run
- # If changes detected, prompt user to run full backfill
# Full corpus backfill
/citation-backfill
# Preview what would change
/citation-backfill --dry-run
# Backfill only edges from a specific paper
/citation-backfill --scope REF-364
# JSON output for programmatic use
/citation-backfill --format json
data-ai
Report which research-corpus radar sidecars are overdue for refresh. Computes staleness (days since last refresh vs the cadence window) for every radar, sorted most-overdue-first. Runs via `aiwg corpus radar-status`.
data-ai
Aggregate research-corpus radar sidecars into a corpus or per-cluster freshness report — totals, overdue count, per-cluster / per-GRADE / per-trajectory breakdowns, an overdue table, and per-radar rationale snippets. Runs via `aiwg corpus radar-report`.
testing
Scaffold radar/freshness sidecars for research-corpus REFs. Pulls title/authors from the citation sidecar and GRADE from the analysis doc, defaults the refresh cadence from GRADE and the cluster from a corpus-local map, and stamps documentation/radar/REF-XXX-radar.md. Runs via `aiwg corpus radar-init`.
data-ai
Compute an entity's publication trajectory — per-year paper counts, topic drift, hot-streak detection (≥3 consecutive A-grade years), and career phase. Runs via `aiwg corpus profile-temporal`.