Logo: Build Zotero Library

Build Zotero Library

Communautéit
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.

Iwwersiicht

Editeurdanepps
Repositorylegal-research-skills
Skill-Nummbuild-zotero-library
Stären
46
Forks
9
Matgeliwwert Dateien
10
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 10 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    danepps huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Build Zotero Library an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/danepps/legal-research-skills/tree/main/codex/build-zotero-library
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Build Zotero Library an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Build Zotero Library automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Build Zotero Library net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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.

Firwat Build Zotero Library op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Build Zotero Library besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Build Zotero Library an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/danepps/legal-research-skills/tree/main/codex/build-zotero-library an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Build Zotero Library benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Build Zotero Library benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Build Zotero Library domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Build Zotero Library gratis?

Jo. danepps huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