opencode-autoresearch 3.3.0 → 3.4.0
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.
- package/.opencode/INSTALL.md +85 -0
- package/.opencode-plugin/plugin.json +2 -2
- package/AGENTS.md +29 -27
- package/INSTALL.md +275 -0
- package/README.md +122 -34
- package/VERSION +1 -1
- package/dist/cli.js +8 -8
- package/dist/cli.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/helpers.d.ts +6 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +77 -4
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -1
- package/dist/run-manager.d.ts.map +1 -1
- package/dist/run-manager.js +6 -6
- package/dist/run-manager.js.map +1 -1
- package/dist/wizard.d.ts.map +1 -1
- package/dist/wizard.js +4 -3
- package/dist/wizard.js.map +1 -1
- package/docs/ARCHITECTURE.md +54 -9
- package/docs/OPENCODE_INSTALL.md +80 -19
- package/docs/QUICKSTART.md +145 -0
- package/docs/RELEASE.md +16 -15
- package/hooks/status.sh +14 -12
- package/hooks/stop.sh +47 -13
- package/hooks/verify-package.sh +36 -3
- package/package.json +25 -5
- package/plugins/autoresearch.ts +7 -0
- package/skills/hermes/INTEGRATION.md +156 -0
- package/skills/hermes/README.md +159 -0
- package/skills/hermes/autoresearch-prompt.md +270 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Installing Auto Research for OpenCode
|
|
2
|
+
|
|
3
|
+
For the public raw install handoff, see [`../INSTALL.md`](../INSTALL.md).
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- [OpenCode.ai](https://opencode.ai) installed
|
|
8
|
+
|
|
9
|
+
## Recommended: OpenCode Plugin Install
|
|
10
|
+
|
|
11
|
+
Add Auto Research to the `plugin` array in your global or project-level `opencode.json`:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"plugin": ["opencode-autoresearch@latest"]
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Restart OpenCode. OpenCode installs npm plugins automatically and registers the Auto Research commands.
|
|
20
|
+
|
|
21
|
+
Verify inside OpenCode by running:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
/autoresearch
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Optional: Global CLI Install
|
|
28
|
+
|
|
29
|
+
Install the CLI globally if you also want `autoresearch` and `opencode-autoresearch` on your shell `PATH`:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install -g opencode-autoresearch
|
|
33
|
+
opencode-autoresearch doctor
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
For one-time use without a global install:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx opencode-autoresearch doctor
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Commands
|
|
43
|
+
|
|
44
|
+
After installation, these commands are available in OpenCode:
|
|
45
|
+
|
|
46
|
+
- `/autoresearch`
|
|
47
|
+
- `/autoresearch:plan`
|
|
48
|
+
- `/autoresearch:debug`
|
|
49
|
+
- `/autoresearch:fix`
|
|
50
|
+
- `/autoresearch:learn`
|
|
51
|
+
- `/autoresearch:predict`
|
|
52
|
+
- `/autoresearch:scenario`
|
|
53
|
+
- `/autoresearch:security`
|
|
54
|
+
- `/autoresearch:ship`
|
|
55
|
+
|
|
56
|
+
## Updating
|
|
57
|
+
|
|
58
|
+
OpenCode refreshes npm plugins when it starts. The `opencode-autoresearch@latest` plugin entry follows the current npm `latest` release. Restart OpenCode after changing `opencode.json` or after a new Auto Research package release is published.
|
|
59
|
+
|
|
60
|
+
To pin a version:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"plugin": ["opencode-autoresearch@3.3.3"]
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Troubleshooting
|
|
69
|
+
|
|
70
|
+
### Plugin not loading
|
|
71
|
+
|
|
72
|
+
1. Verify the package name in `opencode.json` is `opencode-autoresearch`.
|
|
73
|
+
2. Restart OpenCode after editing config.
|
|
74
|
+
3. Check OpenCode logs with `opencode run --print-logs "hello"`.
|
|
75
|
+
|
|
76
|
+
### CLI not found
|
|
77
|
+
|
|
78
|
+
1. Run `npm install -g opencode-autoresearch`.
|
|
79
|
+
2. Verify your npm global bin directory is on `PATH`.
|
|
80
|
+
3. Run `opencode-autoresearch doctor`.
|
|
81
|
+
|
|
82
|
+
## Getting Help
|
|
83
|
+
|
|
84
|
+
- Issues: https://github.com/Maleick/AutoResearch/issues
|
|
85
|
+
- Documentation: https://github.com/Maleick/AutoResearch#readme
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autoresearch",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Auto Research for OpenCode. Run a structured autonomous iteration loop with a standing subagent pool.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Maleick",
|
|
@@ -34,4 +34,4 @@
|
|
|
34
34
|
"termsOfServiceURL": "https://github.com/Maleick/AutoResearch/blob/main/LICENSE",
|
|
35
35
|
"brandColor": "#0F766E"
|
|
36
36
|
}
|
|
37
|
-
}
|
|
37
|
+
}
|
package/AGENTS.md
CHANGED
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
# Auto Research Agent Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Project Purpose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Auto Research is an OpenCode and Hermes Agent workflow bundle plus npm package for structured autonomous improve-verify loops.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- The iteration engine is subagent-first: a standing pool of specialized subagents supports the orchestrator.
|
|
9
|
-
- Mechanical verification is mandatory — no keep decisions on intuition alone.
|
|
10
|
-
- Background runs support overnight unattended operation.
|
|
7
|
+
## Source of Truth
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
- Runtime source lives in `src/`.
|
|
10
|
+
- OpenCode commands live in `commands/`.
|
|
11
|
+
- The Auto Research skill bundle lives in `skills/autoresearch/`.
|
|
12
|
+
- The Hermes Agent skill bundle and integration docs live in `skills/hermes/`.
|
|
13
|
+
- Shell hooks live in `hooks/`.
|
|
14
|
+
- OpenCode package metadata lives in `.opencode-plugin/plugin.json`.
|
|
15
|
+
- Installation, architecture, and release docs live in `docs/` and `wiki/`.
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
## Development Rules
|
|
18
|
+
|
|
19
|
+
- Build context from existing files before changing behavior.
|
|
20
|
+
- Prefer the smallest correct change.
|
|
21
|
+
- Do not commit, tag, push, create releases, or publish packages unless the user explicitly asks.
|
|
22
|
+
- Do not commit runtime artifacts from `.autoresearch/` or generated result files.
|
|
23
|
+
- Keep `VERSION`, `package.json`, `package-lock.json`, `src/constants.ts`, and `.opencode-plugin/plugin.json` aligned for releases.
|
|
24
|
+
- When Hermes cron, `delegate_task`, model routing, or install behavior changes, keep `README.md`, `INSTALL.md`, `docs/`, `wiki/`, and `skills/hermes/` aligned.
|
|
25
|
+
|
|
26
|
+
## Security Rules
|
|
27
|
+
|
|
28
|
+
- Do not add install flows that pipe remote scripts into a shell.
|
|
29
|
+
- Keep package contents guarded by `hooks/verify-package.sh`.
|
|
30
|
+
- Do not hardcode secrets, tokens, credentials, or private paths.
|
|
31
|
+
- Pass shell variables into inline scripts through environment variables or argv, not by interpolating into source code.
|
|
15
32
|
|
|
16
33
|
## Verification
|
|
17
34
|
|
|
18
|
-
|
|
35
|
+
Run the focused relevant checks before claiming work is complete. Release-prep changes should run:
|
|
19
36
|
|
|
20
37
|
```bash
|
|
38
|
+
npm audit --audit-level=moderate
|
|
21
39
|
npm run typecheck
|
|
22
40
|
npm run build
|
|
23
41
|
npm run verify:pack
|
|
42
|
+
npm test
|
|
43
|
+
npm pack --dry-run
|
|
24
44
|
```
|
|
25
|
-
|
|
26
|
-
## Self-Improvement
|
|
27
|
-
|
|
28
|
-
Auto Research can run on itself. See `skills/autoresearch/references/self-improve-loop.md` for recursive loop semantics.
|
|
29
|
-
|
|
30
|
-
When running self-improvement:
|
|
31
|
-
|
|
32
|
-
1. Define a measurable meta-goal.
|
|
33
|
-
2. Use `--mode background` for long runs.
|
|
34
|
-
3. Always set a `--guard` command to catch regressions.
|
|
35
|
-
4. Review `autoresearch-memory.md` between meta-iterations.
|
|
36
|
-
|
|
37
|
-
## Docs
|
|
38
|
-
|
|
39
|
-
- [README.md](README.md) — Product overview
|
|
40
|
-
- [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) — Architecture reference
|
|
41
|
-
- [docs/RELEASE.md](docs/RELEASE.md) — Release process
|
|
42
|
-
- [wiki/Home.md](wiki/Home.md) — Wiki index
|
package/INSTALL.md
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# Install Auto Research
|
|
2
|
+
|
|
3
|
+
Auto Research is a multi-runtime plugin and npm package for structured autonomous improve-verify loops. It keeps runtime state local to the target repository and gates changes with mechanical verification.
|
|
4
|
+
|
|
5
|
+
## Supported Runtimes
|
|
6
|
+
|
|
7
|
+
- **OpenCode** — Slash commands (`/autoresearch`) with standing subagent pool
|
|
8
|
+
- **Hermes Agent** — Cron-based iteration loop with `delegate_task` subagents (max 3)
|
|
9
|
+
|
|
10
|
+
Both runtimes share the same state format (`.autoresearch/state.json`) and CLI (`opencode-autoresearch`).
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## OpenCode Install
|
|
15
|
+
|
|
16
|
+
### One-Line OpenCode Install
|
|
17
|
+
|
|
18
|
+
Paste this one line into OpenCode to install and verify Auto Research. This URL follows the latest `main` instructions:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
Fetch and follow instructions from https://raw.githubusercontent.com/Maleick/AutoResearch/refs/heads/main/INSTALL.md
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Prerequisites
|
|
25
|
+
|
|
26
|
+
- OpenCode installed and available in your shell.
|
|
27
|
+
- Node.js with npm available for the optional CLI path.
|
|
28
|
+
- Git installed and available in your shell.
|
|
29
|
+
- A target repository with a verification command such as `npm test`, `pytest`, or `go test ./...`.
|
|
30
|
+
|
|
31
|
+
### Recommended OpenCode Plugin Install
|
|
32
|
+
|
|
33
|
+
Add Auto Research to your global or project-level `opencode.json` plugin array:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"plugin": ["opencode-autoresearch@latest"]
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Restart OpenCode after editing the configuration. The command family should then be available inside your target repository:
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
/autoresearch
|
|
45
|
+
/autoresearch:plan
|
|
46
|
+
/autoresearch:debug
|
|
47
|
+
/autoresearch:fix
|
|
48
|
+
/autoresearch:learn
|
|
49
|
+
/autoresearch:predict
|
|
50
|
+
/autoresearch:scenario
|
|
51
|
+
/autoresearch:security
|
|
52
|
+
/autoresearch:ship
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### npm Global Install
|
|
56
|
+
|
|
57
|
+
If you also want the CLI available on your shell `PATH`:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install -g opencode-autoresearch
|
|
61
|
+
opencode-autoresearch doctor
|
|
62
|
+
opencode-autoresearch --version
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Then restart OpenCode and run:
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
/autoresearch
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### One-Time CLI Path
|
|
72
|
+
|
|
73
|
+
For one-time CLI use without a global install:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npx opencode-autoresearch doctor
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Use the plugin-array install for normal OpenCode usage.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Hermes Agent Install
|
|
84
|
+
|
|
85
|
+
### Prerequisites
|
|
86
|
+
|
|
87
|
+
- Hermes Agent installed and configured.
|
|
88
|
+
- Node.js with npm available for the CLI path.
|
|
89
|
+
- Git installed and available in your shell.
|
|
90
|
+
|
|
91
|
+
### Install the Hermes Skill
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# 1. Clone AutoResearch (or use an existing checkout)
|
|
95
|
+
git clone https://github.com/Maleick/AutoResearch.git
|
|
96
|
+
cd AutoResearch
|
|
97
|
+
npm install
|
|
98
|
+
|
|
99
|
+
# 2. Copy skill files to your Hermes skills directory
|
|
100
|
+
mkdir -p ~/.hermes/skills/software-development/autoresearch
|
|
101
|
+
cp skills/hermes/autoresearch-prompt.md ~/.hermes/skills/software-development/autoresearch/SKILL.md
|
|
102
|
+
cp skills/hermes/INTEGRATION.md ~/.hermes/skills/software-development/autoresearch/REFERENCES.md
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Create the Cronjob
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
hermes cron create \
|
|
109
|
+
--name "autoresearch-loop" \
|
|
110
|
+
--workdir ~/projects/AutoResearch \
|
|
111
|
+
--skill autoresearch-hermes \
|
|
112
|
+
"every 15m" \
|
|
113
|
+
"Run AutoResearch iteration loop. Detect phase from .autoresearch/state.json and execute one phase. Approved verify command: `npm run test:coverage`. Approved guard command: `npm run typecheck`."
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Initialize a Run
|
|
117
|
+
|
|
118
|
+
Initialize state from a trusted shell before enabling unattended cron:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
autoresearch init \
|
|
122
|
+
--goal "Improve test coverage" \
|
|
123
|
+
--metric "coverage_pct" \
|
|
124
|
+
--direction "higher" \
|
|
125
|
+
--verify "npm run test:coverage" \
|
|
126
|
+
--guard "npm run typecheck" \
|
|
127
|
+
--iterations 20 \
|
|
128
|
+
--mode background
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Do not rely on cron to auto-init from repository config; the Hermes skill treats repository commands as untrusted unless they match operator-approved cron commands.
|
|
132
|
+
|
|
133
|
+
### Start, Check, and Stop
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Start
|
|
137
|
+
hermes cron resume autoresearch-loop
|
|
138
|
+
|
|
139
|
+
# Check status
|
|
140
|
+
cat .autoresearch/state.json | jq .
|
|
141
|
+
|
|
142
|
+
# Stop
|
|
143
|
+
hermes cron pause autoresearch-loop
|
|
144
|
+
# Or set stop flag:
|
|
145
|
+
jq '.flags.stop_requested = true' .autoresearch/state.json > tmp.json && mv tmp.json .autoresearch/state.json
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
See [`skills/hermes/README.md`](skills/hermes/README.md) for full Hermes setup, troubleshooting, and command mapping.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Verification
|
|
153
|
+
|
|
154
|
+
These checks do not require secrets:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npm view opencode-autoresearch version
|
|
158
|
+
npm view opencode-autoresearch dist-tags
|
|
159
|
+
opencode-autoresearch doctor
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
For a local clone:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npm install
|
|
166
|
+
npm run build
|
|
167
|
+
npm run typecheck
|
|
168
|
+
npm run verify:pack
|
|
169
|
+
npm test
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
To verify command availability:
|
|
173
|
+
|
|
174
|
+
- **OpenCode**: restart OpenCode in a Git repository and run `/autoresearch`.
|
|
175
|
+
- **Hermes**: run `hermes cron list` and confirm `autoresearch-loop` is present.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Updating
|
|
180
|
+
|
|
181
|
+
### OpenCode
|
|
182
|
+
|
|
183
|
+
For plugin-array installs, `opencode-autoresearch@latest` follows the current npm `latest` release. Restart OpenCode after a new Auto Research package release is available. To pin a fixed version instead:
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"plugin": ["opencode-autoresearch@3.3.3"]
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
For npm global installs:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
npm install -g opencode-autoresearch@latest
|
|
195
|
+
npm list -g opencode-autoresearch --depth=0
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Hermes
|
|
199
|
+
|
|
200
|
+
Update the skill files from the latest repo checkout:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
cd AutoResearch
|
|
204
|
+
git pull origin main
|
|
205
|
+
cp skills/hermes/autoresearch-prompt.md ~/.hermes/skills/software-development/autoresearch/SKILL.md
|
|
206
|
+
cp skills/hermes/INTEGRATION.md ~/.hermes/skills/software-development/autoresearch/REFERENCES.md
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Restart the cronjob if needed:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
hermes cron resume autoresearch-loop
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Troubleshooting
|
|
218
|
+
|
|
219
|
+
### Plugin Not Loading (OpenCode)
|
|
220
|
+
|
|
221
|
+
- Confirm `opencode.json` is valid JSON.
|
|
222
|
+
- Confirm the plugin entry is in the top-level `plugin` array.
|
|
223
|
+
- Restart OpenCode after changing the config.
|
|
224
|
+
- Check OpenCode logs with `opencode run --print-logs "hello"`.
|
|
225
|
+
|
|
226
|
+
### Commands Not Found (OpenCode)
|
|
227
|
+
|
|
228
|
+
- Restart OpenCode so it reloads plugin commands.
|
|
229
|
+
- Confirm the package installed successfully with `npm list -g opencode-autoresearch --depth=0` if using the global path.
|
|
230
|
+
- Run `/autoresearch` from inside a Git repository, not from an empty directory.
|
|
231
|
+
|
|
232
|
+
### Cron Not Running (Hermes)
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
hermes cron list
|
|
236
|
+
hermes logs --component cron
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### State File Corrupted (any runtime)
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Reset to baseline
|
|
243
|
+
rm .autoresearch/state.json
|
|
244
|
+
# Next run will re-init from config
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Subagent Failures (Hermes)
|
|
248
|
+
|
|
249
|
+
Check `.autoresearch/state.json` for:
|
|
250
|
+
- `flags.needs_human` — requires manual intervention
|
|
251
|
+
- Last iteration's `error` field
|
|
252
|
+
|
|
253
|
+
### Runtime Artifacts
|
|
254
|
+
|
|
255
|
+
- Auto Research writes runtime state to `.autoresearch/` in the target repository.
|
|
256
|
+
- Do not commit `.autoresearch/`, `autoresearch-results.tsv`, `autoresearch-report.md`, or `autoresearch-memory.md` unless you intentionally want to share run outputs.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Safety Notes
|
|
261
|
+
|
|
262
|
+
- Start with a measurable goal, metric, and verification command.
|
|
263
|
+
- Review generated reports before relying on unattended background runs.
|
|
264
|
+
- Keep verification mechanical; do not accept improvements based on intuition alone.
|
|
265
|
+
- Do not pipe remote install scripts into a shell.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Links
|
|
270
|
+
|
|
271
|
+
- Documentation: https://github.com/Maleick/AutoResearch/tree/main/docs
|
|
272
|
+
- Wiki: https://github.com/Maleick/AutoResearch/wiki
|
|
273
|
+
- Releases: https://github.com/Maleick/AutoResearch/releases
|
|
274
|
+
- Issues: https://github.com/Maleick/AutoResearch/issues
|
|
275
|
+
- Hermes docs: https://hermes-agent.nousresearch.com/docs
|