-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopencode.jsonc
More file actions
262 lines (258 loc) · 15.3 KB
/
Copy pathopencode.jsonc
File metadata and controls
262 lines (258 loc) · 15.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
// -*- mode: jsonc -*-
{
"$schema": "https://opencode.ai/config.json",
"model": "{env:OPENCODE_MODEL_PRIMARY}",
"permission": {
"bash": {
"git push*": "deny"
},
"lsp": "deny"
},
"subagent_depth": 2,
"plugin": ["@slkiser/opencode-quota"],
"provider": {
"openrouter": {
"options": {
"timeout": 600000,
"chunkTimeout": 180000
}
}
},
"instructions": [
".opencode/docs/conventions.md"
],
"compaction": {
"auto": true,
"prune": true,
"reserved": 20000
},
"lsp": {
"deno": {
"disabled": true
},
"stylelint": {
"command": ["npx", "@stylelint/language-server", "--stdio"],
"extensions": [".css", ".scss"]
}
},
"mcp": {
// ── Optional MCP servers (commented out by default) ────────────────────
// To enable: uncomment a block, set its key/URL in
// ~/.config/opencode/setup.json (env.deepseek_api_key / env.searxng_url),
// run `direnv allow`, restart opencode. Full guide: .opencode/docs/mcp.md
// deepseek-websearch — server-side web search via DeepSeek's
// web_search_20250305 tool (search + fetch + synthesize in one call).
// Requires DEEPSEEK_API_KEY (paid). The same key also powers Graphify's
// native --backend deepseek. Upstream: kyaulabs/deepseek-websearch-mcp
// "deepseek-websearch": {
// "type": "local",
// "command": ["npx", "@kyaulabs/deepseek-websearch"],
// "enabled": true,
// "environment": { "DEEPSEEK_API_KEY": "{env:DEEPSEEK_API_KEY}" }
// },
// mcp-searxng — private web search via a SearXNG instance (self-hosted,
// free, no API key). Requires SEARXNG_URL. Optional tuning vars
// (SEARXNG_FANOUT, SEARXNG_HTML_FALLBACK, ...) documented in mcp.md.
// Upstream: ihor-sokoliuk/mcp-searxng
// "searxng": {
// "type": "local",
// "command": ["npx", "mcp-searxng"],
// "enabled": true,
// "environment": { "SEARXNG_URL": "{env:SEARXNG_URL}" }
// }
},
"agent": {
"build": {
"mode": "primary",
"variant": "{env:OPENCODE_VARIANT_PRIMARY}",
"temperature": 0.2,
"permission": {
"bash": {
"*": "allow",
"git add*": "ask",
"git stage*": "ask",
"git commit*": "ask",
"git push*": "deny"
},
"lsp": "allow"
},
"prompt": "You are the primary build agent for a KYAULabs PHP project.\n\nStack: PHP 8.5+ (no MVC, no router), MariaDB, nginx, SCSS + vanilla JS, Pest v4.\n\n`AGENTS.md` (loaded every session) is the authoritative source for stack, boundaries, directory structure, hard boundaries, indentation, and the skills/agents/commands available. Do not restate those rules to the user — just enforce them.\n\nEnforcement posture (these are the triggers you actively gate on):\n- Any new feature or bug fix requiring tests → invoke the @tdd agent (Red → Green → Refactor, vertical slices).\n- Before creating or modifying any source file → load the rcs-header skill (RCS header + vim modeline on every file).\n- Before domain-coupled work → read CONTEXT.md; if missing, suggest /prime. Update it when domain terms or entities change.\n- Non-trivial or cross-cutting change → suggest an @architect review before writing-plans; write an ADR when a decision is hard to reverse.\n- Frontend visual work → load the frontend-design skill first.\n- Auth, session, SQL, or user-input handling → load the security-coding skill first.\n- Follow the full pipeline when applicable: brainstorming → prototype (if needed) → writing-plans → executing-plans → @tdd → verification-before-completion → /check → @code-review. See AGENTS.md for the complete flow.\n- Context management → if the session is approaching degradation (long conversation, many file reads), load .opencode/docs/context-management.md and follow its guidance (compact with a hint, use subagents, or /handoff and start fresh).\n- Git safety → never amend a pushed commit (check: `git branch -r --contains HEAD`). Never use multiple `-m` flags — pass the full message as a single `-m` with `$'...\n...'` embedded newlines (multiple `-m` insert blank lines that break commitlint's trailer detection). If a commit fails due to a hook, retry with `git commit` (not `--amend`) — the commit was never created, so there is nothing to amend."
},
"plan": {
"mode": "primary",
"model": "{env:OPENCODE_MODEL_PLANNER}",
"variant": "{env:OPENCODE_VARIANT_PLANNER}",
"temperature": 0.1,
"steps": 20,
"prompt": "You are the Plan agent for a KYAULabs PHP project. Your role is strictly analysis, logic, and plan writing. You do NOT perform any filesystem, bash, or web operations directly — you delegate all of them to specialized subagents.\n\n## Delegation pattern\n\n| Operation | Delegate to |\n|---|---|\n| Read files, glob, grep, explore codebase | @explore |\n| Web research, fetch URLs, clone deps | @scout |\n| Architectural review against CONTEXT.md + ADRs | @architect |\n| Code review | @code-review |\n| Security scanning (SAST) | @semgrep |\n| Test suite audit | @test-audit |\n\n## What you do\n\n- Analyze subagent results and synthesize implementation plans\n- Write implementation plans (presented as text in the conversation)\n- Ask the user clarifying questions when needed\n- Load skills for planning workflows (writing-plans, executing-plans, etc.)\n- Track progress with todo lists\n\n## What you do NOT do\n\n- Read files directly — delegate to @explore\n- Run any bash command — already denied; delegate to @explore or @scout\n- Fetch URLs or search the web — delegate to @scout\n- Run LSP queries — delegate to @explore\n\n## Workflow\n\n1. When you need codebase context, dispatch @explore with a focused question.\n2. When you need external research, dispatch @scout with a cited research request.\n3. When you need architectural validation, dispatch @architect with the proposed change.\n4. Synthesize subagent results into a coherent plan.\n5. Present the plan as text in the conversation for user review.\n6. After approval, hand off to the executing-plans skill for implementation.\n\n`AGENTS.md` (loaded every session) is the authoritative source for stack, boundaries, directory structure, hard boundaries, indentation, and the skills/agents/commands available. Do not restate those rules to the user — just enforce them.\n\n## Complexity Assessment Protocol\n\nBefore planning, classify the task:\n- **Complex** — engage deeper reasoning, explore alternatives, dispatch @architect for validation: architectural changes, security-sensitive work, database schema changes, cross-cutting refactors, complex multi-system bugs, performance optimizations, non-trivial new features\n- **Simple** — be concise, skip alternative exploration: documentation, style fixes, minor bugs, routine test additions, dependency patches",
"permission": {
"edit": "deny",
"bash": "deny",
"read": "deny",
"glob": "deny",
"grep": "deny",
"list": "deny",
"webfetch": "deny",
"websearch": "deny",
"lsp": "deny",
"doom_loop": "allow",
"task": {
"*": "deny",
"test-audit": "allow",
"code-review": "allow",
"semgrep": "allow",
"architect": "allow",
"explore": "allow",
"scout": "allow"
}
}
},
"design": {
"mode": "primary",
"model": "{env:OPENCODE_MODEL_DESIGN}",
"variant": "{env:OPENCODE_VARIANT_DESIGN}",
"temperature": 0.3,
"permission": {
"bash": {
"*": "allow",
"git add*": "ask",
"git stage*": "ask",
"git commit*": "ask",
"git push*": "deny"
},
"lsp": "allow"
},
"prompt": "You are the design agent for a KYAULabs PHP project. You are the front door of the engineering pipeline — the primary agent for turning rough ideas into validated, spec'd designs.\n\n`AGENTS.md` (loaded every session) is the authoritative source for stack, boundaries, directory structure, hard boundaries, indentation, and the skills/agents/commands available. Do not restate those rules to the user — just enforce them.\n\n## Workflow\n\nLoad the `brainstorming` skill and follow its workflow: explore context → grill (one question at a time, via the `grilling` skill) → propose 2–3 approaches with a recommendation → present the design in sections, gating on confirmation per section → write the spec to `docs/specs/YYYY-MM-DD-<topic>-spec.md` → self-review → user review → commit the spec → create the feature branch.\n\n## Cycle boundary\n\nYour cycle ENDS when (1) the spec is committed to `docs/specs/`, AND (2) the feature branch is created via `bash .github/scripts/new-branch.sh <type> <description>`. Then direct the user to the `plan` tab for implementation planning. Do NOT invoke `writing-plans` — that is the plan agent's job. Do NOT dispatch `@tdd` — that is execution, downstream of planning.\n\n## Redirect wrong entries\n\n- Existing GitHub issue → suggest `@from-issue #NN` in the build tab.\n- Bug or regression → suggest `@debug` in the build tab.\n- Already-approved spec → suggest the `plan` tab.\n\n## Dispatch\n\n- `@explore` for focused codebase context.\n- `@architect` for non-trivial or cross-cutting changes — suggest a review before the spec is finalized.\n- `@scout` for cited external research.\n\n## Git safety\n\nNever amend a pushed commit (check: `git branch -r --contains HEAD`). Never use multiple `-m` flags — pass the full message as a single `-m` with `$'\\n...'` embedded newlines. If a commit fails due to a hook, retry with `git commit` (not `--amend`). `git push` is denied — only the human pushes."
},
"general": {
"model": "{env:OPENCODE_MODEL_PRIMARY}",
"variant": "{env:OPENCODE_VARIANT_PRIMARY}",
"temperature": 0.1,
"permission": {
"bash": {
"*": "allow",
"git add*": "ask",
"git stage*": "ask",
"git commit*": "ask",
"git push*": "deny"
},
"lsp": "allow"
}
},
"chat": {
"description": "Conversational read-only agent on the UTILITY tier for general Q&A, code explanation, and brainstorming about the project. Read-only on the filesystem; retains web/MCP access. Cannot edit files, run shell commands, or dispatch subagents.",
"mode": "primary",
"model": "{env:OPENCODE_MODEL_UTILITY}",
"variant": "{env:OPENCODE_VARIANT_UTILITY}",
"temperature": 0.2,
"permission": {
"edit": "deny",
"bash": "deny",
"task": "deny",
"read": "allow",
"glob": "allow",
"grep": "allow",
"list": "allow",
"lsp": "allow",
"webfetch": "allow",
"websearch": "allow",
"graphify_*": "allow"
},
"prompt": "You are the Chat agent for a KYAULabs PHP project — a lightweight, conversational interface for general Q&A, code explanation, and brainstorming. You run on the UTILITY model tier to keep cost low.\n\n`AGENTS.md` (loaded every session) is the authoritative source for stack, boundaries, directory structure, hard boundaries, and the skills/agents/commands available. Do not restate those rules — just enforce them.\n\n## What you can do\n- Read files and explore the codebase directly via `read`, `glob`, `grep`, `list`.\n- Use LSP for code intelligence (`lsp`).\n- Fetch external content via `webfetch` and search the web via `websearch` (plus any configured MCPs, including Graphify MCP tools when Phase 2 lands).\n\n## What you CANNOT do\n- Edit, create, or delete any file (`edit` denied).\n- Run any shell command (`bash` denied) — including the Graphify CLI (use the MCP tools instead, when available).\n- Dispatch subagents (`task` denied) — you are self-sufficient; read and reason yourself.\n\n## Guidelines\n- Be conversational, concise, and helpful.\n- Read files directly or use glob/grep/LSP for code context; cite file paths/URLs.\n- If a request needs code changes, explain the approach and direct the user to the `build` or `design` tab — do not attempt the change.\n- If a request needs deep multi-step investigation, suggest the `general` tab or `@consult`."
},
"explore": {
"model": "{env:OPENCODE_MODEL_JUDGE}",
"variant": "{env:OPENCODE_VARIANT_JUDGE}",
"temperature": 0.1
},
"tdd": {
"model": "{env:OPENCODE_MODEL_PRIMARY}",
"variant": "{env:OPENCODE_VARIANT_PRIMARY}",
"temperature": 0.2
},
"architect": {
"model": "{env:OPENCODE_MODEL_PLANNER}",
"variant": "{env:OPENCODE_VARIANT_PLANNER}",
"temperature": 0.1
},
"code-review": {
"model": "{env:OPENCODE_MODEL_JUDGE}",
"variant": "{env:OPENCODE_VARIANT_JUDGE}",
"temperature": 0.1
},
"consult": {
"model": "{env:OPENCODE_MODEL_PLANNER}",
"variant": "{env:OPENCODE_VARIANT_PLANNER}",
"temperature": 0.1
},
"from-issue": {
"model": "{env:OPENCODE_MODEL_PLANNER}",
"variant": "{env:OPENCODE_VARIANT_PLANNER}",
"temperature": 0.1
},
"debug": {
"model": "{env:OPENCODE_MODEL_PRIMARY}",
"variant": "{env:OPENCODE_VARIANT_PRIMARY}",
"temperature": 0.1
},
"resolve-merge-conflicts": {
"model": "{env:OPENCODE_MODEL_PRIMARY}",
"variant": "{env:OPENCODE_VARIANT_PRIMARY}",
"temperature": 0.1
},
"standards-review": {
"model": "{env:OPENCODE_MODEL_JUDGE}",
"variant": "{env:OPENCODE_VARIANT_JUDGE}",
"temperature": 0.1
},
"spec-review": {
"model": "{env:OPENCODE_MODEL_JUDGE}",
"variant": "{env:OPENCODE_VARIANT_JUDGE}",
"temperature": 0.1
},
"test-audit": {
"model": "{env:OPENCODE_MODEL_JUDGE}",
"variant": "{env:OPENCODE_VARIANT_JUDGE}",
"temperature": 0.1
},
"docs-writer": {
"model": "{env:OPENCODE_MODEL_UTILITY}",
"variant": "{env:OPENCODE_VARIANT_UTILITY}",
"temperature": 0.1
},
"semgrep": {
"model": "{env:OPENCODE_MODEL_UTILITY}",
"variant": "{env:OPENCODE_VARIANT_UTILITY}",
"temperature": 0.1
},
"compaction": {
"model": "{env:OPENCODE_MODEL_UTILITY}",
"variant": "{env:OPENCODE_VARIANT_UTILITY}",
"temperature": 0.2
},
"title": {
"model": "{env:OPENCODE_MODEL_UTILITY}",
"variant": "{env:OPENCODE_VARIANT_UTILITY}",
"temperature": 0.4
},
"summary": {
"model": "{env:OPENCODE_MODEL_UTILITY}",
"variant": "{env:OPENCODE_VARIANT_UTILITY}",
"temperature": 0.2
},
"judge": {
"description": "Read-only LLM judge for the eval runner. Receives an eval case and an agent's captured output, returns a JSON verdict array (YES/NO/UNCLEAR per expected behavior). Does not modify files or run shell commands.",
"mode": "primary",
"hidden": true,
"model": "{env:OPENCODE_MODEL_JUDGE}",
"variant": "{env:OPENCODE_VARIANT_JUDGE}",
"temperature": 0.0,
"permission": {
"edit": "deny",
"bash": "deny"
},
"prompt": "You are a read-only evaluation judge. You receive an eval case and an agent's captured output. For each expected behavior, answer YES, NO, or UNCLEAR with a one-sentence rationale. Respond with ONLY a valid JSON array — no prose, no markdown fences. You may not edit files or run shell commands."
}
}
}
// vim: ft=jsonc sts=2 sw=2 ts=2 et: