@aipper/aiws-spec 0.0.24 → 0.0.26

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 (252) hide show
  1. package/README.md +22 -0
  2. package/docs/aiws-bootstrap-routing-design.md +138 -0
  3. package/docs/aiws-governance-positioning.md +69 -0
  4. package/docs/cli-interface.md +91 -6
  5. package/docs/collaboration-artifacts.md +62 -0
  6. package/docs/opencode-omo-adapter.md +135 -0
  7. package/docs/opencode-omo-validation-checklist.md +90 -0
  8. package/docs/spec-contract.md +30 -22
  9. package/docs/superpowers-collaboration-adoption.md +92 -0
  10. package/docs/workflow-delegation-contracts.json +274 -0
  11. package/docs/workflow-delegation-contracts.md +248 -0
  12. package/docs/workflow-delegation-contracts.schema.json +176 -0
  13. package/docs/workflow-governance-rules.json +294 -0
  14. package/docs/workflow-governance-rules.md +63 -0
  15. package/docs/workflow-governance-rules.schema.json +182 -0
  16. package/docs/workflow-review-gates.json +72 -0
  17. package/docs/workflow-review-gates.md +36 -0
  18. package/docs/workflow-review-gates.schema.json +67 -0
  19. package/docs/workflow-router-rules.json +196 -0
  20. package/docs/workflow-router-rules.md +83 -0
  21. package/docs/workflow-router-rules.schema.json +119 -0
  22. package/docs/workflow-stage-contracts.json +148 -0
  23. package/docs/workflow-stage-contracts.md +70 -0
  24. package/docs/workflow-stage-contracts.schema.json +98 -0
  25. package/package.json +1 -1
  26. package/templates/workspace/.agents/skills/using-aiws/SKILL.md +87 -0
  27. package/templates/workspace/.agents/skills/ws-commit/SKILL.md +27 -1
  28. package/templates/workspace/.agents/skills/ws-delegate/SKILL.md +75 -0
  29. package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +25 -4
  30. package/templates/workspace/.agents/skills/ws-dev/SKILL.md +35 -6
  31. package/templates/workspace/.agents/skills/ws-dev-lite/SKILL.md +58 -0
  32. package/templates/workspace/.agents/skills/ws-finish/SKILL.md +25 -12
  33. package/templates/workspace/.agents/skills/ws-frontend-design/SKILL.md +126 -0
  34. package/templates/workspace/.agents/skills/ws-handoff/SKILL.md +25 -4
  35. package/templates/workspace/.agents/skills/ws-plan/SKILL.md +25 -1
  36. package/templates/workspace/.agents/skills/ws-plan-verify/SKILL.md +20 -0
  37. package/templates/workspace/.agents/skills/ws-preflight/SKILL.md +23 -0
  38. package/templates/workspace/.agents/skills/ws-quality-review/SKILL.md +56 -0
  39. package/templates/workspace/.agents/skills/ws-review/SKILL.md +24 -0
  40. package/templates/workspace/.agents/skills/ws-spec-review/SKILL.md +57 -0
  41. package/templates/workspace/.agents/skills/ws-verify-before-complete/SKILL.md +59 -0
  42. package/templates/workspace/.aiws/manifest.json +2 -6
  43. package/templates/workspace/.claude/commands/using-aiws.md +25 -0
  44. package/templates/workspace/.claude/commands/ws-dev-lite.md +31 -0
  45. package/templates/workspace/.claude/commands/ws-finish.md +1 -1
  46. package/templates/workspace/.claude/commands/ws-handoff.md +3 -2
  47. package/templates/workspace/.claude/commands/ws-quality-review.md +24 -0
  48. package/templates/workspace/.claude/commands/ws-review.md +2 -2
  49. package/templates/workspace/.claude/commands/ws-spec-review.md +24 -0
  50. package/templates/workspace/.claude/commands/ws-verify-before-complete.md +24 -0
  51. package/templates/workspace/.claude/skills/p-aiws-change-archive/SKILL.md +24 -0
  52. package/templates/workspace/.claude/skills/p-aiws-change-finish/SKILL.md +24 -0
  53. package/templates/workspace/.claude/skills/p-aiws-change-list/SKILL.md +18 -0
  54. package/templates/workspace/.claude/skills/p-aiws-change-new/SKILL.md +26 -0
  55. package/templates/workspace/.claude/skills/p-aiws-change-next/SKILL.md +19 -0
  56. package/templates/workspace/.claude/skills/p-aiws-change-start/SKILL.md +33 -0
  57. package/templates/workspace/.claude/skills/p-aiws-change-status/SKILL.md +19 -0
  58. package/templates/workspace/.claude/skills/p-aiws-change-sync/SKILL.md +19 -0
  59. package/templates/workspace/.claude/skills/p-aiws-change-templates-init/SKILL.md +18 -0
  60. package/templates/workspace/.claude/skills/p-aiws-change-templates-which/SKILL.md +18 -0
  61. package/templates/workspace/.claude/skills/p-aiws-change-validate/SKILL.md +23 -0
  62. package/templates/workspace/.claude/skills/p-aiws-hooks-install/SKILL.md +30 -0
  63. package/templates/workspace/.claude/skills/p-aiws-hooks-status/SKILL.md +18 -0
  64. package/templates/workspace/.claude/skills/p-aiws-init/SKILL.md +27 -0
  65. package/templates/workspace/.claude/skills/p-aiws-rollback/SKILL.md +18 -0
  66. package/templates/workspace/.claude/skills/p-aiws-update/SKILL.md +26 -0
  67. package/templates/workspace/.claude/skills/p-aiws-validate/SKILL.md +22 -0
  68. package/templates/workspace/.claude/skills/p-tasks-plan/SKILL.md +37 -0
  69. package/templates/workspace/.claude/skills/using-aiws/SKILL.md +87 -0
  70. package/templates/workspace/.claude/skills/ws-analyze/SKILL.md +26 -0
  71. package/templates/workspace/.claude/skills/ws-bugfix/SKILL.md +111 -0
  72. package/templates/workspace/.claude/skills/ws-commit/SKILL.md +130 -0
  73. package/templates/workspace/.claude/skills/ws-deliver/SKILL.md +230 -0
  74. package/templates/workspace/.claude/skills/ws-dev/SKILL.md +168 -0
  75. package/templates/workspace/.claude/skills/ws-dev-lite/SKILL.md +58 -0
  76. package/templates/workspace/.claude/skills/ws-finish/SKILL.md +209 -0
  77. package/templates/workspace/.claude/skills/ws-frontend-design/SKILL.md +126 -0
  78. package/templates/workspace/.claude/skills/ws-handoff/SKILL.md +52 -0
  79. package/templates/workspace/.claude/skills/ws-migrate/SKILL.md +54 -0
  80. package/templates/workspace/.claude/skills/ws-plan/SKILL.md +138 -0
  81. package/templates/workspace/.claude/skills/ws-plan-verify/SKILL.md +61 -0
  82. package/templates/workspace/.claude/skills/ws-preflight/SKILL.md +55 -0
  83. package/templates/workspace/.claude/skills/ws-pull/SKILL.md +119 -0
  84. package/templates/workspace/.claude/skills/ws-push/SKILL.md +110 -0
  85. package/templates/workspace/.claude/skills/ws-quality-review/SKILL.md +56 -0
  86. package/templates/workspace/.claude/skills/ws-req-change/SKILL.md +41 -0
  87. package/templates/workspace/.claude/skills/ws-req-contract-sync/SKILL.md +17 -0
  88. package/templates/workspace/.claude/skills/ws-req-contract-validate/SKILL.md +12 -0
  89. package/templates/workspace/.claude/skills/ws-req-flow-sync/SKILL.md +28 -0
  90. package/templates/workspace/.claude/skills/ws-req-review/SKILL.md +32 -0
  91. package/templates/workspace/.claude/skills/ws-review/SKILL.md +50 -0
  92. package/templates/workspace/.claude/skills/ws-rule/SKILL.md +23 -0
  93. package/templates/workspace/.claude/skills/ws-spec-review/SKILL.md +57 -0
  94. package/templates/workspace/.claude/skills/ws-submodule-setup/SKILL.md +65 -0
  95. package/templates/workspace/.claude/skills/ws-verify-before-complete/SKILL.md +59 -0
  96. package/templates/workspace/.githooks/commit-msg +10 -0
  97. package/templates/workspace/.opencode/command/using-aiws.md +30 -0
  98. package/templates/workspace/.opencode/command/ws-delegate.md +33 -0
  99. package/templates/workspace/.opencode/command/ws-dev-lite.md +34 -0
  100. package/templates/workspace/.opencode/command/ws-finish.md +1 -1
  101. package/templates/workspace/.opencode/command/ws-handoff.md +4 -3
  102. package/templates/workspace/.opencode/command/ws-plan.md +3 -0
  103. package/templates/workspace/.opencode/command/ws-preflight.md +4 -0
  104. package/templates/workspace/.opencode/command/ws-quality-review.md +30 -0
  105. package/templates/workspace/.opencode/command/ws-review.md +5 -2
  106. package/templates/workspace/.opencode/command/ws-spec-review.md +30 -0
  107. package/templates/workspace/.opencode/command/ws-verify-before-complete.md +27 -0
  108. package/templates/workspace/.opencode/commands/p-aiws-change-archive.md +27 -0
  109. package/templates/workspace/.opencode/commands/p-aiws-change-finish.md +27 -0
  110. package/templates/workspace/.opencode/commands/p-aiws-change-list.md +26 -0
  111. package/templates/workspace/.opencode/commands/p-aiws-change-new.md +27 -0
  112. package/templates/workspace/.opencode/commands/p-aiws-change-next.md +27 -0
  113. package/templates/workspace/.opencode/commands/p-aiws-change-start.md +27 -0
  114. package/templates/workspace/.opencode/commands/p-aiws-change-status.md +27 -0
  115. package/templates/workspace/.opencode/commands/p-aiws-change-sync.md +27 -0
  116. package/templates/workspace/.opencode/commands/p-aiws-change-templates-init.md +26 -0
  117. package/templates/workspace/.opencode/commands/p-aiws-change-templates-which.md +26 -0
  118. package/templates/workspace/.opencode/commands/p-aiws-change-validate.md +27 -0
  119. package/templates/workspace/.opencode/commands/p-aiws-hooks-install.md +26 -0
  120. package/templates/workspace/.opencode/commands/p-aiws-hooks-status.md +26 -0
  121. package/templates/workspace/.opencode/commands/p-aiws-init.md +23 -0
  122. package/templates/workspace/.opencode/commands/p-aiws-rollback.md +16 -0
  123. package/templates/workspace/.opencode/commands/p-aiws-update.md +22 -0
  124. package/templates/workspace/.opencode/commands/p-aiws-validate.md +17 -0
  125. package/templates/workspace/.opencode/commands/using-aiws.md +30 -0
  126. package/templates/workspace/.opencode/commands/ws-analyze.md +30 -0
  127. package/templates/workspace/.opencode/commands/ws-bugfix.md +35 -0
  128. package/templates/workspace/.opencode/commands/ws-commit.md +70 -0
  129. package/templates/workspace/.opencode/commands/ws-delegate.md +33 -0
  130. package/templates/workspace/{.iflow/commands/ws-deliver.toml → .opencode/commands/ws-deliver.md} +13 -13
  131. package/templates/workspace/.opencode/commands/ws-dev-lite.md +34 -0
  132. package/templates/workspace/.opencode/commands/ws-dev.md +36 -0
  133. package/templates/workspace/{.iflow/commands/ws-finish.toml → .opencode/commands/ws-finish.md} +46 -29
  134. package/templates/workspace/.opencode/commands/ws-handoff.md +26 -0
  135. package/templates/workspace/.opencode/commands/ws-migrate.md +25 -0
  136. package/templates/workspace/.opencode/commands/ws-plan-verify.md +28 -0
  137. package/templates/workspace/.opencode/commands/ws-plan.md +27 -0
  138. package/templates/workspace/.opencode/commands/ws-preflight.md +34 -0
  139. package/templates/workspace/.opencode/commands/ws-pull.md +87 -0
  140. package/templates/workspace/.opencode/commands/ws-push.md +93 -0
  141. package/templates/workspace/.opencode/commands/ws-quality-review.md +30 -0
  142. package/templates/workspace/.opencode/commands/ws-req-change.md +45 -0
  143. package/templates/workspace/.opencode/commands/ws-req-contract-sync.md +21 -0
  144. package/templates/workspace/.opencode/commands/ws-req-contract-validate.md +16 -0
  145. package/templates/workspace/.opencode/commands/ws-req-flow-sync.md +23 -0
  146. package/templates/workspace/.opencode/commands/ws-req-review.md +36 -0
  147. package/templates/workspace/.opencode/commands/ws-review.md +33 -0
  148. package/templates/workspace/.opencode/commands/ws-rule.md +27 -0
  149. package/templates/workspace/.opencode/commands/ws-spec-review.md +30 -0
  150. package/templates/workspace/.opencode/commands/ws-submodule-setup.md +57 -0
  151. package/templates/workspace/.opencode/commands/ws-verify-before-complete.md +27 -0
  152. package/templates/workspace/.opencode/oh-my-opencode.json.example +17 -0
  153. package/templates/workspace/.opencode/skills/p-aiws-change-archive/SKILL.md +24 -0
  154. package/templates/workspace/.opencode/skills/p-aiws-change-finish/SKILL.md +24 -0
  155. package/templates/workspace/.opencode/skills/p-aiws-change-list/SKILL.md +18 -0
  156. package/templates/workspace/.opencode/skills/p-aiws-change-new/SKILL.md +26 -0
  157. package/templates/workspace/.opencode/skills/p-aiws-change-next/SKILL.md +19 -0
  158. package/templates/workspace/.opencode/skills/p-aiws-change-start/SKILL.md +33 -0
  159. package/templates/workspace/.opencode/skills/p-aiws-change-status/SKILL.md +19 -0
  160. package/templates/workspace/.opencode/skills/p-aiws-change-sync/SKILL.md +19 -0
  161. package/templates/workspace/.opencode/skills/p-aiws-change-templates-init/SKILL.md +18 -0
  162. package/templates/workspace/.opencode/skills/p-aiws-change-templates-which/SKILL.md +18 -0
  163. package/templates/workspace/.opencode/skills/p-aiws-change-validate/SKILL.md +23 -0
  164. package/templates/workspace/.opencode/skills/p-aiws-hooks-install/SKILL.md +30 -0
  165. package/templates/workspace/.opencode/skills/p-aiws-hooks-status/SKILL.md +18 -0
  166. package/templates/workspace/.opencode/skills/p-aiws-init/SKILL.md +27 -0
  167. package/templates/workspace/.opencode/skills/p-aiws-rollback/SKILL.md +18 -0
  168. package/templates/workspace/.opencode/skills/p-aiws-update/SKILL.md +26 -0
  169. package/templates/workspace/.opencode/skills/p-aiws-validate/SKILL.md +22 -0
  170. package/templates/workspace/.opencode/skills/p-tasks-plan/SKILL.md +37 -0
  171. package/templates/workspace/.opencode/skills/using-aiws/SKILL.md +91 -0
  172. package/templates/workspace/.opencode/skills/ws-analyze/SKILL.md +26 -0
  173. package/templates/workspace/.opencode/skills/ws-bugfix/SKILL.md +111 -0
  174. package/templates/workspace/.opencode/skills/ws-commit/SKILL.md +130 -0
  175. package/templates/workspace/.opencode/skills/ws-delegate/SKILL.md +63 -0
  176. package/templates/workspace/.opencode/skills/ws-deliver/SKILL.md +230 -0
  177. package/templates/workspace/.opencode/skills/ws-dev/SKILL.md +168 -0
  178. package/templates/workspace/.opencode/skills/ws-dev-lite/SKILL.md +58 -0
  179. package/templates/workspace/.opencode/skills/ws-finish/SKILL.md +209 -0
  180. package/templates/workspace/.opencode/skills/ws-frontend-design/SKILL.md +126 -0
  181. package/templates/workspace/.opencode/skills/ws-handoff/SKILL.md +52 -0
  182. package/templates/workspace/.opencode/skills/ws-migrate/SKILL.md +54 -0
  183. package/templates/workspace/.opencode/skills/ws-plan/SKILL.md +148 -0
  184. package/templates/workspace/.opencode/skills/ws-plan-verify/SKILL.md +61 -0
  185. package/templates/workspace/.opencode/skills/ws-preflight/SKILL.md +60 -0
  186. package/templates/workspace/.opencode/skills/ws-pull/SKILL.md +119 -0
  187. package/templates/workspace/.opencode/skills/ws-push/SKILL.md +110 -0
  188. package/templates/workspace/.opencode/skills/ws-quality-review/SKILL.md +63 -0
  189. package/templates/workspace/.opencode/skills/ws-req-change/SKILL.md +41 -0
  190. package/templates/workspace/.opencode/skills/ws-req-contract-sync/SKILL.md +17 -0
  191. package/templates/workspace/.opencode/skills/ws-req-contract-validate/SKILL.md +12 -0
  192. package/templates/workspace/.opencode/skills/ws-req-flow-sync/SKILL.md +28 -0
  193. package/templates/workspace/.opencode/skills/ws-req-review/SKILL.md +32 -0
  194. package/templates/workspace/.opencode/skills/ws-review/SKILL.md +57 -0
  195. package/templates/workspace/.opencode/skills/ws-rule/SKILL.md +23 -0
  196. package/templates/workspace/.opencode/skills/ws-spec-review/SKILL.md +64 -0
  197. package/templates/workspace/.opencode/skills/ws-submodule-setup/SKILL.md +65 -0
  198. package/templates/workspace/.opencode/skills/ws-verify-before-complete/SKILL.md +59 -0
  199. package/templates/workspace/AGENTS.md +74 -30
  200. package/templates/workspace/AI_PROJECT.md +1 -1
  201. package/templates/workspace/AI_WORKSPACE.md +1 -1
  202. package/templates/workspace/changes/README.md +25 -4
  203. package/templates/workspace/changes/templates/proposal.md +15 -0
  204. package/templates/workspace/changes/templates/tasks.md +9 -2
  205. package/templates/workspace/manifest.json +340 -82
  206. package/templates/workspace/memory-bank/README.md +1 -2
  207. package/templates/workspace/tools/ws_change_check.py +26 -4
  208. package/templates/workspace/.iflow/agents/feature-reviewer.md +0 -27
  209. package/templates/workspace/.iflow/agents/requirements-analyst.md +0 -24
  210. package/templates/workspace/.iflow/agents/server-commit-manager.md +0 -28
  211. package/templates/workspace/.iflow/agents/server-fix-implementer.md +0 -31
  212. package/templates/workspace/.iflow/agents/server-test-planner.md +0 -28
  213. package/templates/workspace/.iflow/agents/server-test-triager.md +0 -30
  214. package/templates/workspace/.iflow/commands/aiws-init.toml +0 -24
  215. package/templates/workspace/.iflow/commands/aiws-rollback.toml +0 -18
  216. package/templates/workspace/.iflow/commands/aiws-update.toml +0 -23
  217. package/templates/workspace/.iflow/commands/aiws-validate.toml +0 -18
  218. package/templates/workspace/.iflow/commands/server-commit.toml +0 -27
  219. package/templates/workspace/.iflow/commands/server-drain.toml +0 -99
  220. package/templates/workspace/.iflow/commands/server-fix-and-commit.toml +0 -27
  221. package/templates/workspace/.iflow/commands/server-fix.toml +0 -65
  222. package/templates/workspace/.iflow/commands/server-test-plan.toml +0 -62
  223. package/templates/workspace/.iflow/commands/server-test.toml +0 -58
  224. package/templates/workspace/.iflow/commands/server-triage.toml +0 -38
  225. package/templates/workspace/.iflow/commands/server_test-plan.toml +0 -12
  226. package/templates/workspace/.iflow/commands/server_test.toml +0 -12
  227. package/templates/workspace/.iflow/commands/ws-analyze.toml +0 -33
  228. package/templates/workspace/.iflow/commands/ws-commit.toml +0 -46
  229. package/templates/workspace/.iflow/commands/ws-contract-check.toml +0 -69
  230. package/templates/workspace/.iflow/commands/ws-dev.toml +0 -34
  231. package/templates/workspace/.iflow/commands/ws-doctor.toml +0 -141
  232. package/templates/workspace/.iflow/commands/ws-env-doctor.toml +0 -74
  233. package/templates/workspace/.iflow/commands/ws-feature-deliver.toml +0 -44
  234. package/templates/workspace/.iflow/commands/ws-feature-plan.toml +0 -47
  235. package/templates/workspace/.iflow/commands/ws-init.toml +0 -53
  236. package/templates/workspace/.iflow/commands/ws-memory-bank-init.toml +0 -100
  237. package/templates/workspace/.iflow/commands/ws-migrate.toml +0 -59
  238. package/templates/workspace/.iflow/commands/ws-preflight.toml +0 -30
  239. package/templates/workspace/.iflow/commands/ws-pull.toml +0 -47
  240. package/templates/workspace/.iflow/commands/ws-push.toml +0 -40
  241. package/templates/workspace/.iflow/commands/ws-req-change.toml +0 -64
  242. package/templates/workspace/.iflow/commands/ws-req-contract-sync.toml +0 -25
  243. package/templates/workspace/.iflow/commands/ws-req-contract-validate.toml +0 -16
  244. package/templates/workspace/.iflow/commands/ws-req-flow-sync.toml +0 -36
  245. package/templates/workspace/.iflow/commands/ws-req-review.toml +0 -56
  246. package/templates/workspace/.iflow/commands/ws-review.toml +0 -33
  247. package/templates/workspace/.iflow/commands/ws-rule.toml +0 -43
  248. package/templates/workspace/.iflow/commands/ws-submodule-setup.toml +0 -32
  249. package/templates/workspace/tools/iflow_watchdog.sh +0 -138
  250. package/templates/workspace/tools/install_iflow_watchdog_systemd_user.sh +0 -118
  251. package/templates/workspace/tools/systemd/iflow-watchdog@.service +0 -16
  252. package/templates/workspace/tools/systemd/iflow-watchdog@.timer +0 -11
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: 私有:模板初始化:初始化 changes/templates 覆盖模板
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:aiws-change-templates-init -->
5
+ # aiws change templates init
6
+
7
+ (私有原子入口;日常优先用 ws-* 链路。)
8
+
9
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
+
11
+ 目标:
12
+ - 初始化 changes/templates 覆盖模板
13
+
14
+ 执行(在仓库根目录):
15
+ ```bash
16
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
17
+ ./node_modules/.bin/aiws change templates init
18
+ elif command -v aiws >/dev/null 2>&1; then
19
+ aiws change templates init
20
+ else
21
+ npx @aipper/aiws change templates init
22
+ fi
23
+ ```
24
+ <!-- AIWS_MANAGED_END:opencode:aiws-change-templates-init -->
25
+
26
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: 私有:模板来源:查看 change templates 来源
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:aiws-change-templates-which -->
5
+ # aiws change templates which
6
+
7
+ (私有原子入口;日常优先用 ws-* 链路。)
8
+
9
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
+
11
+ 目标:
12
+ - 查看 change 模板来源
13
+
14
+ 执行(在仓库根目录):
15
+ ```bash
16
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
17
+ ./node_modules/.bin/aiws change templates which
18
+ elif command -v aiws >/dev/null 2>&1; then
19
+ aiws change templates which
20
+ else
21
+ npx @aipper/aiws change templates which
22
+ fi
23
+ ```
24
+ <!-- AIWS_MANAGED_END:opencode:aiws-change-templates-which -->
25
+
26
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: 私有:变更校验:按 strict 校验变更工件与绑定
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:aiws-change-validate -->
5
+ # aiws change validate
6
+
7
+ (私有原子入口;日常优先用 ws-* 链路。)
8
+
9
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
+
11
+ 目标:
12
+ - 按严格模式校验变更工件与绑定关系
13
+
14
+ 执行(在仓库根目录):
15
+ ```bash
16
+ change_id="<change-id>"
17
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
18
+ ./node_modules/.bin/aiws change validate "${change_id}"
19
+ elif command -v aiws >/dev/null 2>&1; then
20
+ aiws change validate "${change_id}"
21
+ else
22
+ npx @aipper/aiws change validate "${change_id}"
23
+ fi
24
+ ```
25
+ <!-- AIWS_MANAGED_END:opencode:aiws-change-validate -->
26
+
27
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: 私有:Hooks 启用:启用 git hooks 门禁
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:aiws-hooks-install -->
5
+ # aiws hooks install
6
+
7
+ (私有原子入口;日常优先用 ws-* 链路。)
8
+
9
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
+
11
+ 目标:
12
+ - 启用 git hooks 门禁(core.hooksPath=.githooks)
13
+
14
+ 执行(在仓库根目录):
15
+ ```bash
16
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
17
+ ./node_modules/.bin/aiws hooks install .
18
+ elif command -v aiws >/dev/null 2>&1; then
19
+ aiws hooks install .
20
+ else
21
+ npx @aipper/aiws hooks install .
22
+ fi
23
+ ```
24
+ <!-- AIWS_MANAGED_END:opencode:aiws-hooks-install -->
25
+
26
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,26 @@
1
+ ---
2
+ description: 私有:Hooks 状态:查看当前仓库 hooks 门禁状态
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:aiws-hooks-status -->
5
+ # aiws hooks status
6
+
7
+ (私有原子入口;日常优先用 ws-* 链路。)
8
+
9
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
+
11
+ 目标:
12
+ - 查看当前仓库 hooks 门禁状态(只读)
13
+
14
+ 执行(在仓库根目录):
15
+ ```bash
16
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
17
+ ./node_modules/.bin/aiws hooks status .
18
+ elif command -v aiws >/dev/null 2>&1; then
19
+ aiws hooks status .
20
+ else
21
+ npx @aipper/aiws hooks status .
22
+ fi
23
+ ```
24
+ <!-- AIWS_MANAGED_END:opencode:aiws-hooks-status -->
25
+
26
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: 私有:初始化:落盘 AIWS 真值与门禁文件
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:aiws-init -->
5
+ # aiws init
6
+
7
+ (私有原子入口;日常优先用 ws-* 链路。)
8
+
9
+ 目标:
10
+ - 生成/补齐真值文件与门禁文件(以 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md` 为准)
11
+ - 写入/更新 `.gitignore` 的 aiws 托管块
12
+ - 生成/更新 `.aiws/manifest.json`(用于漂移检测)
13
+
14
+ 建议执行:
15
+ 1) `npx @aipper/aiws init`
16
+ 2) `npx @aipper/aiws validate`
17
+
18
+ 约束:
19
+ - 不写入任何 secrets
20
+ - 只允许更新托管块(`AIWS_MANAGED_BEGIN/END`)或 spec 指定的 `replace_file` 文件
21
+ <!-- AIWS_MANAGED_END:opencode:aiws-init -->
22
+
23
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,16 @@
1
+ ---
2
+ description: 私有:回滚:从 .aiws/backups 恢复快照
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:aiws-rollback -->
5
+ # aiws rollback
6
+
7
+ (私有原子入口;日常优先用 ws-* 链路。)
8
+
9
+ 目标:
10
+ - 从 `.aiws/backups/` 恢复到某次备份快照
11
+
12
+ 建议执行:
13
+ - `npx @aipper/aiws rollback latest`
14
+ <!-- AIWS_MANAGED_END:opencode:aiws-rollback -->
15
+
16
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,22 @@
1
+ ---
2
+ description: 私有:更新:刷新模板与 tool-native 文件(先备份)
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:aiws-update -->
5
+ # aiws update
6
+
7
+ (私有原子入口;日常优先用 ws-* 链路。)
8
+
9
+ 目标:
10
+ - 基于当前 `@aipper/aiws-spec` 刷新模板与 tool-native 文件
11
+ - 更新前备份到 `.aiws/backups/<timestamp>/`
12
+
13
+ 建议执行:
14
+ 1) `npx @aipper/aiws update`
15
+ 2) `npx @aipper/aiws validate`
16
+
17
+ 约束:
18
+ - 不写入任何 secrets
19
+ - 只更新托管块或 spec 指定的 `replace_file` 文件
20
+ <!-- AIWS_MANAGED_END:opencode:aiws-update -->
21
+
22
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,17 @@
1
+ ---
2
+ description: 私有:门禁:校验 required/托管块/漂移(可落盘 stamp)
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:aiws-validate -->
5
+ # aiws validate
6
+
7
+ (私有原子入口;日常优先用 ws-* 链路。)
8
+
9
+ 目标:
10
+ - 作为 CI/本地门禁:校验 required 文件结构、托管块、`.aiws/manifest.json` 漂移
11
+ - 强门禁:缺 `python3`/缺 required 脚本也应失败
12
+
13
+ 建议执行:
14
+ - `npx @aipper/aiws validate`
15
+ <!-- AIWS_MANAGED_END:opencode:aiws-validate -->
16
+
17
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: 默认 workflow router:先判定阶段,再进入具体 ws-* 入口
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:using-aiws -->
5
+ # using aiws
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:
10
+ - 把当前任务先路由到正确的 AIWS workflow,而不是直接跳进实现。
11
+
12
+ 执行建议:
13
+ 1) 先读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`。
14
+ - 若检测到 `.opencode/oh-my-opencode.json`:输出 `OpenCode mode: oMo-enabled`,并注明后续会优先借用 `planner-sisyphus` / `explore` / `librarian` / `oracle`
15
+ - 若未检测到:输出 `OpenCode mode: standard-opencode`
16
+ 2) 若缺失任一真值文件:先 `/ws-preflight`,必要时运行 `aiws init .`,不要继续实现。
17
+ 3) 若任务意图、归因或验证入口不明确:先提 1-3 个关键澄清问题并停止。
18
+ 4) 路由规则:
19
+ - 需求/验收/合同变更:`/ws-req-review`
20
+ - 中大型实现或需要 change/worktree:`/ws-plan`
21
+ - 小步明确实现:`/ws-dev`(若是 simple/local 单点修复,可显式进入 `/ws-dev-lite`)
22
+ - 评审/审计:`/ws-review`
23
+ - finish / merge / push / cleanup:`/ws-finish`
24
+ - handoff / archive summary:`/ws-handoff`
25
+ 5) 输出 `OpenCode mode:` / `Task intent:` / `Binding:` / `Route:` / `Why:` / `Next:`。
26
+ 6) 若 `Route: ws-dev` 且任务属于 simple/local 单点修复:`Next` 可显式建议 `/ws-dev-lite`。
27
+ 7) 除非用户只要路由判断,否则给出 route 后继续遵循对应入口的契约。
28
+ <!-- AIWS_MANAGED_END:opencode:using-aiws -->
29
+
30
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: 分析:实现前技术分析并落盘证据
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-analyze -->
5
+ # ws analyze
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:在开始实现/修复前做一次技术分析,产出可执行的最小行动清单,并把证据落盘到 `.agentdocs/tmp/analyze/`。
10
+
11
+ 输入:
12
+ - 主题/需求:`$ARGUMENTS`(若为空,先问用户一句“本次分析主题是什么?”)
13
+
14
+ 步骤(建议):
15
+ 1) 先运行 `/ws-preflight`。
16
+ 2) 基于真值文件与当前代码现状,输出:
17
+ - 目标 / 非目标
18
+ - 现状证据(文件路径/接口路径)
19
+ - 推荐方案(1 个)+ 备选(可选)
20
+ - 风险与回滚(3–8 条)
21
+ - 最小验证命令(可复现)
22
+ 3) 将分析落盘到:`.agentdocs/tmp/analyze/opencode-analysis.md`(目录不存在则创建)。
23
+ 4) 回复中必须包含:`Evidence:` 证据文件路径。
24
+
25
+ 安全:
26
+ - 不打印 secrets(尤其 `secrets/test-accounts.json`)。
27
+ - 不执行破坏性命令。
28
+ <!-- AIWS_MANAGED_END:opencode:ws-analyze -->
29
+
30
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: 缺陷修复:禅道 MCP 拉单、图片证据落盘并汇总 fix_bus_issues.csv
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-bugfix -->
5
+ # ws bugfix
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:
10
+ - 通过禅道 MCP 拉单、图片证据落盘并汇总 `issues/fix_bus_issues.csv`。
11
+
12
+ 建议流程:
13
+ 1) 先运行 `/ws-preflight`。
14
+ 2) 若当前不在 `change/<change-id>` 分支 / worktree,先建立 change 上下文:
15
+ - 工作区先保持干净
16
+ - 仓库已有提交:优先 `aiws change start <change-id> --hooks --worktree`
17
+ - superproject + submodule:优先 `aiws change start <change-id> --hooks --worktree --submodules`
18
+ - 仓库尚无提交 / 不满足 worktree 前置条件:回退 `aiws change start <change-id> --hooks --no-switch`
19
+ 3) 若上一步创建了 worktree:后续 bug 证据、CSV 更新、`/ws-dev` 修复都必须在该 worktree 中继续。
20
+ 4) 通过已配置 zentao MCP 拉取 bug 字段与附件列表。
21
+ 5) 落盘证据到当前 active change 上下文的 `changes/<change-id>/bug/`:
22
+ - `zentao-bug-<bug-id>.json`
23
+ - `zentao-bug-<bug-id>.md`
24
+ - `images/<bug-id>/...`
25
+ 6) upsert 当前 active change 上下文中的 `issues/fix_bus_issues.csv`(主键 `Bug_ID`)。
26
+ 7) 进入 `/ws-dev` 修复并回填 `Fix_Status/Verify_Command/Updated_At`。
27
+ 8) 质量门:`aiws change validate <change-id> --strict` + `aiws validate . --stamp`。
28
+
29
+ 强制约束:
30
+ - 不自动 commit / push。
31
+ - 不写入 secrets(token、cookie、内网地址)。
32
+ - 无法复现时先输出阻塞信息并落盘,不直接改代码。
33
+ <!-- AIWS_MANAGED_END:opencode:ws-bugfix -->
34
+
35
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,70 @@
1
+ ---
2
+ description: 提交:门禁/审计后提交(submodule 感知)
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-commit -->
5
+ # ws commit
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:在**当前分支可直提**的前提下,先做审计与门禁,并在存在 submodule 时给出正确的提交顺序(先 submodule,再 superproject),最后执行 `git commit`。
10
+ 补充:若你经常遇到 submodule detached,建议日常拉取优先使用 `/ws-pull`(尽量把 submodule “挂回分支”且不改变 gitlink commit)。
11
+
12
+ 安全约束(强制):
13
+ - 不自动 `git add -A`;只在用户明确指示时才做 staging
14
+ - 不使用 `--no-verify` 绕过 hooks
15
+ - 不自动 push
16
+ - 不打印 secrets
17
+ - commit message 优先使用中文;若启用了 `.githooks/commit-msg`,默认仅提示,只有 strict 模式才会拒绝全英文首行(`Merge/Revert/fixup!/squash!` 例外)
18
+
19
+ 步骤(建议):
20
+ 1) 先运行 `/ws-preflight`。
21
+ 2) 运行 `/ws-review`(优先落盘审计证据到 `changes/<change-id>/review/`)。
22
+ 3) 运行门禁校验并写 stamp:
23
+ ```bash
24
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
25
+ ./node_modules/.bin/aiws validate . --stamp
26
+ elif command -v aiws >/dev/null 2>&1; then
27
+ aiws validate . --stamp
28
+ else
29
+ npx @aipper/aiws validate . --stamp
30
+ fi
31
+ ```
32
+ 4) 输出提交上下文(必须输出给用户确认):
33
+ ```bash
34
+ git branch --show-current
35
+ git status --porcelain
36
+ ```
37
+ 5) submodule 感知检查:
38
+ ```bash
39
+ if [[ -f .gitmodules ]]; then
40
+ git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' || true
41
+ fi
42
+ while read -r _ sub_path; do
43
+ [[ -z "${sub_path:-}" ]] && continue
44
+ echo "== submodule: ${sub_path} =="
45
+ git -C "${sub_path}" rev-parse --abbrev-ref HEAD 2>/dev/null || true
46
+ git -C "${sub_path}" status --porcelain || true
47
+ done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
48
+ ```
49
+ 判定规则(强制):
50
+ - 任一 submodule `git status --porcelain` 非空:停止提交 superproject;先在对应 submodule 完成 commit,再回到 superproject 更新并提交 gitlink。
51
+ - 若该 submodule 当前为 detached HEAD:先按 `.gitmodules` 的目标分支挂到 `aiws/pin/<target-branch>`;不要直接切 `change/<change-id>` / `main` / `master`。
52
+ 6) 检查 staging(必须输出给用户确认):
53
+ ```bash
54
+ git status --porcelain
55
+ git diff --staged --submodule=short
56
+ ```
57
+ 7) 若没有 staged changes:停止并提示用户先明确要提交哪些文件(例如 `git add -p` 或 `git add <path>`)。
58
+ 8) 优先生成并确认中文 commit message(格式建议:`<类型>: <简述>`;若用户明确要求英文也可保留,但 strict 模式下会被 hook 拒绝)。
59
+ 9) 执行提交(不带 `--no-verify`):
60
+ ```bash
61
+ git commit -m "<message>"
62
+ ```
63
+
64
+ 输出必须包含:
65
+ - `证据(Evidence):` `changes/<change-id>/review/*`(无 change-id 时回退 `.agentdocs/tmp/review/*`) + `.agentdocs/tmp/aiws-validate/*`
66
+ - `上下文(Context):` 当前分支 + 是否检测到 submodule + 若阻断则给出阻断原因
67
+ - `下一步(Next):` 若存在 submodule 改动,先提示用户进入 submodule 提交
68
+ <!-- AIWS_MANAGED_END:opencode:ws-commit -->
69
+
70
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: 委托:按 AIWS 合同拆分子任务,并优先借用 oMo agent
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-delegate -->
5
+ # ws delegate
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:先写清 delegation plan,再决定是否优先借用 `oh-my-opencode` 的 `planner-sisyphus` / `explore` / `librarian` / `oracle`;若不可用则回退,不阻断流程。
10
+
11
+ 执行建议:
12
+ 1) 先运行 `/ws-preflight`,再读取 `packages/spec/docs/workflow-delegation-contracts.md` 与 `packages/spec/docs/opencode-omo-adapter.md`。
13
+ 2) 先写 `Delegation Plan:`,至少包含:
14
+ - `role`
15
+ - `preferred agent`
16
+ - `task`
17
+ - `readScope`
18
+ - `writeScope`
19
+ - `artifactTargets`
20
+ - `fallback`
21
+ 3) 若检测到 `.opencode/oh-my-opencode.json` 或当前会话明确可用相关 agent:
22
+ - planning 优先 `planner-sisyphus`
23
+ - 探索优先 `@explore` / `@librarian`
24
+ - 独立审查优先 `@oracle`
25
+ 4) 主 agent 统一收敛结果,并把产物回收到:
26
+ - `changes/<id>/analysis/`
27
+ - `changes/<id>/patches/`
28
+ - `changes/<id>/review/`
29
+ - `changes/<id>/evidence/`
30
+ 5) 若 oMo agent 不可用:明确回退为普通 OpenCode delegation / 单 agent 执行。
31
+ <!-- AIWS_MANAGED_END:opencode:ws-delegate -->
32
+
33
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -1,17 +1,15 @@
1
- # Command: ws:deliver
2
- # Description: 交付(submodules + superproject 分步提交,并安全合并回目标分支)
3
- # Category: workspace
4
- # Version: 1
1
+ ---
2
+ description: 交付:submodules+superproject 分步提交并安全合并回 base
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-deliver -->
5
+ # ws deliver
5
6
 
