/research-agent-skills:analysis-codefrom research-agent-skills
How to write and change research code so it stays small, correct and easy to follow - think before coding, simplest solution, surgical changes, one owner per function, functional style with few classes, and verification before reporting. Use before adding a function, script, notebook, plot helper or pipeline step (Python, R, notebooks, Snakemake/Nextflow, SLURM job scripts, deep-learning training code); when refactoring, deduplicating or moving code or results; when writing tests; and when reviewing code written by another agent or a student.
Ships in research-agent-skills. 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.
A project's own instruction file adds its path resolver, owners and traps, and wins where it is stricter. In repos
that follow quadbio's analysis-workflow, its rules on paths, task directories, working objects and environments
win over §4 and §6 here.
rg -n "<operation>|<plot type>" over the live tree (skip archives and
legacy folders). If an owner exists, call it or extend it in place. Write a second implementation only when the
inputs, coordinate system or estimand really differ, and say so in its docstring.Series.transform(false_discovery_control)
without a groupby runs element-wise and silently returns q = p.dataclass or NamedTuple; one implementation needs no base class; no
inheritance hierarchies "for later".#SBATCH lines are the one exception.NN_verb_object.ipynb; no Copy1 or Untitled; outputs stripped in git (nbstripout).${CLAUDE_PLUGIN_ROOT}/skills/research-workflow/scripts/runlock.py (one writer per folder; see the
research-workflow skill).x / array where the array can hold zeros.git log -1 at the top of every job.pixi.toml plus the exact pixi.lock, both committed, so the environment can be
reproduced anywhere with pixi install. Existing conda/mamba environments stay usable; replacing one is its own
task. Run worktrees with the main checkout's environment instead of building one per worktree; keep
environments and caches out of home and backed-up storage on shared machines. List every environment in the
project's ENVIRONMENTS.md (project-setup skill).PYTHONNOUSERSITE=1), no packages borrowed from other
environments, pip check and pip freeze recorded. Caches go to scratch, never home.Everything printed into an agent's context is paid for on every later turn, and a wall of output hides the number that matters. Compute in a script; let only summaries in.
.head(),
.describe(), value_counts().head(10)). Never print a whole table, array or dict of unknown size.python -c "import anndata as ad; print(ad.read_h5ad('x.h5ad', backed='r'))".jupyter nbconvert --to script --stdout nb.ipynb or
jq -r '.cells[] | select(.cell_type=="code") | .source | join("")' nb.ipynb.cmd > out.log 2>&1; echo "exit=$?"; tail -n 20 out.log; grep -n -i -m 20 -E "error|traceback|warn" out.log.
Use quiet flags where they exist (pip install -q, pytest -q --tb=short, git diff --stat first).Commit on your own branch, early and small; never commit to the main branch; ask before pushing. No logs, data or notebook outputs in git. New options keep old defaults, so old configs reproduce old runs.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
3 skills in this plugin
/project-setupSet up or repair a research project so every coding agent (Claude Code and OpenAI Codex) finds the same instructions - one AGENTS.md per project with a CLAUDE.md that imports it, CODE_MAP.md (packages, modules, entry points, code-health flags) and ENVIRONMENTS.md (each environment, its main packages, what it is for), a handover/ folder for task records, one git worktree per task under .claude/worktrees/, and pixi for new environments. Works on new folders and on existing projects, where it surveys the code and environments and fills the gaps from the project's own documents. Use when starting a project, when a project lacks these files or has competing CLAUDE.md/AGENTS.md files, when agents keep missing a project's rules, or when the user asks for "the AGENTS.md / handover structure"./research-workflowHow a research task is scoped, run, recorded and handed over so that the user and the next agent can follow it, even if the session dies halfway. Use at the start of any task that is more than a quick answer (an analysis, a pipeline change, a model run, a data or literature investigation), when resuming someone else's work, when finishing or pausing, when planning a compute run (pre-registration), when several runs or agents could write to the same place, and when delegating to subagents or to another coding agent (Claude Haiku/Sonnet/Opus, OpenAI Codex models). Covers scope, PLAN.md, PROGRESS.md, HANDOVER.md, the project handover index, run locks and briefs for other agents.research-agent-skills@quadbio is listed by quadbio/claude-plugins — review the source before installing
npx claudepluginhub quadbio/claude-plugins --plugin research-agent-skills