diff --git a/README.md b/README.md index 7dec7e8..7ab4f81 100644 --- a/README.md +++ b/README.md @@ -15,18 +15,29 @@ It assumes analysis repos made from [analysis_template](https://github.com/quadb (pixi-managed) and code repos from the [scverse cookiecutter](https://github.com/scverse/cookiecutter-scverse) (uv-managed). Nothing in it is specific to a dataset, an analysis or a compute environment. -## Install +## Use -**The plugin**, once per machine: +Start each analysis task as its own session, from the analysis repo's main checkout. Pull it first: the worktree +branches from `origin`'s default branch but runs on the main checkout's environment. ```bash -claude plugin marketplace add quadbio/claude-plugins -claude plugin install analysis-workflow@quadbio +claude --worktree ``` -The skill is then available everywhere, so it can set up a new project. The hooks and session-start rules act only -in repos that enable the plugin in their committed `.claude/settings.json`, as -[analysis_template](https://github.com/quadbio/analysis_template) does: +1. The agent works on that worktree's branch, in a new task directory `analysis//_vN/`; a later + answer to the same question gets the next version, in a new session. +2. It asks you which working object is current, then works in scripts; outputs go to the task directory. +3. Results reach a shared working object only after you sign off the dry run. +4. It opens a PR. Once it is merged, leave with `/exit` and remove the worktree. + +Notebooks and environment changes (`pixi install`, `pixi add`) stay with you, in the main checkout. With no +analysis repo yet, ask Claude to start an analysis project: the skill sets one up. + +## Install + +**The plugin**, once per machine, from the [quadbio marketplace](https://github.com/quadbio/claude-plugins). The +skill is then available everywhere; the hooks and session-start rules act only in repos that enable the plugin in +their committed `.claude/settings.json`, as [analysis_template](https://github.com/quadbio/analysis_template) does: ```json { diff --git a/hooks/session_context.md b/hooks/session_context.md index 13eb658..a40253e 100644 --- a/hooks/session_context.md +++ b/hooks/session_context.md @@ -2,7 +2,7 @@ This repository follows the analysis-workflow conventions. Load the `analysis-wo analysis code, outputs or data. Always: 1. One task = one session = one git worktree = one directory `analysis//.../_vN/`. A new task - directory needs a new session. + directory needs a new session, which the human starts with `claude --worktree ` in the main checkout. 2. Every output path comes from `task_paths(__file__)` (package `analysis_workflow`); never a bare relative path. 3. Ask the human which working object (and which label keys) is current; never infer it from a script or the newest file name. diff --git a/skills/analysis-workflow/SKILL.md b/skills/analysis-workflow/SKILL.md index fd5c327..7449ef8 100644 --- a/skills/analysis-workflow/SKILL.md +++ b/skills/analysis-workflow/SKILL.md @@ -41,7 +41,8 @@ into the human lane. **Start** 1. One task = one session = one git worktree = one branch = one directory `analysis//.../_vN/`, merged - through one or more PRs. A new task directory needs a new session; a later answer to the same question is `_v2`. + through one or more PRs. A new task directory needs a new session, which the human starts with + `claude --worktree ` in the main checkout; a later answer to the same question is `_v2`. 2. Copy `assets/task_template/`. 3. Ask which working object and which label keys are current, and record them under Inputs. Never infer them from a script or the newest file name.