6
- description = "交付(submodules + superproject 分步提交,并安全合并回目标分支)"
7
-
8
- prompt = """
9
7
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
8
 
11
9
  目标:适配 superproject + submodule(数量不固定)的交付收尾,降低提交顺序和合并回 base 分支的出错概率:
12
10
  1) 先逐个提交 submodule(每个 repo 单独确认 commit message;默认 `git add -p`)
13
11
  2) 再提交 superproject(包含 submodule gitlink 指针更新 + 自身改动/变更工件)
14
- 3) 最后 fast-forward 合并回目标分支(复用 `aiws change finish`;建议用 `ws:finish`)
12
+ 3) 最后 fast-forward 合并回目标分支(复用 `aiws change finish`;建议用 `/ws-finish`)
15
13
 
16
14
  强制约束:
17
15
  - 不自动 `git add -A`。
@@ -19,8 +17,8 @@ prompt = """
19
17
  - 不自动删除分支。
20
18
 
21
19
  建议流程(按顺序):
22
- 1) 先确认真值文件存在并遵守:`AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`。
23
- 2) 如果存在 `.gitmodules` 但缺少 `submodule.<name>.branch`,先运行 `ws:submodule-setup` 并提交 `.gitmodules`(否则 `aiws validate .` 会失败,且 submodule 工作流会产生人为差异)。
20
+ 1) 先运行 `/ws-preflight`。
21
+ 2) 如果存在 `.gitmodules` 但缺少 `submodule.<name>.branch`,先运行 `/ws-submodule-setup` 并提交 `.gitmodules`(否则 `aiws validate .` 会失败,且 submodule 工作流会产生人为差异)。
24
22
  2.1) 若存在 submodule:必须准备 `changes/<change-id>/submodules.targets`,并覆盖所有 submodule path;这是本次交付的目标分支真值。
