From spml
Verifies base code readiness and generates research protocol for automated iteration after validation passes. Use after VP passes to set up autonomous exploration loop.
How this skill is triggered — by the user, by Claude, or both
Slash command
/spml:autoresearch-handoffThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Bridge between VP validation and automated research iteration. Generates `autoresearch-protocol.md` + `experiences.md` for base code that has already been built and validated.
Bridge between VP validation and automated research iteration. Generates autoresearch-protocol.md + experiences.md for base code that has already been built and validated.
Core principle: Do not rewrite VP-validated code. Handoff verifies readiness, extracts the protocol, and sets up the iteration loop.
Do NOT hand off without: 1. VP L1 Runtime Validation passed — mandatory for autoresearch. If skipped, STOP and run it now. 2. Design doc contains "## Autoresearch Protocol" sectionprofile_command runs (Step 4.5)kernel_targets non-empty, validate parity machinery on baseline (Step 4.6)Confirm VP L1 passed. Record the evaluation metric as the protocol's baseline value.
Check that the first step/epoch prints quickly on single GPU. This is the most important precondition for autoresearch — every round pays the cost of baseline speed. If the first step takes too long, the baseline must be fixed before entering the loop (smaller data, lighter model, faster I/O). Do NOT proceed to handoff with a slow baseline.
Check that time_limit and epoch_limit termination logic exists and works (VP L1 already ran under these conditions).
Core principle: eval must be a pre-defined, deterministic script — not agent-generated code.
Run the eval_command independently (outside of any training context) to verify:
If the eval script doesn't meet these criteria, fix it NOW before entering the loop. The eval script is the source of truth for the entire autoresearch loop — if it's broken or ambiguous, every round's result is unreliable.
Confirm the eval_command is listed in Fixed.files in the protocol. If not, add it.
profile_command empty in design doc)The design doc may contain a profile_command (collected by ml-brainstorming Q6 when metric_category == performance). Validate it runs against the baseline before writing the protocol:
cd <experiment_dir>
<profile_command>
Requirements: exit code 0; stdout non-empty (at least one kernel/op timing line).
If the design doc's profile_command was recorded as TODO: build in VP L1 (user did not have one at brainstorming time), STOP the handoff and tell the user:
"Build phase did not produce a
profile_command. Add one to the design doc (and commit it to the experiment) before re-running handoff. We can't enter the iteration loop without a runnable profile command for perf-mode research."
If the command exists but exits non-zero, STOP and tell the user the exact error from stderr; ask them to fix profile_command and re-run handoff.
kernel_targets empty in design doc)For each declared kernel target:
Resolve new_module — check the file exists in the experiment tree. If absent, STOP and tell the user: "create <module_path> as a re-export of <baseline_module> so baseline parity is trivially passable, then re-run handoff."
Run parity dry-run — for each target in the draft protocol's kernel_targets, execute the inline Python heredoc from autoresearch/SKILL.md Step 2 (the parity check block), substituting the target's values and $EXPERIMENT_DIR for the placeholders.
Exit 0 from all targets → parity machinery is wired correctly; proceed. Exit 1 from any target → STOP and tell the user the exact PARITY_FAIL line from stderr. Typical causes: fixture returns wrong-shape inputs, import path typo, malformed tolerance.
This is intentionally a trivial pass — the new kernel is currently a re-export of baseline, so parity is mechanical. The dry-run's purpose is to surface configuration errors at handoff rather than at Round 1, where they would be misattributed to the Researcher.
Extract from design doc's ## Autoresearch Protocol section. Ensure eval_command's script file is included in Fixed.files. Write to <experiment-dir>/autoresearch-protocol.md:
# Autoresearch Protocol: <title>
research_question: <from design doc>
max_rounds: <from design doc>
target: <from design doc, or "none">
baseline: <metric> = <value from VP L1>
## Fixed(不可变:代码 + 条件)
- files: <fixed files from design doc>
- time_limit: <value>
- epoch_limit: <value>
## Variable(可变:代码 + 条件)
- files: <variable files from design doc>
- 可调范围: <from design doc>
## Eval
- metric: <name>
- direction: <maximize / minimize>
- command: <eval_command from design doc>
<!-- Include only if design doc has profile_command -->
## Profile
- command: <profile_command from design doc>
<!-- end Profile -->
<!-- Include only if design doc has kernel_targets non-empty. The yaml fence below is intentional — Supervisor parses kernel_targets from the first ```yaml fence in the file. -->
## Kernel Targets
```yaml
kernel_targets:
- name: <readable name>
new_module: <module:attr>
baseline_module: <module:attr>
fixture: <module:attr>
tolerance: { atol: <float>, rtol: <float> }
# repeat per target
```
<!-- end Kernel Targets -->
Write to <experiment-dir>/experiences.md:
# Experiences
best: {metric} = {baseline_value} (R0)
rounds: 0 / {max_rounds}
status: not_started
| Round | Compliance | Result | Verdict | Strategy | Insight | Note |
|-------|------------|--------|---------|----------|---------|------|
| 0 | ✅ | {baseline_value} | — | baseline: {brief description of baseline config} | initial | {user hints if any} |
git log --oneline -1 # base code committed
Handoff complete:
- Protocol: <experiment-dir>/autoresearch-protocol.md
- Experiences: <experiment-dir>/experiences.md
- Baseline: {metric} = {value}
- Max rounds: {N}
To start — open a new session and say:
run autoresearch at <experiment-dir>
npx claudepluginhub qqhard/superpowers-mlExecutes an Auto Research loop by locating the protocol and starting autonomous iteration. Requires the protocol to exist from the creation flow.
Sets up and runs an autonomous experiment loop for any optimization target. Gathers what to optimize and starts iterating. Triggered by phrases like 'run autoresearch' or 'optimize X in a loop'.
Generates program.md for autonomous AI research experiments (Karpathy's autoresearch). Interviews user on codebase, metrics, constraints; explores code; tailors agent instructions from template.