@chenmk/superflow 0.1.0 → 0.1.2

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 (79) hide show
  1. package/INSTALL.en.md +32 -5
  2. package/INSTALL.md +58 -17
  3. package/README.md +83 -7
  4. package/README.zh-CN.md +80 -11
  5. package/assets/brand/superflow-banner.svg +80 -0
  6. package/assets/context-templates/business-rules.md +45 -78
  7. package/assets/context-templates/decisions.md +63 -149
  8. package/assets/context-templates/external-systems.md +64 -161
  9. package/assets/context-templates/incidents.md +40 -78
  10. package/assets/context-templates-en/business-rules.md +72 -0
  11. package/assets/context-templates-en/decisions.md +72 -0
  12. package/assets/context-templates-en/external-systems.md +78 -0
  13. package/assets/context-templates-en/incidents.md +52 -0
  14. package/assets/manifest.json +6 -4
  15. package/assets/scripts/claude-auto-backup-hook.sh +11 -6
  16. package/assets/scripts/codex-auto-backup-hook.sh +11 -6
  17. package/assets/skills-en/api-doc-changelog/SKILL.md +64 -151
  18. package/assets/skills-en/superflow-clarify/SKILL.md +4 -4
  19. package/assets/skills-en/superflow-clarify/agents/openai.yaml +1 -1
  20. package/assets/skills-en/superflow-design/agents/openai.yaml +1 -1
  21. package/assets/skills-en/superflow-docs/SKILL.md +27 -27
  22. package/assets/skills-en/superflow-docs/agents/openai.yaml +1 -1
  23. package/assets/skills-en/superflow-implement/SKILL.md +113 -457
  24. package/assets/skills-en/superflow-implement/agents/openai.yaml +1 -1
  25. package/assets/skills-en/superflow-pipeline/SKILL.md +167 -840
  26. package/assets/skills-en/superflow-pipeline/agents/openai.yaml +1 -1
  27. package/assets/skills-en/superflow-pipeline/references/api-design-template.md +17 -426
  28. package/assets/skills-en/superflow-pipeline/references/architecture-design-template.md +15 -114
  29. package/assets/skills-en/superflow-pipeline/references/batch-prompt-template.md +36 -524
  30. package/assets/skills-en/superflow-pipeline/references/batch-split-guide.md +19 -133
  31. package/assets/skills-en/superflow-pipeline/references/document-templates.md +50 -123
  32. package/assets/skills-en/superflow-pipeline/references/feature-gated-workflow.md +12 -119
  33. package/assets/skills-en/superflow-pipeline/references/implementation-prompt-template.md +22 -1044
  34. package/assets/skills-en/superflow-pipeline/references/mock-strategy-guide.md +11 -81
  35. package/assets/skills-en/superflow-pipeline/references/openspec-format.md +17 -51
  36. package/assets/skills-en/superflow-pipeline/references/orchestration.md +17 -632
  37. package/assets/skills-en/superflow-pipeline/references/p0-baseline-template.md +10 -169
  38. package/assets/skills-en/superflow-pipeline/references/prompt-usage-template.md +29 -128
  39. package/assets/skills-en/superflow-pipeline/references/quality-gate.md +36 -299
  40. package/assets/skills-en/superflow-pipeline/references/quality-standards.md +12 -186
  41. package/assets/skills-en/superflow-pipeline/references/reviewer-checklist.md +12 -154
  42. package/assets/skills-en/superflow-pipeline/references/sql-risk-review-checklist.md +19 -316
  43. package/assets/skills-en/superflow-pipeline/references/test-execution-template.md +22 -220
  44. package/assets/skills-en/superflow-pipeline/references/test-guide.md +12 -26
  45. package/assets/skills-en/superflow-pipeline/references/traceability-matrix.md +5 -103
  46. package/assets/skills-en/superflow-pipeline/references/validation-integrity.md +12 -130
  47. package/assets/skills-en/superflow-pipeline/scripts/superflow-guard.sh +23 -23
  48. package/assets/skills-en/superflow-pipeline/scripts/superflow-state.sh +1 -1
  49. package/assets/skills-en/superflow-pipeline/scripts/superflow-status.sh +15 -15
  50. package/assets/skills-en/superflow-table-impact-analysis/SKILL.md +3 -3
  51. package/dist/cli/index.js +61 -54
  52. package/dist/cli/index.js.map +1 -1
  53. package/dist/commands/doctor.js +34 -14
  54. package/dist/commands/doctor.js.map +1 -1
  55. package/dist/commands/init.js +75 -27
  56. package/dist/commands/init.js.map +1 -1
  57. package/dist/commands/scan.js +8 -4
  58. package/dist/commands/scan.js.map +1 -1
  59. package/dist/commands/uninstall.js +3 -3
  60. package/dist/commands/uninstall.js.map +1 -1
  61. package/dist/commands/update.js +8 -3
  62. package/dist/commands/update.js.map +1 -1
  63. package/dist/core/cli-help.js +98 -0
  64. package/dist/core/cli-help.js.map +1 -0
  65. package/dist/core/context.js +40 -17
  66. package/dist/core/context.js.map +1 -1
  67. package/dist/core/detect.js +58 -5
  68. package/dist/core/detect.js.map +1 -1
  69. package/dist/core/i18n.js +10 -8
  70. package/dist/core/i18n.js.map +1 -1
  71. package/dist/core/manifest.js +3 -0
  72. package/dist/core/manifest.js.map +1 -1
  73. package/dist/core/scripts.js +8 -0
  74. package/dist/core/scripts.js.map +1 -1
  75. package/dist/core/skills.js +6 -0
  76. package/dist/core/skills.js.map +1 -1
  77. package/dist/core/state.js +12 -1
  78. package/dist/core/state.js.map +1 -1
  79. package/package.json +4 -3
