opencode-autoresearch 3.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/.opencode-plugin/plugin.json +37 -0
  2. package/LICENSE +21 -0
  3. package/README.md +74 -0
  4. package/commands/autoresearch/debug.md +23 -0
  5. package/commands/autoresearch/fix.md +21 -0
  6. package/commands/autoresearch/learn.md +21 -0
  7. package/commands/autoresearch/plan.md +25 -0
  8. package/commands/autoresearch/predict.md +21 -0
  9. package/commands/autoresearch/scenario.md +21 -0
  10. package/commands/autoresearch/security.md +21 -0
  11. package/commands/autoresearch/ship.md +22 -0
  12. package/commands/autoresearch.md +45 -0
  13. package/dist/cli.d.ts +3 -0
  14. package/dist/cli.d.ts.map +1 -0
  15. package/dist/cli.js +202 -0
  16. package/dist/cli.js.map +1 -0
  17. package/dist/constants.d.ts +13 -0
  18. package/dist/constants.d.ts.map +1 -0
  19. package/dist/constants.js +13 -0
  20. package/dist/constants.js.map +1 -0
  21. package/dist/helpers.d.ts +19 -0
  22. package/dist/helpers.d.ts.map +1 -0
  23. package/dist/helpers.js +137 -0
  24. package/dist/helpers.js.map +1 -0
  25. package/dist/index.d.ts +4 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +3 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/run-manager.d.ts +9 -0
  30. package/dist/run-manager.d.ts.map +1 -0
  31. package/dist/run-manager.js +239 -0
  32. package/dist/run-manager.js.map +1 -0
  33. package/dist/subagent-pool.d.ts +7 -0
  34. package/dist/subagent-pool.d.ts.map +1 -0
  35. package/dist/subagent-pool.js +101 -0
  36. package/dist/subagent-pool.js.map +1 -0
  37. package/dist/types.d.ts +129 -0
  38. package/dist/types.d.ts.map +1 -0
  39. package/dist/types.js +2 -0
  40. package/dist/types.js.map +1 -0
  41. package/dist/wizard.d.ts +3 -0
  42. package/dist/wizard.d.ts.map +1 -0
  43. package/dist/wizard.js +56 -0
  44. package/dist/wizard.js.map +1 -0
  45. package/docs/ARCHITECTURE.md +88 -0
  46. package/docs/CNAME +1 -0
  47. package/docs/OPENCODE_INSTALL.md +48 -0
  48. package/docs/RELEASE.md +67 -0
  49. package/docs/autoresearch-loop.svg +95 -0
  50. package/docs/index.html +249 -0
  51. package/hooks/init.sh +21 -0
  52. package/hooks/status.sh +23 -0
  53. package/hooks/stop.sh +27 -0
  54. package/package.json +49 -0
  55. package/skills/autoresearch/SKILL.md +77 -0
  56. package/skills/autoresearch/references/core-principles.md +20 -0
  57. package/skills/autoresearch/references/debug-workflow.md +31 -0
  58. package/skills/autoresearch/references/fix-workflow.md +25 -0
  59. package/skills/autoresearch/references/interaction-wizard.md +33 -0
  60. package/skills/autoresearch/references/learn-workflow.md +15 -0
  61. package/skills/autoresearch/references/loop-workflow.md +35 -0
  62. package/skills/autoresearch/references/plan-workflow.md +42 -0
  63. package/skills/autoresearch/references/predict-workflow.md +15 -0
  64. package/skills/autoresearch/references/results-logging.md +29 -0
  65. package/skills/autoresearch/references/runtime-hard-invariants.md +13 -0
  66. package/skills/autoresearch/references/scenario-workflow.md +15 -0
  67. package/skills/autoresearch/references/security-workflow.md +15 -0
  68. package/skills/autoresearch/references/ship-workflow.md +15 -0
  69. package/skills/autoresearch/references/state-management.md +39 -0
  70. package/skills/autoresearch/references/structured-output-spec.md +34 -0
  71. package/skills/autoresearch/references/subagent-orchestration.md +42 -0
