Bib Check
Documentsbib-checkBib Check is an Agent Skill for documents published in the brycewang-stanford/Auto-Empirical-Research-Skills repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Cross-checks citation keys in index.qmd against references.bib, reporting missing, orphaned, and duplicate entries. Use when verifying citations.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills/blob/HEAD/skills/29-quarcs-lab-project20XXy/dot-claude/skills/bib-check/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/bib-check, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Audit Citations and References
Cross-check all citation keys in the manuscript against references.bib and report mismatches.
Steps
-
Read
index.qmdand extract every citation key:- Narrative citations:
@key - Parenthetical citations:
[@key],[@key1; @key2] - Ignore email addresses and
@sec-,@fig-,@tbl-cross-references
- Narrative citations:
-
Read
references.biband extract every entry key (the identifier after@article{,@book{, etc.) -
Check for duplicate keys within
references.bib(same key defined more than once) -
Report three categories:
Errors — cited in manuscript but missing from
.bib:- List each missing key with the line number in
index.qmdwhere it appears - For each, suggest running
/project:cite <key>to add the entry
Orphaned — in
.bibbut never cited in manuscript:- List each unused key (informational, not necessarily a problem)
Duplicates — same key appears multiple times in
.bib:- List each duplicate with line numbers in
references.bib
- List each missing key with the line number in
-
Print a summary: total cited keys, total
.bibentries, errors, orphaned, duplicates
Error handling
- If
references.bibdoes not exist, report the error and stop. - If
index.qmdcontains no citations, report "No citations found" and stop.