package/INSTALL.en.md CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  [中文教程](./INSTALL.md)
4
4
 
5
- SuperBridge Flow installs OpenSpec, Superpowers, skills, hooks, scripts, rules,
6
- and handoff state for Claude Code and Codex.
5
+ SuperBridge Flow installs OpenSpec, Superpowers, skills, hooks or command
6
+ aliases, scripts, rules, and handoff state for Claude Code, Codex, and
7
+ OpenCode.
7
8
 
8
9
  ## 1. Install
9
10
 
@@ -24,18 +25,27 @@ superflow init --language en --yes
24
25
  superflow init --language zh --yes
25
26
  ```
26
27
 
28
+ Global language selection is also supported:
29
+
30
+ ```bash
31
+ superflow --language en --help
32
+ SUPERFLOW_LANG=en superflow init
33
+ ```
34
+
27
35
  `superflow init` performs:
28
36
 
29
37
  1. Detect platform paths.
30
38
  2. Install OpenSpec CLI.
31
- 3. Run native `openspec init <project> --tools claude,codex --profile custom`.
32
- 4. Install Superpowers for selected agents.
39
+ 3. Run native `openspec init <project> --tools ... --profile custom`.
40
+ 4. Install Superpowers for selected Claude Code/Codex agents.
33
41
  5. Try understand-anything and api-doc-changelog.
34
42
  6. Deploy SuperBridge Flow/OpenSpec skills.
35
43
  7. Register hooks and rules.
36
44
  8. Scaffold `docs/sdd-context/`.
37
45
 
38
- OpenSpec and Superpowers are required. understand-anything is best-effort.
46
+ OpenSpec and Superpowers are required for the full workflow. OpenCode receives
47
+ skills and command aliases; native hook registration is not enabled for
48
+ OpenCode yet. understand-anything is best-effort.
39
49
 
40
50
  ## 3. Daily Workflow
41
51
 
@@ -51,6 +61,12 @@ In Claude Code:
51
61
  /superflow-pipeline
52
62
  ```
53
63
 
64
+ In OpenCode:
65
+
66
+ ```text
67
+ /superflow-pipeline
68
+ ```
69
+
54
70
  The workflow phases are:
55
71
 
56
72
  ```text
@@ -70,6 +86,16 @@ superflow doctor
70
86
  was compressed or interrupted, ask the agent to continue the current SuperBridge
71
87
  Flow change. It will read `.sdd/state.yaml` and `.sdd/handoff`.
72
88
 
89
+ To regenerate project context templates:
90
+
91
+ ```bash
92
+ superflow scan --language en
93
+ superflow scan --language en --force
94
+ ```
95
+
96
+ `scan` keeps edited files by default. Use `--force` only when you want to
97
+ overwrite the four files under `docs/sdd-context/`.
98
+
73
99
  ## 5. Updates
74
100
 
75
101
  Refresh installed skills, hooks, scripts, and rules:
@@ -100,6 +126,7 @@ Team environments should keep `check`. Personal machines may choose `apply`.
100
126
  ```bash
101
127
  superflow uninstall --agent codex --force
102
128
  superflow uninstall --agent claude --force
129
+ superflow uninstall --agent opencode --force
103
130
  ```
104
131
 
105
132
  This removes SuperBridge Flow managed assets only. It does not remove unrelated
package/INSTALL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SuperBridge Flow 安装、初始化与日常使用教程
2
2
 
3
- `@chenmk/superflow` 是面向 Claude Code 和 Codex 的 SDD 开发工作流 CLI。它把
3
+ `@chenmk/superflow` 是面向 Claude Code、Codex 和 OpenCode 的 SDD 开发工作流 CLI。它把
4
4
  OpenSpec、Superpowers、SuperBridge Flow 技能、状态机、handoff 上下文包、hook 脚本和
5
5
  质量门禁安装到你的 agent 环境里,让一个需求可以沿着固定阶段推进:
6
6
 
@@ -24,7 +24,7 @@ docs -> design -> implement -> verify -> archive
24
24
  | Node.js | 20+ | `node -v` |
25
25
  | npm | 9+ | `npm -v` |
26
26
  | Git | 已安装 | `git --version` |
27
- | Agent | Claude Code 或 Codex 至少一个 | `claude --version` / `codex --version` |
27
+ | Agent | Claude Code、Codex 或 OpenCode 至少一个 | `claude --version` / `codex --version` / `opencode --version` |
28
28
  | Shell | macOS/Linux 原生 shell;Windows 使用 Git Bash 或兼容 shell | `bash --version` |
29
29
  | Python | hook 中的 Python 脚本需要 | `python3 --version` |
30
30
 
@@ -55,7 +55,7 @@ npm install -g @chenmk/superflow
55
55
 
56
56
  ```bash
57
57
  git clone <your-repo-url>
58
- cd code-cli-config/sdd-cli
58
+ cd superflow
59
59
  npm install
60
60
  npm run build
61
61
  npm install -g .
@@ -83,7 +83,8 @@ cd your-project
83
83
  superflow init