25
23
  - 生成该文件时可先做默认预填:detached HEAD 默认建议取 `.gitmodules` 声明分支;已附着在本地分支时默认建议取当前分支。
26
24
  - 上述都只是建议值;真正的 deliver/finish 只认 `submodules.targets`。
@@ -47,12 +45,14 @@ prompt = """
47
45
  5.2) (可选)生成状态快照(建议):
48
46
  - `aiws change state <change-id> --write`
49
47
  6) 安全合并回目标分支:
50
- - 优先运行 `ws:finish`(底层调用 `aiws change finish`,默认 `--ff-only`;push 成功后会清理对应 change worktree)
48
+ - 优先运行 `/ws-finish`(底层调用 `aiws change finish`,默认 `--ff-only`;push 成功后会清理对应 change worktree)
51
49
 
52
50
  输出要求:
53
51
  - `Submodules:` 每个 submodule 的 commit 摘要(repo/path → sha → message)
54
52
  - `Superproject:` commit 摘要
55
- - `Merge:` `ws:finish`/`aiws change finish` 输出(into/from)
53
+ - `Merge:` `/ws-finish` 输出(into/from)
56
54
  - `Worktree cleanup:` 若存在独立 change worktree,输出清理结果(removed/skipped + reason)
57
55
  - `Evidence:` `.agentdocs/tmp/aiws-validate/*.json`(若使用 --stamp)
58
- """
56
+ <!-- AIWS_MANAGED_END:opencode:ws-deliver -->
57
+
58
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: 轻量开发:simple/local 单点修复;最小改动 + 最小验证
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-dev-lite -->
5
+ # ws dev lite
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:处理 simple/local 单点修复,走最小改动 + 最小验证,不默认拉起完整重流程。
10
+
11
+ 使用条件:
12
+ - 目标明确、归因明确、验证入口明确
13
+ - 一般只影响单文件或紧密相关的小范围文件
14
+ - 不需要先改 `REQUIREMENTS.md`
15
+
16
+ 强制流程:
17
+ 1) 先运行 `/ws-preflight`。
18
+ 2) 先说明:
19
+ - `Goal:`
20
+ - `Why lite:`
21
+ - 若说不清,立刻回到 `/ws-dev` 或 `/ws-plan`
22
+ 3) 实施最小改动;不要为形式完整额外扩 scope。
23
+ 4) 运行最小可复现验证;允许比全量更窄,但必须说明为什么足够。
24
+ 5) 输出 `Changed / Verify / Evidence / Next`。
25
+ 6) 若准备提交或交付:后续仍进入 `/ws-review`、`/ws-commit`、`/ws-finish`。
26
+
27
+ 边界:
28
+ - 默认不创建 `plan/...`
29
+ - 默认不跑 `ws-plan-verify`
30
+ - 默认不要求先做双 review
31
+ - 一旦复杂度升高,停止 lite,切回主流程
32
+ <!-- AIWS_MANAGED_END:opencode:ws-dev-lite -->
33
+
34
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: 开发:在 AIWS 约束下完成小步交付
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-dev -->
5
+ # ws dev
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:在 AIWS 约束下完成一个可回放、可验证的小步交付。
10
+
11
+ 建议流程:
12
+ 1) 先运行 `/ws-preflight`(读真值文件并输出约束摘要)。
13
+ - 若 `/ws-plan` 刚创建了 `change/<change-id>` worktree:后续实现必须在该 worktree 中继续;不要回原工作区重复 `aiws change start ...`
14
+ 2) 建立变更归因(推荐):
15
+ - ⚠️ 若准备切分支/创建 worktree,先看 `git status --porcelain`;否则切换上下文后,未提交改动可能“看起来丢了”。
16
+ - 若当前目录已经是 `change/<change-id>` worktree(例如由 `/ws-plan` 创建):直接在这里继续,不要再创建第二个 worktree,也不要回原工作区写代码。
17
+ - 若非空仅因为 `/ws-plan` 生成了 `plan/...` 或 `changes/<change-id>/...`,这是预期行为;此时优先 `aiws change start <change-id> --hooks --no-switch`,若仍要 `--switch/--worktree`,先提交这些规划工件。
18
+ - 推荐更安全(默认):`aiws change start <change-id> --hooks --no-switch`(只创建分支/工件 + 启用 hooks;不切分支)
19
+ - 准备进入实现时:若当前已在 `change/<change-id>` 直接继续;若需切换到该分支,先确认除规划工件外无额外未提交改动,再执行:`git switch change/<change-id>`
20
+ - 若你明确要“一键切分支”(不推荐,且 dirty 会被拦截):`aiws change start <change-id> --hooks --switch`
21
+ - superproject + submodule(推荐):`aiws change start <change-id> --hooks --worktree --submodules`
22
+ - 若后续需要在 detached submodule 内提交:先挂到 `aiws/pin/<target-branch>`;不要直接切 `change/<change-id>` / `main` / `master`
23
+ - 或手工:`git switch -c change/<change-id>`,并创建 `changes/<change-id>/proposal.md` 与 `changes/<change-id>/tasks.md`(参考 `changes/README.md`)
24
+ 3) 如涉及需求调整:先 `/ws-req-review` → 用户确认后再 `/ws-req-change`(避免需求漂移)。
25
+ 4) 实施最小改动:任何改动都要能归因到 `REQUIREMENTS.md`(验收)或 `issues/problem-issues.csv`(问题)。
26
+ 5) 运行 `AI_WORKSPACE.md` 里声明的验证命令;未运行不声称已运行。
27
+ 6) 提交前强制:`aiws validate .`(commit/push hooks 也会阻断)。
28
+ 7) 交付收尾(推荐,减少手动 merge 出错):运行 `/ws-finish`(底层调用 `aiws change finish`,默认 fast-forward 安全合并回目标分支)。
29
+
30
+ 输出要求:
31
+ - `变更文件(Changed):` 文件清单
32
+ - `验证(Verify):` 实际运行的命令 + 期望结果
33
+ - `证据(Evidence):` 证据路径(例如 `changes/<change-id>/review/...`、`changes/<change-id>/...` 或 `.agentdocs/tmp/...`)
34
+ <!-- AIWS_MANAGED_END:opencode:ws-dev -->
35
+
36
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -1,35 +1,50 @@
1
- # Command: ws:finish
2
- # Description: AI Workspace 安全收尾(门禁 + fast-forward 合并 + submodule 并回分支后顺序 push
3
- # Category: workspace
4
- # Version: 1
1
+ ---
2
+ description: 收尾:fast-forward 合并并把 submodule 并回目标分支后顺序 push
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-finish -->
5
+ # ws finish
5
6
 
