Mmcp.market

validate-bib skill

by pedrohcgs·pedrohcgs/claude-code-my-workflow·1.6k stars·MIT

Validate bibliography entries against citations in all lecture files. Structural checks (missing/unused entries, malformed fields) by default; `--semantic` adds citation-drift detection, DOI verification, and style-consistency checks.

A100/100content scan

Is the validate-bib skill safe?

Clean: nothing in its files matched our rules. We read 1 file in the folder on 2026-09-28.

No findings.

Install the validate-bib skill

A skill is a folder. Copy it into your agent's skills folder and the agent loads it when the task matches its description.

git clone --depth 1 https://github.com/pedrohcgs/claude-code-my-workflow.git /tmp/claude-code-my-workflow
mkdir -p ~/.claude/skills
cp -r /tmp/claude-code-my-workflow/.claude/skills/validate-bib ~/.claude/skills/validate-bib
available in every project

In the Claude apps, zip the folder and upload it from the Skills settings. The folder on GitHub

The instructions your agent would load

SKILL.md as published, without the frontmatter. Read it on GitHub

Validate Bibliography

Cross-reference citations in lecture files against bibliography entries. Two modes:

  • Default (structural): missing entries, unused entries, malformed fields, typo candidates.
  • --semantic: adds citation-drift detection (duplicate entries for the same paper), DOI verification via crossref, and citation-style consistency within each file.

Report saved to qualityreports/bibaudit_[structural|semantic].md.

Mode 1: Structural (default)

