/research-core:data-handlingfrom research-core
Guides reporting and verification practices during data analysis: printing dimensions, coverage, and join results; surfacing ambiguities and data problems before writing analysis code.
Ships in research-core. 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.
This skill is about what you tell the user while working with their data. It is not a guide to
writing R or Python. File layout, script numbering and output conventions belong to the
script-organization skill.
Every significant operation prints its numbers into the script's output — dimensions, coverage, join results, filter impact. That is the complete record, and it is not optional. Silently writing code that produces plausible-looking output is how wrong join keys and column collisions survive into published results.
What enters the conversation is a subset. Replaying every diagnostic buries the one number that matters under nineteen that behaved. Bring the user:
seurat_name column is mostly bare Trinity IDs. The key formats match, but the low
annotation coverage is still unexplained, so I'm stopping before using it downstream."Everything else is summarised at the review stop, where the user decides how deeply to look. Resolved data problems belong in that summary: state what was wrong, what was corrected, the evidence for the correction and how many cases were affected. Resolution does not make the problem disappear from the report; it need not interrupt work when the correction is straightforward.
Verify the key values, not just that both tables have a column with the right name.
head() alone misleads when the early rows are unrepresentative — unannotated entries often sort
first. Sample instead, or check the distribution.sum(table_a$key %in% table_b$key)
table_a["key"].isin(table_b["key"]).sum()
Geneid is c12345-g1 for 30k genes but c12345-g1 Annotation…
for 10k — those won't match Trinity_geneID."Two different obligations with very different costs. Do not collapse them.
Report it and keep working. Visible in the output and raised at the review, but not a stop:
"unmatched" or NAelse branch of any conditional logicInvestigate, then stop and ask — only when continuing would cross the attention threshold:
Never use a silent catch-all default. A safe-looking default is the most common way a real data problem gets masked.
The shared Research Core agent collaboration instructions keep consequential scientific choices with the researcher and routine implementation with the agent. This section is the working list.
Before writing the analysis, identify which of these choices remain unresolved. If a project plan or genuinely comparable prior analysis already records a choice, check that the scientific question and data are sufficiently similar, briefly remind the user in plain language how it was handled, and ask whether to reuse that approach instead of reopening every technical detail. Bring unresolved choices before the work that depends on them — a different answer changes the result or how it should be read. Exploratory choices that need future evidence may remain open while agreed investigations proceed:
How to ask: actively elicit the scientist's vision and reasoning, then follow the phase's consequential decision branches with detailed follow-up questions. A proposed solution and an "okay" do not replace alignment through discussion. Give context, concrete options and trade-offs, your recommendation where useful and why. Group independent related choices; ask dependent questions sequentially, and defer those that need later evidence. Use representative input-to-interpretation examples when they expose a consequential assumption. Aim for as much autonomous scientific work as the agreed approach permits, while identifying where the user's intellectual contribution is useful. Agree anticipated discussions and return with evidence when discoveries create a new need for joint scientific thinking; update the affected approach and clarify what may continue afterward. Wait for unresolved consequential answers before dependent implementation; routine diagnostics and reversible work within the agreed approach remain the agent's responsibility.
Everything else you decide yourself, then list those decisions at the review so the user can push back if you called one wrong. "Routine" means a different answer would not change the result or how it is read — not that the code change was small.
These produce a confidently wrong number with no error and no warning. Check for them by name.
R
lm() / glm() — the usual na.action = na.omit omits observations missing variables in the
model; the configured action can differ. Check actual omissions, not NAs in unrelated columns.limma::lmFit() — accepts missing expression values and fits each gene with its available
observations; it does not discard every gene row containing an NA. Check per-gene missingness
and estimability before interpreting the fit.cor(use = "complete.obs") — excludes incomplete casesna.action = na.omitas.numeric() on character — introduces NAsdrop = FALSE). Explicit drop = TRUE,
droplevels() or re-factoring can remove them; check the intended categories before dropping levels.Python
pd.merge(how="inner") — drops unmatched rows on both sidesdf.groupby() — excludes NA keys unless dropna=False.value_counts() — excludes NaN unless dropna=Falsepd.to_numeric(errors="coerce") — silently manufactures NaNdf.dropna() on a wide frame — removes far more rows than expecteddf[cond]["col"] = val) — may fail silently; use .loc[]Both
na.rm = TRUE / skipna=True on mean, sum, sd — report how many were ignoredColumn collisions from repeated joins. Joining the same annotation table at two points in one
script — gene_names[, c("id", "name", "label")] in section 3 and again in section 8 — silently
produces label.x and label.y. Join once and carry the result forward, or join only the columns
needed at each point.
Bioconductor masking dplyr. Loading DESeq2, edgeR or AnnotationDbi imports S4 generics that mask
rename(), select(), filter(), count(), slice(). Use dplyr:: explicitly whenever both are
loaded in the same session.
During exploration and planned phases, choose tests around consequential transformations and handoffs: identity alignment, row loss/duplication, annotation ambiguity, units and denominators. Keep known-answer examples and test assertions separate from the main analysis; retain concise checks and diagnostics on the actual data where they protect interpretation. Use the readable analysis and testing guidance when organizing these checks. Before each substantive review, simplify the current retained path and report the failures tested and any gaps. This does not add a per-script approval stop.
script-organization for the convention.data/. Decompress to outs/<script>/ and record the original compressed
source in the inputs section.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
data-analysis, data-quality, reproducibility, data-wrangling
Other plugins' skills for the same job
npx claudepluginhub musserlab/lab-claude-skills --plugin research-core25 skills in this plugin
/analysis-distillationDistill exploratory or complex scientific analysis into the smallest readable workflow that supports a phase review, paper, report, or durable handoff. Use when a settled phase result needs consolidation, or selected results need publication-ready code, a newcomer reproduction route, or a maintained analysis path. Do not use to choose an unresolved scientific method, perform ordinary session cleanup, or rewrite a working pipeline merely to impose a preferred structure.
/analysis-review-dashboardBuild or refresh a browser dashboard for independently reviewing a scientific analysis, from a short workflow to a branching pipeline. Organize existing evidence into a pipeline overview, scientific task pages and complete script reviews with file and object previews. Use when the user asks for an analysis review dashboard or linked pipeline/task/script pages. Do not use for a task-status dashboard, source-code distillation alone, or a script audit alone.
/audit-projectReview project documentation, authority, navigation and workflow drift; propose careful, reversible consolidation when useful. Use for project health or documentation reconciliation, not script correctness (audit-script) or skill quality (a separate maintainer audit; use plugin-feedback for a student plugin report).
/audit-scriptAudit a scientific or data-analysis script, connected workflow, or publication producer for bugs, analytical validity, data handling, reproducibility, outputs, and readability. Use when reviewing code, preparing a substantial phase for scientific discussion, checking collaborator code, or investigating whether retained results can be trusted. Do not use for a quick question about one line or for project-document drift (use audit-project).
/cleanup-scriptsConsolidate scratch or exploratory code from the current work when its retained role is known. Use when the user asks to clean up scripts, when session-owned scratch files need disposition, or when a changed workflow has unclear helper/output ownership. Selecting and simplifying a complete publication or durable handoff path needs its own agreed scope. Do not use as a mandatory project-wide closeout scan or to enforce numbering, lifecycle labels, or one script format.
/conda-envConda environment activation for Python commands. Use when running Python scripts, pip, or conda-dependent tools.