Logo di Build Zotero Library

Build Zotero Library

Community
danepps
build-zotero-library

Build or extend a verified Zotero collection for a research project, including attached full-text PDFs when requested. Use when the user asks Codex to build, populate, curate, or add sources or PDFs to a Zotero library or collection; gather books, articles, cases, reports, or other research sources into Zotero; attach open-access PDFs or files the user supplies; or audit newly added Zotero items and attachments. Search for candidates, prevent duplicates, record field-level provenance, write through the Zotero Web API, and enforce post-write verification before reporting completion.

Panoramica

Pubblicato dadanepps
Repositorylegal-research-skills
Nome della skillbuild-zotero-library
Stelle
46
Fork
9
File inclusi
10
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 10

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da danepps su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Build Zotero Library in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/danepps/legal-research-skills/tree/main/codex/build-zotero-library
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/danepps/legal-research-skills.git /tmp/legal-research-skills
mkdir -p .claude/skills
cp -r /tmp/legal-research-skills/codex/build-zotero-library .claude/skills/build-zotero-library
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Build Zotero Library in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Build Zotero Library non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Build Zotero Library non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Build Zotero Library

Build a useful research collection without inventing sources or leaving uncertain records behind. Treat Zotero writes as a reviewed data pipeline: scope, discover, verify, deduplicate, preview, write, re-fetch, audit.

Start a hidden run

Create run state inside the active project, not beside the final user-facing work:

bash
python3 <skill-dir>/scripts/init_run.py \
  --project-dir <project-dir> \
  --request "<user request>" \
  --library user:<id> \
  --collection-name "<target collection>"

Add --require-pdfs whenever the request requires attached full text. Do not omit it merely because authenticated acquisition may be difficult; the validator must keep the run incomplete until every target has a verified PDF or the user accepts a narrower result.

Use the printed run directory for every artifact. Read references/run-format.md before populating it. Do not expose API keys in files, commands, logs, or chat.

Infer a sensible scope when the request is specific. Ask only when a missing choice would materially change the collection: target library, new collection name, source types, date range, jurisdiction, or whether representative rather than exhaustive coverage is wanted. Creating a new collection is authorized only when the user requested one or clearly requested a named destination that does not exist.

Confirm access and destination

Before proposing candidates, the lead reads a complete inventory of the target library. Save it inside the hidden run directory:

bash
python3 <skill-dir>/scripts/zotero_api.py inventory --library user:<id> \
  --output <run-dir>/library-inventory.json

For a large library, inspect the overall inventory and locally filter relevant slices. A narrow search or a worker's statement that a work is absent does not establish absence from the library. The lead owns the inventory and duplicate decision; give any discovery worker the relevant existing-item list. child_count includes notes and non-PDF attachments and never proves that full text is present.

Use the connected Zotero MCP tools for semantic library search, metadata reads, and full text when available. Use the bundled Web API helper for exact collection reads and all writes:

bash
python3 <skill-dir>/scripts/zotero_api.py key-info
python3 <skill-dir>/scripts/zotero_api.py collections --library user:<id>
python3 <skill-dir>/scripts/zotero_api.py collection-items --library user:<id> --collection <key>

For a new installation, configure the recipient’s own ZOTERO_API_KEY, ZOTERO_LIBRARY_ID, and ZOTERO_LIBRARY_TYPE securely in the host environment. The helper reads those variables first; its macOS Keychain fallback is specific to an existing Codex Zotero setup and is optional. Resolve the recipient’s destination from the API and current request; never copy another researcher’s library IDs or credentials. Never read Claude configuration as a credential source. Pass --library group:<id> explicitly for a group library.

The helper does not read MCP configuration files at any scope. A library exposed by a project-specific connected tool can therefore be usable for reads while the shell helper has no credentials for writes. Discover libraries through the active runtime, show their real names, and verify the chosen destination through the route that will perform the operation. Missing shell credentials do not prove that no library exists. If the write route is unavailable, report that limitation and its remedy before preparing a write; do not substitute the Keychain's default library for the requested destination or claim that a read-only connection can perform the write.

