verify-citations ยท diff
git:20260415.fc9a399 to git:20260925.a3208eb
15 added, 45 removed. Audit A to A.
---
name: verify-citations
- description: Audit citations in LaTeX files -- check all \cite keys exist in .bib and verify via literature search
+ description: Audit every entry in a BibTeX file against the Corbis paper index and cross-check LaTeX citation keys when a manuscript is available
user_invocable: true
---
- # Verify Citations Skill
-
- Audit citations for correctness. Checks that every \cite{KEY} has a matching BibTeX entry and verifies each entry against online search.
-
- ## Examples
- - `/verify-citations` -- auto-detect the .tex and .bib files in the project
- - `/verify-citations paper/my_paper.tex` -- audit a specific file
- - `/verify-citations --key blume1983` -- verify single entry
-
- ## Workflow
-
- 1. Find the main `.tex` file: check `paper/`, `latex_template/`, then the project root for files containing `\documentclass`. If multiple candidates exist, ask the user which to audit. Extract all `\cite{KEY}` and `\citep{KEY}` commands.
- 2. Find the `.bib` file: check the same directory as the `.tex` file, then the project root. Read the full BibTeX database.
- 3. For each citation key:
- a. Check KEY exists in .bib -- if missing, flag as MISSING
- b. Extract: author, title, year, journal from the BibTeX entry
- c. Use `search_papers` to verify: `"{title}" {first author surname} {year}`
- d. Use `get_paper_details` to confirm details when a match is found
- e. Build comparison table:
-
- | Field | BibTeX value | Search result | Match? |
- |-------|-------------|---------------|--------|
- | Authors | {from .bib} | {from search} | Y/N/-- |
- | Title | ... | ... | Y/N/-- |
- | Year | ... | ... | Y/N/-- |
- | Journal | ... | ... | Y/N/-- |
+ # Verify Citations
- Use Y = confirmed, N = mismatch, -- = not found in search.
- CRITICAL: If search returns blank for a field, write "NOT FOUND IN SEARCH" -- NEVER fill from memory.
+ Audit the whole `.bib` file, including entries that a manuscript does not cite. Corbis `verify_bibtex` resolves entries against its paper index and reports field-level corrections. An unresolved entry remains unverified, not false.
- 4. Classify each citation:
- - **OK**: ALL fields confirmed
- - **PARTIAL**: Authors + title confirmed, journal/volume not found
- - **MISMATCH**: Fields contradict search results
- - **UNVERIFIED**: Cannot find paper online
- - **MISSING**: Key in \cite{} but not in .bib
+ ## Inputs
- 5. For forthcoming papers: use `search_papers` with additional queries as fallback to check journal placement
+ - `/verify-citations` finds the project's `.bib` file. If more than one plausible file exists, use the manuscript's `\bibliography{}` or `\addbibresource{}` reference when available; otherwise ask which file to audit.
+ - `/verify-citations path/to/references.bib` audits that full file without requiring a `.tex` file.
+ - `/verify-citations path/to/paper.tex` locates its bibliography and also checks in-text citation keys.
+ - `/verify-citations --key key_name` audits one entry from the selected bibliography.
- 6. Output verification report:
- ```
- Citation Audit: [detected .tex file]
- Total: N citations checked
- OK: X | Partial: Y | Mismatch: Z | Missing: W
+ ## Workflow
- --- FLAGGED ENTRIES ---
- [KEY] STATUS: details...
- ```
+ 1. Read the selected `.bib` file. Never send credentials, private notes, or unrelated files with it.
+ 2. Call `verify_bibtex` with `bibtexContent` set to the raw BibTeX content and `maxEntries` large enough for the file (up to 200). For larger bibliographies, split on complete BibTeX entries into batches of at most 200. Check `totalEntries`, `parsedCount`, `parseErrors`, and every returned entry so no record is silently skipped.
+ 3. Report each entry as **OK** (resolved, no corrections), **CORRECTION** (resolved, with field-level differences), **UNVERIFIED** (unresolved), or **PARSE ERROR**. Show the proposed correction and its Corbis basis; do not silently alter the `.bib` file. Verify consequential differences against the publisher, DOI landing page, or paper PDF before applying them.
+ 4. Run `python utils/citation_keys.py path/to/references.bib --tex path/to/main.tex` when a manuscript exists. The helper scans the manuscript and included `.tex` files for natbib commands, including `\cite`, `\citep`, `\citet`, and optional-argument forms. It reports missing keys and unused bibliography entries separately. Without a manuscript, run it with the `.bib` path alone to list every entry. This is a key-coverage check, not metadata verification.
+ 5. Save the report to `output/citation_audit.md` with file paths, total/parsed/resolved/unresolved counts, parse errors, corrections, missing keys, and unused entries. Append a dated entry to `notes/lab_notebook.md`.
- Process citations in batches of 5 to respect rate limits.
+ If `verify_bibtex` is unavailable for the current connection, say so and verify entries using `search_papers` followed by `get_paper_details_batch` for discovered IDs. Label any entry that still lacks a source **UNVERIFIED**. Never invent a citation or copy unverified supplied metadata into a verified bibliography.