From zotero-skills
Create, modify, retrieve, and execute Zotero saved searches programmatically using the Zotero.Search API. Covers conditions, operators, join modes, and the saveTx() persistence pattern.
How this skill is triggered — by the user, by Claude, or both
Slash command
/zotero-skills:saved-searchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
How to create, modify, retrieve, and run saved searches in Zotero using `Zotero.Search`.
How to create, modify, retrieve, and run saved searches in Zotero using Zotero.Search.
Saved searches in Zotero are persistent, named queries stored in the database. They live in chrome/content/zotero/xpcom/data/search.js and extend Zotero.DataObject. The plural manager class Zotero.Searches handles retrieval. Saved searches appear in the collections pane and are re-evaluated dynamically each time they are opened.
(condition, operator, value) — e.g., ('title', 'contains', 'climate'). Conditions are stored by integer ID returned from addCondition().joinMode/any as the first condition to switch to OR.addCondition() marks a condition as required when using ANY join mode.searchID for new objects.new Zotero.Search()name (required) and optionally libraryIDaddCondition()await search.saveTx() to persistconst search = new Zotero.Search();
search.name = "Recent climate papers";
search.libraryID = Zotero.Libraries.userLibraryID; // optional, this is the default
search.addCondition('title', 'contains', 'climate');
search.addCondition('dateAdded', 'isInTheLast', '30 days');
const searchID = await search.saveTx();
const search = new Zotero.Search();
search.name = "Papers by Smith or Jones";
search.addCondition('joinMode', 'any'); // must be added before other conditions
search.addCondition('creator', 'contains', 'Smith');
search.addCondition('creator', 'contains', 'Jones');
await search.saveTx();
const search = new Zotero.Search();
search.libraryID = Zotero.Libraries.userLibraryID;
search.addCondition('tag', 'is', 'to-read');
const itemIDs = await search.search();
const search = await Zotero.Searches.getAsync(searchID);
search.addCondition('itemType', 'is', 'journalArticle');
await search.saveTx();
const search = new Zotero.Search();
search.name = "Test";
const condID = search.addCondition('title', 'contains', 'foo');
search.removeCondition(condID);
const conditions = search.getConditions();
// { 0: { id: 0, condition: 'title', operator: 'contains', value: 'foo', required: false }, ... }
| Condition | Notes |
|---|---|
title, anyField | Item field matching |
creator, author, editor, lastName | Creator fields |
tag | Tag matching |
note, childNote | Note content |
itemType | e.g., 'journalArticle', 'book' |
collection | Restrict to a collection (value = collection key) |
savedSearch | Restrict to results of another saved search |
dateAdded, dateModified | Date fields |
fulltextContent, fulltextWord | Full-text search |
deleted | Include/exclude deleted items |
unfiled | Items not in any collection |
joinMode | 'any' or 'all' (default) |
| Operator | Applicable to |
|---|---|
is, isNot | Most fields |
contains, doesNotContain | String fields |
beginsWith | String fields |
isBefore, isAfter | Date fields |
isInTheLast | Date fields; value like '7 days', '1 month' |
isLessThan, isGreaterThan | Numeric fields |
true, false | Boolean conditions |
Zotero.Searches)Zotero.Searches.get(id) // synchronous
await Zotero.Searches.getAsync(id) // async
Zotero.Searches.getByLibrary(libraryID) // all searches in a library
Zotero.Searches.getAll(libraryID) // all, sorted by name
await Zotero.Searches.erase([id1, id2]) // delete
name is required — saveTx() throws "Name not provided for saved search" if empty.libraryID defaults to the user library if not set.npx claudepluginhub cboulanger/zotero-skills --plugin zotero-skillsProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.