@aipper/aiws-spec 0.0.32 → 0.0.34

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 (187) hide show
  1. package/docs/aiws-bootstrap-routing-design.md +5 -50
  2. package/docs/aiws-governance-positioning.md +1 -1
  3. package/docs/cli-interface.md +13 -73
  4. package/docs/collaboration-artifacts.md +2 -2
  5. package/docs/opencode-autonomous-swarm.md +0 -2
  6. package/docs/opencode-omo-adapter.md +0 -2
  7. package/docs/opencode-omo-validation-checklist.md +0 -1
  8. package/docs/spec-contract.md +10 -36
  9. package/docs/workflow-governance-rules.json +11 -7
  10. package/docs/workflow-governance-rules.md +19 -19
  11. package/docs/workflow-governance-rules.schema.json +1 -0
  12. package/docs/workflow-review-gates.json +5 -5
  13. package/docs/workflow-review-gates.md +4 -4
  14. package/docs/workflow-router-rules.json +2 -2
  15. package/docs/workflow-router-rules.md +2 -2
  16. package/docs/workflow-stage-contracts.json +2 -2
  17. package/docs/workflow-stage-contracts.md +2 -2
  18. package/docs/ws-goal-contract.md +230 -0
  19. package/package.json +1 -1
  20. package/templates/workspace/.aiws/continuation/CONTINUATION_PROTOCOL.md +101 -0
  21. package/templates/workspace/.aiws/manifest.json +2 -10
  22. package/templates/workspace/.aiws/tools/ws_change_check.py +11 -4
  23. package/templates/workspace/.opencode/command/ws-finish.md +4 -0
  24. package/templates/workspace/.opencode/command/ws-goal.md +44 -0
  25. package/templates/workspace/.opencode/commands/ws-finish.md +4 -0
  26. package/templates/workspace/.opencode/lib/aiws-context.js +38 -4
  27. package/templates/workspace/.opencode/oh-my-opencode.json.example +5 -0
  28. package/templates/workspace/.opencode/skills/ws-goal/SKILL.md +41 -0
  29. package/templates/workspace/.opencode/skills/ws-intake/SKILL.md +61 -6
  30. package/templates/workspace/AGENTS.md +1 -3
  31. package/templates/workspace/AI_PROJECT.md +6 -1
  32. package/templates/workspace/AI_WORKSPACE.md +1 -1
  33. package/templates/workspace/manifest.json +151 -437
  34. package/templates/workspace/tools/ws_tasks_plan.py +97 -0
  35. package/templates/workspace/.agents/skills/p-aiws-change-archive/SKILL.md +0 -24
  36. package/templates/workspace/.agents/skills/p-aiws-change-finish/SKILL.md +0 -24
  37. package/templates/workspace/.agents/skills/p-aiws-change-list/SKILL.md +0 -18
  38. package/templates/workspace/.agents/skills/p-aiws-change-new/SKILL.md +0 -26
  39. package/templates/workspace/.agents/skills/p-aiws-change-next/SKILL.md +0 -19
  40. package/templates/workspace/.agents/skills/p-aiws-change-start/SKILL.md +0 -33
  41. package/templates/workspace/.agents/skills/p-aiws-change-status/SKILL.md +0 -19
  42. package/templates/workspace/.agents/skills/p-aiws-change-sync/SKILL.md +0 -19
  43. package/templates/workspace/.agents/skills/p-aiws-change-templates-init/SKILL.md +0 -18
  44. package/templates/workspace/.agents/skills/p-aiws-change-templates-which/SKILL.md +0 -18
  45. package/templates/workspace/.agents/skills/p-aiws-change-validate/SKILL.md +0 -23
  46. package/templates/workspace/.agents/skills/p-aiws-hooks-install/SKILL.md +0 -30
  47. package/templates/workspace/.agents/skills/p-aiws-hooks-status/SKILL.md +0 -18
  48. package/templates/workspace/.agents/skills/p-aiws-init/SKILL.md +0 -27
  49. package/templates/workspace/.agents/skills/p-aiws-rollback/SKILL.md +0 -18
  50. package/templates/workspace/.agents/skills/p-aiws-update/SKILL.md +0 -26
  51. package/templates/workspace/.agents/skills/p-aiws-validate/SKILL.md +0 -22
  52. package/templates/workspace/.agents/skills/p-tasks-plan/SKILL.md +0 -37
  53. package/templates/workspace/.agents/skills/using-aiws/SKILL.md +0 -105
  54. package/templates/workspace/.agents/skills/ws-analyze/SKILL.md +0 -26
  55. package/templates/workspace/.agents/skills/ws-bugfix/SKILL.md +0 -111
  56. package/templates/workspace/.agents/skills/ws-commit/SKILL.md +0 -18
  57. package/templates/workspace/.agents/skills/ws-delegate/SKILL.md +0 -75
  58. package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +0 -18
  59. package/templates/workspace/.agents/skills/ws-dev/SKILL.md +0 -109
  60. package/templates/workspace/.agents/skills/ws-dev-lite/SKILL.md +0 -58
  61. package/templates/workspace/.agents/skills/ws-finish/SKILL.md +0 -22
  62. package/templates/workspace/.agents/skills/ws-frontend-design/SKILL.md +0 -126
  63. package/templates/workspace/.agents/skills/ws-handoff/SKILL.md +0 -18
  64. package/templates/workspace/.agents/skills/ws-intake/SKILL.md +0 -87
  65. package/templates/workspace/.agents/skills/ws-migrate/SKILL.md +0 -18
  66. package/templates/workspace/.agents/skills/ws-plan/SKILL.md +0 -144
  67. package/templates/workspace/.agents/skills/ws-plan-verify/SKILL.md +0 -18
  68. package/templates/workspace/.agents/skills/ws-preflight/SKILL.md +0 -56
  69. package/templates/workspace/.agents/skills/ws-pull/SKILL.md +0 -18
  70. package/templates/workspace/.agents/skills/ws-push/SKILL.md +0 -18
  71. package/templates/workspace/.agents/skills/ws-quality-review/SKILL.md +0 -56
  72. package/templates/workspace/.agents/skills/ws-req-change/SKILL.md +0 -41
  73. package/templates/workspace/.agents/skills/ws-req-contract-sync/SKILL.md +0 -17
  74. package/templates/workspace/.agents/skills/ws-req-contract-validate/SKILL.md +0 -12
  75. package/templates/workspace/.agents/skills/ws-req-flow-sync/SKILL.md +0 -28
  76. package/templates/workspace/.agents/skills/ws-req-review/SKILL.md +0 -32
  77. package/templates/workspace/.agents/skills/ws-review/SKILL.md +0 -55
  78. package/templates/workspace/.agents/skills/ws-rule/SKILL.md +0 -23
  79. package/templates/workspace/.agents/skills/ws-spec-review/SKILL.md +0 -57
  80. package/templates/workspace/.agents/skills/ws-submodule-setup/SKILL.md +0 -18
  81. package/templates/workspace/.agents/skills/ws-verify-before-complete/SKILL.md +0 -18
  82. package/templates/workspace/.claude/commands/p-aiws-change-archive.md +0 -24
  83. package/templates/workspace/.claude/commands/p-aiws-change-finish.md +0 -24
  84. package/templates/workspace/.claude/commands/p-aiws-change-list.md +0 -23
  85. package/templates/workspace/.claude/commands/p-aiws-change-new.md +0 -24
  86. package/templates/workspace/.claude/commands/p-aiws-change-next.md +0 -24
  87. package/templates/workspace/.claude/commands/p-aiws-change-start.md +0 -24
  88. package/templates/workspace/.claude/commands/p-aiws-change-status.md +0 -24
  89. package/templates/workspace/.claude/commands/p-aiws-change-sync.md +0 -24
  90. package/templates/workspace/.claude/commands/p-aiws-change-templates-init.md +0 -23
  91. package/templates/workspace/.claude/commands/p-aiws-change-templates-which.md +0 -23
  92. package/templates/workspace/.claude/commands/p-aiws-change-validate.md +0 -24
  93. package/templates/workspace/.claude/commands/p-aiws-hooks-install.md +0 -23
  94. package/templates/workspace/.claude/commands/p-aiws-hooks-status.md +0 -23
  95. package/templates/workspace/.claude/commands/p-aiws-init.md +0 -20
  96. package/templates/workspace/.claude/commands/p-aiws-rollback.md +0 -13
  97. package/templates/workspace/.claude/commands/p-aiws-update.md +0 -19
  98. package/templates/workspace/.claude/commands/p-aiws-validate.md +0 -14
  99. package/templates/workspace/.claude/commands/using-aiws.md +0 -25
  100. package/templates/workspace/.claude/commands/ws-analyze.md +0 -27
  101. package/templates/workspace/.claude/commands/ws-bugfix.md +0 -32
  102. package/templates/workspace/.claude/commands/ws-commit.md +0 -67
  103. package/templates/workspace/.claude/commands/ws-deliver.md +0 -55
  104. package/templates/workspace/.claude/commands/ws-dev-lite.md +0 -31
  105. package/templates/workspace/.claude/commands/ws-dev.md +0 -33
  106. package/templates/workspace/.claude/commands/ws-finish.md +0 -72
  107. package/templates/workspace/.claude/commands/ws-handoff.md +0 -23
  108. package/templates/workspace/.claude/commands/ws-intake.md +0 -19
  109. package/templates/workspace/.claude/commands/ws-migrate.md +0 -22
  110. package/templates/workspace/.claude/commands/ws-plan-verify.md +0 -25
  111. package/templates/workspace/.claude/commands/ws-plan.md +0 -21
  112. package/templates/workspace/.claude/commands/ws-preflight.md +0 -27
  113. package/templates/workspace/.claude/commands/ws-pull.md +0 -84
  114. package/templates/workspace/.claude/commands/ws-push.md +0 -90
  115. package/templates/workspace/.claude/commands/ws-quality-review.md +0 -24
  116. package/templates/workspace/.claude/commands/ws-req-change.md +0 -42
  117. package/templates/workspace/.claude/commands/ws-req-contract-sync.md +0 -18
  118. package/templates/workspace/.claude/commands/ws-req-contract-validate.md +0 -13
  119. package/templates/workspace/.claude/commands/ws-req-flow-sync.md +0 -20
  120. package/templates/workspace/.claude/commands/ws-req-review.md +0 -33
  121. package/templates/workspace/.claude/commands/ws-review.md +0 -31
  122. package/templates/workspace/.claude/commands/ws-rule.md +0 -24
  123. package/templates/workspace/.claude/commands/ws-spec-review.md +0 -24
  124. package/templates/workspace/.claude/commands/ws-submodule-setup.md +0 -54
  125. package/templates/workspace/.claude/commands/ws-verify-before-complete.md +0 -24
  126. package/templates/workspace/.claude/settings.json.example +0 -26
  127. package/templates/workspace/.claude/skills/p-aiws-change-archive/SKILL.md +0 -24
  128. package/templates/workspace/.claude/skills/p-aiws-change-finish/SKILL.md +0 -24
  129. package/templates/workspace/.claude/skills/p-aiws-change-list/SKILL.md +0 -18
  130. package/templates/workspace/.claude/skills/p-aiws-change-new/SKILL.md +0 -26
  131. package/templates/workspace/.claude/skills/p-aiws-change-next/SKILL.md +0 -19
  132. package/templates/workspace/.claude/skills/p-aiws-change-start/SKILL.md +0 -33
  133. package/templates/workspace/.claude/skills/p-aiws-change-status/SKILL.md +0 -19
  134. package/templates/workspace/.claude/skills/p-aiws-change-sync/SKILL.md +0 -19
  135. package/templates/workspace/.claude/skills/p-aiws-change-templates-init/SKILL.md +0 -18
  136. package/templates/workspace/.claude/skills/p-aiws-change-templates-which/SKILL.md +0 -18
  137. package/templates/workspace/.claude/skills/p-aiws-change-validate/SKILL.md +0 -23
  138. package/templates/workspace/.claude/skills/p-aiws-hooks-install/SKILL.md +0 -30
  139. package/templates/workspace/.claude/skills/p-aiws-hooks-status/SKILL.md +0 -18
  140. package/templates/workspace/.claude/skills/p-aiws-init/SKILL.md +0 -27
  141. package/templates/workspace/.claude/skills/p-aiws-rollback/SKILL.md +0 -18
  142. package/templates/workspace/.claude/skills/p-aiws-update/SKILL.md +0 -26
  143. package/templates/workspace/.claude/skills/p-aiws-validate/SKILL.md +0 -22
  144. package/templates/workspace/.claude/skills/p-tasks-plan/SKILL.md +0 -37
  145. package/templates/workspace/.claude/skills/using-aiws/SKILL.md +0 -87
  146. package/templates/workspace/.claude/skills/ws-analyze/SKILL.md +0 -26
  147. package/templates/workspace/.claude/skills/ws-bugfix/SKILL.md +0 -111
  148. package/templates/workspace/.claude/skills/ws-commit/SKILL.md +0 -18
  149. package/templates/workspace/.claude/skills/ws-deliver/SKILL.md +0 -18
  150. package/templates/workspace/.claude/skills/ws-dev/SKILL.md +0 -79
  151. package/templates/workspace/.claude/skills/ws-dev-lite/SKILL.md +0 -58
  152. package/templates/workspace/.claude/skills/ws-finish/SKILL.md +0 -22
  153. package/templates/workspace/.claude/skills/ws-frontend-design/SKILL.md +0 -126
  154. package/templates/workspace/.claude/skills/ws-handoff/SKILL.md +0 -18
  155. package/templates/workspace/.claude/skills/ws-intake/SKILL.md +0 -31
  156. package/templates/workspace/.claude/skills/ws-migrate/SKILL.md +0 -18
  157. package/templates/workspace/.claude/skills/ws-plan/SKILL.md +0 -138
  158. package/templates/workspace/.claude/skills/ws-plan-verify/SKILL.md +0 -18
  159. package/templates/workspace/.claude/skills/ws-preflight/SKILL.md +0 -55
  160. package/templates/workspace/.claude/skills/ws-pull/SKILL.md +0 -18
  161. package/templates/workspace/.claude/skills/ws-push/SKILL.md +0 -18
  162. package/templates/workspace/.claude/skills/ws-quality-review/SKILL.md +0 -56
  163. package/templates/workspace/.claude/skills/ws-req-change/SKILL.md +0 -41
  164. package/templates/workspace/.claude/skills/ws-req-contract-sync/SKILL.md +0 -17
  165. package/templates/workspace/.claude/skills/ws-req-contract-validate/SKILL.md +0 -12
  166. package/templates/workspace/.claude/skills/ws-req-flow-sync/SKILL.md +0 -28
  167. package/templates/workspace/.claude/skills/ws-req-review/SKILL.md +0 -32
  168. package/templates/workspace/.claude/skills/ws-review/SKILL.md +0 -55
  169. package/templates/workspace/.claude/skills/ws-rule/SKILL.md +0 -23
  170. package/templates/workspace/.claude/skills/ws-spec-review/SKILL.md +0 -57
  171. package/templates/workspace/.claude/skills/ws-submodule-setup/SKILL.md +0 -18
  172. package/templates/workspace/.claude/skills/ws-verify-before-complete/SKILL.md +0 -18
  173. package/templates/workspace/.codex/prompts/aiws-init.md +0 -23
  174. package/templates/workspace/.codex/prompts/aiws-rollback.md +0 -16
  175. package/templates/workspace/.codex/prompts/aiws-update.md +0 -22
  176. package/templates/workspace/.codex/prompts/aiws-validate.md +0 -17
  177. package/templates/workspace/.codex/prompts/ws-analyze.md +0 -32
  178. package/templates/workspace/.codex/prompts/ws-dev.md +0 -36
  179. package/templates/workspace/.codex/prompts/ws-migrate.md +0 -27
  180. package/templates/workspace/.codex/prompts/ws-preflight.md +0 -32
  181. package/templates/workspace/.codex/prompts/ws-req-change.md +0 -39
  182. package/templates/workspace/.codex/prompts/ws-req-contract-sync.md +0 -23
  183. package/templates/workspace/.codex/prompts/ws-req-contract-validate.md +0 -18
  184. package/templates/workspace/.codex/prompts/ws-req-flow-sync.md +0 -25
  185. package/templates/workspace/.codex/prompts/ws-req-review.md +0 -38
  186. package/templates/workspace/.codex/prompts/ws-review.md +0 -32
  187. package/templates/workspace/.codex/prompts/ws-rule.md +0 -29