84
84
  ```
85
85
 
86
- CLI 会弹出工具选择列表。你可以只选 Codex、只选 Claude Code,或两者都选。
86
+ CLI 会弹出工具选择列表。你可以只选 Codex、只选 Claude Code、只选 OpenCode,
87
+ 也可以选择多个工具。
87
88
  选择结果会替代手写 `--agent codex` / `--agent claude`。
88
89
 
89
90
  `superflow init` 会执行:
@@ -92,13 +93,14 @@ CLI 会弹出工具选择列表。你可以只选 Codex、只选 Claude Code,
92
93
  2. 安装 OpenSpec CLI。
93
94
  3. 在当前项目目录执行 OpenSpec 原生初始化,并把你选择的工具下发给
94
95
  OpenSpec,例如 `openspec init <project> --tools claude,codex --profile custom`。
95
- 4. 为目标 agent 安装 Superpowers;这是 Superflow 的核心 HOW/TDD 依赖,
96
- 安装失败会中断初始化。
96
+ 4. 为 Claude Code / Codex 安装 Superpowers;这是 Superflow 的核心 HOW/TDD
97
+ 依赖,安装失败会中断初始化。OpenCode 侧会部署 SuperBridge Flow skills
98
+ 和 commands,不注册原生 hook。
97
99
  5. 尝试安装 understand-anything,并复制 api-doc-changelog;失败只警告,
98
100
  不阻断初始化。
99
101
  6. 部署 SuperBridge Flow/OpenSpec skills。
100
- 7. 部署 hook 脚本并注册到 Codex `hooks.json` 或 Claude
101
- `settings.json`。
102
+ 7. 部署 hook/command 脚本;Codex 写入 `hooks.json`,Claude Code 写入
103
+ `settings.json`,OpenCode 写入 `.opencode/commands`。
102
104
  8. 部署 SuperBridge Flow 防漂移规则。
103
105
  9. 初始化 `docs/sdd-context/` 项目上下文模板,并提示
104
106
  understand-anything 扫描状态。
@@ -109,8 +111,9 @@ CLI 会弹出工具选择列表。你可以只选 Codex、只选 Claude Code,
109
111
  请选择要初始化的 agent 工具(可多选):
110
112
  1) Claude Code
111
113
  2) Codex
112
- a) 两者都安装(默认)
113
- 输入序号,例如 1,2 / 2 / a:
114
+ 3) OpenCode
115
+ a) 安装 Claude Code + Codex(默认);输入 all 会包含 OpenCode
116
+ 输入序号,例如 1,2 / 2,3 / all / a:
114
117
  ```
115
118
 
116
119
  选择结果会同时影响:
@@ -125,8 +128,10 @@ CLI 会弹出工具选择列表。你可以只选 Codex、只选 Claude Code,
125
128
 
126
129
  | 命令 | 说明 |
127
130
  |------|------|
128
- | `superflow init` | 交互式初始化,可多选 Codex / Claude Code |
131
+ | `superflow init` | 交互式初始化,可多选 Codex / Claude Code / OpenCode |
129
132
  | `superflow init --yes` | 非交互执行,默认初始化 Claude Code + Codex |
133
+ | `superflow init --agent opencode` | 只初始化 OpenCode |
134
+ | `superflow init --agent all` | 初始化 Claude Code + Codex + OpenCode |
130
135
  | `superflow init --scope global` | 安装到用户主目录,默认值 |
131
136
  | `superflow init --scope project` | 安装到当前项目目录 |
132
137
  | `superflow init --no-hooks` | 只安装技能和脚本,不注册 hook |
@@ -138,13 +143,36 @@ CLI 会弹出工具选择列表。你可以只选 Codex、只选 Claude Code,
138
143
  | `superflow init --overwrite` | 覆盖已安装的 SuperBridge Flow 技能 |
139
144
  | `superflow init --skip-existing` | 保留已存在技能,不覆盖 |
140
145
 
141
- 初始化后建议重启 Claude Code 或 Codex,让 agent 重新加载技能列表。
146
+ 语言可以通过两种方式选择:
147
+
148
+ ```bash
149
+ # 单次命令使用英文 help / 提示
150
+ superflow --language en --help
151
+ superflow init --language en
152
+
153
+ # 当前 shell 默认使用英文提示
154
+ export SUPERFLOW_LANG=en
155
+ superflow init
156
+ ```
157
+
158
+ 如果只想重新生成项目上下文模板,可以使用:
159
+
160
+ ```bash
161
+ superflow scan --language zh
162
+ superflow scan --language en --force
163
+ ```
164
+
165
+ `scan` 默认保留已经编辑过的文件;加 `--force` 才会覆盖
166
+ `docs/sdd-context/` 下的 4 个模板文件。
167
+
168
+ 初始化后建议重启 Claude Code、Codex 或 OpenCode,让 agent 重新加载技能列表。
142
169
 
143
170
  ## 4. 验证安装
144
171
 
145
172
  ```bash
146
173
  superflow doctor --agent codex
147
174
  superflow doctor --agent claude
175
+ superflow doctor --agent opencode
148
176
  ```
149
177
 
150
178
  也可以同时检查两侧:
@@ -160,7 +188,7 @@ superflow doctor
160
188
  - Superpowers、understand-anything、api-doc-changelog 是否可检测。
161
189
  - SuperBridge Flow skills 是否完整。
162
190
  - hook 脚本是否存在。
163
- - hook 是否已注册。
191
+ - hook 是否已注册;OpenCode 当前检查 command alias,不把原生 hook 作为硬门禁。
164
192
  - SDD rule 是否已部署。
