/academic-research:systematic-reviewfrom academic-research
Runs a full PRISMA-style systematic literature review: search, abstract/full-text screening, coding, and export. For social sciences; medical instruments out of scope.
Ships in academic-research. 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.
Glossary: unfamiliar with PRISMA, MCP, BBT, ABS, DOI, ISSN, SFX, TDM, CSL, stage tag, or FE-code? See skills/_glossary.md for one-line definitions of every acronym this skill uses.
Every pipeline step below is a tool of the plugin's own
academic-research MCP server, named here by its bare name
(check_setup, start_search, start_abstract_screen, …). In Claude
Code the full name is
mcp__plugin_academic-research_academic-research__<name>; other hosts
prefix it differently — use the tool whose name ends in the bare name.
Each description starts with its effect class ([read-only], [writes Zotero], [costs LLM credits], …).
check_setup, scaffold_project, screening_report,
audit_library, export_coded_includes, generate_bib) run to
completion and return a small summary plus the path of their full log.start_*) return a job_id at once and run in the
background. Follow one with job_status. When it reports
awaiting_user, show the user its prompt verbatim and pass their
answer to job_answer — never answer it yourself. cancel_job stops a
job (on macOS and Linux it interrupts first, so its CSV and tags flush;
on Windows it terminates); list_jobs shows
recent ones. A job outlives the session that started it. One job at a
time may write to Zotero — the server refuses a second.uv is missing), and
then tell the user once how to enable them: in Claude Code the server
ships with the plugin and needs only uv on PATH (restart the
session after installing it); on Gemini (Antigravity or Gemini CLI)
or Codex, /setup registers it. Steps with no tool (pilot analysis,
tag pruning, LLM provider and model pinning, …) are scripts either
way.Before any step below, verify the plugin has been configured: call
check_setup (terminal equivalent:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/setup/check_configured.py").
If it reports configured: false (NOT CONFIGURED), stop immediately and tell the user:
The academic-research project has not been set up on this machine yet. Run the setup skill or setup wizard first to connect Zotero and configure API keys (Elsevier, WoS, Anthropic, Gemini, Semantic Scholar), MCP servers, and permission rules. Do not attempt an SLR before that.
Do not call MCP tools, run pipeline scripts, or proceed with any stage of the procedure. Running the setup skill/wizard is the required first step.
If it reports configured: true, proceed.
When the user asks for autonomous execution — "work autonomously", "run the whole thing", "don't ask me, just do it", "go" — that is a real instruction and it is honoured. It changes when you ask, not whether.
Consolidate every confirmation into one up-front proposal, and make that proposal before the first paid inference call. Not per stage. The pipeline's gates (scope, model, cost) exist so a human decides before money and methodology are committed; asking six times during a run the user has walked away from does not achieve that, and skipping them silently — which is what happened in the session that prompted this section — achieves the opposite of it.
The single proposal must contain:
.claude/systematic-review/scope.md,
condensed to what a reader needs to say yes or no: construct,
population, questions, databases, year range, journal set.start_abstract_screen with dry_run: true). Not a guess,
and not omitted because the dry run was awkward — the dry run is one
call and its cost line is the number the user is being asked to
approve.Then ask once. After a "proceed", the later stages run without further
questions — the PAID LLM RUN banner still prints before each one, so
the record of what was spent stays in the transcript.
What is not gated: search, import, and enrichment — except that PDF
retrieval beyond its API step needs the user (retrieving-pdfs folds its
strategy questions into this proposal). Database APIs
(OpenAlex, Scopus, WoS, Semantic Scholar, Crossref, Unpaywall) are
covered by keys the user already has, cost nothing per call, and
produce the counts the proposal needs. Run them first, then propose.
What autonomy never overrides:
If the user declines to answer the single proposal — they are away, the session is unattended — run everything up to the first paid stage and stop there with the proposal on screen. A completed search and import with a clear question waiting is a good outcome; a screened corpus the user never authorised is not.
An SR project needs (a) the canonical directory scaffold, (b) four
regression-test files, and (c) pipeline-stage config templates. One
call does all three: scaffold_project (kind: "sr", the default).
It is idempotent — it never overwrites an existing file, so re-running
skips anything already in place — and its summary lists what it created
(created_dirs, copied_templates) and how many files it kept. Do not
use shell mkdir -p (prompts the user, bash-only) or chained cp calls
(prompts the user for every chain) for the same work.
Terminal equivalent:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/setup/scaffold_project.py" --kind sr --no-claude-md
It creates screening/, pilot/, analysis/results/, manuscript/,
scripts/, output/, .claude/ and critic-reviews/, and installs
scripts/test_common.py, scripts/test_citations.py,
scripts/test_empirical_integrity.py, scripts/test_systematic_review.py,
search_config.py, screening_config.py, analysis/manuscript_stats.py,
manuscript/manuscript_tables.py, manuscript/manuscript.qmd and
manuscript/apa.csl; inside a git repo it adds .claude/ and output/
to .gitignore.
apa.csl is the APA 7th-edition citation style (CSL project,
CC BY-SA 3.0); manuscript.qmd names it in its YAML, so it must sit next
to the .qmd. Rendering the manuscript also needs Quarto and a Python
with jupyter, pandas and tabulate — the comment block at the top
of manuscript.qmd shows a one-line setup. Mention this once when the
manuscript is first rendered, not at bootstrap.
Tell the user which files were installed and flag that the top of
each test_*.py has project-specific paths, test_empirical_integrity.py
has a FORBIDDEN_LITERALS tuple, and search_config.py /
screening_config.py / manuscript_stats.py all need customisation
before use.
If the project has no CLAUDE.md yet, suggest using
${CLAUDE_PLUGIN_ROOT}/templates/sr_claude_md.md as a starting
point — but don't write it without the user's say-so. CLAUDE.md is
user-owned, which is why scaffold_project skips it by default. To
install it once the user confirms: scaffold_project with
claude_md: "install" (terminal equivalent:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/setup/install_templates.py" sr_claude_md.md:CLAUDE.md).
zotero-operations skill's IRON RULEBefore any Zotero work in this skill: when reading or writing the
user's library, the access hierarchy is (1) MCP mcp__zotero__*
tools for reads → (2) zotero-cli for one-off writes outside a
pipeline script → (3) scripts/pipelines/zotero_io.py and
scripts/pipelines/bbt_client.py for bulk/pipeline reads and writes
→ (4) never direct HTTP. zotero-cli is not a substitute for
zotero_io.py inside enrichment/screening/coding scripts — no
batching, no --json, no 412 retry, ~1–2 s per-call startup. A
direct urllib.request.urlopen("http://127.0.0.1:23119/...") or
curl localhost:23119 is a defect signal — propose adding the
missing helper to zotero_io.py rather than working around it
inline. The full rule lives in skills/zotero-operations/SKILL.md
under "IRON RULE — Zotero access goes through the plugin's surface".
Never compose item metadata yourself. New items come from a
pipeline script importing database-retrieved rows, or from an
identifier-based add (mcp__zotero__zotero_add_item with a DOI/ISBN/
URL, or zotero-cli add doi|isbn|url). Typing out a citation — even
one item, even to repair a bad import — writes metadata with no
provenance into a library a manuscript will cite. If neither path
works, name the gap and propose the fix. Full rule: the second IRON
RULE in skills/zotero-operations/SKILL.md.
Zotero Desktop must be running. Every pipeline script reads and
writes the library through Zotero Desktop on this machine
(localhost:23119); there is no zotero.org fallback, so a headless
machine or container cannot run the Zotero stages. If a script reports
that Zotero refused its write key, it opens Zotero's permission dialog
itself — tell the user to choose Always Allow there.
Run this first, right after bootstrap. Pin down which Zotero
library will hold this review's bibliography before starting the
scope conversation — the choice is independent of scope, takes a
single question to resolve, and unblocks every later step that
touches Zotero. Running it first also means the project's
CLAUDE.md carries the library reference from the outset, so a
future session opening the project sees it immediately.
The choice is stored in the project's CLAUDE.md and passed
explicitly to every pipeline script as either --group <id> (a
group library) or --user (your personal / My Library), plus
--collection <key> where supported. It is NOT set via the
ZOTERO_GROUP env var — env vars are per-shell, easily lost on a
new terminal, and invisible to future sessions that read the
project's CLAUDE.md to orient themselves.
Procedure:
List available libraries:
mcp__zotero__zotero_list_libraries()
Without MCP tools registered (a subagent, a CLI-only environment), the same listing comes from the shell:
zotero-cli library list
Use one of these two. There is no plugin script for it and none is needed — do not grep the plugin's source for group IDs, and do not run a pipeline script with no arguments to provoke its "which group?" error message into printing them.
Show the user the personal library (type user) and each group
(type group, with numeric IDs). Ask which to use. Group
libraries are the usual choice for SRs — shared with
collaborators, higher upload quota, cleaner archival than mixing
into personal — but pipeline scripts fully support My Library via
--user, so either works.
Optional: scope to a collection within the chosen library. Ask the user whether this SR's items should go into an existing collection, or a fresh one. For an existing one:
mcp__zotero__zotero_get_collections(library_id=<id>)
For a fresh collection, note the intended name. --collection
accepts either an 8-character collection key or a display
name: a name that matches an existing collection resolves to its
key, and a name that matches nothing is created. The script prints
which of the three happened. (Two collections sharing a name is an
error, not a guess — pass the key.)
Write the choice into the project's CLAUDE.md under a
## Zotero library heading (create or extend the file as
needed). Ask the user to confirm the edit before saving. Shape
depends on group vs personal:
## Zotero library
- **Library:** group (or `user` for personal)
- **Group ID:** `<numeric id>` (omit if `Library: user`)
- **Collection key:** `<8-char Zotero key>` (omit if creating
fresh at import time)
All pipeline scripts take `--group <id>` (group library) or
`--user` (personal library) and, where supported,
`--collection <key>`. Do not set `ZOTERO_GROUP` as an env var —
the canonical record is here.
Self-check before every Zotero write: does the project's
CLAUDE.md have a ## Zotero library section with a group ID? If
not, STOP and run the procedure.
Before calling ANY search tool — MCP (mcp__scopus__search_scopus,
mcp__openalex__search_*, mcp__semantic-scholar__*-search*,
mcp__paper-search*__search_*) or script
(scripts/pipelines/search*.py) — including piloting and volume
probes — the scope brief must exist at
.claude/systematic-review/scope.md AND the user must have
explicitly confirmed it in the current session ("proceed", "looks
good", "confirmed", or equivalent). Silence is not confirmation, and
"experiment with X" is not confirmation of the surrounding scope.
The gate exists because "just a pilot search" shapes the methods: keyword combinations get baked into the user's mental model, volume numbers anchor downstream inclusion calls, and reframing after a pilot is more expensive than reframing on paper. Pin down scope on paper, get explicit sign-off, then search.
Under an autonomous run this confirmation is folded into the single up-front proposal (see "Autonomous runs") rather than asked here — folded in, never dropped.
Brief contents (every section required before asking for confirmation):
Focal construct / phenomenon scope — what is the central topic, and at what breadth? Give the breadth as a narrow / medium / broad choice with a concrete definition of each, and justify the choice. (E.g. a review on "remote work" could go narrow = post-2020 pandemic-induced remote work, medium = any scheduled telework since 2000, broad = all spatially distributed work arrangements.)
Population / unit of analysis / context — what units are in scope (individuals / teams / firms / ventures / SMEs / industries / countries / etc.)? Geographic / sectoral / temporal-era restrictions? If multiple units appear in the scope, name the synthesis strategy (separate strands? single framework?).
Research question(s) — one or more focal questions the review
will answer. If the synthesis will map multiple streams of the
literature — e.g. X-as-antecedent vs X-as-outcome, or phenomenon
used as a tool vs studied as a domain vs applied as a research
method — name the streams. Flag whether streams are a narrative
device only, or whether a per-paper research_stream coding
field should extend FULLTEXT_CODING_FIELDS in
screening_config.py (this is a proposal, not a prescription —
the default template does not include one).
Time window — start year (inclusive), end year (inclusive), and the reason for the start year (a pivot paper, a technology event, a round number with a defence).
Journal set — tier list (AJG/ABS 2024 / FT50 / ABDC), which field codes within it, and whether ISSN-filtering will be used (requires WoS Expanded).
Database access — which databases the formal search will
use. Do NOT ask the user blind. First read the databases section
of check_setup's result (the probe reads
~/.config/academic-research/config.toml out-of-process and emits
only yes/no status — no keys; terminal equivalent:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/setup/check_database_access.py").
Then present the detected set and ask which subset to use. For a formal SR, two or three databases are typical; prefer WoS Expanded + Scopus when both are available, OpenAlex + Semantic Scholar as free fallbacks. Record both the chosen set and any available-but-excluded databases (with the user's reason).
Exclusion criteria — language restriction? editorials / book reviews / proceedings? conference papers? predatory-listed journals?
Search keyword blocks — the literal term lists for each
Boolean block of the query (typically one block per scope
dimension identified in items 1–2). These lists go verbatim into
Scopus / WoS / OpenAlex queries. Present them block-by-block,
with wildcards where stemming is needed (WoS does not stem
phrases; Scopus does), and ask the user to approve each block.
This is the level of detail that actually goes into
search_config.py — do not commit without explicit approval,
because small term choices (e.g. "firm growth" alone vs
"firm growth" OR "venture growth" OR "business growth*")
drastically change recall.
Draft the brief in conversation, ask the user to confirm, then write
.claude/systematic-review/scope.md. Create the directory first:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/setup/ensure_dir.py" .claude/systematic-review
If the user changes scope mid-run, update scope.md and any
affected search_config.py together before further searches.
Self-check before every search call: has scope.md been written?
Has the user said "proceed" (or equivalent) since the brief was
finalised? If either answer is no, STOP and finish the interview.
Self-check before any Write / Edit on search_config.py: is the
keyword list in the current draft of search_config.py identical
(up to formatting) to the block-by-block keyword list the user
approved as item 8 of the scope brief? If the agent revised
keywords after a pilot or reviewer feedback, update scope.md
first, get fresh user confirmation on the revised blocks, then
write search_config.py. Never silently expand keyword coverage
between scope.md and search_config.py.
Run this straight after scope lock-in. It needs the scope brief (the
default is proposed from the focal construct) and it must happen before
the import (start_import), which is the first thing that writes a tag.
Every Zotero tag recording this review's judgement is namespaced:
agentic-ai/abstract:include, not a bare abstract:include. The prefix
is mandatory — the pipeline scripts exit with an error if
screening_config.py has no TAG_PREFIX.
Two reasons, both worth one sentence to the user:
abstract: and fulltext: are the plugin's vocabulary, so they
distinguish nothing. Typing the prefix into the selector isolates one
review.abstract:* family, and a Zotero
duplicate merge unions tag sets — leaving one item carrying two
reviews' contradictory decisions with no way to tell which said what.Derive it from the scope brief's focal construct and keep it short —
the user reads it on every tag. ai-agents-teams for a review of AI
agents in team decision-making; growth-aspirations for one on
entrepreneurial growth aspirations. Offer it as a proposal, not a
prescription.
Rules: 1-32 characters, lowercase letters, digits and interior hyphens.
No spaces, no /, no :, and it may not start or end with a hyphen.
Run the helper with --dry-run and show the user its output — it prints
the actual tags the review will produce under the proposed prefix, plus
the tags that deliberately stay global:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/setup/set_tag_prefix.py" \
--prefix <proposed-prefix> --dry-run
Once the user confirms, write it:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/setup/set_tag_prefix.py" \
--prefix <confirmed-prefix>
Do not hand-edit TAG_PREFIX. The helper validates before the value can
reach Zotero, and an invalid prefix is otherwise discovered only after it
has been written onto hundreds of items.
Add the prefix to .claude/systematic-review/scope.md and to the project
CLAUDE.md, next to the ## Zotero library block. A later session
opening the project needs to know which namespace is this review's
without inferring it from tags.
Changing it mid-review orphans every tag already written. Resume is tag-driven, so already-screened items look unscreened and get re-screened at full cost. If the user wants to change it after screening has started, say this plainly first.
Model choice has three layers. The provider is a machine-wide
setting — which company's (or which local server's) API the pipelines
call. The tier is a per-stage capability level: fast for screening
thousands of abstracts, balanced for coding full texts. No model ID
is hardcoded anywhere in the plugin; you ask the provider what it
serves today and pin a choice.
The execution mode is the third, and it is a different kind of question: does an LLM answer while the script waits? Everything below this heading assumes yes — one request per item, a provider on the other end, results in the same run. That is the default and almost always the right answer.
It stops being possible when the compute is a queued job. A GPU node
behind a batch scheduler cannot answer synchronously at all: work is
submitted and collected minutes or hours later, and no provider value
can describe that. For those, both screening scripts split into
--emit-manifest (assemble the requests, write them, exit) and
--apply-responses (write the tags, notes and CSV rows from responses
produced anywhere). Load cluster-screening for that path — it
covers the automation levels, the transfer, polling discipline, and the
four conditions under which apply must refuse. Do not improvise it from
here.
The same split also buys Anthropic's Message Batches API at half the
synchronous price: emit the manifest, run
run_manifest_batch.py --manifest <requests.jsonl> --model <claude-id>
(submits once, saves the batch id, polls until the batch ends, writes the
responses file with real token usage), then --apply-responses.
Re-running the command after an interruption collects the batch already
submitted instead of paying for a second one. Anthropic models only.
Two things to keep straight when a user's institution offers both:
gateway is a provider — a synchronous
OpenAI-compatible endpoint, configured below, screened against
normally. It is not the cluster path.screening_config.py records the result (ABSTRACT_SCREENING_MODEL,
FULLTEXT_CODING_MODEL) with a provenance comment. That pin is the
project's committed default and belongs in git with the prompts.
Which provider is configured — ask, don't guess, and never try to
read config.toml (the Read tool is denied on it):
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/setup/check_llm_provider.py
It reports the provider, whether the user ever chose one, and whether its credential is present — without printing any key.
Pinning the models (bootstrap, and any time the provider changes) is a two-step, and the middle step is the user's. First see what is on offer — this writes nothing:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/setup/resolve_models.py
Then propose one model per stage and get the user's confirmation
before pinning anything. The script deliberately does not choose:
provider listings are full of things that are not ordinary synchronous
chat models — :batch IDs are asynchronous queue endpoints, and
-image, -tts, -audio, deep-research and customtools variants
appear right alongside the models you want. The tier? column is a
guess from the model's name and is labelled as one. Reading past that
is your job, not the script's.
Propose the newest ordinary chat model of the required tier, judged
by the listing's released column first and the version numbers in the
ID second. Two hard rules:
-YYYYMMDD are pinned releases and the
listing marks them dated snapshot in the notes column. A snapshot
of the previous generation sorts alphabetically right next to its
successor — claude-sonnet-4-5-20250929 immediately before
claude-sonnet-5 — and picking it by proximity is exactly the
mistake this rule exists to stop. Propose a snapshot only when the
user asks for a frozen ID for reproducibility, and say that is why.released date, and what you rejected next to it: "proposing
claude-sonnet-5 (released 2026-02-05) over
claude-sonnet-4-5-20250929, a dated snapshot of the previous
generation." A proposal the user cannot check is not a proposal.Your own knowledge of which model is current is older than the listing in front of you. Where the two disagree, the listing wins — it is what the provider is serving today.
Under an autonomous run, the proposal moves into the single up-front confirmation (see "Autonomous runs"); it does not become an unannounced pick.
Then write each confirmed choice, one call per stage, from the project directory:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/setup/resolve_models.py \
--stage abstract_screening --model <id>
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/setup/resolve_models.py \
--stage fulltext_coding --model <id>
It rewrites only that stage's *_MODEL line, leaving the prompts
untouched, and stamps a provenance comment whose tier= label is
inferred from the model you pinned (override with --tier). Add
--dry-run to see the line without writing it. If the listing step
reports a catalogue fallback, say so to the user: the menu came
from a file shipped with the plugin rather than from the provider, and
may name superseded models.
Each pin is followed automatically by a ~4-token test request, and
resolve_models.py exits non-zero if the model does not answer. Do
not treat a pin as done until that check passes — a written pin only
records an intention, and the check is what proves the model ID, the
provider, and the credential agree.
Before start_abstract_screen or start_fulltext_code runs over a real
corpus:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/setup/check_model_connection.py
Exit 0 means every pinned model answered; 1 means one did not; 2
means the project is not pinned or configured yet. Both orchestrators
also run this check themselves at startup and refuse to begin when it
fails, so a run that dies here has cost nothing.
Read the status word, because two of them look alike and are not.
| Status | What it means | What to do |
|---|---|---|
QUOTA_EXHAUSTED | The key is valid; its allowance is spent | Retrying will not help. Tell the user to check billing, or switch provider. Do not restart the run. |
RATE_LIMITED | Throttled this second; the quota is intact | Re-run, or lower --workers. |
AUTH_FAILED | The key was rejected | Hand off to /setup to rotate it. Never ask for a key in chat. |
MODEL_NOT_FOUND | The provider does not serve this ID | Re-list and re-pin. Usually a typo or a superseded model. |
UNREACHABLE | Nothing answered at the endpoint | For ollama / lmstudio, the local server is not running. For gateway, either [gateway] base_url is unset — the detail line says so — or the endpoint needs the institution's network or VPN. |
The first row is why this section exists. In a real run, an exhausted
Gemini quota was diagnosed as a network hang: the per-item retry ladder
spent 131 seconds per paper failing, progress printed only every tenth
paper, and ~22 minutes passed with no output and no cause. The response
body had said "check your plan and billing details" from the first
request. When you see QUOTA_EXHAUSTED, report it and stop — do not
add timeouts, do not retry, do not diagnose the network.
Switching provider — "use OpenAI instead", "screen this locally":
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/setup/set_llm_provider.py openai
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/setup/resolve_models.py
then confirm and pin as above — the old pins name models the new provider does not serve.
Providers: anthropic, google, openai, openrouter, gateway,
and the two local ones, ollama and lmstudio, which need no API key
and no per-paper spend. If the new provider's credential is missing, the
script says which variable is needed — hand that to /setup, never
ask the user to paste a key into the conversation.
gateway is an OpenAI-compatible endpoint the user's institution
runs — often free to the researcher and serving open-weight models.
Two differences matter when screening against one:
config.toml under [gateway]. Everything reports UNREACHABLE
until base_url is set. A user who already exports a key under their
own name can point at it with [gateway] api_key_env = "THEIR_NAME".resolve_models.py lists and pins against it normally, but there is
no list price on file, so --dry-run reports the cost as
unknown. Report that word. Do not translate it to "free" — an
institution may recharge internally, and you cannot see that.Do not reach for OPENAI_BASE_URL to do this. It exists to redirect
OpenAI itself; a gateway configured through it reports as openai and
inherits OpenAI's list prices, which makes the cost estimate wrong.
ANTHROPIC_BASE_URL is for Anthropic-Messages-shaped endpoints only.
A one-off model change — "screen these with the cheap one", "use a
stronger model for the coding pass" — is the model argument of
start_abstract_screen / start_fulltext_code (model: "fast"), not an
edit. Terminal equivalent:
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/abstract_screen.py \
--group <id> --collection <key> --config ./screening_config.py \
--model fast
model (--model) accepts a tier (fast, balanced, deep), a short alias
that names a tier (cheap, haiku, flash, mini, sonnet, opus,
pro, best, …), or a full model ID. Aliases resolve against the
configured provider, so --model fast means Haiku for an Anthropic
user and Flash for a Gemini one. Unknown names pass through untouched,
so an explicit ID or a locally-served model name both work.
Do NOT edit screening_config.py to satisfy a one-off request. The
config is what a reviewer reads to reconstruct the review; rewriting it
per run destroys that record. The flag prints a banner when it overrides
the config, and the effective model is written to the model column of
every CSV log row — that column, not the config file, is what the
manuscript should cite (see empirical-integrity).
If the user wants the change to be permanent — "always code full texts with the strong model" — re-pin it rather than hand-editing the constant, so the provenance comment stays true:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/setup/resolve_models.py \
--stage fulltext_coding --model <id>
Run the script bare first if you need to see what the provider serves, and confirm the specific model with the user before writing. Then say that you did, and that it changed the committed default.
Cost before spending. dry_run: true on either screening job
(--dry-run on the script) prints a projected cost for the real item
count — read it from the job's log_tail. Quote it before a full run,
especially when the user is about to move to a stronger tier — deep
is roughly double balanced per paper. An "unknown" estimate means no
list price is on file for that model; report that rather than implying
the run is free.
abstract_screen.py)The abstract-screening system prompt lives in screening_config.py
(ABSTRACT_SCREENING_SYSTEM_PROMPT) and is the record of what
got in and what got out at stage 1. Reviewers will read it to judge
whether the review is reproducible. PRISMA expects it to be fixed
before screening starts, not tuned while decisions accumulate.
Procedure (run the first time the agent is about to call
abstract_screen.py):
Open screening_config.py and locate every <INSERT …> / <…>
placeholder in ABSTRACT_SCREENING_SYSTEM_PROMPT. There are
typically four:
.claude/systematic-review/scope.md item 3.Draft each replacement in conversation. Show the user the resulting prompt in full (prefer a read-back / inline code block over just "here's the diff"). Ask them to approve criterion by criterion — criteria are the review's spine.
Bump ABSTRACT_SCREENING_PROMPT_VERSION to a fresh string (e.g.
vN-YYYY-MM-DD). The version goes into every log row; reviewers
use it to distinguish a re-run under the same protocol from a
re-run under a revised protocol.
Write the revised file. Record a one-line summary of the
protocol in .claude/systematic-review/scope.md (append, don't
replace) so the scope brief and the screening config stay in
lockstep.
Self-check before every abstract_screen.py call: does
ABSTRACT_SCREENING_SYSTEM_PROMPT contain any <INSERT /
<CRITERION / bare <…> placeholders? Has the user approved the
prompt in the current session? If either answer is no, STOP and run
the procedure.
Revision during screening. If the user wants to tighten a
criterion after seeing real decisions: bump
ABSTRACT_SCREENING_PROMPT_VERSION and have the user re-approve.
To re-screen items already decided under the old version, remove
their <prefix>/abstract:* tags first — resume is tag-driven, so
abstract_screen.py skips anything already tagged and a plain re-run
does nothing. abstract_screen.py has no --rerun or --full-recode
flag; this instruction previously named --rerun, which that script
does not accept. The append-only log preserves the original decisions
under the old version for audit, so removing the tag loses no history.
fulltext_code.py)The full-text coding schema — FULLTEXT_CODING_FIELDS plus
FULLTEXT_CODING_SYSTEM_PROMPT in screening_config.py — is the
record of what data the review extracts from each included paper.
Fields added or reworded after coding starts create inconsistent
columns in coded_papers.csv; PRISMA expects the schema to be
fixed before coding starts.
Procedure (run the first time the agent is about to call
fulltext_code.py):
Draft the coding schema. The template defaults are
key_findings, sample, method; these are safe starters for
nearly any SR. Propose additions based on the scope brief's
research questions — common add-ons for social-sciences SRs
include theories_and_references, direction_of_relationship,
moderators_boundary_conditions, causal_inference_strength,
future_research, and (if the scope brief named streams) a
research_stream enum field. 5–15 fields total is typical;
each field needs a name, a description written for an LLM
reader, and ideally an example.
Ask which categorical fields should become Zotero tags. A field
that declares a closed values list can also set "tag": True, and
each include then gets one <prefix>/<field>:<value> tag — which
turns Zotero's tag selector into a way to browse the corpus by that
dimension. Walk the categorical fields with the user and ask which
ones they would actually want to filter by.
Two things to tell them:
"tag": True without values is a config error
the script refuses at load time.Say that the choice is reversible in both directions: add "tag": True
and re-code to gain a family, or drop one they regret with
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/manage_tags.py \
--group <id> --collection <key> --prune <field> --apply
manage_tags.py --list first shows how many distinct values each
family actually produced, which is usually what settles it.
Fill in FULLTEXT_CODING_SYSTEM_PROMPT placeholders: research
question (same as stage 1), stage-2 criteria (what the full
text must show that the abstract could not), and exclusion
codes FE1…FE5.
Show the user the full schema (every field) and the prompt. Ask them to approve field-by-field — adding a field mid-run costs a re-code of every already-coded paper.
Bump FULLTEXT_CODING_PROMPT_VERSION to a fresh string.
Write the revised file. Append a one-line summary to
.claude/systematic-review/scope.md, including which fields are
tagged.
Self-check before every fulltext_code.py call: does
FULLTEXT_CODING_SYSTEM_PROMPT contain any <INSERT /
unpopulated placeholders? Does FULLTEXT_CODING_FIELDS still hold
the template's three starter entries unmodified? Has the user
approved the schema in the current session? If any answer is no or
yes-still-template, STOP and run the procedure. If only 1–3 fields were revised and prior adjudicator edits on other fields must be preserved, use --update-fields rather than a full re-code — see Revision during coding below.
Revision during coding. Two revision paths exist — choose based on scope:
Add or revise specific fields (--update-fields) — preferred for
additive schema changes (new field) or guideline rewrites for 1–3 fields.
This mode selects items already tagged <prefix>/fulltext:include, calls the LLM for
all fields (using the updated config), then merges only the named fields into
the existing SLR Coding: <prefix> note without touching any other field values or the
screening decision. Adjudicator edits to the targeted fields are
overwritten (warn the user); adjudicator edits to all other fields are
preserved. Bump FULLTEXT_CODING_PROMPT_VERSION before invoking so the log
records which config version produced the update.
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/fulltext_code.py \
--group <id> --collection <key> --config ./screening_config.py \
--pdf-dir ./pdfs --update-fields method,theories_and_references
Combine with --only-keys K1,K2,... to limit to a specific subset.
Full schema overhaul (--full-recode) — for major version changes
where every field needs a fresh extraction under the new prompt. This
removes this review's <prefix>/fulltext:* tags and every coded-value
family it writes, backs up the CSV log, and re-codes from
scratch. SLR Coding: <prefix> notes for items that re-include are overwritten unconditionally; adjudicator edits to those notes are lost. Notes on items that re-exclude are left untouched. Treat as a v1 → v2 bump and ask the user to confirm they accept
the re-coding cost. Bump FULLTEXT_CODING_PROMPT_VERSION before invoking.
Field reordering in FULLTEXT_CODING_FIELDS is free (it only affects
column order in the export CSV and note rendering). Field renaming needs
a data migration: the old name stays in existing notes' JSON payloads; use
--update-fields <new_name> as a one-pass migration that populates the new
field name, then rename it in config and regenerate.
Before writing ANY of the following, STOP:
python3 <<'EOF' ... EOF or
python3 - <<'PY' ... PY).python -c "..." for anything beyond a single-line
probe (the four shipped probes under scripts/setup/check_*.py
and ensure_dir.py cover all the legitimate single-line cases).If the task is pipeline-shaped (enumerate Zotero items, summarise a screening CSV, mutate tags, fetch abstracts, filter a search CSV, compute counts), one of two things must be true:
A shipped tool or script covers it. Call the tool, or invoke the script with explicit flags where no tool exists. The Pipeline-steps table below is the canonical list.
No shipped script covers it. Tell the user:
There is no shipped script for . I can either (a) add a new script under
scripts/pipelines/(recommended — keeps the work auditable and reusable across sessions), or (b) use the Zotero / OpenAlex / etc. MCP tools directly for this one task. Which do you prefer?
Wait for their answer. Do not write the heredoc.
Why this rule is hard:
python -c one-liner or POSIX pipeline is not, and fails on the
first platform it was not written for.Common gaps that surface as "I'll just write a quick script":
| Task | Right move |
|---|---|
| Filter / trim a search CSV (top-N by year, year range) | No tool: uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/filter_search_results.py --input <csv> --output <csv> [--year-min Y] [--year-max Y] [--top-n N] |
| Summarise screening decisions across passes (last-row-wins, decision counts, list re-screened items) | screening_report (log_csv, optional list_decision / list_rescreened). Terminal equivalent: uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/screening_report.py <log.csv> [--list <decision>] [--list-rescreened] |
| Inspect tag state for one item | Use mcp__zotero__zotero_get_item_metadata directly — single MCP call, no Python needed. |
| Count the records in a screening log | screening_report returns them (rows_in_file, unique_items). Not wc -l: quoted fields with line breaks (abstracts) make it overcount, and Windows shells do not have it. |
Self-check before any Bash heredoc / inline python -c
exceeding one line: is this task in the Pipeline-steps table or
covered by a scripts/setup/ helper? If the answer is "no, but I
could write a quick one", STOP and propose adding the shipped
script instead.
Every systematic review runs through the same stages:
search → import to Zotero → fetch abstracts → attach PDFs →
abstract screening → full-text screening/coding → QA with evaluator agents →
human adjudication → export results → test suite → manuscript
Principles:
zotero-operations skill for lower-level Zotero patterns.screening/*.csv for provenance
and debugging (who decided what, when, with which model and prompt
version). But "what is the current decision on item X?" is answered
by Zotero, not the CSV. Adjudicator flips happen in Zotero directly;
re-runs read Zotero tags to decide what to skip.<prefix>/abstract:include /
<prefix>/abstract:exclude / <prefix>/abstract:borderline for
abstract screening; <prefix>/fulltext:include /
<prefix>/fulltext:exclude for full-text coding), and skip items
already tagged. The CSV log is written in parallel for provenance but is not
consulted for resume decisions.job_status gives its
progress counts and log tail — report them at milestones rather than
polling in a tight loop. Run from a terminal, the scripts use
flush=True on every print and emit [N/total] counters; invoke via
| tee to a log file. Never pipe to /dev/null.--filter-keys-file <path> for enrichment / audit / export scripts,
--only-keys <k1,k2,…> for screening scripts. Either way, the next
stage drives from the previous stage's Zotero tag state (queried via
MCP or pyzotero); the file / CLI filter is a way to narrow further.| Variable | Used by | Purpose |
|---|---|---|
ZOTERO_LOCAL_API_KEY | All Zotero scripts | Zotero Desktop's local write key. Normally not set: /setup stores it, and a script re-requests it through Zotero's dialog if it is revoked. |
ANTHROPIC_API_KEY | Screening scripts | Claude API — required only while anthropic is the selected provider. Each provider has its own variable; check_llm_provider.py reports which one this machine needs. |
(none — [gateway] in config.toml) | Screening scripts | The institutional gateway is config-only: base_url and api_key, plus optional api_key_env / base_url_env naming variables the user already exports. |
ELSEVIER_API_KEY | enrich_pdfs.py, enrich_abstracts.py | Elsevier/ScienceDirect full-text retrieval |
SCOPUS_API_KEY | Search scripts | Scopus API (often same as ELSEVIER_API_KEY; some institutions issue separately) |
WILEY_TDM_TOKEN | enrich_pdfs.py --sources wiley | Wiley TDM UUID token |
OPENALEX_API_KEY | enrich_pdfs.py, enrich_abstracts.py | OpenAlex Content API ($0.01/download, paid) |
SEMANTIC_SCHOLAR_API_KEY | enrich_abstracts.py | Semantic Scholar (higher rate limit with key) |
CROSSREF_MAILTO | All scripts | Crossref polite pool (any email) |
WOS_API_KEY_EXTENDED | Search scripts | WoS Expanded (full Boolean, IS= works) — prefer this |
WOS_API_KEY | Search scripts | WoS Starter (field-limited, no IS=) — piloting only |
The /setup skill writes these to ~/.config/academic-research/config.toml
(mode 0600) on first run. Environment variables take precedence over the
file.
Project-level Zotero selection (group ID, collection key) is not
an env var — it lives in the project's CLAUDE.md per the Zotero
library selection section above, and is passed to every pipeline
script as --group <id> (and --collection <key> where supported).
Scripts fall back to $ZOTERO_GROUP only as a convenience for
command-line invocations; skill agents pass the flag explicitly.
Zotero is the ground truth for screening decisions, coding fields, and adjudication outcomes (see the Core architecture principles above). This section is the canonical catalogue of every tag and child note the pipeline reads or writes. Scripts and skills reference these conventions; the table below is the single source of truth.
<prefix>/ on everything this review decides<prefix> below stands for the project's TAG_PREFIX (see Tag prefix
above). A review with TAG_PREFIX = "agentic-ai" writes
agentic-ai/abstract:include, never a bare abstract:include.
The split is between a judgement this review made and a fact about the paper:
predatory:flag,
retracted:flag, doctype:*, pdf:tdm-recovered, pdf:preprint-version,
pdf:repository-copy, pdf:version:*. Whether a journal is on Beall's list, or a paper
retracted, or an attachment reconstructed from XML, is true regardless
of who is reviewing it. Reviews sharing a library share these rather
than each stamping a private copy — which is also why the library-wide
enrich_* scripts need no prefix and take no --config.Never write a bare stage tag by hand via MCP. An unprefixed
fulltext:unavailable belongs to no review, so no script will ever see
it and the item stays in the pending set forever.
Tell you where each item is in the pipeline. Mutually exclusive within
each stage — an item has at most one <prefix>/abstract:* tag and at
most one <prefix>/fulltext:* tag at any given time. Scripts apply these
at decision time via the Zotero API and remove prior stage tags in the
same namespace on flip; a co-resident review's tags are untouched.
| Tag | Applied by | Meaning |
|---|---|---|
<prefix>/abstract:include | abstract_screen.py | Passes title-abstract screening — proceeds to full-text |
<prefix>/abstract:exclude | abstract_screen.py | Excluded at title-abstract stage |
<prefix>/abstract:borderline | abstract_screen.py | Kept for full-text review (missing abstract, LLM uncertain, or a reply still unparseable after a re-ask) |
<prefix>/fulltext:include | fulltext_code.py | Passes full-text screening; has SLR Coding: <prefix> child note |
<prefix>/fulltext:exclude | fulltext_code.py | Excluded at full-text stage |
| Tag | Applied by | Meaning |
|---|---|---|
<prefix>/search:<query-label> | import_to_zotero.py | Which of this review's queries found the item. One per query that hit it. |
A FULLTEXT_CODING_FIELDS entry that declares a closed values list and
sets "tag": True also writes its coded value as a tag — see Coding
protocol above.
| Tag | Applied by | Meaning |
|---|---|---|
<prefix>/<coded-field>:<value> | fulltext_code.py, for includes only | The value coded for that field, e.g. agentic-ai/research-design:panel. Mutually exclusive within the field; a re-code replaces it. |
Field and value names are slugged (research_design → research-design,
Case Study → case-study). A coded value outside the declared
vocabulary is recorded in the note and CSV but not tagged, and the run
warns — an invented category must not gain a tag that reads as
authoritative as a real one. Prune a family you regret with
manage_tags.py --prune <field>.
Set outside the main screening loop — by preflight checks (predatory) or post-screening quality audits (retraction). Both are warnings the adjudicator sees in Zotero, not automatic exclusions.
| Tag | Applied by | Meaning |
|---|---|---|
| These are the global ones — not namespaced, for the reason given | ||
| under Namespacing above. |
| predatory:flag | Preflight journal check against Beall's list (import_to_zotero.py) | Warning, not exclusion. Author decides during full-text review whether to keep each flagged paper. |
| doctype:supplement / doctype:front-matter / doctype:notice | import_to_zotero.py on import; tag_doctypes.py for items already in the library. Rules in scripts/pipelines/doctype.py | Kept, but not screened. Records Crossref types as journal-article that are not research articles: APA supplemental material (DOI <article DOI>.supp, "Supplemental Material for …"), publisher front matter ("Editorial Board", "Issue Information", "Featured Cover", "Acknowledgment of Ad Hoc Reviewers", author-less "Call for Papers: …"), and SAGE "Publication Notice" retraction/withdrawal notices. abstract_screen.py and fulltext_code.py skip any doctype:*-tagged item and print the count per class — report it as PRISMA "records removed before screening" (screening_report.py --search-csv, or search.n_removed_* in manuscript_stats.py). A supplement is also linked to its article as a Zotero related item. Do not delete these items, and do not screen them by hand. |
| retracted:flag | Post-coding retraction check via mcp__zotero__scite_check_retractions (see Retraction check in Key methodological rules) | Warning, not exclusion. Cited paper has been retracted per Scite's retraction-watch data. Adjudicator decides whether to keep (with a discussion note), replace the citation, or drop the paper. |
| pdf:tdm-recovered | enrich_pdfs.py, when Elsevier's TDM API returns only a 1-page preview and the fetcher falls back to the XML endpoint | Warning, not exclusion. The attached "PDF" is text reconstructed from XML, not the publisher's native PDF — may be less complete or lose figures/tables. audit_zotero_library.py lists these under tdm_recovered; review before/during full-text coding. |
| pdf:preprint-version | enrich_pdfs.py --allow-preprints, when the only copy found is on arXiv / SSRN / RePEc | Warning, not exclusion — and the most consequential of these. The attached PDF is the manuscript before peer review. Hypotheses, samples and findings all move between a working paper and the published article, and nothing downstream can tell the difference: the coding note and the CSV row read identically either way. fulltext_code.py names these items before it codes them and audit_zotero_library.py lists them under preprint_version. Verify each coded finding against the published article, or fetch the real one, before the numbers reach a manuscript. Do not confuse this with OUT_OF_SCOPE, which is about the item's type being a preprint; this is a journal article with a preprint file attached. |
| pdf:version:published / pdf:version:accepted / pdf:version:submitted | enrich_pdfs.py, on every PDF it attaches (API sources, browser handlers, Zotero Connector) | Information, not exclusion. Which version the attached file is: the publisher's version of record, the author's accepted manuscript, or a preprint. Decided from the source, conservatively — anything uncertain is tagged accepted, never published — so published is reliable and accepted may include some typeset publisher PDFs hosted by repositories. Older attachments have no version tag. Additive: pdf:repository-copy and pdf:preprint-version are still written. |
| pdf:manual | enrich_pdfs.py --manual (MCP pdf_manual_next / pdf_manual_collect / pdf_manual_assign) | Information. The user downloaded this PDF in their own browser and the manual-download cycle matched and attached it. Its pdf:version:* tag comes from the page the tab opened (library platform or doi.org → published), lowered when the file's first page says it is an accepted manuscript or a preprint. |
| <prefix>/fulltext:unavailable | Applied by the agent only after audit_zotero_library.py reports the item's cause as UNAVAILABLE | The full text could not be obtained by any route the plugin has. This one is namespaced — it is a fulltext:* tag, mutually exclusive with <prefix>/fulltext:include / …:exclude, and it records a decision about this review rather than a fact about the paper. Do not invent a spelling for this, and do not omit the prefix — an unprefixed one belongs to no review and no script will see it. Do not apply it on a failed enrichment run alone: a BROWSER_REQUIRED or ACCESS_BLOCKED item is reachable and this tag would be false. See Diagnose before you exclude in retrieving-pdfs. |
Applied during the post-screening QA evaluator pass and the human adjudication loop (see Post-screening QA below).
All namespaced. apply_qa_adjudications.py sweeps <prefix>/qa- when
recording a verdict, so the sweep cannot reach a co-resident review's QA
tags.
| Tag | Applied by | Meaning | Removed when |
|---|---|---|---|
<prefix>/qa-flag | Main agent after any evaluator flags an item | Sentinel for filtering in Zotero | After human adjudication (replaced by <prefix>/qa-adjudicated-*) |
<prefix>/qa-hard | Main agent from a HARD evaluator flag | Clear violation of a named inclusion / exclusion criterion | After adjudication |
<prefix>/qa-soft-include | Main agent from an inclusion-validator SOFT flag | Borderline inclusion | After adjudication |
<prefix>/qa-soft-exclude | Main agent from an exclusion-validator SOFT flag | Borderline exclusion | After adjudication |
<prefix>/qa-wrong-code | Main agent from an exclusion-validator WRONG_CODE flag | Exclusion stands but the code is wrong | After the exclusion code is corrected on the item |
<prefix>/qa-adjudicated-include | Human after reviewing flag | Final decision: INCLUDE | Never (permanent adjudication record) |
<prefix>/qa-adjudicated-exclude | Human after reviewing flag | Final decision: EXCLUDE | Never |
If the human adjudicator flips an automated decision, the Zotero tag set is updated atomically:
<prefix>/fulltext:* tag → add the opposite one.<prefix>/qa-* severity tag → add the matching
<prefix>/qa-adjudicated-*.screening/fulltext_screening.csv for
provenance (who flipped, when, why). The CSV is run-history; the
tag is the current state.| Note title | Attached to | Written by | Purpose |
|---|---|---|---|
SLR Coding: <prefix> | Every item with <prefix>/fulltext:include | fulltext_code.py after each coding decision | Structured coding fields (constructs, method, findings — see screening_config.py:FULLTEXT_CODING_FIELDS). The adjudicator reads this note directly in Zotero; the CSV row is parallel provenance. Overwritten on --full-recode; selectively updated on --update-fields. |
The note title is namespaced too, and for the same reason as the
tags: upsert_child_note finds the plugin's own note by this marker and
overwrites what it finds. With one fixed marker, a second review coding
the same paper silently replaced the first review's coding. Each review
now gets its own note on a shared item, and the note's JSON payload
records which review wrote it.
A SLR Coding: <prefix> note is created on first code, overwritten
on re-code (via --full-recode), and never deleted automatically.
If the adjudicator edits a field inline in Zotero, the edit is
authoritative — subsequent fulltext_code.py runs skip that item
unless --full-recode is passed.
--only-keys / --rerun
/ --full-recode flags are the escape hatches for re-processing
specific items.fulltext_code.py processes items
tagged <prefix>/abstract:include OR <prefix>/abstract:borderline, and prints the
split it applied (N in collection, M eligible, K not carried forward) before spending anything. A collection with no
<prefix>/abstract:*
tags at all is treated as unscreened and processed whole, with a
notice — so running full-text coding on a collection you screened
elsewhere still works.
export_coded_includes.py reads items tagged
<prefix>/fulltext:include and the SLR Coding: <prefix> note
(adjudication flips propagate automatically because tags are
authoritative). It does not re-check the abstract stage, so a
<prefix>/fulltext:include on an abstract-excluded item would enter
the final corpus indistinguishably. <prefix>/abstract:exclude plus
any <prefix>/fulltext:* tag is a contradiction worth querying for
after a coding run; it should always be empty.<prefix>/fulltext:include items, manuscript_stats.py queries
Zotero, not the CSV. Read the prefix from screening_config.py rather
than retyping it — a stats script with a stale prefix silently counts
zero.manage_tags.py --list
enumerates every tag in the namespace with item counts, grouped by
family. It is the fastest way to see what the review has actually
produced, and the input to any decision about pruning a coded-value
family that turned out too granular to browse.Call the tool; the last column is its terminal equivalent (see "Plugin
tools" at the top). A row with no tool is run as the script. All
scripts live under ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/ and run
with uv run; first-run uv installs declared deps into an ephemeral
venv automatically. The tools expose the user's decisions only; the
command lines below show the most common form, and every script's
--help lists the full flag surface (re-processing, parallelism,
caching, single-item debugging) — a flag a tool does not offer is a
reason to run the script.
| Stage | Tool | Terminal equivalent |
|---|---|---|
| Multi-database formal search | start_search (job; databases, streams, search_fields) | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/search.py --config ./search_config.py [--databases scopus,wos,openalex,semantic_scholar] |
| Single-database piloting (Scopus) | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/search_scopus.py --config ./search_config.py |
| Single-database piloting (Web of Science) | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/search_wos.py --config ./search_config.py |
| Single-database piloting (OpenAlex, free) | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/search_openalex.py --config ./search_config.py |
| Single-database piloting (Semantic Scholar) | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/search_semantic_scholar.py --config ./search_config.py |
| Summarise a pilot CSV — year-cutoff distribution | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/pilot_analyze.py year-cutoff --csv pilot/search_results.csv |
| Summarise a pilot CSV — cross-DB DOI overlap | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/pilot_analyze.py db-overlap --csv pilot/search_results.csv |
| Summarise a pilot CSV — journal coverage (top-N) | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/pilot_analyze.py journal-coverage --csv pilot/search_results.csv --top 25 |
| Summarise a pilot CSV — hits by journals.json field code | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/pilot_analyze.py field-breakdown --csv pilot/search_results.csv --journals journals.json |
| Filter / trim a search CSV (top-N by year, year range) | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/filter_search_results.py --input <csv> --output <csv> [--year-min Y] [--year-max Y] [--top-n N] |
| Import deduplicated search CSV into Zotero | start_import (job; group/user, input, collection; dry_run first) — fails if any item create or update failed; read the failures in log_tail before moving on, the corpus is incomplete | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/import_to_zotero.py --group <id> --input <search.csv> [--collection <key-or-name>] |
| Abstract screening (LLM on title+abstract) | start_abstract_screen (job; collection, group/user, optional model, dry_run) | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/abstract_screen.py --group <id> --collection <key> --config ./screening_config.py [--model <alias>] |
| Full-text screening + structured coding (LLM) | start_fulltext_code (job; collection, group/user, optional model, only_keys, rerun, full_recode, dry_run) | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/fulltext_code.py --group <id> --collection <key> --config ./screening_config.py [--model <alias>] |
| Update specific coding fields on already-coded items | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/fulltext_code.py --group <id> --collection <key> --config ./screening_config.py --update-fields FIELD1,FIELD2 |
| Summarise screening / coding decisions across passes | screening_report (log_csv, list_decision, list_rescreened) | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/screening_report.py <log.csv> [--list <decision>] [--list-rescreened] [--search-csv <search_results.csv>] — --search-csv (script only) adds the removed-before-screening count |
| Tag supplements / front matter / notices already in a library | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/tag_doctypes.py --group <id> [--collection <key>] (dry run) · add --apply to write · --no-link skips relating supplements to their article |
| Fetch missing abstracts (multi-source cascade) | start_enrich_abstracts (job; filter_keys_file) | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/enrich_abstracts.py --filter-keys-file <keys> |
| Validate DOIs / find missing ones | start_enrich_dois (job; filter_keys_file; relays its 2/3-match question through job_status) | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/enrich_dois.py --all --filter-keys-file <keys> |
| Attach missing PDFs (plan with the user, then API / paid / browser / Connector / manual) | REQUIRED SUB-SKILL: retrieving-pdfs — it runs the planning step and every mode | — |
| Audit library (missing abstracts / PDFs / stubs) | audit_library (group or user) | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/audit_zotero_library.py --group <id> |
| Export includes-only coded view | export_coded_includes (collection, group/user; writes analysis/results/coded_papers.csv) | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/export_coded_includes.py --group <id> --collection <key> --config ./screening_config.py --out analysis/results/coded_papers.csv |
| List / prune this review's Zotero tags | — | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/manage_tags.py --group <id> --collection <key> --list · add --prune <field> --apply to drop a coded-value family |
Generate references.bib from manuscript keys | generate_bib (scans manuscript/, writes manuscript/references.bib) | uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/generate_bib.py from the project root |
Additional templates shipped with the plugin:
${CLAUDE_PLUGIN_ROOT}/templates/search_config.py — journal
list, query definitions, year window. Read by search.py and
search_openalex.py.${CLAUDE_PLUGIN_ROOT}/templates/screening_config.py — the
mandatory TAG_PREFIX, system prompts for abstract screening and
full-text coding, plus the FULLTEXT_CODING_FIELDS list that drives
the coding schema (and which fields become tags).test_common.py into your
project's scripts/ directory). One file per skill so failures map
back cleanly to the rule-book the regression violated:
${CLAUDE_PLUGIN_ROOT}/templates/test_systematic_review.py —
this skill's 11 pipeline invariants (PRISMA arithmetic,
search_run.json integrity, decision-state whitelists,
temperature=0, screening_config round-trip, ghost handling).${CLAUDE_PLUGIN_ROOT}/templates/test_citations.py — @citekey
resolution, bare Author (YYYY) detection, BBT-key uniqueness.
Owned by the grounded-citations / fact-check skills.${CLAUDE_PLUGIN_ROOT}/templates/test_empirical_integrity.py —
forbidden-literal grep, label uniqueness, inline s['…'] key
resolution against the live build_stats() dict, figure-file
existence, manuscript_stats.json ↔ build_stats() content
check. Owned by the empirical-integrity skill.${CLAUDE_PLUGIN_ROOT}/templates/test_common.py — shared
TestRunner infra the three test files import.${CLAUDE_PLUGIN_ROOT}/templates/manuscript_stats.py —
flat-dict builder that reads every pipeline output and returns keys
like screen.n_included, search.unique_dois, etc. for inline
lookup in the manuscript. Copy into the project's
analysis/manuscript_stats.py; extend as the manuscript needs new
facts. Output: analysis/results/manuscript_stats.json (written by
the script's CLI mode; never hand-edited).${CLAUDE_PLUGIN_ROOT}/templates/manuscript_tables.py —
pandas-based table functions (methods, regions, exclusion reasons,
construct families) for Quarto code chunks. Keeps prose readable.
Copy into the project's manuscript/manuscript_tables.py so the
.qmd can from manuscript_tables import ....${CLAUDE_PLUGIN_ROOT}/templates/manuscript.qmd — Quarto
scaffold with setup chunk importing build_stats(), placeholder
sections, and example inline expressions showing every methodology
number wired to s['key'] rather than hand-typed. Expects
references.bib (from generate_bib.py) and apa.csl (shipped as
${CLAUDE_PLUGIN_ROOT}/templates/apa.csl) beside it in
manuscript/.A project CLAUDE.md template for new SLR projects lives at
${CLAUDE_PLUGIN_ROOT}/templates/sr_claude_md.md. A
manuscript-only variant (no SLR-pipeline scaffolding, for research-report
editing projects) lives at
${CLAUDE_PLUGIN_ROOT}/templates/manuscript_claude_md.md.
Pilot before the formal run. Before committing to the formal search
parameters, probe each candidate database with a handful of keyword
combinations to surface volume estimates and construct-coverage gaps.
Per the Scripted searches only principle above, MCP tools are
acceptable for piloting (they are fast and session-scoped), and are
the only way to probe Scopus / OpenAlex / Semantic Scholar without
first spinning up the full scripted-search machinery. The formal run
then uses the scripted searchers under scripts/pipelines/.
Once a pilot search has produced a CSV (from any of the single-database
piloting scripts above, or a trimmed formal-search export), run
pilot_analyze.py on it instead of writing an ad-hoc python3 -c "import csv; ..." snippet — its four subcommands (year-cutoff,
db-overlap, journal-coverage, field-breakdown) cover the standard
questions a year cutoff, a single-vs-multi-DB decision, and a
journal-scope sanity check need answered. See the table above for
invocations; --help lists the full flag surface including --plot.
Source preference ordering. Which databases to include depends on what the user's institution provides. Degrade gracefully rather than blocking on a missing subscription:
| Preference | Source | Access | Notes |
|---|---|---|---|
| 1 (preferred) | Web of Science Expanded | Script only, via WOS_API_KEY_EXTENDED. No MCP. | Strongest field coverage for social-sciences SR. Use WOS_API_KEY_EXTENDED, not WOS_API_KEY — Starter's IS= ISSN filter returns 0 results and blocks journal-list filtering. |
| 2 | Scopus | Script + MCP (mcp__scopus__*). Requires ELSEVIER_API_KEY or SCOPUS_API_KEY. | Strong alternative when WoS is unavailable. Covers the same journal set as WoS with different dedup patterns. |
| 3 | OpenAlex | Script + MCP (mcp__openalex__*). Free, no subscription. | Open-access baseline; always usable. Weaker field-precision for niche social-sciences topics, but improves year over year. |
| 4 | Semantic Scholar | Script + MCP (mcp__semantic-scholar__*). Free tier available. | Good for recent work and preprints; complementary to the above. Cannot be scoped by ISSN — S2 returns no ISSN field, so journal scope is matched on JOURNALS titles client-side and a title S2 spells differently drops every paper in that journal. Strong for the citation stream, weak for a journal-restricted keyword search; see --keyword-databases / --citation-databases. |
A formal SR typically combines two or three sources from this list
— the exact mix depends on access. A user without WoS or Scopus can
still run a defensible SR using OpenAlex + Semantic Scholar, provided
the coverage gaps are disclosed in the methods section (pulled from
search_metadata.json via the stats dictionary; never typed in prose).
Crossref is deliberately not on this list, and must not be added as
one. paper-search-mcp exposes a Crossref search, so it is always one
tool call away, and it is the wrong tool three times over: it has no
Boolean query language, so no reportable PRISMA search string can be
built from it; its deposited abstracts are sparse and publisher-
dependent; and OpenAlex already carries Crossref's records with a
searchable surface on top. Crossref's role here is as the metadata
and abstract authority — import_to_zotero.py fills incomplete
records from it, and it heads the abstract cascade below. Both are
lookups by DOI, not discovery.
Prefer a mix that includes Scopus or WoS when the user has one, for
a reason beyond coverage: those two return creator names split into
family and given (Doe, Jane), while OpenAlex and Semantic Scholar
return display order only. Dedup carries the better rendering across
databases, so an OpenAlex+WoS run imports correct creators for every
overlapping record with no extra requests. An OpenAlex-only corpus
pays one Crossref fetch per record to reconstruct them.
Per-stream database selection. --databases sets the default for
both streams; --keyword-databases and --citation-databases override
it for one stream only, and either may name a database absent from
--databases (that flag is a default, not a ceiling). none empties a
stream.
A named database that cannot run is a failed search. If a database
you named in --databases, --keyword-databases or
--citation-databases is skipped — no credentials configured for it, or
no QUERY_DEFS / block terms for it in search_config.py — search.py
counts it with the databases whose API calls failed: it exits non-zero
and writes no dedup CSV and no search_run.json, because those certify
a complete search. Fix the credential (/setup) or the config, or drop
the database from the flag and record that as a protocol decision; do
not import the .partial.csv. A database the script selected by
default (you named none) may still be skipped without failing; then
search_metadata.json lists it under skipped_databases, and
databases names only the ones that actually ran — so the methods
section, which reads databases, never claims a search that did not
happen.
Semantic Scholar needs journal titles. S2 returns no ISSN, so with a
JOURNALS list that gives ISSNs only (no titles) it has nothing to match
on, and search.py stops with an error rather than returning an empty
or unscoped stream. Add titles, or leave S2 out of the keyword stream.
This exists because a database can be right for one stream and wrong for
the other, and the leading case is Semantic Scholar. It returns no ISSN,
so it cannot be scoped to a journal list at the source; its keyword
contribution to a journal-restricted review is structurally weak. For a
citation search it is the opposite — on one real seed it returned about
50% more citing works than OpenAlex. So (the per-stream flags are not
start_search arguments — run the script):
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/search.py --config ./search_config.py \
--databases wos,openalex --citation-databases openalex,semantic_scholar
Do not resolve this by admitting the database to both streams and
calling it a deviation. A project that did exactly that wrote "cost is
screening volume" into its scope note, and the real cost was nothing at
all: under journal scope the keyword stream contributed zero rows, so
there was no precision trade-off to accept. If a database returns 0 in
per_database_counts, find out why before describing it — the search
prints a warning naming the cause when a scope filter rejects a whole
non-empty result set.
Citation search (forward snowballing) — a second search stream. A keyword search restricted to a journal list has a blind spot it cannot close by adding terms: a paper that applies something often uses none of the review's topic vocabulary. What it does contain is a citation to the work that introduced the thing. When the object of the review is a specific named work — a method or estimator, a scale or instrument, a theoretical framework, a widely reused dataset — searching on that citation reaches a population no query string will.
Set the seed DOIs in the config and run the normal search:
# search_config.py
CITATION_SEEDS = ["10.1037/0021-9010.91.4.917"]
Then start_search as usual, or start_search with
streams: "citation" to pilot one seed cheaply. Terminal equivalent:
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/search.py --config ./search_config.py
uv run ${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/search.py --config ./search_config.py --streams citation # pilot one seed
Both streams land in one corpus under one DOI hash, so the import
(start_import) and the integrity machinery need no separate path. Four things to know:
FROM_YEAR / TO_YEAR always apply. JOURNALS applies by
default — --citation-journal-scope auto, the default, scopes the
stream whenever JOURNALS is non-empty; off keeps it open to any
venue. Decide this deliberately, because the two answer different
questions.
Scoped asks: which papers in my journals cite this work without
matching my keywords? That is still a real gain over Stream A — a
paper in a target journal that applies the method but describes only
its topic — and it is far cheaper. OpenAlex ANDs the venue filter into
the cites: query server-side, so out-of-scope records are never
fetched: 1670 citing works open-scope against 68 scoped, on one seed.
Open asks: who cites this work anywhere? Use it when the review's object is the method or instrument itself rather than a literature in a venue list, and accept the volume — one review's seed returned 1839 citing works of which 107 were in its 22 target journals.
Semantic Scholar cannot filter venues server-side (/citations takes
no such parameter), so there the scope is applied after the fact: it
saves import and screening, not API calls.
A changed scope changes the corpus. The resolved value is recorded
in search_metadata.json as citation_journal_scope, alongside
plugin_version — two runs of the same config can differ on either,
and neither is recoverable from the search date.
Report it as "other sources", not as a database. PRISMA counts a
citation search separately from the database totals. Every row carries
a discovery_source column (keyword_search / citation_search), and
search_metadata.json records citation_seeds,
per_database_citation_counts and unique_records_by_discovery_source.
Pull those numbers through the stats dictionary like any other; never
type them into prose.
A record found by both streams counts as a database hit. The
citation stream is credited for what it adds. This is decided in
_dedup, not by which stream happened to run first.
OpenAlex and Semantic Scholar only. Scopus needs a Scopus EID
rather than a DOI for REFEID(), and the WoS Starter tier exposes no
cited-reference endpoint; both are skipped with a message rather than
failing the run. OpenAlex pages with a cursor and so has no result
ceiling; Semantic Scholar's /citations stops at 10,000 per seed and
says so when it does. For a heavily cited seed, OpenAlex is the one to
trust for completeness.
State the seeds in the protocol before running. A citation search chosen after seeing the keyword results is a different thing from one the protocol specified — the same objection as adding a database post hoc.
The databases do not search the same fields, and it can dominate
recall. OpenAlex's search= covers full text. Scopus
TITLE-ABS-KEY and WoS TS= cover title, abstract and keywords
only. Every mixed run has always inherited that asymmetry silently.
It is not a footnote. Measured across six management journals, 2011+:
| phrase | title+abstract | full text | ratio |
|---|---|---|---|
| "job satisfaction" (topic) | 160 | 415 | 2.6x |
| "moderated mediation" (topic) | 95 | 271 | 2.9x |
| "three-way interaction" (method) | 17 | 113 | 6.6x |
| "common method bias" (method) | 1 | 181 | 181x |
Papers advertise their topic in the abstract and bury their method in the Methods section. So when the review's target population is defined by something the paper did rather than what it is about — a specific estimator, a scale, a design, a robustness check — an abstract-limited search has a hard recall ceiling, and no amount of term tuning reaches past it because the words are not in the indexed fields. One review measured 16.2% recall against its own ground truth of three-way-interaction papers; the field split above predicts 15%.
Three consequences for protocol design:
--search-fields makes the choice explicit. all (default) keeps
OpenAlex's full-text reach; title_abstract restricts it to match
what Scopus and WoS can see, which is the setting for a protocol that
needs every database searched comparably. Both are recorded in
search_metadata.json, because PRISMA requires reporting the fields
searched and a protocol cannot report what it was never told.Technical tips for search design:
TS="growth aspiration" misses plural "aspirations". Always
write TS=("growth aspir*" OR ...).Cascade in order: Crossref → Semantic Scholar (DOI) → Semantic Scholar (title) → Scopus → ScienceDirect → OpenAlex GROBID.
abstract_inverted_index. Often reconstructed
from GROBID full-text parsing — returns body-text fragments, not
abstracts. See https://bmkramer.github.io/SesameOpenScience_site/thought/202411_open_abstracts/.<abstract> element is the acceptable last-resort
OpenAlex source; still verify length > 60 chars and sense-check.REQUIRED SUB-SKILL: retrieving-pdfs. Load it with the Skill tool
before attaching any PDF, and follow it. It plans retrieval with the user
(what the API cascade, the paid OpenAlex source, the browser and
Connector passes and manual download would each get), records the agreed
order in .claude/pdf/strategy.toml, executes it step by step, and owns
the retrieval doctrine: the source cascade and its traps, the [pdf]
policy, the failure causes, and diagnose before you exclude.
What this skill adds for a review:
--filter-keys-file (or the
filter_keys_file tool parameter) when that is narrower than the
library.[pdf] values the user agrees in
the strategy conversation are written to this project's
screening_config.py (PDF_MIN_VERSION / PDF_RECONSTRUCTED /
PDF_PAID), so the version the review codes from is recorded with it.<prefix>/fulltext:unavailable is applied only
when retrieving-pdfs' audit reports the item's cause as UNAVAILABLE
— see the tag table above."temperature": 0
in screening scripts.**DECISION:** Include. is tolerated), the item is
asked again; only a reply that is still unparseable after the retry
is filed as borderline — the deliberate bias toward keeping an item
for full-text review.search.py labels them in a doctype column (and counts them in
search_metadata.json under unique_records_by_doctype);
import_to_zotero.py imports them with a global doctype:* tag; both
screening scripts skip tagged items and print how many per class. They
stay in the corpus and the DOI hash, so report them as "records removed
before screening" in the PRISMA flow, not as exclusions. If a screening
run warns about untagged look-alikes (a library imported before 0.25.0),
run tag_doctypes.py (dry run, then --apply) before screening.ThreadPoolExecutor + threading.Lock on the
CSV log. Default 8 workers for Haiku / Gemini Flash, 5 for Sonnet / Gemini Pro.
--workers is a synchronous-path setting only. It sizes a pool of
concurrent API calls — it has no effect on the browser passes either,
which are sized by --browser-workers. So it does nothing on the
--emit-manifest /
--apply-responses path — there the whole manifest goes to the serving
engine in one call and the engine schedules the batch, which is where
nearly all of the throughput comes from. Reinstating a per-request loop
to "parallelise" a batch run forfeits it. See cluster-screening.llm_helpers.extract_json_from_response() which walks for the first
balanced {...}. Errored rows write decision=error with truncated
response in reason. On fulltext_code.py, --rerun retries exactly
those rows and nothing else, and cannot be combined with
--full-recode. (abstract_screen.py has no such flag — re-screening
there means removing the stage tag.)Before screening, query a predatory-journal list (Beall's archive at
https://beallslist.net/ or equivalent) for each journal ISSN. Papers
from listed journals get a predatory:flag tag in Zotero. This is a
warning, not an exclusion — the author decides during full-text
review whether to keep each flagged paper. Transparent flagging
(not silent removal) is the rule.
PRISMA quality assessment should catch retracted papers in the
included set — citing a retracted paper is a fact-check failure mode.
Run this check after full-text coding is complete and before
exporting coded_papers.csv, so retractions don't slip into the
manuscript's bibliography.
The mechanism (mcp__zotero__scite_check_retractions, the
retracted:flag tag convention, "flag — don't silently drop")
lives in zotero-operations — see its Optional: retraction check
section, including what to do when the tool is missing because the
server was registered without the scite toolset. The SR-specific twist is scope and timing:
<prefix>/fulltext:include so it runs against papers that matter for the
synthesis, not the full library.export_coded_includes.py; the
adjudicator decides whether to keep retracted items (with a
prominent discussion note), replace the citation, or exclude.After every automated full-text screening / coding run (and after every re-run following prompt changes), launch three parallel evaluator agents, then run a human adjudication loop on whatever they flag. Abstract screening is typically not re-QAed — its errors surface at Stage 2 anyway — but the pattern works identically if you want to.
Launch in a single message, multiple Agent tool calls so they
run in parallel (≈max-of-three latency instead of sum-of-three).
Every evaluator flags items; no evaluator ever re-decides.
include, with
the automated reason and the key coding fields. Prompt asks it to
flag false positives — papers that slipped through despite
failing one of the inclusion criteria. Each flag marks severity
HARD (clearly fails a named criterion) or SOFT (borderline,
defensible). Returns a bulleted list, one per flagged item, with
item_key, severity, and a one-sentence reason.WRONG_CODE:
the exclusion stands but the code is wrong (e.g. exclusion E3 when
the real reason is E1).The 20 % threshold for coding-quality spot-checks is the plugin's default. Smaller corpora (< 40 includes) warrant 100 % review; larger corpora (> 200 includes) can drop to 10 % with a quality audit built in.
Evaluators run as Agent calls in the main session — they cannot
write to Zotero themselves. The main agent takes each flag the
evaluators return and applies the appropriate <prefix>/qa-* tag via
mcp__zotero__zotero_update_item (with an add_tags parameter) or
mcp__zotero__zotero_batch_update (with item_keys + add_tags) for
the bulk case.
See Zotero tag and note conventions above for the full tag
vocabulary — <prefix>/qa-flag, <prefix>/qa-hard,
<prefix>/qa-soft-include, <prefix>/qa-soft-exclude,
<prefix>/qa-wrong-code, and the two post-adjudication
<prefix>/qa-adjudicated-* tags.
Required: each evaluator emits a decisions.json alongside the
markdown report. The markdown is for human review; the JSON is the
machine-actionable input that apply_qa_adjudications.py consumes
once the human has reviewed and (optionally) overridden the
evaluator's calls. Schema:
[
{
"item_key": "ABCD0001",
"verdict": "include" | "exclude" | "borderline",
"reason": "(optional) free-text rationale, written to apply log",
"flip_fulltext": false
}
]
flip_fulltext is true only when the adjudication overrides
the screener's <prefix>/fulltext:* tag — leave false for confirmations of
the original decision. The evaluator subagent prompt must instruct
the model to emit one JSON entry per flagged item.
The human opens Zotero, filters the collection by <prefix>/qa-flag, and for
each flagged item:
SLR Coding child note.<prefix>/qa-hard /
<prefix>/qa-soft-* / <prefix>/qa-wrong-code) and
<prefix>/qa-flag; adds <prefix>/qa-adjudicated-include or
<prefix>/qa-adjudicated-exclude.<prefix>/fulltext:* tag and adds the opposite one. Tags are the
authoritative state — a flip that doesn't update the
<prefix>/fulltext:*
tag leaves Zotero inconsistent with the adjudication.SLR Coding: <prefix> child note and
removes <prefix>/qa-wrong-code.screening/fulltext_screening.csv (who flipped, when, why). The
CSV is run-history; the Zotero tag is the current state. Downstream
scripts (export_coded_includes.py, manuscript_stats.py,
test_systematic_review.py) read from Zotero, not from the CSV.screening/qa_review.md recording the decision
(format below).Bulk-applying many adjudications: when the human-curated decision list is non-trivial (more than ~5 items), use the shipped pipeline script rather than per-item MCP tag calls:
uv run "${CLAUDE_PLUGIN_ROOT}/scripts/pipelines/apply_qa_adjudications.py" \
--group <id> --decisions .claude/qa/decisions.json
The script consumes decisions.json (the schema in Applying QA
tags above), routes through zotero_io.batch_update_tags —
constructing the full PATCH payload with the right version field
per item — and writes an audit log to output/qa_adjudications_log.csv.
Replaces the user's earlier ad-hoc adjudication script that hit a
silent-write pyzotero footgun (calling add_tags() with a stub item
dict drops the write).
screening/qa_review.md structureA single markdown file in the project's screening/ directory with
two sections.
Scope clarifications. Protocol-level decisions the adjudicator made while working through flags. These apply going forward and propagate back into the screening prompt version for any future re-run. Format:
- <one-line rule> — <paragraph rationale>. (YYYY-MM-DD)
Example: "Cross-country GEM studies at country-year level are in scope. Rationale: the GEM cluster is a coherent strand; fragmenting it weakens synthesis."
Adjudication log. One line per flagged item, in processing order. Format:
{item_key}{short citation} — {kept DECISION / flipped to DECISION [EXCLUSION_CODE]} — <one-to-two-sentence rationale>. (YYYY-MM-DD)
Group related flips onto one line when the rationale is identical (e.g. "10 GEM studies — all kept INCLUDE — see scope clarification 1"). Individual contentious flips get their own line.
This file is the methods-section evidence for the manuscript's QA paragraph. Without it, the adjudication is not reproducible.
You are about to silently drop a <prefix>/qa-flagged item — remove the
flag without recording a disposition in the adjudication log. Never.
Every flagged item gets one line in qa_review.md, even if the
decision is "kept without change". Silent drops break the
reproducibility invariant that makes the QA step worth the effort.
These rules supplement the empirical-integrity skill with SR-specific
patterns:
search_metadata.json. Never
import scripts (side effects); parse with
re.search(r'CONSTANT\s*=\s*"([^"]+)"', source). Keywords, year
bounds, model names, prompt versions all live in the metadata file.
analysis/manuscript_stats.py then ingests search_metadata.json and exposes
each field under s['search.*'] or s['provenance.*'] in the
manuscript's stats dictionary — the manuscript never reads
search_metadata.json directly.claude-haiku, claude-sonnet), keyword strings, year bounds.
These must use inline expressions from the stats dictionary
(s['search.databases'], s['provenance.fulltext.model'], …).include + borderline + exclude = total screened; coded include + exclude = total coded. Catches missing
items or pipeline drops.search_run.json records the
canonical count of unique DOIs from the scripted search. Post-import
invariant: Zotero DOIs == search DOIs. Abort if extras exist (items
added outside the pipeline).See empirical-integrity for the overall approach and file layout.
SR-specific invariants live in
${CLAUDE_PLUGIN_ROOT}/templates/test_systematic_review.py (copy into
the project's scripts/). The file ships 14 active tests:
| Test | What it catches |
|---|---|
| Pipeline artefacts exist and non-empty | Pipeline didn't run |
search_run.json marker matches dedup CSV | Stale or missing integrity gatekeeper |
search_metadata.json has required fields | Export bug |
| No duplicate DOIs in dedup CSV | Dedup gap |
| Abstract log uses allowed decision states | Pipeline emitted an unexpected abstract-stage decision |
| Fulltext log final decisions | Non-final (error) decision left at the end of the fulltext log |
| PRISMA arithmetic | Screening funnel inconsistency |
| Coded count == fulltext includes | Export/coding drift |
temperature=0 pinned in Claude calls | Reproducibility regression |
screening_config constants match logs | Config changed without a re-run |
No decision=error left in fulltext log | Unresolved screening errors |
| No ghost keys (fulltext log ⊆ Zotero) | Items removed or renamed outside the pipeline |
| Fulltext tags consistent with CSV log | Zotero tag state diverges from CSV decisions — tag write-back failed, or an out-of-band CSV edit wasn't mirrored in Zotero |
Every <prefix>/fulltext:include item has an SLR Coding note | Include-tag set without a coded note — export script has nothing to read for that paper |
BBT-key uniqueness and coded_papers.csv → references.bib resolution
live in test_citations.py (citation concerns). Manuscript-prose
invariants — forbidden literals, label uniqueness, inline s['…']
resolution, figure-file existence — live in
test_empirical_integrity.py. Zotero-collection dedup checks are run
via mcp__zotero__zotero_find_duplicates, not as a static test.
Grow the suite with the pipeline. When you find a new SR-pipeline
regression a static check could catch — a new metadata field that
should round-trip, a new PRISMA edge case, a new Zotero-drift pattern —
add the test to scripts/test_systematic_review.py before closing
out the task. The failure becomes the sentinel so the same class of
mistake can't silently return across runs.
This skill targets social-sciences systematic reviews (management, entrepreneurship, IS, organizational behavior). Medical / clinical SLR instruments — evidence hierarchies (I–VII), RoB 2, ROBINS-I, PRISMA-P preregistration — are out of scope for v0.1. A medical-SLR variant would need those plugged in; forcing them into social-science reviews is domain-inappropriate.
<abstract> element.%PDF
magic bytes.~/.config/academic-research/config.toml via
cat, head, tail, grep, less, more, awk, sed, a
Python script, or any other command. NEVER read that file. It
holds API keys. Pipeline scripts read it via Python's open()
outside your tool layer; you have no legitimate reason to inspect
it. If debugging feels like it needs a look inside the file, ask
the user to re-run /setup — that's the reset path.scripts/pipelines/ covers the task, invoke
it. If none does, tell the user which task is missing and propose
adding a shipped script — do not write a one-off. Improvised
scripts leak keys through your context and sidestep pre-approved
permissions.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
systematic-review, prisma, slr, literature-review, screening, coding
npx claudepluginhub mronkko/claude-academic-research --plugin academic-research14 skills in this plugin
/academic-styleUse when drafting or editing academic prose — topic sentences, paragraph structure, APA-style citations, voice, tense, hedging, term definitions — in a .qmd / .Rmd / .md / .tex file of an academic-research project. Trigger phrases "write this section", "edit this paragraph", "tighten the prose", "APA style". Do NOT use to revise a finished draft — use `critic-loop`. Do NOT use for citation or number accuracy — use `grounded-citations` / `empirical-integrity` / `fact-check`./cluster-screeningUse when screening or coding papers on a GPU cluster or batch scheduler instead of an LLM API — emitting a request manifest, submitting a SLURM job, collecting responses, applying them to Zotero. Trigger phrases "screen on the cluster", "run this on SLURM", "sbatch", "GPU node", "emit a manifest", "apply the responses", "batch screening". Do NOT use for ordinary API-based screening — use `systematic-review`./critic-loopUse when the user asks to revise, polish, critique, or finalize an existing academic manuscript, chapter, thesis, or paper — runs parallel critic subagents until no MAJOR issue remains. Trigger phrases "/critic-loop", "run critic-loop", "revise this manuscript", "polish this chapter", "critique this draft", "review this thesis". Do NOT use for first drafts — use `academic-style`. Do NOT use for a standalone citation audit — use `fact-check`./demo-slrUse when the user wants to demo or try the plugin's whole systematic-review workflow in 5-10 minutes on a topic they choose, ending with a highlighted Zotero PDF. Trigger phrases "/demo-slr", "demo the SLR", "show me a mini systematic review", "run a demo review". Do NOT use for a real review — use `systematic-review`. Do NOT use to retrieve PDFs for a real library — use `retrieving-pdfs`./empirical-integrityUse when writing or editing a manuscript (.qmd, .Rmd, .ipynb, .tex, .md) that states numbers, statistics, tables, test results, or methodology facts (search dates, model names, keyword strings) — every such value must come from a pipeline-generated file via an inline expression. Trigger phrases "add the sample size", "report the results", "update the table", "insert this statistic". Do NOT use for citation claims — use `grounded-citations` / `fact-check`./fact-checkUse when the user asks to fact-check a manuscript, verify or audit its citations, or check that cited papers support the claims attributed to them. Trigger phrases "fact-check", "verify citations", "audit citations", "check the sources", "do these papers actually say that", "verify the numbers in this draft". Do NOT use during or right after a `critic-loop` run — its evidence critic already audits the citations. Do NOT use to add a new citation — use `grounded-citations`.Other plugins' skills for the same job