@devlitusp/opencode-agent 0.0.4 → 0.0.5
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 +60 -34
- package/dist/bin/dev-agents.js +3 -2
- package/dist/bin/postinstall.js +6 -6
- package/package.json +1 -1
- package/src/init.ts +6 -0
- package/src/inject.ts +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,45 @@
|
|
|
1
1
|
# @devlitusp/opencode-agent
|
|
2
2
|
|
|
3
|
-
Multi-agent development team for [OpenCode CLI](https://opencode.ai). One command sets up a full team of AI agents in your project — orchestrator, investigator, planner, builder, QA, security, and
|
|
3
|
+
Multi-agent development team for [OpenCode CLI](https://opencode.ai). One command 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
|
+
### pnpm (recommended)
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
pnpm dlx @devlitusp/opencode-agent init
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
This
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
This is the only command needed. It handles the pnpm security restriction that blocks postinstall scripts by default, adds the package to `devDependencies`, and injects all agents automatically.
|
|
14
|
+
|
|
15
|
+
> **Why `dlx init` and not `pnpm add`?**
|
|
16
|
+
> pnpm v8+ blocks postinstall scripts from dependencies unless explicitly allowed. Running `pnpm add --save-dev @devlitusp/opencode-agent` installs the package but **nothing gets injected**. The `init` command adds `@devlitusp/opencode-agent` to `pnpm.onlyBuiltDependencies` in your `package.json` before installing, which allows the postinstall to run.
|
|
17
|
+
|
|
18
|
+
### npm
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install --save-dev @devlitusp/opencode-agent
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
npm runs postinstall scripts automatically — agents are injected immediately after install.
|
|
25
|
+
|
|
26
|
+
### yarn
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
yarn add --dev @devlitusp/opencode-agent
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
yarn runs postinstall scripts automatically — agents are injected immediately after install.
|
|
33
|
+
|
|
34
|
+
### bun
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bun add --dev @devlitusp/opencode-agent
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
bun runs postinstall scripts automatically — agents are injected immediately after install.
|
|
41
|
+
|
|
42
|
+
---
|
|
15
43
|
|
|
16
44
|
Then set your API key and open OpenCode:
|
|
17
45
|
|
|
@@ -26,12 +54,16 @@ export GITHUB_TOKEN=your_token_here # GitHub Copilot
|
|
|
26
54
|
```
|
|
27
55
|
.opencode/agents/
|
|
28
56
|
orchestrator.md ← primary agent, coordinates the team
|
|
29
|
-
investigator.md ←
|
|
57
|
+
investigator.md ← researches libraries and external APIs
|
|
30
58
|
planner.md ← creates implementation plans
|
|
31
59
|
builder.md ← writes the code
|
|
32
60
|
qa.md ← quality assurance and tests
|
|
33
61
|
security.md ← vulnerability scanning (OWASP Top 10)
|
|
34
62
|
docs-writer.md ← JSDoc, README, documentation
|
|
63
|
+
debugger.md ← diagnoses errors and stack traces
|
|
64
|
+
performance.md ← profiles bottlenecks and optimizations
|
|
65
|
+
devops.md ← CI/CD, Docker, infrastructure-as-code
|
|
66
|
+
refactorer.md ← improves code structure without changing behavior
|
|
35
67
|
|
|
36
68
|
opencode.json ← provider config + default_agent
|
|
37
69
|
```
|
|
@@ -41,25 +73,40 @@ opencode.json ← provider config + default_agent
|
|
|
41
73
|
| Agent | Mode | Role |
|
|
42
74
|
|-------|------|------|
|
|
43
75
|
| `orchestrator` | primary | Coordinates the full dev workflow |
|
|
44
|
-
| `investigator` | subagent |
|
|
76
|
+
| `investigator` | subagent | Researches libraries, frameworks, and external APIs |
|
|
45
77
|
| `planner` | subagent | Creates detailed implementation plans |
|
|
46
78
|
| `builder` | subagent | Implements code following the plan |
|
|
47
79
|
| `qa` | subagent | Reviews quality, writes tests |
|
|
48
80
|
| `security` | subagent | Scans for vulnerabilities (pre and post build) |
|
|
49
81
|
| `docs-writer` | subagent | Writes JSDoc, README sections, examples |
|
|
82
|
+
| `debugger` | subagent | Diagnoses errors, analyzes stack traces |
|
|
83
|
+
| `performance` | subagent | Profiles bottlenecks, recommends optimizations |
|
|
84
|
+
| `devops` | subagent | Handles CI/CD, Docker, deployment configs |
|
|
85
|
+
| `refactorer` | subagent | Improves code structure without changing behavior |
|
|
50
86
|
|
|
51
|
-
## Development
|
|
87
|
+
## Development workflows
|
|
52
88
|
|
|
53
|
-
The orchestrator
|
|
89
|
+
The orchestrator selects the right workflow based on the task:
|
|
54
90
|
|
|
55
91
|
```
|
|
92
|
+
# Standard feature
|
|
56
93
|
investigate → plan → security (pre) → build → QA → security (post) → docs
|
|
94
|
+
|
|
95
|
+
# Bug report
|
|
96
|
+
debugger (diagnose) → builder (fix) → qa (verify)
|
|
97
|
+
|
|
98
|
+
# Performance issue
|
|
99
|
+
performance (profile) → builder (optimize) → qa (benchmark)
|
|
100
|
+
|
|
101
|
+
# Cleanup / refactor
|
|
102
|
+
refactorer (plan) → builder (apply) → qa (verify)
|
|
103
|
+
|
|
104
|
+
# Deployment task
|
|
105
|
+
devops (design) → security (review) → builder (implement)
|
|
57
106
|
```
|
|
58
107
|
|
|
59
108
|
## Providers
|
|
60
109
|
|
|
61
|
-
Two providers are supported out of the box:
|
|
62
|
-
|
|
63
110
|
| Provider | Flag | Model | Env var |
|
|
64
111
|
|----------|------|-------|---------|
|
|
65
112
|
| [MiniMax](https://platform.minimax.io) | `minimax` *(default)* | `MiniMax-M2.7` | `MINIMAX_API_KEY` |
|
|
@@ -77,34 +124,13 @@ GitHub Copilot also exposes `gpt-4o-mini`, `o3-mini`, `claude-sonnet-4-5`, and `
|
|
|
77
124
|
## CLI
|
|
78
125
|
|
|
79
126
|
```bash
|
|
80
|
-
opencode-agent init # full project setup
|
|
127
|
+
opencode-agent init # full project setup (pnpm-safe)
|
|
81
128
|
opencode-agent inject # inject with MiniMax (default)
|
|
82
129
|
opencode-agent inject --provider github-copilot # inject with GitHub Copilot
|
|
83
130
|
opencode-agent inject -f # overwrite existing agent files
|
|
84
131
|
opencode-agent list # list available agents
|
|
85
132
|
```
|
|
86
133
|
|
|
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
134
|
## License
|
|
109
135
|
|
|
110
136
|
MIT
|
package/dist/bin/dev-agents.js
CHANGED
|
@@ -687,7 +687,7 @@ var MINIMAX_PROVIDER = {
|
|
|
687
687
|
npm: "@ai-sdk/openai-compatible",
|
|
688
688
|
name: "MiniMax",
|
|
689
689
|
options: {
|
|
690
|
-
baseURL: "https://api.minimax.
|
|
690
|
+
baseURL: "https://api.minimax.io/v1",
|
|
691
691
|
apiKey: "{env:MINIMAX_API_KEY}"
|
|
692
692
|
},
|
|
693
693
|
models: {
|
|
@@ -827,7 +827,7 @@ function inject(options = {}) {
|
|
|
827
827
|
pkg["scripts"] = scripts;
|
|
828
828
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + `
|
|
829
829
|
`, "utf-8");
|
|
830
|
-
log(`Added "prepare": "
|
|
830
|
+
log(`Added "prepare": "opencode-agent inject" to package.json`);
|
|
831
831
|
} else {
|
|
832
832
|
log(`Skipped package.json prepare script (already exists)`);
|
|
833
833
|
}
|
|
@@ -883,6 +883,7 @@ Install failed. Try running manually:
|
|
|
883
883
|
${installCmd}`);
|
|
884
884
|
process.exit(1);
|
|
885
885
|
}
|
|
886
|
+
inject({ cwd, verbose: true });
|
|
886
887
|
}
|
|
887
888
|
function detectPackageManager(cwd) {
|
|
888
889
|
const agent = process.env["npm_config_user_agent"] ?? "";
|
package/dist/bin/postinstall.js
CHANGED
|
@@ -686,7 +686,7 @@ var MINIMAX_PROVIDER = {
|
|
|
686
686
|
npm: "@ai-sdk/openai-compatible",
|
|
687
687
|
name: "MiniMax",
|
|
688
688
|
options: {
|
|
689
|
-
baseURL: "https://api.minimax.
|
|
689
|
+
baseURL: "https://api.minimax.io/v1",
|
|
690
690
|
apiKey: "{env:MINIMAX_API_KEY}"
|
|
691
691
|
},
|
|
692
692
|
models: {
|
|
@@ -826,7 +826,7 @@ function inject(options = {}) {
|
|
|
826
826
|
pkg["scripts"] = scripts;
|
|
827
827
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + `
|
|
828
828
|
`, "utf-8");
|
|
829
|
-
log(`Added "prepare": "
|
|
829
|
+
log(`Added "prepare": "opencode-agent inject" to package.json`);
|
|
830
830
|
} else {
|
|
831
831
|
log(`Skipped package.json prepare script (already exists)`);
|
|
832
832
|
}
|
|
@@ -858,14 +858,14 @@ try {
|
|
|
858
858
|
} catch {}
|
|
859
859
|
try {
|
|
860
860
|
console.log(`
|
|
861
|
-
[
|
|
861
|
+
[opencode-agent] Injecting OpenCode agent config...
|
|
862
862
|
`);
|
|
863
863
|
inject({ cwd: projectRoot, verbose: true });
|
|
864
864
|
console.log(`
|
|
865
|
-
[
|
|
866
|
-
` + `[
|
|
865
|
+
[opencode-agent] Done! Set MINIMAX_API_KEY in your environment and open OpenCode.
|
|
866
|
+
` + `[opencode-agent] Use the orchestrator agent to start the full development workflow.
|
|
867
867
|
`);
|
|
868
868
|
} catch (err) {
|
|
869
869
|
console.warn(`
|
|
870
|
-
[
|
|
870
|
+
[opencode-agent] Warning: could not inject config:`, err instanceof Error ? err.message : err, "\nRun `opencode-agent inject` manually to retry.\n");
|
|
871
871
|
}
|
package/package.json
CHANGED
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
|
@@ -10,7 +10,7 @@ const MINIMAX_PROVIDER: OpenCodeProvider = {
|
|
|
10
10
|
npm: "@ai-sdk/openai-compatible",
|
|
11
11
|
name: "MiniMax",
|
|
12
12
|
options: {
|
|
13
|
-
baseURL: "https://api.minimax.
|
|
13
|
+
baseURL: "https://api.minimax.io/v1",
|
|
14
14
|
apiKey: "{env:MINIMAX_API_KEY}",
|
|
15
15
|
},
|
|
16
16
|
models: {
|
|
@@ -183,7 +183,7 @@ export function inject(options: InjectOptions = {}): void {
|
|
|
183
183
|
scripts["prepare"] = "opencode-agent inject";
|
|
184
184
|
pkg["scripts"] = scripts;
|
|
185
185
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n", "utf-8");
|
|
186
|
-
log(`Added "prepare": "
|
|
186
|
+
log(`Added "prepare": "opencode-agent inject" to package.json`);
|
|
187
187
|
} else {
|
|
188
188
|
log(`Skipped package.json prepare script (already exists)`);
|
|
189
189
|
}
|