bibtex-gen
Skill4 starsChanged 20 days agoMITView on GitHub
Generate BibTeX entries for academic references from arXiv IDs, DOIs, titles, URLs, batch lists, or reference-search JSON. Route HEP papers to InspireHEP, non-HEP papers to Google Scholar when available, and CrossRef DOI BibTeX as a fallback; preserve source-native keys and print or append to a .bib file. Use when the user asks for bibtex, citation entries, bibliography filling, arXiv/DOI/title-to-BibTeX, InspireHEP BibTeX, publisher BibTeX, or converting discovered references into a .bib file.
- Installs packages
In this repository38 other files it gives its agents.
- academic-cvSkill
- academic-jobsSkill
- academic-proseSkill
- adversarial-reviewSkill
- chrome-sessionSkill
- clickup-cliSkill
- clickup-todaySkill
- commit-triageSkill
- concept-explainerSkill
- contact-emailSkill
- cover-letterSkill
- dropboxSkill
- handdrawn-schematicSkill
- hep-rumor-millSkill
- journal-club-reviewSkill
- magi-researchSkill
- md2pdf-typoraSkill
- morgenSkill
- overleaf-section-workflowSkill
- overleapSkill
- peer-agent-reviewSkill
- proton-mailSkill
- reference-searchSkill
- remarkable-syncSkill
- research-backupSkill
- research-boardSkill
- research-logSkill
- research-portalSkill
- research-proposalSkill
- research-reportSkill
- research-statementSkill
- scienceplot-pySkill
- vastaiSkill
- wide-slide-illustratorSkill
- workshop-paper-reviewSkill
- xkcd-pySkill
- zai-web-searchSkill
- zoom-summarySkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 70
Do not silently rewrite keys.
- Distinctive: line 75
Confirm the input set: If the user gave a Korean / English list of references, treat each line as one query.
- Very specific: line 78
Decide routing override: If the user said "HEP", "high energy", "장 인용", "물리 논문" etc., pass --hep.
- Very specific: line 114
If the orchestrator is run with a bare python3 (no uv), scholarly may be missing.
- Distinctive: line 142
After creating or updating this skill, suggest starting a new session so the new skill is discoverable from session start.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
bibtex-gen — BibTeX Generator (InspireHEP / Google Scholar / CrossRef)
Generate bibtex entries by routing each query to the most authoritative
source. The skill is read-only for the user's existing .bib files
unless they pass --output, in which case new entries are appended (never
overwritten or de-duplicated — that is the user's call).
Routing logic
Each input is classified as HEP or non-HEP, then routed:
| Class | Primary source | Fallback |
| HEP | InspireHEP (format=bibtex) | non-HEP path if InspireHEP returns nothing |
| non-HEP | Google Scholar via scholarly | CrossRef DOI bibtex transform |
Classification rule: a query is HEP iff InspireHEP returns at least one
match for it. arXiv IDs additionally check the arXiv API for hep-* /
nucl-* categories as a strong pre-signal. The user can override with
--hep or --no-hep.
This intentionally aligns with the user's preference:
- HEP citations follow InspireHEP style (
Author:YYYYabckeys, journal abbreviations, eprint fields, collaboration tagging). - Non-HEP citations follow Google Scholar style first; if Scholar is unavailable or returns nothing, fall back to the publisher's bibtex via CrossRef's DOI→bibtex transform.
Inputs accepted
The orchestrator auto-detects the input type:
- arXiv ID —
2301.00001,arxiv:2301.00001,hep-ex/0511032 - DOI —
10.1103/PhysRevD.98.030001,doi:10.1...,https://doi.org/10.1... - Title — anything else is treated as a title / free-text query
- URL — DOI URLs are parsed; arXiv URLs are normalized to arXiv IDs
Batch mode reads one query per line from a file (# comments and blank
lines ignored).
For an OpenAlex-driven discovery → citation pipeline, the orchestrator
also accepts --from-search refs.json, where refs.json is the JSON
output of the reference-search skill (openalex_search.py --format
json). Each result's DOI is extracted (title fallback if no DOI) and
routed through the normal HEP / Scholar / CrossRef pipeline — so you can
run "find me 10 papers on X" and turn that into a .bib in one extra
command. See references/examples.md for the full pipeline recipe.
Bibtex key style
Each source returns its own key style; the skill preserves them verbatim:
- InspireHEP:
Smith:2024abc - Google Scholar:
smith2024title - CrossRef: DOI-suffix style (e.g.
Smith_2024)
Do not silently rewrite keys. If the user asks for a unified style, surface it as an explicit follow-up step, not a side effect.
Workflow
- Confirm the input set. If the user gave a Korean / English list of references, treat each line as one query. If they gave a single phrase, treat it as one query.
- Decide routing override. If the user said "HEP", "high energy", "장
인용", "물리 논문" etc., pass
--hep. If they said "ML 논문", "biology paper", etc., pass--no-hep. Otherwise let auto-classification run. - Run the orchestrator:
For batch mode:uv run bibtex-gen/scripts/bibtex_gen.py "<query>" [--hep | --no-hep] \ [--output refs.bib]uv run bibtex-gen/scripts/bibtex_gen.py --batch refs.txt --output refs.bib - Surface the bibtex. Stream to stdout by default. If
--outputis set, confirm append count to the user. - Report failures. Any query that produced no bibtex from any source is listed explicitly. Do not invent a bibtex entry — ask the user to refine the query or supply a DOI.
What this skill does NOT do
- It does not deduplicate entries in the target
.bibfile. Run a separate pass if needed. - It does not normalize keys across sources. If the user wants
FirstAuthorYeareverywhere, ask before doing it. - It does not fabricate missing fields. If a source returns sparse bibtex (no DOI, no journal), surface it as-is.
- It does not handle paywalled publisher endpoints directly. CrossRef bibtex is the publisher proxy and is sufficient for most journals.
Dependencies
The orchestrator carries PEP 723 inline script metadata declaring
scholarly as a dependency. When run with uv run, uv reads that header
and provisions an ephemeral environment that includes scholarly — the
user does not need to uv add or pip install anything ahead of time.
If the orchestrator is run with a bare python3 (no uv), scholarly
may be missing; in that case the Google Scholar path is skipped with a
one-line stderr note and non-HEP queries fall through to CrossRef. HEP
queries continue to work unchanged via the stdlib-only InspireHEP path.
Source notes (quick reference)
| Source | Endpoint | Auth | Stdlib only? |
| InspireHEP | https://inspirehep.net/api/literature?q={query}&format=bibtex | none | yes |
| arXiv | http://export.arxiv.org/api/query?id_list={id} (for HEP category) | none | yes |
| CrossRef | https://api.crossref.org/works/{DOI}/transform/application/x-bibtex | none | yes |
| Scholar | scholarly.search_pubs(q) → scholarly.bibtex(pub) | none | requires scholarly |
Full source-by-source semantics in references/sources.md. HEP
classification heuristics in references/hep_classification.md.
Resources
scripts/bibtex_gen.py— orchestrator; runnable asuv run scripts/bibtex_gen.py "<query>".references/sources.md— per-source API details, response shape, and gotchas.references/hep_classification.md— when a query is classified HEP vs non-HEP and how to override.references/examples.md— copy-pasteable CLI invocations (single, batch, HEP override, file append,reference-searchintegration).
Companion skills
reference-search— OpenAlex-based literature discovery. Use it upstream of this skill when the user has a topic / claim / section in mind but no specific paper picked out. Save its output with--format json, then runbibtex-gen --from-search <file>.jsonto materialize a.bib.
After creating or updating this skill, suggest starting a new session so the new skill is discoverable from session start.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

