my-opencode 1.3.4 → 2.0.0
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 +299 -270
- package/agents/architect.md +30 -30
- package/agents/backend-dev.md +29 -0
- package/agents/business-analyst.md +30 -0
- package/agents/code-reviewer.md +29 -29
- package/agents/design-evidence.md +29 -0
- package/agents/frontend-dev.md +29 -0
- package/agents/system-designer.md +30 -0
- package/agents/team-lead.md +65 -60
- package/agents/tech-writer.md +30 -30
- package/agents/test-engineer.md +30 -30
- package/agents/verifier.md +38 -33
- package/bin/cli.js +366 -364
- package/bin/moc +198 -198
- package/opencode.json +218 -170
- package/package.json +53 -51
- package/plugins/README.md +67 -67
- package/plugins/provider-profile.mjs +203 -194
- package/scripts/postinstall.js +202 -202
- package/scripts/validate-role-flow.mjs +90 -0
- 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/design-evidence/SKILL.md +56 -0
- package/skills/dev-flow/SKILL.md +126 -188
- package/skills/dev-flow/references/code-phase.md +35 -72
- package/skills/dev-flow/references/contract-phase.md +66 -81
- package/skills/dev-flow/references/verify-phase.md +70 -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 +63 -112
- package/skills/orchestrate/references/orchestration-patterns.md +49 -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/agents/executor.md +0 -30
- package/agents/fullstack-dev.md +0 -57
- package/agents/spec-writer.md +0 -37
package/opencode.json
CHANGED
|
@@ -1,170 +1,218 @@
|
|
|
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": "
|
|
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
|
-
|
|
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
|
-
"write":
|
|
76
|
-
"edit":
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
"bash": true
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"
|
|
110
|
-
"bash": true
|
|
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
|
-
"description": "
|
|
153
|
-
"agent": "
|
|
154
|
-
"subtask": true,
|
|
155
|
-
"template": "
|
|
156
|
-
},
|
|
157
|
-
"
|
|
158
|
-
"description": "Create
|
|
159
|
-
"agent": "
|
|
160
|
-
"subtask": true,
|
|
161
|
-
"template": "
|
|
162
|
-
},
|
|
163
|
-
"
|
|
164
|
-
"description": "
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
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": "team-lead",
|
|
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
|
+
"skills/design-evidence/SKILL.md"
|
|
14
|
+
],
|
|
15
|
+
"plugin": [
|
|
16
|
+
"plugins/provider-profile.mjs"
|
|
17
|
+
],
|
|
18
|
+
"agent": {
|
|
19
|
+
"team-lead": {
|
|
20
|
+
"description": "Primary delivery orchestrator. Coordinates Design Evidence → SA → SD → Frontend/Backend → Review → Verify.",
|
|
21
|
+
"mode": "primary",
|
|
22
|
+
"prompt": "{file:agents/team-lead.md}",
|
|
23
|
+
"permission": {
|
|
24
|
+
"task": "ask"
|
|
25
|
+
},
|
|
26
|
+
"tools": {
|
|
27
|
+
"read": true,
|
|
28
|
+
"write": true,
|
|
29
|
+
"edit": true,
|
|
30
|
+
"bash": true
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"design-evidence": {
|
|
34
|
+
"description": "Extract source-backed Design Evidence Packs from Figma, screenshots, wireframes, and prototypes.",
|
|
35
|
+
"mode": "subagent",
|
|
36
|
+
"model": "opencode-go/deepseek-v4-pro",
|
|
37
|
+
"prompt": "{file:agents/design-evidence.md}",
|
|
38
|
+
"tools": {
|
|
39
|
+
"read": true,
|
|
40
|
+
"bash": true,
|
|
41
|
+
"write": true,
|
|
42
|
+
"edit": true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"business-analyst": {
|
|
46
|
+
"description": "SA role: translate evidence into business requirements, rules, states, data meaning, and acceptance intent.",
|
|
47
|
+
"mode": "subagent",
|
|
48
|
+
"model": "opencode-go/deepseek-v4-pro",
|
|
49
|
+
"prompt": "{file:agents/business-analyst.md}",
|
|
50
|
+
"tools": {
|
|
51
|
+
"read": true,
|
|
52
|
+
"write": true,
|
|
53
|
+
"edit": true,
|
|
54
|
+
"bash": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"system-designer": {
|
|
58
|
+
"description": "SD role: translate business requirements into technical, API, data, security, and operational contracts.",
|
|
59
|
+
"mode": "subagent",
|
|
60
|
+
"model": "opencode-go/deepseek-v4-pro",
|
|
61
|
+
"prompt": "{file:agents/system-designer.md}",
|
|
62
|
+
"tools": {
|
|
63
|
+
"read": true,
|
|
64
|
+
"bash": true,
|
|
65
|
+
"write": true,
|
|
66
|
+
"edit": true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"frontend-dev": {
|
|
70
|
+
"description": "Implement frontend routes, interactions, state, accessibility, and visual acceptance from approved contracts.",
|
|
71
|
+
"mode": "subagent",
|
|
72
|
+
"prompt": "{file:agents/frontend-dev.md}",
|
|
73
|
+
"tools": {
|
|
74
|
+
"read": true,
|
|
75
|
+
"write": true,
|
|
76
|
+
"edit": true,
|
|
77
|
+
"bash": true
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"backend-dev": {
|
|
81
|
+
"description": "Implement backend APIs, domain logic, persistence, authorization, integrations, and observability from approved contracts.",
|
|
82
|
+
"mode": "subagent",
|
|
83
|
+
"prompt": "{file:agents/backend-dev.md}",
|
|
84
|
+
"tools": {
|
|
85
|
+
"read": true,
|
|
86
|
+
"write": true,
|
|
87
|
+
"edit": true,
|
|
88
|
+
"bash": true
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"verifier": {
|
|
92
|
+
"description": "Run lint, typecheck, tests, and build to verify code changes. Read-only + bash.",
|
|
93
|
+
"mode": "subagent",
|
|
94
|
+
"model": "opencode-go/deepseek-v4-flash",
|
|
95
|
+
"prompt": "{file:agents/verifier.md}",
|
|
96
|
+
"tools": {
|
|
97
|
+
"read": true,
|
|
98
|
+
"bash": true,
|
|
99
|
+
"write": false,
|
|
100
|
+
"edit": false
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"code-reviewer": {
|
|
104
|
+
"description": "Systematic code review across correctness, security, quality, testing, and style dimensions.",
|
|
105
|
+
"mode": "subagent",
|
|
106
|
+
"model": "opencode-go/deepseek-v4-pro",
|
|
107
|
+
"prompt": "{file:agents/code-reviewer.md}",
|
|
108
|
+
"tools": {
|
|
109
|
+
"read": true,
|
|
110
|
+
"bash": true,
|
|
111
|
+
"write": false,
|
|
112
|
+
"edit": false
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"test-engineer": {
|
|
116
|
+
"description": "Generate meaningful tests for source code — unit, integration, and E2E. Framework-aware.",
|
|
117
|
+
"mode": "subagent",
|
|
118
|
+
"prompt": "{file:agents/test-engineer.md}",
|
|
119
|
+
"tools": {
|
|
120
|
+
"read": true,
|
|
121
|
+
"write": true,
|
|
122
|
+
"edit": true,
|
|
123
|
+
"bash": true
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"tech-writer": {
|
|
127
|
+
"description": "Generate and update project documentation — code comments, API docs, README, and CHANGELOG.",
|
|
128
|
+
"mode": "subagent",
|
|
129
|
+
"prompt": "{file:agents/tech-writer.md}",
|
|
130
|
+
"tools": {
|
|
131
|
+
"read": true,
|
|
132
|
+
"write": true,
|
|
133
|
+
"edit": true,
|
|
134
|
+
"bash": true
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"architect": {
|
|
138
|
+
"description": "Capture architecture decisions as ADR documents. Analyzes tradeoffs and records context.",
|
|
139
|
+
"mode": "subagent",
|
|
140
|
+
"model": "opencode-go/deepseek-v4-pro",
|
|
141
|
+
"prompt": "{file:agents/architect.md}",
|
|
142
|
+
"tools": {
|
|
143
|
+
"read": true,
|
|
144
|
+
"write": true,
|
|
145
|
+
"edit": true,
|
|
146
|
+
"bash": true
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"command": {
|
|
151
|
+
"evidence": {
|
|
152
|
+
"description": "Create a source-backed Design Evidence Pack in docs/specs/<feature>/",
|
|
153
|
+
"agent": "design-evidence",
|
|
154
|
+
"subtask": true,
|
|
155
|
+
"template": "Extract the Design Evidence Pack for this feature. Record sources, observed/inferred/unknown evidence, confidence, and intake metadata.\n\n$ARGUMENTS"
|
|
156
|
+
},
|
|
157
|
+
"business-spec": {
|
|
158
|
+
"description": "Create business requirements from an approved Design Evidence Pack",
|
|
159
|
+
"agent": "business-analyst",
|
|
160
|
+
"subtask": true,
|
|
161
|
+
"template": "Read the feature intake and evidence pack, then produce business requirements, rules, states, business data definitions, acceptance intent, and traceability IDs.\n\n$ARGUMENTS"
|
|
162
|
+
},
|
|
163
|
+
"technical-design": {
|
|
164
|
+
"description": "Create technical, frontend, and backend contracts from approved business requirements",
|
|
165
|
+
"agent": "system-designer",
|
|
166
|
+
"subtask": true,
|
|
167
|
+
"template": "Read the evidence pack and business requirements, then produce technical design, frontend contract, backend contract, and traceability mappings.\n\n$ARGUMENTS"
|
|
168
|
+
},
|
|
169
|
+
"frontend": {
|
|
170
|
+
"description": "Implement a frontend slice from its approved contract",
|
|
171
|
+
"agent": "frontend-dev",
|
|
172
|
+
"subtask": true,
|
|
173
|
+
"template": "Implement the approved frontend slice and report its requirement, API, and verification IDs.\n\n$ARGUMENTS"
|
|
174
|
+
},
|
|
175
|
+
"backend": {
|
|
176
|
+
"description": "Implement a backend slice from its approved contract",
|
|
177
|
+
"agent": "backend-dev",
|
|
178
|
+
"subtask": true,
|
|
179
|
+
"template": "Implement the approved backend slice and report its requirement, API, data, and verification IDs.\n\n$ARGUMENTS"
|
|
180
|
+
},
|
|
181
|
+
"review": {
|
|
182
|
+
"description": "Review code changes across 5 dimensions (correctness, security, quality, testing, style)",
|
|
183
|
+
"agent": "code-reviewer",
|
|
184
|
+
"subtask": true,
|
|
185
|
+
"template": "Review the current changes.\n\n$ARGUMENTS"
|
|
186
|
+
},
|
|
187
|
+
"test": {
|
|
188
|
+
"description": "Generate tests for source code — auto-detects framework and conventions",
|
|
189
|
+
"agent": "test-engineer",
|
|
190
|
+
"subtask": true,
|
|
191
|
+
"template": "Generate tests for the current code.\n\n$ARGUMENTS"
|
|
192
|
+
},
|
|
193
|
+
"docs": {
|
|
194
|
+
"description": "Generate or update documentation — code comments, README, API docs, ADRs",
|
|
195
|
+
"agent": "tech-writer",
|
|
196
|
+
"subtask": true,
|
|
197
|
+
"template": "Generate or update documentation.\n\n$ARGUMENTS"
|
|
198
|
+
},
|
|
199
|
+
"orchestrate": {
|
|
200
|
+
"description": "Coordinate multiple agents for complex, multi-domain tasks",
|
|
201
|
+
"agent": "team-lead",
|
|
202
|
+
"subtask": true,
|
|
203
|
+
"template": "Orchestrate the following complex task.\n\n$ARGUMENTS"
|
|
204
|
+
},
|
|
205
|
+
"adr": {
|
|
206
|
+
"description": "Create or update an Architecture Decision Record",
|
|
207
|
+
"agent": "architect",
|
|
208
|
+
"subtask": true,
|
|
209
|
+
"template": "Create an Architecture Decision Record.\n\n$ARGUMENTS"
|
|
210
|
+
},
|
|
211
|
+
"verify": {
|
|
212
|
+
"description": "Run lint, typecheck, tests, and build to verify changes",
|
|
213
|
+
"template": "Use the verifier agent to run the full verification suite on the current changes.\n\n$ARGUMENTS",
|
|
214
|
+
"agent": "verifier",
|
|
215
|
+
"subtask": true
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
package/package.json
CHANGED
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "my-opencode",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "高品質 opencode 開發流程 skill 與 agents 集合 —
|
|
5
|
-
"keywords": [
|
|
6
|
-
"opencode",
|
|
7
|
-
"claude-code",
|
|
8
|
-
"ai-coding",
|
|
9
|
-
"development-workflow",
|
|
10
|
-
"contract-first",
|
|
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
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "my-opencode",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "高品質 opencode 開發流程 skill 與 agents 集合 — Evidence-First 開發流程、ADR、PR Review、測試生成、文件生成",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"opencode",
|
|
7
|
+
"claude-code",
|
|
8
|
+
"ai-coding",
|
|
9
|
+
"development-workflow",
|
|
10
|
+
"contract-first",
|
|
11
|
+
"evidence-first",
|
|
12
|
+
"adr",
|
|
13
|
+
"code-review",
|
|
14
|
+
"test-generation",
|
|
15
|
+
"documentation",
|
|
16
|
+
"agents",
|
|
17
|
+
"skills"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://github.com/jjyung/my-opencode#readme",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/jjyung/my-opencode/issues"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": "cfh00902455",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/jjyung/my-opencode.git"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"postinstall": "node scripts/postinstall.js",
|
|
31
|
+
"test": "node --test test/*.test.mjs",
|
|
32
|
+
"test:structure": "node scripts/validate-role-flow.mjs"
|
|
33
|
+
},
|
|
34
|
+
"bin": {
|
|
35
|
+
"my-opencode": "bin/cli.js",
|
|
36
|
+
"moc": "bin/moc.js"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"bin/",
|
|
40
|
+
"scripts/",
|
|
41
|
+
"skills/",
|
|
42
|
+
"agents/",
|
|
43
|
+
"plugins/",
|
|
44
|
+
"opencode.json"
|
|
45
|
+
],
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=18.0.0"
|
|
48
|
+
},
|
|
49
|
+
"type": "module",
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
}
|
|
53
|
+
}
|
package/plugins/README.md
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
# Plugins
|
|
2
|
-
|
|
3
|
-
opencode plugin 是透過 `opencode.json` 的 `plugin` 區塊註冊的 npm 或本地封裝,可包含自訂 tool、MCP 整合、或額外的 subagent 類型。
|
|
4
|
-
|
|
5
|
-
## 目前包含
|
|
6
|
-
|
|
7
|
-
### `provider-profile.mjs`
|
|
8
|
-
|
|
9
|
-
零依賴 ESM plugin / resolver,用來切換本 repo 的模型 profile。
|
|
10
|
-
|
|
11
|
-
- 預設 profile:`opencode`
|
|
12
|
-
- 支援:`opencode`、`openai`、`google`、`copilot`
|
|
13
|
-
- 讀取:`OPENCODE_PROVIDER_PROFILE`
|
|
14
|
-
- 可透過 plugin tuple options 覆寫:`["plugins/provider-profile.mjs", { "profile": "google" }]`
|
|
15
|
-
|
|
16
|
-
| Profile | Primary / heavy | Small / verifier |
|
|
17
|
-
|---------|------------------|------------------|
|
|
18
|
-
| `opencode` | `opencode-go/deepseek-v4-pro` | `opencode-go/deepseek-v4-flash` |
|
|
19
|
-
| `openai` | `openai/gpt-5.6` | `openai/gpt-5.6-luna` |
|
|
20
|
-
| `google` | `google/gemini-3.1-pro-preview-customtools` | `google/gemini-3.5-flash` |
|
|
21
|
-
| `copilot` | `github-copilot/gpt-5.6-sol` | `github-copilot/gpt-5.6-luna` |
|
|
22
|
-
|
|
23
|
-
> 💡 `openai` 與 `copilot` profile 的 `gpt-5.6-luna` 支援 reasoning effort 切換(high / medium / low,預設 `low`),
|
|
24
|
-
> 在 opencode 內用 `variant_cycle` 快捷鍵循環切換。
|
|
25
|
-
|
|
26
|
-
### 用法
|
|
27
|
-
|
|
28
|
-
建議優先使用 `moc`:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
moc
|
|
32
|
-
moc openai
|
|
33
|
-
moc google --list-agents
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
`moc` 會對四個已知 profile 快取 provider-profile 產生出的 JSON override,位置在 `.opencode/cache/provider-profile/`。快取是否有效由以下條件決定:
|
|
37
|
-
|
|
38
|
-
- profile 名稱
|
|
39
|
-
- `.opencode/plugins/provider-profile.mjs` 的 mtime
|
|
40
|
-
- `.opencode/opencode.json` 的 mtime
|
|
41
|
-
|
|
42
|
-
若三者都沒變,`moc` 會直接重用快取,不再重新執行 `node .opencode/plugins/provider-profile.mjs`。
|
|
43
|
-
|
|
44
|
-
進階情境可直接設定環境變數:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
OPENCODE_CONFIG_CONTENT="$(node .opencode/plugins/provider-profile.mjs)" opencode
|
|
48
|
-
|
|
49
|
-
OPENCODE_PROVIDER_PROFILE=openai \
|
|
50
|
-
OPENCODE_CONFIG_CONTENT="$(node .opencode/plugins/provider-profile.mjs)" \
|
|
51
|
-
opencode
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
直接執行模組時,會輸出可供 `OPENCODE_CONFIG_CONTENT` 使用的 JSON override。
|
|
55
|
-
|
|
56
|
-
> 備註:目前 OpenCode plugin API 可註冊 runtime hooks / tools,但不會在載入時直接改寫 `opencode.json`;因此這個模組同時扮演 plugin 與 config override generator。
|
|
57
|
-
|
|
58
|
-
## 何時需要 Plugin
|
|
59
|
-
|
|
60
|
-
- 需要封裝自訂 tool 給多個專案共用
|
|
61
|
-
- 需要透過 MCP 串接外部 API
|
|
62
|
-
- 需要 hook opencode 的生命週期事件
|
|
63
|
-
|
|
64
|
-
## 開發參考
|
|
65
|
-
|
|
66
|
-
- [opencode 官方文件 — Plugins](https://opencode.ai/plugins)
|
|
67
|
-
- 範本可參考 `templates/plugin-template/`
|
|
1
|
+
# Plugins
|
|
2
|
+
|
|
3
|
+
opencode plugin 是透過 `opencode.json` 的 `plugin` 區塊註冊的 npm 或本地封裝,可包含自訂 tool、MCP 整合、或額外的 subagent 類型。
|
|
4
|
+
|
|
5
|
+
## 目前包含
|
|
6
|
+
|
|
7
|
+
### `provider-profile.mjs`
|
|
8
|
+
|
|
9
|
+
零依賴 ESM plugin / resolver,用來切換本 repo 的模型 profile。
|
|
10
|
+
|
|
11
|
+
- 預設 profile:`opencode`
|
|
12
|
+
- 支援:`opencode`、`openai`、`google`、`copilot`
|
|
13
|
+
- 讀取:`OPENCODE_PROVIDER_PROFILE`
|
|
14
|
+
- 可透過 plugin tuple options 覆寫:`["plugins/provider-profile.mjs", { "profile": "google" }]`
|
|
15
|
+
|
|
16
|
+
| Profile | Primary / heavy | Small / verifier |
|
|
17
|
+
|---------|------------------|------------------|
|
|
18
|
+
| `opencode` | `opencode-go/deepseek-v4-pro` | `opencode-go/deepseek-v4-flash` |
|
|
19
|
+
| `openai` | `openai/gpt-5.6` | `openai/gpt-5.6-luna` |
|
|
20
|
+
| `google` | `google/gemini-3.1-pro-preview-customtools` | `google/gemini-3.5-flash` |
|
|
21
|
+
| `copilot` | `github-copilot/gpt-5.6-sol` | `github-copilot/gpt-5.6-luna` |
|
|
22
|
+
|
|
23
|
+
> 💡 `openai` 與 `copilot` profile 的 `gpt-5.6-luna` 支援 reasoning effort 切換(high / medium / low,預設 `low`),
|
|
24
|
+
> 在 opencode 內用 `variant_cycle` 快捷鍵循環切換。
|
|
25
|
+
|
|
26
|
+
### 用法
|
|
27
|
+
|
|
28
|
+
建議優先使用 `moc`:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
moc
|
|
32
|
+
moc openai
|
|
33
|
+
moc google --list-agents
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`moc` 會對四個已知 profile 快取 provider-profile 產生出的 JSON override,位置在 `.opencode/cache/provider-profile/`。快取是否有效由以下條件決定:
|
|
37
|
+
|
|
38
|
+
- profile 名稱
|
|
39
|
+
- `.opencode/plugins/provider-profile.mjs` 的 mtime
|
|
40
|
+
- `.opencode/opencode.json` 的 mtime
|
|
41
|
+
|
|
42
|
+
若三者都沒變,`moc` 會直接重用快取,不再重新執行 `node .opencode/plugins/provider-profile.mjs`。
|
|
43
|
+
|
|
44
|
+
進階情境可直接設定環境變數:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
OPENCODE_CONFIG_CONTENT="$(node .opencode/plugins/provider-profile.mjs)" opencode
|
|
48
|
+
|
|
49
|
+
OPENCODE_PROVIDER_PROFILE=openai \
|
|
50
|
+
OPENCODE_CONFIG_CONTENT="$(node .opencode/plugins/provider-profile.mjs)" \
|
|
51
|
+
opencode
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
直接執行模組時,會輸出可供 `OPENCODE_CONFIG_CONTENT` 使用的 JSON override。
|
|
55
|
+
|
|
56
|
+
> 備註:目前 OpenCode plugin API 可註冊 runtime hooks / tools,但不會在載入時直接改寫 `opencode.json`;因此這個模組同時扮演 plugin 與 config override generator。
|
|
57
|
+
|
|
58
|
+
## 何時需要 Plugin
|
|
59
|
+
|
|
60
|
+
- 需要封裝自訂 tool 給多個專案共用
|
|
61
|
+
- 需要透過 MCP 串接外部 API
|
|
62
|
+
- 需要 hook opencode 的生命週期事件
|
|
63
|
+
|
|
64
|
+
## 開發參考
|
|
65
|
+
|
|
66
|
+
- [opencode 官方文件 — Plugins](https://opencode.ai/plugins)
|
|
67
|
+
- 範本可參考 `templates/plugin-template/`
|