| name | autoresearch |
| description | Run a subagent-first structured improve-verify loop in OpenCode. Activate with /autoresearch or specialized modes like /autoresearch:plan, /autoresearch:debug, /autoresearch:fix, /autoresearch:learn, /autoresearch:predict, /autoresearch:scenario, /autoresearch:security, /autoresearch:ship. Supports recursive self-improvement loops. |
| metadata | {"short-description":"Subagent-first autonomous iteration loop for OpenCode with recursive self-improvement"} |
Auto Research for OpenCode
Use this skill when the task is larger than a one-shot edit and benefits from repeated experiments with mechanical verification, parallel subagent input, and a main-agent orchestrator that keeps the Auto Research loop moving.
Activation Contract
When invoked:
- Read
references/core-principles.md
- Read
references/structured-output-spec.md
- Read
references/subagent-orchestration.md
- For new interactive runs, read
references/interaction-wizard.md, references/plan-workflow.md, and references/loop-workflow.md
- For state and results semantics, read
references/state-management.md and references/results-logging.md
- For self-improvement and recursive loops, read
references/self-improve-loop.md
- For specialized modes, read the matching workflow reference:
references/debug-workflow.md
references/fix-workflow.md
references/learn-workflow.md
references/predict-workflow.md
references/scenario-workflow.md
references/security-workflow.md
references/ship-workflow.md
Subagent-First Orchestration
The main agent is the orchestrator. Subagents are the standing execution pool.
- Keep a small, persistent subagent pool alive across iterations.
- Use subagents for bounded context gathering, alternative generation, verification, and critique.
- Feed subagent findings back into the next iteration before making another code change.
- The main agent owns the final decision, the edit, and the run state.
- Approval belongs before launch. After launch, continue by default unless the user stops the run.
Recursive Self-Improvement
Auto Research can run on itself:
flowchart TD
A[Meta-Goal] --> B[Child Loop]
B --> C[Evaluate]
C --> D{Improve?}
D -->|yes| E[Learn + Memory]
D -->|no| F[Adapt Strategy]
E --> G[Next Child]
F --> G
G --> B
- Use
references/self-improve-loop.md for recursive run semantics.
- Meta-iterations spawn child loops that inherit the meta-goal.
- Patterns extracted from child results guide strategy adaptation.
- Memory persists across meta-iterations in
autoresearch-memory.md.
Required Internal Fields
Infer or confirm before launching:
- Goal — What outcome should this run optimize?
- Metric — What numeric metric tracks progress?
- Direction —
lower or higher
- Verify — The mechanical command that measures the metric
Strongly recommended:
- Run Mode —
foreground or background
- Scope — In-scope files or subsystem
- Guard — Optional guard command for regression catch
Execution Rules
- Always read relevant in-scope files before the first write.
- Baseline exactly once at run start.
- Make one focused experiment per iteration.
- Verify mechanically. Do not keep on intuition alone.
- Record every iteration before the next one starts.
- Keep strict improvements, discard regressions.
- Continue until the stop condition is met.
- For self-improvement runs, archive state before each meta-iteration.
Background Control
autoresearch init --goal "..." --metric "..." --direction "lower" --verify "npm test"
autoresearch status
autoresearch stop
autoresearch resume
autoresearch complete
Output
Follow references/structured-output-spec.md. Print a setup summary before the first iteration, short progress updates during the loop, and a completion summary when done.
For recursive runs, emit meta-iteration summaries in addition to standard progress.