Skip to content

Commit a6e55e6

Browse files
committed
Support codex
1 parent 998153a commit a6e55e6

22 files changed

Lines changed: 279 additions & 232 deletions

.claude-plugin/marketplace.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44
"name": "Yunguan Fu"
55
},
66
"metadata": {
7-
"description": "A bibliography toolkit for LaTeX — Claude Code plugin",
7+
"description": "A bibliography toolkit for LaTeX, built as agent skills",
88
"repository": "https://github.com/mathpluscode/bibtools",
99
"homepage": "https://bib.tools"
1010
},
1111
"plugins": [
1212
{
1313
"name": "bibtools",
14-
"source": "./",
14+
"source": {
15+
"source": "local",
16+
"path": "./"
17+
},
1518
"description": "A bibliography toolkit for LaTeX",
16-
"version": "1.4.0",
19+
"version": "1.5.0",
1720
"keywords": ["bibtex", "bibliography", "latex", "overleaf", "academic", "reference", "citation"],
1821
"category": "academic",
1922
"license": "MIT"

.claude-plugin/plugin.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "bibtools",
33
"description": "A bibliography toolkit for LaTeX",
4-
"version": "1.4.0",
4+
"version": "1.5.0",
55
"author": {
66
"name": "Yunguan Fu"
77
},
88
"repository": "https://github.com/mathpluscode/bibtools",
99
"homepage": "https://bib.tools",
1010
"license": "MIT",
11-
"keywords": ["bibtex", "bibliography", "latex", "overleaf", "academic", "reference", "citation"]
11+
"keywords": ["bibtex", "bibliography", "latex", "overleaf", "academic", "reference", "citation"],
12+
"skills": "./skills/"
1213
}

.codex/INSTALL.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Installing bibtools for Codex
2+
3+
Enable the `bibtidy` skill in Codex via native skill discovery.
4+
5+
## Prerequisites
6+
7+
- Git
8+
9+
## Installation
10+
11+
1. Clone the repository:
12+
13+
```bash
14+
git clone https://github.com/mathpluscode/bibtools.git ~/.codex/bibtools
15+
```
16+
17+
2. Create the Codex skills symlink:
18+
19+
```bash
20+
mkdir -p ~/.codex/skills
21+
ln -s ~/.codex/bibtools/skills/bibtidy ~/.codex/skills/bibtidy
22+
```
23+
24+
3. Restart Codex so it discovers the new skill.
25+
26+
## Verify
27+
28+
```bash
29+
ls -la ~/.codex/skills/bibtidy
30+
```
31+
32+
You should see a symlink pointing at `~/.codex/bibtools/skills/bibtidy`.
33+
34+
## Updating
35+
36+
```bash
37+
cd ~/.codex/bibtools && git pull
38+
```
39+
40+
The skill updates immediately through the symlink. Restart Codex if it is already running.
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Lint and Test
22

33
on:
44
push:
@@ -24,3 +24,7 @@ jobs:
2424
python-version: "3.12"
2525
- uses: astral-sh/setup-uv@v5
2626
- run: uv run pytest tests/ -v
27+
- name: Check docs/index.html is up to date
28+
run: |
29+
python docs/build.py
30+
git diff --exit-code docs/index.html

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ marimo/_lsp/
207207
__marimo__/
208208
.idea/
209209
.claude/settings.local.json
210-
tests/bibtidy/fixtures/got.bib
210+
.uv-cache/
211+
tests/bibtidy/fixtures/got_cc.bib
212+
tests/bibtidy/fixtures/got_codex.bib
211213
*.bib.orig
212214
TODO.md
213215
.DS_Store

AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# bibtools
2+
3+
A bibliography toolkit for LaTeX, built as agent skills. Explore the repo to understand the project structure before making changes.
4+
5+
## General principles
6+
7+
Bias toward action. Do not spend excessive time exploring files or asking clarifying questions when the task is clear. Start implementing and iterate.
8+
9+
## Code changes
10+
11+
- When fixing bugs or implementing changes, do NOT fix things that aren't actually broken. If you're unsure whether something is a real bug, ask before implementing a fix. Never apply fixes for theoretical issues that can't occur in practice given the actual workflow.
12+
- When making changes, always check README.md and other documentation files for references that need updating. Check for hardcoded magic numbers that should use existing config values.
13+
14+
## Code review
15+
16+
When asked to do a code review, only flag real actionable issues. Do NOT over-engineer fixes or apply unnecessary changes. When in doubt, propose the fix and wait for user approval before implementing.
17+
18+
## How it works
19+
20+
### bibtidy
21+
22+
In Claude Code, invoke with `/bibtidy refs.bib`. In Codex, ask it to use the `bibtidy` skill on a `.bib` file. The agent reads the file, dispatches parallel subagents to verify entries against Google Scholar and CrossRef (bundled `crossref.py`), then applies fixes sequentially with targeted edits. Every change includes the original entry commented out and one or more source URLs for verification.
23+
24+
## Versioning
25+
26+
Version is tracked in three files (`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `pyproject.toml`). Update all three, then run `uv lock` to sync `uv.lock`.
27+
28+
## Development
29+
30+
The skill's tools live under `skills/bibtidy/tools/` in this repo. At runtime, determine which agent platform you are (Claude Code, Codex, etc.) and resolve the installed tools directory accordingly (e.g. `~/.claude/skills/bibtidy/tools` for Claude Code, `~/.codex/skills/bibtidy/tools` for Codex). To test local changes:
31+
32+
- Run `./tests/run_bibtidy_cc_tests.sh` — this syncs local tools to `~/.claude/skills/bibtidy/` before invoking Claude
33+
- Run `./tests/run_bibtidy_codex_tests.sh` for the Codex end-to-end path
34+
- Unit tests only: `uv run pytest tests/`
35+
36+
## Code style
37+
38+
- Keep code and comments plain, direct, and easy to scan. Avoid decorative formatting or cleverness that does not add meaning.
39+
- Add comments only when they clarify intent, constraints, or a non-obvious choice. Skip comments that just restate the next line.
40+
- Prefer small shared helpers and simple structure over repeated logic.

CLAUDE.md

Lines changed: 0 additions & 60 deletions
This file was deleted.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

PRIVACY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Privacy Policy
22

3-
**bibtools** is a Claude Code plugin — a bibliography toolkit for LaTeX. It does not collect, store, or transmit any personal data.
3+
**bibtools** is a bibliography toolkit for LaTeX, built as agent skills. It does not collect, store, or transmit any personal data.
44

55
## What bibtools does
66

77
- Reads and edits `.bib` files on your local machine
88
- Sends bibliographic metadata (paper titles, author names) to public APIs (CrossRef, Google Scholar) to verify reference accuracy
9-
- All processing happens locally within your Claude Code session
9+
- All processing happens locally within your agent session
1010

1111
## What bibtools does NOT do
1212

README.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# bibtools
22

3-
A bibliography toolkit for LaTeX, built as a [Claude Code](https://docs.anthropic.com/en/docs/claude-code) plugin.
3+
A bibliography toolkit for LaTeX, built as agent skills. Available for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) and [Codex](https://openai.com/index/introducing-codex/).
44

5-
**[bibtidy](#bibtidy)** — Cross-check BibTeX entries against Google Scholar, CrossRef, and conference/journal sites. Upgrades arXiv/bioRxiv preprints to published versions (even when the title changed upon publication), corrects metadata (authors, pages, venues), and flags semantic duplicates (e.g. a preprint and its published version cited separately).
5+
**[bibtidy](#bibtidy)** — Cross-check BibTeX entries against Google Scholar, CrossRef, and conference/journal sites. Upgrades arXiv/bioRxiv preprints to published versions (even when the title changed upon publication), corrects metadata (authors, pages, venues), and flags duplicate entries.
66

77
![bibtidy demo](docs/bibtidy_demo.gif)
88

99
## Install
1010

11+
Installation differs by platform. Claude Code uses the plugin marketplace; Codex uses native skill discovery.
12+
13+
### Claude Code
14+
1115
Add the marketplace in Claude Code:
1216

1317
```bash
@@ -26,13 +30,23 @@ Reload plugins:
2630
/reload-plugins
2731
```
2832

29-
## bibtidy
33+
### Codex
34+
35+
Tell Codex:
3036

37+
```text
38+
Fetch and follow instructions from https://raw.githubusercontent.com/mathpluscode/bibtools/main/.codex/INSTALL.md
3139
```
32-
/bibtidy refs.bib
40+
41+
## bibtidy
42+
43+
```text
44+
Use bibtidy to validate and fix refs.bib
3345
```
3446

35-
bibtidy verifies each entry against [Google Scholar](https://scholar.google.com/) and [CrossRef](https://search.crossref.org/), fixes errors, and upgrades stale preprints to published versions. Every change includes the original entry commented out above so you can compare or revert, plus a `% bibtidy:` URL for verification. We recommend using git to track changes. If using [Overleaf](https://www.overleaf.com/), this can be done with [git sync](https://docs.overleaf.com/integrations-and-add-ons/git-integration-and-github-synchronization). To remove bibtidy comments after review, ask Claude: "remove all bibtidy comments from refs.bib".
47+
Or in Claude Code, use the slash command: `/bibtidy refs.bib`
48+
49+
bibtidy verifies each entry against [Google Scholar](https://scholar.google.com/) and [CrossRef](https://search.crossref.org/), fixes errors, and upgrades stale preprints to published versions. Every change includes the original entry commented out above so you can compare or revert, plus one or more `% bibtidy:` URL lines for verification. We recommend using git to track changes. If using [Overleaf](https://www.overleaf.com/), this can be done with [git sync](https://docs.overleaf.com/integrations-and-add-ons/git-integration-and-github-synchronization). To remove bibtidy comments after review, ask your agent to remove all `bibtidy` comments from the file.
3650

3751
Note that bibtidy assumes standard brace-style BibTeX like `@article{...}`. Parenthesized forms like `@article(...)` are not supported; convert them to brace style first.
3852

@@ -294,15 +308,15 @@ After:
294308

295309
### General
296310

297-
**Do I need Claude Code?**
311+
**Do I need a paid subscription?**
298312

299-
Yes. bibtools is currently a Claude Code plugin only. If there's demand to support other platforms (e.g. Codex), we'll consider adding it.
313+
Claude Code requires a paid plan (there is no free tier). Codex offers a free tier, so you can use bibtools with Codex at no cost.
300314

301-
**Why a Claude Code plugin instead of a Python package?**
315+
**Why an agent skill/plugin instead of a Python package?**
302316

303-
Building on Claude Code keeps the codebase small, the plugin reuses existing search and editing capabilities rather than reimplementing HTTP clients, parsers, and retry logic.
317+
Building on agent-native search and editing keeps the codebase small. The skill/plugin reuses existing web, editing, and subagent capabilities rather than reimplementing HTTP clients, parsers, and retry logic.
304318

305-
bibtidy needs to search Google Scholar, CrossRef, and conference/journal sites. Google Scholar has no official API and bans scrapers; Semantic Scholar's public API (1,000 req/s) is shared globally so availability is unpredictable. Claude Code's built-in web search sidesteps both problems, no API keys, no shared rate limits. Citation metadata (title, authors, venue, year) is almost never behind a paywall, so Claude can simply visit the publisher page and read the correct information.
319+
bibtidy needs to search Google Scholar, CrossRef, and conference/journal sites. Google Scholar has no official API and bans scrapers; Semantic Scholar's public API (1,000 req/s) is shared globally so availability is unpredictable. Agent environments with built-in web access sidestep both problems, no API keys, no shared rate limits. Citation metadata (title, authors, venue, year) is almost never behind a paywall, so the agent can simply visit the publisher page and read the correct information.
306320

307321
### bibtidy
308322

@@ -314,7 +328,7 @@ You shouldn't, and that's by design. The point of bibtidy is to surface potentia
314328

315329
[CiteAudit](https://arxiv.org/abs/2602.23452) verifies bibliographic metadata but is a closed system. bibtidy is fully open-source, transparent (every change includes the original entry commented out and a source URL so you can verify exactly what changed and why), and it fixes issues (wrong authors, stale preprints, incorrect pages) directly in your .bib file rather than just flagging them.
316330

317-
[refchecker](https://github.com/markrussinovich/refchecker) verifies references against Semantic Scholar, OpenAlex, and CrossRef, and uses LLM-powered web search to flag fabricated references. It reports problems but does not auto-fix them. bibtidy applies corrections in place so you review a diff, not a report. bibtidy also upgrades stale arXiv/bioRxiv preprints to their published versions (even when the title changed on publication), and requires no setup beyond installing the plugin.
331+
[refchecker](https://github.com/markrussinovich/refchecker) verifies references against Semantic Scholar, OpenAlex, and CrossRef, and uses LLM-powered web search to flag fabricated references. It reports problems but does not auto-fix them. bibtidy applies corrections in place so you review a diff, not a report. bibtidy also upgrades stale arXiv/bioRxiv preprints to their published versions (even when the title changed on publication), and requires no setup beyond installing the skill.
318332

319333
[bibtex-tidy](https://github.com/FlamingTempura/bibtex-tidy) reformats and deduplicates .bib files but does not verify metadata against external sources. bibtidy checks correctness, not just formatting.
320334

0 commit comments

Comments
 (0)