@chenmk/superflow 0.1.1 → 0.1.3
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/INSTALL.en.md +32 -5
- package/INSTALL.md +58 -17
- package/README.md +121 -7
- package/README.zh-CN.md +92 -11
- package/assets/brand/superflow-banner.svg +80 -0
- package/assets/context-templates/business-rules.md +45 -78
- package/assets/context-templates/decisions.md +63 -149
- package/assets/context-templates/external-systems.md +64 -161
- package/assets/context-templates/incidents.md +40 -78
- package/assets/context-templates-en/business-rules.md +72 -0
- package/assets/context-templates-en/decisions.md +72 -0
- package/assets/context-templates-en/external-systems.md +78 -0
- package/assets/context-templates-en/incidents.md +52 -0
- package/assets/manifest.json +6 -4
- package/assets/scripts/claude-auto-backup-hook.sh +11 -6
- package/assets/scripts/codex-auto-backup-hook.sh +11 -6
- package/assets/skills/superflow-design/SKILL.md +16 -8
- package/assets/skills/superflow-docs/SKILL.md +17 -8
- package/assets/skills/superflow-pipeline/references/api-design-template.md +99 -63
- package/assets/skills/superflow-pipeline/references/batch-prompt-template.md +62 -14
- package/assets/skills/superflow-pipeline/references/implementation-prompt-template.md +114 -67
- package/assets/skills/superflow-pipeline/references/quality-gate.md +104 -102
- package/assets/skills/superflow-pipeline/references/superpower-technical-design-template.md +45 -19
- package/assets/skills/superflow-pipeline/scripts/superflow-guard.sh +35 -0
- package/assets/skills-en/api-doc-changelog/SKILL.md +64 -151
- package/assets/skills-en/superflow-clarify/SKILL.md +4 -4
- package/assets/skills-en/superflow-clarify/agents/openai.yaml +1 -1
- package/assets/skills-en/superflow-design/agents/openai.yaml +1 -1
- package/assets/skills-en/superflow-docs/SKILL.md +27 -27
- package/assets/skills-en/superflow-docs/agents/openai.yaml +1 -1
- package/assets/skills-en/superflow-implement/SKILL.md +113 -457
- package/assets/skills-en/superflow-implement/agents/openai.yaml +1 -1
- package/assets/skills-en/superflow-pipeline/SKILL.md +167 -840
- package/assets/skills-en/superflow-pipeline/agents/openai.yaml +1 -1
- package/assets/skills-en/superflow-pipeline/references/api-design-template.md +17 -426
- package/assets/skills-en/superflow-pipeline/references/architecture-design-template.md +15 -114
- package/assets/skills-en/superflow-pipeline/references/batch-prompt-template.md +36 -524
- package/assets/skills-en/superflow-pipeline/references/batch-split-guide.md +19 -133
- package/assets/skills-en/superflow-pipeline/references/document-templates.md +50 -123
- package/assets/skills-en/superflow-pipeline/references/feature-gated-workflow.md +12 -119
- package/assets/skills-en/superflow-pipeline/references/implementation-prompt-template.md +22 -1044
- package/assets/skills-en/superflow-pipeline/references/mock-strategy-guide.md +11 -81
- package/assets/skills-en/superflow-pipeline/references/openspec-format.md +17 -51
- package/assets/skills-en/superflow-pipeline/references/orchestration.md +17 -632
- package/assets/skills-en/superflow-pipeline/references/p0-baseline-template.md +10 -169
- package/assets/skills-en/superflow-pipeline/references/prompt-usage-template.md +29 -128
- package/assets/skills-en/superflow-pipeline/references/quality-gate.md +36 -299
- package/assets/skills-en/superflow-pipeline/references/quality-standards.md +12 -186
- package/assets/skills-en/superflow-pipeline/references/reviewer-checklist.md +12 -154
- package/assets/skills-en/superflow-pipeline/references/sql-risk-review-checklist.md +19 -316
- package/assets/skills-en/superflow-pipeline/references/test-execution-template.md +22 -220
- package/assets/skills-en/superflow-pipeline/references/test-guide.md +12 -26
- package/assets/skills-en/superflow-pipeline/references/traceability-matrix.md +5 -103
- package/assets/skills-en/superflow-pipeline/references/validation-integrity.md +12 -130
- package/assets/skills-en/superflow-pipeline/scripts/superflow-guard.sh +23 -23
- package/assets/skills-en/superflow-pipeline/scripts/superflow-state.sh +1 -1
- package/assets/skills-en/superflow-pipeline/scripts/superflow-status.sh +15 -15
- package/assets/skills-en/superflow-table-impact-analysis/SKILL.md +3 -3
- package/dist/cli/index.js +61 -54
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/design.js +25 -3
- package/dist/commands/design.js.map +1 -1
- package/dist/commands/doctor.js +31 -12
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.js +75 -27
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/scan.js +8 -4
- package/dist/commands/scan.js.map +1 -1
- package/dist/commands/uninstall.js +3 -3
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +8 -3
- package/dist/commands/update.js.map +1 -1
- package/dist/core/cli-help.js +98 -0
- package/dist/core/cli-help.js.map +1 -0
- package/dist/core/context.js +40 -17
- package/dist/core/context.js.map +1 -1
- package/dist/core/detect.js +58 -5
- package/dist/core/detect.js.map +1 -1
- package/dist/core/i18n.js +10 -8
- package/dist/core/i18n.js.map +1 -1
- package/dist/core/manifest.js +3 -0
- package/dist/core/manifest.js.map +1 -1
- package/dist/core/scripts.js +8 -0
- package/dist/core/scripts.js.map +1 -1
- package/dist/core/skills.js +6 -0
- package/dist/core/skills.js.map +1 -1
- package/dist/core/state.js +12 -1
- package/dist/core/state.js.map +1 -1
- 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
|
|
6
|
-
and handoff state for Claude Code and
|
|
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
|
|
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
|
|
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 和
|
|
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 或
|
|
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
|
|
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.
|
|
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
|
|
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
|
-
|
|
113
|
-
|
|
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
|
-
|
|
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 和
|
|
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
|
|
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 或
|
|
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,102 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
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
|
+
## Highlights
|
|
50
|
+
|
|
51
|
+
- **9 catalogued failure modes, blocked at the gate.** Nine real ways AI breaks
|
|
52
|
+
in production — swallowing the whole PRD then forgetting details, editing
|
|
53
|
+
only the setter while missing consumers, SQL drift across dev/test/DB
|
|
54
|
+
layers, mock-only "已验证" reports, and more — each baked into a hard check
|
|
55
|
+
the agent cannot skip.
|
|
56
|
+
- **Architecture 6-questions before cross-service code.** Any change crossing
|
|
57
|
+
service / SDK / MQ / device / callback / gateway boundaries must answer six
|
|
58
|
+
questions in the technical design: who owns the module, what is the call
|
|
59
|
+
direction, where are existing entry/exit points, are new ones allowed, which
|
|
60
|
+
paths are forbidden, what is the evidence anchor.
|
|
61
|
+
- **Field And Status Reverse Impact matrix.** Every schema / status / enum
|
|
62
|
+
change must enumerate its write sites, read sites, filter conditions,
|
|
63
|
+
derived / sync sites, cross-module consumers, and test coverage — including
|
|
64
|
+
reverse-recovery scenarios (down then up again, deleted then re-created, old
|
|
65
|
+
value unavailable while upstream didn't send the field).
|
|
66
|
+
- **6 productized lessons as gates, not reminders.** Full-impact discovery,
|
|
67
|
+
business semantics over HTTP 200, no default fallbacks, DB reconciliation,
|
|
68
|
+
real-entry evidence, code-data verification — each baked into a specific
|
|
69
|
+
phase and a specific hook. Missing evidence blocks the next phase.
|
|
70
|
+
- **5 phases × 5+ guard scripts as hard gates.** `superflow-guard.sh` +
|
|
71
|
+
`superflow-hook-guard.sh` + `superflow-contract-hooks.sh` +
|
|
72
|
+
`superflow-sql-sync-hook.py` + `superflow-test-report-lint.py` +
|
|
73
|
+
`superflow-verify-integration.sh`. No handoff hash → no implementation. No
|
|
74
|
+
real-entry evidence → no "verified" report.
|
|
75
|
+
- **Context-drift proof via handoff + state + sha256.** When long sessions
|
|
76
|
+
compress, when agents switch, when multiple workers parallelize —
|
|
77
|
+
`.sdd/handoff/sdd-context.{md,json}` + sha256 + `.sdd/state.yaml` keep
|
|
78
|
+
Worker / Tester / Reviewer on the same source of truth. Stale prompts
|
|
79
|
+
blocked by hash mismatch.
|
|
80
|
+
- **User says one sentence, pipeline runs 9 steps.** No prompt engineering
|
|
81
|
+
required: `> use SuperFlow to handle this requirement` triggers clarify →
|
|
82
|
+
docs → design → implement → verify → archive. Phase progression, guards,
|
|
83
|
+
hashes, and hooks are flow-enforced, not user-discipline.
|
|
84
|
+
|
|
85
|
+
## Workflow
|
|
13
86
|
|
|
14
|
-
|
|
15
|
-
|
|
87
|
+
```text
|
|
88
|
+
docs -> design -> implement -> verify -> archive
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Each phase has a clear owner and an exit gate:
|
|
92
|
+
|
|
93
|
+
| Phase | Owner | Output |
|
|
94
|
+
| --- | --- | --- |
|
|
95
|
+
| `docs` | OpenSpec/SDD | Requirements, contracts, API/DB/test docs |
|
|
96
|
+
| `design` | Superpowers | Source-level technical design and TDD plan |
|
|
97
|
+
| `implement` | Superpowers + SuperBridge Flow | Batched implementation prompts and review gates |
|
|
98
|
+
| `verify` | SuperBridge Flow hooks | Evidence-backed test report and real-entry checks |
|
|
99
|
+
| `archive` | OpenSpec/SDD | Final spec archive and lifecycle closure |
|
|
16
100
|
|
|
17
101
|
## Install
|
|
18
102
|
|
|
@@ -28,7 +112,7 @@ superflow init
|
|
|
28
112
|
|
|
29
113
|
Interactive init lets you select:
|
|
30
114
|
|
|
31
|
-
- target agent tools: Claude Code, Codex, or
|
|
115
|
+
- target agent tools: Claude Code, Codex, OpenCode, or selected combinations
|
|
32
116
|
- language: English or Chinese
|
|
33
117
|
- install scope: global or project
|
|
34
118
|
|
|
@@ -40,6 +124,13 @@ superflow init --language en --yes
|
|
|
40
124
|
superflow init --language zh --yes
|
|
41
125
|
```
|
|
42
126
|
|
|
127
|
+
CLI help and runtime prompts can also be switched globally:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
superflow --language en --help
|
|
131
|
+
SUPERFLOW_LANG=en superflow init
|
|
132
|
+
```
|
|
133
|
+
|
|
43
134
|
## What Init Installs
|
|
44
135
|
|
|
45
136
|
`superflow init` installs and configures:
|
|
@@ -60,10 +151,14 @@ best-effort and does not block initialization.
|
|
|
60
151
|
| Command | Purpose |
|
|
61
152
|
| --- | --- |
|
|
62
153
|
| `superflow init` | Install and configure SuperBridge Flow interactively |
|
|
154
|
+
| `superflow init --agent opencode` | Install OpenCode skills and command aliases |
|
|
155
|
+
| `superflow init --agent all` | Install Claude Code, Codex, and OpenCode |
|
|
63
156
|
| `superflow update` | Refresh installed skills, hooks, scripts, and rules |
|
|
64
157
|
| `superflow update --with-package` | Also update `@chenmk/superflow`, OpenSpec, and Superpowers |
|
|
65
158
|
| `superflow doctor` | Diagnose installed assets and project state |
|
|
66
159
|
| `superflow status` | Show active changes, current phase, next command, and risks |
|
|
160
|
+
| `superflow --language en --help` | Show English CLI help |
|
|
161
|
+
| `superflow scan --language en` | Regenerate project context templates in English |
|
|
67
162
|
| `superflow pipeline` | Check pipeline skill deployment |
|
|
68
163
|
| `superflow docs` | Check docs-phase skill deployment |
|
|
69
164
|
| `superflow design` | Check design-phase skill deployment |
|
|
@@ -85,6 +180,16 @@ In Claude Code:
|
|
|
85
180
|
/superflow-pipeline
|
|
86
181
|
```
|
|
87
182
|
|
|
183
|
+
In OpenCode:
|
|
184
|
+
|
|
185
|
+
```text
|
|
186
|
+
/superflow-pipeline
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
OpenCode receives `.opencode/skills` and `.opencode/commands` assets. Native
|
|
190
|
+
hook registration is not enabled for OpenCode yet; use `/superflow-*` commands
|
|
191
|
+
to run workflow gates explicitly.
|
|
192
|
+
|
|
88
193
|
For large requirements, ask the agent to read one section or one feature at a
|
|
89
194
|
time. SuperBridge Flow will route through clarification, OpenSpec docs,
|
|
90
195
|
Superpowers technical design, implementation prompts, verification, and archive.
|
|
@@ -133,10 +238,19 @@ keeps the same workflow contracts.
|
|
|
133
238
|
## Requirements
|
|
134
239
|
|
|
135
240
|
- Node.js 20+
|
|
136
|
-
- Claude Code or
|
|
241
|
+
- Claude Code, Codex, or OpenCode
|
|
137
242
|
- npm access to install OpenSpec and Superpowers
|
|
138
243
|
- Git Bash or a compatible shell on Windows for hook scripts
|
|
139
244
|
|
|
245
|
+
## Star History
|
|
246
|
+
|
|
247
|
+
The chart is generated by Star History from public GitHub star data. It may stay
|
|
248
|
+
empty while the repository is private.
|
|
249
|
+
|
|
250
|
+
[](https://star-history.com/#basketballnotfound-mankun/superflow-cli&Date)
|
|
251
|
+
|
|
252
|
+
[Open the Star History chart](https://star-history.com/#basketballnotfound-mankun/superflow-cli&Date)
|
|
253
|
+
|
|
140
254
|
## License
|
|
141
255
|
|
|
142
256
|
MIT
|
package/README.zh-CN.md
CHANGED
|
@@ -1,13 +1,69 @@
|
|
|
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
|
-
|
|
30
|
+
通用 SDD 开发工作流 CLI,支持 Claude Code、Codex 和 OpenCode。
|
|
4
31
|
|
|
5
|
-
|
|
32
|
+
SuperBridge Flow 不是简单“装两个工具”,而是把 OpenSpec/SDD 和
|
|
33
|
+
Superpowers 编排成一个有状态的研发流程:前者负责需求、合同和验收口径,
|
|
34
|
+
后者负责源码级设计、TDD 顺序、实现分工、review 和真实验证。
|
|
6
35
|
|
|
7
|
-
|
|
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
|
+
- **9 类翻车场景,沉淀成门禁。** 我们见过的 AI 翻车——需求一次吞、字段漏查消费者、SQL 漂移、mock-only 报告、跨服务只看到"能调"……9 种典型形态都被固化成 guard,AI 想跳过都不行。
|
|
47
|
+
- **跨服务代码必须先答架构 6 问。** 涉及跨仓、跨服务、SDK、MQ、设备、回调、网关的改动,技术详设里必须先回答:owner 是谁、调用方向、新入口是否允许、禁止路径、证据锚点——答不全不让进入实现。
|
|
48
|
+
- **改字段之前先填"字段与状态反向影响"矩阵。** 任何 schema、状态、枚举的改动,必须枚举写入点、读取点、过滤点、派生 / 同步点、跨模块消费者、测试覆盖,还要列反向恢复场景(下线后重上线、旧值不可用但上游没传字段、历史脏数据被新过滤条件消费)。
|
|
49
|
+
- **6 条踩坑经验产品化,不是提醒是门禁。** 影响面要查全、业务语义 > 接口成功、禁止默认兜底、数据库收口、真实入口验证、代码与数据关系核实——每条绑定特定阶段和特定 hook,缺证据就阻断下一阶段。
|
|
50
|
+
- **5 个阶段 × 5+ 门禁脚本硬阻断。** `superflow-guard.sh` + `superflow-hook-guard.sh` + `superflow-contract-hooks.sh` + `superflow-sql-sync-hook.py` + `superflow-test-report-lint.py` + `superflow-verify-integration.sh`。没有 handoff hash 不进实现,没有真实入口证据不写"通过"。
|
|
51
|
+
- **用 handoff + state + sha256 治上下文漂移。** 长会话压缩、切 agent、并行 worktree——`.sdd/handoff/sdd-context.{md,json}` + sha256 + `.sdd/state.yaml` 让 Worker / Tester / Reviewer 始终基于同一份上下文,hash 对不上的旧 prompt 自动被 guard 拒绝。
|
|
52
|
+
- **用户只说一句话,流水线跑 9 步。** 不用写复杂 prompt:`> 用 SuperFlow 处理这个需求` 触发 clarify → docs → design → implement → verify → archive。阶段推进、guard、hash、hook 全是流程强制,不靠用户自觉。
|
|
53
|
+
|
|
54
|
+
## 工作流
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
docs -> design -> implement -> verify -> archive
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
| 阶段 | 主责 | 产物 |
|
|
61
|
+
|------|------|------|
|
|
62
|
+
| `docs` | OpenSpec/SDD | 需求、接口、数据库、测试和验收合同 |
|
|
63
|
+
| `design` | Superpowers | 源码级技术详设、影响面分析和 TDD 计划 |
|
|
64
|
+
| `implement` | Superpowers + SuperBridge Flow | 分批任务 prompt、review 门禁和执行状态 |
|
|
65
|
+
| `verify` | SuperBridge Flow hooks | 有证据的测试报告、真实入口和联调校验 |
|
|
66
|
+
| `archive` | OpenSpec/SDD | 归档后的 spec 状态和生命周期闭环 |
|
|
11
67
|
|
|
12
68
|
## 安装
|
|
13
69
|
|
|
@@ -20,12 +76,18 @@ npm install -g @chenmk/superflow
|
|
|
20
76
|
## 快速开始
|
|
21
77
|
|
|
22
78
|
```bash
|
|
23
|
-
# 交互式选择 Claude Code / Codex(可多选)
|
|
79
|
+
# 交互式选择 Claude Code / Codex / OpenCode(可多选)
|
|
24
80
|
superflow init
|
|
25
81
|
|
|
26
82
|
# 非交互模式,默认同时安装 Claude Code + Codex
|
|
27
83
|
superflow init --yes
|
|
28
84
|
|
|
85
|
+
# 显式安装 OpenCode
|
|
86
|
+
superflow init --agent opencode
|
|
87
|
+
|
|
88
|
+
# 同时安装 Claude Code + Codex + OpenCode
|
|
89
|
+
superflow init --agent all
|
|
90
|
+
|
|
29
91
|
# 跳过 hook 注册(手工管理)
|
|
30
92
|
superflow init --no-hooks
|
|
31
93
|
|
|
@@ -39,6 +101,17 @@ superflow init --resume
|
|
|
39
101
|
superflow doctor
|
|
40
102
|
```
|
|
41
103
|
|
|
104
|
+
语言也可以全局切换:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# 查看英文 CLI help
|
|
108
|
+
superflow --language en --help
|
|
109
|
+
|
|
110
|
+
# 当前 shell 默认使用英文提示
|
|
111
|
+
export SUPERFLOW_LANG=en
|
|
112
|
+
superflow init
|
|
113
|
+
```
|
|
114
|
+
|
|
42
115
|
## SDD 分工
|
|
43
116
|
|
|
44
117
|
- OpenSpec/SDD 负责 WHAT 和合同:需求、API、DB、SQL、字段语义、tests、真实入口验收和质量门禁。
|
|
@@ -51,14 +124,18 @@ superflow doctor
|
|
|
51
124
|
|
|
52
125
|
| 命令 | 说明 |
|
|
53
126
|
|------|------|
|
|
54
|
-
| `superflow init` | 一站式安装;交互终端中可多选 Claude Code / Codex |
|
|
127
|
+
| `superflow init` | 一站式安装;交互终端中可多选 Claude Code / Codex / OpenCode |
|
|
55
128
|
| `superflow init --yes` | 非交互安装,默认 `--agent both` |
|
|
129
|
+
| `superflow init --agent opencode` | 安装 OpenCode skills、commands、scripts 和 rules |
|
|
130
|
+
| `superflow init --agent all` | 同时安装 Claude Code + Codex + OpenCode |
|
|
56
131
|
| `superflow init --dry-run` | 只打印计划不执行 |
|
|
57
132
|
| `superflow init --resume` | 从失败步骤继续 |
|
|
58
133
|
| `superflow init --no-hooks` | 只装技能 + 脚本,跳过 Codex/Claude hook 注册 |
|
|
59
134
|
| `superflow init --no-openspec-init` | 跳过当前项目 OpenSpec 原生初始化 |
|
|
60
135
|
| `superflow doctor` | 诊断 CLI / 第三方 / 脚本 / skills |
|
|
61
136
|
| `superflow doctor --agent codex` | 只诊断 Codex 侧 |
|
|
137
|
+
| `superflow --language en --help` | 查看英文 CLI help |
|
|
138
|
+
| `superflow scan --language en` | 重新生成英文项目上下文模板 |
|
|
62
139
|
| `superflow clarify [feature]` | 校验 SuperBridge Flow clarify 阶段技能部署 |
|
|
63
140
|
| `superflow docs [change]` | 校验 SuperBridge Flow docs 阶段技能部署 |
|
|
64
141
|
| `superflow design [change]` | 校验 SuperBridge Flow design 阶段技能部署 |
|
|
@@ -74,10 +151,10 @@ superflow doctor
|
|
|
74
151
|
## 依赖
|
|
75
152
|
|
|
76
153
|
- Node.js 20+
|
|
77
|
-
- Claude Code 或
|
|
154
|
+
- Claude Code、Codex 或 OpenCode(按 `--agent` 选择)
|
|
78
155
|
- 第三方(`superflow init` 自动装):
|
|
79
156
|
- openspec CLI(硬依赖,npm 全局)并在当前项目执行 `openspec init --tools ...`
|
|
80
|
-
- superpowers
|
|
157
|
+
- superpowers(Claude Code / Codex 为硬依赖;OpenCode 侧通过已部署 skills/commands 使用流程)
|
|
81
158
|
- understand-anything(尽力安装,失败只警告)
|
|
82
159
|
- api-doc-changelog(辅助 skill,复制到目标 agent skills 目录)
|
|
83
160
|
|
|
@@ -87,7 +164,7 @@ superflow doctor
|
|
|
87
164
|
|
|
88
165
|
- `@chenmk/superflow`
|
|
89
166
|
- `@fission-ai/openspec`
|
|
90
|
-
- Claude Code / Codex 的 Superpowers
|
|
167
|
+
- Claude Code / Codex 的 Superpowers 插件;OpenCode 侧的 SuperBridge Flow assets
|
|
91
168
|
|
|
92
169
|
推荐策略是“自动检查,手动更新”:默认只提示,不自动安装;执行
|
|
93
170
|
`superflow update --with-package` 才会统一更新。
|
|
@@ -107,10 +184,14 @@ export SUPERFLOW_AUTO_UPDATE=apply
|
|
|
107
184
|
export SUPERFLOW_UPDATE_MIN_INTERVAL_SECONDS=21600
|
|
108
185
|
```
|
|
109
186
|
|
|
110
|
-
##
|
|
187
|
+
## Star History
|
|
188
|
+
|
|
189
|
+
下图由 Star History 根据 GitHub 公开 star 数据动态生成。仓库保持 private
|
|
190
|
+
时,第三方服务通常读不到完整数据;切换为 public 后会正常展示趋势。
|
|
191
|
+
|
|
192
|
+
[](https://star-history.com/#basketballnotfound-mankun/superflow-cli&Date)
|
|
111
193
|
|
|
112
|
-
|
|
113
|
-
- 实施 plan:`~/cmk-project/code-cli-config/sdd-cli-plan.md`
|
|
194
|
+
[打开 Star History 趋势图](https://star-history.com/#basketballnotfound-mankun/superflow-cli&Date)
|
|
114
195
|
|
|
115
196
|
## 许可证
|
|
116
197
|
|