@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,479 @@
1
+ # PlantUML 绘图模板
2
+
3
+ 可复制的成品模板,直接改文字即可。配色/skinparam 已调好。SKILL.md 的"绘图质量规范"给原则,本文件给具体模板。
4
+
5
+ ## 目录
6
+ - [通用 skinparam 主题(放图顶)](#通用-skinparam-主题)
7
+ - [Material Design 色阶调色板](#material-design-色阶调色板)
8
+ - [活动图(带分区+改动点高亮)](#活动图)
9
+ - [时序图(带 box 分组+participant 上色)](#时序图)
10
+ - [时序图 alt 多分支(多错误码场景)](#时序图-alt-多分支)
11
+ - [类图(带 package+改动点高亮)](#类图)
12
+ - [状态图](#状态图)
13
+ - [组件/部署图](#组件部署图)
14
+ - [应用架构图(嵌套 package+色阶分层)](#应用架构图)
15
+ - [改动点高亮约定回顾](#改动点高亮约定回顾)
16
+
17
+ ---
18
+
19
+ ## 通用 skinparam 主题
20
+
21
+ 每张图顶部贴这段,统一观感:
22
+
23
+ ```
24
+ skinparam defaultFontSize 13
25
+ skinparam roundCorner 10
26
+ skinparam shadowing false
27
+ skinparam activity {
28
+ BackgroundColor #FAFAFA
29
+ BorderColor #888888
30
+ FontColor #222222
31
+ }
32
+ skinparam sequence {
33
+ ArrowColor #555555
34
+ ParticipantBorderColor #555555
35
+ ParticipantBackgroundColor #FAFAFA
36
+ }
37
+ skinparam class {
38
+ BackgroundColor #FAFAFA
39
+ BorderColor #888888
40
+ }
41
+ ```
42
+
43
+ ---
44
+
45
+ ## 活动图
46
+
47
+ 业务流程/状态流转首选。带 `partition` 分区 + 改动点高亮 + `legend`。
48
+
49
+ ```
50
+ @startuml
51
+ skinparam backgroundColor #FEFEFE
52
+ skinparam defaultFontSize 13
53
+ skinparam roundCorner 10
54
+ skinparam shadowing false
55
+ skinparam PartitionBorderThickness 1
56
+ skinparam activity {
57
+ BackgroundColor #FFFFFF
58
+ BorderColor #999999
59
+ FontColor #222222
60
+ }
61
+
62
+ partition "下单阶段" #FFF3E0 {
63
+ start
64
+ :用户提交订单;
65
+ #LightBlue:校验库存(核心);
66
+ if (库存充足?) then (是)
67
+ :创建订单;
68
+ else (否)
69
+ #Salmon:提示缺货;
70
+ stop
71
+ endif
72
+ }
73
+
74
+ partition "支付阶段" #E8F5E9 {
75
+ #LightGreen:发起支付(新增);
76
+ :等待支付结果;
77
+ if (支付成功?) then (是)
78
+ :订单完成;
79
+ else (否)
80
+ #Gold:超时关单(修改阈值);
81
+ endif
82
+ stop
83
+ }
84
+
85
+ legend top right
86
+ |= 颜色 |= 含义 |
87
+ |<#LightGreen>| 新增 |
88
+ |<#Gold>| 修改 |
89
+ |<#LightBlue>| 关键路径 |
90
+ |<#Salmon>| 异常 |
91
+ endlegend
92
+ @enduml
93
+ ```
94
+
95
+ 要点:
96
+ - `partition "名" #Color { }` 给每个分区**不同背景色**(Material 浅色),用背景色分组破"瘦长"感
97
+ - `skinparam PartitionBorderThickness 1` 细框线,比大框轻(PlantUML partition 不支持虚线边框,用细线近似)
98
+ - `legend top right` 放顶部(活动图竖排长时,底部 legend 难看到)
99
+ - 线性无分支步骤合并成单节点(如"标准化+保存+更新"),partition 数量控制在 3-4 个,避免纵向堆叠过长
100
+ - 活动图**不支持** `left to right direction`(见踩坑),横排用背景色分组+步骤精简,不要用 direction
101
+
102
+ ---
103
+
104
+ ## 时序图
105
+
106
+ 多系统/多角色交互。带 `box` 分组 + `autonumber` + participant 上色。
107
+
108
+ ```
109
+ @startuml
110
+ skinparam defaultFontSize 13
111
+ autonumber
112
+
113
+ box "客户端" #LightBlue
114
+ participant "App" as app
115
+ end box
116
+ box "服务端" #FAFAFA
117
+ participant "网关" as gw
118
+ participant "订单服务" as order #LightGreen
119
+ participant "支付服务" as pay
120
+ end box
121
+
122
+ app -> gw: 下单请求
123
+ gw -> order: 创建订单
124
+ order -> pay: 发起支付 #LightGreen
125
+ note over order: 本次新增:直连支付
126
+ pay --> order: 支付结果
127
+ order --> gw: 订单状态
128
+ gw --> app: 响应
129
+
130
+ note over app, pay: 修订点:支付链路改为订单服务直连(原经网关)
131
+ @enduml
132
+ ```
133
+
134
+ 要点:`box` 圈子系统、`autonumber` 编号便于沟通、新增 participant 上 `#LightGreen`、消息变更用 `note over` 标注(消息箭头不支持色块)。
135
+
136
+ ---
137
+
138
+ ## 类图
139
+
140
+ 领域模型。带 `package` 分包 + 改动点高亮。
141
+
142
+ ```
143
+ @startuml
144
+ skinparam defaultFontSize 13
145
+ skinparam class {
146
+ BackgroundColor #FAFAFA
147
+ BorderColor #888888
148
+ }
149
+
150
+ package "订单域" {
151
+ class Order {
152
+ +id: Long
153
+ +status: OrderStatus
154
+ +create(): void
155
+ }
156
+ class OrderItem {
157
+ +productId: Long
158
+ +quantity: Integer
159
+ }
160
+ class OrderStatus <<new>> #LightGreen {
161
+ UNPAID
162
+ PAID
163
+ CLOSED
164
+ }
165
+ }
166
+
167
+ package "支付域" {
168
+ class Payment <<modified>> #Gold {
169
+ +pay(): void
170
+ }
171
+ }
172
+
173
+ Order "1" *-- "N" OrderItem
174
+ Order --> OrderStatus
175
+ Order --> Payment
176
+
177
+ legend right
178
+ |= 颜色 |= 含义 |
179
+ |<#LightGreen>| 新增类 |
180
+ |<#Gold>| 修改类 |
181
+ endlegend
182
+ @enduml
183
+ ```
184
+
185
+ 要点:`package` 分域、关系用 multiplicities(`"1" *-- "N"`)、新增/修改类用 stereotype `<<new>>`/`<<modified>>` + 色块、`legend` 说明。
186
+
187
+ ---
188
+
189
+ ## 状态图
190
+
191
+ 对象状态机。状态用色区分正常/异常态。
192
+
193
+ ```
194
+ @startuml
195
+ skinparam defaultFontSize 13
196
+
197
+ state "待支付" as Unpaid
198
+ state "已支付" as Paid #LightBlue
199
+ state "已发货" as Shipped
200
+ state "已完成" as Done #LightGreen
201
+ state "已取消" as Cancelled #Salmon
202
+
203
+ [*] --> Unpaid
204
+ Unpaid --> Paid : 支付成功
205
+ Unpaid --> Cancelled : 超时/取消
206
+ Paid --> Shipped : 发货
207
+ Shipped --> Done : 确认收货
208
+ Cancelled --> [*]
209
+ Done --> [*]
210
+ @enduml
211
+ ```
212
+
213
+ 要点:终态/异常态用约定色、转换标触发事件。
214
+
215
+ ---
216
+
217
+ ## 组件/部署图
218
+
219
+ 系统依赖拓扑。
220
+
221
+ ```
222
+ @startuml
223
+ skinparam defaultFontSize 13
224
+ skinparam component {
225
+ BackgroundColor #FAFAFA
226
+ BorderColor #888888
227
+ }
228
+
229
+ package "KA Capacity" {
230
+ [容量服务] as cap #LightBlue
231
+ [派单服务] as dispatch
232
+ }
233
+
234
+ database "MySQL" as db
235
+ queue "Kafka" as mq
236
+ [网关] as gw
237
+
238
+ gw --> cap
239
+ cap --> db
240
+ cap --> mq
241
+ dispatch --> db
242
+ @enduml
243
+ ```
244
+
245
+ 要点:用 `[组件]`/`database`/`queue` 区分类型、新增/核心组件上色。
246
+
247
+ ---
248
+
249
+ ## Material Design 色阶调色板
250
+
251
+ 配色原则:**同色系深浅表达层级**(浅色 = 外层 package/box,深色 = 内层组件;层级越深色越浓),**跨图色系一致**(同一子系统在所有图里用同色系)。5 色系 × 3 档,直接抄:
252
+
253
+ | 色系(用途建议) | 浅(package/box) | 中(component/participant) | 深(原子/底层) |
254
+ |---|---|---|---|
255
+ | 橙系(前端/触发层) | `#FFF3E0` | `#FFE0B2` | `#FFCC80` |
256
+ | 绿系(业务前台层) | `#E8F5E9` | `#C8E6C9` | `#A5D6A7` |
257
+ | 蓝系(用户中心/核心域) | `#E3F2FD` | `#90CAF9` | `#64B5F6` |
258
+ | 紫系(现有系统/外部依赖) | `#F3E5F5` | `#E1BEE7` | `#CE93D8` |
259
+ | 青系(回调/异步) | `#E0F2F1` | `#80CBC4` | `#4DB6AC` |
260
+
261
+ 箭头语义色(时序图箭头着色,同语义同色):
262
+ - `#1976D2`(蓝)= 主流程/正向
263
+ - `#F57C00`(橙)= 取消/异常/recheck
264
+ - `#00695C`(青绿)= 回调/上传
265
+ - `#C62828`(红)= 失败/拒绝
266
+
267
+ 用法:`participant "X" as x #90CAF9`(participant 上色)、`A -[#F57C00]-> B : recheck`(箭头着色)、`box "场景A" #E8F5E9`(box 背景)。
268
+
269
+ ---
270
+
271
+ ## 时序图 alt 多分支
272
+
273
+ 多错误码/多分支决策场景,用嵌套 `alt/else`,每个 else 对应一种返回。比活动图 if 更适合"同一调用多种结果"。
274
+
275
+ ```
276
+ @startuml
277
+ skinparam backgroundColor #FEFEFE
278
+ title 登录流程(多错误码)
279
+
280
+ actor "管理员" as Admin
281
+ participant "前端" as FE #FFE0B2
282
+ participant "鉴权服务" as Auth #90CAF9
283
+ database "Redis" as Redis
284
+
285
+ Admin -> FE : 输入账号密码
286
+ FE -> Auth : 登录请求
287
+
288
+ == 凭据校验 ==
289
+ Auth -> Auth : 校验用户名密码
290
+
291
+ alt 凭据校验通过
292
+ Auth -> Auth : 校验员工状态
293
+ Auth -> Auth : 校验公司状态
294
+ alt 全部校验通过
295
+ Auth -> Redis : 存储 Token
296
+ Auth --> FE : 返回 Token
297
+ else 员工/公司已禁用
298
+ Auth --> FE : 错误(已禁用)
299
+ end
300
+ else 密码错误/账号不存在
301
+ Auth --> FE : 错误(凭据无效)
302
+ end
303
+
304
+ FE --> Admin : 跳转首页或显示错误
305
+ @enduml
306
+ ```
307
+
308
+ 要点:`== 段名 ==` 分段、`note right of X` 收纳步骤细节(此处略)、每个 `else` 对应一种错误返回、嵌套 `alt` 表达"大分支里再分小分支"。
309
+
310
+ ---
311
+
312
+ ## 应用架构图
313
+
314
+ 应用分层 + 应用间调用 + 职责边界。`package` 分层(可嵌套),`-down->` 表达自上而下,色阶区分层。对照真实好图提炼。
315
+
316
+ ```
317
+ @startuml
318
+ skinparam backgroundColor #FEFEFE
319
+ skinparam componentStyle rectangle
320
+ skinparam arrowThickness 2
321
+ title 应用拓扑架构图
322
+
323
+ package "前端层" as Frontend #FFF3E0 {
324
+ component "货主APP" as shipperApp #FFE0B2
325
+ component "司机APP" as driverApp #FFE0B2
326
+ component "管理后台" as admin #FFE0B2
327
+ }
328
+
329
+ package "业务前台应用层" as BizLayer #E8F5E9 {
330
+ component "saas-app\n货主/司机端" as saasApp #C8E6C9
331
+ component "admin-app\n运营后台" as adminApp #A5D6A7
332
+ }
333
+
334
+ package "用户中心" as UserCenter #E3F2FD {
335
+ package "前台应用层" as UCFront #BBDEFB {
336
+ component "鉴权服务" as authApp #90CAF9
337
+ }
338
+ package "底层领域层" as UCDomain #90CAF9 {
339
+ component "用户原子能力" as infoServer #64B5F6
340
+ }
341
+ }
342
+
343
+ package "现有系统" as Existing #F3E5F5 {
344
+ component "trade-company-app" as companyApp #E1BEE7
345
+ }
346
+
347
+ database "MySQL" as mysql #FFECB3
348
+ database "Redis" as redis #FFCDD2
349
+
350
+ shipperApp -down-> saasApp : REST
351
+ driverApp -down-> saasApp : REST
352
+ admin -down-> adminApp : REST
353
+
354
+ saasApp -down-> infoServer : RPC原子
355
+ adminApp -down-> authApp : RPC登录
356
+ adminApp -down-> companyApp : RPC
357
+
358
+ authApp -down-> infoServer : RPC校验
359
+ infoServer -down-> mysql
360
+ authApp -down-> redis
361
+ @enduml
362
+ ```
363
+
364
+ 要点:
365
+ - `package` 分层,层间色系递进(橙→绿→蓝→紫),同层组件同色
366
+ - `package` 嵌套表达"大系统含子系统分层"(用户中心内套前台/领域两层)
367
+ - `-down->` 显式方向,标签写"调用类型"(`: REST`/`: RPC登录`)
368
+ - `database`/`queue` 放最底层,用关键字区分类型
369
+ - `skinparam componentStyle rectangle` 用矩形(默认是 UML 组件图标,架构图用矩形更干净)
370
+
371
+ 技术架构图同此画法,把"应用"换成"技术栈/中间件节点"即可(如 Nginx/Gateway/MySQL/Redis/Kafka + 部署节点)。
372
+
373
+ ---
374
+
375
+ ## 修改现有功能的流程图(强制 4 件套模板)
376
+
377
+ 技术方案里"修改 XX 流程"类需求,流程图必须带 4 件套:**上下文边界 + 颜色高亮 + 删除分支画出来 + 图下 4 段文字说明**。详见 SKILL.md「补充·修改现有功能的流程图(强制 4 件套)」。
378
+
379
+ ```
380
+ @startuml
381
+ skinparam backgroundColor #FEFEFE
382
+ skinparam defaultFontSize 13
383
+ skinparam roundCorner 10
384
+ skinparam shadowing false
385
+ skinparam activity {
386
+ BackgroundColor #FFFFFF
387
+ BorderColor #999999
388
+ FontColor #222222
389
+ }
390
+
391
+ title 6.X xxx 流程(修改后)
392
+
393
+ start
394
+
395
+ ' 1. 入口:用 note 标注"被谁调、触发条件"
396
+ :上游触发 doXxx;
397
+ note right: 触发条件 = xxx\n调度频率 = xxx\n由 xxx 自动调用
398
+
399
+ ' 2. 如果触发入口到变更点之间有未改动非重要节点,用 ... 省略
400
+ ' (... 这里可省略若干非重要节点 ...)
401
+
402
+ ' 3. 真正的变更逻辑
403
+ :doXxx;
404
+
405
+ if (新条件?) then (是)
406
+ #Gold:新动作(修改后保留);
407
+ #Gold:返回 NEED_CANCEL;
408
+ note right: 本次修改:xxx
409
+ stop
410
+ elseif ([DEL] 旧条件?) then ([DEL])
411
+ #LightGray:[DEL] 旧动作;
412
+ note right #FFCDD2: 原版有该判断,本次删除\n删除原因:xxx\n详见 PRD xxx
413
+ else (否)
414
+ #LightBlue:返回 CONTINUE;
415
+ stop
416
+ endif
417
+
418
+ ' 4. legend 颜色图例(强制)
419
+ legend right
420
+ |= 颜色 |= 含义 |
421
+ |<#Gold>| 本次修改后保留 |
422
+ |<#LightGray>| 本次删除 |
423
+ |<#LightBlue>| 未变更(原版即有) |
424
+ endlegend
425
+
426
+ @enduml
427
+ ```
428
+
429
+ 图下必须配 4 段结构化文字说明(详见 SKILL.md 4 件套第 4 条):
430
+
431
+ ```
432
+ **变更摘要**(必填,删/改/增 各列 1-2 条):
433
+ - 删除:xxx 流程中的 xxx 判断分支
434
+ - 修改:xxx 流程的 xxx 条件(从 A 改为 B)
435
+ - 新增:xxx 流程新增 xxx 步骤
436
+
437
+ **变更动机**(必填,引用 PRD/Issue 链接):
438
+ - 旧版痛点:司机比预计时间晚到时,系统误判为已到装货地
439
+ - 引用:PRD https://wiki.amh-group.com/pages/viewpage.action?pageId=xxx
440
+
441
+ **影响范围**(必填):
442
+ - 任务/接口:xxxService#xxx(Java 类#方法)
443
+ - 数据:ka_xxx 表(无变更)
444
+ - 灰度:先发 1 台,观察 1 天
445
+ - 监控:新增告警 xxx
446
+
447
+ **回滚方案**(必填):
448
+ - 回退到旧版 commit xxx
449
+ - 兜底开关:Lion 配置 ymm-ka-xxx.enabled = false
450
+ - 数据:无需回滚
451
+ ```
452
+
453
+ 要点(画图前自检):
454
+ - **入口用 note 标注"被谁调"**:禁止只画内部逻辑,前面是黑盒
455
+ - **触发入口到变更点之间**未改动且非重要节点用 ... 省略
456
+ - **删除的分支必须画出来**:用 #LightGray + [DEL] 前缀 + note 说明删除原因
457
+ - **legend 强制**:任何修订版流程图都必须带颜色图例
458
+ - **图下 4 段说明**:变更摘要 / 变更动机 / 影响范围 / 回滚方案,缺一段返工
459
+
460
+ 反面教材:图下方只写"改动:删除时间判断分支"一行——这不够,读者不知道为什么改、有没有风险、怎么回滚都不知道。
461
+
462
+ ---
463
+
464
+ ## 改动点高亮约定回顾
465
+
466
+ 修订现有图(如方案迭代、代码变更说明)时,改动必须显眼且可解释:
467
+
468
+ | 含义 | 颜色 | 活动图 | 时序图 | 类图 |
469
+ |---|---|---|---|---|
470
+ | 新增 | `#LightGreen` | `#LightGreen:动作;` | `participant X as x #LightGreen` + `note over` | `class X <<new>> #LightGreen` |
471
+ | 修改 | `#Gold` | `#Gold:动作;` | `note over x: 修改说明` | `class X <<modified>> #Gold` |
472
+ | 删除 | `#LightGray` | `#LightGray:[DEL]动作;` | `note over x: 已删除` | 注释标 `<<deleted>>` |
473
+ | 关键路径 | `#LightBlue` | `#LightBlue:动作;` | participant 上色 | — |
474
+ | 异常/警告 | `#Salmon` | `#Salmon:动作;` | `note over x #Salmon: 警告` | — |
475
+
476
+ 规则:
477
+ - 每张含改动的图**必须**加 `legend`,说明颜色含义
478
+ - 颜色语义全工程一致,不要这张图 green=新增、那张图 green=修改
479
+ - 纯新建图(非修订)不用改动点高亮,用关键路径/异常色即可
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: cbb-wiki-ops
3
+ description: Wiki (wiki.amh-group.com) 命令行操作工具。遇到 wiki.amh-group.com 链接时**必须**使用本技能,禁止用 WebFetch(Wiki 需认证,WebFetch 必然失败)。触发场景:读取/查询/搜索 Wiki 页面、列子页/评论/空间/版本/附件、创建/更新页面、创建评论、任何涉及 wiki.amh-group.com 的操作。所有操作通过 `cbb wiki` 子命令完成。即使用户只给了 Wiki 链接没有明确说"用 wiki 工具",也要优先用本技能而非 WebFetch。
4
+ ---
5
+
6
+ # 行为规则
7
+
8
+ ## 1. 环境检查(脚本自带 5 分钟 TTL 缓存)
9
+
10
+ 脚本内部已实现文件缓存(`~/.cbb/.auth-status`,5 分钟 TTL),重复调用开销接近 0:
11
+
12
+ ```bash
13
+ node .claude/skills/cbb-wiki-ops/scripts/check-auth.js
14
+ ```
15
+
16
+ | 输出 | 含义 | 下一步 |
17
+ |------|------|--------|
18
+ | `AUTH_OK` | 环境变量已配置 | 继续执行用户请求的 `cbb wiki` 操作 |
19
+ | `AUTH_MISSING` | 未配置凭据 | → §2 认证配置 |
20
+
21
+ 注意:只在 `AUTH_OK` 后才执行 `cbb wiki` 命令。如果执行时遇到 401/403,按 §3 处理。
22
+
23
+ ## 2. 认证配置(首次使用)
24
+
25
+ **停止当前流程**,向用户展示:
26
+
27
+ > Wiki 认证未配置。请提供你的 @amh-group.com 邮箱,以及在 https://wiki.amh-group.com/plugins/tokens/view.action 生成的 Personal Access Token。拿到后二选一:
28
+
29
+ **方式 A — 环境变量(推荐,复制即用):**
30
+ ```cmd
31
+ setx CBB_WIKI_EMAIL "你的邮箱@amh-group.com"
32
+ setx CBB_WIKI_TOKEN "你的PAT"
33
+ ```
34
+ > 设置后需重启工具会话生效。
35
+
36
+ **方式 B — 配置文件:**
37
+ 创建 `~/.cbb/wiki-config.json`,内容:`{"email": "邮箱@amh-group.com", "token": "PAT"}`
38
+
39
+ 用户确认配置完成后,重新执行 `cbb wiki user --current` 验证通过,再继续原操作。
40
+
41
+ ## 3. 凭据过期(401/403)
42
+
43
+ 提示用户重新生成令牌(同上地址),更新后重试。
44
+
45
+ ## 4. 页面不存在(404)
46
+
47
+ 核实 pageId 是否正确,或用户对该空间是否有访问权限。
48
+
49
+ ## 5. 版本冲突(409)
50
+
51
+ 直接重新执行命令(update 子命令会自动取最新版本号 +1)。
52
+
53
+ ---
54
+
55
+ # 命令参考
56
+
57
+ ## 查询
58
+
59
+ ### 读页面
60
+ ```bash
61
+ cbb wiki get <pageId> # 标题/空间/版本(正文折叠)
62
+ cbb wiki get <pageId> --full # 含完整 XHTML 正文
63
+ ```
64
+
65
+ ### 列子页
66
+ ```bash
67
+ cbb wiki children <pageId> [--limit=50] [--start=0]
68
+ ```
69
+
70
+ ### CQL 搜索
71
+ ```bash
72
+ cbb wiki search "type=page AND title~\"关键词\"" [--limit=20]
73
+ cbb wiki search "type=page AND text~\"关键词\"" --excerpt=highlight
74
+ cbb wiki search "type=page AND space=KEY" --order=lastmodified desc
75
+ ```
76
+
77
+ **CQL 语法速查:**
78
+ - `type=page|space|user|comment`
79
+ - `title~"关键词"` — 标题模糊;`text~"关键词"` — 全文搜索
80
+ - `space=KEY` — 限定空间;`parent=<pageId>` — 限定父页面
81
+ - `lastmodified>=startOfDay(-7d)` — 时间范围
82
+ - `order=lastmodified desc|asc` — 排序
83
+
84
+ ### 列空间
85
+ ```bash
86
+ cbb wiki spaces [--limit=100] [--type=global]
87
+ ```
88
+
89
+ ### 列评论
90
+ ```bash
91
+ cbb wiki comments <pageId> [--limit=50]
92
+ ```
93
+
94
+ ### 查用户
95
+ ```bash
96
+ cbb wiki user --current
97
+ cbb wiki user --account-id=<accountId>
98
+ cbb wiki user --username=<name>
99
+ ```
100
+
101
+ ### 历史版本
102
+ ```bash
103
+ cbb wiki versions <pageId> [--limit=20]
104
+ ```
105
+
106
+ ## 附件
107
+
108
+ ```bash
109
+ cbb wiki attachments <pageId> list [--limit=50]
110
+ cbb wiki attachments <pageId> upload --file=<path> [--comment="说明"]
111
+ cbb wiki attachments <pageId> delete --attachment-id=<id>
112
+ ```
113
+
114
+ > 下载附件:Basic 认证下不可用,请在浏览器打开页面下载。
115
+
116
+ ## 写操作
117
+
118
+ ### 创建页面
119
+ ```bash
120
+ cbb wiki create --parent-id <父页面Id> --title "标题" --file <markdown文件路径>
121
+ ```
122
+ 读取 Markdown 文件,自动转换为 Confluence XHTML 后创建。
123
+
124
+ ### 更新页面
125
+ ```bash
126
+ cbb wiki update --page-id <pageId> --file <markdown文件路径>
127
+ ```
128
+ 读取 Markdown 文件,自动转换为 Confluence XHTML 后更新(自动取版本号 +1)。
129
+
130
+ ### 创建评论
131
+ ```bash
132
+ cbb wiki comment <pageId> --body-file=<xhtml文件路径> [--parent=<父评论Id>]
133
+ ```
134
+ 评论 body 须为 Confluence Storage XHTML 格式。
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ // cbb-wiki-ops 环境检查脚本
3
+ // 检查 Wiki 认证是否已配置(环境变量或配置文件)
4
+ // 带 TTL 文件缓存,避免每次重复检测
5
+ // 输出 AUTH_OK 或 AUTH_MISSING
6
+
7
+ const fs = require('fs');
8
+ const os = require('os');
9
+ const path = require('path');
10
+
11
+ const CACHE_FILE = path.join(os.homedir(), '.cbb', '.auth-status');
12
+ const TTL_MS = 5 * 60 * 1000; // 5 分钟
13
+
14
+ function doCheck() {
15
+ const envOk = process.env.CBB_WIKI_EMAIL && process.env.CBB_WIKI_TOKEN;
16
+ const configPath = path.join(os.homedir(), '.cbb', 'wiki-config.json');
17
+ const fileOk = fs.existsSync(configPath);
18
+ return (envOk || fileOk) ? 'AUTH_OK' : 'AUTH_MISSING';
19
+ }
20
+
21
+ function readCache() {
22
+ try {
23
+ const data = JSON.parse(fs.readFileSync(CACHE_FILE, 'utf-8'));
24
+ if (data.status && data.checkedAt && Date.now() - data.checkedAt < TTL_MS) {
25
+ return data.status;
26
+ }
27
+ } catch (_) { /* 缓存文件不存在或解析失败,走实际检查 */ }
28
+ return null;
29
+ }
30
+
31
+ function writeCache(status) {
32
+ try {
33
+ fs.mkdirSync(path.dirname(CACHE_FILE), { recursive: true });
34
+ fs.writeFileSync(CACHE_FILE, JSON.stringify({
35
+ status,
36
+ checkedAt: Date.now(),
37
+ }));
38
+ } catch (_) { /* 缓存写入失败不影响输出 */ }
39
+ }
40
+
41
+ const cached = readCache();
42
+ const status = cached || doCheck();
43
+ if (!cached) writeCache(status);
44
+ console.log(status);