165
193
  - 当前项目里的 `.sdd/state.yaml` 是否符合状态机字段约束。
166
194
 
@@ -168,6 +196,7 @@ superflow doctor
168
196
 
169
197
  ```bash
170
198
  superflow pipeline --agent codex
199
+ superflow pipeline --agent opencode
171
200
  superflow docs --agent codex
172
201
  superflow design --agent codex
173
202
  superflow implement --agent codex
@@ -179,18 +208,21 @@ superflow archive --agent codex
179
208
 
180
209
  ### 5.1 开始一个完整需求
181
210
 
182
- Codex 和 Claude Code 的触发方式不同:
211
+ Codex、Claude Code 和 OpenCode 的触发方式不同:
183
212
 
184
213
  - Codex:通常用自然语言或 `$skill-name` 触发,例如“请使用 SuperBridge Flow 流程”或
185
214
  `$superflow-pipeline`。
186
215
  - Claude Code:安装后可以直接使用 slash command,例如
187
216
  `/superflow-pipeline`、`/superflow-clarify`、`/superflow-docs`、`/superflow-design`、
188
217
  `/superflow-implement`、`/superflow-verify`、`/superflow-archive`。
218
+ - OpenCode:安装后使用 `.opencode/commands` 里的 slash command,例如
219
+ `/superflow-pipeline`、`/superflow-docs`、`/superflow-design`、`/superflow-verify`。
189
220
 
190
221
  普通使用建议始终先走总路由,让 SDD 自己判断阶段:
191
222
 
192
223
  - Codex:优先 `$superflow-pipeline` 或自然语言“请使用 SuperBridge Flow 流程”。
193
224
  - Claude Code:优先 `/superflow-pipeline`。
225
+ - OpenCode:优先 `/superflow-pipeline`。
194
226
 
195
227
  只有你非常明确当前就是需求澄清、文档补齐、技术详设或实现阶段时,才直达
196
228
  `$superflow-clarify` / `/superflow-clarify`、`$superflow-docs` / `/superflow-docs` 等阶段命令。
@@ -207,6 +239,12 @@ Codex 和 Claude Code 的触发方式不同:
207
239
  /superflow-pipeline 处理这个需求:……
208
240
  ```
209
241
 
242
+ 在 OpenCode 会话里同样可以运行:
243
+
244
+ ```text
245
+ /superflow-pipeline 处理这个需求:……
246
+ ```
247
+
210
248
  两种方式都会从 SDD 总入口路由,通常按下面阶段推进。
211
249
 
212
250
  #### 示例:读取飞书在线文档中的某个小节
@@ -453,7 +491,7 @@ Claude Code 里也可以直接用当前阶段命令继续,例如:
453
491
 
454
492
  - `@chenmk/superflow`
455
493
  - `@fission-ai/openspec`
456
- - Claude Code / Codex 的 Superpowers 插件
494
+ - Claude Code / Codex 的 Superpowers 插件;OpenCode 侧刷新 SuperBridge Flow assets
457
495
 
458
496
  同一会话只检查一次;默认只提示,不自动安装。至少间隔 6 小时才真正访问
459
497
  npm/plugin 源,避免每次 prompt 都联网。可用:
@@ -538,7 +576,7 @@ which superflow
538
576
  如果是源码安装,也可以重新链接:
539
577
 
540
578
  ```bash
541
- cd code-cli-config/sdd-cli
579
+ cd superflow
542
580
  npm run build
543
581
  npm install -g .
544
582
  ```
@@ -561,17 +599,20 @@ python3 --version
561
599
 
562
600
  ### 技能装好了,但 agent 没触发
563
601
 
564
- 重启 Claude Code 或 Codex。若仍不触发:
602
+ 重启 Claude Code、Codex 或 OpenCode。若仍不触发:
565
603
 
566
604
  ```bash
567
605
  superflow doctor --agent codex
606
+ superflow doctor --agent opencode
568
607
  superflow pipeline --agent codex
608
+ superflow pipeline --agent opencode
569
609
  ```
570
610
 
571
611
  然后在会话里明确说:
572
612
 
573
613
  ```text
574
614
  请使用 $superflow-pipeline 处理这个需求。
615
+ /superflow-pipeline 处理这个需求。
575
616
  ```
576
617
 
577
618
  ### 任务 prompt 偶发缺失
package/README.md CHANGED
@@ -1,18 +1,66 @@
1
- # SuperBridge Flow
1
+ <p align="center">
2
+ <img src="./assets/brand/superflow-banner.svg" alt="SuperBridge Flow banner">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/@chenmk/superflow"><img alt="npm version" src="https://img.shields.io/npm/v/@chenmk/superflow?style=flat-square"></a>
7
+ <a href="https://www.npmjs.com/package/@chenmk/superflow"><img alt="monthly downloads" src="https://img.shields.io/npm/dm/@chenmk/superflow?style=flat-square&label=Downloads/mo"></a>
8
+ <a href="https://www.npmjs.com/package/@chenmk/superflow"><img alt="weekly downloads" src="https://img.shields.io/npm/dw/@chenmk/superflow?style=flat-square&label=Downloads/wk"></a>
9
+ <a href="https://github.com/BasketballNotFound-ManKun/superflow-cli/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/BasketballNotFound-ManKun/superflow-cli?style=flat-square"></a>
10
+ <a href="./LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square"></a>
11
+ <img alt="Node.js 20+" src="https://img.shields.io/badge/Node.js-20%2B-339933?style=flat-square">
12
+ </p>
13
+
14
+ <p align="center">
15
+ <strong>A workflow harness for turning OpenSpec/SDD contracts and
16
+ Superpowers engineering discipline into one delivery flow.</strong>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <a href="./README.zh-CN.md">中文文档</a>
21
+ ·
22
+ <a href="#install">Install</a>
23
+ ·
24
+ <a href="#workflow">Workflow</a>
25
+ ·
26
+ <a href="#star-history">Star History</a>
27
+ </p>
2
28
 
