@aipper/aiws-spec 0.0.24 → 0.0.25

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 (191) 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 +87 -5
  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 +26 -11
  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 +83 -0
  27. package/templates/workspace/.agents/skills/ws-commit/SKILL.md +23 -0
  28. package/templates/workspace/.agents/skills/ws-delegate/SKILL.md +75 -0
  29. package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +22 -0
  30. package/templates/workspace/.agents/skills/ws-dev/SKILL.md +35 -6
  31. package/templates/workspace/.agents/skills/ws-finish/SKILL.md +24 -0
  32. package/templates/workspace/.agents/skills/ws-frontend-design/SKILL.md +126 -0
  33. package/templates/workspace/.agents/skills/ws-handoff/SKILL.md +22 -1
  34. package/templates/workspace/.agents/skills/ws-plan/SKILL.md +25 -1
  35. package/templates/workspace/.agents/skills/ws-plan-verify/SKILL.md +20 -0
  36. package/templates/workspace/.agents/skills/ws-preflight/SKILL.md +23 -0
  37. package/templates/workspace/.agents/skills/ws-quality-review/SKILL.md +56 -0
  38. package/templates/workspace/.agents/skills/ws-review/SKILL.md +24 -0
  39. package/templates/workspace/.agents/skills/ws-spec-review/SKILL.md +57 -0
  40. package/templates/workspace/.agents/skills/ws-verify-before-complete/SKILL.md +59 -0
  41. package/templates/workspace/.claude/commands/using-aiws.md +24 -0
  42. package/templates/workspace/.claude/commands/ws-quality-review.md +24 -0
  43. package/templates/workspace/.claude/commands/ws-spec-review.md +24 -0
  44. package/templates/workspace/.claude/commands/ws-verify-before-complete.md +24 -0
  45. package/templates/workspace/.claude/skills/p-aiws-change-archive/SKILL.md +24 -0
  46. package/templates/workspace/.claude/skills/p-aiws-change-finish/SKILL.md +24 -0
  47. package/templates/workspace/.claude/skills/p-aiws-change-list/SKILL.md +18 -0
  48. package/templates/workspace/.claude/skills/p-aiws-change-new/SKILL.md +26 -0
  49. package/templates/workspace/.claude/skills/p-aiws-change-next/SKILL.md +19 -0
  50. package/templates/workspace/.claude/skills/p-aiws-change-start/SKILL.md +33 -0
  51. package/templates/workspace/.claude/skills/p-aiws-change-status/SKILL.md +19 -0
  52. package/templates/workspace/.claude/skills/p-aiws-change-sync/SKILL.md +19 -0
  53. package/templates/workspace/.claude/skills/p-aiws-change-templates-init/SKILL.md +18 -0
  54. package/templates/workspace/.claude/skills/p-aiws-change-templates-which/SKILL.md +18 -0
  55. package/templates/workspace/.claude/skills/p-aiws-change-validate/SKILL.md +23 -0
  56. package/templates/workspace/.claude/skills/p-aiws-hooks-install/SKILL.md +30 -0
  57. package/templates/workspace/.claude/skills/p-aiws-hooks-status/SKILL.md +18 -0
  58. package/templates/workspace/.claude/skills/p-aiws-init/SKILL.md +27 -0
  59. package/templates/workspace/.claude/skills/p-aiws-rollback/SKILL.md +18 -0
  60. package/templates/workspace/.claude/skills/p-aiws-update/SKILL.md +26 -0
  61. package/templates/workspace/.claude/skills/p-aiws-validate/SKILL.md +22 -0
  62. package/templates/workspace/.claude/skills/p-tasks-plan/SKILL.md +37 -0
  63. package/templates/workspace/.claude/skills/using-aiws/SKILL.md +83 -0
  64. package/templates/workspace/.claude/skills/ws-analyze/SKILL.md +26 -0
  65. package/templates/workspace/.claude/skills/ws-bugfix/SKILL.md +111 -0
  66. package/templates/workspace/.claude/skills/ws-commit/SKILL.md +127 -0
  67. package/templates/workspace/.claude/skills/ws-deliver/SKILL.md +231 -0
  68. package/templates/workspace/.claude/skills/ws-dev/SKILL.md +168 -0
  69. package/templates/workspace/.claude/skills/ws-finish/SKILL.md +220 -0
  70. package/templates/workspace/.claude/skills/ws-frontend-design/SKILL.md +126 -0
  71. package/templates/workspace/.claude/skills/ws-handoff/SKILL.md +52 -0
  72. package/templates/workspace/.claude/skills/ws-migrate/SKILL.md +54 -0
  73. package/templates/workspace/.claude/skills/ws-plan/SKILL.md +138 -0
  74. package/templates/workspace/.claude/skills/ws-plan-verify/SKILL.md +61 -0
  75. package/templates/workspace/.claude/skills/ws-preflight/SKILL.md +55 -0
  76. package/templates/workspace/.claude/skills/ws-pull/SKILL.md +119 -0
  77. package/templates/workspace/.claude/skills/ws-push/SKILL.md +110 -0
  78. package/templates/workspace/.claude/skills/ws-quality-review/SKILL.md +56 -0
  79. package/templates/workspace/.claude/skills/ws-req-change/SKILL.md +41 -0
  80. package/templates/workspace/.claude/skills/ws-req-contract-sync/SKILL.md +17 -0
  81. package/templates/workspace/.claude/skills/ws-req-contract-validate/SKILL.md +12 -0
  82. package/templates/workspace/.claude/skills/ws-req-flow-sync/SKILL.md +28 -0
  83. package/templates/workspace/.claude/skills/ws-req-review/SKILL.md +32 -0
  84. package/templates/workspace/.claude/skills/ws-review/SKILL.md +50 -0
  85. package/templates/workspace/.claude/skills/ws-rule/SKILL.md +23 -0
  86. package/templates/workspace/.claude/skills/ws-spec-review/SKILL.md +57 -0
  87. package/templates/workspace/.claude/skills/ws-submodule-setup/SKILL.md +65 -0
  88. package/templates/workspace/.claude/skills/ws-verify-before-complete/SKILL.md +59 -0
  89. package/templates/workspace/.opencode/command/using-aiws.md +29 -0
  90. package/templates/workspace/.opencode/command/ws-delegate.md +33 -0
  91. package/templates/workspace/.opencode/command/ws-plan.md +3 -0
  92. package/templates/workspace/.opencode/command/ws-preflight.md +4 -0
  93. package/templates/workspace/.opencode/command/ws-quality-review.md +30 -0
  94. package/templates/workspace/.opencode/command/ws-review.md +3 -0
  95. package/templates/workspace/.opencode/command/ws-spec-review.md +30 -0
  96. package/templates/workspace/.opencode/command/ws-verify-before-complete.md +27 -0
  97. package/templates/workspace/.opencode/commands/p-aiws-change-archive.md +27 -0
  98. package/templates/workspace/.opencode/commands/p-aiws-change-finish.md +27 -0
  99. package/templates/workspace/.opencode/commands/p-aiws-change-list.md +26 -0
  100. package/templates/workspace/.opencode/commands/p-aiws-change-new.md +27 -0
  101. package/templates/workspace/.opencode/commands/p-aiws-change-next.md +27 -0
  102. package/templates/workspace/.opencode/commands/p-aiws-change-start.md +27 -0
  103. package/templates/workspace/.opencode/commands/p-aiws-change-status.md +27 -0
  104. package/templates/workspace/.opencode/commands/p-aiws-change-sync.md +27 -0
  105. package/templates/workspace/.opencode/commands/p-aiws-change-templates-init.md +26 -0
  106. package/templates/workspace/.opencode/commands/p-aiws-change-templates-which.md +26 -0
  107. package/templates/workspace/.opencode/commands/p-aiws-change-validate.md +27 -0
  108. package/templates/workspace/.opencode/commands/p-aiws-hooks-install.md +26 -0
  109. package/templates/workspace/.opencode/commands/p-aiws-hooks-status.md +26 -0
  110. package/templates/workspace/.opencode/commands/p-aiws-init.md +23 -0
  111. package/templates/workspace/.opencode/commands/p-aiws-rollback.md +16 -0
  112. package/templates/workspace/.opencode/commands/p-aiws-update.md +22 -0
  113. package/templates/workspace/.opencode/commands/p-aiws-validate.md +17 -0
  114. package/templates/workspace/.opencode/commands/using-aiws.md +29 -0
  115. package/templates/workspace/.opencode/commands/ws-analyze.md +30 -0
  116. package/templates/workspace/.opencode/commands/ws-bugfix.md +35 -0
  117. package/templates/workspace/.opencode/commands/ws-commit.md +70 -0
  118. package/templates/workspace/.opencode/commands/ws-delegate.md +33 -0
  119. package/templates/workspace/.opencode/commands/ws-deliver.md +58 -0
  120. package/templates/workspace/.opencode/commands/ws-dev.md +36 -0
  121. package/templates/workspace/.opencode/commands/ws-finish.md +71 -0
  122. package/templates/workspace/.opencode/commands/ws-handoff.md +25 -0
  123. package/templates/workspace/.opencode/commands/ws-migrate.md +25 -0
  124. package/templates/workspace/.opencode/commands/ws-plan-verify.md +28 -0
  125. package/templates/workspace/.opencode/commands/ws-plan.md +27 -0
  126. package/templates/workspace/.opencode/commands/ws-preflight.md +34 -0
  127. package/templates/workspace/.opencode/commands/ws-pull.md +87 -0
  128. package/templates/workspace/.opencode/commands/ws-push.md +93 -0
  129. package/templates/workspace/.opencode/commands/ws-quality-review.md +30 -0
  130. package/templates/workspace/.opencode/commands/ws-req-change.md +45 -0
  131. package/templates/workspace/.opencode/commands/ws-req-contract-sync.md +21 -0
  132. package/templates/workspace/.opencode/commands/ws-req-contract-validate.md +16 -0
  133. package/templates/workspace/.opencode/commands/ws-req-flow-sync.md +23 -0
  134. package/templates/workspace/.opencode/commands/ws-req-review.md +36 -0
  135. package/templates/workspace/.opencode/commands/ws-review.md +33 -0
  136. package/templates/workspace/.opencode/commands/ws-rule.md +27 -0
  137. package/templates/workspace/.opencode/commands/ws-spec-review.md +30 -0
  138. package/templates/workspace/.opencode/commands/ws-submodule-setup.md +57 -0
  139. package/templates/workspace/.opencode/commands/ws-verify-before-complete.md +27 -0
  140. package/templates/workspace/.opencode/oh-my-opencode.json.example +17 -0
  141. package/templates/workspace/.opencode/skills/p-aiws-change-archive/SKILL.md +24 -0
  142. package/templates/workspace/.opencode/skills/p-aiws-change-finish/SKILL.md +24 -0
  143. package/templates/workspace/.opencode/skills/p-aiws-change-list/SKILL.md +18 -0
  144. package/templates/workspace/.opencode/skills/p-aiws-change-new/SKILL.md +26 -0
  145. package/templates/workspace/.opencode/skills/p-aiws-change-next/SKILL.md +19 -0
  146. package/templates/workspace/.opencode/skills/p-aiws-change-start/SKILL.md +33 -0
  147. package/templates/workspace/.opencode/skills/p-aiws-change-status/SKILL.md +19 -0
  148. package/templates/workspace/.opencode/skills/p-aiws-change-sync/SKILL.md +19 -0
  149. package/templates/workspace/.opencode/skills/p-aiws-change-templates-init/SKILL.md +18 -0
  150. package/templates/workspace/.opencode/skills/p-aiws-change-templates-which/SKILL.md +18 -0
  151. package/templates/workspace/.opencode/skills/p-aiws-change-validate/SKILL.md +23 -0
  152. package/templates/workspace/.opencode/skills/p-aiws-hooks-install/SKILL.md +30 -0
  153. package/templates/workspace/.opencode/skills/p-aiws-hooks-status/SKILL.md +18 -0
  154. package/templates/workspace/.opencode/skills/p-aiws-init/SKILL.md +27 -0
  155. package/templates/workspace/.opencode/skills/p-aiws-rollback/SKILL.md +18 -0
  156. package/templates/workspace/.opencode/skills/p-aiws-update/SKILL.md +26 -0
  157. package/templates/workspace/.opencode/skills/p-aiws-validate/SKILL.md +22 -0
  158. package/templates/workspace/.opencode/skills/p-tasks-plan/SKILL.md +37 -0
  159. package/templates/workspace/.opencode/skills/using-aiws/SKILL.md +87 -0
  160. package/templates/workspace/.opencode/skills/ws-analyze/SKILL.md +26 -0
  161. package/templates/workspace/.opencode/skills/ws-bugfix/SKILL.md +111 -0
  162. package/templates/workspace/.opencode/skills/ws-commit/SKILL.md +127 -0
  163. package/templates/workspace/.opencode/skills/ws-delegate/SKILL.md +63 -0
  164. package/templates/workspace/.opencode/skills/ws-deliver/SKILL.md +231 -0
  165. package/templates/workspace/.opencode/skills/ws-dev/SKILL.md +168 -0
  166. package/templates/workspace/.opencode/skills/ws-finish/SKILL.md +220 -0
  167. package/templates/workspace/.opencode/skills/ws-frontend-design/SKILL.md +126 -0
  168. package/templates/workspace/.opencode/skills/ws-handoff/SKILL.md +52 -0
  169. package/templates/workspace/.opencode/skills/ws-migrate/SKILL.md +54 -0
  170. package/templates/workspace/.opencode/skills/ws-plan/SKILL.md +148 -0
  171. package/templates/workspace/.opencode/skills/ws-plan-verify/SKILL.md +61 -0
  172. package/templates/workspace/.opencode/skills/ws-preflight/SKILL.md +60 -0
  173. package/templates/workspace/.opencode/skills/ws-pull/SKILL.md +119 -0
  174. package/templates/workspace/.opencode/skills/ws-push/SKILL.md +110 -0
  175. package/templates/workspace/.opencode/skills/ws-quality-review/SKILL.md +63 -0
  176. package/templates/workspace/.opencode/skills/ws-req-change/SKILL.md +41 -0
  177. package/templates/workspace/.opencode/skills/ws-req-contract-sync/SKILL.md +17 -0
  178. package/templates/workspace/.opencode/skills/ws-req-contract-validate/SKILL.md +12 -0
  179. package/templates/workspace/.opencode/skills/ws-req-flow-sync/SKILL.md +28 -0
  180. package/templates/workspace/.opencode/skills/ws-req-review/SKILL.md +32 -0
  181. package/templates/workspace/.opencode/skills/ws-review/SKILL.md +57 -0
  182. package/templates/workspace/.opencode/skills/ws-rule/SKILL.md +23 -0
  183. package/templates/workspace/.opencode/skills/ws-spec-review/SKILL.md +64 -0
  184. package/templates/workspace/.opencode/skills/ws-submodule-setup/SKILL.md +65 -0
  185. package/templates/workspace/.opencode/skills/ws-verify-before-complete/SKILL.md +59 -0
  186. package/templates/workspace/AGENTS.md +72 -30
  187. package/templates/workspace/changes/README.md +18 -0
  188. package/templates/workspace/changes/templates/proposal.md +15 -0
  189. package/templates/workspace/changes/templates/tasks.md +9 -2
  190. package/templates/workspace/manifest.json +277 -2
  191. package/templates/workspace/tools/ws_change_check.py +26 -4
