@aipper/aiws-spec 0.0.27 → 0.0.29
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 +10 -12
- package/docs/opencode-autonomous-swarm.md +178 -0
- package/docs/opencode-omo-adapter.md +123 -4
- package/docs/opencode-omo-validation-checklist.md +47 -0
- package/docs/opencode-subagent-first.md +187 -0
- package/docs/workflow-delegation-context-injection.md +217 -0
- package/docs/workflow-delegation-contracts.json +68 -1
- package/docs/workflow-delegation-contracts.md +3 -0
- package/docs/workflow-delegation-contracts.schema.json +95 -0
- package/docs/workflow-governance-rules.json +47 -6
- package/docs/workflow-governance-rules.md +7 -6
- package/docs/workflow-governance-rules.schema.json +39 -1
- package/docs/workflow-router-rules.json +63 -8
- package/docs/workflow-router-rules.md +15 -6
- package/docs/workflow-stage-contracts.json +16 -8
- package/docs/workflow-stage-contracts.md +7 -7
- package/package.json +1 -1
- package/templates/workspace/.agents/skills/using-aiws/SKILL.md +22 -8
- package/templates/workspace/.agents/skills/ws-commit/SKILL.md +6 -118
- package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +6 -218
- package/templates/workspace/.agents/skills/ws-dev/SKILL.md +52 -141
- package/templates/workspace/.agents/skills/ws-finish/SKILL.md +6 -205
- package/templates/workspace/.agents/skills/ws-handoff/SKILL.md +10 -44
- 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 +6 -49
- package/templates/workspace/.agents/skills/ws-review/SKILL.md +6 -1
- package/templates/workspace/.agents/skills/ws-verify-before-complete/SKILL.md +12 -53
- package/templates/workspace/.claude/commands/ws-intake.md +19 -0
- package/templates/workspace/.claude/commands/ws-review.md +5 -1
- package/templates/workspace/.claude/settings.json.example +26 -0
- package/templates/workspace/.claude/skills/ws-commit/SKILL.md +6 -118
- package/templates/workspace/.claude/skills/ws-deliver/SKILL.md +6 -218
- package/templates/workspace/.claude/skills/ws-dev/SKILL.md +52 -141
- package/templates/workspace/.claude/skills/ws-finish/SKILL.md +6 -205
- package/templates/workspace/.claude/skills/ws-handoff/SKILL.md +10 -44
- package/templates/workspace/.claude/skills/ws-intake/SKILL.md +31 -0
- package/templates/workspace/.claude/skills/ws-plan-verify/SKILL.md +6 -49
- package/templates/workspace/.claude/skills/ws-review/SKILL.md +6 -1
- package/templates/workspace/.claude/skills/ws-verify-before-complete/SKILL.md +12 -53
- package/templates/workspace/.opencode/command/ws-auto.md +33 -0
- package/templates/workspace/.opencode/command/ws-autonomy.md +25 -0
- package/templates/workspace/.opencode/command/ws-intake.md +22 -0
- package/templates/workspace/.opencode/command/ws-review.md +5 -1
- package/templates/workspace/.opencode/commands/ws-auto.md +33 -0
- package/templates/workspace/.opencode/commands/ws-autonomy.md +25 -0
- package/templates/workspace/.opencode/commands/ws-commit.md +4 -56
- package/templates/workspace/.opencode/commands/ws-deliver.md +10 -50
- package/templates/workspace/.opencode/commands/ws-finish.md +8 -65
- package/templates/workspace/.opencode/commands/ws-handoff.md +9 -17
- package/templates/workspace/.opencode/commands/ws-intake.md +22 -0
- package/templates/workspace/.opencode/commands/ws-migrate.md +10 -17
- package/templates/workspace/.opencode/commands/ws-plan-verify.md +5 -15
- package/templates/workspace/.opencode/commands/ws-pull.md +6 -75
- package/templates/workspace/.opencode/commands/ws-push.md +7 -82
- package/templates/workspace/.opencode/commands/ws-review.md +5 -1
- package/templates/workspace/.opencode/commands/ws-submodule-setup.md +8 -47
- package/templates/workspace/.opencode/commands/ws-verify-before-complete.md +10 -19
- package/templates/workspace/.opencode/helpers/approval-whitelist-check.sh +148 -0
- package/templates/workspace/.opencode/helpers/approval-whitelist-run.sh +82 -0
- package/templates/workspace/.opencode/helpers/approval-whitelist-watchdog.sh +144 -0
- package/templates/workspace/.opencode/helpers/tmux-swarm-rescue.sh +56 -0
- package/templates/workspace/.opencode/helpers/tmux-swarm-scan.sh +46 -0
- package/templates/workspace/.opencode/oh-my-opencode.json.example +64 -4
- package/templates/workspace/.opencode/skills/using-aiws/SKILL.md +93 -77
- package/templates/workspace/.opencode/skills/ws-analyze/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-auto/SKILL.md +46 -0
- package/templates/workspace/.opencode/skills/ws-autonomy/SKILL.md +62 -0
- package/templates/workspace/.opencode/skills/ws-bugfix/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-commit/SKILL.md +6 -118
- package/templates/workspace/.opencode/skills/ws-delegate/SKILL.md +93 -40
- package/templates/workspace/.opencode/skills/ws-deliver/SKILL.md +6 -218
- package/templates/workspace/.opencode/skills/ws-dev/SKILL.md +53 -142
- package/templates/workspace/.opencode/skills/ws-dev-lite/SKILL.md +19 -6
- package/templates/workspace/.opencode/skills/ws-finish/SKILL.md +6 -205
- package/templates/workspace/.opencode/skills/ws-frontend-design/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-handoff/SKILL.md +10 -44
- package/templates/workspace/.opencode/skills/ws-intake/SKILL.md +40 -0
- package/templates/workspace/.opencode/skills/ws-migrate/SKILL.md +6 -42
- package/templates/workspace/.opencode/skills/ws-plan/SKILL.md +4 -2
- package/templates/workspace/.opencode/skills/ws-plan-verify/SKILL.md +6 -49
- package/templates/workspace/.opencode/skills/ws-preflight/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-pull/SKILL.md +8 -109
- package/templates/workspace/.opencode/skills/ws-push/SKILL.md +8 -100
- package/templates/workspace/.opencode/skills/ws-quality-review/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-req-change/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-req-contract-sync/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-req-contract-validate/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-req-flow-sync/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-req-review/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-review/SKILL.md +14 -3
- package/templates/workspace/.opencode/skills/ws-rule/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-spec-review/SKILL.md +1 -1
- package/templates/workspace/.opencode/skills/ws-submodule-setup/SKILL.md +10 -57
- package/templates/workspace/.opencode/skills/ws-verify-before-complete/SKILL.md +12 -53
- package/templates/workspace/AGENTS.md +12 -5
- package/templates/workspace/AI_PROJECT.md +1 -1
- package/templates/workspace/changes/README.md +9 -12
- package/templates/workspace/manifest.json +277 -203
- package/templates/workspace/.agents/skills/ws-migrate/SKILL.md +0 -54
- package/templates/workspace/.agents/skills/ws-pull/SKILL.md +0 -119
- package/templates/workspace/.agents/skills/ws-push/SKILL.md +0 -110
- package/templates/workspace/.agents/skills/ws-submodule-setup/SKILL.md +0 -65
- package/templates/workspace/.claude/skills/ws-migrate/SKILL.md +0 -54
- package/templates/workspace/.claude/skills/ws-pull/SKILL.md +0 -119
- package/templates/workspace/.claude/skills/ws-push/SKILL.md +0 -110
- package/templates/workspace/.claude/skills/ws-submodule-setup/SKILL.md +0 -65
|
@@ -1,217 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ws-finish
|
|
3
|
-
description:
|
|
3
|
+
description: `aiws ws-finish` 的薄包装入口
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# ws-finish
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
- 在结束一次变更交付时,用 fast-forward 安全合并 `change/<change-id>` 回目标分支,减少手输分支名导致的错误
|
|
10
|
-
- 合并成功后,按 `submodule -> superproject` 顺序 push,避免遗漏导致其它仓库拉取异常
|
|
11
|
-
- 不自动删分支;AI 入口执行前应先向用户说明将要 push 的 remote/branch,显式传入 `--push` 即视为确认
|
|
12
|
-
- 若团队希望减少 submodule detached 的人为差异:建议在 `.gitmodules` 配置 `submodule.<name>.branch`,并在日常拉取时使用 `$ws-pull`
|
|
8
|
+
`aiws ws-finish` 的薄包装入口。
|
|
13
9
|
|
|
14
|
-
前置(必须):
|
|
15
|
-
- 工作区是干净的:`git status --porcelain` 无输出(若有未提交改动:先 commit 或 stash)
|
|
16
|
-
- change 分支已存在:`change/<change-id>`(也支持 `changes/`、`ws/`、`ws-change/`)
|
|
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`
|
|
19
|
-
- 若存在 `.gitmodules`:必须为每个 submodule 配置 `submodule.<name>.branch`(否则无法确定性减少 detached;先运行 `$ws-submodule-setup` 并提交 `.gitmodules`)
|
|
20
|
-
|
|
21
|
-
阶段定位:
|
|
22
|
-
- finish 阶段;负责把已提交的 change 安全合并回目标分支,并按约束完成 push / worktree cleanup。
|
|
23
|
-
|
|
24
|
-
必需输入:
|
|
25
|
-
- 干净的当前工作区
|
|
26
|
-
- 已提交完成的 `change/<change-id>`
|
|
27
|
-
- 若存在 submodule:`.gitmodules` 与 `changes/<change-id>/submodules.targets`
|
|
28
|
-
- 当前 push 目标说明(remote / branch)
|
|
29
|
-
|
|
30
|
-
必需输出:
|
|
31
|
-
- `Merge:` `aiws change finish` 的结果(from / into)
|
|
32
|
-
- `Push:` 实际 remote / branch 或未 push 原因
|
|
33
|
-
- `Worktree cleanup:` 清理结果
|
|
34
|
-
- `Evidence:` validate stamp / evidence / state 路径
|
|
35
|
-
|
|
36
|
-
阻断条件:
|
|
37
|
-
- 工作区不干净
|
|
38
|
-
- 缺失 submodule branch / targets 真值
|
|
39
|
-
- fast-forward 失败
|
|
40
|
-
- 子模块目标分支无法安全 push
|
|
41
|
-
|
|
42
|
-
完成判定:
|
|
43
|
-
- change 已安全合并回目标分支,必要的 push 与 worktree cleanup 已完成或明确说明未完成原因。
|
|
44
|
-
|
|
45
|
-
建议步骤:
|
|
46
|
-
0) 若存在 `.gitmodules`,先检查 submodule branch 配置是否齐全(缺失则停止并提示 setup):
|
|
47
|
-
```bash
|
|
48
|
-
if [[ -f .gitmodules ]]; then
|
|
49
|
-
missing=0
|
|
50
|
-
while read -r key sub_path; do
|
|
51
|
-
name="${key#submodule.}"; name="${name%.path}"
|
|
52
|
-
b="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
|
|
53
|
-
if [[ -z "${b:-}" ]]; then
|
|
54
|
-
echo "error: missing .gitmodules submodule.${name}.branch (path=${sub_path})"
|
|
55
|
-
missing=1
|
|
56
|
-
fi
|
|
57
|
-
done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
|
|
58
|
-
if [[ "$missing" -ne 0 ]]; then
|
|
59
|
-
echo "hint: run $ws-submodule-setup (and commit .gitmodules), then retry"
|
|
60
|
-
exit 2
|
|
61
|
-
fi
|
|
62
|
-
fi
|
|
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 执行)先跑一次门禁并落盘证据:
|
|
69
|
-
```bash
|
|
70
|
-
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
71
|
-
./node_modules/.bin/aiws validate . --stamp
|
|
72
|
-
elif command -v aiws >/dev/null 2>&1; then
|
|
73
|
-
aiws validate . --stamp
|
|
74
|
-
else
|
|
75
|
-
npx @aipper/aiws validate . --stamp
|
|
76
|
-
fi
|
|
77
|
-
```
|
|
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`:
|
|
82
|
-
```bash
|
|
83
|
-
change_id="<change-id>"
|
|
84
|
-
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
85
|
-
./node_modules/.bin/aiws change evidence "${change_id}"
|
|
86
|
-
elif command -v aiws >/dev/null 2>&1; then
|
|
87
|
-
aiws change evidence "${change_id}"
|
|
88
|
-
else
|
|
89
|
-
npx @aipper/aiws change evidence "${change_id}"
|
|
90
|
-
fi
|
|
91
|
-
```
|
|
92
|
-
1.2) (可选,仅适用于普通 finish)生成状态快照(建议):
|
|
93
|
-
```bash
|
|
94
|
-
aiws change state "${change_id}" --write
|
|
95
|
-
```
|
|
96
|
-
2) 若不存在 `.gitmodules`,或 submodules 已按顺序处理完成,优先直接使用最小收尾闭环:
|
|
97
|
-
```bash
|
|
98
|
-
# 若当前就在 change/<change-id> 分支上,可省略 <change-id>
|
|
99
|
-
change_id="<change-id>"
|
|
100
|
-
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
101
|
-
./node_modules/.bin/aiws change finish "${change_id}" --push
|
|
102
|
-
elif command -v aiws >/dev/null 2>&1; then
|
|
103
|
-
aiws change finish "${change_id}" --push
|
|
104
|
-
else
|
|
105
|
-
npx @aipper/aiws change finish "${change_id}" --push
|
|
106
|
-
fi
|
|
107
|
-
```
|
|
108
|
-
说明:
|
|
109
|
-
- 该命令会在 fast-forward 合并成功后 push 目标分支。
|
|
110
|
-
- 默认会优先使用当前分支的 upstream 配置(`branch.<name>.remote` + `branch.<name>.merge`);只有在你明确知道要推向别的 remote 时,才追加 `--remote <name>`。
|
|
111
|
-
- 若 `change/<change-id>` 位于独立 worktree,且该 worktree 干净,则会在 push 成功后自动执行 `git worktree remove` + `git worktree prune`。
|
|
112
|
-
- AI 工具内执行前,应先向用户说明将要 push 的 remote/branch;CLI 本身只有在显式传入 `--push` 时才会真正执行 push。
|
|
113
|
-
|
|
114
|
-
3) 若你需要先处理 submodules,则不要依赖当前分支名推断目标分支,先显式解析 `base_branch`,再执行 submodule 步骤,最后回到主仓库执行 `aiws change finish --push`:
|
|
115
|
-
```bash
|
|
116
|
-
change_id="<change-id>"
|
|
117
|
-
base_branch="$(python3 - <<'PY'
|
|
118
|
-
import json, pathlib
|
|
119
|
-
change_id = "<change-id>"
|
|
120
|
-
meta = pathlib.Path("changes") / change_id / ".ws-change.json"
|
|
121
|
-
data = json.loads(meta.read_text(encoding="utf-8"))
|
|
122
|
-
print((data.get("base_branch") or "").strip())
|
|
123
|
-
PY
|
|
124
|
-
)"
|
|
125
|
-
test -n "$base_branch"
|
|
126
|
-
```
|
|
127
|
-
4) 若 fast-forward 失败(提示需要 rebase):先在 change 分支(或对应 worktree)里 `git rebase <target-branch>`,再重试 `aiws change finish --push`。
|
|
128
|
-
5) 若存在 `.gitmodules`,先把每个 submodule 的 gitlink commit 合并回其目标分支(解决 detached HEAD),并按顺序 push:
|
|
129
|
-
```bash
|
|
130
|
-
# 不要用当前分支名代替目标分支;这里显式使用 .ws-change.json 的 base_branch
|
|
131
|
-
change_id="<change-id>"
|
|
132
|
-
targets="changes/${change_id}/submodules.targets"
|
|
133
|
-
|
|
134
|
-
# 子模块清单(没有则跳过)
|
|
135
|
-
git config --file .gitmodules --get-regexp '^submodule\..*\.path$' 2>/dev/null || true
|
|
136
|
-
|
|
137
|
-
# 对每个 submodule.<name>.path <sub_path>:
|
|
138
|
-
# 说明:`git submodule update` 会把 submodule checkout 到固定 gitlink commit,导致 detached HEAD。
|
|
139
|
-
# 为减少游离状态的协作摩擦,本步骤采用 pin 分支策略:
|
|
140
|
-
# - `changes/<change-id>/submodules.targets` 是本次 finish/push 的真值;每个 submodule path 都必须在该文件中声明目标分支(可选 remote)
|
|
141
|
-
# - `.gitmodules` 的 `submodule.<name>.branch` 仍建议保留,用于团队默认配置与校验,但不再作为 finish/push 的 fallback
|
|
142
|
-
# - 生成/检查 `submodules.targets` 时可显式说明默认来源:
|
|
143
|
-
# - detached HEAD:默认建议取 `.gitmodules` 的 `submodule.<name>.branch`
|
|
144
|
-
# - 已附着在某个本地分支:默认建议取当前分支
|
|
145
|
-
# - 以上仅为预填建议;真正执行 finish/push 时仍只认 `submodules.targets`
|
|
146
|
-
# - 不要直接切 `change/<change-id>` / `main` / `master` 等业务分支来解 detached
|
|
147
|
-
# - 不改动 submodule 现有分支指针(例如不强行移动 main/master)
|
|
148
|
-
# - 创建/更新本地 pin 分支:`aiws/pin/<target_branch>` 指向 gitlink commit,并将其 upstream 设为 `origin/<target_branch>`
|
|
149
|
-
if git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' >/dev/null 2>&1; then
|
|
150
|
-
if [[ ! -f "${targets}" ]]; then
|
|
151
|
-
echo "error: missing ${targets} (required when .gitmodules declares submodules)"
|
|
152
|
-
exit 2
|
|
153
|
-
fi
|
|
154
|
-
|
|
155
|
-
source tools/ws_resolve_sub_target.sh
|
|
156
|
-
|
|
157
|
-
while read -r key sub_path; do
|
|
158
|
-
name="${key#submodule.}"; name="${name%.path}"
|
|
159
|
-
[[ -z "${sub_path:-}" ]] && continue
|
|
160
|
-
echo "== submodule: ${sub_path} (${name}) =="
|
|
161
|
-
|
|
162
|
-
current_branch="$(git -C "${sub_path}" branch --show-current 2>/dev/null || true)"
|
|
163
|
-
declared_branch="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
|
|
164
|
-
if [[ -n "${current_branch}" ]]; then
|
|
165
|
-
echo "info: ${sub_path} default suggestion would be current branch: ${current_branch}"
|
|
166
|
-
elif [[ -n "${declared_branch}" ]]; then
|
|
167
|
-
echo "info: ${sub_path} default suggestion would be .gitmodules branch: ${declared_branch}"
|
|
168
|
-
else
|
|
169
|
-
echo "warn: ${sub_path} has no current branch and no .gitmodules branch; submodules.targets must be filled manually"
|
|
170
|
-
fi
|
|
171
|
-
|
|
172
|
-
sub_sha="$(git rev-parse "HEAD:${sub_path}")"
|
|
173
|
-
|
|
174
|
-
ws_resolve_sub_target "${sub_path}" "${name}" "${targets}" "${base_branch}" || exit 2
|
|
175
|
-
target_branch="${_resolved_branch}"
|
|
176
|
-
remote="${_resolved_remote}"
|
|
177
|
-
pin_branch="aiws/pin/${target_branch}"
|
|
178
|
-
|
|
179
|
-
git -C "${sub_path}" fetch "${remote}" --prune
|
|
180
|
-
if ! git -C "${sub_path}" show-ref --verify --quiet "refs/remotes/${remote}/${target_branch}"; then
|
|
181
|
-
echo "error: ${sub_path}: missing ${remote}/${target_branch}; refusing to push superproject (would break gitlink fetchability)"
|
|
182
|
-
exit 2
|
|
183
|
-
fi
|
|
184
|
-
|
|
185
|
-
# 仅当 gitlink commit 属于 <remote>/<target_branch> 的历史时才挂回分支
|
|
186
|
-
if ! git -C "${sub_path}" merge-base --is-ancestor "${sub_sha}" "${remote}/${target_branch}"; then
|
|
187
|
-
echo "[warn] ${sub_path}: ${sub_sha} is not in ${remote}/${target_branch}; keep detached and stop (need manual reconcile)"
|
|
188
|
-
exit 1
|
|
189
|
-
fi
|
|
190
|
-
|
|
191
|
-
git -C "${sub_path}" checkout -B "${pin_branch}" "${sub_sha}"
|
|
192
|
-
git -C "${sub_path}" branch --set-upstream-to "${remote}/${target_branch}" "${pin_branch}" >/dev/null 2>&1 || true
|
|
193
|
-
git -C "${sub_path}" status -sb
|
|
194
|
-
|
|
195
|
-
# push:只允许 fast-forward(若远端分叉会被拒绝;此时必须人工处理)
|
|
196
|
-
git -C "${sub_path}" push "${remote}" "${sub_sha}:refs/heads/${target_branch}"
|
|
197
|
-
done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
|
|
198
|
-
fi
|
|
199
|
-
```
|
|
200
|
-
规则:
|
|
201
|
-
- 每个 submodule 必须先执行 pin 分支挂回 + fast-forward push,再 push 主仓库。
|
|
202
|
-
- 若任一 submodule 的 gitlink commit 不在 `<remote>/<target_branch>` 历史中:立即停止,先人工处理分叉,再继续。
|
|
203
|
-
|
|
204
|
-
6) 仅当 submodules 全部成功后,再在 superproject 当前分支执行最小收尾闭环:
|
|
205
10
|
```bash
|
|
206
|
-
change_id="<change-id>"
|
|
207
11
|
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
208
|
-
./node_modules/.bin/aiws
|
|
12
|
+
./node_modules/.bin/aiws ws-finish
|
|
209
13
|
elif command -v aiws >/dev/null 2>&1; then
|
|
210
|
-
aiws
|
|
14
|
+
aiws ws-finish
|
|
211
15
|
else
|
|
212
|
-
npx @aipper/aiws
|
|
16
|
+
npx @aipper/aiws ws-finish
|
|
213
17
|
fi
|
|
214
18
|
```
|
|
215
|
-
说明:
|
|
216
|
-
- 该命令内部已经包含主仓库 push 成功后安全清理独立 change worktree 的逻辑。
|
|
217
|
-
- 当 `--push` 完整成功时,还会自动把 `changes/<change-id>/` 归档到 `changes/archive/...`,生成 `handoff.md`,并补一个 `归档: <change-id>` commit。
|
|
@@ -1,52 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ws-handoff
|
|
3
|
-
description:
|
|
3
|
+
description: `aiws ws-handoff` 的薄包装入口
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# ws-handoff
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
- 让 change 的交接信息可回放:`handoff.md`(包含:本次完成/改动文件/关键决策/下一步建议/绑定)
|
|
10
|
-
- 若存在协同工件:在 handoff 中一并概述 `analysis/`、`patches/`、`review/`、`evidence/`
|
|
11
|
-
- 指引在归档与依赖场景下如何使用 handoff
|
|
8
|
+
`aiws ws-handoff` 的薄包装入口。
|
|
12
9
|
|
|
13
|
-
说明:
|
|
14
|
-
- `handoff.md` 默认由 `aiws change finish --push` 自动归档时生成:`changes/archive/<date>-<change-id>/handoff.md`
|
|
15
|
-
- `Depends_On` 依赖若已归档,`aiws change start` 会尝试读取依赖的 `handoff.md` 并输出摘要
|
|
16
|
-
|
|
17
|
-
阶段定位:
|
|
18
|
-
- handoff / archive 阶段;负责查看或补充已归档 change 的交接说明。
|
|
19
|
-
|
|
20
|
-
必需输入:
|
|
21
|
-
- 已归档的 `change/<change-id>`
|
|
22
|
-
- 对应 archive 目录
|
|
23
|
-
|
|
24
|
-
必需输出:
|
|
25
|
-
- `Change_ID:` 当前交接对象
|
|
26
|
-
- `Handoff:` `changes/archive/.../handoff.md`
|
|
27
|
-
- `Next:` 推荐后续 change / `Depends_On` 关系
|
|
28
|
-
|
|
29
|
-
阻断条件:
|
|
30
|
-
- 无法定位目标 change
|
|
31
|
-
- `handoff.md` 无法生成或读取
|
|
32
|
-
|
|
33
|
-
完成判定:
|
|
34
|
-
- 下一位协作者可以只依赖 `handoff.md` 和绑定信息继续工作,而不需要回溯整段会话。
|
|
35
|
-
|
|
36
|
-
执行建议:
|
|
37
|
-
1) 先运行 `$ws-preflight`。
|
|
38
|
-
2) 先确认本 change 已通过 `aiws change finish <change-id> --push` 完成自动归档。
|
|
39
|
-
3) 查看 handoff:
|
|
40
10
|
```bash
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
11
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
12
|
+
./node_modules/.bin/aiws ws-handoff
|
|
13
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
14
|
+
aiws ws-handoff
|
|
15
|
+
else
|
|
16
|
+
npx @aipper/aiws ws-handoff
|
|
17
|
+
fi
|
|
44
18
|
```
|
|
45
|
-
4) 若是历史/异常场景,尚未归档且需要手工恢复,再运行 `aiws change archive <change-id>`。
|
|
46
|
-
5) 若要让后续 change 可接力:在 `proposal.md` 里声明 `Blocks`(下一步建议会据此生成)。
|
|
47
|
-
6) 若本 change 使用了外部 / 子 agent 协作:确认关键结论已经进入 `review/` 或 `evidence/`,避免 handoff 只留下原始 patch/分析文件而没有最终结论。
|
|
48
|
-
|
|
49
|
-
输出要求:
|
|
50
|
-
- `Change_ID:` <change-id>
|
|
51
|
-
- `Handoff:` `changes/archive/.../handoff.md`
|
|
52
|
-
- `Next:` 若还有后续工作,建议创建新 change 并在其 `Depends_On` 引用本 change
|
|
@@ -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` 不足。
|
|
@@ -1,61 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ws-plan-verify
|
|
3
|
-
description:
|
|
3
|
+
description: `aiws ws-plan-verify` 的薄包装入口
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# ws-plan-verify
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
- 在进入 `$ws-dev` 前,对 `plan/...` 与 `changes/<change-id>/proposal.md` 做一次“硬约束”质检
|
|
10
|
-
- 避免计划过长、步骤不够具体、验证不可复现、与需求合同绑定不一致
|
|
11
|
-
- 失败时只给最小修正项,修完后再进入实现
|
|
8
|
+
`aiws ws-plan-verify` 的薄包装入口。
|
|
12
9
|
|
|
13
|
-
适用时机:
|
|
14
|
-
- 已执行过 `$ws-plan`,且准备开始编码
|
|
15
|
-
- 或用户反馈“计划太长/容易跑偏”,需要先压缩并对齐
|
|
16
|
-
|
|
17
|
-
阶段定位:
|
|
18
|
-
- planning gate;负责在编码前检查计划是否满足 change 严格契约。
|
|
19
|
-
|
|
20
|
-
必需输入:
|
|
21
|
-
- 当前 `plan/...`
|
|
22
|
-
- `changes/<change-id>/proposal.md`
|
|
23
|
-
- 当前 change 上下文
|
|
24
|
-
|
|
25
|
-
必需输出:
|
|
26
|
-
- `Quality gate:` pass/fail
|
|
27
|
-
- `Fix list:` 最小修正项
|
|
28
|
-
- `Next:` 通过则 `$ws-dev`,未通过则继续修正并复跑
|
|
29
|
-
|
|
30
|
-
阻断条件:
|
|
31
|
-
- 无法定位当前 change 或计划文件
|
|
32
|
-
- `aiws change validate <change-id> --strict` 未通过
|
|
33
|
-
|
|
34
|
-
完成判定:
|
|
35
|
-
- 计划满足严格门禁,且后续实现可以在不补需求/补绑定的情况下直接开始。
|
|
36
|
-
|
|
37
|
-
执行步骤(建议):
|
|
38
|
-
1) 先运行 `$ws-preflight`。
|
|
39
|
-
2) 识别 change 上下文:
|
|
40
|
-
- 优先从当前分支推断 `change/<change-id>`
|
|
41
|
-
- 若无法推断:读取 `changes/*/proposal.md` 中的 `Change_ID`,并让用户确认本次要质检的 change
|
|
42
|
-
3) 运行严格门禁(这是硬约束入口):
|
|
43
10
|
```bash
|
|
44
11
|
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
45
|
-
./node_modules/.bin/aiws
|
|
12
|
+
./node_modules/.bin/aiws ws-plan-verify
|
|
46
13
|
elif command -v aiws >/dev/null 2>&1; then
|
|
47
|
-
aiws
|
|
14
|
+
aiws ws-plan-verify
|
|
48
15
|
else
|
|
49
|
-
npx @aipper/aiws
|
|
16
|
+
npx @aipper/aiws ws-plan-verify
|
|
50
17
|
fi
|
|
51
18
|
```
|
|
52
|
-
4) 若失败:按报错逐条修正 `proposal.md` / `plan/...`,优先级如下:
|
|
53
|
-
- 先修绑定:`Change_ID` / `Req_ID|Problem_ID` / `Contract_Row` / `Plan_File` / `Evidence_Path`
|
|
54
|
-
- 再修计划质量:必需章节、步骤数量、步骤具体性、验证命令与预期
|
|
55
|
-
5) 复跑 strict 校验,直到通过。
|
|
56
|
-
6) 输出“可执行最小计划摘要”(3-8 步),再进入 `$ws-dev`。
|
|
57
|
-
|
|
58
|
-
输出要求:
|
|
59
|
-
- `Quality gate:` pass/fail
|
|
60
|
-
- `Fix list:` 仅保留必须修改项(按阻断级别排序)
|
|
61
|
-
- `Next:` 通过后建议 `$ws-dev`;未通过则继续修正并复跑 strict
|
|
@@ -6,6 +6,7 @@ description: 评审(提交前审计与证据落盘)
|
|
|
6
6
|
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
7
|
|
|
8
8
|
目标:在提交/交付前审计当前改动,对照真值文件检查是否越界,并把审计证据优先落盘到 `changes/<change-id>/review/`(若无法确定 `change-id` 再回退 `.agentdocs/tmp/review/`)。
|
|
9
|
+
若当前语境已经明确是“准备交付/finish”,则本入口不应只停留在通用 review:应继续同时补齐 `$ws-spec-review` 与 `$ws-quality-review`,把 dual review gate 一次性收敛完。
|
|
9
10
|
|
|
10
11
|
阶段定位:
|
|
11
12
|
- review 阶段;负责对当前改动做规范、风险和验证完整性的审计。
|
|
@@ -40,7 +41,11 @@ description: 评审(提交前审计与证据落盘)
|
|
|
40
41
|
- 默认:`changes/<change-id>/review/codex-review.md`
|
|
41
42
|
- 回退:`.agentdocs/tmp/review/codex-review.md`(仅在无法确定 `change-id` 时使用)
|
|
42
43
|
- 若已有其它 reviewer 文件:不要覆盖它们;当前 reviewer 应写自己的文件或更新自己的汇总文件
|
|
43
|
-
4)
|
|
44
|
+
4) 若当前任务已进入“准备提交/交付/finish”的语境,继续补齐 dual review gate:
|
|
45
|
+
- 运行/收敛 `$ws-spec-review`,落盘 `changes/<change-id>/review/spec-review.md`(或回退 `.agentdocs/tmp/review/spec-review.md`)
|
|
46
|
+
- 运行/收敛 `$ws-quality-review`,落盘 `changes/<change-id>/review/quality-review.md`(或回退 `.agentdocs/tmp/review/quality-review.md`)
|
|
47
|
+
- 不要把单个 `codex-review.md` 误当成 finish gate 已完成
|
|
48
|
+
5) 回复中输出:
|
|
44
49
|
- `证据(Evidence):` 证据文件路径
|
|
45
50
|
- `主要风险(Top risks):` 3–8 条(高→低)
|
|
46
51
|
- `下一步(Next):` 最小修复清单 + 最小验证命令
|
|
@@ -1,59 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ws-verify-before-complete
|
|
3
|
-
description:
|
|
3
|
+
description: `aiws ws-verify-before-complete` 的薄包装入口
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# ws-verify-before-complete
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
- 在进入 `$ws-finish` / `$ws-handoff` 前,检查 review、validate stamp 和证据是否齐全
|
|
10
|
-
- 输出明确的 pass/fail 结论,避免“看起来完成了但 gate 没过”的伪完成
|
|
8
|
+
`aiws ws-verify-before-complete` 的薄包装入口。
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
必需输出:
|
|
22
|
-
- `证据(Evidence):` `changes/<change-id>/evidence/verify-before-complete.md` 或回退 `.agentdocs/tmp/review/verify-before-complete.md`
|
|
23
|
-
- `结论(Result):` pass / fail
|
|
24
|
-
- `缺失项(Missing):` 未满足的 gate
|
|
25
|
-
- `下一步(Next):` 进入 `$ws-finish` / `$ws-handoff`,或回退前置 gate
|
|
26
|
-
|
|
27
|
-
阻断条件:
|
|
28
|
-
- 缺少 spec review
|
|
29
|
-
- 缺少 quality review
|
|
30
|
-
- 缺少 validate stamp
|
|
31
|
-
- review 中仍有未关闭 blocker
|
|
32
|
-
- 无法写 verification 证据
|
|
33
|
-
|
|
34
|
-
完成判定:
|
|
35
|
-
- 已落盘 verify-before-complete 证据,并明确能否进入 `$ws-finish` / `$ws-handoff`。
|
|
36
|
-
|
|
37
|
-
步骤(建议):
|
|
38
|
-
1) 识别当前 `change/<change-id>`。
|
|
39
|
-
2) 检查以下最小 gate:
|
|
40
|
-
- `changes/<change-id>/review/spec-review.md`
|
|
41
|
-
- `changes/<change-id>/review/quality-review.md`
|
|
42
|
-
- `.agentdocs/tmp/aiws-validate/*.json`
|
|
43
|
-
3) 若存在 `changes/<change-id>/evidence/`,检查是否已经收敛 review / validate / collaboration summary。
|
|
44
|
-
4) 将结果落盘到:
|
|
45
|
-
- 默认:`changes/<change-id>/evidence/verify-before-complete.md`
|
|
46
|
-
- 回退:`.agentdocs/tmp/review/verify-before-complete.md`
|
|
47
|
-
5) 输出:
|
|
48
|
-
- `证据(Evidence):`
|
|
49
|
-
- `结论(Result): pass|fail`
|
|
50
|
-
- `缺失项(Missing):`
|
|
51
|
-
- `下一步(Next):`
|
|
52
|
-
|
|
53
|
-
重点:
|
|
54
|
-
- 这个 gate 不替代 `$ws-finish`;它只判断“是否具备进入 finish / handoff 的前置条件”。
|
|
55
|
-
- 若 fail,必须明确回退到哪个 gate:`$ws-spec-review`、`$ws-quality-review`、`aiws validate . --stamp` 或 `aiws change evidence <change-id>`。
|
|
56
|
-
|
|
57
|
-
安全:
|
|
58
|
-
- 不打印 secrets。
|
|
59
|
-
- 不执行破坏性命令。
|
|
10
|
+
```bash
|
|
11
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
12
|
+
./node_modules/.bin/aiws ws-verify-before-complete
|
|
13
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
14
|
+
aiws ws-verify-before-complete
|
|
15
|
+
else
|
|
16
|
+
npx @aipper/aiws ws-verify-before-complete
|
|
17
|
+
fi
|
|
18
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
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 的额外说明(托管块外内容会被保留)。
|
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
3) 将审计落盘到(目录不存在则创建):
|
|
15
15
|
- 默认:`changes/<change-id>/review/codex-review.md`
|
|
16
16
|
- 回退:`.agentdocs/tmp/review/codex-review.md`(仅在无法确定 `change-id` 时使用)
|
|
17
|
-
4)
|
|
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) 回复中输出:
|
|
18
22
|
- `证据(Evidence):` 证据文件路径
|
|
19
23
|
- `主要风险(Top risks):` 3–8 条(高→低)
|
|
20
24
|
- `下一步(Next):` 最小修复清单 + 最小验证命令
|