/research-superpowers:add-to-library <path-to-pdf> [doi]from research-superpowers
Adds a single PDF to a shared master bibliography: verifies metadata via Crossref/OpenAlex, derives keywords, computes bibkey, and appends to references.bib.
Ships in research-superpowers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
add-to-library is the direct-to-library route, deliberately outside the project pipeline:
ingest-source reads an acquired source into a project's wiki (source page + entities + a project-local BibTeX entry) with a full read. It is project-scoped.acquire-sources downloads the PDFs a literature-review guide lists.add-to-library takes one PDF you already have and adds it to the shared master so it surfaces in bib-search.py for every future project — no wiki content, no full read. Later, if a project actually cites it, ingest-source reads it as usual; the master entry is already there.Use it when a colleague sends a PDF, or you download one, and you want it in the collection now without ingesting it.
Announce at start: "Using add-to-library to add <pdf> to the shared master library — I'll verify the metadata before writing anything."
The deterministic mechanics (compute the bibkey, place the PDF, append the entry) live in scripts/add-to-library.py. Your job is the judgement the script cannot do: verify the metadata against a real record, and curate the keywords. Never let the script mint a key from data you have not verified.
If a condition is unmet: name it, ask for a one-line reason, write it to knowledge/_meta/gate-overrides.log, and close. Exception — never soft-gate past (1): if the metadata cannot be verified, do not write; stop and ask.
(1) is enforced by the script, not by your resolve. add-to-library.py commit refuses without --doi unless you pass --unverified-reason "…", and that reason is written into the entry's note field as UNVERIFIED: … — visible to everyone who ever reads that record, in every project. You cannot write an unverified entry silently.
Create a task-list item for each:
Resolve the library. python scripts/add-to-library.py inspect <pdf> resolves it via scripts/library.py. If it reports the library is not configured, that is the machine-local .research-library problem — surface the message, do not proceed.
Inspect the PDF (cheap).
python scripts/add-to-library.py inspect <pdf> --json
Returns docinfo (Title/Author/Keywords/Subject), the first-page text (where the abstract lives), any DOI printed on the front pages, and has_text_layer.
⛔ Stop-and-ask if has_text_layer is false and no DOI was found: a scan with no verifiable identifier cannot be added cheaply — OCR it first, or add it via ingest-source.
Discover and VERIFY the metadata (this is the load-bearing step). Prefer the dao-paper-search-mcp (see docs/recommended-mcps.md); fall back to a manual Crossref lookup if it is absent.
doi input):
dao-paper-search-mcp.search_crossref(query=<doi>)
→ exactly one hit; check that its identifiers.doi IS <doi>
(a DOI query is a direct lookup from dao-paper-search-mcp 1.2.0;
older versions search and can return a different work)
→ hit.inline_citation.authoritative_bibliography_line (verbatim)
or manually: curl -s https://api.crossref.org/works/<doi>.search_crossref / search_openalex by the title + author from docinfo, and require a confident single match.article, incollection (book chapter — use --booktitle), book, inproceedings, … Chapter-vs-whole-book is a judgement; if the record is ambiguous, ask.Derive keywords cheaply. From the docinfo Keywords/Subject fields (often empty or boilerplate — treat as hints) plus the first-page abstract text from step 2, curate 3–8 terms: the canonical name plus known synonyms and aliases across spellings and disciplines (the same discipline as drafting-manuscript's "Searching for a concept, not a string"). No full read. Thin keywords are acceptable — they accrete later at ingest-source time. Never let weak keywords justify skipping step 3.
Where the value sits: the abstract's own vocabulary is already in the full-text index — a later rank-fused alias search (bib-search.py --q, the ranking arm) will match those words with or without you. What only this step can add is the recall arm: terms the abstract does not use — the other disciplines' names, the spelling the field you come from doesn't — because fusion re-ranks what some alias literally matches and adds zero recall. One alias the abstract omits is worth more than three it repeats.
Choose the kurztitel. One to three significant title words — a judgement, not the first three words of the title ("The Low Chronology and the Problem of…" → low chronology, not low-chronology-problem). add-to-library.py proposes one via library.propose_shorttitle; refine it.
Commit — dry-run first, then write.
python scripts/add-to-library.py commit --pdf <pdf> \
--author "<first author, as in BibTeX>" --year <YYYY> --title "<full title>" \
--etype <type> --kurztitel "<chosen>" \
[--journal … --booktitle … --pages … --volume … --number … --doi … --url …] \
--keywords "term one; term two; term three"
Review the proposed bibkey and, if it reports a disambiguation letter (mazar-2011b-iron-age), confirm the new document is genuinely a different work from the existing mazar-2011-… before writing. Then re-run with --write. The commit step:
--force);<library>/references.bib.Re-index so the source is immediately searchable:
python scripts/bib-search.py index
Then close the loop with the search a later drafter would run — canonical name plus your aliases, rank-fused:
python scripts/bib-search.py '"<canonical name>"' --q '<alias>' --key <bibkey>
The keyword hit should print first (ahead of any page hit, page: null). If nothing comes back, the entry is invisible to exactly the query it exists for — fix the keywords now, while the abstract is still in front of you.
Log. Append one line to knowledge/_meta/log.md:
- YYYY-MM-DD · add-to-library · <bibkey> · verified via <crossref|openalex>
Soft-gate (above) and report: the bibkey, where the PDF landed, the keywords written.
Same as ingest-source's BibTeX Entry Convention. keywords is semicolon-separated, 3–8 terms, canonical name plus synonyms/aliases — it is what bib-search.py matches when a source describes a method in prose without naming it; the rank-fused --q alias search changes ranking only, never recall, so this field is the sole non-text-derived path into a search result (see ingest-source's keyword step for the full division of labour). The bibkey is autor-jahr-kurztitel, all lowercase ASCII (umlauts → ae/oe/ue, ß → ss; Turkish ı → i, Polish ł → l; particles/spaces removed), letter suffix after the year for a genuine clash. bibkey == PDF filename stem is the cross-project join key — the script enforces the shape.
| Tempting shortcut | Why it's wrong |
|---|---|
| "The docinfo Title is the citation — use it." | Docinfo is frequently wrong, stale, or a template placeholder. Verify against Crossref/OpenAlex (step 3). |
| "curl returned 200, so the DOI is right." | A 200 only means the DOI resolves. Check the returned record matches the PDF's title/author/year. |
| "No DOI, but I'll infer the year from the filename." | That is guessing bibliographic data. Stop and ask (step 3). |
| "The keywords look thin, so I'll skip verification and just file it." | Keywords are never a reason to skip step 3. Verification gates the write; keywords do not. |
"The abstract names the method — --q fusion will find this entry, keywords are redundant." | The abstract's words are in the index either way; fusion only re-ranks what an alias literally matches. Keywords earn their keep as the aliases the abstract does not use — and without a full read, nobody has recorded those yet. |
| "The base bibkey already exists — I'll just overwrite it." | If it's the same work, keywords union in automatically. If it's different, take the disambiguation letter. Never overwrite a live key. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub leiverkus/research-superpowers --plugin research-superpowers18 skills in this plugin
/acquire-sourcesUse AFTER literature-review and BEFORE ingest-source to obtain the actual PDFs for the A+B graded sources. Auto-downloads Open-Access PDFs into the shared library (<library>/pdf/<bibkey>.pdf — the bibkey IS the filename) and writes a manual-download worklist (input/bibliography/acquisition-todo.md) for everything paywalled or bot-blocked, so the user can fetch originals via university VPN. Re-run to reconcile manually-downloaded files. Triggers on "acquire the sources", "download the literature", "get the PDFs", "Quellen beschaffen", "lade die Literatur herunter". NOT a search skill (that is literature-review), NOT an ingest skill (that is ingest-source)./brainstorming-researchUse BEFORE any research work — defining a question, planning a study, starting a chapter, proposing a grant. Explores intent, state of the field, methodology, feasibility, and ethics, then writes a design doc and gets user approval./drafting-manuscriptUse to draft a book chapter, article section, or grant exposé from synthesized wiki content. Settles the argument architecture with the user first; by default then sketches the WHOLE text — every section's argument, a paragraph plan for long sections, an evidence check with a gap list — and gets that sketch approved before any prose exists, then writes section by section along the plan (per-section mode on request). Pulls from stable synthesis pages and source pages, writes to `output/**/*.qmd` with proper citations. Never drafts from memory — always from the wiki./drift-reportUse to check the shared library, the current wiki, and all registered projects for accumulated drift — un-indexed PDFs, scans without a text layer, PDF bloat, project-bib keywords not yet merged into the master, cross-project bibkey collisions, lint regressions from out-of-band edits. Wraps hooks/drift_check.py, the same state-triggered check that runs automatically at session start. Triggers on "drift report", "check everything", "was steht an", "prüf mal alles", "ist alles konsistent", "check the library". NOT wiki-lint (single-project structural lint — this composes it), NOT semantic-wiki-review (LLM content audit — this is deterministic only)./executing-research-planUse AFTER writing-research-plan has produced a ready plan (status=ready for hermeneutic projects, status=pre-registered for quantitative/mixed). Reads `input/ideas/<slug>-plan.md`, creates one task-list item per plan task, runs a pre-ingest acquisition gate (acquire-sources) so originals are on disk before any source-ingester runs, and works tasks via subagent dispatch (source-acquirer, source-ingester, analyst, drafter) with two-stage review. Does not execute anything outside the plan./finishing-a-research-projectUse when a research project reaches completion — manuscript finalized, peer-review cleared, ready for publication / submission / archive. Runs the final checklist across rendering, BibTeX, wiki, data, reproducibility, archive, and follow-up grant planning.Other plugins' skills for the same job