zotero-librarian
AGENTS.md2 starsChanged 2 months agoMITView on GitHub
Keeps a Zotero library organized: four collections, a controlled family:value tag vocabulary, [YYYY-MMDD] [Venue] Title titles, project page in the URL field. The scripts judge; the agent runs them, relays their report and handles only what they mark for a human. Tokens are the scarce resource: never read a PDF, grep a full text or re-derive a classification yourself. This file is read by every agent (Claude Code, Codex, ...; CLAUDE.md only imports it). Reply in the user's language. -…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,315 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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
- Very specific: line 33
Read through zl.py dump / localdb (a read-only copy of the sqlite.
- Very specific: line 74
No values outside taxonomy.toml.
≈ “Common” is an estimate: at least 1 in 5 of the 42,283 AGENTS.md 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
zotero-librarian — rules for the agent working in this repository
Keeps a Zotero library organized: four collections, a controlled family:value tag vocabulary, [YYYY-MMDD] [Venue] Title
titles, project page in the URL field. The scripts judge; the agent runs them, relays their report and handles only what
they mark for a human. Tokens are the scarce resource: never read a PDF, grep a full text or re-derive a classification
yourself. This file is read by every agent (Claude Code, Codex, ...; CLAUDE.md only imports it).
Reply in the user's language.
Where things are
zl.py the only entry point: python3 zl.py <command> (Windows: python); --help lists everything
taxonomy.toml collections, tag vocabulary with definitions, rules, venue abbreviations — the source of truth
zotero_librarian/ the package (stdlib only): classify / llm / pipeline / connector / zapi / localdb / setup_check / install ...
.agents/skills/ download · tidy · discover · refs (Agent Skills format; Codex `$download`)
.claude/skills/ verbatim copy for Claude Code (`/download`) — edit .agents/skills, then `zl.py setup --sync-skills`
docs/ first-run.md (existing library), classifier.md (how it decides), taxonomy.md (the file's reference), notero.md (Notion mirror)
tests/ tools/ unittest on synthetic papers (CI, 3 platforms) · eval_classify.py (the library as ground truth)
logs/ audit log written by the scripts (local, not in git)| Task | Command | ||
add papers (download skill) | zl.py add <links...> / --from-file FILE — pauses only when the collection is uncertain or, with ZC_LLM=agent, for an ADJUDICATE block | ||
organize items added by hand (tidy skill) | zl.py tidy [--dry-run] [--limit N] [--create-collections] — every item without a status tag | ||
| edit one item | zl.py verify <key> · tag <key> a,b (a status: replaces the reading status; --force to move it backwards) · untag <key> a,b --why ... · collect <key> <collection> · set <key> url=... | ||
find papers (discover, refs skills) | zl.py discover --days 7 --tags a,b · `zl.py refs <key | arXiv | DOI>·zl.py refs --library` |
| re-verify arXiv items | zl.py recheck [--dates] [--search], then --write after approval | ||
| new machine / before pushing | ./setup.sh (= zl.py setup; install puts zl on PATH) · zl.py setup --offline + python3 -m unittest discover -s tests + python3 tools/check_commits.py |
Access rules (hard constraints)
- Read through
zl.py dump/localdb(a read-only copy of the sqlite; works while Zotero runs). Never write to zotero.sqlite. - Existing items are edited only through the Web API (
zapi.py);tagsandcollectionsare replaced wholesale, so every payload starts from the server state and only adds. New items and PDFs go through the desktop connector (Zotero must be running forzl.py add); a PDF uploaded via the Web API never reaches the clients (WebDAV sync). - The API key lives in
.env(mode 600). Never print it. Missing: stop and ask. DELETE /itemsis permanent. Delete or trash only when the user says so, after the scripts logged a snapshot. Never delete notes or collections; collections are created only byzl.py tidy --create-collections, never by the agent.prefs.jsonly while Zotero is closed (automatic tags off on every client, seedocs/first-run.md). Every write is logged by the scripts tologs/— don't write the log by hand.
Repository rules
- English everywhere. A commit message is one line (imperative, what changed); a body only when the why is not obvious,
two lines at most. No agent attribution in a commit: no
Co-Authored-Bynaming an agent, noClaude-Sessionor "Generated with" line, no agent as author or committer — the person who made the change is the only author. Never commit.env,cache/,inbox/,logs/. - Versions are mechanical: a commit that touches behaviour (
zl.py,zotero_librarian/,taxonomy.toml, the skills) is titledvX.Y: <what changed>, bumps__version__(zotero_librarian/__init__.py) and adds that line toCHANGELOG.md— Y +1 every time, fixes included; docs / tests / tools / CI-only commits are plain. The maintainer bumps X and tags major versions.tools/check_commits.pyenforces all of it in CI. - Review follows Google's The Standard of Code Review (https://google.github.io/eng-practices/review/reviewer/standard.html):
approve once the change clearly improves the code's overall health, even if imperfect; facts and data over opinions; this
file and consistency with existing code settle style;
Nit:marks optional remarks; the maintainer breaks ties. - Agent-neutral:
.agents/skills/is the source,.claude/skills/its verbatim copy (setupfails otherwise). A skill uses only what every agent has — "run this command, relay the table, handle PAUSE rows" — no agent-specific frontmatter or tools. - Platform-neutral: Ubuntu, macOS, Windows, Python 3.11+, standard library only. Paths, credentials and external programs
come from
config.pyonly; files are UTF-8; docs saypython3and note Windows usespython. CI runssetup --offlineand the tests on all three; the fullsetupmust pass on all three before a major version is tagged.
Collections and tags
taxonomy.toml holds the vocabulary, the definitions (the policy the local model reads — keep them precise) and the rules.
Four collections, no new ones, no sub-collections; finer distinctions are tags.
- Judge from the abstract and the experiments, never the title alone. A method / hardware / input counts only if the paper's own contribution uses it — baselines, related work and future work don't. Unsure: leave the family empty and say so.
- The scripts output assigned (written), candidates (listed, not written) and flags. A candidate is added with
zl.py tagafter the user agrees; one whose evidence clearly meets the definition may be added directly, said so in the report. - Borderline candidates are adjudicated by
ZC_LLMin.env:ollama/openai(a local model, free),agent(the script prints an ADJUDICATE block and pauses; answer with--confirm a,bor--confirm noneon the printed command — only the candidates asked about), oroff. - No values outside
taxonomy.toml. A new value needs the user's approval and a definition + patterns there. No bare tags exceptkeep_bare_tags(written by plugins such as Notero) — never remove those, nor their link attachments. - Exactly one status on the read axis (
to-read-first > to-read > skimmed > read); new items getto-read; status never moves backwards without approval; the other status axes are the user's. Existing user-set titles, nickname brackets ([ALOHA/ACT]) and markers (✅ ❗) are never changed.
Titles, venues, URL — what the scripts enforce
Title [YYYY-MMDD] [Venue] Original title (off with [library] title_prefix = false); the date is the day the paper first
appeared (arXiv v1, else the preprint's v1, else online publication), never moved by acceptance or re-download, written as far
as known ([2008-11], [1987]). Venue = abbreviation from taxonomy.toml; [arXiv] until acceptance is found by the scripts
(arXiv comment -> PDF first page -> Semantic Scholar -> Crossref -> project page). Never fill a venue from memory.
URL = project page if one exists, else the arXiv / DOI link; the arXiv id stays in the DOI field; Short Title = nickname >
part before the colon > title. Physical Intelligence's models are written in ASCII in titles and short titles (pi0, pi0.5,
never the Greek π — it is not searchable; titles.ascii_pi). PDF file names carry no prefix (Zotero rename template;
tools/fix_pdf_names.js repairs old ones). A paper indexed nowhere (project page + camera-ready PDF, no arXiv, no DOI,
no citation meta) is still added: the local model reads title / authors / abstract / venue statement off the PDF's first
page (sources.meta_unindexed), the date is the PDF file's creation date, and the report flags both — --name, --date,
--venue override.
Workflows
downloadskill:zl.py adddoes fetch -> classify -> save -> verify the sync -> log -> table. The agent relays the table, lists candidates and flags, and resolves PAUSE rows by running the printedzl.py save ...line (--collectionfrom the printed abstract,--confirmfor an ADJUDICATE block). No grepping, no polling loops, no hand-written logs.tidyskill:zl.py tidyon items without a status tag — same pauses, same report.discover/refsonly print tables.- Changing the classifier: edit
taxonomy.toml, add a synthetic case totests/, runpython3 tools/eval_classify.py(and--llm) and keep precision from dropping. Details:docs/classifier.md; every key of the file:docs/taxonomy.md.
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.

