/research-superpowers:drift-reportfrom research-superpowers
Checks a research project's shared library, wiki, and registered projects for accumulated drift: un-indexed PDFs, scans without text layers, PDF bloat, unmerged bib keywords, cross-project bibkey collisions, and lint regressions from out-of-band edits. Wraps hooks/drift_check.py.
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.
Deterministic maintenance findings across three scopes — current project, shared library, all registered projects — produced by the same script the SessionStart hook runs. Report-only with one exception: the incremental search-index update (a derived cache).
Announce at start: "Using drift-report to check for accumulated drift."
At session start, hooks/drift_check.py compares cheap fingerprints (library
PDF count/mtimes, master-bib hash, each registered project's bib hash, the
current wiki's file count/mtimes) against ~/.cache/research-superpowers/drift-state.json.
Nothing changed → nothing runs, nothing is injected. Drift is caused by
actions, not by time — in-session actions are covered by the skills that cause
them (ingest lints, add-to-library re-indexes); the hook covers what happens
out-of-band: manual VPN downloads, Nextcloud syncs from teammates, Obsidian
edits, ingests in other projects. The first run is a silent baseline.
Kill switch: RESEARCH_SUPERPOWERS_NO_DRIFT_CHECK=1.
python3 "${CLAUDE_PLUGIN_ROOT:-$RESEARCH_SUPERPOWERS_DIR}/hooks/drift_check.py" --force --human
--force ignores the fingerprints (checks everything now — this is how you
inspect a freshly installed machine despite the silent baseline); --human
prints the report instead of hook JSON. Run from a project root when possible —
the wiki-lint scope only exists there.
| Finding | Meaning | Fix (never run without the user's go-ahead) |
|---|---|---|
| lint FAILS after out-of-band edit | someone edited knowledge/ outside a session (Obsidian, editor) | python scripts/lint-wiki.py, then fix per wiki-lint skill |
| PDFs with no text layer | scans arrived (VPN download, teammate sync) — invisible to search | ocrmypdf, then re-index |
| PDFs unreadable | corrupt files in the library | bib-search.py status for the list |
| PDFs > 40 MB | publisher bloat syncing to everyone, forever | optimize-pdf.py scan . → optimize after review |
| merge drift | ingests wrote bibkeys/keywords into project bibs that the master lacks — new keywords are invisible to every OTHER project's bib-search until merged | merge-bibs.py --report-only first, review FACTUAL conflicts, then merge |
| bibkey COLLISION / SPLIT | one key names two works (a false cross-project join) or one work has two keys (a silently missed join) | migrate-citekeys.py, guided by the audit output |
| project sync drift | a project's copied schema/ + scripts/ come from an older plugin version — its linter validates against rules the plugin has since changed, and the error reads like a wiki problem | sync-project.py --from-registry to see it, --apply to fix |
| index updated (info) | the one permitted mutation — derived cache, incremental | nothing to do |
Three of these tools live in the plugin, not in the project. merge-bibs.py,
migrate-citekeys.py and sync-project.py are maintainer tools operating across projects, so they are
not mirrored into the template — python scripts/merge-bibs.py from a project root
fails with "No such file or directory". Run them from the plugin:
python3 "${CLAUDE_PLUGIN_ROOT:-$RESEARCH_SUPERPOWERS_DIR}/scripts/merge-bibs.py" …
(Claude Code sets CLAUDE_PLUGIN_ROOT; the OpenCode plugin sets
RESEARCH_SUPERPOWERS_DIR for every shell command). The report's → lines
already carry the absolute path. Everything else in the table (bib-search.py,
optimize-pdf.py, lint-wiki.py) is template-mirrored and runs project-relative.
Never expand the registry in the shell. Pass --from-registry and let
merge-bibs.py read ~/.config/research-superpowers/projects itself. Both shell
forms lose projects silently, in opposite directions: --roots $ROOTS does not
word-split in zsh and arrives as one nonexistent path, while
--roots $(grep -v "^#" …) splits in bash and zsh — including inside a path, so
a project under …/Mobile Documents/… arrives as several nonexistent fragments.
A dropped project makes the report say "0 FACTUAL conflicts" about a set that never
contained it, and inflates the master-only count. --roots <p1> <p2> … stays for
explicitly named projects; quote every path.
Cross-project checks read ~/.config/research-superpowers/projects (one
project root per line, # comments). The hook auto-registers the project
each session starts in, so the registry fills itself through normal use; edit
the file to add projects you never open with Claude Code, or to remove retired
ones.
| Thought | Reality |
|---|---|
| "Merge drift found — I'll just run merge-bibs with --out now" | No. --report-only first: FACTUAL conflicts (wrong DOI, wrong year) need a human verdict before anything writes to the shared master. |
| "The report is empty, so the check must be broken" | Silence IS the report. Nothing changed since the last look — verify with --force --human if in doubt. |
| "A collision — I'll rename the key in this project" | A bibkey is a cross-project join key derived from the work's metadata. Fix it with migrate-citekeys.py in EVERY affected project, not ad hoc in one. |
| "I'll OCR/optimize the PDFs right away, it's obviously needed" | Library files sync to every machine and every teammate. Surface the worklist; the user decides when the shared collection gets rewritten. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
drift-check, research-workflow, pdf-management, bibliography, wiki-lint
18 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)./add-to-libraryAdd ONE document (a PDF) directly to the shared master library — outside the project ingest flow. Auto-discovers the bibliographic metadata, VERIFIES it against Crossref/OpenAlex (never guessing), derives keywords cheaply from the PDF's docinfo + first-page abstract (no full read), computes the canonical bibkey, places the PDF at <library>/pdf/<bibkey>.pdf and appends the entry to <library>/references.bib. Stops and asks when metadata cannot be verified. Triggers on "add this PDF to the library", "add to the master bibliography", "put this straight in the library", "füge das Dokument der Bibliothek hinzu", "nimm das PDF in die Bibliothek auf". NOT ingest-source (which reads a source into a project's wiki), NOT acquire-sources (which downloads a review's worklist)./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./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.npx claudepluginhub leiverkus/research-superpowers --plugin research-superpowersOther plugins' skills for the same job