3
- [中文文档](./README.zh-CN.md)
29
+ # SuperBridge Flow
4
30
 
5
31
  SuperBridge Flow is a workflow CLI for bringing OpenSpec/SDD and Superpowers
6
32
  together in real software delivery.
7
33
 
34
+ ## Why SuperBridge Flow
35
+
36
+ Modern agentic coding often fails in the gap between a well-written spec and
37
+ real verified delivery. SuperBridge Flow makes that gap explicit:
38
+
8
39
  - OpenSpec/SDD owns **WHAT**: requirements, API contracts, database and field
9
40
  semantics, tests, real-entry acceptance, and quality gates.
10
41
  - Superpowers owns source-level **HOW**: technical design, TDD order,
11
42
  worktree/team execution, review, and verification discipline.
12
- - The full lifecycle is `docs -> design -> implement -> verify -> archive`.
43
+ - Handoff files, phase state, hooks, and guards reduce context drift when long
44
+ conversations get compacted or split across agent sessions.
45
+
46
+ The CLI installs skills, hooks or command aliases, rules, scripts, handoff
47
+ state, and dependency guards for Claude Code, Codex, and OpenCode.
48
+
49
+ ## Workflow
13
50
 
14
- The CLI installs skills, hooks, rules, scripts, handoff state, and dependency
15
- guards for Claude Code and Codex.
51
+ ```text
52
+ docs -> design -> implement -> verify -> archive
53
+ ```
54
+
55
+ Each phase has a clear owner and an exit gate:
56
+
57
+ | Phase | Owner | Output |
58
+ | --- | --- | --- |
59
+ | `docs` | OpenSpec/SDD | Requirements, contracts, API/DB/test docs |
60
+ | `design` | Superpowers | Source-level technical design and TDD plan |
61
+ | `implement` | Superpowers + SuperBridge Flow | Batched implementation prompts and review gates |
62
+ | `verify` | SuperBridge Flow hooks | Evidence-backed test report and real-entry checks |
63
+ | `archive` | OpenSpec/SDD | Final spec archive and lifecycle closure |
16
64
 
17
65
  ## Install
18
66
 
@@ -28,7 +76,7 @@ superflow init
28
76
 
29
77
  Interactive init lets you select:
30
78
 
31
- - target agent tools: Claude Code, Codex, or both
79
+ - target agent tools: Claude Code, Codex, OpenCode, or selected combinations
32
80
  - language: English or Chinese
33
81
  - install scope: global or project
34
82
 
@@ -40,6 +88,13 @@ superflow init --language en --yes
40
88
  superflow init --language zh --yes
41
89
  ```
42
90
 
91
+ CLI help and runtime prompts can also be switched globally:
92
+
93
+ ```bash
94
+ superflow --language en --help
95
+ SUPERFLOW_LANG=en superflow init
96
+ ```
97
+
43
98
  ## What Init Installs
44
99
 
45
100
  `superflow init` installs and configures:
@@ -60,10 +115,14 @@ best-effort and does not block initialization.
60
115
  | Command | Purpose |
61
116
  | --- | --- |
62
117
  | `superflow init` | Install and configure SuperBridge Flow interactively |
118
+ | `superflow init --agent opencode` | Install OpenCode skills and command aliases |
119
+ | `superflow init --agent all` | Install Claude Code, Codex, and OpenCode |
63
120
  | `superflow update` | Refresh installed skills, hooks, scripts, and rules |
64
121
  | `superflow update --with-package` | Also update `@chenmk/superflow`, OpenSpec, and Superpowers |
65
122
  | `superflow doctor` | Diagnose installed assets and project state |
66
123
  | `superflow status` | Show active changes, current phase, next command, and risks |
124
+ | `superflow --language en --help` | Show English CLI help |
125
+ | `superflow scan --language en` | Regenerate project context templates in English |
67
126
  | `superflow pipeline` | Check pipeline skill deployment |
68
127
  | `superflow docs` | Check docs-phase skill deployment |
69
128
  | `superflow design` | Check design-phase skill deployment |
@@ -85,6 +144,16 @@ In Claude Code:
85
144
  /superflow-pipeline
86
145
  ```
87
146
 
147
+ In OpenCode:
148
+
149
+ ```text
150
+ /superflow-pipeline
151
+ ```
152
+
153
+ OpenCode receives `.opencode/skills` and `.opencode/commands` assets. Native
154
+ hook registration is not enabled for OpenCode yet; use `/superflow-*` commands
155
+ to run workflow gates explicitly.
156
+
88
157
  For large requirements, ask the agent to read one section or one feature at a
89
158
  time. SuperBridge Flow will route through clarification, OpenSpec docs,
90
159
  Superpowers technical design, implementation prompts, verification, and archive.
@@ -133,10 +202,17 @@ keeps the same workflow contracts.
133
202
  ## Requirements
134
203
 
135
204
  - Node.js 20+
136
- - Claude Code or Codex
205
+ - Claude Code, Codex, or OpenCode
137
206
  - npm access to install OpenSpec and Superpowers
