Computational Experiments
Lifecycle skill for algorithmic research projects where the code IS the scientific contribution.
Modes
| Mode |
What it does |
Phases |
| Scaffold |
Create/audit package structure + algorithm skeleton |
1–2 |
| Experiment |
Design and run pre-specified sweep campaigns |
1, 3–4 |
| Explore |
Adaptive experiment loop: modify → run → evaluate → keep/discard |
1, 3E–4 |
| Autonomous |
Parallel self-correcting sweep with sub-agents |
1, 3A–4 |
| Figures |
Generate publication output from results |
1, 4 |
| Full |
Complete pipeline |
1–5 |
Default: Full. Detect mode from user request or ask if ambiguous.
--scaffold Flag
Sets a stage progression template for the experiment campaign. Templates provide structured checklists and exit criteria for each stage.
| Scaffold |
Stages |
Best for |
standard |
Init → Tune → Creative → Ablate |
Algorithm development, ML, simulation |
robustness |
Main spec → Alternatives → Placebo → Sensitivity |
Causal inference, econometrics |
replication |
Exact → Our data → Extensions → Robustness |
Replicate-and-extend papers |
Templates live in templates/experiments/. When a scaffold is active:
- Present the current stage's checklist before starting work
- Gate progression: don't move to the next stage until exit criteria are met
- Log stage transitions in the experiment breadcrumb
Default (no flag): user-defined stages (current behavior). Scaffold is a guide, not a cage — users can skip stages or reorder with explicit acknowledgment.
--budget Flag
Sets a campaign-level time budget in minutes for the entire experiment run. When set:
- Record start time at the beginning of Phase 3 (any variant)
- Check remaining budget before launching each new config, sweep batch, or explore iteration
- Soft stop when budget is exhausted: finish the current run, save all results collected so far, skip remaining configs
- Never hard-kill a running experiment mid-execution — always let the current run complete
| Mode |
How budget applies |
| Experiment |
Skip remaining sweep configs when time is up |
| Explore |
Exit the explore loop at the next iteration boundary |
| Autonomous |
Do not spawn new agent batches; let running batches finish |
| Figures |
Budget does not apply (figure generation is fast) |
Reporting: When a budget triggers early stop, append to the breadcrumb:
- **Budget:** Stopped after <N>/<M> configs (budget: <X> min, elapsed: <Y> min)
Default: No budget (run all configs to completion). Typical values: --budget 30 for quick exploration, --budget 120 for overnight sweeps.
Use Experiment when the design space is known upfront (grid/random sweep). Use Explore when the design space is unknown and the agent should adaptively search (inspired by Karpathy's autoresearch).
When to Use
- "Set up experiments for my algorithm" / "Scaffold the project"
- "Run the benchmark" / "Design the sweep"
- "Explore what auction parameters reduce collusion" / "Try different architectures"
- "Generate convergence plots" / "Make publication figures from results"
- Any project where algorithms, simulations, or optimisation loops are the contribution
When NOT to Use
- Empirical data analysis (observational/survey data) →
data-analysis
- Experimental design for human subjects →
experiment-design
- Causal inference strategy →
causal-design
- LaTeX compilation →
latex
Workflow
Phase 1: Detect & Configure
- Read project context:
CLAUDE.md, MEMORY.md, .context/project-recap.md if they exist
- Detect structure: Scan for
src/, experiments/, tests/, pyproject.toml, setup.py
- Detect language: Check existing files. Default: Python with uv. Ask if ambiguous.
- Read MEMORY.md: Look for
[LEARN:code] tags, notation registry, key decisions — apply established conventions
- Determine mode: From user request or ask. If existing package exists, skip scaffold.
- Inventory existing code: Map modules, entry points, config objects, result files
Read references/package-scaffold.md if scaffold mode is active.
Phase 2: Scaffold
Skip if: Package structure already exists and user requested experiment/figures mode.
- Package structure: Create
src/<pkg>/, tests/, experiments/configs/, scripts/
- Build config:
pyproject.toml with hatchling, dev dependencies (pytest, matplotlib, numpy)
- Algorithm skeleton: Base classes (
Algorithm, Experiment, Metric) with # TODO: markers. For multi-agent projects, use BaseAgent, Environment, MultiAgentSimulation instead — see references/multi-agent-patterns.md
- Test skeleton: Unit test stubs, convergence test template, smoke test
- Experiment infrastructure: Config dataclass template, runner script template
- Gitignore: Add
results/, *.pkl, wandb/, __pycache__/
Read references/algorithm-templates.md for skeleton code. Read references/package-scaffold.md for directory layout.
Gate: Verify package installs with uv pip install -e ".[dev]" before proceeding.
Phase 3: Experiment Design
Prerequisite: Working package (Phase 2 or pre-existing).
- Config schema: Python dataclass with validation, defaults, serialization to/from YAML
- Config hashing: SHA-256 fingerprint for reproducibility tracking (see
references/experiment-patterns.md)
- Sweep definitions: Grid sweep (all combinations), random sweep (budget-limited), manual configs
- Seed management:
np.random.default_rng(seed) everywhere. Seeds passed through config, never global state.
- Runner script: Config → initialize → loop → collect → save. Reads config, runs
n_seeds repetitions, saves per-seed results.
- Baseline implementations: Same interface as main algorithm, registered in config
- Result aggregation: Per-seed CSV → aggregated stats (mean ± std). Canonical column naming.
- Parallelization:
concurrent.futures.ProcessPoolExecutor for independent seeds/configs. For large sweeps (10+ configs × 10+ seeds, GPU-bound, or >30-min runs): move to [HPC cluster] HPC — see docs/guides/hpc.md in Task Management and copy templates/slurm/{array,gpu}.sbatch into hpc/ with sync-up.sh / sync-down.sh. Recent reference implementations: Projects/NLP/{example-project-a,benchmark-gaming-llm-safety}/hpc/.
- Checkpointing: Save intermediate results to allow resume on crash
- Dual output: Dated archive + "latest" symlink for quick access (see
references/experiment-patterns.md)
For multi-agent simulations, also include:
- Agent composition: Heterogeneous population specs with distribution presets (uniform, weighted, custom)
- Feature toggles: Opt-in capabilities per agent type (memory, messaging) — enables ablation studies
- Messaging service: Round-based broadcast channel for inter-agent communication
- Multi-level metrics: Agent-level (individual performance) + system-level (aggregate outcomes) + emergent-level (herding, convergence)
See references/multi-agent-patterns.md for all multi-agent patterns.
Read references/experiment-patterns.md for config, sweep, and runner patterns.
Gate: Run a smoke test — single config, single seed, verify output files are created.
Phase 3E: Explore Loop (Adaptive Experiments)
Use instead of Phase 3 when: The design space is unknown, the user wants to adaptively search rather than run a pre-specified sweep, or the user says "explore", "try things", "see what works".
Read references/explore-loop.md for the full protocol. Summary:
- Branch: Create
experiments/<tag> branch (e.g. experiments/mar14-collusion-params)
- Baseline: Run the code as-is, record baseline metric in
results.tsv
- Loop (autonomous until interrupted or budget exhausted):
- Propose a modification based on results so far (informed by prior keep/discard outcomes)
- Apply the change to the target file(s)
git commit the change
- Run with time budget:
timeout <budget>s uv run python <script> > run.log 2>&1
- Extract metric from output
- Log to
results.tsv: commit hash, metric, status (keep/discard/crash), description
- If improved → keep (advance branch)
- If not improved → discard (
git reset --hard HEAD~1)
- If crashed → attempt fix once, else discard and move on
- Stop when: user interrupts,
--budget time exhausted (campaign-level), per-run timeout exceeded, or N consecutive discards with no progress
Key principles:
- One change per iteration — never stack multiple untested changes
- Log every attempt, including discards and crashes
- The TSV is the ground truth — it captures the full exploration history
- Simplicity criterion: prefer changes that simplify the code for equal or better metrics
Gate: results.tsv exists with at least a baseline entry before entering the loop.
Phase 3A: Autonomous Sweep (Parallel Self-Correcting)
Use instead of Phase 3 when: 10+ configs, known failure-prone experiments, or user says "autonomous", "hands-off", "self-correcting sweep".
Read references/autonomous-sweep.md for the full protocol. Summary:
- Batch configs into groups of max 4 parallel agents
- Spawn sub-agents — each runs its batch, detects failures by signature (shape mismatch, NaN, empty array, timeout), diagnoses, fixes, retries (max 3 cycles)
- Aggregate results — coordinator collects batch results, reports success/fixed/unresolved counts
- Generate figures for all successful configs
Key constraints:
- Max 4 parallel agents
- Max 3 retry cycles per config
- Agents must not modify shared code simultaneously
- Each fix is committed for traceability
Graceful degradation: If some batches fail while others succeed, collect all successful results and report failures. Only stop entirely if ALL batches fail. See shared/skill-design-patterns.md (Graceful Degradation section).
Gate: At least one config must succeed. If all fail, report the unresolved errors and stop.
Breadcrumb: After any Phase 3 variant completes, append to .planning/state.md (if exists) or .context/current-focus.md:
### [computational-experiments] Experiments complete [YYYY-MM-DD HH:MM]
- **Done:** [N configs run, N seeds, mode: experiment/explore/autonomous]
- **Outputs:** [result files at <path>, N successful / N total]
- **Next:** Publication output (figures/tables)
Phase 4: Publication Output
Prerequisite: Result files exist in results/ or experiments/results/.
- Convergence plots: Metric vs iteration/budget (mean ± std across seeds, multiple methods)
- Comparison charts: Bar chart or table comparing methods across problems
- Ablation plots: Performance with/without each component (for multi-agent: use feature toggle ablation configs)
- Sensitivity analysis: Metric vs parameter (line plot with shaded confidence band)
- Tables: Performance tables exported as
.tex via \input{} — never hard-code results
- Figure script:
scripts/make_all_figures.py that regenerates all figures from saved results
Read references/figure-recipes.md for matplotlib recipes.
Output routing:
- Figures →
paper/figures/ as PDF (per overleaf-separation rule)
- Tables →
paper/tables/ as .tex (per no-hardcoded-results rule)
- Figure scripts →
scripts/ (never inside paper/)
Phase 5: Audit & Save
- Reproducibility check:
- Seed determinism: same config + seed → same output?
- Config completeness: can results be regenerated from saved configs?
- Output freshness: are figures newer than their source data?
- Dependency pinning: are versions locked in
pyproject.toml or uv.lock?
- Code review: Invoke the
code-review agent on all generated scripts (via skill-routing mechanism)
- Record learnings: Write
[LEARN:code] tags for project-specific conventions discovered
- Suggest next steps: compilation with
latex, additional experiments, replication-package
Breadcrumb: After Phase 5 completes, append to .planning/state.md (if exists) or .context/current-focus.md:
### [computational-experiments] Phase 5 complete [YYYY-MM-DD HH:MM]
- **Done:** [reproducibility check, code review score, N learn tags recorded]
- **Outputs:** [figures at <path>, tables at <path>]
- **Next:** [suggested next steps]
Evolution Protocol
This skill improves with each invocation on a project:
- Before work: Read
MEMORY.md for existing [LEARN:code] entries and Key Decisions
- During work: Note any convention, naming pattern, or structural choice that should persist
- After work: Record
[LEARN:code] tags and update Key Decisions table
Examples of learnings to capture:
[LEARN:code] This project uses ElicitationConfig dataclass, not YAML files
[LEARN:code] Metrics are in src/utils/metrics.py, not a separate package
[LEARN:code] Seeds are managed via utils/seeds.py with MASTER_SEED + offset
Cross-References
| Resource |
When read |
references/package-scaffold.md |
Phase 2 (project structure) |
references/algorithm-templates.md |
Phase 2 (skeleton code) |
references/experiment-patterns.md |
Phase 3 (configs, sweeps, runners, config hashing, dual output) |
references/multi-agent-patterns.md |
Phase 2–3 (agent composition, messaging, multi-level metrics) |
references/multi-agent-infrastructure.md |
Phase 2–3 (feature toggles, config hashing, simulation runner, visualization) |
references/explore-loop.md |
Phase 3E (adaptive explore loop) |
references/autonomous-sweep.md |
Phase 3A (parallel self-correcting sweep) |
references/figure-recipes.md |
Phase 4 (matplotlib recipes) |
shared/publication-output.md |
Phase 4 (table/figure format standards) |
shared/multi-language-conventions.md |
Phase 1 (if non-Python) |
docs/guides/hpc.md (Task Management) |
Phase 3 (move to Avon for large/GPU/long sweeps) |
templates/slurm/*.sbatch (Task Management) |
Phase 3 (drop-in SLURM templates; all log git-SHA to OUT_DIR) |
no-hardcoded-results rule |
Phase 4 (output routing) |
overleaf-separation rule |
Phase 4 (file placement) |
the code-review agent |
Phase 5 (auto-invoked) |
data-analysis skill |
Redirect if task is empirical, not computational |
replication-package skill |
Phase 5 (suggested next step) |
cross-language-check skill |
Phase 5 (suggested next step for verification) |
references/multi-analyst-design.md |
Phase 3–5 (many-analysts robustness diagnostic) |
shared/worker-critic-protocol.md |
Phase 3–4 (inline review of generated code/results) |
shared/checkpoint-resumability.md |
All phases (save/resume on crash) |
templates/experiments/standard.md |
--scaffold standard (init/tune/creative/ablate) |
templates/experiments/robustness.md |
--scaffold robustness (econometrics robustness) |
templates/experiments/replication.md |
--scaffold replication (replicate-and-extend) |
figure-feedback skill |
Phase 4 (VLM analysis of generated plots) |
1---2name: computational-experiments3description: "Scaffold, execute, analyse, and publish computational research experiments through a reproducible staged workflow. Use when a research question requires simulations or computational sweeps rather than a one-off script."4allowed-tools: Bash(uv*, pytest*, mkdir*, ls*, cp*), Read, Write, Edit, Glob, Grep, AskUserQuestion, Skill5argument-hint: "[project-path] [--mode scaffold|experiment|figures|full] [--budget <minutes>] [--scaffold standard|robustness|replication]"6agent-dependencies: [code-review]7skill-dependencies: [multi-perspective]8---910# Computational Experiments1112> Lifecycle skill for algorithmic research projects where the code IS the scientific contribution.1314## Modes1516| Mode | What it does | Phases |17|------|-------------|--------|18| **Scaffold** | Create/audit package structure + algorithm skeleton | 1–2 |19| **Experiment** | Design and run pre-specified sweep campaigns | 1, 3–4 |20| **Explore** | Adaptive experiment loop: modify → run → evaluate → keep/discard | 1, 3E–4 |21| **Autonomous** | Parallel self-correcting sweep with sub-agents | 1, 3A–4 |22| **Figures** | Generate publication output from results | 1, 4 |23| **Full** | Complete pipeline | 1–5 |2425Default: **Full**. Detect mode from user request or ask if ambiguous.2627### `--scaffold` Flag2829Sets a **stage progression template** for the experiment campaign. Templates provide structured checklists and exit criteria for each stage.3031| Scaffold | Stages | Best for |32|----------|--------|----------|33| `standard` | Init → Tune → Creative → Ablate | Algorithm development, ML, simulation |34| `robustness` | Main spec → Alternatives → Placebo → Sensitivity | Causal inference, econometrics |35| `replication` | Exact → Our data → Extensions → Robustness | Replicate-and-extend papers |3637Templates live in `templates/experiments/`. When a scaffold is active:381. Present the current stage's checklist before starting work392. Gate progression: don't move to the next stage until exit criteria are met403. Log stage transitions in the experiment breadcrumb4142Default (no flag): user-defined stages (current behavior). Scaffold is a guide, not a cage — users can skip stages or reorder with explicit acknowledgment.4344### `--budget` Flag4546Sets a **campaign-level time budget** in minutes for the entire experiment run. When set:47481. **Record start time** at the beginning of Phase 3 (any variant)492. **Check remaining budget** before launching each new config, sweep batch, or explore iteration503. **Soft stop** when budget is exhausted: finish the current run, save all results collected so far, skip remaining configs514. **Never hard-kill** a running experiment mid-execution — always let the current run complete5253| Mode | How budget applies |54|------|-------------------|55| **Experiment** | Skip remaining sweep configs when time is up |56| **Explore** | Exit the explore loop at the next iteration boundary |57| **Autonomous** | Do not spawn new agent batches; let running batches finish |58| **Figures** | Budget does not apply (figure generation is fast) |5960**Reporting:** When a budget triggers early stop, append to the breadcrumb:61```62- **Budget:** Stopped after <N>/<M> configs (budget: <X> min, elapsed: <Y> min)63```6465**Default:** No budget (run all configs to completion). Typical values: `--budget 30` for quick exploration, `--budget 120` for overnight sweeps.6667Use **Experiment** when the design space is known upfront (grid/random sweep). Use **Explore** when the design space is unknown and the agent should adaptively search (inspired by Karpathy's [autoresearch](https://github.com/karpathy/autoresearch)).6869## When to Use7071- "Set up experiments for my algorithm" / "Scaffold the project"72- "Run the benchmark" / "Design the sweep"73- "Explore what auction parameters reduce collusion" / "Try different architectures"74- "Generate convergence plots" / "Make publication figures from results"75- Any project where algorithms, simulations, or optimisation loops are the contribution7677## When NOT to Use7879- Empirical data analysis (observational/survey data) → `data-analysis`80- Experimental design for human subjects → `experiment-design`81- Causal inference strategy → `causal-design`82- LaTeX compilation → `latex`8384## Workflow8586### Phase 1: Detect & Configure87881. **Read project context:** `CLAUDE.md`, `MEMORY.md`, `.context/project-recap.md` if they exist892. **Detect structure:** Scan for `src/`, `experiments/`, `tests/`, `pyproject.toml`, `setup.py`903. **Detect language:** Check existing files. Default: Python with uv. Ask if ambiguous.914. **Read MEMORY.md:** Look for `[LEARN:code]` tags, notation registry, key decisions — apply established conventions925. **Determine mode:** From user request or ask. If existing package exists, skip scaffold.936. **Inventory existing code:** Map modules, entry points, config objects, result files9495Read `references/package-scaffold.md` if scaffold mode is active.9697### Phase 2: Scaffold9899**Skip if:** Package structure already exists and user requested experiment/figures mode.1001011. **Package structure:** Create `src/<pkg>/`, `tests/`, `experiments/configs/`, `scripts/`1022. **Build config:** `pyproject.toml` with hatchling, dev dependencies (pytest, matplotlib, numpy)1033. **Algorithm skeleton:** Base classes (`Algorithm`, `Experiment`, `Metric`) with `# TODO:` markers. For multi-agent projects, use `BaseAgent`, `Environment`, `MultiAgentSimulation` instead — see `references/multi-agent-patterns.md`1044. **Test skeleton:** Unit test stubs, convergence test template, smoke test1055. **Experiment infrastructure:** Config dataclass template, runner script template1066. **Gitignore:** Add `results/`, `*.pkl`, `wandb/`, `__pycache__/`107108Read `references/algorithm-templates.md` for skeleton code. Read `references/package-scaffold.md` for directory layout.109110**Gate:** Verify package installs with `uv pip install -e ".[dev]"` before proceeding.111112### Phase 3: Experiment Design113114**Prerequisite:** Working package (Phase 2 or pre-existing).1151161. **Config schema:** Python dataclass with validation, defaults, serialization to/from YAML1172. **Config hashing:** SHA-256 fingerprint for reproducibility tracking (see `references/experiment-patterns.md`)1183. **Sweep definitions:** Grid sweep (all combinations), random sweep (budget-limited), manual configs1194. **Seed management:** `np.random.default_rng(seed)` everywhere. Seeds passed through config, never global state.1205. **Runner script:** Config → initialize → loop → collect → save. Reads config, runs `n_seeds` repetitions, saves per-seed results.1216. **Baseline implementations:** Same interface as main algorithm, registered in config1227. **Result aggregation:** Per-seed CSV → aggregated stats (mean ± std). Canonical column naming.1238. **Parallelization:** `concurrent.futures.ProcessPoolExecutor` for independent seeds/configs. **For large sweeps (10+ configs × 10+ seeds, GPU-bound, or >30-min runs):** move to [HPC cluster] HPC — see [`docs/guides/hpc.md`](../../docs/guides/hpc.md) in Task Management and copy `templates/slurm/{array,gpu}.sbatch` into `hpc/` with `sync-up.sh` / `sync-down.sh`. Recent reference implementations: `Projects/NLP/{example-project-a,benchmark-gaming-llm-safety}/hpc/`.1249. **Checkpointing:** Save intermediate results to allow resume on crash12510. **Dual output:** Dated archive + "latest" symlink for quick access (see `references/experiment-patterns.md`)126127**For multi-agent simulations, also include:**12812911. **Agent composition:** Heterogeneous population specs with distribution presets (uniform, weighted, custom)13012. **Feature toggles:** Opt-in capabilities per agent type (memory, messaging) — enables ablation studies13113. **Messaging service:** Round-based broadcast channel for inter-agent communication13214. **Multi-level metrics:** Agent-level (individual performance) + system-level (aggregate outcomes) + emergent-level (herding, convergence)133134See `references/multi-agent-patterns.md` for all multi-agent patterns.135136Read `references/experiment-patterns.md` for config, sweep, and runner patterns.137138**Gate:** Run a smoke test — single config, single seed, verify output files are created.139140### Phase 3E: Explore Loop (Adaptive Experiments)141142**Use instead of Phase 3 when:** The design space is unknown, the user wants to adaptively search rather than run a pre-specified sweep, or the user says "explore", "try things", "see what works".143144Read `references/explore-loop.md` for the full protocol. Summary:1451461. **Branch:** Create `experiments/<tag>` branch (e.g. `experiments/mar14-collusion-params`)1472. **Baseline:** Run the code as-is, record baseline metric in `results.tsv`1483. **Loop** (autonomous until interrupted or budget exhausted):149 - Propose a modification based on results so far (informed by prior keep/discard outcomes)150 - Apply the change to the target file(s)151 - `git commit` the change152 - Run with time budget: `timeout <budget>s uv run python <script> > run.log 2>&1`153 - Extract metric from output154 - Log to `results.tsv`: commit hash, metric, status (keep/discard/crash), description155 - If improved → **keep** (advance branch)156 - If not improved → **discard** (`git reset --hard HEAD~1`)157 - If crashed → attempt fix once, else discard and move on1584. **Stop when:** user interrupts, `--budget` time exhausted (campaign-level), per-run timeout exceeded, or N consecutive discards with no progress159160**Key principles:**161- One change per iteration — never stack multiple untested changes162- Log every attempt, including discards and crashes163- The TSV is the ground truth — it captures the full exploration history164- Simplicity criterion: prefer changes that simplify the code for equal or better metrics165166**Gate:** `results.tsv` exists with at least a baseline entry before entering the loop.167168### Phase 3A: Autonomous Sweep (Parallel Self-Correcting)169170**Use instead of Phase 3 when:** 10+ configs, known failure-prone experiments, or user says "autonomous", "hands-off", "self-correcting sweep".171172Read `references/autonomous-sweep.md` for the full protocol. Summary:1731741. **Batch configs** into groups of max 4 parallel agents1752. **Spawn sub-agents** — each runs its batch, detects failures by signature (shape mismatch, NaN, empty array, timeout), diagnoses, fixes, retries (max 3 cycles)1763. **Aggregate results** — coordinator collects batch results, reports success/fixed/unresolved counts1774. **Generate figures** for all successful configs178179**Key constraints:**180- Max 4 parallel agents181- Max 3 retry cycles per config182- Agents must not modify shared code simultaneously183- Each fix is committed for traceability184185**Graceful degradation:** If some batches fail while others succeed, collect all successful results and report failures. Only stop entirely if ALL batches fail. See `shared/skill-design-patterns.md` (Graceful Degradation section).186187**Gate:** At least one config must succeed. If all fail, report the unresolved errors and stop.188189**Breadcrumb:** After any Phase 3 variant completes, append to `.planning/state.md` (if exists) or `.context/current-focus.md`:190```191### [computational-experiments] Experiments complete [YYYY-MM-DD HH:MM]192- **Done:** [N configs run, N seeds, mode: experiment/explore/autonomous]193- **Outputs:** [result files at <path>, N successful / N total]194- **Next:** Publication output (figures/tables)195```196197### Phase 4: Publication Output198199**Prerequisite:** Result files exist in `results/` or `experiments/results/`.2002011. **Convergence plots:** Metric vs iteration/budget (mean ± std across seeds, multiple methods)2022. **Comparison charts:** Bar chart or table comparing methods across problems2033. **Ablation plots:** Performance with/without each component (for multi-agent: use feature toggle ablation configs)2044. **Sensitivity analysis:** Metric vs parameter (line plot with shaded confidence band)2055. **Tables:** Performance tables exported as `.tex` via `\input{}` — **never hard-code results**2066. **Figure script:** `scripts/make_all_figures.py` that regenerates all figures from saved results207208Read `references/figure-recipes.md` for matplotlib recipes.209210**Output routing:**211- Figures → `paper/figures/` as PDF (per `overleaf-separation` rule)212- Tables → `paper/tables/` as `.tex` (per `no-hardcoded-results` rule)213- Figure scripts → `scripts/` (never inside `paper/`)214215### Phase 5: Audit & Save2162171. **Reproducibility check:**218 - Seed determinism: same config + seed → same output?219 - Config completeness: can results be regenerated from saved configs?220 - Output freshness: are figures newer than their source data?221 - Dependency pinning: are versions locked in `pyproject.toml` or `uv.lock`?2222. **Code review:** Invoke the `code-review` agent on all generated scripts (via skill-routing mechanism)2233. **Record learnings:** Write `[LEARN:code]` tags for project-specific conventions discovered2244. **Suggest next steps:** compilation with `latex`, additional experiments, `replication-package`225226**Breadcrumb:** After Phase 5 completes, append to `.planning/state.md` (if exists) or `.context/current-focus.md`:227```228### [computational-experiments] Phase 5 complete [YYYY-MM-DD HH:MM]229- **Done:** [reproducibility check, code review score, N learn tags recorded]230- **Outputs:** [figures at <path>, tables at <path>]231- **Next:** [suggested next steps]232```233234## Evolution Protocol235236This skill improves with each invocation on a project:2372381. **Before work:** Read `MEMORY.md` for existing `[LEARN:code]` entries and Key Decisions2392. **During work:** Note any convention, naming pattern, or structural choice that should persist2403. **After work:** Record `[LEARN:code]` tags and update Key Decisions table241242Examples of learnings to capture:243- `[LEARN:code] This project uses ElicitationConfig dataclass, not YAML files`244- `[LEARN:code] Metrics are in src/utils/metrics.py, not a separate package`245- `[LEARN:code] Seeds are managed via utils/seeds.py with MASTER_SEED + offset`246247## Cross-References248249| Resource | When read |250|----------|-----------|251| `references/package-scaffold.md` | Phase 2 (project structure) |252| `references/algorithm-templates.md` | Phase 2 (skeleton code) |253| `references/experiment-patterns.md` | Phase 3 (configs, sweeps, runners, config hashing, dual output) |254| `references/multi-agent-patterns.md` | Phase 2–3 (agent composition, messaging, multi-level metrics) |255| `references/multi-agent-infrastructure.md` | Phase 2–3 (feature toggles, config hashing, simulation runner, visualization) |256| `references/explore-loop.md` | Phase 3E (adaptive explore loop) |257| `references/autonomous-sweep.md` | Phase 3A (parallel self-correcting sweep) |258| `references/figure-recipes.md` | Phase 4 (matplotlib recipes) |259| `shared/publication-output.md` | Phase 4 (table/figure format standards) |260| `shared/multi-language-conventions.md` | Phase 1 (if non-Python) |261| `docs/guides/hpc.md` (Task Management) | Phase 3 (move to Avon for large/GPU/long sweeps) |262| `templates/slurm/*.sbatch` (Task Management) | Phase 3 (drop-in SLURM templates; all log git-SHA to OUT_DIR) |263| `no-hardcoded-results` rule | Phase 4 (output routing) |264| `overleaf-separation` rule | Phase 4 (file placement) |265| the `code-review` agent | Phase 5 (auto-invoked) |266| `data-analysis` skill | Redirect if task is empirical, not computational |267| `replication-package` skill | Phase 5 (suggested next step) |268| `cross-language-check` skill | Phase 5 (suggested next step for verification) |269| `references/multi-analyst-design.md` | Phase 3–5 (many-analysts robustness diagnostic) |270| `shared/worker-critic-protocol.md` | Phase 3–4 (inline review of generated code/results) |271| `shared/checkpoint-resumability.md` | All phases (save/resume on crash) |272| `templates/experiments/standard.md` | `--scaffold standard` (init/tune/creative/ablate) |273| `templates/experiments/robustness.md` | `--scaffold robustness` (econometrics robustness) |274| `templates/experiments/replication.md` | `--scaffold replication` (replicate-and-extend) |275| `figure-feedback` skill | Phase 4 (VLM analysis of generated plots) |