@@ -1,72 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-finish -->
2
- # ws finish
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:安全把 `change/<change-id>` fast-forward 合并回目标分支,避免手输分支名导致的错误。
7
- 补充:若团队希望减少 submodule detached 的人为差异,建议在 `.gitmodules` 配置 `submodule.<name>.branch`,并在日常拉取时使用 `/ws-pull`。
8
-
9
- 前置(必须):
10
- - 工作区干净:`git status --porcelain` 无输出(否则先 commit 或 stash)
11
- - change 分支存在(`change/<change-id>`;也支持 `changes/`、`ws/`、`ws-change/`)
12
- - 普通 finish 的 `validate/evidence/state` 应先在 `change/<change-id>` worktree 完成;真正执行 `aiws change finish` 时再切到目标分支所在 worktree
13
- - 若 `aiws change status <change-id>` 输出 `governance_rule: finish_resume_required`:说明 merge 已发生,只需继续 push / archive / cleanup closeout;直接在提示的 worktree 运行 `aiws change finish <change-id> --push`
14
- - 若存在 `.gitmodules`:必须为每个 submodule 配置 `submodule.<name>.branch`(否则先运行 `/ws-submodule-setup` 并提交 `.gitmodules`)
15
-
16
- 步骤(建议):
17
- 0) 若存在 `.gitmodules`,先检查 submodule branch 配置是否齐全(缺失则停止并提示 setup):
18
- ```bash
19
- if [[ -f .gitmodules ]]; then
20
- missing=0
21
- while read -r key sub_path; do
22
- name="${key#submodule.}"; name="${name%.path}"
23
- b="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
24
- if [[ -z "${b:-}" ]]; then
25
- echo "error: missing .gitmodules submodule.${name}.branch (path=${sub_path})"
26
- missing=1
27
- fi
28
- done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
29
- if [[ "$missing" -ne 0 ]]; then
30
- echo "hint: run /ws-submodule-setup (and commit .gitmodules), then retry"
31
- exit 2
32
- fi
33
- fi
34
- ```
35
- 1) 先运行 `/ws-preflight`(确保真值文件齐全)。
36
- 2) 先运行 `aiws change status <change-id>`,优先看稳定字段 `governance_rule:`。
37
- - 若为 `finish_resume_required`:直接跳到步骤 3 执行 `aiws change finish <change-id> --push`
38
- - 若不是该值:按普通 finish 继续;不要依赖自然语言提示句做分支判断
39
- 2.1) 普通 finish 时,`aiws validate . --stamp` / `aiws change evidence <change-id>` / `aiws change state <change-id> --write` 应在 `change/<change-id>` worktree 完成。
40
- - 如果已经在目标分支 worktree,且 `governance_rule` 不是 `finish_resume_required`,不要在这里跑 `aiws validate . --stamp`;先回 `change/<change-id>` worktree,或先跑 `/ws-verify-before-complete`
41
- 3) 若不存在 `.gitmodules`,或 submodules 已按顺序处理完成,优先直接执行最小收尾闭环:
42
- - `aiws change finish <change-id> --push`
43
- - 若当前就在 `change/<change-id>` 分支上,也可省略 `<change-id>`
44
- - 该命令会在 fast-forward 合并成功后 push 目标分支;默认优先使用 upstream 配置(`branch.<name>.remote` + `branch.<name>.merge`),只有在你明确知道要推向别的 remote 时才追加 `--remote <name>`
45
- - 若 `change/<change-id>` 位于独立 worktree,且该 worktree 干净,则会在 push 成功后自动执行 `git worktree remove` + `git worktree prune`
46
- - AI 入口执行前,应先向用户说明将要 push 的 remote/branch;显式传入 `--push` 即视为确认
47
- 4) 若提示无法 fast-forward:先在 change 分支(或对应 worktree)里 `git rebase <target-branch>`,再重试 `aiws change finish --push`。
48
- 5) 若需要先处理 submodules,则按顺序处理每个 submodule(减少 detached;再 push):
49
- - 先显式解析 base branch,不要用当前分支名替代:
50
- - `python3 - <<'PY'`
51
- - `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())`
52
- - `PY`
53
- - 发现 submodules:`git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$'`
54
- - 对每个 `<sub_path>`:
55
- - 读取 superproject 当前 gitlink:`git rev-parse "HEAD:<sub_path>"`
56
- - 目标分支真值:`changes/<change-id>/submodules.targets`;若条目里分支写 `.`,则展开为刚才解析出的 `base_branch`
57
- - 生成/检查 `submodules.targets` 时,detached HEAD 默认建议取 `.gitmodules` 的 `submodule.<name>.branch`;已附着在本地分支时默认建议取当前分支;这些都只是预填建议,不是 finish/push 的运行时真值
58
- - 不要直接切 `change/<change-id>` / `main` / `master` 来解 detached
59
- - 用 pin 分支挂回(不改动现有 main/master 指针):`git -C "<sub_path>" checkout -B "aiws/pin/<target-branch>" <gitlink-sha>`
60
- - 仅当 `<gitlink-sha>` 属于 `origin/<target-branch>` 历史时才允许 push;否则停止并人工处理分叉
61
- - push(只允许 fast-forward):`git -C "<sub_path>" push origin "<gitlink-sha>:refs/heads/<target-branch>"`
62
- 6) 任一 submodule 不满足 fast-forward 条件时立即停止(不要继续 push 主仓库)。
63
- 7) submodules 全部成功后,再回到主仓库执行:
64
- - `aiws change finish <change-id> --push`
65
- 8) `aiws change finish --push` 成功后会自动归档并生成 handoff;只有历史/异常场景才需要手工运行 `aiws change archive <change-id>`。
66
-
67
- 安全:
68
- - push 前先输出状态并说明远端/分支。
69
- - 不执行破坏性命令。
70
- <!-- AIWS_MANAGED_END:claude:ws-finish -->
71
-
72
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,23 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-handoff -->
2
- # ws handoff
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:
7
- - 交接与回放:通过 `handoff.md` 让已归档的 change 可被下一位/下一次会话快速接力。
8
- - handoff 文件位置:`changes/archive/<date>-<change-id>/handoff.md`(默认由 `aiws change finish --push` 自动归档时生成)。
9
-
10
- 执行建议:
11
- 1) 先确认 change 已通过 `/ws-finish` 或 `aiws change finish --push` 完成自动归档。
12
- 2) 查看 handoff:
13
- ```bash
14
- change_id="<change-id>"
15
- ls -1 changes/archive/*-"${change_id}"/handoff.md
16
- sed -n '1,160p' changes/archive/*-"${change_id}"/handoff.md
17
- ```
18
- 3) 依赖提示:
19
- - 若你在某个 change 的 `proposal.md` 声明了 `Depends_On`,`aiws change start` 会尝试读取依赖 change 的 `handoff.md` 并输出摘要(前提:依赖已归档且 handoff 存在)。
20
- - 若是历史/异常场景尚未归档,再手工运行 `/p-aiws-change-archive`。
21
- <!-- AIWS_MANAGED_END:claude:ws-handoff -->
22
-
23
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,19 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-intake -->
2
- # ws intake
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:
7
- - 在正式 `/ws-plan` 前,先把需求里的待确认问题逐条澄清并冻结。
8
-
9
- 执行建议:
10
- 1) 先读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`。
11
- 2) 若存在最新 `plan/*.intake.md`,先续写;否则创建新的 intake 草案。
12
- 3) 把问题写成 `Open Questions`,状态只允许 `open / in_discussion / frozen / deferred`。
13
- 4) 每次只推进 1 条 `Current question`,允许围绕这 1 条问题多轮沟通。
14
- 5) 当前问题未标记为 `frozen` 或 `deferred` 前,不进入下一题。
15
- 6) 每轮都要把结论落到 `plan/<timestamp>-<slug>.intake.md`,并输出 `Ready for ws-plan: yes/no`。
16
- 7) 只有关键问题已冻结时,`Next` 才能进入 `/ws-plan`;否则继续 `/ws-intake`。
17
- <!-- AIWS_MANAGED_END:claude:ws-intake -->
18
-
19
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,22 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-migrate -->
2
- # ws migrate
3
-
4
- 用中文输出;命令与路径保持原样不翻译。
5
-
6
- 目标:把当前仓库补齐为 aiws workspace 模板,并启用可验证门禁。
7
-
8
- 执行(在项目根目录):
9
- 1) 若已存在 `.aiws/manifest.json`:`npx @aipper/aiws update .`
10
- 2) 否则:`npx @aipper/aiws init .`
11
- 3) 门禁校验:`npx @aipper/aiws validate .`
12
- 4) 启用本机 git hooks(推荐,本地生效):`git config core.hooksPath .githooks`
13
-
14
- 回滚:
15
- - 恢复最近一次快照:`npx @aipper/aiws rollback . latest`
16
-
17
- 约束:
18
- - 不写入任何 secrets。
19
- - 不执行破坏性命令。
20
- <!-- AIWS_MANAGED_END:claude:ws-migrate -->
21
-
22
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,25 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-plan-verify -->
2
- # ws plan verify
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:
7
- - 执行前检查计划是否跑偏,并给出最小修正项。
8
-
9
- 执行建议:
10
- 1) 先运行 `/ws-preflight`。
11
- 2) 运行严格门禁:
12
- ```bash
13
- if [[ -x "./node_modules/.bin/aiws" ]]; then
14
- ./node_modules/.bin/aiws change validate <change-id> --strict
15
- elif command -v aiws >/dev/null 2>&1; then
16
- aiws change validate <change-id> --strict
17
- else
18
- npx @aipper/aiws change validate <change-id> --strict
19
- fi
20
- ```
21
- 3) 若失败:先修 `proposal.md` / `plan` 的绑定字段与验证命令,再复跑。
22
- 4) 通过后再进入 `/ws-dev`。
23
- <!-- AIWS_MANAGED_END:claude:ws-plan-verify -->
24
-
25
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,21 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-plan -->
2
- # ws plan
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:
7
- - 若尚未进入本次 change 的工作上下文:先建立 `change/<change-id>` 分支 / worktree,再生成可落盘执行计划(供 /ws-dev 执行)。
8
-
9
- 执行建议:
10
- 1) 先运行 `/ws-preflight`(对齐 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`)。
11
- 2) 若当前不在 `change/<change-id>` 分支 / worktree,先调用 `aiws change start <change-id>` 建立上下文:
12
- - 仓库已有提交:优先 `aiws change start <change-id> --hooks --worktree`;若声明了 submodules,加 `--submodules`
13
- - 仓库尚无提交 / 不满足 worktree 前置条件:回退 `aiws change start <change-id> --hooks --no-switch`
14
- 3) 若上一步创建了 worktree:切到输出的 `worktree:` 路径,后续所有计划文件都写在该 worktree 中。
15
- 4) 生成或更新计划文件:`plan/YYYY-MM-DD_HH-MM-SS-<slug>.md`。
16
- 5) 计划至少包含:`绑定信息(Bindings)`、`目标(Goal)`、`非目标(Non-goals)`、`范围(Scope)`、`执行计划(Plan)`、`验证(Verify)`、`风险与回滚(Risks & Rollback)`、`证据(Evidence)`。
17
- 6) 若已有 `changes/<change-id>/proposal.md`,对齐 `计划文件(Plan_File)` / `合同行(Contract_Row)` / `证据路径(Evidence_Path)`。
18
- 7) 完成后先运行 `/ws-plan-verify`,通过再进入 `/ws-dev`。
19
- <!-- AIWS_MANAGED_END:claude:ws-plan -->
20
-
21
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,27 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-preflight -->
2
- # ws preflight
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:在开始任何“写代码/改配置/落盘文件”之前,对齐工作区真值文件,避免规则漂移。
7
-
8
- 执行步骤(强制):
9
- 1) 定位项目根目录:
10
- - 优先:`git rev-parse --show-toplevel`
11
- - 若失败:停止并让用户确认当前目录是否为项目根(不要猜测)。
12
- 2) 在项目根目录读取以下文件(存在则必须读取;缺失则明确报告缺失项,不要臆测内容):
13
- - `AI_PROJECT.md`
14
- - `REQUIREMENTS.md`
15
- - `AI_WORKSPACE.md`
16
- 3) 输出:
17
- - `根目录(Root):` <项目根路径>
18
- - `已读取(Found):` <实际读取到的文件列表>
19
- - `缺失(Missing):` <缺失文件列表>
20
- - `关键规则(Key rules):` 3–8 条 bullet(范围/禁止项/必须产物/必须验证命令)
21
-
22
- 安全:
23
- - 不打印 secrets;遇到疑似敏感值只提示“存在风险”但不要复述原文。
24
- - 不执行破坏性命令。
25
- <!-- AIWS_MANAGED_END:claude:ws-preflight -->
26
-
27
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,84 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-pull -->
2
- # ws pull
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:安全拉取 superproject,并对齐 submodules,尽量把 submodule 从 detached HEAD “挂回”分支(仅当该分支包含 gitlink commit),减少人为操作差异。
7
-
8
- 安全约束(强制):
9
- - 不执行破坏性命令;不自动提交/不自动 push
10
- - 若工作区不干净:停止并要求用户先 commit 或 stash
11
- - `git pull` 默认只允许 fast-forward(避免隐式 merge/rebase)
12
-
13
- 步骤(建议):
14
- 1) 输出上下文并检查工作区干净:
15
- ```bash
16
- git rev-parse --show-toplevel
17
- git branch --show-current
18
- git status --porcelain
19
- ```
20
- 若 `git status --porcelain` 非空:停止。
21
-
22
- 2) 拉取 superproject(fast-forward only):
23
- ```bash
24
- git pull --ff-only
25
- ```
26
- 若失败:停止并说明需要用户明确选择 `git pull --rebase` 或手动处理。
27
-
28
- 3) 更新 submodules 到 superproject 记录的 gitlink commit:
29
- ```bash
30
- if [[ -f .gitmodules ]]; then
31
- git submodule sync --recursive
32
- git submodule update --init --recursive
33
- else
34
- echo "[info] no .gitmodules"
35
- fi
36
- ```
37
-
38
- 4) (可选但推荐)把 submodule 从 detached HEAD 尽量“挂回分支”(不改动 gitlink commit):
39
- 为避免 origin 多分支时“猜错分支”,本步骤只在 `.gitmodules` 明确配置了 `submodule.<name>.branch` 时才执行;否则保持 detached 并提示先运行 `/ws-submodule-setup` 对齐配置。
40
- ```bash
41
- if [[ -f .gitmodules ]]; then
42
- base_branch="$(git branch --show-current)"
43
- git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null \
44
- | while read -r key sub_path; do
45
- [[ -z "${sub_path:-}" ]] && continue
46
- name="${key#submodule.}"; name="${name%.path}"
47
- echo "== submodule: ${sub_path} (${name}) =="
48
- sub_sha="$(git rev-parse "HEAD:${sub_path}" 2>/dev/null || true)"
49
- [[ -z "${sub_sha:-}" ]] && { echo "[warn] no gitlink sha"; continue; }
50
-
51
- cfg_branch="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
52
- if [[ "${cfg_branch:-}" == "." ]]; then cfg_branch="$base_branch"; fi
53
- if [[ -z "${cfg_branch:-}" ]]; then
54
- echo "[warn] ${sub_path}: missing .gitmodules submodule.${name}.branch; keep detached (run ws-submodule-setup)"
55
- continue
56
- fi
57
- target_branch="${cfg_branch}"
58
- pin_branch="aiws/pin/${target_branch}"
59
-
60
- git -C "${sub_path}" fetch origin --prune || true
61
- if git -C "${sub_path}" show-ref --verify --quiet "refs/remotes/origin/${target_branch}"; then
62
- if git -C "${sub_path}" merge-base --is-ancestor "${sub_sha}" "origin/${target_branch}"; then
63
- git -C "${sub_path}" checkout -B "${pin_branch}" "${sub_sha}"
64
- git -C "${sub_path}" branch --set-upstream-to "origin/${target_branch}" "${pin_branch}" >/dev/null 2>&1 || true
65
- echo "[ok] attached ${sub_path} to ${pin_branch} (upstream=origin/${target_branch}) at ${sub_sha}"
66
- else
67
- echo "[warn] ${sub_path}: ${sub_sha} is not in origin/${target_branch}; keep detached"
68
- fi
69
- else
70
- echo "[warn] ${sub_path}: origin/${target_branch} not found; keep detached"
71
- fi
72
- done
73
- fi
74
- ```
75
-
76
- 可选(方案 2,一次性设置 submodule 跟踪分支,会改 `.gitmodules`,需提交):
77
- ```bash
78
- git submodule set-branch --branch main <sub_path>
79
- git add .gitmodules
80
- git commit -m "chore(submodule): set tracking branch"
81
- ```
82
- <!-- AIWS_MANAGED_END:claude:ws-pull -->
83
-
84
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,90 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-push -->
2
- # ws push
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:安全 push 当前仓库;若仓库包含 submodules,则先 push submodules,再 push superproject(默认 fast-forward;不 force)。
7
-
8
- 强制约束:
9
- - 不自动提交、不自动 `git add -A`
10
- - 不使用 `--force` / `--force-with-lease`
11
- - 若工作区不干净:停止并要求先 commit 或 stash
12
-
13
- 步骤(建议):
14
- 1) 输出上下文并检查工作区干净:
15
- ```bash
16
- git branch --show-current
17
- git status --porcelain
18
- git status -sb
19
- ```
20
- 若 `git status --porcelain` 非空:停止。
21
-
22
- 2) 判断是否存在 submodules:
23
- ```bash
24
- if [[ -f .gitmodules ]]; then
25
- git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' || true
26
- fi
27
- ```
28
-
29
- 3) 若没有 submodules:正常 push(仍需用户确认远端/分支):
30
- ```bash
31
- git remote -v
32
- git push
33
- ```
34
-
35
- 4) 若有 submodules:先检查 `.gitmodules` 的 `submodule.<name>.branch` 是否齐全(缺失则停止并提示 `/ws-submodule-setup`):
36
- ```bash
37
- missing=0
38
- while read -r key sub_path; do
39
- name="${key#submodule.}"; name="${name%.path}"
40
- b="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
41
- if [[ -z "${b:-}" ]]; then
42
- echo "error: missing .gitmodules submodule.${name}.branch (path=${sub_path})"
43
- missing=1
44
- fi
45
- done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
46
- if [[ "$missing" -ne 0 ]]; then
47
- echo "hint: run /ws-submodule-setup (and commit .gitmodules), then retry"
48
- exit 2
49
- fi
50
- ```
51
-
52
- 5) 逐个 push submodules(fast-forward only),再 push superproject:
53
- ```bash
54
- base_branch="$(git branch --show-current)"
55
-
56
- git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null \
57
- | while read -r key sub_path; do
58
- name="${key#submodule.}"; name="${name%.path}"
59
- echo "== submodule: ${sub_path} (${name}) =="
60
-
61
- if [[ -n "$(git -C "${sub_path}" status --porcelain 2>/dev/null || true)" ]]; then
62
- echo "error: submodule dirty: ${sub_path}"
63
- exit 2
64
- fi
65
-
66
- cfg_branch="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
67
- if [[ "${cfg_branch:-}" == "." ]]; then cfg_branch="$base_branch"; fi
68
- target_branch="${cfg_branch}"
69
-
70
- git -C "${sub_path}" fetch origin --prune
71
- if ! git -C "${sub_path}" show-ref --verify --quiet "refs/remotes/origin/${target_branch}"; then
72
- echo "error: missing origin/${target_branch} for ${sub_path}"
73
- exit 2
74
- fi
75
-
76
- if ! git -C "${sub_path}" merge-base --is-ancestor "origin/${target_branch}" HEAD; then
77
- echo "error: non-fast-forward (submodule=${sub_path}, branch=${target_branch})"
78
- exit 2
79
- fi
80
-
81
- git -C "${sub_path}" push origin "HEAD:refs/heads/${target_branch}"
82
- done
83
-
84
- git remote -v
85
- git push
86
- ```
87
- <!-- AIWS_MANAGED_END:claude:ws-push -->
88
-
89
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
90
-
@@ -1,24 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-quality-review -->
2
- # ws quality review
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:审查行为回归、边界条件、测试覆盖与实现质量。
7
-
8
- 步骤(建议):
9
- 1) 读取 `git diff`、已执行的验证结果和相关代码。
10
- 2) 检查:
11
- - 是否存在行为回归或明显 bug 风险
12
- - 边界条件 / 失败路径是否覆盖
13
- - 测试是否足以支撑当前改动
14
- 3) 将结论落盘到:
15
- - 默认:`changes/<change-id>/review/quality-review.md`
16
- - 回退:`.agentdocs/tmp/review/quality-review.md`
17
- 4) 输出:
18
- - `证据(Evidence):`
19
- - `主要发现(Findings):`
20
- - `测试缺口(Gaps):`
21
- - `下一步(Next):`
22
- <!-- AIWS_MANAGED_END:claude:ws-quality-review -->
23
-
24
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,42 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-req-change -->
2
- # ws req change
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:记录需求变更(更新 `REQUIREMENTS.md` + 追加 `requirements/CHANGELOG.md`),并同步/校验执行合同 `requirements/requirements-issues.csv`。
7
-
8
- 步骤(必须按顺序):
9
- 1) 读取:`AI_PROJECT.md`、`REQUIREMENTS.md`、`AI_WORKSPACE.md`、`requirements/CHANGELOG.md`(缺失则创建目录与文件)。
10
- 2) 先产出“拟变更方案”(不要立刻写文件):
11
- - 变更摘要(1–5 条)
12
- - 影响范围(API/鉴权/字段/状态码/测试边界)
13
- - 回滚思路(1–2 条)
14
- 3) 对比与冲突检查(强制,不写文件):
15
- - 对比“变更前 vs 拟变更后”的差异清单(新增/删除/语义变化)
16
- - 整理潜在冲突/不确定点(只列“最可能影响验收/实现”的,避免噪音)
17
- 4) 逐条澄清(强制,避免一次问完):
18
- - 若存在潜在冲突/不确定点:**本轮只问 1 个**最高优先级问题(给出 2–4 个可选答案或二选一),然后停止,等待用户回复;不要继续问下一题,也不要写文件。
19
- - 收到用户回复后:更新“拟变更方案”,回到步骤 3) 重新对比,直至没有未决问题。
20
- 5) 强制停下来让用户确认:是否继续落盘?(Y/N)
21
- 6) 用户确认 Y 后再写入:
22
- - 更新 `REQUIREMENTS.md`(只保留当前有效版本,不在此堆历史)
23
- - 追加 `requirements/CHANGELOG.md`
24
- 7) 同步/补齐需求执行合同(强制,自动处理 FlowSpec 有/无两种情况):
25
- - `python3 tools/requirements_contract_sync.py --workspace .`
26
- - 说明:若 `REQUIREMENTS.md` 中不存在 FlowSpec(或 flows 为空),该命令只会确保 `requirements/requirements-issues.csv` 表头存在并给出 WARN(这是预期行为,不要当成失败)。
27
- 8) 校验需求执行合同(强制):`python3 tools/requirements_contract.py validate`
28
- 9) 同步场景合同(可选,但若存在 FlowSpec 则强烈建议自动执行):
29
- - 若 `REQUIREMENTS.md` 同时包含 `<!-- FLOW_SPEC_BEGIN -->` 与 `<!-- FLOW_SPEC_END -->`:运行 `/ws-req-flow-sync`
30
- - 否则:跳过,并提示用户“可以先不维护 FlowSpec;后续需要场景回归时再补”
31
-
32
- 输出必须包含:
33
- - 本次更新的文件清单(路径)
34
- - 回滚方案(如何撤销本次需求变更)
35
- - 下一步建议命令
36
-
37
- 安全:
38
- - 不打印 `secrets/test-accounts.json`
39
- - 不引入任何 token/密钥到仓库
40
- <!-- AIWS_MANAGED_END:claude:ws-req-change -->
41
-
42
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,18 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-req-contract-sync -->
2
- # ws req contract sync
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 用途:从 `REQUIREMENTS.md` 的 FlowSpec 补齐 `requirements/requirements-issues.csv`(只生成骨架,不猜测完成状态)。
7
-
8
- 执行(在 workspace 根目录):
9
- - `python3 tools/requirements_contract_sync.py --workspace .`
10
-
11
- 输出要求:
12
- - 说明新增/更新了多少条
13
- - 明确下一步:手工补齐 CRUD/Inputs/Outputs/Business_Logic/Tests,并将可开工条目标为 `Spec_Status=READY`
14
-
15
- 下一步建议:`/ws-req-contract-validate`
16
- <!-- AIWS_MANAGED_END:claude:ws-req-contract-sync -->
17
-
18
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,13 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-req-contract-validate -->
2
- # ws req contract validate
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 执行(失败则修正 CSV 后重试):
7
- - `python3 tools/requirements_contract.py validate`
8
-
9
- 输出要求:
10
- - 若失败:列出前 20 条缺失字段(Req_ID + field),并给出最小补齐建议
11
- <!-- AIWS_MANAGED_END:claude:ws-req-contract-validate -->
12
-
13
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,20 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-req-flow-sync -->
2
- # ws req flow sync
3
-
4
- 用中文输出;命令与路径保持原样不翻译。
5
-
6
- 目标:基于 `REQUIREMENTS.md` 的 FlowSpec 生成:
7
- - `docs/api-flow.mmd`(简短逻辑图,Mermaid)
8
- - `issues/server-scenario-issues.csv`(场景执行合同:TODO/DONE/BLOCKED)
9
-
10
- 执行(在 workspace 根目录):
11
- `python3 tools/requirements_flow_gen.py --workspace .`
12
-
13
- 若缺少工具 `tools/requirements_flow_gen.py`:提示用户先运行 `npx @aipper/aiws init .`(默认会安装 optional tools)。
14
-
15
- 输出要求:只打印生成的文件路径与下一步命令:
16
- - 查看逻辑图:`cat docs/api-flow.mmd`
17
- - 查看场景合同:`cat issues/server-scenario-issues.csv`
18
- <!-- AIWS_MANAGED_END:claude:ws-req-flow-sync -->
19
-
20
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,33 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-req-review -->
2
- # ws req review
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:在不修改任何文件的前提下,对 `REQUIREMENTS.md` 做一次整体 QA,输出缺口/冲突/风险,减少实现漂移。
7
-
8
- 执行步骤(强制):
9
- 1) 定位项目根目录:`git rev-parse --show-toplevel`(失败则停止并让用户确认根目录)。
10
- 2) 读取(存在则必须读取;缺失则明确列出,不要臆测):
11
- - `AI_PROJECT.md`
12
- - `REQUIREMENTS.md`
13
- - `AI_WORKSPACE.md`
14
- - `requirements/CHANGELOG.md`(若存在)
15
- - `requirements/requirements-issues.csv`(若存在)
16
- 3) 输出固定结构的报告:
17
-
18
- ## 需求 QA(Requirements QA)
19
- - 结论:是否可进入实现(是/否/有条件)
20
- - 漂移风险:最容易导致不一致的点
21
- - 可验收性缺口:缺少输入/输出/错误码/边界/示例的条目
22
- - 完整性:非目标(Non-goals)/兼容性/鉴权/重试/并发/观测性/性能
23
- - 一致性:与 `AI_PROJECT.md` 约束冲突点
24
- - 可测试性与证据:最小验证命令 + 期望结果 + 证据路径
25
- - 风险清单:3–8 条
26
- - 需要澄清的问题:5–12 个(按优先级)
27
-
28
- 4) 最后询问用户:是否进入需求落盘流程 `/ws-req-change`?(Y/N)
29
-
30
- 安全:不打印 `secrets/test-accounts.json`。
31
- <!-- AIWS_MANAGED_END:claude:ws-req-review -->
32
-
33
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,31 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-review -->
2
- # ws review
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:在提交/交付前审计当前改动,对照真值文件检查是否越界,并把审计证据优先落盘到 `changes/<change-id>/review/`(若无法确定 `change-id` 再回退 `.agentdocs/tmp/review/`)。
7
-
8
- 步骤(建议):
9
- 1) 先运行 `/ws-preflight`。
10
- 2) 基于 `git status` / `git diff`(以及你实际运行过的测试结果),对照 `AI_PROJECT.md` 与 `REQUIREMENTS.md` 检查:
11
- - 是否存在越界目录改动/危险操作
12
- - 是否有可复现验证命令与证据
13
- - 是否维护了 `changes/<change-id>/` 或相关 `issues/*.csv`
14
- 3) 将审计落盘到(目录不存在则创建):
15
- - 默认:`changes/<change-id>/review/codex-review.md`
16
- - 回退:`.agentdocs/tmp/review/codex-review.md`(仅在无法确定 `change-id` 时使用)
17
- 4) 若当前任务已进入“准备提交/交付/finish”的语境,继续补齐 dual review gate:
18
- - 运行/收敛 `/ws-spec-review`,落盘 `changes/<change-id>/review/spec-review.md`
19
- - 运行/收敛 `/ws-quality-review`,落盘 `changes/<change-id>/review/quality-review.md`
20
- - 不要把单个 `codex-review.md` 误当成 finish gate 已完成
21
- 5) 回复中输出:
22
- - `证据(Evidence):` 证据文件路径
23
- - `主要风险(Top risks):` 3–8 条(高→低)
24
- - `下一步(Next):` 最小修复清单 + 最小验证命令
25
-
26
- 安全:
27
- - 不打印 secrets。
28
- - 不执行破坏性命令。
29
- <!-- AIWS_MANAGED_END:claude:ws-review -->
30
-
31
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,24 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-rule -->
2
- # ws rule
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:把用户口述的“项目特有规则”整理成可执行条款,并写入 `AI_PROJECT.md` 的 `AI_PROJECT_RULES_BEGIN/END` 段(托管块外内容会被保留)。
7
-
8
- 安全规则(强制):
9
- - 不打印/不写入 secrets(token、密钥、内网地址、账号密码)。
10
- - 不执行破坏性命令。
11
-
12
- 工作流:
13
- 1) 先运行 `/ws-preflight`;若缺失 `AI_PROJECT.md`:提示用户先 `/ws-migrate` 或运行 `npx @aipper/aiws init .`。
14
- 2) 写入前创建备份(必须):
15
- `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}`
16
- 3) 先输出“将写入的规则清单”(3–12 条),并要求用户回复 `CONFIRM` 后再落盘。
17
- 4) 用户确认后,**仅更新** BEGIN/END 段内内容(合并去重;写成可检查条款:目录白名单/必须验证命令/禁止项/产物要求)。
18
- 5) 输出必须包含:
19
- - 更新了哪些文件(路径)
20
- - 回滚方式(恢复备份文件)
21
- - 下一步建议:`aiws validate .`
22
- <!-- AIWS_MANAGED_END:claude:ws-rule -->
23
-
24
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
@@ -1,24 +0,0 @@
1
- <!-- AIWS_MANAGED_BEGIN:claude:ws-spec-review -->
2
- # ws spec review
3
-
4
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
5
-
6
- 目标:审查 requirements 归因、plan/change 绑定、evidence 与 workflow gate 完整性。
7
-
8
- 步骤(建议):
9
- 1) 先运行 `/ws-preflight`。
10
- 2) 对照 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md` 检查:
11
- - 当前改动是否能归因到 `Req_ID` / `Problem_ID`
12
- - `plan/...`、`proposal.md`、`tasks.md`、`evidence/` 是否保持一致
13
- - 是否存在越界改动、危险操作或缺失 gate
14
- 3) 将结论落盘到:
15
- - 默认:`changes/<change-id>/review/spec-review.md`
16
- - 回退:`.agentdocs/tmp/review/spec-review.md`
17
- 4) 输出:
18
- - `证据(Evidence):`
19
- - `阻断项(Blockers):`
20
- - `警告(Warnings):`
21
- - `下一步(Next):`
22
- <!-- AIWS_MANAGED_END:claude:ws-spec-review -->
23
-
24
- 可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。