138
207
  - Git Bash or a compatible shell on Windows for hook scripts
139
208
 
209
+ ## Star History
210
+
211
+ The chart is generated by Star History from public GitHub star data. It may stay
212
+ empty while the repository is private.
213
+
214
+ [![Star History Chart](https://api.star-history.com/svg?repos=BasketballNotFound-ManKun/superflow-cli&type=Date)](https://star-history.com/#BasketballNotFound-ManKun/superflow-cli&Date)
215
+
140
216
  ## License
141
217
 
142
218
  MIT
package/README.zh-CN.md CHANGED
@@ -1,13 +1,59 @@
1
+ <p align="center">
2
+ <img src="./assets/brand/superflow-banner.svg" alt="SuperBridge Flow banner">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/@chenmk/superflow"><img alt="npm version" src="https://img.shields.io/npm/v/@chenmk/superflow?style=flat-square"></a>
7
+ <a href="https://www.npmjs.com/package/@chenmk/superflow"><img alt="monthly downloads" src="https://img.shields.io/npm/dm/@chenmk/superflow?style=flat-square&label=Downloads/mo"></a>
8
+ <a href="https://www.npmjs.com/package/@chenmk/superflow"><img alt="weekly downloads" src="https://img.shields.io/npm/dw/@chenmk/superflow?style=flat-square&label=Downloads/wk"></a>
9
+ <a href="https://github.com/BasketballNotFound-ManKun/superflow-cli/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/BasketballNotFound-ManKun/superflow-cli?style=flat-square"></a>
10
+ <a href="./LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square"></a>
11
+ <img alt="Node.js 20+" src="https://img.shields.io/badge/Node.js-20%2B-339933?style=flat-square">
12
+ </p>
13
+
14
+ <p align="center">
15
+ <strong>把 OpenSpec/SDD 的合同约束和 Superpowers 的工程纪律,收束成一个可执行的交付工作流。</strong>
16
+ </p>
17
+
18
+ <p align="center">
19
+ <a href="./README.md">English</a>
20
+ ·
21
+ <a href="#安装">安装</a>
22
+ ·
23
+ <a href="#工作流">工作流</a>
24
+ ·
25
+ <a href="#star-history">Star History</a>
26
+ </p>
27
+
1
28
  # SuperBridge Flow
2
29
 
3
- [English](./README.md)
30
+ 通用 SDD 开发工作流 CLI,支持 Claude Code、Codex 和 OpenCode。
4
31
 
5
- 通用 SDD 开发工作流 CLI,支持 Claude Code 和 Codex。
32
+ SuperBridge Flow 不是简单“装两个工具”,而是把 OpenSpec/SDD 和
33
+ Superpowers 编排成一个有状态的研发流程:前者负责需求、合同和验收口径,
34
+ 后者负责源码级设计、TDD 顺序、实现分工、review 和真实验证。
6
35
 
7
- 把 SuperBridge Flow 技能和配套 hook 脚本整合为单一 npm 包,通过 CLI 自动部署到:
36
+ CLI 会把 SuperBridge Flow 技能、配套 hook/command 脚本整合为单一 npm 包,
37
+ 自动部署到:
8
38
 
9
39
  - Claude Code:`~/.claude/skills/`、`~/.claude/scripts/`,并注册 `~/.claude/settings.json` hook
10
40
  - Codex:`~/.codex/skills/`、`~/.codex/hooks/`
41
+ - OpenCode:`.opencode/skills/`、`.opencode/commands/`、`.opencode/scripts/`
42
+ 或全局 `~/.config/opencode/`
43
+
44
+ ## 工作流
45
+
46
+ ```text
47
+ docs -> design -> implement -> verify -> archive
48
+ ```
49
+
50
+ | 阶段 | 主责 | 产物 |
51
+ |------|------|------|
52
+ | `docs` | OpenSpec/SDD | 需求、接口、数据库、测试和验收合同 |
53
+ | `design` | Superpowers | 源码级技术详设、影响面分析和 TDD 计划 |
54
+ | `implement` | Superpowers + SuperBridge Flow | 分批任务 prompt、review 门禁和执行状态 |
55
+ | `verify` | SuperBridge Flow hooks | 有证据的测试报告、真实入口和联调校验 |
56
+ | `archive` | OpenSpec/SDD | 归档后的 spec 状态和生命周期闭环 |
11
57
 
12
58
  ## 安装
13
59
 
@@ -20,12 +66,18 @@ npm install -g @chenmk/superflow
20
66
  ## 快速开始
21
67
 
22
68
  ```bash
23
- # 交互式选择 Claude Code / Codex(可多选)
69
+ # 交互式选择 Claude Code / Codex / OpenCode(可多选)
24
70
  superflow init
25
71
 
26
72
  # 非交互模式,默认同时安装 Claude Code + Codex
27
73
  superflow init --yes
28
74
 
75
+ # 显式安装 OpenCode
76
+ superflow init --agent opencode
77
+
78
+ # 同时安装 Claude Code + Codex + OpenCode
79
+ superflow init --agent all
80
+
29
81
  # 跳过 hook 注册(手工管理)
30
82
  superflow init --no-hooks
31
83
 
@@ -39,6 +91,17 @@ superflow init --resume
39
91
  superflow doctor
40
92
  ```
41
93
 
94
+ 语言也可以全局切换:
95
+
96
+ ```bash
97
+ # 查看英文 CLI help
98
+ superflow --language en --help
99
+
100
+ # 当前 shell 默认使用英文提示
101
+ export SUPERFLOW_LANG=en
102
+ superflow init
103
+ ```
104
+
42
105
  ## SDD 分工
43
106
 
44
107
  - OpenSpec/SDD 负责 WHAT 和合同:需求、API、DB、SQL、字段语义、tests、真实入口验收和质量门禁。
@@ -51,14 +114,18 @@ superflow doctor
51
114
 
52
115
  | 命令 | 说明 |
53
116
  |------|------|
54
- | `superflow init` | 一站式安装;交互终端中可多选 Claude Code / Codex |
117
+ | `superflow init` | 一站式安装;交互终端中可多选 Claude Code / Codex / OpenCode |
55
118
  | `superflow init --yes` | 非交互安装,默认 `--agent both` |
119
+ | `superflow init --agent opencode` | 安装 OpenCode skills、commands、scripts 和 rules |
120
+ | `superflow init --agent all` | 同时安装 Claude Code + Codex + OpenCode |
56
121
  | `superflow init --dry-run` | 只打印计划不执行 |
57
122
  | `superflow init --resume` | 从失败步骤继续 |
58
123
  | `superflow init --no-hooks` | 只装技能 + 脚本,跳过 Codex/Claude hook 注册 |
59
124
  | `superflow init --no-openspec-init` | 跳过当前项目 OpenSpec 原生初始化 |
60
125
  | `superflow doctor` | 诊断 CLI / 第三方 / 脚本 / skills |
61
126
  | `superflow doctor --agent codex` | 只诊断 Codex 侧 |
127
+ | `superflow --language en --help` | 查看英文 CLI help |
128
+ | `superflow scan --language en` | 重新生成英文项目上下文模板 |
62
129
  | `superflow clarify [feature]` | 校验 SuperBridge Flow clarify 阶段技能部署 |
63
130
  | `superflow docs [change]` | 校验 SuperBridge Flow docs 阶段技能部署 |
64
131
  | `superflow design [change]` | 校验 SuperBridge Flow design 阶段技能部署 |
@@ -74,10 +141,10 @@ superflow doctor
74
141
  ## 依赖
75
142
 
76
143
  - Node.js 20+
77
- - Claude Code 或 Codex(按 `--agent` 选择)
144
+ - Claude Code、Codex 或 OpenCode(按 `--agent` 选择)
78
145
  - 第三方(`superflow init` 自动装):
79
146
  - openspec CLI(硬依赖,npm 全局)并在当前项目执行 `openspec init --tools ...`
80
- - superpowers(硬依赖,Claude Code / Codex 对应插件)
147
+ - superpowers(Claude Code / Codex 为硬依赖;OpenCode 侧通过已部署 skills/commands 使用流程)
81
148
  - understand-anything(尽力安装,失败只警告)
82
149
  - api-doc-changelog(辅助 skill,复制到目标 agent skills 目录)
83
150
 
@@ -87,7 +154,7 @@ superflow doctor
87
154
 
88
155
  - `@chenmk/superflow`
89
156
  - `@fission-ai/openspec`
90
- - Claude Code / Codex 的 Superpowers 插件
157
+ - Claude Code / Codex 的 Superpowers 插件;OpenCode 侧的 SuperBridge Flow assets
91
158
 
92
159
  推荐策略是“自动检查,手动更新”:默认只提示,不自动安装;执行
93
160
  `superflow update --with-package` 才会统一更新。
@@ -107,10 +174,12 @@ export SUPERFLOW_AUTO_UPDATE=apply
107
174
  export SUPERFLOW_UPDATE_MIN_INTERVAL_SECONDS=21600
108
175
  ```
109
176
 
110
- ## 设计文档
177
+ ## Star History
178
+
179
+ 下图由 Star History 根据 GitHub 公开 star 数据动态生成。仓库保持 private
180
+ 时,第三方服务通常读不到完整数据;切换为 public 后会正常展示趋势。
111
181
 
112
- - 详细设计:`~/cmk-project/code-cli-config/sdd-cli-design.md`
113
- - 实施 plan:`~/cmk-project/code-cli-config/sdd-cli-plan.md`
182
+ [![Star History Chart](https://api.star-history.com/svg?repos=BasketballNotFound-ManKun/superflow-cli&type=Date)](https://star-history.com/#BasketballNotFound-ManKun/superflow-cli&Date)
114
183
 
115
184
  ## 许可证
116
185
 
@@ -0,0 +1,80 @@
1
+ <svg width="1600" height="420" viewBox="0 0 1600 420" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="title desc">
2
+ <title id="title">SuperBridge Flow banner</title>
3
+ <desc id="desc">A dark technical banner for SuperBridge Flow, connecting OpenSpec and Superpowers through a bridge-shaped workflow.</desc>
4
+ <defs>
5
+ <radialGradient id="blueGlow" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(328 205) rotate(18) scale(502 230)">
6
+ <stop stop-color="#67e8f9"/>
7
+ <stop offset="0.34" stop-color="#2563eb" stop-opacity="0.86"/>
8
+ <stop offset="1" stop-color="#020617" stop-opacity="0"/>
9
+ </radialGradient>
10
+ <radialGradient id="greenGlow" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(1110 218) rotate(160) scale(430 210)">
11
+ <stop stop-color="#22c55e" stop-opacity="0.9"/>
12
+ <stop offset="0.42" stop-color="#0891b2" stop-opacity="0.64"/>
13
+ <stop offset="1" stop-color="#020617" stop-opacity="0"/>
14
+ </radialGradient>
15
+ <linearGradient id="flow" x1="174" y1="256" x2="1360" y2="126" gradientUnits="userSpaceOnUse">
16
+ <stop stop-color="#60a5fa"/>
17
+ <stop offset="0.46" stop-color="#a78bfa"/>
18
+ <stop offset="1" stop-color="#34d399"/>
19
+ </linearGradient>
20
+ <filter id="softGlow" x="-40%" y="-40%" width="180%" height="180%" color-interpolation-filters="sRGB">
21
+ <feGaussianBlur stdDeviation="10" result="blur"/>
22
+ <feColorMatrix in="blur" type="matrix" values="0 0 0 0 0.28 0 0 0 0 0.65 0 0 0 0 1 0 0 0 0.9 0"/>
23
+ <feBlend in="SourceGraphic" mode="screen"/>
24
+ </filter>
25
+ <pattern id="dotGrid" width="22" height="22" patternUnits="userSpaceOnUse">
26
+ <circle cx="2" cy="2" r="1.4" fill="#38bdf8" opacity="0.28"/>
27
+ </pattern>
28
+ </defs>
29
+
30
+ <rect width="1600" height="420" rx="18" fill="#020617"/>
31
+ <rect width="1600" height="420" rx="18" fill="url(#blueGlow)"/>
32
+ <rect width="1600" height="420" rx="18" fill="url(#greenGlow)"/>
33
+ <rect x="0" y="0" width="1600" height="420" fill="url(#dotGrid)" opacity="0.72"/>
34
+
35
+ <path d="M94 310C250 136 405 106 568 214C734 324 884 319 1039 181C1159 74 1298 56 1488 112" stroke="url(#flow)" stroke-width="8" stroke-linecap="round" filter="url(#softGlow)"/>
36
+ <path d="M122 338C298 210 438 205 584 282C743 365 936 308 1054 214C1184 111 1318 103 1476 154" stroke="#e0f2fe" stroke-width="2" stroke-linecap="round" opacity="0.78"/>
37
+ <path d="M126 282C298 68 513 80 664 196C808 307 966 273 1092 146C1214 23 1374 32 1502 72" stroke="#93c5fd" stroke-width="2" stroke-linecap="round" opacity="0.42"/>
38
+
39
+ <g opacity="0.86">
40
+ <path d="M280 304H1320" stroke="#64748b" stroke-width="2"/>
41
+ <path d="M360 304C430 218 500 178 570 178C650 178 710 304 790 304C875 304 935 178 1025 178C1100 178 1168 222 1240 304" stroke="#cbd5e1" stroke-width="5" stroke-linecap="round"/>
42
+ <path d="M422 304V252M528 304V207M635 304V207M742 304V252M858 304V252M965 304V207M1072 304V207M1178 304V252" stroke="#cbd5e1" stroke-width="5" stroke-linecap="round"/>
43
+ </g>
44
+
45
+ <g>
46
+ <rect x="94" y="84" width="230" height="52" rx="8" fill="#0f172a" stroke="#38bdf8" stroke-opacity="0.45"/>
47
+ <text x="118" y="118" fill="#bae6fd" font-family="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace" font-size="24" letter-spacing="2">OpenSpec / SDD</text>
48
+ <rect x="94" y="148" width="230" height="40" rx="8" fill="#020617" stroke="#334155"/>
49
+ <text x="118" y="174" fill="#94a3b8" font-family="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace" font-size="18">WHAT + contracts</text>
50
+ </g>
51
+
52
+ <g>
53
+ <rect x="1276" y="238" width="230" height="52" rx="8" fill="#052e2b" stroke="#34d399" stroke-opacity="0.52"/>
54
+ <text x="1300" y="272" fill="#bbf7d0" font-family="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace" font-size="24" letter-spacing="2">Superpowers</text>
55
+ <rect x="1276" y="302" width="230" height="40" rx="8" fill="#020617" stroke="#334155"/>
56
+ <text x="1300" y="328" fill="#94a3b8" font-family="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace" font-size="18">HOW + verification</text>
57
+ </g>
58
+
59
+ <g>
60
+ <text x="522" y="132" fill="#f8fafc" font-family="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace" font-size="72" font-weight="800" letter-spacing="6">SUPERFLOW</text>
61
+ <text x="528" y="179" fill="#cbd5e1" font-family="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace" font-size="28" letter-spacing="5">SUPERBRIDGE FLOW</text>
62
+ <text x="531" y="224" fill="#60a5fa" font-family="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace" font-size="24" letter-spacing="3">FROM REQUIREMENT TO VERIFIED DELIVERY</text>
63
+ </g>
64
+
65
+ <g fill="#e2e8f0" font-family="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace" font-size="17" opacity="0.9">
66
+ <text x="506" y="355">docs</text>
67
+ <text x="638" y="355">design</text>
68
+ <text x="800" y="355">implement</text>
69
+ <text x="990" y="355">verify</text>
70
+ <text x="1136" y="355">archive</text>
71
+ </g>
72
+
73
+ <g fill="#38bdf8" filter="url(#softGlow)">
74
+ <circle cx="486" cy="304" r="7"/>
75
+ <circle cx="624" cy="304" r="7"/>
76
+ <circle cx="782" cy="304" r="7"/>
77
+ <circle cx="960" cy="304" r="7"/>
78
+ <circle cx="1118" cy="304" r="7"/>
79
+ </g>
80
+ </svg>