Steps

  1. Read the bibliography file and extract all citation keys.
  1. Scan lecture files for citation keys:
  • .tex: \cite{, \citet{, \citep{, \citeauthor{, \citeyear{, \textcite{, \parencite{
  • .qmd / .md: @key, [@key], [@key1; @key2]
  • Extract all unique citation keys used.
  1. Cross-reference:
  • Missing entries (CRITICAL): cited in lectures, absent from .bib.
  • Unused entries (informational): in .bib but never cited.
  • Typo candidates: keys within edit-distance 2 of a .bib key (e.g., Smith2020 vs Smth2020).
  1. Check entry quality:
  • Required fields present (author, title, year, journal/booktitle).
  • Author field properly formatted.
  • Year in 1900–current.
  • No malformed characters / encoding issues.
  • doi field normalized (no leading https://doi.org/).
  1. Write report to qualityreports/bibaudit_structural.md.

Files scanned

Slides/*.tex
Quarto/*.qmd
guide/*.qmd
master_supporting_docs/**/*.tex

Bibliography location

Bibliography_base.bib at repo root by default; override via CLAUDE.md.

Mode 2: Semantic (--semantic)

Everything in Mode 1, plus:

2a. Citation drift detection

Multiple .bib entries describing the same paper under different keys. Symptoms:

  • Smith2020 + Smith2020a with identical DOI or title.
  • CallawaySantAnna2021 + CS2021 both pointing to the same paper.
  • Collaborator-merged .bib files.

Detection heuristics (any → FLAG):

For each flagged pair: list both keys, where each is cited, and recommend a canonical key (prefer most-cited, then alphabetically first).

2b. DOI verification (optional; network)

For each entry with a doi, fetch https://api.crossref.org/works/{doi} and compare:

  • First-author last name
  • Year
  • Title (Jaccard > 0.7 on normalized tokens)
  • Container-title / journal (exact or abbreviation)

Severity:

  • Author or title mismatch → CRITICAL (wrong paper)
  • Year mismatch → MEDIUM (preprint vs published, or typo)
  • Journal mismatch → LOW (legitimate preprint variants)

Rate limit: cap 50 lookups per run, 0.5s delay between calls. Cache in qualityreports/.doicache.json.

Opt-out: --skip-doi for offline or no-WebFetch environments.

2c. Style consistency within each file

For each file, count citation commands (\citet vs \citep vs \cite; @key vs [@key]). FLAG files with mixed styles without an obvious pattern (e.g., 20× \citep and 3× \cite in the same deck). Low-severity.

2d. Cite-claim sanity (flag-only)

Gated behind --cite-claim. For the top-10 most-cited works per file, WebFetch the crossref abstract and surface it beside the in-text context. No auto-judgment — humans decide if the claim matches.

This is existence/structure, not appropriateness. Deciding whether the cited paper actually says what the in-text claim attributes to it is /verify-claims's job — it reads the source and grounds a supports / partial / contradicts verdict in quotes + pages (with the EXPLAINED escape for a defensible named alternative). --cite-claim only surfaces the abstract; for the verdict, run /verify-claims.

Report structure (qualityreports/bibaudit_semantic.md)

# Bibliography Semantic Audit

**Date:** YYYY-MM-DD
**Bibliography:** Bibliography_base.bib (N entries)
**Files scanned:** [list]

## Summary

| Check | Critical | Medium | Low |
|---|---|---|---|
| Structural | | | |
| Citation drift | | | |
| DOI verification | | | |
| Style consistency | 0 | 0 | |

## Critical Issues

### Duplicate entries
| Keys | Signal | Citations | Recommended canonical |
|---|---|---|---|

### DOI mismatches
| Key | Field | .bib value | crossref value |
|---|---|---|---|

## Medium / Low issues
…

## Next steps
1. Resolve duplicates — pick canonical key, update citations, remove orphans.
2. Fix DOI mismatches — verify paper in crossref or strip the wrong DOI.
3. Review style-consistency notes.

Exit behavior

  • Structural: exit 0; report enumerates issues.
  • Semantic: exit 0 if only LOW findings; exit 1 on any CRITICAL. Usable as a pre-submission gate.

Cross-references

  • .claude/skills/review-paper/SKILL.md — pair for full pre-submission.
  • .claude/skills/audit-reproducibility/SKILL.md — numeric-claims counterpart.
  • .claude/skills/verify-claims/SKILL.md — citation appropriateness counterpart (does the cited paper support the claim?). This skill checks that a citation exists and is well-formed; /verify-claims checks that it holds.

What this skill does NOT do

  • Judge whether a citation is used in the right context — whether the cited paper actually says what the claim attributes to it. That is /verify-claims's job (see 2d); this skill stays existence-and-structure only.
  • Auto-fix your .bib file — all edits are recommendations.
  • Check non-DOI identifiers (ISBN, arXiv, SSRN) — roadmap.

More skills from pedrohcgs/claude-code-my-workflow

  • Aadjudicate-reviewTurn an incoming set of findings — from an AI reviewer, a referee report, a code review, a linter, or a second model — into verified fixes, without letting a confident misread damage correct work. Every finding is a CANDIDATE until checked against the actual source. Use whenever you receive review comments, audit findings, or a critique you did not write yourself, especially when the reviewer is a model or when the volume is too large to check by feel.
  • Aaudit-reproducibilityEnforce the replication-protocol.md rule by cross-checking numeric claims in a manuscript against the actual R / Stata / Python outputs. Report PASS/FAIL per claim against tolerance thresholds. Use before submission and before releasing a replication package.
  • Ablast-radiusBefore and after changing anything shared — a function's return value, a signature, a schema, a label set, a config default, a constant, a file format — find every consumer and actually run them. Catches the change that looks purely additive but silently breaks a contract in a file you never opened. Use when editing shared code, adding a field/column/return element, renaming, changing units or defaults, or touching a pipeline that produces reported numbers.
  • Acapture-environmentSnapshot the computational environment for a replication package — detects the analysis stack (R / Stata / Python) and emits the right lockfiles (renv.lock + sessionInfo.txt, requirements.txt / environment.yml / uv.lock, Stata version + ado package list), records seeds and RNG kind, optionally writes a pinning Dockerfile, and produces a paste-ready "Computational requirements" block. Use when user says "capture the environment", "snapshot my dependencies", "pin the versions", "make a renv.lock / requirements.txt", "make this byte-reproducible", or before releasing a replication package to openICPSR / the AEA Data Editor.
  • AchallengeStress-test a finding against the choices you did not make. Enumerates the discrete forks a competent analyst could have taken (measure definition, sample filter, control set, clustering level, weighting, functional form), runs the specification grid, and reports the distribution rather than a point estimate — then attacks the identifying assumption with named, computable sensitivity statistics. Use when the user says "is this robust", "challenge this result", "specification curve", "multiverse", "how sensitive is this", "what if I'd used a different measure", "stress-test my estimate", or before a result becomes a headline claim. NOT a reviewer of prose or code — it challenges the CLAIM.
  • AcheckpointSave a structured state snapshot before stopping or handing off. Captures the active plan, recent decisions, file pointers (with line numbers), open questions, and the next 1–3 actions into a checkpoint file under `quality_reports/checkpoints/`. Optionally proposes `[LEARN]` entries to add to MEMORY.md. Use when user says "checkpoint", "save state", "snapshot before I stop", "where am I", "wrap up the session for handoff", or before a long break / model switch / collaborator handoff. Companion to (NOT replacement for) the narrative session-log workflow.
  • Acoauthor-briefGenerate a co-author / collaborator handoff brief for a multi-author, multi-machine project — summarizing what changed since the last brief (git delta), the current state of each artifact (manuscript, analysis, slides), open questions, how to reproduce locally, and any restricted-data access steps. Use when user says "coauthor brief", "handoff brief", "bring my coauthor up to speed", "what changed since last week", "onboard a collaborator", "write a handoff for [name]", or before sending a co-author the repo. NOT a commit or a checkpoint — it is the cross-machine, cross-person summary `meta-governance.md` only partially covers.
  • AcommitCommit the current work — runs the quality, consistency and passport gates, branches off main if needed, stages specific files, and writes a commit whose subject states what is now true. Pushes and opens a pull request only with --pr or when the user asks; never merges — a merge happens only when the user explicitly says to merge. Use ONLY on explicit commit intent — user says "commit", "let's commit this", "open a PR", or prefixes with `/commit`. Do NOT auto-invoke on vague end-of-task phrases ("we're done", "wrap up") — those require explicit confirmation first. Never force-pushes or skips hooks.
  • Acompile-latexCompile a Beamer LaTeX slide deck with XeLaTeX (3 passes + bibtex). Use when user says "compile", "build the slides", "rebuild the PDF", "run latex", "render the tex", or asks why a `.tex` file isn't producing a PDF. Operates on `Slides/*.tex`.
  • Acompress-sessionDistill the current conversation into a structured note (decisions made, open questions, file pointers with line numbers, next 1–3 actions) and save to `quality_reports/session_logs/` before auto-compression. Differs from `/checkpoint` (explicit stop-point snapshot) and from auto-compaction (which truncates rather than distills). Use when context is approaching auto-compact threshold, when a long pipeline has accumulated many decisions, or when the user says "compress", "distil this session", "before we hit auto-compact", "structured handoff before context resets".
  • Acontext-statusShow current context status and session health. Use to check how much context has been used, whether auto-compact is approaching, and what state will be preserved.
  • Acreate-lectureCreate a new Beamer lecture `.tex` from source papers and materials, with notation consistency checks and the project's preamble wired in. Use when user says "create a lecture on X", "new lecture from these papers", "start a deck on topic Y", "scaffold a new Beamer file", "build me a lecture from these PDFs". Scaffolds the full deck — NOT for compiling existing `.tex` (use `/compile-latex`).

All agent skills → · MCP servers