/research-agent-skills:project-setupfrom research-agent-skills
Set 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".
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.
Read when SKILL.md points to them; scripts run unread.
The result, per project:
| File | Loaded | Holds |
|---|---|---|
AGENTS.md | every session (keep it 60-120 lines) | purpose, trust order, start-here table, layout, commands, workflow, rules, traps and caveats |
CLAUDE.md | every Claude Code session | a title and @AGENTS.md, nothing else |
CODE_MAP.md | when working on code | packages and modules with their purpose, entry points, frozen code, code-health decisions |
ENVIRONMENTS.md | when running code | every environment: location or manifest, main packages and versions, what it is for, how to run it |
handover/INDEX.md | at the start of a task | one row per agent task folder |
One instruction file, AGENTS.md, and a CLAUDE.md that imports it, both tracked in the repo. Codex reads
AGENTS.md natively. Claude Code reads it on its own only when there is no CLAUDE.md or CLAUDE.local.md in the
working folder or any folder above it, and otherwise skips it without a sign
(docs). A CLAUDE.md holding only
@AGENTS.md keeps it loaded in every case, and never loads it twice. Instructions go in AGENTS.md only, so the two
files can't drift apart. Because both are tracked, every worktree carries them, and no agent settings are needed.
Repos that follow quadbio's analysis-workflow (their .claude/settings.json enables
analysis-workflow@quadbio, or they were made from analysis_template) already have AGENTS.md, a CLAUDE.md
that imports it, and .claude/worktrees/, and keep task records in task directories instead of handover/. Follow those; don't add
handover/. Offer only CODE_MAP.md and ENVIRONMENTS.md there, and only if the user wants them. The survey
reports when a repo is one of these.
python3 "${CLAUDE_PLUGIN_ROOT}/skills/project-setup/scripts/setup_project.py" <project_dir> [--code-dir <dir>]
Reports git status, the code folder (default code/, else the project root), which of the files above exist, a
CLAUDE.md that holds instructions instead of only importing AGENTS.md or a lowercase agents.md to convert and
the files that mention them, worktrees, whether .claude/worktrees/ is ignored, and what it would create. Before changing anything, check for other agent sessions,
uncommitted work and running jobs in the project.
python3 "${CLAUDE_PLUGIN_ROOT}/skills/project-setup/scripts/setup_project.py" <project_dir> --go
Creates only missing files, never overwrites or deletes: AGENTS.md from the template (skipped when a CLAUDE.md
holds the instructions: convert that instead, step 5), CLAUDE.md with the import, ENVIRONMENTS.md and CODE_MAP.md from their templates with a survey
draft appended (scripts/survey_envs.py, scripts/survey_code.py), and handover/INDEX.md. Both survey scripts
can also be run on their own and print Markdown.
The drafts are mechanical; the agent turns them into a useful description. Scope this research (see the
research-workflow skill in this plugin): read the README, existing instruction files, handover and design
documents, workflow READMEs, configs, and what the user has told agents about the project, not the whole tree.
.claude/worktrees/<name>. The user starts the
session with claude --worktree <name> from the main checkout, which creates it there; an agent adding one itself
uses git worktree add .claude/worktrees/<name> -b <branch>. Keep .claude/worktrees/ in .gitignore. Check
git worktree list before starting; remove the worktree after merging (the branch history stays). Outputs go to the
project's results tree and the task's handover/ folder, never into a worktree, so removing it loses nothing.
Existing layouts that bundle a worktree with job and output folders can stay; new tasks use this.pixi.toml plus an exact pixi.lock, both
committed, so anyone reproduces it with pixi install. Existing conda/mamba environments stay in use and are
listed in ENVIRONMENTS.md; replace one only as its own task. Do not build a pixi environment inside every
worktree: run the main checkout's environment (e.g. pixi run --manifest-path <main checkout>/pixi.toml ...)
or a small wrapper. On shared servers and clusters keep environments and the pixi cache out of home and
backed-up storage (pixi's detached-environments setting and PIXI_CACHE_DIR).AGENTS.md and CLAUDE.md are
tracked there and each worktree carries them. When the project folder sits above the repo, put both in the repo,
not above it, so worktrees and both agents see them.Instructions in AGENTS.md, and a CLAUDE.md that only imports it:
CLAUDE.md with instructions and no AGENTS.md: rename it to AGENTS.md (git mv when tracked), content
unchanged, create a new CLAUDE.md from templates/CLAUDE.md, then fill gaps as in step 3.CLAUDE.md holds instructions: merge them into AGENTS.md, then reduce CLAUDE.md to the title
and @AGENTS.md.CLAUDE.md that already holds only @AGENTS.md (as analysis_template ships it) is correct: keep it. So is a
CLAUDE.md that is a symlink to AGENTS.md. To replace any symlinked CLAUDE.md, remove the link first
(git rm when tracked), then create the file: writing to the link overwrites the file it points to..claude/CLAUDE.md the line is @../AGENTS.md, since
@AGENTS.md there means .claude/AGENTS.md..claude/CLAUDE.md with instructions: merge them into AGENTS.md as well, and keep one importing CLAUDE.md.CLAUDE.local.md or a CLAUDE.md in a folder above the repo needs no change: the import still loads AGENTS.md.agents.md is loaded by neither agent: rename it, or keep it as package documentation and point to it.AGENTS.md answers, without letting them read files. Claude:
cd <project_dir> && claude -p "Without running commands or reading files: according to your project instructions, <question>? Answer briefly, or NONE."; Codex: the same prompt with codex exec -s read-only "...". Repeat inside
a worktree. If Claude answers NONE, check that CLAUDE.md holds the @AGENTS.md line.scripts/setup_project.py (opens in a new tab)scripts/survey_code.py (opens in a new tab)scripts/survey_envs.py (opens in a new tab)templates/AGENTS.md (opens in a new tab)templates/CLAUDE.md (opens in a new tab)templates/CODE_MAP.md (opens in a new tab)templates/ENVIRONMENTS.md (opens in a new tab)templates/INDEX.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
3 skills in this plugin
/analysis-codeHow 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./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