Autoresearch Prep
Invoke as $autoresearch-prep.
Scaffolds a program.md research program for $autoresearch. Auto-detects benchmark commands, test commands, sandbox boundaries, and exclude patterns from the codebase, then asks the user only what it can't infer: metric command and direction, research directions, and budget.
When to Use
When the user wants to start an $autoresearch loop but doesn't have a program.md yet.
Preconditions
- A git repository with code to optimize
- The user has a measurable property in mind (benchmark, bundle size, test coverage, etc.)
Process
0. Resolve Output Path
- If
$ARGUMENTS is provided and non-empty, use it as the output path.
- Otherwise default to
./program.md.
- If the file already exists, warn the user and ask whether to overwrite or pick a new path.
1. Auto-Detect Codebase Signals
Scan the repository for:
Benchmark commands:
package.json scripts containing bench or benchmark
bench/, benchmarks/, or perf/ directories
Makefile targets: bench, benchmark, perf
- Language-specific:
cargo bench, go test -bench, pytest-benchmark, hyperfine usage
Test commands:
package.json test script
Makefile test target
- Language-specific:
pytest, cargo test, go test, jest, vitest, mocha
Sandbox globs (based on what directories exist):
src/**, lib/**, app/**, pkg/**, internal/**, crates/**
- Include only directories that actually exist in the repo
Exclude patterns:
- Test files:
**/*.test.*, **/*.spec.*, **/test/**, **/tests/**, **/__tests__/**
- Config:
*.config.*, .eslintrc*, tsconfig*, .prettierrc*
- Benchmark harness:
bench/**, benchmarks/**, perf/**
- Build output:
dist/**, build/**, target/**, out/**, .next/**
- Lock files:
package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock, go.sum
- VCS/tooling:
.git/**, node_modules/**, .autoresearch/**
2. Light Interview
Present the detected signals as a summary, then ask:
- Metric command + direction (always required): "What shell command prints your target metric as a single number? Is higher or lower better?"
- Research directions (always required): "What optimization directions should the agent explore? List 2-5 ideas."
- Budget (offer default): "How many iterations? (default: 20)"
If benchmark commands were detected, suggest them as starting points for the metric command.
If test commands were detected, note they'll be included as the test command with required: true.
3. Findings Validation
Show the complete proposed program.md content to the user. Let them confirm or adjust any section before writing.
4. Validate Metric Command
- Run the metric command once from the project root.
- Parse the last number from stdout.
- If the command fails or produces no parseable number, stop and ask the user to fix it.
- Record the parsed value as the baseline for the Context section.
5. Write program.md
Write the file in the exact format expected by $autoresearch:
# Research Program
## Metric
command: <user-provided command>
direction: <higher-is-better | lower-is-better>
## Budget
max_iterations: <user-provided or 20>
## Sandbox
files:
- <detected or user-adjusted globs>
exclude:
- <detected or user-adjusted patterns>
## Test Command
command: <detected test command>
required: true
## Research Directions
1. <direction one>
2. <direction two>
...
## Context
Baseline metric value: <measured value>
<any additional context from interview>
Omit the Test Command section if no test command was detected or provided.
6. Route
Recommended next command: $autoresearch <output-path>
Constraints
- Do not run the autoresearch loop — only scaffold
program.md.
- Do not modify any source files in the repository.
- Do not create the
.autoresearch/ directory.
- Do not create alignment pages.
- Do not follow the shared shipping contract — this skill writes one local file, not tracked repo changes.
1---2name: autoresearch-prep3description: Scaffold a program.md for $autoresearch by auto-detecting codebase signals and interviewing for what can't be inferred4type: planning5version: v0.06invocation: chained7argument-hint: "[output-path]"8context_intake: scoped9metadata:10 source: https://skillmd.com/skills/georgeqle/autoresearch-prep11---1213# Autoresearch Prep1415Invoke as `$autoresearch-prep`.1617Scaffolds a `program.md` research program for `$autoresearch`. Auto-detects benchmark commands, test commands, sandbox boundaries, and exclude patterns from the codebase, then asks the user only what it can't infer: metric command and direction, research directions, and budget.1819## When to Use2021When the user wants to start an `$autoresearch` loop but doesn't have a `program.md` yet.2223## Preconditions2425- A git repository with code to optimize26- The user has a measurable property in mind (benchmark, bundle size, test coverage, etc.)2728## Process2930### 0. Resolve Output Path31321. If `$ARGUMENTS` is provided and non-empty, use it as the output path.332. Otherwise default to `./program.md`.343. If the file already exists, warn the user and ask whether to overwrite or pick a new path.3536### 1. Auto-Detect Codebase Signals3738Scan the repository for:3940**Benchmark commands:**41- `package.json` scripts containing `bench` or `benchmark`42- `bench/`, `benchmarks/`, or `perf/` directories43- `Makefile` targets: `bench`, `benchmark`, `perf`44- Language-specific: `cargo bench`, `go test -bench`, `pytest-benchmark`, `hyperfine` usage4546**Test commands:**47- `package.json` `test` script48- `Makefile` `test` target49- Language-specific: `pytest`, `cargo test`, `go test`, `jest`, `vitest`, `mocha`5051**Sandbox globs** (based on what directories exist):52- `src/**`, `lib/**`, `app/**`, `pkg/**`, `internal/**`, `crates/**`53- Include only directories that actually exist in the repo5455**Exclude patterns:**56- Test files: `**/*.test.*`, `**/*.spec.*`, `**/test/**`, `**/tests/**`, `**/__tests__/**`57- Config: `*.config.*`, `.eslintrc*`, `tsconfig*`, `.prettierrc*`58- Benchmark harness: `bench/**`, `benchmarks/**`, `perf/**`59- Build output: `dist/**`, `build/**`, `target/**`, `out/**`, `.next/**`60- Lock files: `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `Cargo.lock`, `go.sum`61- VCS/tooling: `.git/**`, `node_modules/**`, `.autoresearch/**`6263### 2. Light Interview6465Present the detected signals as a summary, then ask:66671. **Metric command + direction** (always required): "What shell command prints your target metric as a single number? Is higher or lower better?"682. **Research directions** (always required): "What optimization directions should the agent explore? List 2-5 ideas."693. **Budget** (offer default): "How many iterations? (default: 20)"7071If benchmark commands were detected, suggest them as starting points for the metric command.72If test commands were detected, note they'll be included as the test command with `required: true`.7374### 3. Findings Validation7576Show the complete proposed `program.md` content to the user. Let them confirm or adjust any section before writing.7778### 4. Validate Metric Command79801. Run the metric command once from the project root.812. Parse the last number from stdout.823. If the command fails or produces no parseable number, stop and ask the user to fix it.834. Record the parsed value as the baseline for the Context section.8485### 5. Write program.md8687Write the file in the exact format expected by `$autoresearch`:8889```markdown90# Research Program9192## Metric93command: <user-provided command>94direction: <higher-is-better | lower-is-better>9596## Budget97max_iterations: <user-provided or 20>9899## Sandbox100files:101 - <detected or user-adjusted globs>102exclude:103 - <detected or user-adjusted patterns>104105## Test Command106command: <detected test command>107required: true108109## Research Directions1101. <direction one>1112. <direction two>112...113114## Context115Baseline metric value: <measured value>116<any additional context from interview>117```118119Omit the `Test Command` section if no test command was detected or provided.120121### 6. Route122123**Recommended next command:** `$autoresearch <output-path>`124125## Constraints126127- Do not run the autoresearch loop — only scaffold `program.md`.128- Do not modify any source files in the repository.129- Do not create the `.autoresearch/` directory.130- Do not create alignment pages.131- Do not follow the shared shipping contract — this skill writes one local file, not tracked repo changes.