Before any write:

  1. Confirm the target library and collection key.
  2. Search both the collection and the wider library for duplicates using title, creator, ISBN, DOI, and close variants.
  3. Record the search queries, possible matches, and unique, duplicate, or uncertain decision in candidates.jsonl.
  4. Recheck duplicates immediately before each write, including late additions and items created earlier in this run. Reuse an existing item by adding collection membership rather than creating a duplicate. Because that modifies external state, preview the proposed membership change just like a new item.

Discover and verify candidates

Search the local project and Zotero library first when relevant, then authoritative external sources. For books prefer publisher pages, national or university library catalogs, ISBN-linked catalog records, and Google Books. For articles prefer the journal, DOI registry, institutional repository, author manuscript, HeinOnline, SSRN, or another source that proves bibliographic identity. For cases and government materials prefer official repositories.

If a source is available only through an authenticated database (HeinOnline, a library proxy, a publisher paywall), do not try to automate access. Ask the user to download the PDF themselves and attach it with --file --source-mode file, recording the provenance URL with --source-url. Never type, request, store, or infer institutional credentials, and never drive a two-factor login.

For every candidate:

  1. Open at least one source establishing that the work exists.
  2. Cross-check surprising, conflicting, or high-risk metadata against a second independent source.
  3. Record field-level provenance for every material field written: title, creators, date, publication, publisher, volume, issue, pages, edition, ISBN, DOI, URL, and item type as applicable.
  4. Do not fill plausible metadata from memory. Leave a nonrequired field blank when it cannot be verified.
  5. Use the edition's actual imprint and date. Preserve verified contributor roles; do not force an unsupported role into Zotero.
  6. Put stable identifiers in their native fields. Normalize DOI values without a doi.org prefix. Prefer ISBN-13 when the edition supplies it.

For law-review articles, preserve the source title's leading article and question mark; use the specific issue's year. Distinguish a real subtitle from an appended piece-type label using the first page. Preserve verified student-note, comment, essay, or foreword designations separately in extra as a genre: line without overwriting other provenance. Verify journal abbreviations before populating journalAbbreviation; never invent one. These fields require the same provenance as other metadata.

Precheck proposed records before writing:

bash
python3 <skill-dir>/scripts/verify_items.py --input <run-dir>/planned-items.json \
  --output <run-dir>/precheck.json

An identifier-based PASS proves bibliographic identity and detects contradictions; it does not prove every Zotero field. The provenance ledger carries that burden. NO_IDENTIFIER, UNRESOLVED, UNAVAILABLE, and MISMATCH require more research or a documented manual verification, not optimism.

Preview and write

Show the user a compact preview before a broad or judgment-heavy write: destination, item count, representative inclusions, exclusions, and unresolved duplicate or scope questions. A routine write that directly matches a precise request may proceed without an extra confirmation. Never silently broaden the project.

Write no more than 50 items per request. The helper adds an idempotency token and records the exact request hash and API response:

bash
python3 <skill-dir>/scripts/zotero_api.py create-items \
  --library user:<id> \
  --input <run-dir>/planned-items.json \
  --output <run-dir>/write-result.json

Inspect the response's successful, unchanged, and failed maps. Do not report an item as added merely because the HTTP request returned successfully.

For corrections, fetch the current item and use a version-guarded partial update:

bash
python3 <skill-dir>/scripts/zotero_api.py patch-item \
  --library user:<id> --key <item-key> --version <version> \
  --input <patch.json>

Do not delete preexisting items. If a newly created item cannot be corrected or verified, disclose the problem and request approval before deleting it.

Acquire and attach requested PDFs

Prefer an open publisher, journal, repository, author, SSRN, government, or other authorized direct PDF URL. Attach direct PDF bytes and append the verified result to the run ledger:

bash
python3 <skill-dir>/scripts/attach_pdf.py \
  --library user:<id> --item <parent-key> --url <pdf-url> \
  --ledger <run-dir>/attachment-results.jsonl

