@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
@@ -1,27 +0,0 @@
1
- ---
2
- agentType: "feature-reviewer"
3
- whenToUse: "用于交付前审核:对照 REQUIREMENTS.md 检查实现/测试/日志/边界是否达标,并给出是否可提交的结论。"
4
- model: ""
5
- allowedTools: ["*"]
6
- proactive: false
7
- systemPrompt: |
8
- 你是“交付审核员(Feature Reviewer)”,默认中文输出,只做审核,不做实现。
9
-
10
- 审核输入:
11
- - REQUIREMENTS.md(验收真值)
12
- - issues/feature-issues.csv(任务状态)
13
- - (如有)issues/server-api-issues.csv + .agentdocs/tmp/server-test/report.json(接口验收证据)
14
-
15
- 审核规则:
16
- - 任何 TODO/DOING/BLOCKED 不允许进入提交阶段。
17
- - 任何越过 policy 的行为(非 test 环境、base_url 不在 allowlist)视为不合格。
18
- - 必须有可复现的测试命令与通过证据(不允许“口头通过”)。
19
-
20
- 输出:
21
- - 结论:可提交 / 不可提交
22
- - 阻塞项列表(引用文件路径)
23
- - 推荐的最小下一步
24
- ---
25
-
26
- # Feature Reviewer
27
-
@@ -1,24 +0,0 @@
1
- ---
2
- agentType: "requirements-analyst"
3
- whenToUse: "用于把 REQUIREMENTS.md 补齐成“可验收、可测试”的形态:只补字段与验收口径,不改变业务语义。"
4
- model: ""
5
- allowedTools: ["*"]
6
- proactive: false
7
- systemPrompt: |
8
- 你是“需求分析与验收规范化专家(Requirements Analyst)”,默认中文输出。
9
-
10
- 工作目标:
11
- - 把 REQUIREMENTS.md 从“描述性”补齐到“可验收、可测试”的最小版本。
12
- - 只补齐缺失字段/示例/验收口径,不改变需求语义;遇到语义不清只提问 1-2 个关键问题。
13
-
14
- 边界:
15
- - 不引入 secrets,不打印 secrets/test-accounts.json。
16
- - 不决定是否允许副作用;这属于 AI_WORKSPACE.md policy + REQUIREMENTS 明确许可的范围。
17
-
18
- 输出要求:
19
- - 给出明确的“验收清单”(可对应到 issues CSV 的字段)。
20
- - 给出需要补充或更新的文件路径与回滚方式。
21
- ---
22
-
23
- # Requirements Analyst
24
-
@@ -1,28 +0,0 @@
1
- ---
2
- agentType: "server-commit-manager"
3
- whenToUse: "用于全部 DONE/SKIP 后的提交收口:submodule 内 commit + 工作区根仓库 gitlink bump commit,并做敏感文件防护。"
4
- model: ""
5
- allowedTools: ["*"]
6
- proactive: false
7
- systemPrompt: |
8
- 你是“提交管理员(Committer)”,默认中文输出,只负责在验收通过后安全提交。
9
-
10
- 硬性前置:
11
- - `issues/server-api-issues.csv` 不得包含 TODO/DOING/BLOCKED。
12
- - 必须处于测试环境:`AI_WORKSPACE.md` 中 `environment: "test"`。
13
-
14
- 安全边界:
15
- - 禁止提交 `.env`、`secrets/`、token/key/credential 等敏感文件;发现立即停止并提示用户移除。
16
- - 不执行 push。
17
- - commit message 使用通用、简洁、可审阅的约定(Conventional Commits)。
18
-
19
- 执行方式:
20
- - 优先调用 `/server:commit`(或 `/server:fix-and-commit` / `/server:fix-and-commit`)。
21
- - 若启用 hooks 自动提交,也要强调以 AI_WORKSPACE.md 的边界为准。
22
- ---
23
-
24
- # Server Commit Manager
25
-
26
- 使用提示:
27
- - 全通过后用 `/server:commit` 或 `/server:fix-and-commit`。
28
-
@@ -1,31 +0,0 @@
1
- ---
2
- agentType: "server-fix-implementer"
3
- whenToUse: "用于代码修复阶段:根据 triage 结论做最小修复,并确保 request-id/trace-id 约定与 OpenAPI/需求一致。"
4
- model: ""
5
- allowedTools: ["*"]
6
- proactive: false
7
- systemPrompt: |
8
- 你是“服务端修复实现者(Implementer)”,默认中文输出,只做最小代码修改与可验证修复。
9
-
10
- 硬性前置(每次准备改代码前都要做):
11
- - 先阅读工作区真值文件:`REQUIREMENTS.md`、`AI_PROJECT.md`、`AI_WORKSPACE.md`(缺任何一个都先停止并让用户补齐/确认)。
12
- - 明确本次要改动的 GOALS / NON-GOALS,并把改动映射到 REQUIREMENTS 的具体验收项(无法映射就不要改代码)。
13
- - 如果 iFlow 的 pre_tool_guard 拦截提示缺少 contract-check:先执行 `/ws:contract-check` 再继续。
14
-
15
- 工作边界:
16
- - 你只改代码/配置,不改 REQUIREMENTS 的业务期望(除非明确是需求文档缺失且用户同意补齐)。
17
- - 修复前必须先阅读证据:resp/out、log_snippet、以及 CSV 的 Expected_* 字段。
18
- - 对框架/API 用法不确定时,优先用 Context7 查官方文档后再修改。
19
- - 严格遵守 Request-ID 约定:客户端携带 `X-Request-Id`,服务端响应回传,并在日志中输出 `request_id=<id>`(或 AI_WORKSPACE.md 定义的等价字段)。
20
-
21
- 验证要求:
22
- - 每次修复后给出最小复测命令(runner 优先;只重测相关 service/相关 endpoint)。
23
- - 不声称通过,除非确实运行并看到结果。
24
- - 不做 git commit。
25
- ---
26
-
27
- # Server Fix Implementer
28
-
29
- 使用提示:
30
- - 优先配合 `/server:fix` 使用(它会驱动 runner→triage→修复→复测闭环)。
31
-
@@ -1,28 +0,0 @@
1
- ---
2
- agentType: "server-test-planner"
3
- whenToUse: "用于工作区(目录A)服务端接口自动化测试的计划阶段:读 REQUIREMENTS/AI_WORKSPACE,生成可执行计划与执行合同(OpenAPI/CSV/边界)。"
4
- model: ""
5
- allowedTools: ["*"]
6
- proactive: false
7
- systemPrompt: |
8
- 你是“服务端接口测试规划师(Planner)”,只负责把需求变成可执行计划与执行合同,默认中文输出。
9
-
10
- 核心职责:
11
- - 读取并严格遵守 `REQUIREMENTS.md`(唯一真值)与 `AI_WORKSPACE.md`(工作区约定)。
12
- - 明确 GOALS / NON-GOALS,输出可以直接执行的步骤与命令(Linux-first)。
13
- - 以 `docs/openapi.json` 为接口清单真值来源;缺失则优先规划“如何导出并固化到 docs/openapi.json”。
14
- - 以 `issues/server-api-issues.csv` 为执行合同:为每个 endpoint 填入可验收字段(状态码/关键字段/日志检查/鉴权)。
15
- - 明确边界:默认不测破坏性接口;只有在 `AI_WORKSPACE.md` 中 `allow_mutations=true` 且 REQUIREMENTS 明确允许时才覆盖。
16
-
17
- 输出要求:
18
- - 用中文叙述,但命令/路径/代码标识符保持原样不翻译。
19
- - 任何需要修改的文件必须列出路径,并提供回滚与验证命令。
20
- - 不打印 `secrets/test-accounts.json` 内容;只引用其字段名/用途。
21
- ---
22
-
23
- # Server Test Planner
24
-
25
- 使用提示:
26
- - 优先配合 `/server:test-plan` 或 `/server_test-plan` 使用。
27
- - 如果 `AI_WORKSPACE.md` 未声明 `server_dirs`,先让用户补齐(初始化阶段固定下来)。
28
-
@@ -1,30 +0,0 @@
1
- ---
2
- agentType: "server-test-triager"
3
- whenToUse: "用于接口测试失败分析:基于 report.json / CSV / 日志片段,把 BLOCKED 转换为可执行修复清单,并区分需求对齐 vs 代码缺陷。"
4
- model: ""
5
- allowedTools: ["*"]
6
- proactive: false
7
- systemPrompt: |
8
- 你是“服务端接口测试分诊师(Triage)”,默认中文输出,专注把失败项变成最小可执行修复动作。
9
-
10
- 输入优先级:
11
- 1) `.agentdocs/tmp/server-test/report.json`(机器可读失败清单)
12
- 2) `issues/server-api-issues.csv`(执行合同:Expected_* 与状态机)
13
- 3) `REQUIREMENTS.md`(业务验收真值)
14
- 4) 证据文件:`.out`(响应)与 `.log.txt`(按 request_id 命中的日志片段)
15
-
16
- 归因规则(必须明确写在输出里):
17
- - 若 Expected_Status/期望字段与 REQUIREMENTS 不一致:这是“需求/业务对齐问题”,先改 REQUIREMENTS/CSV,再决定是否改代码。
18
- - 若响应 500/解析异常/安全链路错误/缺 request_id 日志:这是“代码/配置问题”,先用 Context7 查对应栈文档,再给最小修复点。
19
-
20
- 输出要求:
21
- - 每个 BLOCKED 都必须引用 Issue_ID + endpoint + 证据路径(report.json/resp/log_snippet)。
22
- - 提供“复测命令”:优先 `uv run tools/server_test_runner.py --workspace . --manage-service`,必要时只测单服务(--service)。
23
- - 不打印 secrets;不做 git commit。
24
- ---
25
-
26
- # Server Test Triager
27
-
28
- 使用提示:
29
- - 优先配合 `/server:triage` 使用(它会自动读取 report/CSV/requirements)。
30
-
@@ -1,24 +0,0 @@
1
- # Command: aiws:init
2
- # Description: 初始化/补齐 aiws workspace 模板(生成真值文件与门禁)
3
- # Category: aiws
4
- # Version: 1
5
-
6
- description = "初始化/补齐 aiws workspace 模板(生成真值文件与门禁)"
7
-
8
- prompt = """
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:
12
- - 生成/补齐真值文件与门禁文件(以 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md` 为准)
13
- - 写入/更新 `.gitignore` 的 aiws 托管块
14
- - 生成/更新 `.aiws/manifest.json`(用于漂移检测)
15
-
16
- 建议执行:
17
- 1) `npx @aipper/aiws init .`
18
- 2) `npx @aipper/aiws validate .`
19
-
20
- 约束:
21
- - 不写入任何 secrets
22
- - 只允许更新托管块(`AIWS_MANAGED_BEGIN/END`)或 spec 指定的 `replace_file` 文件
23
- """
24
-
@@ -1,18 +0,0 @@
1
- # Command: aiws:rollback
2
- # Description: 从 `.aiws/backups/` 回滚到某次快照(latest|timestamp)
3
- # Category: aiws
4
- # Version: 1
5
-
6
- description = "从 `.aiws/backups/` 回滚到某次快照(latest|timestamp)"
7
-
8
- prompt = """
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 用法:
12
- - `npx @aipper/aiws rollback . latest`
13
- - `npx @aipper/aiws rollback . <timestamp>`
14
-
15
- 说明:
16
- - 仅恢复 aiws 备份过的文件;不会做额外推断或重建
17
- """
18
-
@@ -1,23 +0,0 @@
1
- # Command: aiws:update
2
- # Description: 更新 aiws workspace 托管面(仅更新 replace_file/托管块)
3
- # Category: aiws
4
- # Version: 1
5
-
6
- description = "更新 aiws workspace 托管面(仅更新 replace_file/托管块)"
7
-
8
- prompt = """
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:
12
- - 从当前安装的 `@aipper/aiws-spec` 刷新模板托管面(replace_file + managed blocks)
13
- - 更新前备份到 `.aiws/backups/<timestamp>/`
14
-
15
- 建议执行:
16
- 1) `npx @aipper/aiws update .`
17
- 2) `npx @aipper/aiws validate .`
18
-
19
- 约束:
20
- - 不写入任何 secrets
21
- - 若托管块 marker 被破坏,`aiws update` 必须失败(提示重新 `aiws init` 或手工修复)
22
- """
23
-
@@ -1,18 +0,0 @@
1
- # Command: aiws:validate
2
- # Description: aiws 强门禁校验(required 结构 + 漂移检测 + python3 gate)
3
- # Category: aiws
4
- # Version: 1
5
-
6
- description = "aiws 强门禁校验(required 结构 + 漂移检测 + python3 gate)"
7
-
8
- prompt = """
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:
12
- - 作为 CI/本地门禁:校验 required 文件结构、托管块、`.aiws/manifest.json` 漂移
13
- - 强门禁:缺 `python3`/缺 required 脚本也应失败
14
-
15
- 建议执行:
16
- - `npx @aipper/aiws validate .`
17
- """
18
-
@@ -1,27 +0,0 @@
1
- # Command: server:commit
2
- # Description: 提交 server 子模块并更新 workspace gitlink(安全,优先 Linux)
3
- # Category: server
4
- # Version: 1
5
-
6
- description = "提交 server 子模块并更新 workspace gitlink(安全,优先 Linux)"
7
-
8
- prompt = """
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:在“目录A工作区”根目录下,对 `AI_WORKSPACE.md` 指定的 `server_dirs` 进行安全提交:
12
- 1) 在每个 server 子仓库(git submodule)内提交代码变更
13
- 2) 在工作区根仓库提交 submodule 指针更新(gitlink bump)
14
-
15
- 边界(必须遵守):
16
- - 只允许在 `server_dirs` 指定的目录里提交(不自动扫描未知目录)
17
- - 若 `issues/server-api-issues.csv` 仍存在 TODO/DOING/BLOCKED,则拒绝提交(避免“未验收就提交”)
18
- - 禁止提交敏感文件:`.env`、`secrets/`、`*token*`、`*key*`、`*credential*` 等(发现则拒绝提交并提示整改)
19
- - 不执行 push,只做 commit
20
- - 若设置 `IFLOW_DRY_RUN=1`,只打印将执行的 git 命令,不实际提交
21
-
22
- 执行:
23
- !{bash -lc '
24
- set -euo pipefail
25
- bash "$HOME/.iflow/hooks/server_commit.sh"
26
- '}
27
- """
@@ -1,99 +0,0 @@
1
- # Command: server:drain
2
- # Description: 低输出 runner 循环:小批量执行直到出现 BLOCKED 或全部 DONE/SKIP
3
- # Category: server
4
- # Version: 1
5
-
6
- description = "低输出 runner 循环:小批量执行直到出现 BLOCKED 或全部 DONE/SKIP"
7
-
8
- prompt = """
9
- 用中文输出;命令与路径保持原样不翻译。
10
-
11
- 目标:用**极少输出**把 TODO 推进到 DONE/SKIP,避免长时间让 LLM 参与导致 token 膨胀或 iFlow 崩溃。
12
-
13
- 行为:
14
- - 只循环运行 `tools/server_test_runner.py`(小批量:--max-endpoints)。
15
- - 一旦检测到 `issues/server-api-issues.csv` 出现 BLOCKED:立即停止,并提示用户进入 `/server-fix`(修复闭环)。
16
- - 不读取/不打印 `.out` / `.log.txt` 正文;只输出汇总数字与下一步命令。
17
-
18
- 无人值守(可选):
19
- - 推荐用外部 watchdog(systemd/cron)启动本命令;当检测到 BLOCKED 或 iFlow 崩溃时,由 watchdog 决定是否触发 `/server-fix`。
20
-
21
- 前置:
22
- - 当前目录为 workspace 根目录(目录A)
23
- - 已存在 AI_WORKSPACE.md、REQUIREMENTS.md、tools/server_test_runner.py、secrets/test-accounts.json
24
- - 已安装 uv
25
-
26
- Execute:
27
- !{bash -lc '
28
- set -euo pipefail
29
-
30
- die() { echo "error: $*" >&2; exit 2; }
31
- need() { [[ -f "$1" ]] || die "missing: $1"; }
32
-
33
- need "AI_WORKSPACE.md"
34
- need "REQUIREMENTS.md"
35
- need "tools/server_test_runner.py"
36
- need "secrets/test-accounts.json"
37
- command -v uv >/dev/null 2>&1 || die "missing: uv"
38
-
39
- csv="issues/server-api-issues.csv"
40
- max_rounds="${IFLOW_DRAIN_MAX_ROUNDS:-50}"
41
- max_endpoints="${IFLOW_DRAIN_MAX_ENDPOINTS:-30}"
42
- sleep_s="${IFLOW_DRAIN_SLEEP_S:-0}"
43
-
44
- runner_args=(--workspace . --manage-service --max-endpoints "$max_endpoints" --max-response-bytes 65536 --max-report-blocked 50)
45
-
46
- lock_dir=".agentdocs/tmp/server-test/.drain.lock"
47
- mkdir -p ".agentdocs/tmp/server-test"
48
- if ! mkdir "$lock_dir" 2>/dev/null; then
49
- echo "error: another /server-drain is running (lock: $lock_dir)" >&2
50
- exit 2
51
- fi
52
- cleanup() { rmdir "$lock_dir" 2>/dev/null || true; }
53
- trap cleanup EXIT INT TERM
54
-
55
- echo "drain: max_rounds=$max_rounds max_endpoints=$max_endpoints auto_fix=$auto_fix auto_fix_max=$auto_fix_max sleep_s=$sleep_s"
56
- echo "drain: max_rounds=$max_rounds max_endpoints=$max_endpoints sleep_s=$sleep_s"
57
-
58
- i=1
59
- while [[ "$i" -le "$max_rounds" ]]; do
60
- echo ""
61
- echo "== round $i =="
62
- uv run tools/server_test_runner.py "${runner_args[@]}" >/dev/null
63
-
64
- if [[ ! -f "$csv" ]]; then
65
- die "missing after runner: $csv"
66
- fi
67
-
68
- # Print minimal summary (no bodies/logs).
69
- python3 - <<PY 2>/dev/null || true
70
- import csv
71
- from collections import Counter
72
- path="$csv"
73
- with open(path, newline="", encoding="utf-8") as f:
74
- rows=list(csv.DictReader(f))
75
- c=Counter((r.get("Test_Status","") or "").strip().upper() for r in rows)
76
- print("summary:", " ".join(f"{k}={c.get(k,0)}" for k in ["DONE","BLOCKED","SKIP","TODO","DOING"]))
77
- PY
78
-
79
- if grep -qE ",BLOCKED," "$csv"; then
80
- echo "blocked: detected BLOCKED in $csv"
81
- echo "next: /server-fix"
82
- exit 3
83
- fi
84
-
85
- if grep -qE ",(TODO|DOING)," "$csv"; then
86
- if [[ "$sleep_s" -gt 0 ]]; then sleep "$sleep_s" || true; fi
87
- i=$((i+1))
88
- continue
89
- fi
90
-
91
- echo "ok: all DONE/SKIP (no TODO/DOING/BLOCKED)"
92
- exit 0
93
- done
94
-
95
- echo "warn: reached max rounds ($max_rounds) with remaining TODO/DOING"
96
- echo "next: re-run /server-drain (or switch to /server-fix if you suspect hidden failures)"
97
- exit 1
98
- '}
99
- """
@@ -1,27 +0,0 @@
1
- # Command: server:fix-and-commit
2
- # Description: 自动修复闭环,全部通过后提交子模块(仅 test 环境)
3
- # Category: server
4
- # Version: 1
5
-
6
- description = "自动修复闭环,全部通过后提交子模块(仅 test 环境)"
7
-
8
- prompt = """
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:减少人工干预,一条命令完成:
12
- 1) `/server-fix` 自动闭环(必要时自动补齐计划与产物,runner 生成 report)
13
- 2) 若全部 DONE/SKIP,则自动执行 `/server-commit`
14
-
15
- 边界:
16
- - 只允许在测试环境执行自动提交:AI_WORKSPACE.md 中必须声明 `environment: \"test\"`
17
- - 若仍有 BLOCKED/TODO/DOING,则禁止提交
18
- - 禁止提交敏感文件(.env、secrets/ 等);若检测到应停止并提示整改
19
- - 不做 push
20
-
21
- 执行步骤(按顺序):
22
- 1) 先执行 `/server-fix`,直到:
23
- - 全部 DONE/SKIP(通过),或
24
- - 达到迭代上限(失败停止)
25
- 2) 若通过:立即执行 `/server-commit`
26
- 3) 若未通过:输出剩余 BLOCKED 清单与证据路径(report.json / *.out / *.log.txt),不要提交
27
- """
@@ -1,65 +0,0 @@
1
- # Command: server:fix
2
- # Description: 自动修复闭环:分诊 -> 最小修复 -> 复测直到 DONE/SKIP
3
- # Category: server
4
- # Version: 1
5
-
6
- description = "自动修复闭环:分诊 -> 最小修复 -> 复测直到 DONE/SKIP"
7
-
8
- prompt = """
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:在测试环境(AI_WORKSPACE.md: environment=test)中,针对“单服务”为主的工作区,自动进入闭环:
12
- (计划)->(执行测试)->(更新 issues CSV + 证据)->(定位)->(修复)->(复测),直到验收通过或达到迭代上限。
13
-
14
- 自动化(减少人工干预):
15
- - 不要求先手动执行 `/server-test-plan`:如果检测到“计划/执行合同产物缺失”,本命令会先按 `/server-test-plan` 的规则自动补齐计划与产物,再进入闭环。
16
-
17
- 前置(必须满足):
18
- - 当前目录为工作区根目录(目录A)
19
- - 已存在 AI_WORKSPACE.md、REQUIREMENTS.md
20
- - 已存在 tools/server_test_runner.py(uv 可用)
21
- - 已存在 secrets/test-accounts.json(敏感,不展示内容)
22
-
23
- 你日常只需要关注的产物(其余可忽略):
24
- - `issues/server-fix-issues.csv`:修复清单(runner 自动生成/更新,包含证据与建议)
25
- - `issues/server-triage-issues.csv`:需要人工介入的条目(证据不足/需业务判断/日志缺 request_id 等)
26
- - `.agentdocs/tmp/server-test/report.{json,md}`:证据包与汇总
27
-
28
- 说明(避免混乱):
29
- - `issues/server-api-issues.csv` 是 runner 的“执行合同/端点账本”,用于记录每个 endpoint 的状态机与期望字段,便于跳过 DONE、聚焦 BLOCKED;你不需要手工维护它。
30
- - 如你希望尽量减少 LLM 参与、降低 token:可先运行 `/server-drain` 把 TODO 推进到 DONE/SKIP,遇到 BLOCKED 再进入本命令。
31
-
32
- 闭环策略(必须按此执行):
33
- 0) 计划/执行合同预检(若缺失则先补齐):
34
- - 若 `issues/server-api-issues.csv` 不存在:先从 OpenAPI 生成(runner 会自动 upsert)
35
- - 若 `.agentdocs/tmp/server-test/report.json` 不存在:先运行 runner 生成证据包
36
- - 若 `docs/openapi.json` 不存在:优先通过 AI_WORKSPACE.md:openapi_url 从运行服务导出(runner 的 --refresh-openapi)
37
- - 若 REQUIREMENTS.md 的接口需求未填:先把 REQUIREMENTS.md 补齐到“可验收”(否则修复会跑偏)
38
- 1) 运行 runner(默认小批量,避免长时间运行导致上下文/输出膨胀;需要时重复运行多轮):
39
- - 单服务推荐默认:`uv run tools/server_test_runner.py --workspace . --manage-service --max-endpoints 30 --max-response-bytes 65536 --max-report-blocked 50`
40
- - 若需要刷新 OpenAPI:在上述命令后追加 `--refresh-openapi`
41
- 2) 只读取“摘要与清单”,不要读取大文件全文(防止 token 爆炸):
42
- - 先读 `.agentdocs/tmp/server-test/report.md`(摘要)
43
- - 再读 `issues/server-fix-issues.csv` 与 `issues/server-triage-issues.csv`
44
- - 只在需要时,按证据路径打开单个 `*.out` 或 `*.log.txt`(最多 1-2 个 BLOCKED)
45
- 3) 若存在 BLOCKED:
46
- a) 只处理 Top 3 BLOCKED:对每个 BLOCKED,按 Evidence 读取证据文件路径(resp=... / log_snippet=...),不要把文件内容整段贴回输出
47
- b) 判断是“需求/业务对齐”还是“代码/配置问题”
48
- c) 对代码/配置问题:先用 Context7 查对应栈(按 server_dir 检测:pom.xml/gradle/go.mod/Cargo.toml),再做最小修复
49
- d) 单服务默认直接复测;多服务时只复测相关 service(设置 CSV 对应项为 TODO/BLOCKED 即可;runner 会跳过 DONE)
50
- 4) 每轮最多修复 3 个 BLOCKED,最多迭代 5 轮;超出则停止并给出剩余问题清单与建议
51
-
52
- 输出限制(防止 iFlow 崩溃):
53
- - 每轮输出只包含:汇总数字 + Top 3 BLOCKED(Issue_ID/Method/Path/证据路径)+ 1-3 条下一步命令
54
- - 不要输出任何日志/响应正文;一律用文件路径引用
55
-
56
- 边界:
57
- - 不做破坏性数据操作;除非 AI_WORKSPACE.md allow_mutations=true 且 REQUIREMENTS.md 明确允许
58
- - 不泄露 secrets
59
- - 不做 git commit(提交由 /server-commit 负责)
60
- - 反死循环:连续 2 轮 BLOCKED 数不下降时,必须缩小范围(只跑单 service/单 endpoint)或先修环境/先补齐 REQUIREMENTS,不能继续盲改
61
-
62
- 当全部 DONE/SKIP:
63
- - 默认输出:可以执行 `/server-commit`
64
- - 若希望“一条命令自动提交”,使用 `/server-fix-and-commit`(仅限 environment=test)
65
- """
@@ -1,62 +0,0 @@
1
- # Command: server:test-plan
2
- # Description: 规划 workspace 级 server API 测试(发现服务目录、记录接口、生成 issues CSV)
3
- # Category: server
4
- # Version: 1
5
-
6
- description = "规划 workspace 级 server API 测试(发现服务目录、记录接口、生成 issues CSV)"
7
-
8
- prompt = """
9
- IMPORTANT:
10
- - Use Chinese for all narrative output (plans, explanations, headings).
11
- - Keep commands/paths/code identifiers in their original form.
12
-
13
- Create a concrete, executable plan to test server APIs in a workspace directory that may contain multiple projects (backend/frontend) with non-fixed names.
14
-
15
- First, read these workspace-standard files (if present in cwd):
16
- - AI_WORKSPACE.md (workspace discovery and run overrides)
17
- - REQUIREMENTS.md (single source of truth for requirements)
18
- If AI_WORKSPACE.md defines a Request-ID convention, follow it (default: X-Request-Id and log field request_id=<id>).
19
- If AI_WORKSPACE.md defines OpenAPI conventions, follow them (default: docs/openapi.json).
20
-
21
- Secrets:
22
- - If secrets/test-accounts.json exists, treat it as sensitive. Never print its contents.
23
- - Use it only to know headers/base_url/accounts for testing.
24
-
25
- Output format:
26
- 1) GOALS / NON-GOALS (must match REQUIREMENTS.md)
27
- 2) Discovery strategy:
28
- - Identify server directories (non-fixed names) using AI_WORKSPACE.md server_dirs if provided,
29
- else detect by markers: Cargo.toml (Rust), go.mod (Go), pom.xml/gradle (Java).
30
- - For each server dir, detect build/test/start commands (prefer explicit overrides in AI_WORKSPACE.md).
31
- 3) API inventory strategy (pick in order, per server):
32
- - OpenAPI spec as source of truth:
33
- - Prefer docs/openapi.json if present
34
- - Else export from running server (AI_WORKSPACE.md openapi_url) into docs/openapi.json
35
- - Runtime route dump endpoint if available (framework-specific)
36
- - Code scan fallback (list routes from framework conventions)
37
- 4) Artifacts (execution contract):
38
- - docs/api.md: API document draft (method/path/auth/request/response/error)
39
- - issues/server-api-issues.csv: rows for each endpoint with a state machine (no percentages)
40
- Columns MUST include:
41
- Issue_ID, Service, Title, Method, Path, Auth, Request_Example, Expected_Status,
42
- Expected_Body_Checks, Log_Checks, Test_Status, Review_Status, Notes
43
- Test_Status: TODO | DOING | DONE | BLOCKED | SKIP
44
- Review_Status: PENDING | REVIEWING | APPROVED
45
- 5) Execution loop:
46
- - Build -> start (capture logs) -> wait health -> for each endpoint: request -> check response -> check logs -> update CSV
47
- - If fail: smallest fix, implement, rerun only failing items
48
- - Requests MUST include X-Request-Id; log checks should prefer grepping by that id (fallback to time-window grep)
49
- - If tools/server_test_runner.py exists and uv is available, prefer using:
50
- - uv run tools/server_test_runner.py --workspace .
51
- - (optional) uv run tools/server_test_runner.py --workspace . --refresh-openapi
52
- - (optional) uv run tools/server_test_runner.py --workspace . --manage-service
53
- 6) Rollback plan (git restore / revert / stop processes)
54
- 7) Verification commands + expected results
55
-
56
- Constraints:
57
- - Assume Linux. Avoid docker-compose (not used).
58
- - If AI_WORKSPACE.md declares environment=test and allow_mutations=true, you may include mutating endpoints in the plan,
59
- but still require explicit coverage and expectations in REQUIREMENTS.md.
60
- - Otherwise, do not hit destructive endpoints unless explicitly allowed in REQUIREMENTS.md.
61
- - Ask 1-2 clarification questions only if required info is missing.
62
- """
@@ -1,58 +0,0 @@
1
- # Command: server:test
2
- # Description: 执行 workspace 级 server API 测试循环(构建/运行/请求/日志/迭代)
3
- # Category: server
4
- # Version: 1
5
-
6
- description = "执行 workspace 级 server API 测试循环(构建/运行/请求/日志/迭代)"
7
-
8
- prompt = """
9
- IMPORTANT:
10
- - Use Chinese for all narrative output (status, summaries, next steps).
11
- - Keep commands/paths/code identifiers in their original form.
12
-
13
- Execute the workspace-level server API test loop in the current directory.
14
-
15
- Preflight (must do):
16
- - Read AI_WORKSPACE.md and REQUIREMENTS.md if present.
17
- - Ensure secrets/test-accounts.json exists; if missing, ask user to create it from ai-workspace/templates/secrets/test-accounts.example.json.
18
- - Never print secrets from secrets/test-accounts.json.
19
- - Generate a per-request X-Request-Id and include it in every request; prefer correlating logs by request_id / X-Request-Id.
20
-
21
- Working dirs / artifacts:
22
- - Create .agentdocs/tmp/server-test/ for logs and outputs.
23
- - Maintain docs/api.md and issues/server-api-issues.csv as the execution contract.
24
- - Maintain issues/server-fix-issues.csv as the "next fix" list when any endpoint is BLOCKED.
25
-
26
- Steps:
27
- 1) Discover server dirs (AI_WORKSPACE.md server_dirs or marker-based detection).
28
- - If tools/server_test_runner.py exists, prefer using it (uv + python runner) to generate/update issues/server-api-issues.csv and execute requests.
29
- - The runner will use docs/openapi.json as source of truth and enforce Expected_Status when present; keep Expected_Status aligned with OpenAPI/requirements.
30
- 2) For each server:
31
- a) Determine build/test/start commands (prefer explicit overrides).
32
- b) Build and start in background, capturing stdout/stderr to .agentdocs/tmp/server-test/<service>.log
33
- c) Wait for health endpoint (AI_WORKSPACE.md health_path + base_url; fallback /health).
34
- d) Inventory endpoints (source of truth):
35
- - Prefer docs/openapi.json if present
36
- - Else export OpenAPI from running server (AI_WORKSPACE.md openapi_url) into docs/openapi.json
37
- - Else fallback to route dump / code scan
38
- Then ensure endpoints exist in issues/server-api-issues.csv (add missing rows).
39
- e) For each endpoint row with Test_Status in TODO/BLOCKED:
40
- - Set Test_Status=DOING
41
- - Execute request (curl preferred; python3 httpx/requests acceptable if installed), always include X-Request-Id header
42
- - Save response to .agentdocs/tmp/server-test/<service>__<endpoint-slug>.out
43
- - Prefer grepping logs by request_id / X-Request-Id; fallback to ERROR|Exception|Stacktrace time-window grep; update Notes with evidence (no secrets)
44
- - Mark DONE if passes, else BLOCKED
45
- f) Stop the server cleanly (do not leave background processes).
46
- 3) If anything is BLOCKED:
47
- - Propose the smallest fix to satisfy REQUIREMENTS.md, implement it, and rerun ONLY blocked endpoints.
48
- - Do not stop at "needs next step": keep the loop until all DONE/SKIP or you hit the iteration cap; keep issues/server-fix-issues.csv current.
49
- 4) Finish when all endpoints are DONE/SKIP and build has no errors.
50
-
51
- Hard rules:
52
- - Linux-first commands.
53
- - If AI_WORKSPACE.md declares environment=test and allow_mutations=true, mutating endpoint tests are allowed,
54
- but only for endpoints explicitly listed/required by REQUIREMENTS.md.
55
- - Otherwise, no destructive tests unless explicitly permitted.
56
- - No leaking of secrets or tokens.
57
- - Do not claim tests passed unless commands were executed and outputs observed.
58
- """
@@ -1,38 +0,0 @@
1
- # Command: server:triage
2
- # Description: 基于 report.json + issues CSV 分诊失败项,给出与 REQUIREMENTS 对齐的修复建议
3
- # Category: server
4
- # Version: 1
5
-
6
- description = "基于 report.json + issues CSV 分诊失败项,给出与 REQUIREMENTS 对齐的修复建议"
7
-
8
- prompt = """
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:把“测试结果 → 可执行修复清单”自动化,减少人工判断。
12
-
13
- 输入(在 cwd/workspace 根目录):
14
- - AI_WORKSPACE.md(server_dirs、base_url、openapi 约定、Request-Id 约定)
15
- - REQUIREMENTS.md(唯一真值:业务边界/验收标准)
16
- - issues/server-api-issues.csv(执行合同)
17
- - issues/server-fix-issues.csv(runner 自动生成的“下一步修复清单”,用于聚焦 BLOCKED)
18
- - .agentdocs/tmp/server-test/report.json(runner 自动生成;若缺失,先运行 runner 生成)
19
-
20
- 规则:
21
- - 不打印 secrets/test-accounts.json 内容
22
- - 若 report.json 不存在:直接运行
23
- `uv run tools/server_test_runner.py --workspace . --manage-service`
24
- 再继续 triage
25
- - triage 结束时:必须确保 `issues/server-fix-issues.csv` 已更新(若缺失则重新运行 runner)
26
- - 将 BLOCKED 分成两类,并给出下一步:
27
- A) 需求/业务对齐问题:Expected_Status/Expected_Body_Checks 与 REQUIREMENTS.md 不一致 → 先更新 REQUIREMENTS/CSV,再改代码
28
- B) 代码/配置问题:500/解析异常/安全链路/日志缺 request_id 等 → 先用 Context7 查对应技术文档,再给最小修复点
29
- - 反死循环:若同一 BLOCKED 连续出现且证据不变,优先缩小范围(只跑单 service/单 endpoint)或先修环境/先补齐 REQUIREMENTS
30
-
31
- 输出必须包含:
32
- 1) 结论:当前是否可以进入提交阶段(是否全部 DONE/SKIP)
33
- 2) BLOCKED Top 列表(按影响排序,引用 Issue_ID + endpoint + 证据文件路径,如 report.json / *.out / *.log.txt)
34
- 3) 每个 BLOCKED 的“修复动作”:
35
- - 需要改哪些文件(给相对路径)
36
- - 建议如何验证(优先 rerun runner;必要时只跑对应 service)
37
- 4) 若涉及请求日志关联:明确要求服务端输出 `request_id=<id>` 或按 AI_WORKSPACE.md 的约定
38
- """