lingzhi227/citation-management
Manage BibTeX citations for LaTeX papers. Harvest missing citations from a draft using Semantic Scholar, validate cite keys against .bib files, deduplicate entries, and format bibliography. Use when working with references, BibTeX, or citations.
npx skills add https://github.com/lingzhi227/agent-research-skills --skill citation-management
Manage the full lifecycle of citations in a LaTeX paper.
$0 — Action: harvest, validate, add, format$1 — Path to .tex or .bib filepython ~/.claude/skills/citation-management/scripts/validate_citations.py \
--tex paper/main.tex --bib paper/references.bib --check-figures --figures-dir paper/figures/
Reports: missing citations, unused bib entries, duplicate keys, duplicate sections, duplicate labels, undefined references, missing figures.
python ~/.claude/skills/deep-research/scripts/bibtex_manager.py \
--jsonl paper_db.jsonl --output references.bib
python ~/.claude/skills/deep-research/scripts/search_semantic_scholar.py \
--query "attention is all you need" --max-results 5 \
--api-key "$(grep S2_API_Key /Users/lingzhi/Code/keys.md 2>/dev/null | cut -d: -f2 | tr -d ' ')"
python ~/.claude/skills/citation-management/scripts/harvest_citations.py \
--tex paper/main.tex --bib paper/references.bib --output candidates.bib --max-rounds 10
Scans .tex for uncited claims, searches Semantic Scholar, outputs candidate BibTeX entries.
Key flags: --dry-run (preview only), --verbose, --api-key
python ~/.claude/skills/citation-management/scripts/validate_citations.py \
--tex paper/main.tex --bib paper/references.bib --fix
Generates references_fixed.bib with placeholder entries for all missing citation keys.
harvest — Iterative Citation HarvestingBased on AI-Scientist's 20-round citation harvesting loop. For each round:
.tex draftlastNameYearWord).bib (skip if key exists)\cite{key} at the appropriate locationKey rules:
validate — Pre-Compilation CheckRun validate_citations.py to catch all issues before compilation. Fix any reported problems.
add — Add Specific PaperSearch Semantic Scholar for the paper, extract BibTeX, clean the key, append to .bib.
BibTeX key format: firstAuthorLastNameYearFirstContentWord (e.g., vaswani2017attention)
format — Standardize .bib{Braces} in titlesTake lingzhi227/citation-management from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.