Repository navigation
Expand file tree
/
Copy pathopencode.jsonc
More file actions
514 lines (514 loc) · 22.3 KB
/
Copy pathopencode.jsonc
File metadata and controls
514 lines (514 loc) · 22.3 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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"*": "allow",
"external_directory": "ask",
"doom_loop": "ask",
},
"agent": {
"architect": {
"description": "Software Architect \u2014 strategic thinking for meta-systems and agentic harnesses. Applies recursive spatialize/branch/benchmark/converge loop with cross-domain pattern transfer.",
"mode": "subagent",
"permission": {
"edit": "ask",
"task": {
"*": "deny",
"explore": "allow",
"plan": "allow",
"review": "allow",
"scout": "allow",
"worker": "allow",
},
},
"prompt": "# Software Architect\\nFull methodology in .opencode/rules/architect-methodology.mdc.\\n\\nCore loop: SPATIALIZE → BRANCH → BENCHMARK → CONVERGE\\n- Treat architecture as discovery, not design\\n- Cross-domain benchmark every novel decision\\n- Every decision needs a falsification criterion\\n- Socratic dialogue with human. Status at every interaction.",
"steps": 15,
},
"build": {
"disable": false,
"mode": "primary",
"permission": {
"sequential-thinking_*": "allow",
},
"prompt": "## Build Agent\n\nALWAYS load the dev-defaults skill FIRST: skill(name='dev-defaults'). Strategic thinking patterns (RESEARCH -> CHALLENGE -> EXTRAPOLATE -> DECIDE) on EVERY interaction.\n\nDetailed rules are in .opencode/rules/build-workflow.mdc and build-meta-learning.mdc.\n\nKey points:\n- Load dev-defaults skill before anything else\n- searxng_web_search FIRST, websearch_tavily_search 2nd, webfetch fallback\n- Delegate to explore/scout/plan/worker/review (max depth 3)\n- gh CLI over GitHub MCP for GitHub operations\n- Run lsp_diagnostics + build check before completing tasks\n- Load domain skills via skill() for specific tasks — NEVER use read() to load skills, always use skill() tool\n- For web research / factual-lookup: load authoritative-search via skill(name='authoritative-search') — NEVER use read(), always skill() — applies consensus/authority discipline (cross-verify load-bearing claims via extractor sidecar at 127.0.0.1:8081, emit provenance).",
"steps": 40,
},
"general": {
"description": "General-purpose agent for researching complex questions and executing multi-step tasks",
"mode": "subagent",
"prompt": "\n\n## Context-Mode Tooling (Memory & Research)\nThis agent has access to context-mode tools for persistent memory and research:\n- ctx_search: Search indexed knowledge (codebase patterns, prior decisions)\n- ctx_fetch_and_index: Fetch web content and store in searchable index\n- ctx_index: Store structured knowledge for future retrieval\n- ctx_batch_execute: Run multiple shell queries efficiently\n\nUse ctx_search before asking repetitive questions. Use ctx_fetch_and_index for web research that benefits future sessions. Prefer ctx_batch_execute over multiple sequential shell commands.\n\nFor web research / factual-lookup: load authoritative-search via skill(name='authoritative-search') — NEVER use read() to load skills, always use skill() tool — applies consensus/authority discipline (cross-verify load-bearing claims via extractor sidecar at 127.0.0.1:8081, emit provenance).",
"steps": 15,
},
"plan": {
"permission": {
"bash": "deny",
"edit": "deny",
"sequential-thinking_*": "allow",
},
"prompt": "Keep plans concise and decision-complete. For complex decomposition, use sequential-thinking before finalizing the plan.",
"steps": 15,
},
"review": {
"description": "Review diffs for bugs, regressions, risky changes, and missing tests.",
"mode": "subagent",
"permission": {
"edit": "deny",
},
"prompt": "On start, log to audit trail: bash ~/.local/share/opencode/scripts/hooks/log-agent.sh 'review' '${description:-review}' 2>/dev/null || true.\nOn completion, log stop: bash ~/.local/share/opencode/scripts/hooks/log-agent-stop.sh 'review' 'completed' 2>/dev/null || true.\n\nReview code changes with a code-review mindset. Prioritize bugs, behavioral regressions, risky assumptions, security issues, and missing tests. Present findings first, ordered by severity, and keep summaries brief. If the task references pull requests, issues, reviews, or commits, prefer the gh CLI for that context.",
"steps": 15,
},
"scout": {
"description": "Read-only agent for external docs and dependency research. Clone repos into managed cache, inspect library source, cross-reference upstream implementations.",
"mode": "subagent",
"permission": {
"edit": "deny",
},
"prompt": "## MANDATORY - Search Tool Order\nYou MUST use `searxng_web_search` FIRST for all web searches (free, self-hosted, no rate limits).\nIf SearXNG returns empty or errors, fall back to `websearch_tavily_search` (Tavily).\nIf Tavily is unavailable, use `webfetch` for known URLs.\nUse `webfetch` for known URLs (free).\n\nYou are Scout. Research external dependencies, clone repos into OpenCode's managed cache, inspect library source, and cross-reference local code against upstream implementations. Do not modify the workspace.\n\nFor web research / factual-lookup: load authoritative-search via skill(name='authoritative-search') — NEVER use read() to load skills, always use skill() tool — applies consensus/authority discipline (cross-verify load-bearing claims via extractor sidecar at 127.0.0.1:8081, emit provenance).",
"steps": 10,
},
"test-writer": {
"description": "Test specialist - generates comprehensive unit, integration, and e2e tests. Can only write to test files.",
"mode": "subagent",
"permission": {
"edit": {
"*": "deny",
"**/*.spec.ts": "allow",
"**/*.spec.tsx": "allow",
"**/*.test.py": "allow",
"**/*.test.rs": "allow",
"**/*.test.ts": "allow",
"**/*.test.tsx": "allow",
"**/*_test.go": "allow",
},
"write": {
"*": "deny",
"**/*.spec.ts": "allow",
"**/*.spec.tsx": "allow",
"**/*.test.py": "allow",
"**/*.test.rs": "allow",
"**/*.test.ts": "allow",
"**/*.test.tsx": "allow",
"**/*_test.go": "allow",
},
},
"prompt": "You are a test writer. Generate comprehensive tests covering happy paths, edge cases, and failure modes. You can ONLY read source files and write test files. Do NOT modify source code. Use the Given/When/Then pattern.",
"steps": 20,
"temperature": 0.2,
},
"explore": {
"description": "Contextual grep for codebases — when prompt starts with 'research:' ALWAYS load authoritative-search first: skill(name='authoritative-search') — NEVER use read() for skills.",
"mode": "subagent",
"prompt": "For ANY web research / factual-lookup: load authoritative-search FIRST via skill(name='authoritative-search') — NEVER use read() to load skills, always use skill() tool — do this BEFORE any grep/glob/searxng. Applies consensus/authority discipline (cross-verify via extractor 127.0.0.1:8081, emit provenance).",
"steps": 15,
},
"sisyphus": {
"description": "Sisyphus orchestrator — meta-research exhaustive default (fans out all directions) + authoritative-search discipline. For ANY research: load meta-research: skill(name='meta-research') which fans out via authoritative-search.",
"mode": "primary",
"prompt": "For ANY research / understanding task: load meta-research FIRST via skill(name='meta-research') — exhaustive fan-out across all intents/source types/languages (assumes user doesn't know what they want). It wraps authoritative-search per direction (SearXNG+14 connectors+extractor 127.0.0.1:8081, trust 75/25+RRF, CONFIRMED/LIKELY/CONFLICTED tags, provenance). For simple factual-lookup, authoritative-search alone is fine: skill(name='authoritative-search'). NEVER use read() for skills. Sisyphus delegates to build/general/scout/worker/explore (all wired).",
"steps": 50,
},
"worker": {
"description": "Fresh-context implementation or verification lane when the main thread is saturated, context is degraded, or the task needs a clean slice.",
"mode": "subagent",
"permission": {
"edit": "ask",
"task": {
"*": "deny",
"explore": "allow",
"scout": "allow",
},
},
"prompt": "## MANDATORY - Search Tool Order\nYou MUST use `searxng_web_search` FIRST for all web searches (free, self-hosted, no rate limits).\nIf SearXNG returns empty or errors, fall back to `websearch_tavily_search` (Tavily).\nIf Tavily is unavailable, use `webfetch` for known URLs.\nUse `webfetch` for known URLs (free).\n\nOn start, log to audit trail: bash ~/.local/share/opencode/scripts/hooks/log-agent.sh 'worker' '${description:-implementation}' 2>/dev/null || true.\nOn completion, log stop: bash ~/.local/share/opencode/scripts/hooks/log-agent-stop.sh 'worker' 'completed' 2>/dev/null || true.\nYou have at most 30 tool calls to complete this task. If stuck, write partial output and report BENCH_SUCCESS: false. The parent orchestrator will handle fallback.\n\nYou may delegate read-only research to explore or scout subagents using the task tool. Do NOT delegate implementation to other workers. You are a leaf implementation agent\n\n## Verification Gate (MANDATORY Before Marking Done)\nAfter every edit cycle, BEFORE marking a todo complete:\n1. Run `lsp_diagnostics` on ALL changed files - fix any new errors\n2. If the project has a build/check command (`cargo check`, `npm run check`, `tsc --noEmit`), run it\n3. Verify diagnostics are clean (zero new errors vs pre-change state)\n4. Only after passing verification, mark the todo as completed\n5. If build/check fails, fix before moving on\n\nPre-existing errors (errors present before your changes) are NOT your responsibility.\n\nFor web research / factual-lookup: load authoritative-search via skill(name='authoritative-search') — NEVER use read() to load skills, always use skill() tool — applies consensus/authority discipline (cross-verify load-bearing claims via extractor sidecar at 127.0.0.1:8081, emit provenance).",
"steps": 30,
},
},
"autoupdate": "notify",
"command": {
"architect": {
"agent": "architect",
"description": "Consult the Software Architect for architecture decisions and design",
"subtask": false,
"template": "You are the Software Architect. Analyze the current design context and codebase. Use the spatialize/branch/benchmark/converge loop with cross-domain pattern transfer to explore architectural options. Apply the 6-step cross-domain benchmark when evaluating novel decisions. After each decision, save an Architecture Decision Record to `.omo/adr/<slug>.md` with: context, decision, consequences, alternatives considered. Report findings with a recommended direction and confidence level.",
},
"dev-protocol": {
"agent": "build",
"description": "Run the Development Protocol on the current project — reads dynamically from the protocol repo",
"subtask": false,
"template": "Load the dev-protocol skill: skill(name='dev-protocol'). Then execute the Development Protocol on the current project. Read the protocol from ~/projects/dev/Development-Protocol/ — determine the current pipeline, and execute each step in order, saving artifacts to .omo/plans/. Start from step 1 unless a specific step is mentioned in the user's message after the command.",
},
"review-staged": {
"agent": "review",
"description": "Review staged changes before commit",
"subtask": true,
"template": "Review only the staged changes with a code review mindset. Prioritize bugs, regressions, risky behavior changes, and missing tests. Return findings first, ordered by severity, with concise evidence.\n\nGit status:\n!`git status --short --branch`\n\nStaged diff:\n!`git diff --staged --no-ext-diff`",
},
"review-work": {
"agent": "build",
"description": "Full post-implementation review: goals, quality, security, QA, context",
"subtask": false,
"template": "Load the review-work skill: skill(name='review-work'). Then: review ALL uncommitted changes against these passes: (1) goal/constraint verification, (2) code quality, (3) security, (4) functional QA, (5) context mining from git log. All must pass. Report findings per pass.",
},
"review-working": {
"agent": "review",
"description": "Review current working tree changes",
"subtask": true,
"template": "Review the current working tree changes with a code review mindset. Prioritize bugs, regressions, risky behavior changes, and missing tests. Return findings first, ordered by severity, with concise evidence.\n\nGit status:\n!`git status --short --branch`\n\nDiff:\n!`git diff --no-ext-diff`",
},
"security-research": {
"agent": "build",
"description": "Full security audit on current working tree — OWASP ASVS/WSTG, PoC exploitability",
"subtask": false,
"template": "Load the security-research skill: skill(name='security-research'). Then execute a full security audit of the current working tree changes against OWASP ASVS/WSTG standards. Prove exploitability with PoC code, classify root causes by CWE, and calibrate severity by actual exploitability. Report findings with CWE references and remediation guidance.",
},
"ship-notes": {
"agent": "plan",
"description": "Draft commit and PR text from current changes",
"subtask": true,
"template": "Inspect the current changes and draft release text.\n\nGit status:\n!`git status --short --branch`\n\nDiff:\n!`git diff --no-ext-diff`\n\nProduce exactly these sections:\n1. Commit message\n2. PR title\n3. PR summary\n\nRequirements:\n- Plain ASCII only\n- No mention of AI use\n- Neutral, human-sounding wording\n- No branch naming suggestions unless explicitly requested",
},
},
"compaction": {
"auto": false,
"prune": true,
"reserved": 15000,
},
"default_agent": "sisyphus",
"disabled_providers": ["openai", "anthropic", "google", "xai"],
"experimental": {
"continue_loop_on_deny": true,
},
"formatter": {
"gofumpt": {
"command": ["gofumpt", "-w", "$FILE"],
"extensions": [".go"],
},
"prettier": {
"command": ["prettier", "--write", "$FILE"],
"extensions": [
".js",
".jsx",
".ts",
".tsx",
".mjs",
".cjs",
".mts",
".cts",
".html",
".css",
".json",
".jsonc",
".yaml",
".yml",
".md",
],
},
"ruff": {
"command": ["ruff", "format", "$FILE"],
"extensions": [".py", ".pyi"],
},
"rustfmt": {
"command": ["rustfmt", "$FILE"],
"extensions": [".rs"],
},
},
"instructions": ["AGENTS.md", "docs/AGENTS.md"],
"lsp": {
"basedpyright": {
"command": ["basedpyright-langserver", "--stdio"],
"extensions": [".py", ".pyi"],
"initialization": {
"basedpyright": {
"analysis": {
"typeCheckingMode": "basic",
},
},
"python": {
"analysis": {
"typeCheckingMode": "basic",
},
},
},
},
"css": {
"command": ["vscode-css-language-server", "--stdio"],
"extensions": [".css", ".scss", ".less"],
},
"gopls": {
"command": ["gopls"],
"extensions": [".go"],
"initialization": {
"gofumpt": true,
"staticcheck": true,
},
},
"html": {
"command": ["vscode-html-language-server", "--stdio"],
"extensions": [".html", ".htm"],
},
"json": {
"command": ["vscode-json-language-server", "--stdio"],
"extensions": [".json", ".jsonc"],
},
"markdown": {
"command": ["vscode-markdown-language-server", "--stdio"],
"extensions": [".md", ".mdc"],
},
"rust-analyzer": {
"command": ["rust-analyzer"],
"extensions": [".rs"],
},
"typescript": {
"command": ["resolve-ts-lsp"],
"extensions": [
".ts",
".tsx",
".js",
".jsx",
".mjs",
".cjs",
".mts",
".cts",
],
},
},
"mcp": {
"playwright": {
"command": ["npx", "-y", "@playwright/mcp@0.0.78", "--headless"],
"enabled": true,
"type": "local",
},
"searxng": {
"command": ["mcp-searxng"],
"enabled": true,
"environment": {
"SEARXNG_TIMEOUT_MS": "60000",
"SEARXNG_URL": "http://127.0.0.1:8888",
},
"type": "local",
},
"sequential-thinking": {
"command": [
"npx",
"-y",
"@modelcontextprotocol/server-sequential-thinking@2026.7.4",
],
"enabled": true,
"type": "local",
},
},
"model": "opencode-go/gpt-5.6-luna",
"permission": {
"bash": {
"*": "allow",
"/bin/chmod *": "ask",
"/bin/chown *": "deny",
"/bin/dd *": "deny",
"/bin/rm *": "allow",
"/bin/rm -rf *": "deny",
"/sbin/mkfs *": "deny",
"/sbin/poweroff": "deny",
"/sbin/poweroff *": "deny",
"/sbin/reboot": "deny",
"/sbin/reboot *": "deny",
"/sbin/shutdown *": "deny",
"/usr/bin/chmod *": "ask",
"/usr/bin/chown *": "deny",
"/usr/bin/dd *": "deny",
"/usr/bin/rm *": "allow",
"/usr/bin/rm -rf *": "deny",
"/usr/bin/sudo *": "deny",
"base64 * | sh*": "deny",
"bash -c *": "deny",
"cargo publish": "ask",
"cargo publish *": "ask",
"chmod -R 777 *": "ask",
"chmod 777 *": "ask",
"curl * | sh*": "deny",
"dd *": "deny",
"del *": "deny",
"eval *": "deny",
"gh repo create": "ask",
"gh repo delete": "deny",
"gh repo delete *": "deny",
"gh api -X DELETE repos/*": "deny",
"gh api --method DELETE repos/*": "deny",
"gh api -X DELETE user/*": "deny",
"git clean -fd": "ask",
"git push --force": "ask",
"git push --force-with-lease": "allow",
"git push -f": "ask",
"git reset --hard *": "ask",
"icacls *": "deny",
"mkfs *": "deny",
"node -e *": "deny",
"npm publish": "ask",
"npm publish *": "ask",
"npx -y *": "deny",
"perl -e *": "deny",
"pip install *": "ask",
"pip3 install *": "ask",
"poweroff": "deny",
"python -c *": "deny",
"python3 -c *": "deny",
"rd *": "deny",
"reboot": "deny",
"Remove-Item *": "deny",
"rm -rf *": "deny",
"rtk *": "deny",
"ruby -e *": "deny",
"sh -c *": "deny",
"shutdown *": "deny",
"sudo *": "ask",
"takeown *": "deny",
"wget * | sh*": "deny",
},
"doom_loop": "deny",
"edit": {
"*": "allow",
"**/*.jks": "deny",
"**/*.keystore": "deny",
"**/*.p12": "deny",
"**/*.pem": "deny",
"**/*.pfx": "deny",
"**/.aws/config": "deny",
"**/.config/gh/hosts.yml": "deny",
"**/.gitconfig": "deny",
"**/.docker/config.json": "deny",
"**/.env": "deny",
"**/.env.*": "deny",
"**/.gnupg/**": "deny",
"**/.kube/config": "deny",
"**/.local/share/opencode/auth.json": "deny",
"**/.netrc": "deny",
"**/.npmrc": "deny",
"**/.pypirc": "deny",
"**/.ssh/config": "deny",
"**/credentials*": "deny",
"**/id_dsa": "deny",
"**/id_ecdsa": "deny",
"**/id_ed25519": "deny",
"**/id_rsa": "deny",
"**/secrets/**": "deny",
".git/**": "deny",
},
"external_directory": {
"*": "ask",
"/tmp/opencode/*": "allow",
"~/.agents/skills/**": "allow",
"~/.local/share/opencode/*": "allow",
"~/projects/**": "allow",
"~/.config/act/**": "allow",
"~/.cache/tmp/opencode/**": "allow",
},
"glob": "allow",
"grep": "allow",
"list": "allow",
"lsp": "allow",
"playwright_*": "ask",
"question": "allow",
"read": {
"*": "allow",
"**/*.jks": "deny",
"**/*.keystore": "deny",
"**/*.p12": "deny",
"**/*.pem": "deny",
"**/*.pfx": "deny",
"**/.aws/config": "deny",
"**/.config/gh/hosts.yml": "deny",
"**/.gitconfig": "deny",
"**/.docker/config.json": "deny",
"**/.env": "deny",
"**/.env.*": "deny",
"**/.ssh/config": "deny",
"**/.local/share/opencode/auth.json": "deny",
"**/.gnupg/**": "deny",
"**/.kube/config": "deny",
"**/.netrc": "deny",
"**/.npmrc": "deny",
"**/.pypirc": "deny",
"**/credentials*": "deny",
"**/id_dsa": "deny",
"**/id_ecdsa": "deny",
"**/id_ed25519": "deny",
"**/id_rsa": "deny",
"**/secrets/**": "deny",
},
"searxng_*": "allow",
"sequential-thinking_*": "allow",
"skill": "allow",
"todowrite": "allow",
"webfetch": "allow",
"websearch": "allow",
"write": {
"*": "allow",
"**/*.jks": "deny",
"**/*.keystore": "deny",
"**/*.p12": "deny",
"**/*.pem": "deny",
"**/*.pfx": "deny",
"**/.aws/config": "deny",
"**/.docker/config.json": "deny",
"**/.env": "deny",
"**/.env.*": "deny",
"**/.gnupg/**": "deny",
"**/.kube/config": "deny",
"**/.netrc": "deny",
"**/.npmrc": "deny",
"**/.pypirc": "deny",
"**/credentials*": "deny",
"**/id_dsa": "deny",
"**/id_ecdsa": "deny",
"**/id_ed25519": "deny",
"**/id_rsa": "deny",
"**/secrets/**": "deny",
".git/**": "deny",
},
},
"plugin": [
"oh-my-openagent@4.19.4",
"opencode-command-inject@1.3.0",
"@tarquinen/opencode-dcp@3.1.15",
],
"provider": {
"deepseek": {
"name": "DeepSeek",
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://api.deepseek.com/v1",
},
},
},
"shell": "bash",
"small_model": "opencode-go/mimo-v2-omni",
"subagent_depth": 3,
"tool_output": {
"max_bytes": 25600,
"max_lines": 1000,
},
"tui": {
"status_line": ["model", "context-remaining", "current-dir"],
},
"watcher": {
"ignore": [
"node_modules/**",
"dist/**",
"build/**",
".git/**",
"target/**",
"__pycache__/**",
"*.lock",
"**/*.log",
".cache/**",
".venv/**",
"venv/**",
".omo/**",
"*.pyc",
".next/**",
".nuxt/**",
"coverage/**",
".ruff_cache/**",
".pytest_cache/**",
"*.egg-info/**",
".gradle/**",
],
},
}