@jspg-ai/coding-bb 0.0.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 (183) hide show
  1. package/README.md +41 -0
  2. package/cbb/dev-standards/rules/cbb-ai-behavior.md +104 -0
  3. package/cbb/dev-standards/rules/cbb-coding-rule.md +50 -0
  4. package/cbb/dev-standards/rules/cbb-priority.md +56 -0
  5. package/cbb/dev-standards/skills/architecture-specs/SKILL.md +129 -0
  6. package/cbb/dev-standards/skills/coding-specs/SKILL.md +376 -0
  7. package/cbb/dev-standards/skills/coding-specs/references/concurrency.md +53 -0
  8. package/cbb/dev-standards/skills/coding-specs/references/config-center.md +16 -0
  9. package/cbb/dev-standards/skills/coding-specs/references/distributed.md +42 -0
  10. package/cbb/dev-standards/skills/coding-specs/references/es-coding.md +60 -0
  11. package/cbb/dev-standards/skills/coding-specs/references/scheduled-task.md +25 -0
  12. package/cbb/dev-standards/skills/coding-specs/references/security.md +11 -0
  13. package/cbb/dev-standards/skills/coding-specs/references/unit-testing.md +43 -0
  14. package/cbb/dev-standards/skills/es-design-specs/SKILL.md +104 -0
  15. package/cbb/dev-standards/skills/mysql-design-specs/SKILL.md +89 -0
  16. package/cbb/lib/install/claude-code.js +20 -0
  17. package/cbb/lib/install/cleanup.js +64 -0
  18. package/cbb/lib/install/init.js +1875 -0
  19. package/cbb/lib/install/qoder.js +20 -0
  20. package/cbb/lib/install/workspaces.js +232 -0
  21. package/cbb/lib/openspec/index.js +554 -0
  22. package/cbb/lib/superpowers/index.js +265 -0
  23. package/cbb/lib/utils/check-update.js +147 -0
  24. package/cbb/lib/utils/checkbox.js +383 -0
  25. package/cbb/lib/utils/gitignore.js +69 -0
  26. package/cbb/lib/utils/output.js +64 -0
  27. package/cbb/lib/utils/settings.js +119 -0
  28. package/cbb/lib/utils/version.js +135 -0
  29. package/cbb/lib/wiki/api-client.js +358 -0
  30. package/cbb/lib/wiki/cli.js +427 -0
  31. package/cbb/lib/wiki/convert.js +464 -0
  32. package/cbb/lib/wiki/index.js +218 -0
  33. package/cbb/lib/wiki/mermaid-guard.js +103 -0
  34. package/cbb/lib/wiki/split.js +131 -0
  35. package/cbb/tools/cbb-decompile-jar/SKILL.md +220 -0
  36. package/cbb/tools/cbb-decompile-jar/scripts/decompile.py +863 -0
  37. package/cbb/tools/cbb-design-to-wiki/SKILL.md +180 -0
  38. package/cbb/tools/cbb-mvn-guide/SKILL.md +281 -0
  39. package/cbb/tools/cbb-mvn-guide/scripts/mvn_jdk_manager.py +378 -0
  40. package/cbb/tools/cbb-mvn-guide/scripts/mvn_pom_jdk_reader.py +197 -0
  41. package/cbb/tools/cbb-plantuml-authoring/SKILL.md +448 -0
  42. package/cbb/tools/cbb-plantuml-authoring/references/drawing-templates.md +479 -0
  43. package/cbb/tools/cbb-wiki-ops/SKILL.md +134 -0
  44. package/cbb/tools/cbb-wiki-ops/scripts/check-auth.js +44 -0
  45. package/cbb/worktrees/_shared/scripts/find-target-worktree.js +96 -0
  46. package/cbb/worktrees/_shared/scripts/find-workspace-root.js +67 -0
  47. package/cbb/worktrees/_shared/scripts/push-core.js +136 -0
  48. package/cbb/worktrees/_shared/scripts/silence-popup.js +23 -0
  49. package/cbb/worktrees/commands/close.md +64 -0
  50. package/cbb/worktrees/commands/extend.md +65 -0
  51. package/cbb/worktrees/commands/init.md +55 -0
  52. package/cbb/worktrees/commands/push.md +42 -0
  53. package/cbb/worktrees/skills/openspec-close-worktree/SKILL.md +449 -0
  54. package/cbb/worktrees/skills/openspec-close-worktree/scripts/check-env.js +76 -0
  55. package/cbb/worktrees/skills/openspec-close-worktree/scripts/check-unarchived.js +48 -0
  56. package/cbb/worktrees/skills/openspec-close-worktree/scripts/delete-branches.js +136 -0
  57. package/cbb/worktrees/skills/openspec-close-worktree/scripts/discover-apps.js +76 -0
  58. package/cbb/worktrees/skills/openspec-close-worktree/scripts/find-target-worktree.js +96 -0
  59. package/cbb/worktrees/skills/openspec-close-worktree/scripts/find-workspace-root.js +67 -0
  60. package/cbb/worktrees/skills/openspec-close-worktree/scripts/remove-worktrees.js +124 -0
  61. package/cbb/worktrees/skills/openspec-close-worktree/scripts/safety-check.js +174 -0
  62. package/cbb/worktrees/skills/openspec-close-worktree/scripts/silence-popup.js +23 -0
  63. package/cbb/worktrees/skills/openspec-extend-worktree/SKILL.md +390 -0
  64. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-env.js +95 -0
  65. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-repos.js +98 -0
  66. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/create-branches-and-worktrees.js +135 -0
  67. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/find-target-worktree.js +96 -0
  68. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/find-workspace-root.js +67 -0
  69. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/install-ai.js +150 -0
  70. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/list-available-apps.js +88 -0
  71. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/push-core.js +136 -0
  72. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/silence-popup.js +23 -0
  73. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/sync-repos.js +93 -0
  74. package/cbb/worktrees/skills/openspec-init-worktree/SKILL.md +539 -0
  75. package/cbb/worktrees/skills/openspec-init-worktree/scripts/auto-open.js +136 -0
  76. package/cbb/worktrees/skills/openspec-init-worktree/scripts/check-env-deep.js +87 -0
  77. package/cbb/worktrees/skills/openspec-init-worktree/scripts/check-env.js +90 -0
  78. package/cbb/worktrees/skills/openspec-init-worktree/scripts/check-repos.js +171 -0
  79. package/cbb/worktrees/skills/openspec-init-worktree/scripts/create-branches.js +103 -0
  80. package/cbb/worktrees/skills/openspec-init-worktree/scripts/create-worktrees.js +154 -0
  81. package/cbb/worktrees/skills/openspec-init-worktree/scripts/find-workspace-root.js +67 -0
  82. package/cbb/worktrees/skills/openspec-init-worktree/scripts/generate-app-options.js +93 -0
  83. package/cbb/worktrees/skills/openspec-init-worktree/scripts/install-ai.js +177 -0
  84. package/cbb/worktrees/skills/openspec-init-worktree/scripts/parse-config.js +67 -0
  85. package/cbb/worktrees/skills/openspec-init-worktree/scripts/push-branches.js +101 -0
  86. package/cbb/worktrees/skills/openspec-init-worktree/scripts/push-core.js +136 -0
  87. package/cbb/worktrees/skills/openspec-init-worktree/scripts/silence-popup.js +23 -0
  88. package/cbb/worktrees/skills/openspec-init-worktree/scripts/sync-repos.js +95 -0
  89. package/cbb/worktrees/skills/openspec-init-worktree/scripts/update-gitignore.js +134 -0
  90. package/cbb/worktrees/skills/openspec-push-worktrees/SKILL.md +307 -0
  91. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/commit-worktrees.js +269 -0
  92. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/find-target-worktree.js +96 -0
  93. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/find-workspace-root.js +67 -0
  94. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/push-core.js +136 -0
  95. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/push-worktrees.js +159 -0
  96. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/silence-popup.js +23 -0
  97. package/config/cbb.yaml +6 -0
  98. package/config/config.sample.json +16 -0
  99. package/config/openspec/config.yaml +28 -0
  100. package/config/openspec/schemas/spec-driven/schema.yaml +247 -0
  101. package/config/openspec/schemas/spec-driven/templates/design.md +475 -0
  102. package/config/openspec/schemas/spec-driven/templates/proposal.md +58 -0
  103. package/config/openspec/schemas/spec-driven/templates/spec.md +8 -0
  104. package/config/openspec/schemas/spec-driven/templates/tasks.md +9 -0
  105. package/config/workspaces.json +15 -0
  106. package/openspec/.version +6 -0
  107. package/openspec/commands/apply.md +182 -0
  108. package/openspec/commands/archive.md +223 -0
  109. package/openspec/commands/bulk-archive.md +334 -0
  110. package/openspec/commands/continue.md +112 -0
  111. package/openspec/commands/explore.md +206 -0
  112. package/openspec/commands/ff.md +111 -0
  113. package/openspec/commands/new.md +70 -0
  114. package/openspec/commands/onboard.md +555 -0
  115. package/openspec/commands/propose.md +157 -0
  116. package/openspec/commands/sync.md +256 -0
  117. package/openspec/commands/update.md +85 -0
  118. package/openspec/commands/verify.md +169 -0
  119. package/openspec/skills/openspec-apply-change/SKILL.md +187 -0
  120. package/openspec/skills/openspec-archive-change/SKILL.md +181 -0
  121. package/openspec/skills/openspec-bulk-archive-change/SKILL.md +338 -0
  122. package/openspec/skills/openspec-continue-change/SKILL.md +117 -0
  123. package/openspec/skills/openspec-explore/SKILL.md +342 -0
  124. package/openspec/skills/openspec-ff-change/SKILL.md +116 -0
  125. package/openspec/skills/openspec-new-change/SKILL.md +76 -0
  126. package/openspec/skills/openspec-onboard/SKILL.md +560 -0
  127. package/openspec/skills/openspec-propose/SKILL.md +162 -0
  128. package/openspec/skills/openspec-sync-specs/SKILL.md +261 -0
  129. package/openspec/skills/openspec-update-change/SKILL.md +90 -0
  130. package/openspec/skills/openspec-verify-change/SKILL.md +174 -0
  131. package/package.json +46 -0
  132. package/superpowers/.version +6 -0
  133. package/superpowers/skills/brainstorming/SKILL.md +250 -0
  134. package/superpowers/skills/brainstorming/scripts/frame-template.html +213 -0
  135. package/superpowers/skills/brainstorming/scripts/helper.js +167 -0
  136. package/superpowers/skills/brainstorming/scripts/server.cjs +723 -0
  137. package/superpowers/skills/brainstorming/scripts/start-server.sh +209 -0
  138. package/superpowers/skills/brainstorming/scripts/stop-server.sh +120 -0
  139. package/superpowers/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  140. package/superpowers/skills/brainstorming/visual-companion.md +299 -0
  141. package/superpowers/skills/dispatching-parallel-agents/SKILL.md +167 -0
  142. package/superpowers/skills/executing-plans/SKILL.md +64 -0
  143. package/superpowers/skills/finishing-a-development-branch/SKILL.md +225 -0
  144. package/superpowers/skills/receiving-code-review/SKILL.md +205 -0
  145. package/superpowers/skills/requesting-code-review/SKILL.md +95 -0
  146. package/superpowers/skills/requesting-code-review/code-reviewer.md +181 -0
  147. package/superpowers/skills/subagent-driven-development/SKILL.md +568 -0
  148. package/superpowers/skills/subagent-driven-development/implementer-prompt.md +154 -0
  149. package/superpowers/skills/subagent-driven-development/re-review-prompt.md +115 -0
  150. package/superpowers/skills/subagent-driven-development/scripts/review-package +46 -0
  151. package/superpowers/skills/subagent-driven-development/scripts/sdd-workspace +40 -0
  152. package/superpowers/skills/subagent-driven-development/scripts/task-brief +41 -0
  153. package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +207 -0
  154. package/superpowers/skills/systematic-debugging/CREATION-LOG.md +119 -0
  155. package/superpowers/skills/systematic-debugging/SKILL.md +283 -0
  156. package/superpowers/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  157. package/superpowers/skills/systematic-debugging/condition-based-waiting.md +115 -0
  158. package/superpowers/skills/systematic-debugging/defense-in-depth.md +122 -0
  159. package/superpowers/skills/systematic-debugging/find-polluter.sh +72 -0
  160. package/superpowers/skills/systematic-debugging/root-cause-tracing.md +169 -0
  161. package/superpowers/skills/systematic-debugging/test-academic.md +14 -0
  162. package/superpowers/skills/systematic-debugging/test-pressure-1.md +58 -0
  163. package/superpowers/skills/systematic-debugging/test-pressure-2.md +68 -0
  164. package/superpowers/skills/systematic-debugging/test-pressure-3.md +69 -0
  165. package/superpowers/skills/test-driven-development/SKILL.md +320 -0
  166. package/superpowers/skills/test-driven-development/writing-good-tests.md +198 -0
  167. package/superpowers/skills/using-git-worktrees/SKILL.md +167 -0
  168. package/superpowers/skills/using-superpowers/SKILL.md +63 -0
  169. package/superpowers/skills/using-superpowers/references/antigravity-tools.md +23 -0
  170. package/superpowers/skills/using-superpowers/references/codex-tools.md +108 -0
  171. package/superpowers/skills/using-superpowers/references/gemini-tools.md +63 -0
  172. package/superpowers/skills/using-superpowers/references/hermes-tools.md +56 -0
  173. package/superpowers/skills/using-superpowers/references/pi-tools.md +16 -0
  174. package/superpowers/skills/verification-before-completion/SKILL.md +120 -0
  175. package/superpowers/skills/writing-plans/SKILL.md +171 -0
  176. package/superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  177. package/superpowers/skills/writing-skills/SKILL.md +679 -0
  178. package/superpowers/skills/writing-skills/anthropic-best-practices.md +1150 -0
  179. package/superpowers/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  180. package/superpowers/skills/writing-skills/graphviz-conventions.dot +172 -0
  181. package/superpowers/skills/writing-skills/persuasion-principles.md +187 -0
  182. package/superpowers/skills/writing-skills/render-graphs.js +169 -0
  183. package/superpowers/skills/writing-skills/testing-skills-with-subagents.md +384 -0