6
- description = "AI Workspace 安全收尾(门禁 + fast-forward 合并 + submodule 并回分支后顺序 push)"
7
-
8
- prompt = """
9
7
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
8
 
11
- 目标:安全把 `change/<change-id>` fast-forward 合并回目标分支,并按 `submodule -> superproject` 顺序 push,减少遗漏。
12
- 补充:若团队希望减少 submodule detached 的人为差异,建议在 `.gitmodules` 配置 `submodule.<name>.branch`,并在日常拉取时使用 `ws:pull`。
9
+ 目标:安全把 `change/<change-id>` fast-forward 合并回目标分支,避免手输分支名导致的错误。
10
+ 补充:若团队希望减少 submodule detached 的人为差异,建议在 `.gitmodules` 配置 `submodule.<name>.branch`,并在日常拉取时使用 `/ws-pull`。
11
+
12
+ 前置(必须):
13
+ - 工作区干净:`git status --porcelain` 无输出(否则先 commit 或 stash)
14
+ - change 分支存在(`change/<change-id>`;也支持 `changes/`、`ws/`、`ws-change/`)
15
+ - 若存在 `.gitmodules`:必须为每个 submodule 配置 `submodule.<name>.branch`(否则先运行 `/ws-submodule-setup` 并提交 `.gitmodules`)
13
16
 
14
- 强制步骤:
15
- 1) 读取真值文件:`AI_PROJECT.md`、`REQUIREMENTS.md`、`AI_WORKSPACE.md`(缺失则先运行 `/aiws-init` `aiws init .`)。
16
- 2) 若 iFlow 拦截写入:先执行 `/ws-contract-check`,再继续。
17
- 3) 确认 git 状态(必须输出给用户):
18
- - `git status --porcelain`
19
- - `git branch --show-current`(或 `git rev-parse --abbrev-ref HEAD`)
20
- 4) 若工作区不干净:停止,并要求先 commit 或 stash(不要尝试自动处理)。
21
- 4.1) 若存在 `.gitmodules`:必须为每个 submodule 配置 `submodule.<name>.branch`(否则先运行 `ws:submodule-setup` 并提交 `.gitmodules`)。
22
- 5) (推荐)门禁校验并落盘证据:`aiws validate . --stamp`(未安装全局 aiws 时可用 `npx @aipper/aiws validate . --stamp`)。
23
- 5.1) (强烈建议)收敛持久证据并回填 `Evidence_Path`:`aiws change evidence <change-id>`(未安装全局 aiws 时可用 `npx @aipper/aiws change evidence <change-id>`)。
24
- 5.2) (可选)生成状态快照(建议):`aiws change state <change-id> --write`。
25
- 6) 若不存在 `.gitmodules`,或 submodules 已按顺序处理完成,优先直接执行最小收尾闭环:
17
+ 步骤(建议):
18
+ 0) 若存在 `.gitmodules`,先检查 submodule branch 配置是否齐全(缺失则停止并提示 setup):
19
+ ```bash
20
+ if [[ -f .gitmodules ]]; then
21
+ missing=0
22
+ while read -r key sub_path; do
23
+ name="${key#submodule.}"; name="${name%.path}"
24
+ b="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
25
+ if [[ -z "${b:-}" ]]; then
26
+ echo "error: missing .gitmodules submodule.${name}.branch (path=${sub_path})"
27
+ missing=1
28
+ fi
29
+ done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
30
+ if [[ "$missing" -ne 0 ]]; then
31
+ echo "hint: run /ws-submodule-setup (and commit .gitmodules), then retry"
32
+ exit 2
33
+ fi
34
+ fi
35
+ ```
36
+ 1) 先运行 `/ws-preflight`(确保真值文件齐全)。
37
+ 2) (推荐)门禁校验并落盘证据:`aiws validate . --stamp`(未安装全局 aiws 时可用 `npx @aipper/aiws validate . --stamp`)。
38
+ 2.1) (强烈建议)收敛持久证据并回填 `Evidence_Path`:`aiws change evidence <change-id>`(未安装全局 aiws 时可用 `npx @aipper/aiws change evidence <change-id>`)。
39
+ 2.2) (可选)生成状态快照(建议):`aiws change state <change-id> --write`。
40
+ 3) 若不存在 `.gitmodules`,或 submodules 已按顺序处理完成,优先直接执行最小收尾闭环:
26
41
  - `aiws change finish <change-id> --push`
27
- - `change/<change-id>` 分支上也可省略 `<change-id>`;命令会尝试读取 `changes/<change-id>/.ws-change.json` 的 `base_branch`
42
+ - 若当前就在 `change/<change-id>` 分支上,也可省略 `<change-id>`
28
43
  - 该命令会在 fast-forward 合并成功后 push 目标分支;默认优先使用 upstream 配置(`branch.<name>.remote` + `branch.<name>.merge`),只有在你明确知道要推向别的 remote 时才追加 `--remote <name>`
29
44
  - 若 `change/<change-id>` 位于独立 worktree,且该 worktree 干净,则会在 push 成功后自动执行 `git worktree remove` + `git worktree prune`
30
45
  - AI 入口执行前,应先向用户说明将要 push 的 remote/branch;显式传入 `--push` 即视为确认
31
- 7) 若提示无法 fast-forward:先在 change 分支(或对应 worktree)里执行 `git rebase <target-branch>`,再重试 `aiws change finish --push`。
32
- 8) 若需要先处理 submodules,则按顺序处理每个 submodule(先并回目标分支,再 push):
46
+ 4) 若提示无法 fast-forward:先在 change 分支(或对应 worktree)里 `git rebase <target-branch>`,再重试 `aiws change finish --push`。
47
+ 5) 若需要先处理 submodules,则按顺序处理每个 submodule(减少 detached;再 push):
33
48
  - 先显式解析 base branch,不要用当前分支名替代:
34
49
  - `python3 - <<'PY'`
35
50
  - `import json, pathlib; meta = pathlib.Path("changes") / "<change-id>" / ".ws-change.json"; print((json.loads(meta.read_text(encoding="utf-8")).get("base_branch") or "").strip())`
@@ -43,12 +58,14 @@ prompt = """
43
58
  - 用 pin 分支挂回(不改动现有 main/master 指针):`git -C "<sub_path>" checkout -B "aiws/pin/<target-branch>" <gitlink-sha>`
44
59
  - 仅当 `<gitlink-sha>` 属于 `origin/<target-branch>` 历史时才允许 push;否则停止并人工处理分叉
45
60
  - push(只允许 fast-forward):`git -C "<sub_path>" push origin "<gitlink-sha>:refs/heads/<target-branch>"`
46
- 9) 任一 submodule 不满足 fast-forward 条件时立即停止(不要继续 push 主仓库)。
47
- 10) submodules push 完成后,再回到主仓库执行:
61
+ 6) 任一 submodule 不满足 fast-forward 条件时立即停止(不要继续 push 主仓库)。
62
+ 7) submodules 全部成功后,再回到主仓库执行:
48
63
  - `aiws change finish <change-id> --push`
49
- 11) (可选)交付完成后归档变更工件:`aiws change archive <change-id>`。
64
+ 8) `aiws change finish --push` 成功后会自动归档并生成 handoff;只有历史/异常场景才需要手工运行 `aiws change archive <change-id>`。
50
65
 
51
- 边界:
66
+ 安全:
52
67
  - push 前先输出状态并说明远端/分支。
53
68
  - 不执行破坏性命令。
54
- """
69
+ <!-- AIWS_MANAGED_END:opencode:ws-finish -->
70
+
71
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。