For a PDF the user downloaded themselves from an authenticated source, attach the local file with its provenance URL:

bash
python3 <skill-dir>/scripts/attach_pdf.py \
  --library user:<id> --item <parent-key> --file <path-to.pdf> --source-mode file \
  --source-url <item-url> --ledger <run-dir>/attachment-results.jsonl

If a reused Zotero item already has a stored PDF, verify its bytes instead of adding a duplicate:

bash
python3 <skill-dir>/scripts/attach_pdf.py \
  --library user:<id> --item <parent-key> --verify-existing \
  --ledger <run-dir>/attachment-results.jsonl

The helper parses PDF structure and page content streams with pypdf or PyPDF2, rejects malformed or unreadable files, re-fetches Zotero attachment metadata, matches Zotero's MD5, and computes a local SHA-256. It writes VERIFIED only after parsing and the parent, content type, and stored hash checks pass. If neither parser is available, the attachment remains unverified; install a parser or disclose the incomplete PDF requirement. This is structural verification, not visual inspection or proof that the PDF contains the intended work.

For each new attachment, the helper fetches the parent item's verified Zotero metadata and stores the PDF as Creator - Year - Title.pdf. It uses two creator surnames, switches to FirstCreator et al. for three or more, omits unavailable components, removes filesystem-unsafe characters, and limits the UTF-8 filename length. Use --filename only when a source needs a distinct descriptive label, such as a supplement; the override is normalized to the same safe PDF rules. Do not preserve opaque download names when parent metadata is available. --verify-existing audits an existing filename but does not rename it.

Re-fetch and enforce the gate

Verify exactly what Zotero stored, using the keys returned by the write response and the existing keys of every reused target item:

bash
python3 <skill-dir>/scripts/verify_items.py \
  --library user:<id> --keys <K1,K2,...> \
  --output <run-dir>/verification.json

python3 <skill-dir>/scripts/validate_run.py <run-dir> --require-ready

The verification output records the destination library and fetched item metadata. The gate checks target collection membership and agreement with planned bibliographic fields for every added or reused item. A local-input precheck cannot substitute for this readback. Collection and library list helpers follow every API page; --limit controls page size, not total coverage.

For a genuine item without a resolvable ISBN or DOI, add a line to manual-verifications.jsonl following the run-format reference. A MANUAL_PASS requires an opened authoritative source, the item key, the source URL, access time, checked fields, and a concise note. Search snippets, memory, and secondary mentions do not qualify.

Do not call the run complete unless the validator prints READY. For a --require-pdfs run, READY also requires one structurally verified PDF attachment for every added or reused target item. Repair failed writes, duplicates, provenance gaps, attachment gaps, and verification failures, then re-run the gate. A network outage may justify a candid incomplete or limited handoff, never a fabricated pass.

Report

Return a concise summary containing:

  • destination library and collection;
  • items added, reused, skipped as duplicates, and excluded;
  • the validator's status and verification counts;
  • any MANUAL_PASS items and their verification basis;
  • material judgment calls, remaining limits, and decisions the user should make.

Keep run artifacts hidden unless the user asks to inspect them. Do not publish a memo merely to describe the run.

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Build Zotero Library?

Build or extend a verified Zotero collection for a research project, including attached full-text PDFs when requested. Use when the user asks Codex to build, populate, curate, or add sources or PDFs to a Zotero library or collection; gather books, articles, cases, reports, or other research sources into Zotero; attach open-access PDFs or files the user supplies; or audit newly added Zotero items and attachments. Search for candidates, prevent duplicates, record field-level provenance, write through the Zotero Web API, and enforce post-write verification before reporting completion.

Perché usare Build Zotero Library su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Build Zotero Library è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Build Zotero Library in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/danepps/legal-research-skills/tree/main/codex/build-zotero-library. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Build Zotero Library?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Build Zotero Library?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Build Zotero Library: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Build Zotero Library è gratuita?

Sì. È pubblicata su GitHub da danepps con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