@@ -0,0 +1,247 @@
1
+ name: spec-driven
2
+ version: 2
3
+ description: spec-driven 工作流(项目默认,安装时自动选用)- proposal → specs → design → tasks
4
+ artifacts:
5
+ - id: proposal
6
+ generates: proposal.md
7
+ description: 概述本次变更的初始提案文档
8
+ template: proposal.md
9
+ instruction: |
10
+ 编写 proposal 文档,明确这次变更"为什么"要做。
11
+
12
+ **写作流程(四阶段顺序执行,禁止跳过或颠倒):**
13
+
14
+ ### 阶段一:收集需求(第一步永远是问用户,禁止先扫代码)
15
+
16
+ 1. 用 AskUserQuestion 询问用户:本次想做什么?是否有 PRD / MRD / 需求文档链接?
17
+ 2. 拿到用户输入后,整理并复述目标,**让用户确认**理解是否正确。未确认前禁止进入下一阶段。
18
+ 3. 信息不足或目标模糊时,继续追问,直到目标清晰无歧义。
19
+
20
+ ### 阶段二:查阅知识库(需求确认后,代码扫描前)
21
+
22
+ 1. 询问用户是否有知识库、参考文档等可提供。
23
+ 2. 若有知识库:通过 INDEX.md(路径见 CLAUDE.md "知识库" 章节)按层级进入。从 INDEX.md → 域索引 → 子域 → 知识条目。仅跟随索引中的已有链接,**禁止 glob 或全库搜索**。记录每个被引用的文档。
24
+ 3. 若无知识库或 INDEX.md 不存在:记录"知识库暂无覆盖",直接进入阶段三,**禁止编造或强行搜索**。
25
+
26
+ ### 阶段三:扫描代码(带着确认后的目标 + 知识库结果去扫)
27
+
28
+ 1. 以阶段一确认的目标和阶段二收集的知识库为上下文,扫描代码库。
29
+ 2. 只扫与本次需求相关的入口类/方法、已有实现、依赖链。**禁止无目标的全库扫描**。
30
+ 3. 扫描结果应直接支撑「四、代码改动清单」的编写。
31
+
32
+ ### 阶段四:撰写 proposal
33
+
34
+ 以上三阶段完成后,才开始动笔写 proposal.md。
35
+
36
+ **写作约束:**
37
+ - **禁止推测**:需求细节必须来自上述三阶段的产出;信息不足时回退到对应阶段补充
38
+ - **来源标注**:一、为什么 / 二、变更简述 / 三、变更清单 / 四、代码改动清单 / 五、影响 中每一条断言后附来源,示例:
39
+ - "(来自 PRD §3.2)"
40
+ - "(知识库: myb-user-domain/auth-flow.md)"
41
+ - "(代码: com.x.user.facade.UserFacade#resetPassword)"
42
+ - **存疑必问,禁止猜测**:撰写过程中遇到以下情况,必须暂停并用 AskUserQuestion 让用户决策,禁止自行假设后继续:
43
+ - 需求逻辑不合理或自相矛盾
44
+ - 信息缺失无法判断(不确定调用哪个接口、数据从哪来等)
45
+ - 存在潜在风险(资损、性能、兼容性、安全)
46
+ - 多种可行方案各有取舍
47
+ 每次向用户确认后,将决策逐条记录到「六、决策记录」表格中。
48
+ - **知识库引用**还应一并带到 design.md 的"知识库参考"章节
49
+
50
+ 章节(顺序:动机 → 变更简述 → 能力契约 → 代码入口 → 影响 → 决策记录;每章带中文数字序号):
51
+ - **一、为什么**(必选):1-3 句话说清问题或机会。要解决什么?为什么是现在?
52
+ - **二、变更简述**(必选):1-5 句话最精简易读地描述本需求要做的事情
53
+ - **三、变更清单**(必选):能力维度的变更盘点(新增 / 修改 / 删除)。每个能力对应 `openspec/specs/<name>/spec.md`。identifier 与中文名解耦
54
+ - **identifier 与展示名解耦**:identifier 列(`能力名` / `现有 spec 名` / `已废弃 spec 名`)填英文 kebab-case(用于 path / CLI / 跨引用),新增一列 `中文名` 填人类阅读用名
55
+ - **新增能力**:每个对应一份新建 `specs/<name>/spec.md`
56
+ - **修改能力**:每个对应一份 delta spec 文件
57
+ - **删除能力**:整段能力下线。spec 文件保留并写 `## REMOVED Requirements` 段,避免后续误用
58
+ - **四、代码改动清单**(必选):每个代码入口一行。
59
+ - **必须基于实际扫代码 + 读知识库得出,禁止凭 PRD 直接推测**
60
+ - 字段:应用 / 变更类型 / 代码入口类型 / 代码入口 / 所属能力 / 变更简述 / 备注
61
+ - 后端 代码入口类型 仅允许:rpc / rest / mq / job / sql / config / constant / enum
62
+ - 前端 代码入口类型 固定为 `前端`;代码入口列允许 `文件路径 —— 简短描述` 自然语言
63
+ - 代码入口(前端除外)必须可被代码搜索(完整方法签名、REST 路径、MQ topic、SQL 片段、配置 key 等)
64
+ - `所属能力` 列强制填写:填第三章的能力名(含删除能力);无对应能力的纯基础设施改动填 `(基础设施)`
65
+ - `constant` 类型仅当「被 ≥2 个 entry 引用」或「属于业务规则配置」时才单列;其余并入最近上游 entry 的备注
66
+ - 反向校验:每个 entry 应真的对应一次代码改动,不应"凑行"
67
+ - **五、影响**(必选):列出受影响的代码、接口、依赖、上下游系统。**复杂影响分析**(灰度步骤、回滚方案、跨团队协作)进入 § design 阶段
68
+ - **六、决策记录**(必选):撰写过程中向用户确认过的每个决策点,逐条填入表格。字段:序号 / 决策点 / 用户决策 / 影响。无决策则填一行"无"
69
+
70
+ 重要:变更清单章节是 proposal 与 spec 阶段的契约核心。动笔前先研究现有 spec。每列出的能力都对应一份 spec 文件。
71
+
72
+ 保持简洁(1-2 页)。专注"为什么"而非"怎么做"——实现细节归 design.md。
73
+
74
+ 这是整个工作流的基础——specs、design、tasks 都建立在它之上。
75
+ requires: []
76
+
77
+ - id: specs
78
+ generates: "specs/**/*.md"
79
+ description: 本次变更的详细规范
80
+ template: spec.md
81
+ instruction: |
82
+ Create spec files defining WHAT the system does — one per capability in the proposal's Capabilities section.
83
+ - New capability → `specs/<capability>/spec.md` (exact kebab-case name from the proposal).
84
+ - Modified capability → delta spec at `specs/<capability>/spec.md`, reusing the existing folder name under `openspec/specs/`.
85
+
86
+ Use `##` headers for delta operations:
87
+ - **ADDED Requirements**: new behavior.
88
+ - **MODIFIED Requirements**: changed behavior — MUST paste the ENTIRE updated requirement block (header through all scenarios), not just the diff. Partial content loses detail at archive time; if only adding concerns without changing existing behavior, use ADDED instead.
89
+ - **REMOVED Requirements**: MUST include **Reason** and **Migration**.
90
+ - **RENAMED Requirements**: name-only change, `FROM:`/`TO:` format.
91
+
92
+ Format (the template shows the skeleton):
93
+ - `### Requirement: <name>` + normative description using SHALL/MUST (avoid should/may).
94
+ - `#### Scenario: <name>` in **WHEN/THEN** form; every requirement needs ≥1 scenario.
95
+ - **CRITICAL: scenarios MUST use exactly 4 hashtags (`####`)** — 3 hashtags or bullets fail silently.
96
+
97
+ Specs must be testable — each scenario is a potential test case.
98
+ requires:
99
+ - proposal
100
+
101
+ - id: design
102
+ generates: design.md
103
+ description: 含实施细节的技术方案文档
104
+ template: design.md
105
+ instruction: |
106
+ Create the design document that explains HOW to implement the change.
107
+
108
+ **Knowledge Base Reference (MANDATORY):**
109
+ Before writing design, you MUST consult the project's knowledge base:
110
+ 1. Read the knowledge base root INDEX.md (path defined in CLAUDE.md under "知识库")
111
+ 2. Navigate from INDEX.md → relevant domain index → sub-domain → knowledge chunks
112
+ 3. Collect all knowledge documents relevant to this change's design sections
113
+ 4. Fill the "知识库参考" section in the template with: knowledge point name, full file path, corresponding design section
114
+ 5. If a design section has no matching knowledge base coverage, note it as "知识库暂无覆盖,建议补充"
115
+
116
+ Knowledge-to-design-section mapping reference:
117
+ - 需求背景 → business domain indexes (myb-*-domain/)
118
+ - 架构设计 → application indexes (project/<app>/)
119
+ - 领域模型设计 → domain indexes (myb-*-domain/)
120
+ - 核心流程设计 → domain knowledge chunks
121
+ - 数据库模型 → application indexes + domain knowledge
122
+ - MQ设计 → domain knowledge chunks
123
+ - 稳定性设计 → tech-asset/tech-gray/
124
+ - 防资损设计 → domain knowledge chunks
125
+
126
+ When to include design.md (create only if any apply):
127
+ - Cross-cutting change (multiple services/modules) or new architectural pattern
128
+ - New external dependency or significant data model changes
129
+ - Security, performance, or migration complexity
130
+ - Ambiguity that benefits from technical decisions before coding
131
+
132
+ Sections (follow design.md template):
133
+ - **知识库参考**(必选):列出本次设计参考的知识库文档路径及对应章节
134
+ - **需求或项目背景**(必选):问题/目标、PRD/DMPT链接
135
+ - **Checklist事项**(必选):逐项检查技术风险(新接口、改接口、新枚举、新依赖、新表/MQ、sentinel、敏感数据、SQL、历史兼容、Redis、验签)
136
+ - **功能拆解**(必选):按模块拆分功能点,标注变更类型和FTAPI
137
+ - **必须基于 proposal.md > 四、代码改动清单 展开**:每条功能拆解条目都应可追溯到代码改动清单里的某一行(或几行),禁止平行枚举
138
+ - **禁止出现代码改动清单之外的 entry 类型**:若需新增 entry 类型,先回退更新 proposal.md 的代码改动清单
139
+ - 在代码改动清单的基础上补充:工作量估算、字段级细节、上下游协同计划、影响范围
140
+ - **架构设计**(必选):模块划分 + 分层依赖关系
141
+ - **领域模型设计**(可选):聚合根/实体/值对象/领域事件的变更
142
+ - **核心流程设计**(必选):跨服务时序图(仅跨应用时绘制,participant:应用用英文名、操作角色用中文名,禁止类名,同一应用不重复)/泳道图/流程图/状态机,用PlantUML;修改型功能点须包含触发入口及上下至少各一层上下文节点,变更节点统一高亮
143
+ - **代码设计**(必选):UML类图(禁止类级别时序图),用PlantUML;修改型功能点须包含触发入口及上下至少各一层上下文节点,变更点(类、方法、属性等)统一高亮
144
+ - **分层设计**(必选):Controller/Facade/Service/Repo各层方法与职责,接口契约含请求/响应参数表;依赖RPC标注强弱依赖、超时、降级策略
145
+ - **数据库模型设计**(可选):DDL语句及变更说明
146
+ - **MQ设计**(可选):Topic、角色、幂等方案
147
+ - **JOB设计**(可选):JobHandler、Cron、参数格式
148
+ - **Redis设计**(可选):key/value格式、TTL
149
+ - **配置设计**(可选):配置key及QA/生产值
150
+ - **测试策略**(必选):测试场景与验证点,满足TDD
151
+ - **稳定性设计**(必选):发布方案(灰度/兼容)+ 回滚方案 + 监控告警
152
+ - **防资损设计**(必选):资损场景、资金流、防控与监控方案
153
+ - **其他风险/遗留问题**(可选)
154
+
155
+ 可选章节不涉及则删除整章。所有图用PlantUML生成。**MANDATORY**:画任何图之前,用 Skill tool 调用 `cbb-plantuml-authoring`(该技能包含完整配色方案、图类型选型、语法校验、模板及常见语法坑)。
156
+
157
+ 【修改型功能点规则】
158
+ 当功能点变更类型为"修改"时,所有图表必须:
159
+ 1. 展示触发入口(REST 接口 / RPC 调用 / MQ 消费者 / Job Handler)
160
+ 2. 展示上游一层(直接调用变更点的调用方节点)
161
+ 3. 展示下游一层(变更点直接调用的被调方节点)
162
+ 4. 变更节点用约定颜色高亮(新增/修改/删除各有对应色,由 cbb-plantuml-authoring 统一)
163
+ 5. 不展示完整调用链,避免图表冗长失焦
164
+
165
+ 【图表质量准则】
166
+ - 聚焦核心:每张图聚焦单一业务流程或功能点
167
+ - 层次鲜明:配色区分入口/新增/修改/删除/未变更节点
168
+ - 粒度适中:节点粒度为方法或步骤级
169
+ - 逻辑完整:所有路径有入口和出口,无孤立节点或断链
170
+
171
+ 以 proposal.md > 一、为什么 为动机来源,以 proposal.md > 四、代码改动清单 为入口范围依据。代码改动清单是「功能拆解」章节的输入,不允许平行重列。specs(specs/**/*.md)提供需求/验收口径。
172
+ requires:
173
+ - proposal
174
+
175
+ - id: tasks
176
+ generates: tasks.md
177
+ description: 可追踪的实施任务清单
178
+ template: tasks.md
179
+ instruction: |
180
+ Create the task list that breaks down the implementation work.
181
+
182
+ **IMPORTANT: Follow the template exactly.** The apply phase parses checkbox
183
+ format to track progress. Tasks not using `- [ ]` won't be tracked.
184
+
185
+ **Scope note**: tasks.md 是 OpenSpec 的**粗粒度人类可见进度表**。详细 TDD 实施计划(每步:写失败测试 → 跑测试 → 写最小实现 → 跑通 → 提交)由 superpowers:writing-plans 在 apply 阶段单独生成到 `openspec/changes/<name>/plan.md`,不在本文件展开。
186
+
187
+ Guidelines:
188
+ - Group related tasks under ## numbered headings
189
+ - Each task MUST be a checkbox: `- [ ] X.Y Task description`
190
+ - Tasks should be small enough to complete in one session
191
+ - Order tasks by dependency (what must be done first?)
192
+
193
+ Reference specs for what needs to be built, design for architecture.
194
+ Each task should be verifiable — you know when it's done.
195
+
196
+ Example:
197
+ ```
198
+ ## 1. Setup
199
+
200
+ - [ ] 1.1 Create new module structure
201
+ - [ ] 1.2 Add dependencies to package.json
202
+
203
+ ## 2. Core Implementation
204
+
205
+ - [ ] 2.1 Implement data export function
206
+ - [ ] 2.2 Add CSV formatting utilities
207
+ ```
208
+ requires:
209
+ - specs
210
+ - design
211
+
212
+ apply:
213
+ requires: [tasks]
214
+ tracks: tasks.md
215
+ instruction: |
216
+ Run superpowers TDD pipeline against this change. tasks.md 是人类可见的进度表,详细 TDD 计划由 superpowers 自行生成。
217
+
218
+ 1. **Generate detailed TDD plan**:
219
+ - 用 Skill tool 调用 `superpowers:writing-plans`,传入 `proposal.md`、`specs/**/*.md`、以及 `design.md`(如果存在)作为输入
220
+ - **路径覆盖**: 本项目把 plan 写到 `openspec/changes/<name>/plan.md`(覆盖 writing-plans 的默认 `docs/superpowers/plans/`)。写作时使用 change 名作为输出路径
221
+ - writing-plans 自己负责 TDD step 结构、任务粒度划分
222
+ 2. **Execute via subagent**:
223
+ - 用 Skill tool 调用 `superpowers:subagent-driven-development`,目标指向上一步生成的 `plan.md`
224
+ - subagent-driven-development 自己拥有 implementer / reviewer / fixer 循环和内部进度 ledger
225
+ - Read `specs/**/*.md` for acceptance criteria
226
+ 3. **Mirror progress to tasks.md**:
227
+ - subagent-driven-development 报告一个粗粒度任务完成(与 `tasks.md` 中某行 `- [ ] X.Y` 对应)时,把那一行翻成 `- [x]`
228
+ - **回写粒度**: 每个粗粒度 task 翻一次,**不照 plan.md 里的 TDD step 翻**
229
+ - OpenSpec 用这些 checkbox 展示进度;subagent 的内部 ledger 才是真实状态源
230
+ 4. **Mid-flight fixes**:
231
+ - 如果 `plan.md` 路径或测试错了,原地编辑再继续
232
+ - 如果 `tasks.md` 任务边界与 subagent 报告不对应,原地编辑 tasks.md 以匹配
233
+
234
+ `plan.md` 跟 change 同住一个目录,archive 阶段会被一起带走。
235
+
236
+ verify:
237
+ tracks: cr.md
238
+ requires: [tasks]
239
+ instruction: |
240
+ Verify 在 tasks.md 全部翻成 `- [x]` 后执行。
241
+
242
+ **两条硬性约束(项目级,不被 `cbb update --upstream-openspec` 覆盖,不论官方 verify 命令如何升级都生效):**
243
+
244
+ 1. **MANDATORY Code Review**:用 `Skill` tool 调用 `superpowers:requesting-code-review`。
245
+ 即便 AI 自认能 review,仍必须调 skill。
246
+ 2. **MANDATORY 产出 `cr.md`**:把完整 Verification Report 写到 `openspec/changes/<name>/cr.md`,
247
+ 缺则视为 verify 未完成。报告必须包含五段:Summary / CRITICAL / WARNING / SUGGESTION / Code Review。