@@ -0,0 +1,249 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Auto Research</title>
7
+ <style>
8
+ :root {
9
+ --bg: #09111a;
10
+ --panel: rgba(15, 23, 42, 0.76);
11
+ --ink: #e5f4f0;
12
+ --muted: #95b8b0;
13
+ --line: rgba(148, 163, 184, 0.18);
14
+ --accent: #14b8a6;
15
+ --accent-2: #7dd3fc;
16
+ }
17
+
18
+ * {
19
+ box-sizing: border-box;
20
+ }
21
+
22
+ body {
23
+ margin: 0;
24
+ font-family: "IBM Plex Sans", "Avenir Next", sans-serif;
25
+ color: var(--ink);
26
+ background:
27
+ radial-gradient(circle at top left, rgba(20, 184, 166, 0.18), transparent 28rem),
28
+ radial-gradient(circle at bottom right, rgba(125, 211, 252, 0.14), transparent 26rem),
29
+ linear-gradient(180deg, #071018 0%, #0b1320 100%);
30
+ }
31
+
32
+ main {
33
+ max-width: 1040px;
34
+ margin: 0 auto;
35
+ padding: 64px 24px 96px;
36
+ }
37
+
38
+ .hero,
39
+ .panel {
40
+ border: 1px solid var(--line);
41
+ background: var(--panel);
42
+ backdrop-filter: blur(14px);
43
+ border-radius: 24px;
44
+ box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
45
+ }
46
+
47
+ .hero {
48
+ padding: 40px;
49
+ }
50
+
51
+ .eyebrow {
52
+ text-transform: uppercase;
53
+ letter-spacing: 0.14em;
54
+ font-size: 0.76rem;
55
+ color: var(--accent-2);
56
+ }
57
+
58
+ h1, h2 {
59
+ margin: 0 0 16px;
60
+ font-family: "IBM Plex Serif", Georgia, serif;
61
+ font-weight: 600;
62
+ }
63
+
64
+ h1 {
65
+ font-size: clamp(2.8rem, 6vw, 4.6rem);
66
+ line-height: 0.95;
67
+ }
68
+
69
+ p {
70
+ margin: 0 0 16px;
71
+ color: var(--muted);
72
+ line-height: 1.6;
73
+ }
74
+
75
+ .hero-grid,
76
+ .grid {
77
+ display: grid;
78
+ gap: 24px;
79
+ }
80
+
81
+ .hero-grid {
82
+ grid-template-columns: 1.5fr 1fr;
83
+ align-items: center;
84
+ }
85
+
86
+ .grid {
87
+ grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
88
+ margin-top: 24px;
89
+ }
90
+
91
+ .panel {
92
+ padding: 24px;
93
+ }
94
+
95
+ code,
96
+ pre {
97
+ font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
98
+ }
99
+
100
+ pre {
101
+ margin: 0;
102
+ padding: 16px;
103
+ border-radius: 16px;
104
+ background: rgba(9, 17, 26, 0.8);
105
+ overflow-x: auto;
106
+ border: 1px solid rgba(148, 163, 184, 0.12);
107
+ }
108
+
109
+ a {
110
+ color: var(--ink);
111
+ }
112
+
113
+ .links {
114
+ display: flex;
115
+ flex-wrap: wrap;
116
+ gap: 14px;
117
+ margin-top: 20px;
118
+ }
119
+
120
+ .links a {
121
+ text-decoration: none;
122
+ border-bottom: 1px solid transparent;
123
+ }
124
+
125
+ .links a:hover {
126
+ border-color: var(--accent);
127
+ }
128
+
129
+ table {
130
+ width: 100%;
131
+ border-collapse: collapse;
132
+ margin-top: 12px;
133
+ }
134
+
135
+ th,
136
+ td {
137
+ text-align: left;
138
+ padding: 12px 0;
139
+ border-bottom: 1px solid var(--line);
140
+ vertical-align: top;
141
+ }
142
+
143
+ .section {
144
+ margin-top: 28px;
145
+ }
146
+
147
+ .accent {
148
+ color: var(--accent);
149
+ }
150
+
151
+ img.diagram {
152
+ width: 100%;
153
+ border-radius: 18px;
154
+ border: 1px solid var(--line);
155
+ background: rgba(7, 16, 24, 0.84);
156
+ }
157
+
158
+ @media (max-width: 820px) {
159
+ .hero-grid {
160
+ grid-template-columns: 1fr;
161
+ }
162
+
163
+ main {
164
+ padding-top: 32px;
165
+ }
166
+
167
+ .hero {
168
+ padding: 28px;
169
+ }
170
+ }
171
+ </style>
172
+ </head>
173
+ <body>
174
+ <main>
175
+ <section class="hero">
176
+ <div class="hero-grid">
177
+ <div>
178
+ <div class="eyebrow">Subagent-First Autonomous Iteration &mdash; OpenCode</div>
179
+ <h1>Auto <span class="accent">Research</span></h1>
180
+ <p>Auto Research is a subagent-first autonomous iteration engine for OpenCode. It keeps the stable <code>/autoresearch</code> command family, adds mode-specific workflows, and ships as an npm package.</p>
181
+ <div class="links">
182
+ <a href="https://github.com/Maleick/AutoResearch">GitHub</a>
183
+ <a href="https://github.com/Maleick/AutoResearch/releases">Releases</a>
184
+ <a href="https://github.com/Maleick/AutoResearch/issues">Issues</a>
185
+ <a href="https://github.com/Maleick/AutoResearch/blob/main/README.md">README</a>
186
+ </div>
187
+ </div>
188
+ <div class="panel">
189
+ <p><strong>OpenCode install</strong></p>
190
+ <pre><code>npm install -g opencode-autoresearch
191
+ opencode-autoresearch doctor</code></pre>
192
+ <p class="section"><strong>CLI commands</strong></p>
193
+ <pre><code>autoresearch init --goal "..." --verify "npm test"
194
+ autoresearch status
195
+ autoresearch stop
196
+ autoresearch resume
197
+ autoresearch complete</code></pre>
198
+ </div>
199
+ </div>
200
+ </section>
201
+
202
+ <section class="grid">
203
+ <article class="panel">
204
+ <h2>Runtime</h2>
205
+ <table>
206
+ <tr><th>Surface</th><th>Entry point</th></tr>
207
+ <tr><td>OpenCode</td><td><code>/autoresearch*</code></td></tr>
208
+ <tr><td>CLI</td><td><code>autoresearch</code></td></tr>
209
+ </table>
210
+ </article>
211
+ <article class="panel">
212
+ <h2>Source Layout</h2>
213
+ <pre><code>src/
214
+ commands/
215
+ skills/autoresearch/
216
+ hooks/
217
+ docs/
218
+ .opencode-plugin/</code></pre>
219
+ </article>
220
+ <article class="panel">
221
+ <h2>Package</h2>
222
+ <pre><code>npm install -g opencode-autoresearch</code></pre>
223
+ <p>Node.js ESM. TypeScript runtime. No Python in the shipped artifact.</p>
224
+ </article>
225
+ </section>
226
+
227
+ <section class="section">
228
+ <img class="diagram" src="autoresearch-loop.svg" alt="Auto Research loop diagram">
229
+ </section>
230
+
231
+ <section class="grid section">
232
+ <article class="panel">
233
+ <h2>Core Loop</h2>
234
+ <p>Baseline once, make one focused experiment, verify mechanically, keep strict improvements, discard regressions, record the outcome, and continue until the stop condition is met.</p>
235
+ </article>
236
+ <article class="panel">
237
+ <h2>Artifacts</h2>
238
+ <table>
239
+ <tr><th>Artifact</th><th>Purpose</th></tr>
240
+ <tr><td><code>.autoresearch/state.json</code></td><td>Run checkpoint</td></tr>
241
+ <tr><td><code>autoresearch-results.tsv</code></td><td>Iteration log</td></tr>
242
+ <tr><td><code>autoresearch-report.md</code></td><td>End-of-run report</td></tr>
243
+ <tr><td><code>autoresearch-memory.md</code></td><td>Reusable memory</td></tr>
244
+ </table>
245
+ </article>
246
+ </section>
247
+ </main>
248
+ </body>
249
+ </html>
package/hooks/init.sh ADDED
@@ -0,0 +1,21 @@
1
+ #!/bin/sh
2
+ # SessionStart hook for Auto Research
3
+ # Reads the current run state and emits a checklist if a managed run is active.
4
+
5
+ set -e
6
+
7
+ checklist() {
8
+ echo "Auto Research checklist:"
9
+ echo "- If this is a fresh managed run, baseline first, then initialize results/state artifacts."
10
+ echo "- Record every completed experiment before starting the next one."
11
+ echo "- Keep retain/stop label gates satisfied before marking an iteration as kept."
12
+ echo "- Respect iteration and duration caps."
13
+ echo "- After launch approval, continue by default unless the user stops the run."
14
+ }
15
+
16
+ if [ -f ".autoresearch/state.json" ]; then
17
+ status=$(node -e "try{const s=require('.autoresearch/state.json');console.log(s.status||'')}catch{e}''" 2>/dev/null || true)
18
+ if [ "$status" = "running" ] || [ "$status" = "initialized" ]; then
19
+ checklist
20
+ fi
21
+ fi
@@ -0,0 +1,23 @@
1
+ #!/bin/sh
2
+ # Status hook for Auto Research
3
+ # Prints current run status from the state file.
4
+
5
+ set -e
6
+
7
+ STATUS_FILE="${AUTORESEARCH_STATE:-.autoresearch/state.json}"
8
+
9
+ if [ -f "$STATUS_FILE" ]; then
10
+ node -e "
11
+ const s = require('$STATUS_FILE');
12
+ console.log('Auto Research run: ' + s.run_id);
13
+ console.log('Status: ' + s.status);
14
+ console.log('Mode: ' + s.mode);
15
+ console.log('Goal: ' + s.goal);
16
+ console.log('Iterations: ' + s.stats.total_iterations);
17
+ console.log('Kept: ' + s.stats.kept + ' | Discarded: ' + s.stats.discarded);
18
+ if (s.flags.needs_human) console.log('NEEDS HUMAN');
19
+ if (s.flags.stop_requested) console.log('STOP REQUESTED');
20
+ " 2>/dev/null || echo "No active run."
21
+ else
22
+ echo "No active run."
23
+ fi
package/hooks/stop.sh ADDED
@@ -0,0 +1,27 @@
1
+ #!/bin/sh
2
+ # Stop hook for Auto Research
3
+ # Marks the background run as stopping if one is active.
4
+
5
+ set -e
6
+
7
+ STATUS_FILE="${AUTORESEARCH_STATE:-.autoresearch/state.json}"
8
+
9
+ if [ -f "$STATUS_FILE" ]; then
10
+ mode=$(node -e "try{const s=require('$STATUS_FILE');console.log(s.mode||'')}catch{e}''" 2>/dev/null || true)
11
+ if [ "$mode" = "background" ]; then
12
+ node -e "
13
+ const fs = require('fs');
14
+ const s = JSON.parse(fs.readFileSync('$STATUS_FILE','utf8'));
15
+ s.updated_at = new Date().toISOString();
16
+ s.flags.stop_requested = true;
17
+ s.flags.background_active = false;
18
+ s.status = 'stopping';
19
+ fs.writeFileSync('$STATUS_FILE', JSON.stringify(s, null, 2) + '\n');
20
+ console.log('Stop requested for run: ' + s.run_id);
21
+ " 2>/dev/null || echo "Could not update state."
22
+ else
23
+ echo "Only background runs can be stopped."
24
+ fi
25
+ else
26
+ echo "No active run."
27
+ fi
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "opencode-autoresearch",
3
+ "version": "3.1.0-beta.2",
4
+ "description": "Auto Research for OpenCode. Subagent-first autonomous iteration loop with standing-pool orchestration and mechanical verification.",
5
+ "author": {
6
+ "name": "Maleick",
7
+ "url": "https://github.com/Maleick"
8
+ },
9
+ "homepage": "https://github.com/Maleick/AutoResearch",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/Maleick/AutoResearch.git"
13
+ },
14
+ "license": "MIT",
15
+ "keywords": [
16
+ "opencode",
17
+ "plugin",
18
+ "autoresearch",
19
+ "automation",
20
+ "workflows"
21
+ ],
22
+ "type": "module",
23
+ "main": "dist/index.js",
24
+ "bin": {
25
+ "autoresearch": "dist/cli.js"
26
+ },
27
+ "files": [
28
+ "dist/",
29
+ "commands/",
30
+ "skills/",
31
+ "hooks/",
32
+ "docs/",
33
+ ".opencode-plugin/"
34
+ ],
35
+ "scripts": {
36
+ "build": "tsc",
37
+ "typecheck": "tsc --noEmit",
38
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
39
+ "pack": "npm pack --dry-run",
40
+ "lint": "echo 'TODO: add lint'"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^20.0.0",
44
+ "typescript": "^5.9.3"
45
+ },
46
+ "engines": {
47
+ "node": ">=18.0.0"
48
+ }
49
+ }
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: autoresearch
3
+ 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."
4
+ metadata:
5
+ short-description: "Subagent-first autonomous iteration loop for OpenCode"
6
+ ---
7
+
8
+ # Auto Research for OpenCode
9
+
10
+ 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.
11
+
12
+ ## Activation Contract
13
+
14
+ When invoked:
15
+
16
+ 1. Read `references/core-principles.md`
17
+ 2. Read `references/structured-output-spec.md`
18
+ 3. Read `references/subagent-orchestration.md`
19
+ 4. For new interactive runs, read `references/interaction-wizard.md`, `references/plan-workflow.md`, and `references/loop-workflow.md`
20
+ 5. For state and results semantics, read `references/state-management.md` and `references/results-logging.md`
21
+ 6. For specialized modes, read the matching workflow reference:
22
+ - `references/debug-workflow.md`
23
+ - `references/fix-workflow.md`
24
+ - `references/learn-workflow.md`
25
+ - `references/predict-workflow.md`
26
+ - `references/scenario-workflow.md`
27
+ - `references/security-workflow.md`
28
+ - `references/ship-workflow.md`
29
+
30
+ ## Subagent-First Orchestration
31
+
32
+ The main agent is the orchestrator. Subagents are the standing execution pool.
33
+
34
+ - Keep a small, persistent subagent pool alive across iterations.
35
+ - Use subagents for bounded context gathering, alternative generation, verification, and critique.
36
+ - Feed subagent findings back into the next iteration before making another code change.
37
+ - The main agent owns the final decision, the edit, and the run state.
38
+ - Approval belongs before launch. After launch, continue by default unless the user stops the run.
39
+
40
+ ## Required Internal Fields
41
+
42
+ Infer or confirm before launching:
43
+
44
+ - **Goal** — What outcome should this run optimize?
45
+ - **Metric** — What numeric metric tracks progress?
46
+ - **Direction** — `lower` or `higher`
47
+ - **Verify** — The mechanical command that measures the metric
48
+
49
+ Strongly recommended:
50
+
51
+ - **Run Mode** — `foreground` or `background`
52
+ - **Scope** — In-scope files or subsystem
53
+ - **Guard** — Optional guard command for regression catch
54
+
55
+ ## Execution Rules
56
+
57
+ 1. Always read relevant in-scope files before the first write.
58
+ 2. Baseline exactly once at run start.
59
+ 3. Make one focused experiment per iteration.
60
+ 4. Verify mechanically. Do not keep on intuition alone.
61
+ 5. Record every iteration before the next one starts.
62
+ 6. Keep strict improvements, discard regressions.
63
+ 7. Continue until the stop condition is met.
64
+
65
+ ## Background Control
66
+
67
+ ```bash
68
+ autoresearch init --goal "..." --metric "..." --direction "lower" --verify "npm test"
69
+ autoresearch status
70
+ autoresearch stop
71
+ autoresearch resume
72
+ autoresearch complete
73
+ ```
74
+
75
+ ## Output
76
+
77
+ 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.
@@ -0,0 +1,20 @@
1
+ # Core Principles
2
+
3
+ The loop exists to make disciplined progress, not noisy activity.
4
+
5
+ ## Principles
6
+
7
+ - Work toward a metric that can be checked mechanically.
8
+ - Prefer one reversible change over a large speculative rewrite.
9
+ - Keep a guard when the target metric does not capture regression risk.
10
+ - Record every completed experiment in the same format.
11
+ - Change tactics when repeated experiments fail.
12
+ - Treat blockers explicitly instead of silently stalling.
13
+
14
+ ## Artifact Discipline
15
+
16
+ - `autoresearch-state.json` is the current run snapshot.
17
+ - `research-results.tsv` is the append-only experiment log.
18
+ - `autoresearch-launch.json` is the last background launch request.
19
+
20
+ Only helper scripts should mutate these files when possible.
@@ -0,0 +1,31 @@
1
+ # Debug Workflow
2
+
3
+ Use this when the user wants investigation before repair.
4
+
5
+ ## Goal
6
+
7
+ Produce evidence-backed findings, not speculative guesses.
8
+
9
+ ## Loop
10
+
11
+ 1. Read the suspected files and any failing output.
12
+ 2. Form one falsifiable hypothesis.
13
+ 3. Test that hypothesis mechanically.
14
+ 4. Prove or disprove it with concrete evidence.
15
+ 5. Record the finding with file references and impact.
16
+ 6. Repeat with the next best hypothesis if more iterations remain.
17
+
18
+ ## Output Shape
19
+
20
+ Each finding should capture:
21
+
22
+ - title
23
+ - file reference
24
+ - severity or impact
25
+ - hypothesis
26
+ - evidence
27
+ - likely fix direction
28
+
29
+ ## Handoff
30
+
31
+ When the user wants repair after debugging, switch to the fix workflow and use the logged findings to choose the next experiment.
@@ -0,0 +1,25 @@
1
+ # Fix Workflow
2
+
3
+ Use this when the user wants autoresearch to repair a concrete failing command or breakage pattern.
4
+
5
+ ## Goal
6
+
7
+ Reduce the count of known failures to zero or to the best verified lower value.
8
+
9
+ ## Loop
10
+
11
+ 1. Run the target command to capture the current failures.
12
+ 2. Pick one error cluster to address.
13
+ 3. Read only the relevant files for that cluster before editing.
14
+ 4. Make one focused fix.
15
+ 5. Run the target command again.
16
+ 6. Run the guard command if configured.
17
+ 7. Keep the change only if the error count strictly improves and the guard passes.
18
+ 8. Record the result before the next attempt.
19
+
20
+ ## Rules
21
+
22
+ - Prefer one-file or one-concern fixes.
23
+ - Do not mix cleanup with repair.
24
+ - If the same error path fails repeatedly, change strategy instead of retrying the same idea.
25
+ - Stop when the failures hit zero, the iteration cap is reached, or the run needs human input.
@@ -0,0 +1,33 @@
1
+ # Interaction Wizard
2
+
3
+ Use this contract for every new interactive run.
4
+
5
+ ## Minimum Questions
6
+
7
+ Confirm or infer:
8
+
9
+ 1. What outcome matters most?
10
+ 2. What scope is actually in play?
11
+ 3. How should progress be measured?
12
+ 4. What command verifies the target metric?
13
+ 5. Is there a guard command that must continue to pass?
14
+ 6. Should the run stay in `foreground` or move to `background`?
15
+ 7. Which standing subagent pool should stay active for the run?
16
+
17
+ Use `python scripts/autoresearch_wizard.py` to build the first setup summary, then only ask about fields that are still missing or risky.
18
+
19
+ ## Launch Rule
20
+
21
+ Do not start a new interactive loop until the user has had one chance to correct the setup summary and explicitly approve launch.
22
+
23
+ Treat that approval as one-time launch authorization. After launch, continue by default unless the stop condition is met, the user stops the run, or a real blocker requires human input.
24
+
25
+ ## After Launch
26
+
27
+ Once the user approves the launch, keep going until:
28
+
29
+ - the stop condition is met
30
+ - the user stops the run
31
+ - the loop reaches a real blocker that requires human input
32
+
33
+ Do not ask for repeated launch approval on every iteration. Re-anchor the current plan, findings, and subagent assignments instead.
@@ -0,0 +1,15 @@
1
+ # Learn Workflow
2
+
3
+ Use this when the user wants autoresearch to map, explain, or document a codebase area.
4
+
5
+ ## Goal
6
+
7
+ Iteratively improve repository understanding and documentation quality with mechanical checks where possible.
8
+
9
+ ## Loop
10
+
11
+ 1. Define the documentation target and scope.
12
+ 2. Read the relevant code and existing docs.
13
+ 3. Draft or revise one focused section.
14
+ 4. Verify against available checks such as tests, examples, lint, or consistency review.
15
+ 5. Keep only changes that improve clarity without breaking the checks.
@@ -0,0 +1,35 @@
1
+ # Loop Workflow
2
+
3
+ ## Phase 1: Setup
4
+
5
+ 1. Read the relevant code and repo configuration.
6
+ 2. Read `references/subagent-orchestration.md` so the standing subagent pool and task split are clear before the first iteration.
7
+ 3. Generate the initial setup summary with `scripts/autoresearch_wizard.py` when the request is incomplete.
8
+ 4. Summarize the goal, scope, metric, direction, verify command, guard, and subagent plan.
9
+ 5. Ask one grounded clarification round if needed.
10
+ 6. Initialize artifacts with `scripts/autoresearch_init_run.py`.
11
+
12
+ ## Phase 2: Iterate
13
+
14
+ For each iteration:
15
+
16
+ 1. Re-state the goal, scope, metric, verify command, and current subagent assignments.
17
+ 2. Use the standing subagent pool to gather context, challenge the leading hypothesis, and surface verification gaps.
18
+ 3. Make one focused change.
19
+ 4. Run verify and guard commands.
20
+ 5. Feed subagent findings back into the next iteration plan.
21
+ 6. Keep or discard the experiment.
22
+ 7. Record the outcome with `scripts/autoresearch_record_iteration.py`.
23
+
24
+ ## Phase 3: Decide
25
+
26
+ Stop when:
27
+
28
+ - the configured goal is met
29
+ - the user requests stop
30
+ - the iteration cap is reached
31
+ - the run genuinely needs human input
32
+
33
+ Once the user approves launch, continue by default until one of those stop conditions is true. Do not restart the approval cycle on every pass; re-anchor the same standing pool and keep iterating.
34
+
35
+ Background supervisors should use `scripts/autoresearch_supervisor_status.py` to make the relaunch decision from the same artifacts.
@@ -0,0 +1,42 @@
1
+ # Plan Workflow
2
+
3
+ Use this when the user invokes `/autoresearch:plan` without a complete setup or explicitly asks for a wizard.
4
+
5
+ ## Goal
6
+
7
+ Turn a vague request into a launch-ready setup summary with:
8
+
9
+ - goal
10
+ - scope
11
+ - metric
12
+ - direction
13
+ - verify command
14
+ - optional guard
15
+ - run mode
16
+ - stop condition
17
+
18
+ ## Steps
19
+
20
+ 1. Read the repo before asking anything.
21
+ 2. Infer defaults where the repo makes them obvious.
22
+ 3. Generate the setup summary with `python scripts/autoresearch_wizard.py`.
23
+ 4. Ask only the missing or risky questions.
24
+ 5. Let the user correct the setup once before launch.
25
+ 6. If the user approves, initialize artifacts and start the loop.
26
+
27
+ ## Question Priorities
28
+
29
+ Ask these in order when missing:
30
+
31
+ 1. Outcome: what should improve?
32
+ 2. Scope: what files or subsystem are in play?
33
+ 3. Metric: what number or count tracks progress?
34
+ 4. Verify: what command measures it mechanically?
35
+ 5. Guard: what command must keep passing?
36
+ 6. Mode: `foreground` or `background`?
37
+
38
+ ## Defaults
39
+
40
+ - If the repo has `pytest.ini` or a `tests/` directory, default `verify` to `pytest`.
41
+ - If the repo contains `scripts/autoresearch_supervisor_status.py`, offer it as the default guard.
42
+ - Default metric direction to `lower` unless the user clearly wants to maximize a score.
@@ -0,0 +1,15 @@
1
+ # Predict Workflow
2
+
3
+ Use this when the user wants pre-mortem analysis, design critique, or ranked risks before editing.
4
+
5
+ ## Goal
6
+
7
+ Surface likely failure modes and tradeoffs from multiple concrete angles.
8
+
9
+ ## Steps
10
+
11
+ 1. Define the scope and question being analyzed.
12
+ 2. Generate a small set of reviewer lenses such as correctness, performance, security, maintainability, and DX.
13
+ 3. Evaluate the same code through each lens.
14
+ 4. Rank findings by severity and confidence.
15
+ 5. If the user wants action, hand the top findings into debug or fix mode.