@aipper/aiws-spec 0.0.26 → 0.0.28
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.
- package/docs/cli-interface.md +4 -2
- package/docs/workflow-governance-rules.json +15 -1
- package/docs/workflow-governance-rules.md +5 -3
- package/docs/workflow-router-rules.json +28 -5
- package/docs/workflow-router-rules.md +8 -3
- package/docs/workflow-stage-contracts.json +14 -5
- package/docs/workflow-stage-contracts.md +5 -4
- package/package.json +1 -1
- package/templates/workspace/.agents/skills/using-aiws/SKILL.md +16 -4
- package/templates/workspace/.agents/skills/ws-finish/SKILL.md +12 -4
- package/templates/workspace/.agents/skills/ws-intake/SKILL.md +87 -0
- package/templates/workspace/.agents/skills/ws-plan/SKILL.md +15 -9
- package/templates/workspace/.agents/skills/ws-plan-verify/SKILL.md +11 -2
- package/templates/workspace/.claude/commands/ws-finish.md +8 -4
- package/templates/workspace/.claude/commands/ws-intake.md +19 -0
- package/templates/workspace/.claude/skills/ws-finish/SKILL.md +12 -4
- package/templates/workspace/.claude/skills/ws-intake/SKILL.md +31 -0
- package/templates/workspace/.opencode/command/ws-finish.md +8 -4
- package/templates/workspace/.opencode/command/ws-intake.md +22 -0
- package/templates/workspace/.opencode/commands/ws-finish.md +8 -4
- package/templates/workspace/.opencode/commands/ws-intake.md +22 -0
- package/templates/workspace/.opencode/skills/ws-finish/SKILL.md +12 -4
- package/templates/workspace/.opencode/skills/ws-intake/SKILL.md +31 -0
- package/templates/workspace/AGENTS.md +7 -3
- package/templates/workspace/changes/README.md +2 -1
- package/templates/workspace/manifest.json +16 -0
- package/templates/workspace/tools/ws_change_check.py +224 -7
package/docs/cli-interface.md
CHANGED
|
@@ -274,14 +274,15 @@ Dashboard API(本地只读):
|
|
|
274
274
|
### `aiws change start`
|
|
275
275
|
|
|
276
276
|
语义:
|
|
277
|
-
- 默认行为:切分支到 `change/<change-id
|
|
277
|
+
- 默认行为:切分支到 `change/<change-id>`(存在则切换;不存在则创建);若仓库存在 `.gitmodules`,只切 superproject,本次不会递归切换 submodules。
|
|
278
278
|
- 若检测到 `.gitmodules`(git submodules)且未显式指定 `--switch/--no-switch/--worktree`:默认优先采用 `--worktree`(避免切走 superproject 分支导致 submodule 状态混乱);若不满足 `--worktree` 前置条件则回退为 `--no-switch`。
|
|
279
279
|
- 若 `changes/<change-id>/` 不存在:等价执行 `aiws change new ...`。
|
|
280
280
|
- 可选:`--hooks` 等价于 `aiws hooks install .`。
|
|
281
281
|
- 可选:`--switch` 显式允许切换 superproject 分支(仅在存在 `.gitmodules` 时有意义;否则等价于默认行为)。
|
|
282
|
-
- 实现细节:当存在 `.gitmodules` 且使用 `--switch` 时,CLI
|
|
282
|
+
- 实现细节:当存在 `.gitmodules` 且使用 `--switch` 时,CLI 只切 superproject 分支;submodules 保持当前状态,由 `ws-pull` / `ws-finish` 再统一挂回 `aiws/pin/<target-branch>`。
|
|
283
283
|
- 可选:`--no-switch` 不切换当前分支(仅确保目标分支存在,并初始化变更工件);适用于 superproject + submodule 场景,避免意外切换 A 目录分支导致 submodule 状态混乱。
|
|
284
284
|
- 可选:`--worktree` 使用 `git worktree` 创建一个独立工作区并在其中 checkout `change/<change-id>`,当前目录分支保持不变(推荐用于 superproject + submodule)。
|
|
285
|
+
- 当 `.gitmodules` 存在时,submodule 的 detached HEAD 恢复应统一使用 `aiws/pin/<target-branch>`;不要把 submodule 切到 `change/<change-id>`。
|
|
285
286
|
- 默认 worktree 目录:`../<repo-name>-<change-id>`(相对于 git root)
|
|
286
287
|
- 可选:`--worktree-dir <path>` 覆盖 worktree 目录(推荐放在仓库外;相对路径按 `../` 作为基准理解)
|
|
287
288
|
- 可选:`--submodules` 在 worktree 内执行 `git submodule update --init --recursive`(避免新 worktree 下 submodule 目录为空)
|
|
@@ -311,6 +312,7 @@ Dashboard API(本地只读):
|
|
|
311
312
|
- 只有完整 finish 成功(兼容旧事件 `finish`,新事件 `finish_done`)后,治理阶段才可进入 `ws-handoff`
|
|
312
313
|
- 当 `--push` 完整成功时,CLI 应自动执行 archive:将 `changes/<id>/` 移动到 `changes/archive/<YYYY-MM-DD>-<id>/`,生成 `handoff.md`,提交 `归档: <change-id>`,并将该 archive commit push 到同一目标分支
|
|
313
314
|
- 若 auto-archive commit/push 失败,应报错并保留已归档工件,提示用户继续提交/推送 archive 结果;不应要求重新做 merge
|
|
315
|
+
- 若发现“已 finish 但 active `changes/<id>/` 仍存在”的 `finished_unarchived` 状态,应视为 finish closeout 未完成:默认恢复动作是重跑 `aiws change finish <id> --push`,而不是继续开发或要求从头再做 merge
|
|
314
316
|
|
|
315
317
|
接口(仅定义):
|
|
316
318
|
- `aiws change finish [<change-id>] [--into <branch> | --base <branch>]`
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
"version": 1,
|
|
3
3
|
"description": "Machine-readable governance inference rules for aiws change status/next/dashboard.",
|
|
4
4
|
"governanceRules": [
|
|
5
|
+
{
|
|
6
|
+
"id": "finish_resume_required",
|
|
7
|
+
"when": { "signal": "finish_resume_required", "truthy": true },
|
|
8
|
+
"currentStage": "ws-finish",
|
|
9
|
+
"recommendedStage": "ws-finish",
|
|
10
|
+
"rationale": "finish already completed locally, but archive/push closeout is still pending; rerun finish to resume"
|
|
11
|
+
},
|
|
5
12
|
{
|
|
6
13
|
"id": "strict_blockers",
|
|
7
14
|
"when": { "signal": "blockers_strict_count", "gt": 0 },
|
|
@@ -269,9 +276,16 @@
|
|
|
269
276
|
"收尾已完成且 change 应已归档:下一步运行 `$ws-handoff` 检查/补充归档 handoff"
|
|
270
277
|
]
|
|
271
278
|
},
|
|
279
|
+
{
|
|
280
|
+
"id": "guidance_finish_resume_required",
|
|
281
|
+
"when": { "signal": "governance_rule_id", "eq": "finish_resume_required" },
|
|
282
|
+
"lines": [
|
|
283
|
+
"finish closeout 未完成:直接重跑 `aiws change finish {change_id} --push`(不要先在目标分支 worktree 运行 `aiws validate . --stamp`)"
|
|
284
|
+
]
|
|
285
|
+
},
|
|
272
286
|
{
|
|
273
287
|
"id": "guidance_finish_retry",
|
|
274
|
-
"when": { "signal": "governance_rule_id", "in": ["finish_failed", "finish_local"] },
|
|
288
|
+
"when": { "signal": "governance_rule_id", "in": ["finish_failed", "finish_local", "finish_resume_required"] },
|
|
275
289
|
"lines": [
|
|
276
290
|
"收尾未完整完成:检查 push / cleanup / submodule 状态后重跑 `$ws-finish`"
|
|
277
291
|
]
|
|
@@ -11,13 +11,14 @@
|
|
|
11
11
|
|
|
12
12
|
- version: `1`
|
|
13
13
|
- description: Machine-readable governance inference rules for aiws change status/next/dashboard.
|
|
14
|
-
- governance rules:
|
|
15
|
-
- guidance rules:
|
|
14
|
+
- governance rules: 17
|
|
15
|
+
- guidance rules: 17
|
|
16
16
|
|
|
17
17
|
## 阶段推断规则
|
|
18
18
|
|
|
19
19
|
| Rule ID | Match | Current | Next | Rationale |
|
|
20
20
|
| --- | --- | --- | --- | --- |
|
|
21
|
+
| `finish_resume_required` | `finish_resume_required` is truthy | `ws-finish` | `ws-finish` | finish already completed locally, but archive/push closeout is still pending; rerun finish to resume |
|
|
21
22
|
| `strict_blockers` | `blockers_strict_count` > 0 | `ws-plan-verify` | `ws-plan-verify` | strict blockers remain unresolved |
|
|
22
23
|
| `unchecked_tasks` | `tasks_unchecked` > 0 | `ws-dev` | `ws-dev` | {tasks_unchecked} unchecked task(s) remain |
|
|
23
24
|
| `finish_completed` | `finish_state` == `done` | `ws-finish` | `ws-handoff` | finish completed; archive should already exist and handoff is ready for follow-up |
|
|
@@ -52,7 +53,8 @@
|
|
|
52
53
|
| `guidance_deliver_finish` | (`governance_current_stage` == `ws-deliver`) AND (`governance_recommended_stage` == `ws-finish`) | 交付工件齐全后,进入 `$ws-finish`(安全合并 + push + cleanup) |
|
|
53
54
|
| `guidance_finish_cleanup_pending` | `governance_rule_id` == `finish_cleanup_pending` | push 已完成,但 cleanup 仍未完成({finish_state_reason});清理对应 worktree 后重跑 `$ws-finish` |
|
|
54
55
|
| `guidance_finish_handoff` | `governance_rule_id` == `finish_completed` | 收尾已完成且 change 应已归档:下一步运行 `$ws-handoff` 检查/补充归档 handoff |
|
|
55
|
-
| `
|
|
56
|
+
| `guidance_finish_resume_required` | `governance_rule_id` == `finish_resume_required` | finish closeout 未完成:直接重跑 `aiws change finish {change_id} --push`(不要先在目标分支 worktree 运行 `aiws validate . --stamp`) |
|
|
57
|
+
| `guidance_finish_retry` | `governance_rule_id` in [`finish_failed`, `finish_local`, `finish_resume_required`] | 收尾未完整完成:检查 push / cleanup / submodule 状态后重跑 `$ws-finish` |
|
|
56
58
|
| `guidance_handoff` | `governance_current_stage` == `ws-handoff` | 进入交接:在 AI 工具中运行 `$ws-handoff`,并检查归档 handoff 是否足够支撑下一次接力 |
|
|
57
59
|
| `guidance_default` | `governance_current_stage` == `` | 按阶段契约继续推进当前 change |
|
|
58
60
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"kind": "skill",
|
|
17
17
|
"summary": "默认 workflow bootstrap/router:先读真值,再把任务路由到正确的 `ws-*` 入口。",
|
|
18
18
|
"outputContract": [
|
|
19
|
-
"Root / Found / Missing",
|
|
19
|
+
"Root / Found / Missing / Intent status",
|
|
20
20
|
"Task intent / Binding status / Route",
|
|
21
21
|
"Why / Next"
|
|
22
22
|
]
|
|
@@ -32,6 +32,11 @@
|
|
|
32
32
|
"action": "判断当前任务是在做需求变更、实现、评审、收尾还是交接。",
|
|
33
33
|
"why": "先判 workflow,再决定进入哪个 skill;不能一开始就跳进实现。"
|
|
34
34
|
},
|
|
35
|
+
{
|
|
36
|
+
"step": "check_intent_freeze",
|
|
37
|
+
"action": "判断需求是否已经冻结;若存在多条待确认问题或需要多轮沟通,先进入 intake 阶段。",
|
|
38
|
+
"why": "中大型需求在计划前往往需要多轮澄清;router 应该先把问题冻结,而不是把沟通负担全部塞给 `ws-plan`。"
|
|
39
|
+
},
|
|
35
40
|
{
|
|
36
41
|
"step": "check_binding",
|
|
37
42
|
"action": "检查任务是否具备 `Req_ID` / `Problem_ID` / change 上下文 / Verify 入口等最小绑定。",
|
|
@@ -60,6 +65,14 @@
|
|
|
60
65
|
"gate": "必须先问 1-3 个关键澄清问题,然后停止。",
|
|
61
66
|
"rationale": "router 的职责是阻断模糊任务,而不是用猜测替代路由。"
|
|
62
67
|
},
|
|
68
|
+
{
|
|
69
|
+
"id": "needs_intake",
|
|
70
|
+
"intent": "需求存在多条待确认问题,尚未冻结",
|
|
71
|
+
"match": "任务是新需求或中大型变更;目标方向大致明确,但存在多条待确认问题、需要逐条沟通,或用户明确要求先多轮澄清再进入计划。",
|
|
72
|
+
"routeTo": "ws-intake",
|
|
73
|
+
"gate": "先逐条澄清并冻结结论;未形成 intake 草案前不进入 `ws-plan`。",
|
|
74
|
+
"rationale": "`ws-intake` 负责把多轮需求沟通收敛为轻量草案,避免 `ws-plan` 同时承担反复澄清与正式计划落盘。"
|
|
75
|
+
},
|
|
63
76
|
{
|
|
64
77
|
"id": "requirements_change",
|
|
65
78
|
"intent": "需求/验收/合同变更",
|
|
@@ -95,10 +108,10 @@
|
|
|
95
108
|
{
|
|
96
109
|
"id": "plan_first",
|
|
97
110
|
"intent": "中大型实现或需要建立 change 上下文",
|
|
98
|
-
"match": "任务是多步实现、跨文件、跨模块、需要方案、需要新建 change/worktree
|
|
111
|
+
"match": "任务是多步实现、跨文件、跨模块、需要方案、需要新建 change/worktree,且需求已经冻结或已有可消费的 intake 草案。",
|
|
99
112
|
"routeTo": "ws-plan",
|
|
100
113
|
"gate": "plan 过 gate 前不进入 `ws-dev`。",
|
|
101
|
-
"rationale": "medium/complex
|
|
114
|
+
"rationale": "medium/complex 任务在需求冻结后必须先生成可落盘计划,避免 router 直接跳进实现。"
|
|
102
115
|
},
|
|
103
116
|
{
|
|
104
117
|
"id": "direct_implementation",
|
|
@@ -126,6 +139,14 @@
|
|
|
126
139
|
"expectedRoute": "clarify",
|
|
127
140
|
"why": "这种场景必须先澄清意图和绑定,不能猜测实现。"
|
|
128
141
|
},
|
|
142
|
+
{
|
|
143
|
+
"id": "case_needs_intake",
|
|
144
|
+
"scenario": "任务方向大致明确,但存在多条待确认问题,需要逐条沟通后再计划。",
|
|
145
|
+
"request": "做一个新的 change intake 流程,我想先一条一条把需求和边界聊清楚,再进入正式计划。",
|
|
146
|
+
"expectedRuleId": "needs_intake",
|
|
147
|
+
"expectedRoute": "ws-intake",
|
|
148
|
+
"why": "这类需求不是完全不清晰,但还没有冻结,适合先走 intake。"
|
|
149
|
+
},
|
|
129
150
|
{
|
|
130
151
|
"id": "case_requirements_change",
|
|
131
152
|
"scenario": "任务要修改 REQUIREMENTS、requirements CSV 或 workflow 真值。",
|
|
@@ -179,13 +200,15 @@
|
|
|
179
200
|
"用户只说“继续”“优化一下”“看一下”,但没有明确目标对象或当前阶段。",
|
|
180
201
|
"无法把任务绑定到 `Req_ID` / `Problem_ID` / change 上下文。",
|
|
181
202
|
"没有可复现验证入口,且无法从 `AI_WORKSPACE.md` 推断。",
|
|
182
|
-
"当前描述同时包含需求变更、实现和收尾,但没有明确优先级。"
|
|
203
|
+
"当前描述同时包含需求变更、实现和收尾,但没有明确优先级。",
|
|
204
|
+
"同一个任务包含多条待确认问题,且用户希望逐条、多轮沟通。"
|
|
183
205
|
],
|
|
184
206
|
"universalRules": [
|
|
185
207
|
"router 自己不是实现阶段;先判定 workflow,再进入具体 `ws-*` skill。",
|
|
186
208
|
"除缺失真值场景外,router 至少要给出一个明确的 `Route:` 结果或明确的澄清问题。",
|
|
187
209
|
"当 `routeTo=clarify` 时,必须停止,不直接写代码。",
|
|
188
|
-
"当 `routeTo=ws-
|
|
210
|
+
"当 `routeTo=ws-intake` 时,必须先逐条冻结问题并产出 intake 草案;不要跳过到 `ws-plan`。",
|
|
211
|
+
"当 `routeTo=ws-plan` / `ws-dev` / `ws-review` / `ws-finish` / `ws-handoff` / `ws-req-review` / `ws-intake` 时,后续行为必须遵循对应 skill 契约。",
|
|
189
212
|
"任何 route 都不能绕过 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`。"
|
|
190
213
|
],
|
|
191
214
|
"notes": [
|
|
@@ -22,7 +22,7 @@ router 在做任何 workflow 判断前,必须先读取:
|
|
|
22
22
|
- kind: `skill`
|
|
23
23
|
- summary: 默认 workflow bootstrap/router:先读真值,再把任务路由到正确的 `ws-*` 入口。
|
|
24
24
|
- output contract:
|
|
25
|
-
- Root / Found / Missing
|
|
25
|
+
- Root / Found / Missing / Intent status
|
|
26
26
|
- Task intent / Binding status / Route
|
|
27
27
|
- Why / Next
|
|
28
28
|
|
|
@@ -32,6 +32,7 @@ router 在做任何 workflow 判断前,必须先读取:
|
|
|
32
32
|
| --- | --- | --- |
|
|
33
33
|
| `read_truths` | 先定位项目根,并读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`。 | router 不能绕过真值文件,否则会把 workflow 判断建立在会话猜测上。 |
|
|
34
34
|
| `classify_intent` | 判断当前任务是在做需求变更、实现、评审、收尾还是交接。 | 先判 workflow,再决定进入哪个 skill;不能一开始就跳进实现。 |
|
|
35
|
+
| `check_intent_freeze` | 判断需求是否已经冻结;若存在多条待确认问题或需要多轮沟通,先进入 intake 阶段。 | 中大型需求在计划前往往需要多轮澄清;router 应该先把问题冻结,而不是把沟通负担全部塞给 `ws-plan`。 |
|
|
35
36
|
| `check_binding` | 检查任务是否具备 `Req_ID` / `Problem_ID` / change 上下文 / Verify 入口等最小绑定。 | 缺失绑定时必须阻断或回退到 `ws-plan`,避免无归因实现。 |
|
|
36
37
|
| `route_or_clarify` | 给出单一路由结果;若意图不明确,则先问关键澄清问题并停止。 | default-routed workflow 的关键不是自动执行,而是避免模糊任务直接进入实现。 |
|
|
37
38
|
|
|
@@ -41,11 +42,12 @@ router 在做任何 workflow 判断前,必须先读取:
|
|
|
41
42
|
| --- | --- | --- | --- | --- | --- |
|
|
42
43
|
| `missing_truths` | 仓库未初始化或真值缺失 | 缺失任一真值文件,或无法确定项目根目录。 | `ws-preflight` | 先补齐真值或确认项目根,不进入实现。 | 所有后续 skill 都依赖真值文件;缺失时 router 只能回退到 preflight/init 路径。 |
|
|
43
44
|
| `unclear_intent` | 用户目标、归因或验收不清晰 | 无法明确当前是需求变更、实现、评审、finish 还是 handoff;或无法明确 `Req_ID` / `Problem_ID` / Verify。 | `clarify` | 必须先问 1-3 个关键澄清问题,然后停止。 | router 的职责是阻断模糊任务,而不是用猜测替代路由。 |
|
|
45
|
+
| `needs_intake` | 需求存在多条待确认问题,尚未冻结 | 任务是新需求或中大型变更;目标方向大致明确,但存在多条待确认问题、需要逐条沟通,或用户明确要求先多轮澄清再进入计划。 | `ws-intake` | 先逐条澄清并冻结结论;未形成 intake 草案前不进入 `ws-plan`。 | `ws-intake` 负责把多轮需求沟通收敛为轻量草案,避免 `ws-plan` 同时承担反复澄清与正式计划落盘。 |
|
|
44
46
|
| `requirements_change` | 需求/验收/合同变更 | 任务涉及 `REQUIREMENTS.md`、requirements CSV、spec contract、验收标准或 workflow 真值变更。 | `ws-req-review` | 先做需求评审,再决定是否进入 `ws-plan` / `ws-dev`。 | 需求真值变更必须先过 review,不能直接编码。 |
|
|
45
47
|
| `review_request` | 审计/评审/找风险 | 用户明确要求 review、audit、评审、找 bug、识别风险或检查回归。 | `ws-review` | 先给 findings;除非用户另行要求,不先改代码。 | 评审任务与实现任务的输出契约不同,必须优先走 review。 |
|
|
46
48
|
| `finish_request` | 收尾/合并/推送/cleanup | 用户要求 finish、merge、push、收尾、交付完成、清理 worktree 或 branch。 | `ws-finish` | 必须满足 finish gate,不能跳过 validate / push / cleanup。 | finish 是独立治理阶段,不能与普通实现混用。 |
|
|
47
49
|
| `handoff_request` | 交接/归档总结 | 用户要求 handoff、交接说明、archive summary、会话总结或接力说明。 | `ws-handoff` | 先确认 change 已 finish 或 archive 上下文存在。 | handoff 依赖已有证据与归档上下文,不应在实现前触发。 |
|
|
48
|
-
| `plan_first` | 中大型实现或需要建立 change 上下文 | 任务是多步实现、跨文件、跨模块、需要方案、需要新建 change/worktree
|
|
50
|
+
| `plan_first` | 中大型实现或需要建立 change 上下文 | 任务是多步实现、跨文件、跨模块、需要方案、需要新建 change/worktree,且需求已经冻结或已有可消费的 intake 草案。 | `ws-plan` | plan 过 gate 前不进入 `ws-dev`。 | medium/complex 任务在需求冻结后必须先生成可落盘计划,避免 router 直接跳进实现。 |
|
|
49
51
|
| `direct_implementation` | 小步实现/修复/配置调整 | 目标明确、归因清晰、验证入口明确,且无需先改 requirements 或单独评审。 | `ws-dev` | 若执行中发现复杂度升高,必须回退到 `ws-plan`。 | router 允许明确的小步任务直接实现,但必须保留回退计划阶段的门;若用户明确要走轻量入口,可在实现阶段显式使用 `ws-dev-lite` 作为 `ws-dev` 的 facade。 |
|
|
50
52
|
|
|
51
53
|
## Route Cases
|
|
@@ -54,6 +56,7 @@ router 在做任何 workflow 判断前,必须先读取:
|
|
|
54
56
|
| --- | --- | --- | --- | --- | --- |
|
|
55
57
|
| `case_missing_truths` | 仓库未初始化或真值缺失时,不能直接开始实现。 | 在一个还没执行 aiws init 的仓库里继续开发这个功能。 | `missing_truths` | `ws-preflight` | 缺失真值文件时只能先补齐 preflight/init 路径。 |
|
|
56
58
|
| `case_unclear_continue` | 用户只说继续,但没有明确当前 change、归因或验证入口。 | 继续。 | `unclear_intent` | `clarify` | 这种场景必须先澄清意图和绑定,不能猜测实现。 |
|
|
59
|
+
| `case_needs_intake` | 任务方向大致明确,但存在多条待确认问题,需要逐条沟通后再计划。 | 做一个新的 change intake 流程,我想先一条一条把需求和边界聊清楚,再进入正式计划。 | `needs_intake` | `ws-intake` | 这类需求不是完全不清晰,但还没有冻结,适合先走 intake。 |
|
|
57
60
|
| `case_requirements_change` | 任务要修改 REQUIREMENTS、requirements CSV 或 workflow 真值。 | 更新 REQUIREMENTS.md 和 requirements/requirements-issues.csv,补充验收标准。 | `requirements_change` | `ws-req-review` | 需求真值变更必须先做需求评审。 |
|
|
58
61
|
| `case_review_request` | 用户明确要求 review、审计、找风险或检查回归。 | review 这批改动,先给我风险和回归点,不要先改代码。 | `review_request` | `ws-review` | 评审任务的输出契约是 findings,不应直接进入实现。 |
|
|
59
62
|
| `case_finish_request` | 用户要求合并、push、cleanup 或 finish 当前 change。 | 把 demo-change finish 掉并 push,顺便 cleanup worktree。 | `finish_request` | `ws-finish` | finish 是独立治理阶段,必须先走 finish gate。 |
|
|
@@ -67,13 +70,15 @@ router 在做任何 workflow 判断前,必须先读取:
|
|
|
67
70
|
- 无法把任务绑定到 `Req_ID` / `Problem_ID` / change 上下文。
|
|
68
71
|
- 没有可复现验证入口,且无法从 `AI_WORKSPACE.md` 推断。
|
|
69
72
|
- 当前描述同时包含需求变更、实现和收尾,但没有明确优先级。
|
|
73
|
+
- 同一个任务包含多条待确认问题,且用户希望逐条、多轮沟通。
|
|
70
74
|
|
|
71
75
|
## 统一规则
|
|
72
76
|
|
|
73
77
|
- router 自己不是实现阶段;先判定 workflow,再进入具体 `ws-*` skill。
|
|
74
78
|
- 除缺失真值场景外,router 至少要给出一个明确的 `Route:` 结果或明确的澄清问题。
|
|
75
79
|
- 当 `routeTo=clarify` 时,必须停止,不直接写代码。
|
|
76
|
-
- 当 `routeTo=ws-
|
|
80
|
+
- 当 `routeTo=ws-intake` 时,必须先逐条冻结问题并产出 intake 草案;不要跳过到 `ws-plan`。
|
|
81
|
+
- 当 `routeTo=ws-plan` / `ws-dev` / `ws-review` / `ws-finish` / `ws-handoff` / `ws-req-review` / `ws-intake` 时,后续行为必须遵循对应 skill 契约。
|
|
77
82
|
- 任何 route 都不能绕过 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`。
|
|
78
83
|
|
|
79
84
|
## 说明
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
],
|
|
9
9
|
"standardChain": [
|
|
10
10
|
"ws-preflight",
|
|
11
|
+
"ws-intake",
|
|
11
12
|
"ws-plan",
|
|
12
13
|
"ws-plan-verify",
|
|
13
14
|
"ws-dev",
|
|
@@ -30,21 +31,29 @@
|
|
|
30
31
|
"requiredInputs": "项目根;AI_PROJECT.md;REQUIREMENTS.md;AI_WORKSPACE.md",
|
|
31
32
|
"requiredOutputs": "Root / Found / Missing / Key rules / Next",
|
|
32
33
|
"blockers": "无法确定项目根;真值缺失",
|
|
33
|
-
"next": "ws-plan 或 ws-dev"
|
|
34
|
+
"next": "ws-intake / ws-plan 或 ws-dev"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"stage": "ws-intake",
|
|
38
|
+
"goal": "逐条澄清问题并冻结需求结论,产出可被计划阶段消费的草案",
|
|
39
|
+
"requiredInputs": "任务描述;真值文件;当前已知绑定与约束;若已存在则读取最新 intake 草案",
|
|
40
|
+
"requiredOutputs": "plan/*.intake.md;Open Questions / Resolved Questions / Frozen Decisions / Draft Scope / Draft Verify / Ready for ws-plan",
|
|
41
|
+
"blockers": "任务目标完全无法识别;关键真值缺失;无法把当前问题收敛为 frozen 或 deferred",
|
|
42
|
+
"next": "继续 intake 或进入 ws-plan"
|
|
34
43
|
},
|
|
35
44
|
{
|
|
36
45
|
"stage": "ws-plan",
|
|
37
46
|
"goal": "建立 change 绑定并落盘计划",
|
|
38
|
-
"requiredInputs": "任务描述;真值文件;proposal.md
|
|
47
|
+
"requiredInputs": "任务描述;真值文件;proposal.md(若存在);若已有则优先消费最新 intake 草案",
|
|
39
48
|
"requiredOutputs": "plan/...;Bindings;Verify;Risks;Evidence;Next",
|
|
40
|
-
"blockers": "
|
|
49
|
+
"blockers": "绑定不清;需求尚未冻结;dirty 工作区无法安全建 context;无法写盘",
|
|
41
50
|
"next": "ws-plan-verify"
|
|
42
51
|
},
|
|
43
52
|
{
|
|
44
53
|
"stage": "ws-plan-verify",
|
|
45
|
-
"goal": "
|
|
54
|
+
"goal": "检查计划是否满足严格契约,并做多视角方案审查",
|
|
46
55
|
"requiredInputs": "plan/...;proposal.md;当前 change",
|
|
47
|
-
"requiredOutputs": "Quality gate;Fix list;可执行最小计划摘要",
|
|
56
|
+
"requiredOutputs": "Quality gate;Perspective findings;Fix list;可执行最小计划摘要",
|
|
48
57
|
"blockers": "strict 校验失败;无法定位 change",
|
|
49
58
|
"next": "修计划后重跑或进入 ws-dev"
|
|
50
59
|
},
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
默认链路:
|
|
14
14
|
|
|
15
|
-
`ws-preflight` -> `ws-plan` -> `ws-plan-verify` -> `ws-dev` -> `ws-review` -> `ws-commit` -> `ws-deliver` -> `ws-finish` -> `ws-handoff`
|
|
15
|
+
`ws-preflight` -> `ws-intake` -> `ws-plan` -> `ws-plan-verify` -> `ws-dev` -> `ws-review` -> `ws-commit` -> `ws-deliver` -> `ws-finish` -> `ws-handoff`
|
|
16
16
|
|
|
17
17
|
说明:
|
|
18
18
|
- ws-deliver 用于多 repo / submodule 场景的顺序提交与交付准备。
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
|
|
25
25
|
| Stage | 目标 | 必需输入 | 必需输出 | 阻断条件 | 下一步 |
|
|
26
26
|
| --- | --- | --- | --- | --- | --- |
|
|
27
|
-
| `ws-preflight` | 对齐真值文件与协作约束 | 项目根;AI_PROJECT.md;REQUIREMENTS.md;AI_WORKSPACE.md | Root / Found / Missing / Key rules / Next | 无法确定项目根;真值缺失 | ws-plan 或 ws-dev |
|
|
28
|
-
| `ws-
|
|
29
|
-
| `ws-plan
|
|
27
|
+
| `ws-preflight` | 对齐真值文件与协作约束 | 项目根;AI_PROJECT.md;REQUIREMENTS.md;AI_WORKSPACE.md | Root / Found / Missing / Key rules / Next | 无法确定项目根;真值缺失 | ws-intake / ws-plan 或 ws-dev |
|
|
28
|
+
| `ws-intake` | 逐条澄清问题并冻结需求结论,产出可被计划阶段消费的草案 | 任务描述;真值文件;当前已知绑定与约束;若已存在则读取最新 intake 草案 | plan/*.intake.md;Open Questions / Resolved Questions / Frozen Decisions / Draft Scope / Draft Verify / Ready for ws-plan | 任务目标完全无法识别;关键真值缺失;无法把当前问题收敛为 frozen 或 deferred | 继续 intake 或进入 ws-plan |
|
|
29
|
+
| `ws-plan` | 建立 change 绑定并落盘计划 | 任务描述;真值文件;proposal.md(若存在);若已有则优先消费最新 intake 草案 | plan/...;Bindings;Verify;Risks;Evidence;Next | 绑定不清;需求尚未冻结;dirty 工作区无法安全建 context;无法写盘 | ws-plan-verify |
|
|
30
|
+
| `ws-plan-verify` | 检查计划是否满足严格契约,并做多视角方案审查 | plan/...;proposal.md;当前 change | Quality gate;Perspective findings;Fix list;可执行最小计划摘要 | strict 校验失败;无法定位 change | 修计划后重跑或进入 ws-dev |
|
|
30
31
|
| `ws-dev` | 实施最小改动并验证 | 真值文件;归因目标;计划(medium/complex) | Changed;Verify;Evidence;Next | 无法归因;没有验证入口;change 上下文不安全 | ws-review / ws-commit |
|
|
31
32
|
| `ws-review` | 审计规范、风险与验证完整性 | 当前 diff;验证结果;真值文件 | review 文件;Top risks;Next | 无改动可审;无法写审计证据 | ws-commit 或修复后重审 |
|
|
32
33
|
| `ws-commit` | 串联 review、validate、commit 确认 | staged diff;review 证据;validate stamp;用户确认的 message | Evidence;Context;Commit | 无 staged changes;submodule dirty;validate 失败;message 未确认 | ws-deliver / ws-finish |
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ description: 默认 workflow bootstrap/router:先读真值,再路由到正
|
|
|
9
9
|
- 作为默认入口,先读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`
|
|
10
10
|
- 先判定当前任务属于哪个 workflow,再进入具体 `ws-*` skill
|
|
11
11
|
- 若任务意图、归因或验证入口不明确:先澄清,不直接进入实现
|
|
12
|
+
- 若任务方向大致明确但仍有多条待确认问题:先进入 `$ws-intake` 冻结需求,再进入计划
|
|
12
13
|
|
|
13
14
|
阶段定位:
|
|
14
15
|
- bootstrap/router 阶段;负责 workflow 分流,而不是直接完成实现。
|
|
@@ -23,6 +24,7 @@ description: 默认 workflow bootstrap/router:先读真值,再路由到正
|
|
|
23
24
|
必需输出:
|
|
24
25
|
- `Root:` 当前项目根
|
|
25
26
|
- `Found:` 实际读取到的真值文件
|
|
27
|
+
- `Intent status:` 当前需求是否已经冻结
|
|
26
28
|
- `Task intent:` 当前任务意图分类
|
|
27
29
|
- `Binding:` `Req_ID` / `Problem_ID` / change 上下文是否清晰
|
|
28
30
|
- `Route:` 选中的下一步 skill
|
|
@@ -52,14 +54,22 @@ description: 默认 workflow bootstrap/router:先读真值,再路由到正
|
|
|
52
54
|
- 评审/审计/找风险:`$ws-review`
|
|
53
55
|
- finish / merge / push / cleanup:`$ws-finish`
|
|
54
56
|
- handoff / archive summary:`$ws-handoff`
|
|
55
|
-
-
|
|
57
|
+
- 新需求或中大型变更,且存在多条待确认问题 / 用户要求逐条多轮沟通:`$ws-intake`
|
|
58
|
+
- 中大型实现、需要方案、需要 change/worktree,且需求已经冻结:`$ws-plan`
|
|
56
59
|
- 小步明确实现/修复/配置调整:`$ws-dev`(若是 simple/local 单点修复,且用户明确希望走轻量入口,可显式进入 `$ws-dev-lite`)
|
|
57
60
|
4) 若任务意图或归因不明确:
|
|
58
61
|
- 只问 1-3 个关键澄清问题
|
|
59
62
|
- 明确写出缺的是什么:意图、`Req_ID` / `Problem_ID`、verify、change 上下文
|
|
60
63
|
- 然后停止;不要直接写代码
|
|
61
|
-
5)
|
|
64
|
+
5) 若任务方向大致明确,但同一个任务包含多条待确认问题、范围尚未冻结,或用户明确说“想一条一条聊清楚再计划”:
|
|
65
|
+
- 输出 `Intent status: not_frozen`
|
|
66
|
+
- `Route: $ws-intake`
|
|
67
|
+
- `Why:` 说明当前不适合直接进入 `$ws-plan`
|
|
68
|
+
- `Next:` 进入 `$ws-intake`
|
|
69
|
+
- 然后在同一轮中继续遵循 `$ws-intake` 的契约
|
|
70
|
+
6) 若已确定 route:
|
|
62
71
|
- 先输出:
|
|
72
|
+
- `Intent status:`
|
|
63
73
|
- `Task intent:`
|
|
64
74
|
- `Binding:`
|
|
65
75
|
- `Route:`
|
|
@@ -69,17 +79,19 @@ description: 默认 workflow bootstrap/router:先读真值,再路由到正
|
|
|
69
79
|
- 否则:
|
|
70
80
|
- `Next:` 进入对应主 skill
|
|
71
81
|
- 然后在同一轮中继续遵循对应 skill 的契约
|
|
72
|
-
|
|
82
|
+
7) 路由约束:
|
|
73
83
|
- router 自己不是实现阶段;不要在给出 route 之前直接改代码
|
|
74
84
|
- 除非用户只想听判断结果,否则给出 route 后应继续按对应 skill 的规则推进
|
|
75
85
|
- 一次只选择一个主 route;不要把 `ws-plan` / `ws-dev` / `ws-review` / `ws-finish` 混成并行终态
|
|
76
|
-
|
|
86
|
+
8) 若执行过程中发现复杂度升高:
|
|
77
87
|
- 从 `$ws-dev` 回退到 `$ws-plan`
|
|
88
|
+
- 从 `$ws-plan` 回退到 `$ws-intake`(当发现需求并未冻结)
|
|
78
89
|
- 从 `$ws-finish` 回退到前置门禁而不是硬推完成
|
|
79
90
|
|
|
80
91
|
输出模板:
|
|
81
92
|
- `Root:` <path>
|
|
82
93
|
- `Found:` <files>
|
|
94
|
+
- `Intent status:` <frozen / not_frozen>
|
|
83
95
|
- `Task intent:` <分类>
|
|
84
96
|
- `Binding:` <清晰 / 缺失项>
|
|
85
97
|
- `Route:` <$ws-... 或 clarify>
|
|
@@ -14,7 +14,8 @@ description: 收尾(门禁 + 安全合并 + submodule→主仓库顺序 push
|
|
|
14
14
|
前置(必须):
|
|
15
15
|
- 工作区是干净的:`git status --porcelain` 无输出(若有未提交改动:先 commit 或 stash)
|
|
16
16
|
- change 分支已存在:`change/<change-id>`(也支持 `changes/`、`ws/`、`ws-change/`)
|
|
17
|
-
- 若使用 worktree
|
|
17
|
+
- 若使用 worktree:普通 finish 的 `validate/evidence/state` 先在 `change/<change-id>` worktree 完成;真正执行 `aiws change finish` 时再切到目标分支所在 worktree(命令会提示正确的 worktree)
|
|
18
|
+
- 若 `aiws change status <change-id>` 输出 `governance_rule: finish_resume_required`:说明 merge 已发生,只剩 push / archive / cleanup closeout;直接在该 worktree 运行 `aiws change finish <change-id> --push`,不要先跑 `aiws validate . --stamp`
|
|
18
19
|
- 若存在 `.gitmodules`:必须为每个 submodule 配置 `submodule.<name>.branch`(否则无法确定性减少 detached;先运行 `$ws-submodule-setup` 并提交 `.gitmodules`)
|
|
19
20
|
|
|
20
21
|
阶段定位:
|
|
@@ -60,7 +61,11 @@ if [[ -f .gitmodules ]]; then
|
|
|
60
61
|
fi
|
|
61
62
|
fi
|
|
62
63
|
```
|
|
63
|
-
|
|
64
|
+
0.5) 先运行 `aiws change status <change-id>`,优先看稳定字段 `governance_rule:`:
|
|
65
|
+
- 若为 `finish_resume_required`:直接跳到步骤 2 执行 `aiws change finish <change-id> --push`
|
|
66
|
+
- 若不是该值:按普通 finish 继续;不要依赖自然语言提示句做分支判断
|
|
67
|
+
|
|
68
|
+
1) (推荐,仅适用于普通 finish,且应在 `change/<change-id>` worktree 执行)先跑一次门禁并落盘证据:
|
|
64
69
|
```bash
|
|
65
70
|
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
66
71
|
./node_modules/.bin/aiws validate . --stamp
|
|
@@ -70,7 +75,10 @@ else
|
|
|
70
75
|
npx @aipper/aiws validate . --stamp
|
|
71
76
|
fi
|
|
72
77
|
```
|
|
73
|
-
|
|
78
|
+
若你已经位于目标分支 worktree,且 `governance_rule` 不是 `finish_resume_required`:
|
|
79
|
+
- 不要在这里跑 `aiws validate . --stamp`
|
|
80
|
+
- 先回 `change/<change-id>` worktree 补齐 finish gate,或先跑 `$ws-verify-before-complete`
|
|
81
|
+
1.1) (强烈建议,仅适用于普通 finish)收敛持久证据并回填 `Evidence_Path`:
|
|
74
82
|
```bash
|
|
75
83
|
change_id="<change-id>"
|
|
76
84
|
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
@@ -81,7 +89,7 @@ else
|
|
|
81
89
|
npx @aipper/aiws change evidence "${change_id}"
|
|
82
90
|
fi
|
|
83
91
|
```
|
|
84
|
-
1.2)
|
|
92
|
+
1.2) (可选,仅适用于普通 finish)生成状态快照(建议):
|
|
85
93
|
```bash
|
|
86
94
|
aiws change state "${change_id}" --write
|
|
87
95
|
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-intake
|
|
3
|
+
description: 计划前置澄清(逐条冻结问题并产出 intake 草案,供 ws-plan 消费)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 在进入 `$ws-plan` 前,把新需求或中大型变更里的待确认问题逐条澄清并冻结
|
|
10
|
+
- 采用“一题一线程”模式推进:每次只处理 1 个问题,允许该问题多轮往返,直到形成明确结论
|
|
11
|
+
- 产出一份可被 `$ws-plan` 消费的轻量草案:`plan/<timestamp>-<slug>.intake.md`
|
|
12
|
+
|
|
13
|
+
约束:
|
|
14
|
+
- 不直接创建 change,不直接落正式 `plan/...`,不直接进入实现
|
|
15
|
+
- 同一时刻只能有 1 条问题处于 `in_discussion`
|
|
16
|
+
- 当前问题没有被标记为 `frozen` 或 `deferred` 前,不进入下一题
|
|
17
|
+
- 新衍生问题只加入 `Open Questions` 队列,不抢占当前问题
|
|
18
|
+
|
|
19
|
+
阶段定位:
|
|
20
|
+
- pre-planning 阶段;负责把“多轮沟通”从正式计划阶段剥离出来,先冻结需求结论。
|
|
21
|
+
|
|
22
|
+
必需输入:
|
|
23
|
+
- 当前任务描述
|
|
24
|
+
- 真值文件:`AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`
|
|
25
|
+
- 若已存在:最新 `plan/*.intake.md`
|
|
26
|
+
|
|
27
|
+
必需输出:
|
|
28
|
+
- `Intake file:` 实际写入的 `plan/*.intake.md`
|
|
29
|
+
- `Current question:` 当前正在处理的问题
|
|
30
|
+
- `Open Questions:` 尚未冻结的问题列表
|
|
31
|
+
- `Frozen Decisions:` 已冻结结论
|
|
32
|
+
- `Ready for ws-plan:` yes/no
|
|
33
|
+
- `Next:` 继续 `$ws-intake` 或进入 `$ws-plan`
|
|
34
|
+
|
|
35
|
+
阻断条件:
|
|
36
|
+
- 无法确定项目根或真值文件缺失
|
|
37
|
+
- 当前问题无法被表达为具体、可冻结的决策
|
|
38
|
+
- 无法把澄清结果实际写盘
|
|
39
|
+
|
|
40
|
+
完成判定:
|
|
41
|
+
- 已有一份最新 intake 草案,且当前轮次至少把 1 条问题推进到 `frozen` 或 `deferred`
|
|
42
|
+
- 当 `Open Questions` 已清空,或剩余问题明确被标记为 `deferred`,输出 `Ready for ws-plan: yes`
|
|
43
|
+
|
|
44
|
+
执行步骤(建议):
|
|
45
|
+
1) 先运行 `$ws-preflight`,读取真值文件并输出约束摘要。
|
|
46
|
+
2) 读取当前任务描述;若存在最新 `plan/*.intake.md`,先读取其中的:
|
|
47
|
+
- `Open Questions`
|
|
48
|
+
- `Resolved Questions`
|
|
49
|
+
- `Frozen Decisions`
|
|
50
|
+
- `Draft Scope`
|
|
51
|
+
- `Draft Verify`
|
|
52
|
+
3) 初始化或续写问题队列:
|
|
53
|
+
- 把当前任务拆成 `N` 条待决问题
|
|
54
|
+
- 每条问题都要写成一句明确的决策句,而不是模糊话题
|
|
55
|
+
- 状态只允许:`open` / `in_discussion` / `frozen` / `deferred`
|
|
56
|
+
4) 选择唯一的当前问题:
|
|
57
|
+
- 优先取已有 `in_discussion`
|
|
58
|
+
- 否则取最影响 `Goal / Scope / Verify / Binding` 的 `open`
|
|
59
|
+
5) 对当前问题输出并沟通:
|
|
60
|
+
- `Current question:`
|
|
61
|
+
- `Why it matters:`
|
|
62
|
+
- `Current options / current understanding:`
|
|
63
|
+
- `Exit condition:` 这条问题在什么条件下算谈完
|
|
64
|
+
6) 只推进当前问题:
|
|
65
|
+
- 允许围绕这 1 条问题多轮问答
|
|
66
|
+
- 若用户回答引出新问题:加入 `Open Questions`
|
|
67
|
+
- 若当前问题已经有明确结论:标记为 `frozen`
|
|
68
|
+
- 若当前问题故意留到后面:标记为 `deferred`
|
|
69
|
+
7) 每次落盘 `plan/<timestamp>-<slug>.intake.md`,至少包含:
|
|
70
|
+
- `Context`
|
|
71
|
+
- `Open Questions`
|
|
72
|
+
- `Resolved Questions`
|
|
73
|
+
- `Frozen Decisions`
|
|
74
|
+
- `Draft Scope`
|
|
75
|
+
- `Draft Verify`
|
|
76
|
+
- `Ready for ws-plan: yes/no`
|
|
77
|
+
8) 判断是否可以移交给 `$ws-plan`:
|
|
78
|
+
- 若仍有关键问题未冻结:`Ready for ws-plan: no`,`Next: 继续 $ws-intake`
|
|
79
|
+
- 若关键问题已冻结,剩余仅是实现细节或已标记 `deferred`:`Ready for ws-plan: yes`,`Next: $ws-plan`
|
|
80
|
+
|
|
81
|
+
输出要求:
|
|
82
|
+
- `Intake file:` <实际写入的路径>
|
|
83
|
+
- `Current question:` <当前问题>
|
|
84
|
+
- `Open Questions:` <剩余问题列表>
|
|
85
|
+
- `Frozen Decisions:` <已冻结结论>
|
|
86
|
+
- `Ready for ws-plan:` <yes/no>
|
|
87
|
+
- `Next:` <继续 `$ws-intake` 或进入 `$ws-plan`>
|
|
@@ -24,6 +24,7 @@ description: 规划(生成可落盘 plan/ 工件;供 ws-dev 执行)
|
|
|
24
24
|
必需输入:
|
|
25
25
|
- 当前任务描述
|
|
26
26
|
- 真值文件:`AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`
|
|
27
|
+
- 若已存在:最新 `plan/*.intake.md`
|
|
27
28
|
- 若已存在:`changes/<change-id>/proposal.md`
|
|
28
29
|
- 若已有计划:当前 `plan/...` 文件
|
|
29
30
|
|
|
@@ -44,9 +45,13 @@ description: 规划(生成可落盘 plan/ 工件;供 ws-dev 执行)
|
|
|
44
45
|
|
|
45
46
|
执行步骤(建议):
|
|
46
47
|
1) 先运行 `$ws-preflight`(读取真值文件并输出约束摘要)。
|
|
47
|
-
2)
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
2) 若存在最新 `plan/*.intake.md`:
|
|
49
|
+
- 优先读取其中的 `Open Questions` / `Resolved Questions` / `Frozen Decisions` / `Draft Scope` / `Draft Verify`
|
|
50
|
+
- 若 `Ready for ws-plan: yes`,把它作为本次计划输入
|
|
51
|
+
- 若仍有未冻结问题,或明确写着 `Ready for ws-plan: no`:停止,并回退到 `$ws-intake`
|
|
52
|
+
3) 若用户任务描述不清,且也没有可消费的 intake 草案:先问 1-3 个关键澄清问题(不要猜);若问题较多则回退到 `$ws-intake`
|
|
53
|
+
4) 判断复杂度:`simple / medium / complex`(给出一句理由),并估算步骤数。
|
|
54
|
+
5) 识别或建立主索引 / change 上下文:
|
|
50
55
|
- 若存在 `changes/<change-id>/proposal.md`:读取其中 `Change_ID` / `Req_ID` / `Problem_ID` / `Contract_Row` / `Evidence_Path`
|
|
51
56
|
- 若缺失关键绑定:先补齐 proposal(至少 `Change_ID`、`Req_ID|Problem_ID`、`Contract_Row`)再继续生成计划
|
|
52
57
|
- 若当前不在 `change/<change-id>` 分支 / worktree,且本次任务需要新建 change:先调用 `aiws change start` 建立上下文,再继续写 plan
|
|
@@ -81,25 +86,26 @@ else
|
|
|
81
86
|
fi
|
|
82
87
|
```
|
|
83
88
|
- 若上一步创建了 worktree:后续所有读取/写入都必须切到 `aiws change start` 输出的 `worktree:` 路径中进行;不要把 `plan/...` 写回原工作区
|
|
84
|
-
|
|
89
|
+
6) 生成计划文件:
|
|
85
90
|
- 文件名:`plan/YYYY-MM-DD_HH-MM-SS-<slug>.md`(`<slug>` 用 kebab-case;同一任务调整计划时尽量复用同一文件)
|
|
86
91
|
- 若 `plan/` 不存在先创建
|
|
87
92
|
- 必须实际写入到磁盘(不要只在对话里输出);如因权限/策略无法写盘,必须明确说明原因并输出可复制的完整内容
|
|
88
93
|
- 计划必须写在当前 active change 上下文内:若当前已进入 `change/<change-id>` worktree,则 `plan/...`、`proposal.md`、`tasks.md` 都应写在该 worktree 中
|
|
89
|
-
|
|
94
|
+
7) 计划内容至少包含(不要留空):
|
|
90
95
|
- `Bindings`:`Change_ID` / `Req_ID` / `Problem_ID` / `Contract_Row` / `Plan_File` / `Evidence_Path`
|
|
91
96
|
- `Goal`:要达成什么
|
|
92
97
|
- `Non-goals`:明确不做什么(避免 scope creep)
|
|
98
|
+
- `Intake Decisions`(若消费了 intake 草案):列出本次从 intake 继承的已冻结结论;不要重新打开除非明确发现冲突
|
|
93
99
|
- `Scope`:默认写成 `## Scope` 或 `## 影响范围(Scope)`,并包含 `### In Scope` / `### Out of Scope`;`In Scope` 下列出允许修改的文件/目录清单(支持 glob,不确定就写 `TBD` 并说明如何确定)
|
|
94
100
|
- `Plan`:分步执行(每步尽量落到具体文件/命令;必要时拆 Phase)
|
|
95
101
|
- `Submodules`(当存在 `.gitmodules` 且声明了 submodule 条目时,强制):声明“本次 change 的 submodule 目标分支真值”(用于同一 superproject 分支内的多渠道交付;也避免仅靠 `.gitmodules` 默认分支导致交付推送到错误分支)
|
|
96
102
|
- `Verify`:可复现命令 + 期望结果(优先引用 `AI_WORKSPACE.md` 的入口;必要时补充 e2e)
|
|
97
103
|
- `Risks & Rollback`:风险点 + 回滚方案(例如 git 回滚、`aiws rollback`、恢复备份等)
|
|
98
104
|
- `Evidence`:计划文件路径;若创建了变更工件则附 `changes/<change-id>/...`
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
8) 若存在 change proposal:回填并对齐 `proposal.md` 的 `Plan_File`(必要时同步 `Contract_Row` / `Evidence_Path`),保证 plan/proposal 一致。
|
|
106
|
+
9) 运行 `$ws-plan-verify` 作为执行前质量门(计划不过长、不跑偏、验证可复现)。
|
|
107
|
+
10) 若计划涉及“需求/验收”变更:先用 `$ws-req-review` 评审 → 用户确认后再 `$ws-req-change` 落盘(避免需求漂移)。
|
|
108
|
+
11) 多步任务(≥2 步):后续进入实现时,使用 `update_plan` 工具跟踪 `pending → in_progress → completed`。
|
|
103
109
|
|
|
104
110
|
补充:submodule 目标分支真值(强约束;同一 superproject 分支内可多渠道)
|
|
105
111
|
- 背景:`.gitmodules submodule.<name>.branch` 适合作为“团队默认分支真值”,但当同一 superproject 分支需要在不同交付中选择不同 submodule 目标分支(多渠道)时,仅靠 `.gitmodules` 不足。
|
|
@@ -8,6 +8,7 @@ description: 计划质检(执行前检查计划是否过长/跑偏,并给出
|
|
|
8
8
|
目标:
|
|
9
9
|
- 在进入 `$ws-dev` 前,对 `plan/...` 与 `changes/<change-id>/proposal.md` 做一次“硬约束”质检
|
|
10
10
|
- 避免计划过长、步骤不够具体、验证不可复现、与需求合同绑定不一致
|
|
11
|
+
- 显式做一次多视角方案审查,避免计划“格式合格但方向跑偏”
|
|
11
12
|
- 失败时只给最小修正项,修完后再进入实现
|
|
12
13
|
|
|
13
14
|
适用时机:
|
|
@@ -24,6 +25,7 @@ description: 计划质检(执行前检查计划是否过长/跑偏,并给出
|
|
|
24
25
|
|
|
25
26
|
必需输出:
|
|
26
27
|
- `Quality gate:` pass/fail
|
|
28
|
+
- `Perspective findings:` 多视角审查结论
|
|
27
29
|
- `Fix list:` 最小修正项
|
|
28
30
|
- `Next:` 通过则 `$ws-dev`,未通过则继续修正并复跑
|
|
29
31
|
|
|
@@ -52,10 +54,17 @@ fi
|
|
|
52
54
|
4) 若失败:按报错逐条修正 `proposal.md` / `plan/...`,优先级如下:
|
|
53
55
|
- 先修绑定:`Change_ID` / `Req_ID|Problem_ID` / `Contract_Row` / `Plan_File` / `Evidence_Path`
|
|
54
56
|
- 再修计划质量:必需章节、步骤数量、步骤具体性、验证命令与预期
|
|
55
|
-
5)
|
|
56
|
-
|
|
57
|
+
5) 在 strict 通过后,增加多视角方案审查(不要跳过):
|
|
58
|
+
- 产品/范围:目标是否清楚、是否有 scope creep、是否把不该做的内容带进来
|
|
59
|
+
- 工程实现:数据流、边界条件、失败模式、回滚、验证是否闭合
|
|
60
|
+
- 体验 / DX(按需):若任务涉及 UI、CLI、API、文档或工具链,检查关键路径是否可用、成本是否可接受
|
|
61
|
+
- 验收完整性:是否能凭当前 Verify 判断 done / not done
|
|
62
|
+
6) 若多视角审查发现阻断问题:`Quality gate: fail`,只输出最小修正项,不进入实现。
|
|
63
|
+
7) 复跑 strict 校验,直到通过。
|
|
64
|
+
8) 输出“可执行最小计划摘要”(3-8 步),再进入 `$ws-dev`。
|
|
57
65
|
|
|
58
66
|
输出要求:
|
|
59
67
|
- `Quality gate:` pass/fail
|
|
68
|
+
- `Perspective findings:` 按视角列出阻断点 / 警告 / 通过结论
|
|
60
69
|
- `Fix list:` 仅保留必须修改项(按阻断级别排序)
|
|
61
70
|
- `Next:` 通过后建议 `$ws-dev`;未通过则继续修正并复跑 strict
|