@devlitusp/opencode-agent 0.0.4 → 0.0.6
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/README.md +110 -35
- package/dist/bin/dev-agents.js +5 -5
- package/dist/bin/postinstall.js +8 -9
- package/package.json +1 -1
- package/src/agents/orchestrator.ts +1 -1
- package/src/init.ts +6 -0
- package/src/inject.ts +3 -4
- package/src/types.ts +2 -2
package/README.md
CHANGED
|
@@ -1,19 +1,96 @@
|
|
|
1
1
|
# @devlitusp/opencode-agent
|
|
2
2
|
|
|
3
|
-
Multi-agent development team for [OpenCode CLI](https://opencode.ai).
|
|
3
|
+
Multi-agent development team for [OpenCode CLI](https://opencode.ai). Sets up a full team of AI agents in your project — orchestrator, investigator, planner, builder, QA, security, docs, debugger, performance, devops, and refactorer.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### npm
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install --save-dev @devlitusp/opencode-agent
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
npm runs postinstall scripts automatically. Agents are injected immediately — no extra steps needed.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
### yarn
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
yarn add --dev @devlitusp/opencode-agent
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
yarn runs postinstall scripts automatically. Agents are injected immediately — no extra steps needed.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### bun
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
bun add --dev @devlitusp/opencode-agent
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
bun runs postinstall scripts automatically. Agents are injected immediately — no extra steps needed.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
### pnpm
|
|
38
|
+
|
|
39
|
+
pnpm v10+ **blocks all postinstall scripts by default** for security. You must explicitly allow this package to run its script before installing.
|
|
40
|
+
|
|
41
|
+
**Option A — use `init` (recommended, handles everything automatically):**
|
|
6
42
|
|
|
7
43
|
```bash
|
|
8
44
|
pnpm dlx @devlitusp/opencode-agent init
|
|
9
45
|
```
|
|
10
46
|
|
|
11
|
-
This
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
3. Installs the package and runs the setup automatically
|
|
47
|
+
This adds the package to the allowlist, installs it, and injects the agents in one step.
|
|
48
|
+
|
|
49
|
+
**Option B — `pnpm-workspace.yaml` (pnpm v10.26.0+):**
|
|
15
50
|
|
|
16
|
-
|
|
51
|
+
Add to your `pnpm-workspace.yaml`:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
allowBuilds:
|
|
55
|
+
- "@devlitusp/opencode-agent"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Then install:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pnpm add --save-dev @devlitusp/opencode-agent
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Option C — `package.json`:**
|
|
65
|
+
|
|
66
|
+
Add to your `package.json`:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"pnpm": {
|
|
71
|
+
"onlyBuiltDependencies": ["@devlitusp/opencode-agent"]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Then install:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pnpm add --save-dev @devlitusp/opencode-agent
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Option D — allow all builds (not recommended):**
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pnpm config set dangerouslyAllowAllBuilds true --global
|
|
86
|
+
pnpm add --save-dev @devlitusp/opencode-agent
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
> If you skip the allowlist and install directly with `pnpm add`, the package is added to `devDependencies` but the postinstall is silently skipped — no agents are created. Run `opencode-agent inject` manually afterwards to fix this.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
After installation, set your API key and open OpenCode:
|
|
17
94
|
|
|
18
95
|
```bash
|
|
19
96
|
export MINIMAX_API_KEY=your_key_here # MiniMax (default)
|
|
@@ -26,12 +103,16 @@ export GITHUB_TOKEN=your_token_here # GitHub Copilot
|
|
|
26
103
|
```
|
|
27
104
|
.opencode/agents/
|
|
28
105
|
orchestrator.md ← primary agent, coordinates the team
|
|
29
|
-
investigator.md ←
|
|
106
|
+
investigator.md ← researches libraries and external APIs
|
|
30
107
|
planner.md ← creates implementation plans
|
|
31
108
|
builder.md ← writes the code
|
|
32
109
|
qa.md ← quality assurance and tests
|
|
33
110
|
security.md ← vulnerability scanning (OWASP Top 10)
|
|
34
111
|
docs-writer.md ← JSDoc, README, documentation
|
|
112
|
+
debugger.md ← diagnoses errors and stack traces
|
|
113
|
+
performance.md ← profiles bottlenecks and optimizations
|
|
114
|
+
devops.md ← CI/CD, Docker, infrastructure-as-code
|
|
115
|
+
refactorer.md ← improves code structure without changing behavior
|
|
35
116
|
|
|
36
117
|
opencode.json ← provider config + default_agent
|
|
37
118
|
```
|
|
@@ -41,25 +122,40 @@ opencode.json ← provider config + default_agent
|
|
|
41
122
|
| Agent | Mode | Role |
|
|
42
123
|
|-------|------|------|
|
|
43
124
|
| `orchestrator` | primary | Coordinates the full dev workflow |
|
|
44
|
-
| `investigator` | subagent |
|
|
125
|
+
| `investigator` | subagent | Researches libraries, frameworks, and external APIs |
|
|
45
126
|
| `planner` | subagent | Creates detailed implementation plans |
|
|
46
127
|
| `builder` | subagent | Implements code following the plan |
|
|
47
128
|
| `qa` | subagent | Reviews quality, writes tests |
|
|
48
129
|
| `security` | subagent | Scans for vulnerabilities (pre and post build) |
|
|
49
130
|
| `docs-writer` | subagent | Writes JSDoc, README sections, examples |
|
|
131
|
+
| `debugger` | subagent | Diagnoses errors, analyzes stack traces |
|
|
132
|
+
| `performance` | subagent | Profiles bottlenecks, recommends optimizations |
|
|
133
|
+
| `devops` | subagent | Handles CI/CD, Docker, deployment configs |
|
|
134
|
+
| `refactorer` | subagent | Improves code structure without changing behavior |
|
|
50
135
|
|
|
51
|
-
## Development
|
|
136
|
+
## Development workflows
|
|
52
137
|
|
|
53
|
-
The orchestrator
|
|
138
|
+
The orchestrator selects the right workflow based on the task:
|
|
54
139
|
|
|
55
140
|
```
|
|
141
|
+
# Standard feature
|
|
56
142
|
investigate → plan → security (pre) → build → QA → security (post) → docs
|
|
143
|
+
|
|
144
|
+
# Bug report
|
|
145
|
+
debugger (diagnose) → builder (fix) → qa (verify)
|
|
146
|
+
|
|
147
|
+
# Performance issue
|
|
148
|
+
performance (profile) → builder (optimize) → qa (benchmark)
|
|
149
|
+
|
|
150
|
+
# Cleanup / refactor
|
|
151
|
+
refactorer (plan) → builder (apply) → qa (verify)
|
|
152
|
+
|
|
153
|
+
# Deployment task
|
|
154
|
+
devops (design) → security (review) → builder (implement)
|
|
57
155
|
```
|
|
58
156
|
|
|
59
157
|
## Providers
|
|
60
158
|
|
|
61
|
-
Two providers are supported out of the box:
|
|
62
|
-
|
|
63
159
|
| Provider | Flag | Model | Env var |
|
|
64
160
|
|----------|------|-------|---------|
|
|
65
161
|
| [MiniMax](https://platform.minimax.io) | `minimax` *(default)* | `MiniMax-M2.7` | `MINIMAX_API_KEY` |
|
|
@@ -77,34 +173,13 @@ GitHub Copilot also exposes `gpt-4o-mini`, `o3-mini`, `claude-sonnet-4-5`, and `
|
|
|
77
173
|
## CLI
|
|
78
174
|
|
|
79
175
|
```bash
|
|
80
|
-
opencode-agent init # full project setup
|
|
176
|
+
opencode-agent init # full project setup (pnpm-safe)
|
|
81
177
|
opencode-agent inject # inject with MiniMax (default)
|
|
82
178
|
opencode-agent inject --provider github-copilot # inject with GitHub Copilot
|
|
83
179
|
opencode-agent inject -f # overwrite existing agent files
|
|
84
180
|
opencode-agent list # list available agents
|
|
85
181
|
```
|
|
86
182
|
|
|
87
|
-
## Manual install (npm / yarn / bun)
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
# npm
|
|
91
|
-
npm install --save-dev @devlitusp/opencode-agent
|
|
92
|
-
|
|
93
|
-
# yarn
|
|
94
|
-
yarn add --dev @devlitusp/opencode-agent
|
|
95
|
-
|
|
96
|
-
# bun
|
|
97
|
-
bun add --dev @devlitusp/opencode-agent
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Then run:
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
opencode-agent inject
|
|
104
|
-
# or with GitHub Copilot:
|
|
105
|
-
opencode-agent inject --provider github-copilot
|
|
106
|
-
```
|
|
107
|
-
|
|
108
183
|
## License
|
|
109
184
|
|
|
110
185
|
MIT
|
package/dist/bin/dev-agents.js
CHANGED
|
@@ -7,7 +7,7 @@ import { join } from "path";
|
|
|
7
7
|
var orchestrator = {
|
|
8
8
|
name: "orchestrator",
|
|
9
9
|
frontmatter: {
|
|
10
|
-
model: "
|
|
10
|
+
model: "MiniMax-M2.7",
|
|
11
11
|
description: "Lead coordinator that orchestrates the full development workflow",
|
|
12
12
|
mode: "primary",
|
|
13
13
|
temperature: 0.2,
|
|
@@ -685,10 +685,9 @@ var ALL_AGENTS = [
|
|
|
685
685
|
var MINIMAX_PROVIDER_KEY = "minimax";
|
|
686
686
|
var MINIMAX_PROVIDER = {
|
|
687
687
|
npm: "@ai-sdk/openai-compatible",
|
|
688
|
-
name: "
|
|
688
|
+
name: "minimax",
|
|
689
689
|
options: {
|
|
690
|
-
baseURL: "https://
|
|
691
|
-
apiKey: "{env:MINIMAX_API_KEY}"
|
|
690
|
+
baseURL: "https://minimax.io"
|
|
692
691
|
},
|
|
693
692
|
models: {
|
|
694
693
|
"MiniMax-M2.7": { name: "MiniMax-M2.7" }
|
|
@@ -827,7 +826,7 @@ function inject(options = {}) {
|
|
|
827
826
|
pkg["scripts"] = scripts;
|
|
828
827
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + `
|
|
829
828
|
`, "utf-8");
|
|
830
|
-
log(`Added "prepare": "
|
|
829
|
+
log(`Added "prepare": "opencode-agent inject" to package.json`);
|
|
831
830
|
} else {
|
|
832
831
|
log(`Skipped package.json prepare script (already exists)`);
|
|
833
832
|
}
|
|
@@ -883,6 +882,7 @@ Install failed. Try running manually:
|
|
|
883
882
|
${installCmd}`);
|
|
884
883
|
process.exit(1);
|
|
885
884
|
}
|
|
885
|
+
inject({ cwd, verbose: true });
|
|
886
886
|
}
|
|
887
887
|
function detectPackageManager(cwd) {
|
|
888
888
|
const agent = process.env["npm_config_user_agent"] ?? "";
|
package/dist/bin/postinstall.js
CHANGED
|
@@ -6,7 +6,7 @@ import { join } from "path";
|
|
|
6
6
|
var orchestrator = {
|
|
7
7
|
name: "orchestrator",
|
|
8
8
|
frontmatter: {
|
|
9
|
-
model: "
|
|
9
|
+
model: "MiniMax-M2.7",
|
|
10
10
|
description: "Lead coordinator that orchestrates the full development workflow",
|
|
11
11
|
mode: "primary",
|
|
12
12
|
temperature: 0.2,
|
|
@@ -684,10 +684,9 @@ var ALL_AGENTS = [
|
|
|
684
684
|
var MINIMAX_PROVIDER_KEY = "minimax";
|
|
685
685
|
var MINIMAX_PROVIDER = {
|
|
686
686
|
npm: "@ai-sdk/openai-compatible",
|
|
687
|
-
name: "
|
|
687
|
+
name: "minimax",
|
|
688
688
|
options: {
|
|
689
|
-
baseURL: "https://
|
|
690
|
-
apiKey: "{env:MINIMAX_API_KEY}"
|
|
689
|
+
baseURL: "https://minimax.io"
|
|
691
690
|
},
|
|
692
691
|
models: {
|
|
693
692
|
"MiniMax-M2.7": { name: "MiniMax-M2.7" }
|
|
@@ -826,7 +825,7 @@ function inject(options = {}) {
|
|
|
826
825
|
pkg["scripts"] = scripts;
|
|
827
826
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + `
|
|
828
827
|
`, "utf-8");
|
|
829
|
-
log(`Added "prepare": "
|
|
828
|
+
log(`Added "prepare": "opencode-agent inject" to package.json`);
|
|
830
829
|
} else {
|
|
831
830
|
log(`Skipped package.json prepare script (already exists)`);
|
|
832
831
|
}
|
|
@@ -858,14 +857,14 @@ try {
|
|
|
858
857
|
} catch {}
|
|
859
858
|
try {
|
|
860
859
|
console.log(`
|
|
861
|
-
[
|
|
860
|
+
[opencode-agent] Injecting OpenCode agent config...
|
|
862
861
|
`);
|
|
863
862
|
inject({ cwd: projectRoot, verbose: true });
|
|
864
863
|
console.log(`
|
|
865
|
-
[
|
|
866
|
-
` + `[
|
|
864
|
+
[opencode-agent] Done! Set MINIMAX_API_KEY in your environment and open OpenCode.
|
|
865
|
+
` + `[opencode-agent] Use the orchestrator agent to start the full development workflow.
|
|
867
866
|
`);
|
|
868
867
|
} catch (err) {
|
|
869
868
|
console.warn(`
|
|
870
|
-
[
|
|
869
|
+
[opencode-agent] Warning: could not inject config:`, err instanceof Error ? err.message : err, "\nRun `opencode-agent inject` manually to retry.\n");
|
|
871
870
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import type { AgentDefinition } from "../types.js";
|
|
|
3
3
|
export const orchestrator: AgentDefinition = {
|
|
4
4
|
name: "orchestrator",
|
|
5
5
|
frontmatter: {
|
|
6
|
-
model: "
|
|
6
|
+
model: "MiniMax-M2.7",
|
|
7
7
|
description: "Lead coordinator that orchestrates the full development workflow",
|
|
8
8
|
mode: "primary",
|
|
9
9
|
temperature: 0.2,
|
package/src/init.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { execSync } from "child_process";
|
|
2
2
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
3
3
|
import { join } from "path";
|
|
4
|
+
import { inject } from "./inject.js";
|
|
4
5
|
|
|
5
6
|
const PACKAGE_NAME = "@devlitusp/opencode-agent";
|
|
6
7
|
|
|
@@ -44,6 +45,11 @@ export function init(cwd: string = process.cwd()): void {
|
|
|
44
45
|
console.error(`\nInstall failed. Try running manually:\n ${installCmd}`);
|
|
45
46
|
process.exit(1);
|
|
46
47
|
}
|
|
48
|
+
|
|
49
|
+
// pnpm rewrites package.json after the install, which can overwrite changes
|
|
50
|
+
// made by postinstall (e.g. the prepare script). Run inject() explicitly here
|
|
51
|
+
// so it always runs after pnpm has finished modifying package.json.
|
|
52
|
+
inject({ cwd, verbose: true });
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
function detectPackageManager(cwd: string): string {
|
package/src/inject.ts
CHANGED
|
@@ -8,10 +8,9 @@ import type { AgentDefinition, AgentFrontmatter, InjectOptions, OpenCodeConfig,
|
|
|
8
8
|
const MINIMAX_PROVIDER_KEY = "minimax";
|
|
9
9
|
const MINIMAX_PROVIDER: OpenCodeProvider = {
|
|
10
10
|
npm: "@ai-sdk/openai-compatible",
|
|
11
|
-
name: "
|
|
11
|
+
name: "minimax",
|
|
12
12
|
options: {
|
|
13
|
-
baseURL: "https://
|
|
14
|
-
apiKey: "{env:MINIMAX_API_KEY}",
|
|
13
|
+
baseURL: "https://minimax.io",
|
|
15
14
|
},
|
|
16
15
|
models: {
|
|
17
16
|
"MiniMax-M2.7": { name: "MiniMax-M2.7" },
|
|
@@ -183,7 +182,7 @@ export function inject(options: InjectOptions = {}): void {
|
|
|
183
182
|
scripts["prepare"] = "opencode-agent inject";
|
|
184
183
|
pkg["scripts"] = scripts;
|
|
185
184
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n", "utf-8");
|
|
186
|
-
log(`Added "prepare": "
|
|
185
|
+
log(`Added "prepare": "opencode-agent inject" to package.json`);
|
|
187
186
|
} else {
|
|
188
187
|
log(`Skipped package.json prepare script (already exists)`);
|
|
189
188
|
}
|