@@ -0,0 +1,45 @@
1
+ ---
2
+ description: 需求变更:更新 REQUIREMENTS 并同步执行合同
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-req-change -->
5
+ # ws req change
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:记录需求变更(更新 `REQUIREMENTS.md` + 追加 `requirements/CHANGELOG.md`),并同步/校验执行合同 `requirements/requirements-issues.csv`。
10
+
11
+ 步骤(必须按顺序):
12
+ 1) 读取:`AI_PROJECT.md`、`REQUIREMENTS.md`、`AI_WORKSPACE.md`、`requirements/CHANGELOG.md`(缺失则创建目录与文件)。
13
+ 2) 先产出“拟变更方案”(不要立刻写文件):
14
+ - 变更摘要(1–5 条)
15
+ - 影响范围(API/鉴权/字段/状态码/测试边界)
16
+ - 回滚思路(1–2 条)
17
+ 3) 对比与冲突检查(强制,不写文件):
18
+ - 对比“变更前 vs 拟变更后”的差异清单(新增/删除/语义变化)
19
+ - 整理潜在冲突/不确定点(只列“最可能影响验收/实现”的,避免噪音)
20
+ 4) 逐条澄清(强制,避免一次问完):
21
+ - 若存在潜在冲突/不确定点:**本轮只问 1 个**最高优先级问题(给出 2–4 个可选答案或二选一),然后停止,等待用户回复;不要继续问下一题,也不要写文件。
22
+ - 收到用户回复后:更新“拟变更方案”,回到步骤 3) 重新对比,直至没有未决问题。
23
+ 5) 强制停下来让用户确认:是否继续落盘?(Y/N)
24
+ 6) 用户确认 Y 后再写入:
25
+ - 更新 `REQUIREMENTS.md`(只保留当前有效版本,不在此堆历史)
26
+ - 追加 `requirements/CHANGELOG.md`
27
+ 7) 同步/补齐需求执行合同(强制,自动处理 FlowSpec 有/无两种情况):
28
+ - `python3 tools/requirements_contract_sync.py --workspace .`
29
+ - 说明:若 `REQUIREMENTS.md` 中不存在 FlowSpec(或 flows 为空),该命令只会确保 `requirements/requirements-issues.csv` 表头存在并给出 WARN(这是预期行为,不要当成失败)。
30
+ 8) 校验需求执行合同(强制):`python3 tools/requirements_contract.py validate`
31
+ 9) 同步场景合同(可选,但若存在 FlowSpec 则强烈建议自动执行):
32
+ - 若 `REQUIREMENTS.md` 同时包含 `<!-- FLOW_SPEC_BEGIN -->` 与 `<!-- FLOW_SPEC_END -->`:运行 `/ws-req-flow-sync`
33
+ - 否则:跳过,并提示用户“可以先不维护 FlowSpec;后续需要场景回归时再补”
34
+
35
+ 输出必须包含:
36
+ - 本次更新的文件清单(路径)
37
+ - 回滚方案(如何撤销本次需求变更)
38
+ - 下一步建议命令
39
+
40
+ 安全:
41
+ - 不打印 `secrets/test-accounts.json`
42
+ - 不引入任何 token/密钥到仓库
43
+ <!-- AIWS_MANAGED_END:opencode:ws-req-change -->
44
+
45
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,21 @@
1
+ ---
2
+ description: 合同同步:把 REQUIREMENTS FlowSpec 同步到 requirements-issues.csv
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-req-contract-sync -->
5
+ # ws req contract sync
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 用途:从 `REQUIREMENTS.md` 的 FlowSpec 补齐 `requirements/requirements-issues.csv`(只生成骨架,不猜测完成状态)。
10
+
11
+ 执行(在 workspace 根目录):
12
+ - `python3 tools/requirements_contract_sync.py --workspace .`
13
+
14
+ 输出要求:
15
+ - 说明新增/更新了多少条
16
+ - 明确下一步:手工补齐 CRUD/Inputs/Outputs/Business_Logic/Tests,并将可开工条目标为 `Spec_Status=READY`
17
+
18
+ 下一步建议:`/ws-req-contract-validate`
19
+ <!-- AIWS_MANAGED_END:opencode:ws-req-contract-sync -->
20
+
21
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,16 @@
1
+ ---
2
+ description: 合同校验:校验 requirements-issues.csv 字段完整性
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-req-contract-validate -->
5
+ # ws req contract validate
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 执行(失败则修正 CSV 后重试):
10
+ - `python3 tools/requirements_contract.py validate`
11
+
12
+ 输出要求:
13
+ - 若失败:列出前 20 条缺失字段(Req_ID + field),并给出最小补齐建议
14
+ <!-- AIWS_MANAGED_END:opencode:ws-req-contract-validate -->
15
+
16
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,23 @@
1
+ ---
2
+ description: Flow 同步:从 REQUIREMENTS 生成 api-flow 与场景执行合同
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-req-flow-sync -->
5
+ # ws req flow sync
6
+
7
+ 用中文输出;命令与路径保持原样不翻译。
8
+
9
+ 目标:基于 `REQUIREMENTS.md` 的 FlowSpec 生成:
10
+ - `docs/api-flow.mmd`(简短逻辑图,Mermaid)
11
+ - `issues/server-scenario-issues.csv`(场景执行合同:TODO/DONE/BLOCKED)
12
+
13
+ 执行(在 workspace 根目录):
14
+ `python3 tools/requirements_flow_gen.py --workspace .`
15
+
16
+ 若缺少工具 `tools/requirements_flow_gen.py`:提示用户先运行 `npx @aipper/aiws init .`(默认会安装 optional tools)。
17
+
18
+ 输出要求:只打印生成的文件路径与下一步命令:
19
+ - 查看逻辑图:`cat docs/api-flow.mmd`
20
+ - 查看场景合同:`cat issues/server-scenario-issues.csv`
21
+ <!-- AIWS_MANAGED_END:opencode:ws-req-flow-sync -->
22
+
23
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: 需求评审:对 REQUIREMENTS 做整体 QA(不改文件)
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-req-review -->
5
+ # ws req review
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:在不修改任何文件的前提下,对 `REQUIREMENTS.md` 做一次整体 QA,输出缺口/冲突/风险,减少实现漂移。
10
+
11
+ 执行步骤(强制):
12
+ 1) 定位项目根目录:`git rev-parse --show-toplevel`(失败则停止并让用户确认根目录)。
13
+ 2) 读取(存在则必须读取;缺失则明确列出,不要臆测):
14
+ - `AI_PROJECT.md`
15
+ - `REQUIREMENTS.md`
16
+ - `AI_WORKSPACE.md`
17
+ - `requirements/CHANGELOG.md`(若存在)
18
+ - `requirements/requirements-issues.csv`(若存在)
19
+ 3) 输出固定结构的报告:
20
+
21
+ ## Requirements QA
22
+ - 结论:是否可进入实现(是/否/有条件)
23
+ - 漂移风险:最容易导致不一致的点
24
+ - 可验收性缺口:缺少输入/输出/错误码/边界/示例的条目
25
+ - 完整性:Non-goals/兼容性/鉴权/重试/并发/观测性/性能
26
+ - 一致性:与 `AI_PROJECT.md` 约束冲突点
27
+ - 可测试性与证据:最小验证命令 + 期望结果 + 证据路径
28
+ - 风险清单:3–8 条
29
+ - 需要澄清的问题:5–12 个(按优先级)
30
+
31
+ 4) 最后询问用户:是否进入需求落盘流程 `/ws-req-change`?(Y/N)
32
+
33
+ 安全:不打印 `secrets/test-accounts.json`。
34
+ <!-- AIWS_MANAGED_END:opencode:ws-req-review -->
35
+
36
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: 评审:提交前审计改动并落盘证据
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-review -->
5
+ # ws review
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:在提交/交付前审计当前改动,对照真值文件检查是否越界,并把审计证据优先落盘到 `changes/<change-id>/review/`(若无法确定 `change-id` 再回退 `.agentdocs/tmp/review/`)。
10
+
11
+ 步骤(建议):
12
+ 1) 先运行 `/ws-preflight`。
13
+ - 若检测到 `.opencode/oh-my-opencode.json` 或当前会话明确可用 `oracle` / `explore` / `librarian`:优先按 `packages/spec/docs/opencode-omo-adapter.md` 借用这些 agent。
14
+ - 独立审查优先 `@oracle`;diff 影响面优先 `@explore`;规范/文档上下文优先 `@librarian`。
15
+ 2) 基于 `git status` / `git diff`(以及你实际运行过的测试结果),对照 `AI_PROJECT.md` 与 `REQUIREMENTS.md` 检查:
16
+ - 是否存在越界目录改动/危险操作
17
+ - 是否有可复现验证命令与证据
18
+ - 是否维护了 `changes/<change-id>/` 或相关 `issues/*.csv`
19
+ 3) 将审计落盘到(目录不存在则创建):
20
+ - 默认:`changes/<change-id>/review/opencode-review.md`
21
+ - 回退:`.agentdocs/tmp/review/opencode-review.md`(仅在无法确定 `change-id` 时使用)
22
+ 4) 回复中输出:
23
+ - `证据(Evidence):` 证据文件路径
24
+ - `主要风险(Top risks):` 3–8 条(高→低)
25
+ - `下一步(Next):` 最小修复清单 + 最小验证命令
26
+ 5) 若 oMo 不可用:回退为当前 agent 本地 review,不阻断流程。
27
+
28
+ 安全:
29
+ - 不打印 secrets。
30
+ - 不执行破坏性命令。
31
+ <!-- AIWS_MANAGED_END:opencode:ws-review -->
32
+
33
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: 规则:把口述规则整理并写入 AI_PROJECT.md 托管段
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-rule -->
5
+ # ws rule
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:把用户口述的“项目特有规则”整理成可执行条款,并写入 `AI_PROJECT.md` 的 `AI_PROJECT_RULES_BEGIN/END` 段(托管块外内容会被保留)。
10
+
11
+ 安全规则(强制):
12
+ - 不打印/不写入 secrets(token、密钥、内网地址、账号密码)。
13
+ - 不执行破坏性命令。
14
+
15
+ 工作流:
16
+ 1) 先运行 `/ws-preflight`;若缺失 `AI_PROJECT.md`:提示用户先 `/ws-migrate` 或运行 `npx @aipper/aiws init .`。
17
+ 2) 写入前创建备份(必须):
18
+ `ts="$(date +%Y%m%d-%H%M%S)"; mkdir -p .aiws/backups/manual; cp -a AI_PROJECT.md .aiws/backups/manual/AI_PROJECT.md.bak.${ts}`
19
+ 3) 先输出“将写入的规则清单”(3–12 条),并要求用户回复 `CONFIRM` 后再落盘。
20
+ 4) 用户确认后,**仅更新** BEGIN/END 段内内容(合并去重;写成可检查条款:目录白名单/必须验证命令/禁止项/产物要求)。
21
+ 5) 输出必须包含:
22
+ - 更新了哪些文件(路径)
23
+ - 回滚方式(恢复备份文件)
24
+ - 下一步建议:`aiws validate .`
25
+ <!-- AIWS_MANAGED_END:opencode:ws-rule -->
26
+
27
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: 规范审查:requirements / plan / evidence / gate 完整性
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-spec-review -->
5
+ # ws spec review
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:审查 requirements 归因、plan/change 绑定、evidence 与 workflow gate 完整性。
10
+
11
+ 步骤(建议):
12
+ 1) 先运行 `/ws-preflight`。
13
+ - 若检测到 `.opencode/oh-my-opencode.json` 或当前会话明确可用 `oracle` / `librarian`:优先按 `packages/spec/docs/opencode-omo-adapter.md` 借用这些 agent。
14
+ - requirements / gate / evidence 审查优先 `@oracle`;规范与文档真值补充优先 `@librarian`。
15
+ 2) 对照 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md` 检查:
16
+ - 当前改动是否能归因到 `Req_ID` / `Problem_ID`
17
+ - `plan/...`、`proposal.md`、`tasks.md`、`evidence/` 是否保持一致
18
+ - 是否存在越界改动、危险操作或缺失 gate
19
+ 3) 将结论落盘到:
20
+ - 默认:`changes/<change-id>/review/spec-review.md`
21
+ - 回退:`.agentdocs/tmp/review/spec-review.md`
22
+ 4) 输出:
23
+ - `证据(Evidence):`
24
+ - `阻断项(Blockers):`
25
+ - `警告(Warnings):`
26
+ - `下一步(Next):`
27
+ 5) 若 oMo 不可用:回退为当前 agent 本地 spec review。
28
+ <!-- AIWS_MANAGED_END:opencode:ws-spec-review -->
29
+
30
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,57 @@
1
+ ---
2
+ description: 子模块分支对齐(写入 .gitmodules 的 submodule.<name>.branch)
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-submodule-setup -->
5
+ # ws submodule setup
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:为每个 submodule 写入 `.gitmodules` 的 `submodule.<name>.branch`(团队真值),让 `/ws-pull`、`/ws-finish` 能确定性地减少 detached 与人为差异;并使 `aiws validate` 的 submodule 分支门禁通过。
10
+
11
+ 约束:
12
+ - 不自动提交、不自动 push(必须先输出 diff 并让用户确认)
13
+ - 不做破坏性命令
14
+
15
+ 步骤(建议):
16
+ 1) 确认工作区干净:
17
+ ```bash
18
+ git status --porcelain
19
+ ```
20
+ 非空则停止。
21
+
22
+ 2) 列出 submodules:
23
+ ```bash
24
+ test -f .gitmodules || { echo "no .gitmodules"; exit 0; }
25
+ git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$'
26
+ ```
27
+
28
+ 3) 对每个 submodule 让用户选择目标分支(推荐具体分支名;可选 `.` 表示跟随 superproject 分支名):
29
+ ```bash
30
+ while read -r key sub_path; do
31
+ name="${key#submodule.}"; name="${name%.path}"
32
+ echo "== submodule: ${name} path=${sub_path} =="
33
+ echo "[current] branch=$(git config --file .gitmodules --get submodule.${name}.branch || true)"
34
+ echo "[origin] HEAD=$(git -C \"${sub_path}\" symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null || true)"
35
+ done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$')
36
+ ```
37
+
38
+ 4) 写入分支配置:
39
+ ```bash
40
+ git submodule set-branch --branch <branch-or-dot> <sub_path>
41
+ ```
42
+
43
+ 5) 输出 diff 并让用户确认是否提交:
44
+ ```bash
45
+ git diff -- .gitmodules
46
+ git status --porcelain
47
+ ```
48
+
49
+ 6) 用户确认后提交:
50
+ ```bash
51
+ git add .gitmodules
52
+ git commit -m "chore(submodule): set tracking branches"
53
+ ```
54
+ <!-- AIWS_MANAGED_END:opencode:ws-submodule-setup -->
55
+
56
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
57
+
@@ -0,0 +1,27 @@
1
+ ---
2
+ description: 完成前验证:finish / handoff 前检查双审查与 validate/evidence
3
+ ---
4
+ <!-- AIWS_MANAGED_BEGIN:opencode:ws-verify-before-complete -->
5
+ # ws verify before complete
6
+
7
+ 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
+
9
+ 目标:在 `/ws-finish` 或 `/ws-handoff` 前检查双审查、validate stamp 与 evidence 是否齐全。
10
+
11
+ 步骤(建议):
12
+ 1) 检查以下最小 gate:
13
+ - `changes/<change-id>/review/spec-review.md`
14
+ - `changes/<change-id>/review/quality-review.md`
15
+ - `.agentdocs/tmp/aiws-validate/*.json`
16
+ 2) 若存在 `changes/<change-id>/evidence/`,检查 review / validate / collaboration summary 是否已收敛。
17
+ 3) 将结果落盘到:
18
+ - 默认:`changes/<change-id>/evidence/verify-before-complete.md`
19
+ - 回退:`.agentdocs/tmp/review/verify-before-complete.md`
20
+ 4) 输出:
21
+ - `证据(Evidence):`
22
+ - `结论(Result): pass|fail`
23
+ - `缺失项(Missing):`
24
+ - `下一步(Next):`
25
+ <!-- AIWS_MANAGED_END:opencode:ws-verify-before-complete -->
26
+
27
+ 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -0,0 +1,17 @@
1
+ {
2
+ "agents": {
3
+ "planner-sisyphus": {
4
+ "enabled": true,
5
+ "replace_plan": false
6
+ },
7
+ "librarian": {
8
+ "enabled": true
9
+ },
10
+ "explore": {
11
+ "enabled": true
12
+ },
13
+ "oracle": {
14
+ "enabled": true
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: p-aiws-change-archive
3
+ description: 私有:归档变更工件(会先做严格校验并生成 handoff.md)
4
+ ---
5
+
6
+ 目标:
7
+ - 将 `changes/<change-id>/` 归档到 `changes/archive/<YYYY-MM-DD>/...`
8
+
9
+ 执行(在仓库根目录):
10
+ ```bash
11
+ change_id="<change-id>"
12
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
13
+ ./node_modules/.bin/aiws change archive "$change_id"
14
+ elif command -v aiws >/dev/null 2>&1; then
15
+ aiws change archive "$change_id"
16
+ else
17
+ npx @aipper/aiws change archive "$change_id"
18
+ fi
19
+ ```
20
+
21
+ 说明:
22
+ - `archive` 默认会先跑严格校验并要求 tasks 全部勾选
23
+ - `--force` 会绕过部分门禁(不推荐)
24
+ - 归档后会生成交接文档:`changes/archive/<date>-<change-id>/handoff.md`
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: p-aiws-change-finish
3
+ description: 私有:安全合并 change/<change-id> 回目标分支(默认 fast-forward)
4
+ ---
5
+
6
+ 目标:
7
+ - 将 `change/<change-id>` fast-forward 合并回目标分支,减少手输分支名导致的错误
8
+
9
+ 执行(在目标分支所在 worktree 的仓库根目录):
10
+ ```bash
11
+ change_id="<change-id>"
12
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
13
+ ./node_modules/.bin/aiws change finish "$change_id"
14
+ elif command -v aiws >/dev/null 2>&1; then
15
+ aiws change finish "$change_id"
16
+ else
17
+ npx @aipper/aiws change finish "$change_id"
18
+ fi
19
+ ```
20
+
21
+ 说明:
22
+ - 默认等价于:`git merge --ff-only change/<change-id>`
23
+ - 若你当前就在 `change/<change-id>` 分支上,`finish` 会尝试读取 `changes/<change-id>/.ws-change.json` 的 `base_branch` 作为目标分支
24
+ - 若无法 fast-forward:先在 change 分支(或对应 worktree)里 `git rebase <target-branch>`,再重试 `aiws change finish`
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: p-aiws-change-list
3
+ description: 私有:列出 changes 工件(只读)
4
+ ---
5
+
6
+ 目标:
7
+ - 列出当前仓库的变更工件与状态
8
+
9
+ 执行(在仓库根目录):
10
+ ```bash
11
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
12
+ ./node_modules/.bin/aiws change list
13
+ elif command -v aiws >/dev/null 2>&1; then
14
+ aiws change list
15
+ else
16
+ npx @aipper/aiws change list
17
+ fi
18
+ ```
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: p-aiws-change-new
3
+ description: 私有:创建 changes/<change-id> 工件
4
+ ---
5
+
6
+ 目标:
7
+ - 创建 `changes/<change-id>/` 工件目录与基础文件(proposal/tasks/可选 design)
8
+
9
+ 要求:
10
+ - `change-id` 必须是 kebab-case:`^[a-z0-9]+(-[a-z0-9]+)*$`
11
+
12
+ 执行(在仓库根目录):
13
+ ```bash
14
+ change_id="<change-id>"
15
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
16
+ ./node_modules/.bin/aiws change new "$change_id"
17
+ elif command -v aiws >/dev/null 2>&1; then
18
+ aiws change new "$change_id"
19
+ else
20
+ npx @aipper/aiws change new "$change_id"
21
+ fi
22
+ ```
23
+
24
+ 可选参数:
25
+ - `--title <title>`:写入标题
26
+ - `--no-design`:不生成 design.md
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: p-aiws-change-next
3
+ description: 私有:给出下一步建议(只读)
4
+ ---
5
+
6
+ 目标:
7
+ - 基于当前仓库与 changes 工件状态,输出最小下一步建议
8
+
9
+ 执行(在仓库根目录):
10
+ ```bash
11
+ change_id="<change-id>"
12
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
13
+ ./node_modules/.bin/aiws change next "$change_id"
14
+ elif command -v aiws >/dev/null 2>&1; then
15
+ aiws change next "$change_id"
16
+ else
17
+ npx @aipper/aiws change next "$change_id"
18
+ fi
19
+ ```
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: p-aiws-change-start
3
+ description: 私有:切分支并初始化变更工件(可选安装 hooks)
4
+ ---
5
+
6
+ 目标:
7
+ - 切到分支 `change/<change-id>` 并初始化 `changes/<change-id>/` 工件
8
+ - 若检测到 `.gitmodules`(git submodules),默认优先使用 `--worktree`(失败则回退为 `--no-switch`),避免切走 superproject 分支导致 submodule 状态混乱
9
+
10
+ 要求:
11
+ - 需要 git 仓库;若不是 git 仓库先 `git init`
12
+
13
+ 执行(在仓库根目录):
14
+ ```bash
15
+ change_id="<change-id>"
16
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
17
+ ./node_modules/.bin/aiws change start "$change_id"
18
+ elif command -v aiws >/dev/null 2>&1; then
19
+ aiws change start "$change_id"
20
+ else
21
+ npx @aipper/aiws change start "$change_id"
22
+ fi
23
+ ```
24
+
25
+ 可选参数:
26
+ - `--hooks`:同时执行 `aiws hooks install .`
27
+ - `--title <title>`:写入标题
28
+ - `--no-design`:不生成 design.md
29
+ - `--switch`:显式允许切换 superproject 分支(仅在存在 `.gitmodules` 时有意义)
30
+ - `--no-switch`:不切换当前分支(仅确保 `change/<change-id>` 分支存在并初始化工件);适用于 superproject + submodule 场景
31
+ - `--worktree`:用 `git worktree` 创建独立工作区并在其中 checkout `change/<change-id>`(推荐用于 superproject + submodule)
32
+ - `--worktree-dir <path>`:覆盖 worktree 目录
33
+ - `--submodules`:在 worktree 内执行 `git submodule update --init --recursive`
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: p-aiws-change-status
3
+ description: 私有:查看单个变更工件状态(只读)
4
+ ---
5
+
6
+ 目标:
7
+ - 查看指定 `change-id` 的工件状态与下一步建议
8
+
9
+ 执行(在仓库根目录):
10
+ ```bash
11
+ change_id="<change-id>"
12
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
13
+ ./node_modules/.bin/aiws change status "$change_id"
14
+ elif command -v aiws >/dev/null 2>&1; then
15
+ aiws change status "$change_id"
16
+ else
17
+ npx @aipper/aiws change status "$change_id"
18
+ fi
19
+ ```
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: p-aiws-change-sync
3
+ description: 私有:同步真值基线到 changes/<change-id>(写入 .ws-change.json)
4
+ ---
5
+
6
+ 目标:
7
+ - 将当前真值文件(`AI_PROJECT.md` / `AI_WORKSPACE.md` / `REQUIREMENTS.md`)的 hash 快照同步到 `changes/<change-id>/.ws-change.json`
8
+
9
+ 执行(在仓库根目录):
10
+ ```bash
11
+ change_id="<change-id>"
12
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
13
+ ./node_modules/.bin/aiws change sync "$change_id"
14
+ elif command -v aiws >/dev/null 2>&1; then
15
+ aiws change sync "$change_id"
16
+ else
17
+ npx @aipper/aiws change sync "$change_id"
18
+ fi
19
+ ```
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: p-aiws-change-templates-init
3
+ description: 私有:在仓库内初始化 change templates(写入 changes/templates)
4
+ ---
5
+
6
+ 目标:
7
+ - 初始化 `changes/templates/`(用于在仓库内自定义 proposal/tasks/design 模板)
8
+
9
+ 执行(在仓库根目录):
10
+ ```bash
11
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
12
+ ./node_modules/.bin/aiws change templates init
13
+ elif command -v aiws >/dev/null 2>&1; then
14
+ aiws change templates init
15
+ else
16
+ npx @aipper/aiws change templates init
17
+ fi
18
+ ```
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: p-aiws-change-templates-which
3
+ description: 私有:查看当前 change templates 来源(只读)
4
+ ---
5
+
6
+ 目标:
7
+ - 输出当前仓库 change templates 的解析来源与路径(用于排查模板来自哪里)
8
+
9
+ 执行(在仓库根目录):
10
+ ```bash
11
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
12
+ ./node_modules/.bin/aiws change templates which
13
+ elif command -v aiws >/dev/null 2>&1; then
14
+ aiws change templates which
15
+ else
16
+ npx @aipper/aiws change templates which
17
+ fi
18
+ ```
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: p-aiws-change-validate
3
+ description: 私有:校验 changes 工件(可 strict)
4
+ ---
5
+
6
+ 目标:
7
+ - 校验 `changes/<change-id>/` 工件完整性、归因与 WS:TODO(用于 hooks/CI)
8
+
9
+ 执行(在仓库根目录):
10
+ ```bash
11
+ change_id="<change-id>"
12
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
13
+ ./node_modules/.bin/aiws change validate "$change_id" --strict
14
+ elif command -v aiws >/dev/null 2>&1; then
15
+ aiws change validate "$change_id" --strict
16
+ else
17
+ npx @aipper/aiws change validate "$change_id" --strict
18
+ fi
19
+ ```
20
+
21
+ 说明:
22
+ - `--strict` 会把 `WS:TODO`/缺少归因视为错误,并启用计划质量门(章节完整、步骤粒度、验证命令与预期)
23
+ - 紧急情况下可用 `--allow-truth-drift`(不推荐)
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: p-aiws-hooks-install
3
+ description: 私有:启用 git hooks 门禁(core.hooksPath=.githooks)
4
+ ---
5
+
6
+ 目标:
7
+ - 为当前 git 仓库启用 aiws 门禁 hooks(`git commit`/`git push` 自动跑 `aiws validate .`)
8
+
9
+ 执行(在仓库根目录):
10
+ ```bash
11
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
12
+ ./node_modules/.bin/aiws hooks install .
13
+ elif command -v aiws >/dev/null 2>&1; then
14
+ aiws hooks install .
15
+ else
16
+ npx @aipper/aiws hooks install .
17
+ fi
18
+ ```
19
+
20
+ 验证(可选):
21
+ ```bash
22
+ git config core.hooksPath
23
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
24
+ ./node_modules/.bin/aiws hooks status .
25
+ elif command -v aiws >/dev/null 2>&1; then
26
+ aiws hooks status .
27
+ else
28
+ npx @aipper/aiws hooks status .
29
+ fi
30
+ ```
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: p-aiws-hooks-status
3
+ description: 私有:查看当前仓库 hooks 状态(只读)
4
+ ---
5
+
6
+ 目标:
7
+ - 输出当前仓库 hooks 状态(不修改文件)
8
+
9
+ 执行(在仓库根目录):
10
+ ```bash
11
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
12
+ ./node_modules/.bin/aiws hooks status .
13
+ elif command -v aiws >/dev/null 2>&1; then
14
+ aiws hooks status .
15
+ else
16
+ npx @aipper/aiws hooks status .
17
+ fi
18
+ ```