The goal of this skill is not to display the command surface, but to reliably land the user's natural-language Zotero tasks on the correct runtime path, and then bring back the truly useful results.
First grasp these principles
- As long as the task's real goal is to operate onan existing local Zotero libraryoran existing/to-be-created reading workspace, use this skill, even if the user did not say
zot。 - In Claude Code or Codex, users should state their needs directly, not memorize commands first. The skill is responsible for translating needs into runtime actions.
zotis the only execution surface.ref/The old Python reference implementation inzot mcp serveare not the current primary path.- In the answer, give the conclusion, evidence, changes, or reason for failure first. Do not dump raw JSON to the user first.
First bucket by intent
1. Look up items
Users usually say:
- "Find papers related to reward hacking in my library"
- "Find that paper by Smith2024"
- "Show me the 10 most recent items just added to the library"
- "See what items are in this collection"
- "List the feeds in the current library"
Priority routing:
- General in-library search:
library search - Direct citation key lookup:
library citekey - Recently added items:
library recent --count - Fine-grained collection reading:
collection get/subcollections/items/item-count/tags - Library-level organizational information:
library tags/libraries/feeds/feed-items
2. Retrieve evidence
Users usually say:
- "Pull out this reference's details, children, and citations"
- "Pull out all PDF annotations, outline, and notes"
- "Download the attachment to local"
Priority routing:
- Single-item main entry point:
item get/related/children/cite/export - PDF evidence:
item pdf/fulltext/outline - annotation:
item annotation list/search - Attachment download:
item download <attachment-key>
3. Create a workspace
Users usually say:
- "Create an llm-safety workspace for me"
- "Organize papers related to mechanistic interpretability into a long-term workspace"
- "Later I want to do question-answering retrieval within this topic"
Priority routing:
- Create and maintain:
workspace new/add/import/remove/delete - Index and query:
workspace index/search/query
Note:
- The workspace name must be kebab-case, for example
llm-safety workspace searchis keyword searchworkspace queryis question-answering retrieval
4. Save queries
Users usually say:
- "Save this filter condition as a Zotero saved search"
- "List what saved searches I currently have"
- "Delete this expired saved search"
Priority routing:
library saved-search listlibrary saved-search createlibrary saved-search delete
Boundary:
- The Zotero Web API currently only provides saved search metadata and conditions, and does not directly return search results
- It should be explained that what is saved is the "query condition", not a "dynamic result set snapshot"
5. Download attachments
Users usually say:
- "Download the attachment ATCH005"
- "Pull the PDF of this item into the current directory"
Preferred routing:
- Known attachment key:
item download - When only the parent item is known: first
item children, then determine the attachment key
Things not to do:
- Do not disguise attachment downloads as
item attach - Do not mix upload and download into a single action
6. Safe writes
Users typically say:
- "Add a note to this reference"
- "Tag it with priority"
- "Add this item to a collection"
- "Preview first, then merge these two references"
- "Merge duplicate items"
- "Write the formal publication info back to the preprint"
Preferred routing:
- Items and tags:
item note .../item tag .../item update - Import:
item add-doi/add-url/add-file - Manual merge:
item merge - collection relationships:
collection add-item/remove-item/create/rename/delete - duplicates:
library duplicates/duplicates-merge - Status sync:
sync update-status
7. Configuration troubleshooting
Users typically say:
- "Why can't this environment write to Zotero"
- "First help me check whether the configuration is correct"
- "Switch the current profile to work"
- "Initialize a new config profile"
Preferred routing:
- Diagnostics:
doctor - Configuration:
config show/init/set/profiles list/profiles use
Invocation order
- If the system already has
zotinstalled, preferzot --json ... - Only in a development repository environment and when
zotis not inPATHshould you fall back to:
cargo run -q -p zot-cli -- ...
- Keep the same invocation method throughout a task; do not switch back and forth.
Diagnostic gate
For the following scenarios, run doctor:
- First contact with this environment
- Any write operation
- PDF / outline / annotation / attachment related tasks
- semantic index / semantic search / workspace query
- citation key lookup
- saved search / configuration troubleshooting / profile switching
- When the user says "why doesn't it work"
First choice:
zot --json doctor
Development environment fallback:
cargo run -q -p zot-cli -- --json doctor
Focus on these fields:
db_existswrite_credentials.configuredpdf_backend.availablebetter_bibtex.availablelibraries.feeds_availablesemantic_indexannotation_supportembedding.configuredconfig_file
Hard constraints
--libraryonly acceptsuserorgroup:<id>- workspace names must be kebab-case
zot mcp serveis currently unavailableitem add-filedoes not support--attach-modeitem annotation create/create-areaonly applies to PDF attachmentslibrary saved-searchhandles the conditions of a saved query, not the result items- Never directly modify
zotero.sqlite
Safety gate
By default, treat as actions with side effects:
item createitem add-doiitem add-urlitem add-fileitem updateitem trashitem restoreitem attachitem merge --confirmitem note additem note updateitem note deleteitem tag additem tag removeitem tag batchitem annotation createitem annotation create-areacollection createcollection renamecollection deletecollection add-itemcollection remove-itemlibrary saved-search createlibrary saved-search deletelibrary duplicates-merge --confirmsync update-status --applyconfig initconfig setconfig profiles use
Execution rules:
- When the user is only "looking", "analyzing", or "evaluating", do not secretly write to the library.
- Ordinary, single-item, reversible write operations may be performed after the user explicitly requests them.
- For these high-risk actions, first summarize the changes that are about to happen, then execute:
item trashitem note deleteitem merge --confirmcollection deletelibrary saved-search deletelibrary duplicates-merge --confirmsync update-status --apply
- When write permission is missing, stop at read-only analysis; do not pretend to succeed.
Common semantic differences
workspace searchis keyword search,workspace queryis question-answering retrievallibrary recent --count 10is the most recent N items,library recent 2026-04-01 --limit 20filters by time boundarylibrary semantic-searchis library-level semantic retrieval, not equivalent to workspace queryitem add-doi/item add-url/item create --doi|--url|--pdfsupports--attach-modeitem add-filecan include--doito fill in metadata, but does not accept--attach-mode- feeds are not accessed through
--library group:<id>, but instead uselibrary feeds/feed-items item downloadDownload the local attachment file,item attachupload a new attachmentitem mergeis the general merge with manually selected keeper/source,library duplicates-mergeis to first find duplicates, then merge by keeperconfig showis to view the effective configuration,config profiles useis to switch the default profile
Typical mappings from natural language to actions
-
"Find papers related to reward hacking in my library, then pick the most relevant one for me to cite"
Firstlibrary search, thenitem get/item cite -
"Show me the 10 most recent items that just entered the library"
Uselibrary recent --count 10 -
"Pull out the PDF annotations and notes for this paper"
Firstdoctor, thenitem get/item children/item annotation list -
"Create an llm-safety workspace for me; I'll be doing Q&A in it later"
Firstworkspace new/import, thenindex/query -
"Save this filter condition as a saved query"
Uselibrary saved-search create -
"Download attachment ATCH005"
Useitem download -
"Preview first, then merge KEEP001 and DUPE001; after confirmation, actually merge"
Firstitem merge KEEP001 DUPE001, after confirmation thenitem merge ... --confirm -
"Why can't I write to Zotero in my current environment?"
Firstdoctor, if necessaryconfig show
How to understand it when migrating from ref\zotero-cli
search->library searchget->item getannotations->item annotation listoritem pdf --annotationsnotes->item note listcollections->collection listcollection <id>->collection items <id>add doi/add url->item add-doi/item add-urltags->library tagsrecent [n]->library recent --count <n>merge->item merge; if you first find duplicates and then merge, uselibrary duplicates/duplicates-merge
Old mental model not to migrate back:
- Do not add a flat top-level alias
- Do not add
--api-base - Do not add compact JSON as the default output
- Do not turn the connector-style
search/fetchback into another set of main commands
How to understand it when migrating from ref\zotagent
Remember two things first:
- Currently
zotdoes not copyzotagent's flat command surface - Currently
synconly handles preprint publication status; it has the same name but is not an attachment indexer
Parts already covered or replaceable:
- DOI / URL / file import:
item add-doi/item add-url/item add-file/item create - Library-level semantic retrieval:
library semantic-index/library semantic-search - Single-PDF extraction:
item pdf/item fulltext/item outline - citation key entry point: first
library citekey, then switch toitem get/item cite
Not yet completed currently; do not pretend it exists:
s2add --s2-paper-idsearch-inmetadatareadexpand- zotagent-style
status - zotagent-style
syncfull attachment indexing - By
title/author/year/publicationmanually create items in one go
How to handle these requests:
search-in/expand: Clearly say there is currently no equivalent command; you can only firstitem fulltext/item pdfpull the text, then do a second-pass location on the agent sidemetadata: Explain that there is currently no field-scoped metadata search; at most fall back tolibrary searchplus existing filtersstatus: Usedoctor+library semantic-statuscombined to answer; do not treatsync update-statusas indexing statuss2/--s2-paper-id: Directly explain that it is not currently implemented; do not fabricate a substitute command- zotagent
sync: Explain that currently you can only uselibrary semantic-index --fulltextorworkspace indexas a partial substitute, and the scope is mainly metadata + PDF
Fallback when it fails
- No
zot: in the development repository, fall back tocargo run -q -p zot-cli -- ... - No write permission: clearly tell the user it is missing
ZOT_API_KEY/ZOT_LIBRARY_ID - Without Better BibTeX:
library citekeyOnly the Extra fallback is used - Without Pdfium: don't promise fulltext / outline / annotation / text processing after PDF download
- Without embedding: semantic retrieval descriptions will be degraded; workspace Q&A switches to
--mode bm25 attach-mode autoNo OA PDF found: the item may still be created successfully
Output contract
The final answer should:
- First answer the user's actual question, rather than pasting commands first
- Then give key evidence, actions taken, or the reason for failure
- If it fails, clearly tell the user what is missing and what the next step is
- By default, do not dump raw JSON; read the envelope first, then relay the useful information
The goal of this skill is not to explain the CLI more completely, but to let agents such as Claude Code and Codex reliably complete Zotero workflows using natural language.