-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathopencode.jsonc
More file actions
357 lines (357 loc) · 12.5 KB
/
opencode.jsonc
File metadata and controls
357 lines (357 loc) · 12.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
{
"$schema": "https://opencode.ai/config.json",
"autoupdate": true,
"default_agent": "build",
"instructions": [
"instructions/subagent-routing.md",
"instructions/serena.md",
"skills/socratic-design/SKILL.md",
"skills/security-review/SKILL.md",
"skills/coding-standards/SKILL.md",
"skills/git-workflow/SKILL.md",
],
"agent": {
"build": {
"description": "Primary coding agent for development work",
"mode": "primary",
"model": "{env:OPENCODE_MODEL_PRIMARY}",
"prompt": "{file:./prompts/agents/build.txt}",
"reasoningEffort": "{env:OPENCODE_REASONING_SECONDARY}",
"tools": {
"write": true,
"edit": true,
"bash": true,
"read": true,
"task": true,
},
"permission": {
"read": "allow",
"edit": "allow",
"bash": "allow",
// OpenCode task permissions are last-match-wins; direct Task smoke tests verify these allows override the wildcard deny.
// Keep this allowlist in sync when adding or renaming subagents.
"task": {
"*": "deny",
"planner": "allow",
"architect": "allow",
"code-reviewer": "allow",
"security-reviewer": "allow",
"tdd-guide": "allow",
"build-error-resolver": "allow",
"e2e-runner": "allow",
"doc-updater": "allow",
"refactor-cleaner": "allow",
"database-reviewer": "allow",
"git-specialist": "allow",
},
},
},
"planner": {
"description": "MUST delegate for complex feature planning, implementation plans, large refactors, or unclear execution order. Produces plans only.",
"mode": "subagent",
"model": "{env:OPENCODE_MODEL_SUBAGENT_PLANNER}",
"reasoningEffort": "{env:OPENCODE_REASONING_PRIMARY}",
"prompt": "{file:./prompts/agents/planner.txt}",
"tools": {
"read": true,
"bash": true,
"write": false,
"edit": false,
},
},
"architect": {
"description": "MUST delegate for architecture, system design, scalability, cross-module boundaries, or high-impact technical decisions.",
"mode": "subagent",
"model": "{env:OPENCODE_MODEL_SUBAGENT_WORKER}",
"reasoningEffort": "{env:OPENCODE_REASONING_SECONDARY}",
"prompt": "{file:./prompts/agents/architect.txt}",
"tools": {
"read": true,
"bash": true,
"write": false,
"edit": false,
},
},
"code-reviewer": {
"description": "MUST delegate immediately after meaningful code changes. Reviews diffs for bugs, regressions, quality, maintainability, and tests.",
"mode": "subagent",
"model": "{env:OPENCODE_MODEL_SUBAGENT_WORKER}",
"reasoningEffort": "{env:OPENCODE_REASONING_SECONDARY}",
"prompt": "{file:./prompts/agents/code-reviewer.txt}",
"tools": {
"read": true,
"bash": true,
"grep": true,
"write": false,
"edit": false,
},
},
"security-reviewer": {
"description": "MUST delegate for auth, user input, API endpoints, secrets, payments, PII, or sensitive data. Finds and may patch security issues.",
"mode": "subagent",
"model": "{env:OPENCODE_MODEL_SUBAGENT_WORKER}",
"reasoningEffort": "{env:OPENCODE_REASONING_SECONDARY}",
"prompt": "{file:./prompts/agents/security-reviewer.txt}",
"tools": {
"read": true,
"bash": true,
"write": true,
"edit": true,
"grep": true,
"glob": true,
},
},
"tdd-guide": {
"description": "MUST delegate for new features, bug fixes, or refactors that need tests. Enforces RED-GREEN-REFACTOR and 80%+ coverage.",
"mode": "subagent",
"model": "{env:OPENCODE_MODEL_SUBAGENT_WORKER}",
"reasoningEffort": "{env:OPENCODE_REASONING_SECONDARY}",
"prompt": "{file:./prompts/agents/tdd-guide.txt}",
"tools": {
"read": true,
"write": true,
"edit": true,
"bash": true,
"grep": true,
},
},
"build-error-resolver": {
"description": "MUST delegate when build, typecheck, lint, or TypeScript errors occur. Fixes only those errors with minimal diffs.",
"mode": "subagent",
"model": "{env:OPENCODE_MODEL_SUBAGENT_WORKER}",
"reasoningEffort": "{env:OPENCODE_REASONING_SECONDARY}",
"prompt": "{file:./prompts/agents/build-error-resolver.txt}",
"tools": {
"read": true,
"write": true,
"edit": true,
"bash": true,
"grep": true,
"glob": true,
},
},
"e2e-runner": {
"description": "MUST delegate for browser automation, Playwright work, and critical user-flow E2E tests. Generates, runs, and reports artifacts.",
"mode": "subagent",
"model": "{env:OPENCODE_MODEL_SUBAGENT_WORKER}",
"prompt": "{file:./prompts/agents/e2e-runner.txt}",
"tools": {
"read": true,
"write": true,
"edit": true,
"bash": true,
"grep": true,
"glob": true,
},
},
"doc-updater": {
"description": "MUST delegate for documentation, README updates, architecture notes, and codemaps. Keeps docs aligned with code changes.",
"mode": "subagent",
"model": "{env:OPENCODE_MODEL_SUBAGENT_WORKER}",
"reasoningEffort": "{env:OPENCODE_REASONING_SECONDARY}",
"prompt": "{file:./prompts/agents/doc-updater.txt}",
"tools": {
"read": true,
"write": true,
"edit": true,
"bash": true,
"grep": true,
"glob": true,
},
},
"refactor-cleaner": {
"description": "MUST delegate for dead code, unused exports, duplication, and consolidation cleanup. Preserves behavior and verifies safety.",
"mode": "subagent",
"model": "{env:OPENCODE_MODEL_SUBAGENT_WORKER}",
"reasoningEffort": "{env:OPENCODE_REASONING_SECONDARY}",
"prompt": "{file:./prompts/agents/refactor-cleaner.txt}",
"tools": {
"read": true,
"write": true,
"edit": true,
"bash": true,
"grep": true,
"glob": true,
},
},
"database-reviewer": {
"description": "MUST delegate for PostgreSQL, SQL, Supabase, RLS, migrations, schema design, query performance, or DB security.",
"mode": "subagent",
"model": "{env:OPENCODE_MODEL_SUBAGENT_WORKER}",
"prompt": "{file:./prompts/agents/database-reviewer.txt}",
"tools": {
"read": true,
"write": true,
"edit": true,
"bash": true,
"grep": true,
"glob": true,
},
},
"git-specialist": {
"description": "MUST delegate for branch names, commits, staging, pushes, pull requests, and git hygiene. Performs git-only work safely.",
"mode": "subagent",
"model": "{env:OPENCODE_MODEL_SUBAGENT_MINI}",
"reasoningEffort": "{env:OPENCODE_REASONING_TERTIARY}",
"prompt": "{file:./prompts/agents/git-specialist.txt}",
"tools": {
"bash": true,
"read": false,
"write": false,
"edit": false,
"grep": false,
"glob": false,
},
},
},
"command": {
"git": {
"description": "Handle git operations with enforced branch and commit conventions",
"template": "{file:commands/git.md}\n\n$ARGUMENTS",
"agent": "git-specialist",
"subtask": true,
},
"push-changes": {
"description": "Commit relevant changes and push through the git workflow",
"template": "{file:commands/git.md}\n\nExecute this git task:\nCommit the relevant changes with a compliant conventional commit message and push the current branch to its remote. Before pushing, inspect every local commit that would be published: compare against the tracked upstream when one exists, otherwise compare against the branch point from the repository default branch and stop if unrelated committed work would also be published. If no upstream exists and the published commit set is correct, push with upstream tracking. If there is nothing to commit, do not create an empty commit. If hooks fail or the push is ambiguous, stop and report the blocker.\n\nAdditional context: $ARGUMENTS",
"agent": "git-specialist",
"subtask": true,
},
"plan": {
"description": "Create a detailed implementation plan for complex features",
"template": "{file:commands/plan.md}\n\n$ARGUMENTS",
"agent": "planner",
"subtask": true,
},
"tdd": {
"description": "Enforce TDD workflow with 80%+ test coverage",
"template": "{file:commands/tdd.md}\n\n$ARGUMENTS",
"agent": "tdd-guide",
"subtask": true,
},
"code-review": {
"description": "Review code for quality, security, and maintainability",
"template": "{file:commands/code-review.md}\n\n$ARGUMENTS",
"agent": "code-reviewer",
"subtask": true,
},
"security": {
"description": "Run comprehensive security review",
"template": "{file:commands/security.md}\n\n$ARGUMENTS",
"agent": "security-reviewer",
"subtask": true,
},
"build-fix": {
"description": "Fix build and TypeScript errors with minimal changes",
"template": "{file:commands/build-fix.md}\n\n$ARGUMENTS",
"agent": "build-error-resolver",
"subtask": true,
},
"e2e": {
"description": "Generate and run E2E tests with Playwright",
"template": "{file:commands/e2e.md}\n\n$ARGUMENTS",
"agent": "e2e-runner",
"subtask": true,
},
"refactor-clean": {
"description": "Remove dead code and consolidate duplicates",
"template": "{file:commands/refactor-clean.md}\n\n$ARGUMENTS",
"agent": "refactor-cleaner",
"subtask": true,
},
"orchestrate": {
"description": "Orchestrate multiple agents for complex tasks",
"template": "{file:commands/orchestrate.md}\n\n$ARGUMENTS",
"agent": "planner",
"subtask": true,
},
"learn": {
"description": "Extract patterns and learnings from session",
"template": "{file:commands/learn.md}\n\n$ARGUMENTS",
},
"checkpoint": {
"description": "Save verification state and progress",
"template": "{file:commands/checkpoint.md}\n\n$ARGUMENTS",
},
"verify": {
"description": "Run verification loop",
"template": "{file:commands/verify.md}\n\n$ARGUMENTS",
},
"eval": {
"description": "Run evaluation against criteria",
"template": "{file:commands/eval.md}\n\n$ARGUMENTS",
},
"update-docs": {
"description": "Update documentation",
"template": "{file:commands/update-docs.md}\n\n$ARGUMENTS",
"agent": "doc-updater",
"subtask": true,
},
"update-codemaps": {
"description": "Update codemaps",
"template": "{file:commands/update-codemaps.md}\n\n$ARGUMENTS",
"agent": "doc-updater",
"subtask": true,
},
"test-coverage": {
"description": "Analyze test coverage",
"template": "{file:commands/test-coverage.md}\n\n$ARGUMENTS",
"agent": "tdd-guide",
"subtask": true,
},
"setup-pm": {
"description": "Configure package manager",
"template": "{file:commands/setup-pm.md}\n\n$ARGUMENTS",
},
"skill-create": {
"description": "Generate skills from git history",
"template": "{file:commands/skill-create.md}\n\n$ARGUMENTS",
},
"instinct-status": {
"description": "View learned instincts",
"template": "{file:commands/instinct-status.md}\n\n$ARGUMENTS",
},
"instinct-import": {
"description": "Import instincts",
"template": "{file:commands/instinct-import.md}\n\n$ARGUMENTS",
},
"instinct-export": {
"description": "Export instincts",
"template": "{file:commands/instinct-export.md}\n\n$ARGUMENTS",
},
"evolve": {
"description": "Cluster instincts into skills",
"template": "{file:commands/evolve.md}\n\n$ARGUMENTS",
},
},
"mcp": {
"serena": {
"type": "local",
"command": [
"uvx",
"--from",
"git+https://github.com/oraios/serena",
"serena",
"start-mcp-server",
"--open-web-dashboard",
"false",
],
"enabled": true,
},
"context7": {
"type": "local",
"command": ["npx", "-y", "@upstash/context7-mcp@latest"],
},
"wallaby": {
"type": "local",
"command": ["npx", "-y", "-c", "node ~/.wallaby/mcp/"],
},
"Figma": {
"type": "remote",
"url": "https://mcp.figma.com/mcp",
"headers": {},
"enabled": false,
},
},
"plugin": ["@tarquinen/opencode-dcp@latest"],
}