Logo von 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.

Übersicht

Herausgeberdanepps
Repositorylegal-research-skills
Skill-Namebuild-zotero-library
Sterne
46
Forks
9
Mitgelieferte Dateien
10
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • Mitgelieferte Dateien: 10

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von danepps auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Build Zotero Library in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/danepps/legal-research-skills/tree/main/codex/build-zotero-library
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

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
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Build Zotero Library in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Build Zotero Library automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Build Zotero Library nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

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.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der 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.

Warum Build Zotero Library in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Build Zotero Library besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Build Zotero Library in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/danepps/legal-research-skills/tree/main/codex/build-zotero-library ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Build Zotero Library nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Build Zotero Library verwenden?

So viele Sie möchten. In TypingMind können Sie Build Zotero Library mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Build Zotero Library kostenlos?

Ja. Der Skill wird von danepps auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