my-opencode 1.3.0 → 1.3.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.
- package/LICENSE +21 -21
- package/README.md +253 -248
- package/agents/architect.md +30 -30
- package/agents/code-reviewer.md +29 -29
- package/agents/executor.md +30 -30
- package/agents/fullstack-dev.md +57 -57
- package/agents/spec-writer.md +37 -37
- package/agents/team-lead.md +60 -60
- package/agents/tech-writer.md +30 -30
- package/agents/test-engineer.md +30 -30
- package/agents/verifier.md +33 -33
- package/bin/cli.js +340 -340
- package/bin/moc +198 -198
- package/bin/moc.js +350 -0
- package/opencode.json +170 -170
- package/package.json +50 -50
- package/plugins/README.md +64 -64
- package/plugins/provider-profile.mjs +139 -139
- package/scripts/postinstall.js +202 -202
- package/skills/adr/SKILL.md +91 -91
- package/skills/adr/references/templates.md +100 -100
- package/skills/adr/scripts/README.md +5 -5
- package/skills/dev-flow/SKILL.md +188 -188
- package/skills/dev-flow/references/code-phase.md +72 -72
- package/skills/dev-flow/references/contract-phase.md +81 -81
- package/skills/dev-flow/references/verify-phase.md +129 -129
- package/skills/dev-flow/scripts/README.md +3 -3
- package/skills/docs-gen/SKILL.md +162 -162
- package/skills/docs-gen/references/doc-styles.md +216 -216
- package/skills/docs-gen/scripts/README.md +5 -5
- package/skills/orchestrate/SKILL.md +112 -112
- package/skills/orchestrate/references/orchestration-patterns.md +56 -56
- package/skills/pr-review/SKILL.md +110 -110
- package/skills/pr-review/references/review-dimensions.md +117 -117
- package/skills/pr-review/references/security-checklist.md +122 -122
- package/skills/pr-review/scripts/README.md +5 -5
- package/skills/test-gen/SKILL.md +143 -143
- package/skills/test-gen/references/framework-detection.md +105 -105
- package/skills/test-gen/references/test-patterns.md +260 -260
- package/skills/test-gen/scripts/README.md +5 -5
package/bin/moc.js
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { constants as osConstants } from 'node:os';
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { spawn, spawnSync } from 'node:child_process';
|
|
7
|
+
|
|
8
|
+
const knownProfiles = new Set(['opencode', 'openai', 'google', 'copilot']);
|
|
9
|
+
const knownProfilesText = 'opencode openai google copilot';
|
|
10
|
+
const signalExitCodes = {
|
|
11
|
+
SIGHUP: 1,
|
|
12
|
+
SIGINT: 2,
|
|
13
|
+
SIGTERM: 15,
|
|
14
|
+
SIGBREAK: 21,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const pluginPath = path.join('.opencode', 'plugins', 'provider-profile.mjs');
|
|
18
|
+
const configPath = path.join('.opencode', 'opencode.json');
|
|
19
|
+
|
|
20
|
+
const pluginAbsPath = path.resolve(process.cwd(), pluginPath);
|
|
21
|
+
const configAbsPath = path.resolve(process.cwd(), configPath);
|
|
22
|
+
|
|
23
|
+
function isKnownProfile(value) {
|
|
24
|
+
return knownProfiles.has(value);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function normalizeProfile(value) {
|
|
28
|
+
return value.trim();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getMtime(filePath, label) {
|
|
32
|
+
try {
|
|
33
|
+
return String(fs.statSync(filePath).mtimeMs);
|
|
34
|
+
} catch {
|
|
35
|
+
console.error(`moc: failed to read ${label} mtime from ${label === 'plugin' ? pluginPath : configPath}`);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function readMeta(filePath) {
|
|
41
|
+
try {
|
|
42
|
+
const raw = fs.readFileSync(filePath, 'utf8');
|
|
43
|
+
const meta = {};
|
|
44
|
+
|
|
45
|
+
for (const line of raw.split(/\r?\n/)) {
|
|
46
|
+
const index = line.indexOf('=');
|
|
47
|
+
if (index === -1) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const key = line.slice(0, index);
|
|
52
|
+
const value = line.slice(index + 1);
|
|
53
|
+
meta[key] = value;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (meta.profile && meta.plugin_mtime && meta.config_mtime) {
|
|
57
|
+
return meta;
|
|
58
|
+
}
|
|
59
|
+
} catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function readCacheContent(filePath) {
|
|
67
|
+
try {
|
|
68
|
+
return fs.readFileSync(filePath, 'utf8').replace(/\r?\n/g, '');
|
|
69
|
+
} catch {
|
|
70
|
+
return '';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function writeCache(cacheDir, cacheContentPath, cacheMetaPath, profile, pluginMtime, configMtime, configContent) {
|
|
75
|
+
const suffix = `.tmp.${process.pid}.${Date.now()}`;
|
|
76
|
+
const tempContentPath = `${cacheContentPath}${suffix}`;
|
|
77
|
+
const tempMetaPath = `${cacheMetaPath}${suffix}`;
|
|
78
|
+
const metaContent = [
|
|
79
|
+
`profile=${profile}`,
|
|
80
|
+
`plugin_mtime=${pluginMtime}`,
|
|
81
|
+
`config_mtime=${configMtime}`,
|
|
82
|
+
'',
|
|
83
|
+
].join('\n');
|
|
84
|
+
|
|
85
|
+
try {
|
|
86
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
87
|
+
fs.writeFileSync(tempContentPath, `${configContent}\n`, 'utf8');
|
|
88
|
+
fs.writeFileSync(tempMetaPath, metaContent, 'utf8');
|
|
89
|
+
fs.renameSync(tempContentPath, cacheContentPath);
|
|
90
|
+
fs.renameSync(tempMetaPath, cacheMetaPath);
|
|
91
|
+
return true;
|
|
92
|
+
} catch {
|
|
93
|
+
try {
|
|
94
|
+
fs.rmSync(tempContentPath, { force: true });
|
|
95
|
+
} catch {
|
|
96
|
+
// ignore cleanup errors
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
try {
|
|
100
|
+
fs.rmSync(tempMetaPath, { force: true });
|
|
101
|
+
} catch {
|
|
102
|
+
// ignore cleanup errors
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function computeConfigContent(profile) {
|
|
110
|
+
const result = spawnSync(process.execPath, [pluginAbsPath], {
|
|
111
|
+
env: {
|
|
112
|
+
...process.env,
|
|
113
|
+
OPENCODE_PROVIDER_PROFILE: profile,
|
|
114
|
+
},
|
|
115
|
+
encoding: 'utf8',
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
if (result.stderr) {
|
|
119
|
+
process.stderr.write(result.stderr);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (result.error || result.status !== 0) {
|
|
123
|
+
console.error(`moc: failed to compute OPENCODE_CONFIG_CONTENT from ${pluginPath}`);
|
|
124
|
+
process.exit(typeof result.status === 'number' && result.status !== 0 ? result.status : 1);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return result.stdout.replace(/[\r\n]+$/, '');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function printDoctor(activeProfile, cacheContentPath, cacheMetaPath) {
|
|
131
|
+
process.stdout.write(`profile=${activeProfile}\n`);
|
|
132
|
+
process.stdout.write(`plugin_path=${pluginPath}\n`);
|
|
133
|
+
process.stdout.write(`config_path=${configPath}\n`);
|
|
134
|
+
process.stdout.write(`cache_content_path=${cacheContentPath}\n`);
|
|
135
|
+
process.stdout.write(`cache_meta_path=${cacheMetaPath}\n`);
|
|
136
|
+
process.stdout.write(`plugin_exists=${fs.existsSync(pluginAbsPath) ? 'yes' : 'no'}\n`);
|
|
137
|
+
process.stdout.write(`config_exists=${fs.existsSync(configAbsPath) ? 'yes' : 'no'}\n`);
|
|
138
|
+
process.stdout.write(`cache_content_exists=${fs.existsSync(path.resolve(process.cwd(), cacheContentPath)) ? 'yes' : 'no'}\n`);
|
|
139
|
+
process.stdout.write(`cache_meta_exists=${fs.existsSync(path.resolve(process.cwd(), cacheMetaPath)) ? 'yes' : 'no'}\n`);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function resolveWindowsOpencodeInvocation() {
|
|
143
|
+
const pathValue = process.env.PATH || '';
|
|
144
|
+
const searchDirs = pathValue.split(path.delimiter).filter(Boolean);
|
|
145
|
+
|
|
146
|
+
for (const searchDir of searchDirs) {
|
|
147
|
+
const commandPath = path.join(searchDir, 'opencode.cmd');
|
|
148
|
+
if (!fs.existsSync(commandPath)) {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
try {
|
|
153
|
+
const raw = fs.readFileSync(commandPath, 'utf8');
|
|
154
|
+
const matches = [...raw.matchAll(/"([^"]+\.(?:c|m)?js)"/gi)];
|
|
155
|
+
const scriptRef = matches.at(-1)?.[1];
|
|
156
|
+
|
|
157
|
+
if (!scriptRef) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const normalized = scriptRef
|
|
162
|
+
.replace(/%dp0%/gi, `${searchDir}${path.sep}`)
|
|
163
|
+
.replace(/\\/g, path.sep);
|
|
164
|
+
const resolvedScriptPath = path.resolve(normalized);
|
|
165
|
+
|
|
166
|
+
if (fs.existsSync(resolvedScriptPath)) {
|
|
167
|
+
return {
|
|
168
|
+
command: process.execPath,
|
|
169
|
+
argsPrefix: [resolvedScriptPath],
|
|
170
|
+
shell: false,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
} catch {
|
|
174
|
+
// ignore unreadable shims and continue searching PATH
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return {
|
|
179
|
+
command: 'opencode',
|
|
180
|
+
argsPrefix: [],
|
|
181
|
+
shell: true,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function spawnOpencode(args, extraEnv = {}) {
|
|
186
|
+
const invocation = process.platform === 'win32'
|
|
187
|
+
? resolveWindowsOpencodeInvocation()
|
|
188
|
+
: { command: 'opencode', argsPrefix: [], shell: false };
|
|
189
|
+
const child = spawn(invocation.command, [...invocation.argsPrefix, ...args], {
|
|
190
|
+
env: {
|
|
191
|
+
...process.env,
|
|
192
|
+
...extraEnv,
|
|
193
|
+
},
|
|
194
|
+
stdio: 'inherit',
|
|
195
|
+
shell: invocation.shell,
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
const signals = ['SIGINT', 'SIGTERM'];
|
|
199
|
+
if (process.platform !== 'win32') {
|
|
200
|
+
signals.push('SIGHUP');
|
|
201
|
+
} else {
|
|
202
|
+
signals.push('SIGBREAK');
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
let finished = false;
|
|
206
|
+
const handlers = new Map();
|
|
207
|
+
|
|
208
|
+
const cleanup = () => {
|
|
209
|
+
for (const [signal, handler] of handlers) {
|
|
210
|
+
process.off(signal, handler);
|
|
211
|
+
}
|
|
212
|
+
handlers.clear();
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const finish = (code, signal) => {
|
|
216
|
+
if (finished) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
finished = true;
|
|
221
|
+
cleanup();
|
|
222
|
+
|
|
223
|
+
if (signal) {
|
|
224
|
+
const signalCode = osConstants.signals?.[signal] ?? signalExitCodes[signal];
|
|
225
|
+
process.exit(typeof signalCode === 'number' ? 128 + signalCode : 1);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
process.exit(code ?? 0);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
for (const signal of signals) {
|
|
232
|
+
const handler = () => {
|
|
233
|
+
if (child.exitCode !== null || child.signalCode !== null) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
try {
|
|
238
|
+
child.kill(signal);
|
|
239
|
+
} catch {
|
|
240
|
+
// ignore forwarding errors and wait for child exit
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
handlers.set(signal, handler);
|
|
245
|
+
process.on(signal, handler);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
child.on('error', (error) => {
|
|
249
|
+
cleanup();
|
|
250
|
+
console.error(`moc: failed to launch opencode: ${error.message}`);
|
|
251
|
+
process.exit(1);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
child.on('exit', finish);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function main() {
|
|
258
|
+
const originalArgs = process.argv.slice(2);
|
|
259
|
+
let forwardedArgs = [...originalArgs];
|
|
260
|
+
let profile = '';
|
|
261
|
+
let commandMode = '';
|
|
262
|
+
|
|
263
|
+
if (originalArgs[0] === 'doctor' || originalArgs[0] === 'print-config') {
|
|
264
|
+
commandMode = originalArgs[0];
|
|
265
|
+
const candidateProfile = originalArgs[1];
|
|
266
|
+
|
|
267
|
+
if (typeof candidateProfile === 'string' && candidateProfile.length > 0) {
|
|
268
|
+
profile = candidateProfile;
|
|
269
|
+
} else {
|
|
270
|
+
profile = 'opencode';
|
|
271
|
+
}
|
|
272
|
+
} else if (typeof originalArgs[0] === 'string' && isKnownProfile(originalArgs[0])) {
|
|
273
|
+
profile = originalArgs[0];
|
|
274
|
+
forwardedArgs = originalArgs.slice(1);
|
|
275
|
+
} else if (originalArgs.length === 0) {
|
|
276
|
+
const envProfile = typeof process.env.OPENCODE_PROVIDER_PROFILE === 'string'
|
|
277
|
+
? normalizeProfile(process.env.OPENCODE_PROVIDER_PROFILE)
|
|
278
|
+
: '';
|
|
279
|
+
|
|
280
|
+
profile = envProfile || 'opencode';
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (!profile) {
|
|
284
|
+
spawnOpencode(forwardedArgs);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (!isKnownProfile(profile)) {
|
|
289
|
+
console.error(`moc: unknown profile '${profile}'. Must be one of: ${knownProfilesText}`);
|
|
290
|
+
process.exit(1);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const cacheDir = path.join('.opencode', 'cache', 'provider-profile');
|
|
294
|
+
const cacheContentPath = path.join(cacheDir, `${profile}.json`);
|
|
295
|
+
const cacheMetaPath = path.join(cacheDir, `${profile}.meta`);
|
|
296
|
+
const cacheContentAbsPath = path.resolve(process.cwd(), cacheContentPath);
|
|
297
|
+
const cacheMetaAbsPath = path.resolve(process.cwd(), cacheMetaPath);
|
|
298
|
+
|
|
299
|
+
if (!fs.existsSync(pluginAbsPath)) {
|
|
300
|
+
console.error(`moc: plugin not found at ${pluginPath}; falling back to plain opencode`);
|
|
301
|
+
spawnOpencode(forwardedArgs);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (!fs.existsSync(configAbsPath)) {
|
|
306
|
+
console.error(`moc: config not found at ${configPath}; cannot compute provider profile override`);
|
|
307
|
+
process.exit(1);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (commandMode === 'doctor') {
|
|
311
|
+
printDoctor(profile, cacheContentPath, cacheMetaPath);
|
|
312
|
+
process.exit(0);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const pluginMtime = getMtime(pluginAbsPath, 'plugin');
|
|
316
|
+
const configMtime = getMtime(configAbsPath, 'config');
|
|
317
|
+
|
|
318
|
+
let configContent = '';
|
|
319
|
+
const meta = readMeta(cacheMetaAbsPath);
|
|
320
|
+
|
|
321
|
+
if (meta && fs.existsSync(cacheContentAbsPath)) {
|
|
322
|
+
if (
|
|
323
|
+
meta.profile === profile
|
|
324
|
+
&& meta.plugin_mtime === pluginMtime
|
|
325
|
+
&& meta.config_mtime === configMtime
|
|
326
|
+
) {
|
|
327
|
+
configContent = readCacheContent(cacheContentAbsPath);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (!configContent) {
|
|
332
|
+
configContent = computeConfigContent(profile);
|
|
333
|
+
|
|
334
|
+
if (!writeCache(cacheDir, cacheContentAbsPath, cacheMetaAbsPath, profile, pluginMtime, configMtime, configContent)) {
|
|
335
|
+
console.error(`moc: warning: failed to update cache at ${cacheDir}; continuing with fresh config`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (commandMode === 'print-config') {
|
|
340
|
+
process.stdout.write(`${configContent}\n`);
|
|
341
|
+
process.exit(0);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
spawnOpencode(forwardedArgs, {
|
|
345
|
+
OPENCODE_PROVIDER_PROFILE: profile,
|
|
346
|
+
OPENCODE_CONFIG_CONTENT: configContent,
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
main();
|
package/opencode.json
CHANGED
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://opencode.ai/config.json",
|
|
3
|
-
"model": "opencode/
|
|
4
|
-
"small_model": "opencode/deepseek-v4-flash
|
|
5
|
-
"default_agent": "fullstack-dev",
|
|
6
|
-
"instructions": [
|
|
7
|
-
"skills/adr/SKILL.md",
|
|
8
|
-
"skills/dev-flow/SKILL.md",
|
|
9
|
-
"skills/pr-review/SKILL.md",
|
|
10
|
-
"skills/test-gen/SKILL.md",
|
|
11
|
-
"skills/docs-gen/SKILL.md",
|
|
12
|
-
"skills/orchestrate/SKILL.md"
|
|
13
|
-
],
|
|
14
|
-
"plugin": [
|
|
15
|
-
"plugins/provider-profile.mjs"
|
|
16
|
-
],
|
|
17
|
-
"agent": {
|
|
18
|
-
"fullstack-dev": {
|
|
19
|
-
"description": "Primary development agent. Orchestrates contract-first ADR → contract → code → verify flow.",
|
|
20
|
-
"mode": "primary",
|
|
21
|
-
"prompt": "{file:agents/fullstack-dev.md}",
|
|
22
|
-
"permission": {
|
|
23
|
-
"task": "ask"
|
|
24
|
-
},
|
|
25
|
-
"tools": {
|
|
26
|
-
"read": true,
|
|
27
|
-
"write": true,
|
|
28
|
-
"edit": true,
|
|
29
|
-
"bash": true
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"spec-writer": {
|
|
33
|
-
"description": "Analyze requirements and produce contract specifications in docs/specs/. Writes persistent contracts for parallel development.",
|
|
34
|
-
"mode": "subagent",
|
|
35
|
-
"model": "opencode/
|
|
36
|
-
"prompt": "{file:agents/spec-writer.md}",
|
|
37
|
-
"tools": {
|
|
38
|
-
"read": true,
|
|
39
|
-
"bash": true,
|
|
40
|
-
"write": true,
|
|
41
|
-
"edit": true
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"executor": {
|
|
45
|
-
"description": "Implement code changes following an approved contract. Full read/write access for coding.",
|
|
46
|
-
"mode": "subagent",
|
|
47
|
-
"prompt": "{file:agents/executor.md}",
|
|
48
|
-
"tools": {
|
|
49
|
-
"read": true,
|
|
50
|
-
"write": true,
|
|
51
|
-
"edit": true,
|
|
52
|
-
"bash": true
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
"verifier": {
|
|
56
|
-
"description": "Run lint, typecheck, tests, and build to verify code changes. Read-only + bash.",
|
|
57
|
-
"mode": "subagent",
|
|
58
|
-
"model": "opencode/deepseek-v4-flash
|
|
59
|
-
"prompt": "{file:agents/verifier.md}",
|
|
60
|
-
"tools": {
|
|
61
|
-
"read": true,
|
|
62
|
-
"bash": true,
|
|
63
|
-
"write": false,
|
|
64
|
-
"edit": false
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"code-reviewer": {
|
|
68
|
-
"description": "Systematic code review across correctness, security, quality, testing, and style dimensions.",
|
|
69
|
-
"mode": "subagent",
|
|
70
|
-
"model": "opencode/
|
|
71
|
-
"prompt": "{file:agents/code-reviewer.md}",
|
|
72
|
-
"tools": {
|
|
73
|
-
"read": true,
|
|
74
|
-
"bash": true,
|
|
75
|
-
"write": false,
|
|
76
|
-
"edit": false
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
"test-engineer": {
|
|
80
|
-
"description": "Generate meaningful tests for source code — unit, integration, and E2E. Framework-aware.",
|
|
81
|
-
"mode": "subagent",
|
|
82
|
-
"prompt": "{file:agents/test-engineer.md}",
|
|
83
|
-
"tools": {
|
|
84
|
-
"read": true,
|
|
85
|
-
"write": true,
|
|
86
|
-
"edit": true,
|
|
87
|
-
"bash": true
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
"tech-writer": {
|
|
91
|
-
"description": "Generate and update project documentation — code comments, API docs, README, and CHANGELOG.",
|
|
92
|
-
"mode": "subagent",
|
|
93
|
-
"prompt": "{file:agents/tech-writer.md}",
|
|
94
|
-
"tools": {
|
|
95
|
-
"read": true,
|
|
96
|
-
"write": true,
|
|
97
|
-
"edit": true,
|
|
98
|
-
"bash": true
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
"team-lead": {
|
|
102
|
-
"description": "Multi-agent orchestrator for complex tasks. Delegates to architect, spec-writer, executor, code-reviewer, test-engineer, verifier.",
|
|
103
|
-
"mode": "subagent",
|
|
104
|
-
"model": "opencode/
|
|
105
|
-
"prompt": "{file:agents/team-lead.md}",
|
|
106
|
-
"tools": {
|
|
107
|
-
"read": true,
|
|
108
|
-
"write": true,
|
|
109
|
-
"edit": true,
|
|
110
|
-
"bash": true
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"architect": {
|
|
114
|
-
"description": "Capture architecture decisions as ADR documents. Analyzes tradeoffs and records context.",
|
|
115
|
-
"mode": "subagent",
|
|
116
|
-
"model": "opencode/
|
|
117
|
-
"prompt": "{file:agents/architect.md}",
|
|
118
|
-
"tools": {
|
|
119
|
-
"read": true,
|
|
120
|
-
"write": true,
|
|
121
|
-
"edit": true,
|
|
122
|
-
"bash": true
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"command": {
|
|
127
|
-
"spec": {
|
|
128
|
-
"description": "Create a contract specification in docs/specs/ — source of truth for implementation",
|
|
129
|
-
"agent": "spec-writer",
|
|
130
|
-
"subtask": true,
|
|
131
|
-
"template": "Analyze the request and produce a contract specification document.\n\n$ARGUMENTS"
|
|
132
|
-
},
|
|
133
|
-
"review": {
|
|
134
|
-
"description": "Review code changes across 5 dimensions (correctness, security, quality, testing, style)",
|
|
135
|
-
"agent": "code-reviewer",
|
|
136
|
-
"subtask": true,
|
|
137
|
-
"template": "Review the current changes.\n\n$ARGUMENTS"
|
|
138
|
-
},
|
|
139
|
-
"test": {
|
|
140
|
-
"description": "Generate tests for source code — auto-detects framework and conventions",
|
|
141
|
-
"agent": "test-engineer",
|
|
142
|
-
"subtask": true,
|
|
143
|
-
"template": "Generate tests for the current code.\n\n$ARGUMENTS"
|
|
144
|
-
},
|
|
145
|
-
"docs": {
|
|
146
|
-
"description": "Generate or update documentation — code comments, README, API docs, ADRs",
|
|
147
|
-
"agent": "tech-writer",
|
|
148
|
-
"subtask": true,
|
|
149
|
-
"template": "Generate or update documentation.\n\n$ARGUMENTS"
|
|
150
|
-
},
|
|
151
|
-
"orchestrate": {
|
|
152
|
-
"description": "Coordinate multiple agents for complex, multi-domain tasks",
|
|
153
|
-
"agent": "team-lead",
|
|
154
|
-
"subtask": true,
|
|
155
|
-
"template": "Orchestrate the following complex task.\n\n$ARGUMENTS"
|
|
156
|
-
},
|
|
157
|
-
"adr": {
|
|
158
|
-
"description": "Create or update an Architecture Decision Record",
|
|
159
|
-
"agent": "architect",
|
|
160
|
-
"subtask": true,
|
|
161
|
-
"template": "Create an Architecture Decision Record.\n\n$ARGUMENTS"
|
|
162
|
-
},
|
|
163
|
-
"verify": {
|
|
164
|
-
"description": "Run lint, typecheck, tests, and build to verify changes",
|
|
165
|
-
"template": "Use the verifier agent to run the full verification suite on the current changes.\n\n$ARGUMENTS",
|
|
166
|
-
"agent": "verifier",
|
|
167
|
-
"subtask": true
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opencode.ai/config.json",
|
|
3
|
+
"model": "opencode-go/deepseek-v4-pro",
|
|
4
|
+
"small_model": "opencode-go/deepseek-v4-flash",
|
|
5
|
+
"default_agent": "fullstack-dev",
|
|
6
|
+
"instructions": [
|
|
7
|
+
"skills/adr/SKILL.md",
|
|
8
|
+
"skills/dev-flow/SKILL.md",
|
|
9
|
+
"skills/pr-review/SKILL.md",
|
|
10
|
+
"skills/test-gen/SKILL.md",
|
|
11
|
+
"skills/docs-gen/SKILL.md",
|
|
12
|
+
"skills/orchestrate/SKILL.md"
|
|
13
|
+
],
|
|
14
|
+
"plugin": [
|
|
15
|
+
"plugins/provider-profile.mjs"
|
|
16
|
+
],
|
|
17
|
+
"agent": {
|
|
18
|
+
"fullstack-dev": {
|
|
19
|
+
"description": "Primary development agent. Orchestrates contract-first ADR → contract → code → verify flow.",
|
|
20
|
+
"mode": "primary",
|
|
21
|
+
"prompt": "{file:agents/fullstack-dev.md}",
|
|
22
|
+
"permission": {
|
|
23
|
+
"task": "ask"
|
|
24
|
+
},
|
|
25
|
+
"tools": {
|
|
26
|
+
"read": true,
|
|
27
|
+
"write": true,
|
|
28
|
+
"edit": true,
|
|
29
|
+
"bash": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"spec-writer": {
|
|
33
|
+
"description": "Analyze requirements and produce contract specifications in docs/specs/. Writes persistent contracts for parallel development.",
|
|
34
|
+
"mode": "subagent",
|
|
35
|
+
"model": "opencode-go/deepseek-v4-pro",
|
|
36
|
+
"prompt": "{file:agents/spec-writer.md}",
|
|
37
|
+
"tools": {
|
|
38
|
+
"read": true,
|
|
39
|
+
"bash": true,
|
|
40
|
+
"write": true,
|
|
41
|
+
"edit": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"executor": {
|
|
45
|
+
"description": "Implement code changes following an approved contract. Full read/write access for coding.",
|
|
46
|
+
"mode": "subagent",
|
|
47
|
+
"prompt": "{file:agents/executor.md}",
|
|
48
|
+
"tools": {
|
|
49
|
+
"read": true,
|
|
50
|
+
"write": true,
|
|
51
|
+
"edit": true,
|
|
52
|
+
"bash": true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"verifier": {
|
|
56
|
+
"description": "Run lint, typecheck, tests, and build to verify code changes. Read-only + bash.",
|
|
57
|
+
"mode": "subagent",
|
|
58
|
+
"model": "opencode-go/deepseek-v4-flash",
|
|
59
|
+
"prompt": "{file:agents/verifier.md}",
|
|
60
|
+
"tools": {
|
|
61
|
+
"read": true,
|
|
62
|
+
"bash": true,
|
|
63
|
+
"write": false,
|
|
64
|
+
"edit": false
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"code-reviewer": {
|
|
68
|
+
"description": "Systematic code review across correctness, security, quality, testing, and style dimensions.",
|
|
69
|
+
"mode": "subagent",
|
|
70
|
+
"model": "opencode-go/deepseek-v4-pro",
|
|
71
|
+
"prompt": "{file:agents/code-reviewer.md}",
|
|
72
|
+
"tools": {
|
|
73
|
+
"read": true,
|
|
74
|
+
"bash": true,
|
|
75
|
+
"write": false,
|
|
76
|
+
"edit": false
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"test-engineer": {
|
|
80
|
+
"description": "Generate meaningful tests for source code — unit, integration, and E2E. Framework-aware.",
|
|
81
|
+
"mode": "subagent",
|
|
82
|
+
"prompt": "{file:agents/test-engineer.md}",
|
|
83
|
+
"tools": {
|
|
84
|
+
"read": true,
|
|
85
|
+
"write": true,
|
|
86
|
+
"edit": true,
|
|
87
|
+
"bash": true
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"tech-writer": {
|
|
91
|
+
"description": "Generate and update project documentation — code comments, API docs, README, and CHANGELOG.",
|
|
92
|
+
"mode": "subagent",
|
|
93
|
+
"prompt": "{file:agents/tech-writer.md}",
|
|
94
|
+
"tools": {
|
|
95
|
+
"read": true,
|
|
96
|
+
"write": true,
|
|
97
|
+
"edit": true,
|
|
98
|
+
"bash": true
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"team-lead": {
|
|
102
|
+
"description": "Multi-agent orchestrator for complex tasks. Delegates to architect, spec-writer, executor, code-reviewer, test-engineer, verifier.",
|
|
103
|
+
"mode": "subagent",
|
|
104
|
+
"model": "opencode-go/deepseek-v4-pro",
|
|
105
|
+
"prompt": "{file:agents/team-lead.md}",
|
|
106
|
+
"tools": {
|
|
107
|
+
"read": true,
|
|
108
|
+
"write": true,
|
|
109
|
+
"edit": true,
|
|
110
|
+
"bash": true
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"architect": {
|
|
114
|
+
"description": "Capture architecture decisions as ADR documents. Analyzes tradeoffs and records context.",
|
|
115
|
+
"mode": "subagent",
|
|
116
|
+
"model": "opencode-go/deepseek-v4-pro",
|
|
117
|
+
"prompt": "{file:agents/architect.md}",
|
|
118
|
+
"tools": {
|
|
119
|
+
"read": true,
|
|
120
|
+
"write": true,
|
|
121
|
+
"edit": true,
|
|
122
|
+
"bash": true
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"command": {
|
|
127
|
+
"spec": {
|
|
128
|
+
"description": "Create a contract specification in docs/specs/ — source of truth for implementation",
|
|
129
|
+
"agent": "spec-writer",
|
|
130
|
+
"subtask": true,
|
|
131
|
+
"template": "Analyze the request and produce a contract specification document.\n\n$ARGUMENTS"
|
|
132
|
+
},
|
|
133
|
+
"review": {
|
|
134
|
+
"description": "Review code changes across 5 dimensions (correctness, security, quality, testing, style)",
|
|
135
|
+
"agent": "code-reviewer",
|
|
136
|
+
"subtask": true,
|
|
137
|
+
"template": "Review the current changes.\n\n$ARGUMENTS"
|
|
138
|
+
},
|
|
139
|
+
"test": {
|
|
140
|
+
"description": "Generate tests for source code — auto-detects framework and conventions",
|
|
141
|
+
"agent": "test-engineer",
|
|
142
|
+
"subtask": true,
|
|
143
|
+
"template": "Generate tests for the current code.\n\n$ARGUMENTS"
|
|
144
|
+
},
|
|
145
|
+
"docs": {
|
|
146
|
+
"description": "Generate or update documentation — code comments, README, API docs, ADRs",
|
|
147
|
+
"agent": "tech-writer",
|
|
148
|
+
"subtask": true,
|
|
149
|
+
"template": "Generate or update documentation.\n\n$ARGUMENTS"
|
|
150
|
+
},
|
|
151
|
+
"orchestrate": {
|
|
152
|
+
"description": "Coordinate multiple agents for complex, multi-domain tasks",
|
|
153
|
+
"agent": "team-lead",
|
|
154
|
+
"subtask": true,
|
|
155
|
+
"template": "Orchestrate the following complex task.\n\n$ARGUMENTS"
|
|
156
|
+
},
|
|
157
|
+
"adr": {
|
|
158
|
+
"description": "Create or update an Architecture Decision Record",
|
|
159
|
+
"agent": "architect",
|
|
160
|
+
"subtask": true,
|
|
161
|
+
"template": "Create an Architecture Decision Record.\n\n$ARGUMENTS"
|
|
162
|
+
},
|
|
163
|
+
"verify": {
|
|
164
|
+
"description": "Run lint, typecheck, tests, and build to verify changes",
|
|
165
|
+
"template": "Use the verifier agent to run the full verification suite on the current changes.\n\n$ARGUMENTS",
|
|
166
|
+
"agent": "verifier",
|
|
167
|
+
"subtask": true
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|