my-opencode 1.3.0 → 1.3.1

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.
Files changed (40) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +253 -248
  3. package/agents/architect.md +30 -30
  4. package/agents/code-reviewer.md +29 -29
  5. package/agents/executor.md +30 -30
  6. package/agents/fullstack-dev.md +57 -57
  7. package/agents/spec-writer.md +37 -37
  8. package/agents/team-lead.md +60 -60
  9. package/agents/tech-writer.md +30 -30
  10. package/agents/test-engineer.md +30 -30
  11. package/agents/verifier.md +33 -33
  12. package/bin/cli.js +340 -340
  13. package/bin/moc +198 -198
  14. package/bin/moc.js +350 -0
  15. package/opencode.json +170 -170
  16. package/package.json +50 -50
  17. package/plugins/README.md +64 -64
  18. package/plugins/provider-profile.mjs +139 -139
  19. package/scripts/postinstall.js +202 -202
  20. package/skills/adr/SKILL.md +91 -91
  21. package/skills/adr/references/templates.md +100 -100
  22. package/skills/adr/scripts/README.md +5 -5
  23. package/skills/dev-flow/SKILL.md +188 -188
  24. package/skills/dev-flow/references/code-phase.md +72 -72
  25. package/skills/dev-flow/references/contract-phase.md +81 -81
  26. package/skills/dev-flow/references/verify-phase.md +129 -129
  27. package/skills/dev-flow/scripts/README.md +3 -3
  28. package/skills/docs-gen/SKILL.md +162 -162
  29. package/skills/docs-gen/references/doc-styles.md +216 -216
  30. package/skills/docs-gen/scripts/README.md +5 -5
  31. package/skills/orchestrate/SKILL.md +112 -112
  32. package/skills/orchestrate/references/orchestration-patterns.md +56 -56
  33. package/skills/pr-review/SKILL.md +110 -110
  34. package/skills/pr-review/references/review-dimensions.md +117 -117
  35. package/skills/pr-review/references/security-checklist.md +122 -122
  36. package/skills/pr-review/scripts/README.md +5 -5
  37. package/skills/test-gen/SKILL.md +143 -143
  38. package/skills/test-gen/references/framework-detection.md +105 -105
  39. package/skills/test-gen/references/test-patterns.md +260 -260
  40. package/skills/test-gen/scripts/README.md +5 -5
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 my-opencode
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 my-opencode
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,259 +1,264 @@
1
- # my-opencode
2
-
3
- 為 [opencode](https://opencode.ai) 生態打造的高品質開發流程 skill 與 agents 集合。
4
-
5
- > 參考業界知名 agentic coding repo 的設計哲學,提煉出一套符合 opencode 架構的模組化、可組合的開發技能包。
6
-
7
- ---
8
-
9
- ## 快速安裝(npm)
10
-
11
- ```bash
1
+ # my-opencode
2
+
3
+ 為 [opencode](https://opencode.ai) 生態打造的高品質開發流程 skill 與 agents 集合。
4
+
5
+ > 參考業界知名 agentic coding repo 的設計哲學,提煉出一套符合 opencode 架構的模組化、可組合的開發技能包。
6
+
7
+ ---
8
+
9
+ ## 快速安裝(npm)
10
+
11
+ ```bash
12
12
  # 在專案中安裝(產生 .opencode/,並提供 moc launcher)
13
13
  npm install my-opencode
14
-
15
- # 或只初始化 .opencode/
16
- npx my-opencode init
17
-
18
- # 安裝到指定專案
19
- npx my-opencode init ./my-project
20
- ```
21
-
22
- 這會在你的專案下建立 `.opencode/`,包含 `skills/`、`agents/`、`plugins/`、`opencode.json`。
23
-
24
- opencode 會自動發現 `.opencode/opencode.json`,無需額外設定。
25
-
26
- ---
27
-
28
- ### 本地開發(git clone)
29
-
30
- 如果直接 clone 本 repo 做開發或試用:
31
-
32
- ```bash
33
- git clone https://github.com/jjyung/my-opencode.git
34
- cd my-opencode
35
- npm link # 將 bin/moc 註冊到 PATH,讓 moc 指令全域可用
36
- ```
37
-
14
+
15
+ # 或只初始化 .opencode/
16
+ npx my-opencode init
17
+
18
+ # 安裝到指定專案
19
+ npx my-opencode init ./my-project
20
+ ```
21
+
22
+ 這會在你的專案下建立 `.opencode/`,包含 `skills/`、`agents/`、`plugins/`、`opencode.json`。
23
+
24
+ opencode 會自動發現 `.opencode/opencode.json`,無需額外設定。
25
+
26
+ ---
27
+
28
+ ### 本地開發(git clone)
29
+
30
+ 如果直接 clone 本 repo 做開發或試用:
31
+
32
+ ```bash
33
+ git clone https://github.com/jjyung/my-opencode.git
34
+ cd my-opencode
35
+ npm link # 將 bin/moc 註冊到 PATH,讓 moc 指令全域可用
36
+ ```
37
+
38
38
  `npm link` 完成後,`moc` 即可在任何目錄使用。
39
-
40
- ---
41
-
39
+ 新的 npm bin 入口是跨平台的 `bin/moc.js`;repo 內仍保留 `bin/moc` 給直接 shell 執行情境使用。
40
+
41
+ ---
42
+
42
43
  安裝完成後,`moc` 會成為主要入口:
43
-
44
- ```bash
45
- moc # 預設 opencode profile
46
- moc openai # 切到 OpenAI profile
47
- moc google # 切到 Google profile
44
+
45
+ ```bash
46
+ moc # 預設 opencode profile
47
+ moc openai # 切到 OpenAI profile
48
+ moc google # 切到 Google profile
48
49
  moc copilot # 切到 Copilot profile
49
50
  moc --help # 透明轉發到 opencode --help
50
51
  ```
51
52
 
52
- 其他指令:
53
-
54
- ```bash
55
- npx my-opencode list # 列出可用 skills 與 agents
56
- npx my-opencode help # 顯示說明
57
- ```
58
-
59
- ## Provider Profile 切換
60
-
61
- 內建 `provider-profile` plugin / resolver,主要透過 `moc` 切換整套模型配置。
62
-
63
- 支援值:`opencode`(預設)、`openai`、`google`、`copilot`
64
-
65
- | Profile | Primary / heavy | Small / verifier |
66
- |---------|------------------|------------------|
67
- | `opencode` | `opencode/big-pickle` | `opencode/deepseek-v4-flash-free` |
68
- | `openai` | `openai/gpt-5.4` | `openai/gpt-5.4-mini` |
69
- | `google` | `google/gemini-3.1-pro-preview-customtools` | `google/gemini-3.5-flash` |
70
- | `copilot` | `copilot/gpt-5.4` | `copilot/gpt-5.4-mini` |
71
-
72
- ```bash
73
- # 預設 profile(opencode)
74
- moc
75
-
76
- # 切到 OpenAI
77
- moc openai
78
-
79
- # 切到 Google
80
- moc google
81
-
82
- # 轉發額外參數
83
- moc openai --list-agents
84
- ```
85
-
53
+ Windows(cmd、PowerShell)現在也支援直接執行 `moc`;npm 會自動建立對應 shim,無需額外安裝 `.cmd` 或 `.ps1` 檔案。
54
+
55
+ 其他指令:
56
+
57
+ ```bash
58
+ npx my-opencode list # 列出可用 skills 與 agents
59
+ npx my-opencode help # 顯示說明
60
+ ```
61
+
62
+ ## Provider Profile 切換
63
+
64
+ 內建 `provider-profile` plugin / resolver,主要透過 `moc` 切換整套模型配置。
65
+
66
+ 支援值:`opencode`(預設)、`openai`、`google`、`copilot`
67
+
68
+ | Profile | Primary / heavy | Small / verifier |
69
+ |---------|------------------|------------------|
70
+ | `opencode` | `opencode/big-pickle` | `opencode/deepseek-v4-flash-free` |
71
+ | `openai` | `openai/gpt-5.4` | `openai/gpt-5.4-mini` |
72
+ | `google` | `google/gemini-3.1-pro-preview-customtools` | `google/gemini-3.5-flash` |
73
+ | `copilot` | `copilot/gpt-5.4` | `copilot/gpt-5.4-mini` |
74
+
75
+ ```bash
76
+ # 預設 profile(opencode)
77
+ moc
78
+
79
+ # 切到 OpenAI
80
+ moc openai
81
+
82
+ # 切到 Google
83
+ moc google
84
+
85
+ # 轉發額外參數
86
+ moc openai --list-agents
87
+ ```
88
+
86
89
  `moc` 會在目前工作目錄尋找 `.opencode/plugins/provider-profile.mjs` 與 `.opencode/opencode.json`。
87
90
  對 `opencode` / `openai` / `google` / `copilot` 這四個 profile,會把產生出的 `OPENCODE_CONFIG_CONTENT` 快取到 `.opencode/cache/provider-profile/`;只要 profile、plugin mtime、config mtime 都沒變,就直接重用快取,不再重新跑 Node。若 plugin 缺失,則會警告並回退為 plain `opencode`。
88
91
 
89
- 若要在 script 中直接使用環境變數,也可以:
90
-
91
- ```bash
92
- OPENCODE_PROVIDER_PROFILE=openai \
93
- OPENCODE_CONFIG_CONTENT="$(node .opencode/plugins/provider-profile.mjs)" \
94
- opencode
95
- ```
96
-
97
- 如果想固定專案 profile,可把 `.opencode/opencode.json` 的 plugin 設定改成 tuple:
98
-
99
- ```json
100
- {
101
- "plugin": [
102
- ["plugins/provider-profile.mjs", { "profile": "google" }]
103
- ]
104
- }
105
- ```
106
-
107
- 此 tuple 會覆寫 `OPENCODE_PROVIDER_PROFILE`。
108
-
109
- ### 發布(維護者專用)
110
-
111
- #### Token 設定
112
-
113
- 發布前需要建立一個 **Access Token**(繞過 2FA):
114
-
115
- 1. 到 https://www.npmjs.com/settings/~/tokens
116
- 2. Generate New Token → Granular Access Token
117
- 3. 勾選 bypass two-factor authentication
118
- 4. 設定 Read and Write 權限
119
- 5. 將產生的 token 寫入專案 `.npmrc`:
120
-
121
- ```bash
122
- echo "//registry.npmjs.org/:_authToken=npm_xxxxxxxxxxxx" > .npmrc
123
- ```
124
-
125
- > ⚠️ `.npmrc` 已加入 `.gitignore`,不會被 commit。
126
-
127
- #### 發布指令
128
-
129
- ```bash
130
- npm publish
131
- ```
132
-
133
- ---
134
-
135
- ## 靈感來源
136
-
137
- | 專案 | Stars | 核心啟發 |
138
- |------|-------|----------|
139
- | [affaan-m/everything-claude-code](https://github.com/affaan-m/everything-claude-code) | 170K+ | 超大型 skill 生態系統,40+ skill 模組,跨平台設計 |
140
- | [Yeachan-Heo/oh-my-claudecode](https://github.com/Yeachan-Heo/oh-my-claudecode) | 31K+ | 多 agent 編排模式(Team / Autopilot / Pipeline),plan→prd→exec→verify→fix 流程 |
141
- | [wshobson/agents](https://github.com/wshobson/agents) | 35K+ | 185+ 專用 agent、153 skill、單一職責 plugin 架構 |
142
- | [alirezarezvani/claude-skills](https://github.com/alirezarezvani/claude-skills) | 15K+ | 313+ skill 跨 12 種 AI 編碼工具,零依賴 Python 工具 |
143
- | [coleam00/second-brain-skills](https://github.com/coleam00/second-brain-skills) | 700+ | 漸進式上下文揭露(progressive disclosure)哲學 |
144
- | [coleam00/your-claude-engineer](https://github.com/coleam00/your-claude-engineer) | 125+ | 多 agent 編排 + MCP 工具閘道整合 |
145
- | [cablate/claude-code-research](https://github.com/cablate/claude-code-research) | 130+ | Claude Code 內部機制逆向分析,75 份 deep-dive 報告 |
146
-
147
- ---
148
-
149
- ## 本地參考原始碼
150
-
151
- `ref/` 下以 `git submodule` 追蹤上述專案的原始碼,方便快速瀏覽、對照設計:
152
-
153
- ```
154
- ref/
155
- ├── everything-claude-code/ → affaan-m/everything-claude-code
156
- ├── oh-my-claudecode/ → Yeachan-Heo/oh-my-claudecode
157
- ├── wshobson-agents/ → wshobson/agents
158
- ├── claude-skills/ → alirezarezvani/claude-skills
159
- ├── second-brain-skills/ → coleam00/second-brain-skills
160
- └── claude-code-research/ → cablate/claude-code-research
161
- ```
162
-
163
- **同步到最新:**
164
- ```bash
165
- git submodule update --remote --merge
166
- ```
167
-
168
- **首次 clone 本專案:**
169
- ```bash
170
- git clone --recurse-submodules <repo-url>
171
- # 或事後初始化
172
- git submodule update --init --recursive
173
- ```
174
-
175
- ---
176
-
177
- ## 目標
178
-
179
- 1. **提煉通用流程** — 從上述專案中萃取「開發者真正需要的」工作流程模式,轉化為 opencode skill
180
- 2. **Contract-First** — 以合約文件(ADR + Spec)為源頭真相,取代一次性 handoff,支援前後端平行開發
181
- 3. **模組化設計** — 每個 skill 單一職責、可組合、可替換,避免大而全的 monolith
182
- 4. **opencode 原生** — 充分利用 opencode 的 skill/subagent/permission/MCP 機制,而非直接移植他廠格式
183
- 5. **團隊協作就緒** — 支援 adr → contract → code → review → verify → deploy 的完整開發生命週期
184
-
185
- ---
186
-
187
- ## 結構規劃
188
-
189
- ```
190
- my-opencode/
191
- ├── ref/ # 參考專案(git submodule)
192
- │ ├── everything-claude-code/
193
- │ ├── oh-my-claudecode/
194
- │ ├── wshobson-agents/
195
- │ ├── claude-skills/
196
- │ ├── second-brain-skills/
197
- │ └── claude-code-research/
198
- ├── docs/ # 探索記錄與設計文件
199
- │ ├── references/ # 各 repo 分析筆記(6 份)
200
- │ ├── patterns.md # 跨 repo 可複用模式
201
- │ └── design-decisions.md # opencode 生態取捨
202
- ├── skills/ # opencode skill(單一職責)
203
- │ ├── adr/ # [done] ADR:架構決策記錄
204
- │ ├── dev-flow/ # [done] 開發流程:contract → code → verify
205
- │ ├── pr-review/ # [done] PR 審查:5 維度分析
206
- │ ├── test-gen/ # [done] 測試生成:框架偵測 + 多語言模式
207
- │ ├── orchestrate/ # [done] 多 agent 編排:分解、平行派送、綜合
208
- │ └── docs-gen/ # [done] 文件生成:註解、API、README、ADR
209
- ├── agents/ # 組合多個 skill 的完整 agent
210
- │ ├── architect.md # [new] 架構師 agent(ADR 產生)
211
- │ ├── spec-writer.md # 規格 agent(合約文件 → docs/specs/)
212
- │ ├── executor.md # 實作 agent(讀寫)
213
- │ ├── verifier.md # 驗證 agent(唯讀+Bash)
214
- │ ├── code-reviewer.md # 程式碼審查 agent(唯讀)
215
- │ ├── test-engineer.md # 測試工程師 agent(讀寫)
216
- │ ├── tech-writer.md # 技術文件 agent(讀寫)
217
- │ ├── fullstack-dev.md # 全端開發 agent(編排三者)
218
- │ └── team-lead.md # 技術主管 agent(多 agent 交響樂指揮)
219
- ├── CONTRIBUTING.md # 貢獻指南
220
- ├── LICENSE # MIT License
221
- ├── opencode.json # opencode 整合設定:agent + command + skill 註冊
222
- ├── plugins/ # opencode plugin(保留)
223
- └── templates/ # skill / agent 建立範本
224
- ```
225
-
226
- ---
227
-
228
- ## 關鍵設計原則
229
-
230
- - **Progressive Disclosure** — 初期只載入必要 context,深入時才揭露細節
231
- - **Single Responsibility** — 每個 skill 只做一件事,做好
232
- - **Model Agnostic** — 不綁定特定模型,支援 opencode 支援的所有 LLM
233
- - **Zero Heavy Dependency** — 盡量使用 stdlib / 現有工具,避免非必要的 npm/pip 依賴
234
- - **可測試** — 每個 skill 附帶測試場景(eval set),可用 opencode eval 驗證
235
-
236
- ---
237
-
238
- ## 現狀
239
-
240
- - [x] 專案初始化
241
- - [x] ref/ 參考專案 submodule(6 個)
242
- - [x] docs/ 探索紀錄(6 份 notes + patterns.md + design-decisions.md)
243
- - [x] skill: adr(架構決策記錄,Michael Nygard 輕量格式)
244
- - [x] skill: dev-flow(開發流程,含 architecture → contract → code → verify)
245
- - [x] agents: spec-writer, executor, verifier, fullstack-dev, code-reviewer, test-engineer, team-lead, architect
246
- - [x] skill: pr-review(PR 審查,含 5 維度分析 + 安全檢查表)
247
- - [x] skill: test-gen(測試生成,含框架偵測 + 多語言測試模式)
248
- - [x] skill: orchestrate(多 agent 編排)
249
- - [x] skill: docs-gen(文件生成,含多語言註解風格 + ADR/CHANGELOG 範本)
250
- - [x] agent: tech-writer
251
- - [x] opencode.json 整合設定(含 9 個 agent + 7 個 command)
252
- - [x] CONTRIBUTING.md / LICENSE / plugins / templates
253
- - [ ] 自我驗證:用本工具跑自己的開發流程
254
-
255
- ---
256
-
257
- ## 授權
258
-
259
- MIT
92
+ 若你直接用 repo 內的 `bin/moc`,仍會走既有 POSIX shell launcher;透過 npm 安裝、`npm link`、`npx` 取得的 `moc` 則會走跨平台的 `bin/moc.js`。
93
+
94
+ 若要在 script 中直接使用環境變數,也可以:
95
+
96
+ ```bash
97
+ OPENCODE_PROVIDER_PROFILE=openai \
98
+ OPENCODE_CONFIG_CONTENT="$(node .opencode/plugins/provider-profile.mjs)" \
99
+ opencode
100
+ ```
101
+
102
+ 如果想固定專案 profile,可把 `.opencode/opencode.json` 的 plugin 設定改成 tuple:
103
+
104
+ ```json
105
+ {
106
+ "plugin": [
107
+ ["plugins/provider-profile.mjs", { "profile": "google" }]
108
+ ]
109
+ }
110
+ ```
111
+
112
+ 此 tuple 會覆寫 `OPENCODE_PROVIDER_PROFILE`。
113
+
114
+ ### 發布(維護者專用)
115
+
116
+ #### Token 設定
117
+
118
+ 發布前需要建立一個 **Access Token**(繞過 2FA):
119
+
120
+ 1. 到 https://www.npmjs.com/settings/~/tokens
121
+ 2. Generate New Token → Granular Access Token
122
+ 3. 勾選 bypass two-factor authentication
123
+ 4. 設定 Read and Write 權限
124
+ 5. 將產生的 token 寫入專案 `.npmrc`:
125
+
126
+ ```bash
127
+ echo "//registry.npmjs.org/:_authToken=npm_xxxxxxxxxxxx" > .npmrc
128
+ ```
129
+
130
+ > ⚠️ `.npmrc` 已加入 `.gitignore`,不會被 commit。
131
+
132
+ #### 發布指令
133
+
134
+ ```bash
135
+ npm publish
136
+ ```
137
+
138
+ ---
139
+
140
+ ## 靈感來源
141
+
142
+ | 專案 | Stars | 核心啟發 |
143
+ |------|-------|----------|
144
+ | [affaan-m/everything-claude-code](https://github.com/affaan-m/everything-claude-code) | 170K+ | 超大型 skill 生態系統,40+ skill 模組,跨平台設計 |
145
+ | [Yeachan-Heo/oh-my-claudecode](https://github.com/Yeachan-Heo/oh-my-claudecode) | 31K+ | 多 agent 編排模式(Team / Autopilot / Pipeline),plan→prd→exec→verify→fix 流程 |
146
+ | [wshobson/agents](https://github.com/wshobson/agents) | 35K+ | 185+ 專用 agent、153 skill、單一職責 plugin 架構 |
147
+ | [alirezarezvani/claude-skills](https://github.com/alirezarezvani/claude-skills) | 15K+ | 313+ skill 跨 12 種 AI 編碼工具,零依賴 Python 工具 |
148
+ | [coleam00/second-brain-skills](https://github.com/coleam00/second-brain-skills) | 700+ | 漸進式上下文揭露(progressive disclosure)哲學 |
149
+ | [coleam00/your-claude-engineer](https://github.com/coleam00/your-claude-engineer) | 125+ | 多 agent 編排 + MCP 工具閘道整合 |
150
+ | [cablate/claude-code-research](https://github.com/cablate/claude-code-research) | 130+ | Claude Code 內部機制逆向分析,75 份 deep-dive 報告 |
151
+
152
+ ---
153
+
154
+ ## 本地參考原始碼
155
+
156
+ `ref/` 下以 `git submodule` 追蹤上述專案的原始碼,方便快速瀏覽、對照設計:
157
+
158
+ ```
159
+ ref/
160
+ ├── everything-claude-code/ → affaan-m/everything-claude-code
161
+ ├── oh-my-claudecode/ → Yeachan-Heo/oh-my-claudecode
162
+ ├── wshobson-agents/ → wshobson/agents
163
+ ├── claude-skills/ → alirezarezvani/claude-skills
164
+ ├── second-brain-skills/ → coleam00/second-brain-skills
165
+ └── claude-code-research/ → cablate/claude-code-research
166
+ ```
167
+
168
+ **同步到最新:**
169
+ ```bash
170
+ git submodule update --remote --merge
171
+ ```
172
+
173
+ **首次 clone 本專案:**
174
+ ```bash
175
+ git clone --recurse-submodules <repo-url>
176
+ # 或事後初始化
177
+ git submodule update --init --recursive
178
+ ```
179
+
180
+ ---
181
+
182
+ ## 目標
183
+
184
+ 1. **提煉通用流程** — 從上述專案中萃取「開發者真正需要的」工作流程模式,轉化為 opencode skill
185
+ 2. **Contract-First** — 以合約文件(ADR + Spec)為源頭真相,取代一次性 handoff,支援前後端平行開發
186
+ 3. **模組化設計** — 每個 skill 單一職責、可組合、可替換,避免大而全的 monolith
187
+ 4. **opencode 原生** — 充分利用 opencode 的 skill/subagent/permission/MCP 機制,而非直接移植他廠格式
188
+ 5. **團隊協作就緒** — 支援 adr → contract → code → review → verify → deploy 的完整開發生命週期
189
+
190
+ ---
191
+
192
+ ## 結構規劃
193
+
194
+ ```
195
+ my-opencode/
196
+ ├── ref/ # 參考專案(git submodule)
197
+ │ ├── everything-claude-code/
198
+ │ ├── oh-my-claudecode/
199
+ │ ├── wshobson-agents/
200
+ │ ├── claude-skills/
201
+ │ ├── second-brain-skills/
202
+ │ └── claude-code-research/
203
+ ├── docs/ # 探索記錄與設計文件
204
+ │ ├── references/ # 各 repo 分析筆記(6 份)
205
+ │ ├── patterns.md # 跨 repo 可複用模式
206
+ │ └── design-decisions.md # opencode 生態取捨
207
+ ├── skills/ # opencode skill(單一職責)
208
+ │ ├── adr/ # [done] ADR:架構決策記錄
209
+ │ ├── dev-flow/ # [done] 開發流程:contract → code → verify
210
+ │ ├── pr-review/ # [done] PR 審查:5 維度分析
211
+ │ ├── test-gen/ # [done] 測試生成:框架偵測 + 多語言模式
212
+ │ ├── orchestrate/ # [done] 多 agent 編排:分解、平行派送、綜合
213
+ │ └── docs-gen/ # [done] 文件生成:註解、API、README、ADR
214
+ ├── agents/ # 組合多個 skill 的完整 agent
215
+ │ ├── architect.md # [new] 架構師 agent(ADR 產生)
216
+ │ ├── spec-writer.md # 規格 agent(合約文件 → docs/specs/)
217
+ │ ├── executor.md # 實作 agent(讀寫)
218
+ │ ├── verifier.md # 驗證 agent(唯讀+Bash)
219
+ │ ├── code-reviewer.md # 程式碼審查 agent(唯讀)
220
+ │ ├── test-engineer.md # 測試工程師 agent(讀寫)
221
+ │ ├── tech-writer.md # 技術文件 agent(讀寫)
222
+ │ ├── fullstack-dev.md # 全端開發 agent(編排三者)
223
+ │ └── team-lead.md # 技術主管 agent(多 agent 交響樂指揮)
224
+ ├── CONTRIBUTING.md # 貢獻指南
225
+ ├── LICENSE # MIT License
226
+ ├── opencode.json # opencode 整合設定:agent + command + skill 註冊
227
+ ├── plugins/ # opencode plugin(保留)
228
+ └── templates/ # skill / agent 建立範本
229
+ ```
230
+
231
+ ---
232
+
233
+ ## 關鍵設計原則
234
+
235
+ - **Progressive Disclosure** — 初期只載入必要 context,深入時才揭露細節
236
+ - **Single Responsibility** — 每個 skill 只做一件事,做好
237
+ - **Model Agnostic** — 不綁定特定模型,支援 opencode 支援的所有 LLM
238
+ - **Zero Heavy Dependency** — 盡量使用 stdlib / 現有工具,避免非必要的 npm/pip 依賴
239
+ - **可測試** — 每個 skill 附帶測試場景(eval set),可用 opencode eval 驗證
240
+
241
+ ---
242
+
243
+ ## 現狀
244
+
245
+ - [x] 專案初始化
246
+ - [x] ref/ 參考專案 submodule(6 個)
247
+ - [x] docs/ 探索紀錄(6 份 notes + patterns.md + design-decisions.md)
248
+ - [x] skill: adr(架構決策記錄,Michael Nygard 輕量格式)
249
+ - [x] skill: dev-flow(開發流程,含 architecture → contract → code → verify)
250
+ - [x] agents: spec-writer, executor, verifier, fullstack-dev, code-reviewer, test-engineer, team-lead, architect
251
+ - [x] skill: pr-review(PR 審查,含 5 維度分析 + 安全檢查表)
252
+ - [x] skill: test-gen(測試生成,含框架偵測 + 多語言測試模式)
253
+ - [x] skill: orchestrate(多 agent 編排)
254
+ - [x] skill: docs-gen(文件生成,含多語言註解風格 + ADR/CHANGELOG 範本)
255
+ - [x] agent: tech-writer
256
+ - [x] opencode.json 整合設定(含 9 個 agent + 7 個 command)
257
+ - [x] CONTRIBUTING.md / LICENSE / plugins / templates
258
+ - [ ] 自我驗證:用本工具跑自己的開發流程
259
+
260
+ ---
261
+
262
+ ## 授權
263
+
264
+ MIT
@@ -1,30 +1,30 @@
1
- ---
2
- name: architect
3
- description: |
4
- Capture architecture decisions as ADR documents. Analyzes tradeoffs, documents context and consequences.
5
- Use PROACTIVELY when making design choices, selecting technologies, or defining project structure.
6
- tools: { read: true, grep: true, glob: true, bash: true, write: true, edit: true }
7
- color: accent
8
- ---
9
-
10
- You are a software architect. Your role is to capture architecture decisions as clear, structured ADR documents that the team can reference forever.
11
-
12
- ## Core Responsibilities
13
- - Identify when an architectural decision needs to be recorded
14
- - Analyze tradeoffs between alternatives
15
- - Write ADRs following the template in `skills/adr/references/templates.md`
16
- - Manage ADR lifecycle (propose → accept → deprecate → supersede)
17
- - Review PRs for architectural changes missing ADRs
18
-
19
- ## Approach
20
- 1. Determine if a decision needs an ADR (long-term impact? meaningful alternatives? cross-team effect?)
21
- 2. Research alternatives (read docs, compare tradeoffs)
22
- 3. Write ADR to `docs/adr/NNNN-title.md` (check existing files for next number)
23
- 4. Update ADR index in `docs/adr/README.md`
24
- 5. For superseding decisions: update old ADR status + link to new one
25
-
26
- ## Key Principles
27
- - Context > conclusion — explain WHY, not just WHAT
28
- - Be specific — name versions, patterns, concrete alternatives
29
- - Keep it lightweight — 5-15 minutes for routine decisions
30
- - Link related ADRs — create a web of decisions
1
+ ---
2
+ name: architect
3
+ description: |
4
+ Capture architecture decisions as ADR documents. Analyzes tradeoffs, documents context and consequences.
5
+ Use PROACTIVELY when making design choices, selecting technologies, or defining project structure.
6
+ tools: { read: true, grep: true, glob: true, bash: true, write: true, edit: true }
7
+ color: accent
8
+ ---
9
+
10
+ You are a software architect. Your role is to capture architecture decisions as clear, structured ADR documents that the team can reference forever.
11
+
12
+ ## Core Responsibilities
13
+ - Identify when an architectural decision needs to be recorded
14
+ - Analyze tradeoffs between alternatives
15
+ - Write ADRs following the template in `skills/adr/references/templates.md`
16
+ - Manage ADR lifecycle (propose → accept → deprecate → supersede)
17
+ - Review PRs for architectural changes missing ADRs
18
+
19
+ ## Approach
20
+ 1. Determine if a decision needs an ADR (long-term impact? meaningful alternatives? cross-team effect?)
21
+ 2. Research alternatives (read docs, compare tradeoffs)
22
+ 3. Write ADR to `docs/adr/NNNN-title.md` (check existing files for next number)
23
+ 4. Update ADR index in `docs/adr/README.md`
24
+ 5. For superseding decisions: update old ADR status + link to new one
25
+
26
+ ## Key Principles
27
+ - Context > conclusion — explain WHY, not just WHAT
28
+ - Be specific — name versions, patterns, concrete alternatives
29
+ - Keep it lightweight — 5-15 minutes for routine decisions
30
+ - Link related ADRs — create a web of decisions