@aipper/aiws-spec 0.0.24 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/docs/aiws-bootstrap-routing-design.md +138 -0
- package/docs/aiws-governance-positioning.md +69 -0
- package/docs/cli-interface.md +87 -5
- package/docs/collaboration-artifacts.md +62 -0
- package/docs/opencode-omo-adapter.md +135 -0
- package/docs/opencode-omo-validation-checklist.md +90 -0
- package/docs/spec-contract.md +26 -11
- package/docs/superpowers-collaboration-adoption.md +92 -0
- package/docs/workflow-delegation-contracts.json +274 -0
- package/docs/workflow-delegation-contracts.md +248 -0
- package/docs/workflow-delegation-contracts.schema.json +176 -0
- package/docs/workflow-governance-rules.json +294 -0
- package/docs/workflow-governance-rules.md +63 -0
- package/docs/workflow-governance-rules.schema.json +182 -0
- package/docs/workflow-review-gates.json +72 -0
- package/docs/workflow-review-gates.md +36 -0
- package/docs/workflow-review-gates.schema.json +67 -0
- package/docs/workflow-router-rules.json +196 -0
- package/docs/workflow-router-rules.md +83 -0
- package/docs/workflow-router-rules.schema.json +119 -0
- package/docs/workflow-stage-contracts.json +148 -0
- package/docs/workflow-stage-contracts.md +70 -0
- package/docs/workflow-stage-contracts.schema.json +98 -0
- package/package.json +1 -1
- package/templates/workspace/.agents/skills/using-aiws/SKILL.md +83 -0
- package/templates/workspace/.agents/skills/ws-commit/SKILL.md +23 -0
- package/templates/workspace/.agents/skills/ws-delegate/SKILL.md +75 -0
- package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +22 -0
- package/templates/workspace/.agents/skills/ws-dev/SKILL.md +35 -6
- package/templates/workspace/.agents/skills/ws-finish/SKILL.md +24 -0
- package/templates/workspace/.agents/skills/ws-frontend-design/SKILL.md +126 -0
- package/templates/workspace/.agents/skills/ws-handoff/SKILL.md +22 -1
- package/templates/workspace/.agents/skills/ws-plan/SKILL.md +25 -1
- package/templates/workspace/.agents/skills/ws-plan-verify/SKILL.md +20 -0
- package/templates/workspace/.agents/skills/ws-preflight/SKILL.md +23 -0
- package/templates/workspace/.agents/skills/ws-quality-review/SKILL.md +56 -0
- package/templates/workspace/.agents/skills/ws-review/SKILL.md +24 -0
- package/templates/workspace/.agents/skills/ws-spec-review/SKILL.md +57 -0
- package/templates/workspace/.agents/skills/ws-verify-before-complete/SKILL.md +59 -0
- package/templates/workspace/.claude/commands/using-aiws.md +24 -0
- package/templates/workspace/.claude/commands/ws-quality-review.md +24 -0
- package/templates/workspace/.claude/commands/ws-spec-review.md +24 -0
- package/templates/workspace/.claude/commands/ws-verify-before-complete.md +24 -0
- package/templates/workspace/.claude/skills/p-aiws-change-archive/SKILL.md +24 -0
- package/templates/workspace/.claude/skills/p-aiws-change-finish/SKILL.md +24 -0
- package/templates/workspace/.claude/skills/p-aiws-change-list/SKILL.md +18 -0
- package/templates/workspace/.claude/skills/p-aiws-change-new/SKILL.md +26 -0
- package/templates/workspace/.claude/skills/p-aiws-change-next/SKILL.md +19 -0
- package/templates/workspace/.claude/skills/p-aiws-change-start/SKILL.md +33 -0
- package/templates/workspace/.claude/skills/p-aiws-change-status/SKILL.md +19 -0
- package/templates/workspace/.claude/skills/p-aiws-change-sync/SKILL.md +19 -0
- package/templates/workspace/.claude/skills/p-aiws-change-templates-init/SKILL.md +18 -0
- package/templates/workspace/.claude/skills/p-aiws-change-templates-which/SKILL.md +18 -0
- package/templates/workspace/.claude/skills/p-aiws-change-validate/SKILL.md +23 -0
- package/templates/workspace/.claude/skills/p-aiws-hooks-install/SKILL.md +30 -0
- package/templates/workspace/.claude/skills/p-aiws-hooks-status/SKILL.md +18 -0
- package/templates/workspace/.claude/skills/p-aiws-init/SKILL.md +27 -0
- package/templates/workspace/.claude/skills/p-aiws-rollback/SKILL.md +18 -0
- package/templates/workspace/.claude/skills/p-aiws-update/SKILL.md +26 -0
- package/templates/workspace/.claude/skills/p-aiws-validate/SKILL.md +22 -0
- package/templates/workspace/.claude/skills/p-tasks-plan/SKILL.md +37 -0
- package/templates/workspace/.claude/skills/using-aiws/SKILL.md +83 -0
- package/templates/workspace/.claude/skills/ws-analyze/SKILL.md +26 -0
- package/templates/workspace/.claude/skills/ws-bugfix/SKILL.md +111 -0
- package/templates/workspace/.claude/skills/ws-commit/SKILL.md +127 -0
- package/templates/workspace/.claude/skills/ws-deliver/SKILL.md +231 -0
- package/templates/workspace/.claude/skills/ws-dev/SKILL.md +168 -0
- package/templates/workspace/.claude/skills/ws-finish/SKILL.md +220 -0
- package/templates/workspace/.claude/skills/ws-frontend-design/SKILL.md +126 -0
- package/templates/workspace/.claude/skills/ws-handoff/SKILL.md +52 -0
- package/templates/workspace/.claude/skills/ws-migrate/SKILL.md +54 -0
- package/templates/workspace/.claude/skills/ws-plan/SKILL.md +138 -0
- package/templates/workspace/.claude/skills/ws-plan-verify/SKILL.md +61 -0
- package/templates/workspace/.claude/skills/ws-preflight/SKILL.md +55 -0
- package/templates/workspace/.claude/skills/ws-pull/SKILL.md +119 -0
- package/templates/workspace/.claude/skills/ws-push/SKILL.md +110 -0
- package/templates/workspace/.claude/skills/ws-quality-review/SKILL.md +56 -0
- package/templates/workspace/.claude/skills/ws-req-change/SKILL.md +41 -0
- package/templates/workspace/.claude/skills/ws-req-contract-sync/SKILL.md +17 -0
- package/templates/workspace/.claude/skills/ws-req-contract-validate/SKILL.md +12 -0
- package/templates/workspace/.claude/skills/ws-req-flow-sync/SKILL.md +28 -0
- package/templates/workspace/.claude/skills/ws-req-review/SKILL.md +32 -0
- package/templates/workspace/.claude/skills/ws-review/SKILL.md +50 -0
- package/templates/workspace/.claude/skills/ws-rule/SKILL.md +23 -0
- package/templates/workspace/.claude/skills/ws-spec-review/SKILL.md +57 -0
- package/templates/workspace/.claude/skills/ws-submodule-setup/SKILL.md +65 -0
- package/templates/workspace/.claude/skills/ws-verify-before-complete/SKILL.md +59 -0
- package/templates/workspace/.opencode/command/using-aiws.md +29 -0
- package/templates/workspace/.opencode/command/ws-delegate.md +33 -0
- package/templates/workspace/.opencode/command/ws-plan.md +3 -0
- package/templates/workspace/.opencode/command/ws-preflight.md +4 -0
- package/templates/workspace/.opencode/command/ws-quality-review.md +30 -0
- package/templates/workspace/.opencode/command/ws-review.md +3 -0
- package/templates/workspace/.opencode/command/ws-spec-review.md +30 -0
- package/templates/workspace/.opencode/command/ws-verify-before-complete.md +27 -0
- package/templates/workspace/.opencode/commands/p-aiws-change-archive.md +27 -0
- package/templates/workspace/.opencode/commands/p-aiws-change-finish.md +27 -0
- package/templates/workspace/.opencode/commands/p-aiws-change-list.md +26 -0
- package/templates/workspace/.opencode/commands/p-aiws-change-new.md +27 -0
- package/templates/workspace/.opencode/commands/p-aiws-change-next.md +27 -0
- package/templates/workspace/.opencode/commands/p-aiws-change-start.md +27 -0
- package/templates/workspace/.opencode/commands/p-aiws-change-status.md +27 -0
- package/templates/workspace/.opencode/commands/p-aiws-change-sync.md +27 -0
- package/templates/workspace/.opencode/commands/p-aiws-change-templates-init.md +26 -0
- package/templates/workspace/.opencode/commands/p-aiws-change-templates-which.md +26 -0
- package/templates/workspace/.opencode/commands/p-aiws-change-validate.md +27 -0
- package/templates/workspace/.opencode/commands/p-aiws-hooks-install.md +26 -0
- package/templates/workspace/.opencode/commands/p-aiws-hooks-status.md +26 -0
- package/templates/workspace/.opencode/commands/p-aiws-init.md +23 -0
- package/templates/workspace/.opencode/commands/p-aiws-rollback.md +16 -0
- package/templates/workspace/.opencode/commands/p-aiws-update.md +22 -0
- package/templates/workspace/.opencode/commands/p-aiws-validate.md +17 -0
- package/templates/workspace/.opencode/commands/using-aiws.md +29 -0
- package/templates/workspace/.opencode/commands/ws-analyze.md +30 -0
- package/templates/workspace/.opencode/commands/ws-bugfix.md +35 -0
- package/templates/workspace/.opencode/commands/ws-commit.md +70 -0
- package/templates/workspace/.opencode/commands/ws-delegate.md +33 -0
- package/templates/workspace/.opencode/commands/ws-deliver.md +58 -0
- package/templates/workspace/.opencode/commands/ws-dev.md +36 -0
- package/templates/workspace/.opencode/commands/ws-finish.md +71 -0
- package/templates/workspace/.opencode/commands/ws-handoff.md +25 -0
- package/templates/workspace/.opencode/commands/ws-migrate.md +25 -0
- package/templates/workspace/.opencode/commands/ws-plan-verify.md +28 -0
- package/templates/workspace/.opencode/commands/ws-plan.md +27 -0
- package/templates/workspace/.opencode/commands/ws-preflight.md +34 -0
- package/templates/workspace/.opencode/commands/ws-pull.md +87 -0
- package/templates/workspace/.opencode/commands/ws-push.md +93 -0
- package/templates/workspace/.opencode/commands/ws-quality-review.md +30 -0
- package/templates/workspace/.opencode/commands/ws-req-change.md +45 -0
- package/templates/workspace/.opencode/commands/ws-req-contract-sync.md +21 -0
- package/templates/workspace/.opencode/commands/ws-req-contract-validate.md +16 -0
- package/templates/workspace/.opencode/commands/ws-req-flow-sync.md +23 -0
- package/templates/workspace/.opencode/commands/ws-req-review.md +36 -0
- package/templates/workspace/.opencode/commands/ws-review.md +33 -0
- package/templates/workspace/.opencode/commands/ws-rule.md +27 -0
- package/templates/workspace/.opencode/commands/ws-spec-review.md +30 -0
- package/templates/workspace/.opencode/commands/ws-submodule-setup.md +57 -0
- package/templates/workspace/.opencode/commands/ws-verify-before-complete.md +27 -0
- package/templates/workspace/.opencode/oh-my-opencode.json.example +17 -0
- package/templates/workspace/.opencode/skills/p-aiws-change-archive/SKILL.md +24 -0
- package/templates/workspace/.opencode/skills/p-aiws-change-finish/SKILL.md +24 -0
- package/templates/workspace/.opencode/skills/p-aiws-change-list/SKILL.md +18 -0
- package/templates/workspace/.opencode/skills/p-aiws-change-new/SKILL.md +26 -0
- package/templates/workspace/.opencode/skills/p-aiws-change-next/SKILL.md +19 -0
- package/templates/workspace/.opencode/skills/p-aiws-change-start/SKILL.md +33 -0
- package/templates/workspace/.opencode/skills/p-aiws-change-status/SKILL.md +19 -0
- package/templates/workspace/.opencode/skills/p-aiws-change-sync/SKILL.md +19 -0
- package/templates/workspace/.opencode/skills/p-aiws-change-templates-init/SKILL.md +18 -0
- package/templates/workspace/.opencode/skills/p-aiws-change-templates-which/SKILL.md +18 -0
- package/templates/workspace/.opencode/skills/p-aiws-change-validate/SKILL.md +23 -0
- package/templates/workspace/.opencode/skills/p-aiws-hooks-install/SKILL.md +30 -0
- package/templates/workspace/.opencode/skills/p-aiws-hooks-status/SKILL.md +18 -0
- package/templates/workspace/.opencode/skills/p-aiws-init/SKILL.md +27 -0
- package/templates/workspace/.opencode/skills/p-aiws-rollback/SKILL.md +18 -0
- package/templates/workspace/.opencode/skills/p-aiws-update/SKILL.md +26 -0
- package/templates/workspace/.opencode/skills/p-aiws-validate/SKILL.md +22 -0
- package/templates/workspace/.opencode/skills/p-tasks-plan/SKILL.md +37 -0
- package/templates/workspace/.opencode/skills/using-aiws/SKILL.md +87 -0
- package/templates/workspace/.opencode/skills/ws-analyze/SKILL.md +26 -0
- package/templates/workspace/.opencode/skills/ws-bugfix/SKILL.md +111 -0
- package/templates/workspace/.opencode/skills/ws-commit/SKILL.md +127 -0
- package/templates/workspace/.opencode/skills/ws-delegate/SKILL.md +63 -0
- package/templates/workspace/.opencode/skills/ws-deliver/SKILL.md +231 -0
- package/templates/workspace/.opencode/skills/ws-dev/SKILL.md +168 -0
- package/templates/workspace/.opencode/skills/ws-finish/SKILL.md +220 -0
- package/templates/workspace/.opencode/skills/ws-frontend-design/SKILL.md +126 -0
- package/templates/workspace/.opencode/skills/ws-handoff/SKILL.md +52 -0
- package/templates/workspace/.opencode/skills/ws-migrate/SKILL.md +54 -0
- package/templates/workspace/.opencode/skills/ws-plan/SKILL.md +148 -0
- package/templates/workspace/.opencode/skills/ws-plan-verify/SKILL.md +61 -0
- package/templates/workspace/.opencode/skills/ws-preflight/SKILL.md +60 -0
- package/templates/workspace/.opencode/skills/ws-pull/SKILL.md +119 -0
- package/templates/workspace/.opencode/skills/ws-push/SKILL.md +110 -0
- package/templates/workspace/.opencode/skills/ws-quality-review/SKILL.md +63 -0
- package/templates/workspace/.opencode/skills/ws-req-change/SKILL.md +41 -0
- package/templates/workspace/.opencode/skills/ws-req-contract-sync/SKILL.md +17 -0
- package/templates/workspace/.opencode/skills/ws-req-contract-validate/SKILL.md +12 -0
- package/templates/workspace/.opencode/skills/ws-req-flow-sync/SKILL.md +28 -0
- package/templates/workspace/.opencode/skills/ws-req-review/SKILL.md +32 -0
- package/templates/workspace/.opencode/skills/ws-review/SKILL.md +57 -0
- package/templates/workspace/.opencode/skills/ws-rule/SKILL.md +23 -0
- package/templates/workspace/.opencode/skills/ws-spec-review/SKILL.md +64 -0
- package/templates/workspace/.opencode/skills/ws-submodule-setup/SKILL.md +65 -0
- package/templates/workspace/.opencode/skills/ws-verify-before-complete/SKILL.md +59 -0
- package/templates/workspace/AGENTS.md +72 -30
- package/templates/workspace/changes/README.md +18 -0
- package/templates/workspace/changes/templates/proposal.md +15 -0
- package/templates/workspace/changes/templates/tasks.md +9 -2
- package/templates/workspace/manifest.json +277 -2
- package/templates/workspace/tools/ws_change_check.py +26 -4
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-push
|
|
3
|
+
description: 推送(submodule 感知:先 submodules 后 superproject;fast-forward 安全)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 在不自动提交的前提下,安全 push 当前仓库
|
|
10
|
+
- 若仓库包含 submodules:按 `submodules -> superproject` 顺序 push,减少“别人拉取后子模块 detached/分叉”的协作摩擦
|
|
11
|
+
- 若不包含 submodules:按普通 git 仓库的规则 push
|
|
12
|
+
|
|
13
|
+
安全约束(强制):
|
|
14
|
+
- 不自动提交、不自动 `git add -A`
|
|
15
|
+
- 不使用 `--force` / `--force-with-lease`
|
|
16
|
+
- 默认只允许 fast-forward push(发现分叉则停止并提示人工处理)
|
|
17
|
+
- 若工作区不干净:停止并要求先 commit 或 stash
|
|
18
|
+
|
|
19
|
+
执行步骤(建议):
|
|
20
|
+
0) 输出上下文:
|
|
21
|
+
```bash
|
|
22
|
+
git branch --show-current
|
|
23
|
+
git status --porcelain
|
|
24
|
+
git status -sb
|
|
25
|
+
```
|
|
26
|
+
若 `git status --porcelain` 非空:停止。
|
|
27
|
+
|
|
28
|
+
1) 判断是否存在 submodules:
|
|
29
|
+
```bash
|
|
30
|
+
if [[ -f .gitmodules ]]; then
|
|
31
|
+
git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' || true
|
|
32
|
+
else
|
|
33
|
+
echo "[info] no .gitmodules"
|
|
34
|
+
fi
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2) 若不存在 `.gitmodules` 或没有 submodule 条目:按普通仓库 push(仍需用户确认):
|
|
38
|
+
```bash
|
|
39
|
+
git remote -v
|
|
40
|
+
git push
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
3) 若存在 submodules:先检查 `.gitmodules` 的 branch 真值是否齐全(缺失则停止并提示 setup):
|
|
44
|
+
```bash
|
|
45
|
+
missing=0
|
|
46
|
+
while read -r key sub_path; do
|
|
47
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
48
|
+
b="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
|
|
49
|
+
if [[ -z "${b:-}" ]]; then
|
|
50
|
+
echo "error: missing .gitmodules submodule.${name}.branch (path=${sub_path})"
|
|
51
|
+
missing=1
|
|
52
|
+
fi
|
|
53
|
+
done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
|
|
54
|
+
if [[ "$missing" -ne 0 ]]; then
|
|
55
|
+
echo "hint: run $ws-submodule-setup (and commit .gitmodules), then retry"
|
|
56
|
+
exit 2
|
|
57
|
+
fi
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
4) 逐个 push submodules(fast-forward only),再 push superproject:
|
|
61
|
+
```bash
|
|
62
|
+
base_branch="$(git branch --show-current)"
|
|
63
|
+
change_id="$(echo "${base_branch}" | sed -n 's|^change/||p')"
|
|
64
|
+
targets="changes/${change_id}/submodules.targets"
|
|
65
|
+
# Note: if not on a change/ branch, change_id is empty and targets file won't exist;
|
|
66
|
+
# resolution falls back to .gitmodules submodule.<name>.branch via ws_resolve_sub_target.
|
|
67
|
+
|
|
68
|
+
source tools/ws_resolve_sub_target.sh
|
|
69
|
+
|
|
70
|
+
git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null \
|
|
71
|
+
| while read -r key sub_path; do
|
|
72
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
73
|
+
echo "== submodule: ${sub_path} (${name}) =="
|
|
74
|
+
|
|
75
|
+
# submodule 工作区必须干净
|
|
76
|
+
if [[ -n "$(git -C "${sub_path}" status --porcelain 2>/dev/null || true)" ]]; then
|
|
77
|
+
echo "error: submodule dirty: ${sub_path}"
|
|
78
|
+
exit 2
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
ws_resolve_sub_target "${sub_path}" "${name}" "${targets}" "${base_branch}" || exit 2
|
|
82
|
+
target_branch="${_resolved_branch}"
|
|
83
|
+
remote="${_resolved_remote}"
|
|
84
|
+
|
|
85
|
+
git -C "${sub_path}" fetch "${remote}" --prune
|
|
86
|
+
if ! git -C "${sub_path}" show-ref --verify --quiet "refs/remotes/${remote}/${target_branch}"; then
|
|
87
|
+
echo "error: missing ${remote}/${target_branch} for ${sub_path}"
|
|
88
|
+
exit 2
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
# fast-forward only: <remote>/<branch> 必须是 HEAD 的祖先
|
|
92
|
+
if ! git -C "${sub_path}" merge-base --is-ancestor "${remote}/${target_branch}" HEAD; then
|
|
93
|
+
echo "error: non-fast-forward (submodule=${sub_path}, remote=${remote}, branch=${target_branch})"
|
|
94
|
+
echo "hint: rebase/merge in submodule, then retry"
|
|
95
|
+
exit 2
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
# push HEAD -> <remote>/<branch>(不 force)
|
|
99
|
+
git -C "${sub_path}" push "${remote}" "HEAD:refs/heads/${target_branch}"
|
|
100
|
+
done
|
|
101
|
+
|
|
102
|
+
# 最后 push superproject(仍需用户确认远端/分支)
|
|
103
|
+
git remote -v
|
|
104
|
+
git push
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
输出要求:
|
|
108
|
+
- `Context:` 当前分支 + 是否有 submodules
|
|
109
|
+
- `Submodules:` 每个 submodule push 的目标分支与结果(成功/阻断原因)
|
|
110
|
+
- `Superproject:` push 结果
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-quality-review
|
|
3
|
+
description: 质量审查(行为回归 / 测试覆盖 / 实现质量)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 审查当前改动的行为正确性、边界条件、测试覆盖和实现质量
|
|
10
|
+
- 把“代码/行为层 findings”优先落盘到 `changes/<change-id>/review/quality-review.md`
|
|
11
|
+
|
|
12
|
+
OpenCode + oMo 优先策略:
|
|
13
|
+
- 若检测到 `.opencode/oh-my-opencode.json`,或当前会话明确可用 `oracle` / `explore`,优先借用这些 agent 做质量审查。
|
|
14
|
+
- `@oracle` 优先负责独立质量/回归审查;`@explore` 负责补代码路径、依赖关系和影响面探索。
|
|
15
|
+
- 主 agent 负责把 findings / gaps / next 收敛并落盘。
|
|
16
|
+
|
|
17
|
+
阶段定位:
|
|
18
|
+
- review 子 gate;负责实现质量、行为回归与验证覆盖审查。
|
|
19
|
+
|
|
20
|
+
必需输入:
|
|
21
|
+
- 当前 `git diff`
|
|
22
|
+
- 已执行的验证结果
|
|
23
|
+
- 相关代码 / 配置 / 测试文件
|
|
24
|
+
- 若存在:`changes/<change-id>/analysis/`、`patches/`、已有 review 文件
|
|
25
|
+
|
|
26
|
+
必需输出:
|
|
27
|
+
- `证据(Evidence):` `changes/<change-id>/review/quality-review.md` 或回退 `.agentdocs/tmp/review/quality-review.md`
|
|
28
|
+
- `主要发现(Findings):` 高到低排序的问题 / 风险 / 缺失测试
|
|
29
|
+
- `下一步(Next):` 最小修复项与回归命令
|
|
30
|
+
|
|
31
|
+
阻断条件:
|
|
32
|
+
- 没有可审改动
|
|
33
|
+
- 没有任何验证上下文
|
|
34
|
+
- 无法写 review 证据
|
|
35
|
+
|
|
36
|
+
完成判定:
|
|
37
|
+
- 已落盘 quality review 证据,且 findings / 测试缺口 / next 明确。
|
|
38
|
+
|
|
39
|
+
步骤(建议):
|
|
40
|
+
1) 先读取 `git diff`、验证结果与相关代码。
|
|
41
|
+
- 若检测到 oMo:优先让 `@oracle` 做 quality review 草稿;必要时再调用 `@explore` 补代码路径上下文。
|
|
42
|
+
2) 检查:
|
|
43
|
+
- 行为是否可能回归
|
|
44
|
+
- 边界条件 / 失败路径是否覆盖
|
|
45
|
+
- 测试是否足以支撑改动
|
|
46
|
+
- 是否存在明显复杂度、耦合、可维护性或性能问题
|
|
47
|
+
3) 将结论落盘到:
|
|
48
|
+
- 默认:`changes/<change-id>/review/quality-review.md`
|
|
49
|
+
- 回退:`.agentdocs/tmp/review/quality-review.md`
|
|
50
|
+
4) 输出:
|
|
51
|
+
- `证据(Evidence):`
|
|
52
|
+
- `主要发现(Findings):`
|
|
53
|
+
- `测试缺口(Gaps):`
|
|
54
|
+
- `下一步(Next):`
|
|
55
|
+
|
|
56
|
+
重点:
|
|
57
|
+
- 这是质量 / 回归 review,不替代 requirements / gate review。
|
|
58
|
+
- 若发现流程、归因、evidence 缺口,转交给 `$ws-spec-review`。
|
|
59
|
+
|
|
60
|
+
安全:
|
|
61
|
+
- 不打印 secrets。
|
|
62
|
+
- 不执行破坏性命令。
|
|
63
|
+
- 若 oMo agent 不可用,回退为当前 agent 本地 quality review。
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-req-change
|
|
3
|
+
description: 需求变更(更新 REQUIREMENTS 并同步执行合同)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:记录需求变更(更新 `REQUIREMENTS.md` + 追加 `requirements/CHANGELOG.md`),并同步/校验执行合同 `requirements/requirements-issues.csv`。
|
|
9
|
+
|
|
10
|
+
步骤(必须按顺序):
|
|
11
|
+
1) 读取:`AI_PROJECT.md`、`REQUIREMENTS.md`、`AI_WORKSPACE.md`、`requirements/CHANGELOG.md`(缺失则创建目录与文件)。
|
|
12
|
+
2) 先产出“拟变更方案”(不要立刻写文件):
|
|
13
|
+
- 变更摘要(1–5 条)
|
|
14
|
+
- 影响范围(API/鉴权/字段/状态码/测试边界)
|
|
15
|
+
- 回滚思路(1–2 条)
|
|
16
|
+
3) 对比与冲突检查(强制,不写文件):
|
|
17
|
+
- 对比“变更前 vs 拟变更后”的差异清单(新增/删除/语义变化)
|
|
18
|
+
- 整理潜在冲突/不确定点(只列“最可能影响验收/实现”的,避免噪音)
|
|
19
|
+
4) 逐条澄清(强制,避免一次问完):
|
|
20
|
+
- 若存在潜在冲突/不确定点:**本轮只问 1 个**最高优先级问题(给出 2–4 个可选答案或二选一),然后停止,等待用户回复;不要继续问下一题,也不要写文件。
|
|
21
|
+
- 收到用户回复后:更新“拟变更方案”,回到步骤 3) 重新对比,直至没有未决问题。
|
|
22
|
+
5) 强制停下来让用户确认:是否继续落盘?(Y/N)
|
|
23
|
+
6) 用户确认 Y 后再写入:
|
|
24
|
+
- 更新 `REQUIREMENTS.md`(只保留当前有效版本,不在此堆历史)
|
|
25
|
+
- 追加 `requirements/CHANGELOG.md`
|
|
26
|
+
7) 同步/补齐需求执行合同(强制,自动处理 FlowSpec 有/无两种情况):
|
|
27
|
+
- `python3 tools/requirements_contract_sync.py --workspace .`
|
|
28
|
+
- 说明:若 `REQUIREMENTS.md` 中不存在 FlowSpec(或 flows 为空),该命令只会确保 `requirements/requirements-issues.csv` 表头存在并给出 WARN(这是预期行为,不要当成失败)。
|
|
29
|
+
8) 校验需求执行合同(强制):`python3 tools/requirements_contract.py validate`
|
|
30
|
+
9) 同步场景合同(可选,但若存在 FlowSpec 则强烈建议自动执行):
|
|
31
|
+
- 若 `REQUIREMENTS.md` 同时包含 `<!-- FLOW_SPEC_BEGIN -->` 与 `<!-- FLOW_SPEC_END -->`:运行 `$ws-req-flow-sync`
|
|
32
|
+
- 否则:跳过,并提示用户“可以先不维护 FlowSpec;后续需要场景回归时再补”
|
|
33
|
+
|
|
34
|
+
输出必须包含:
|
|
35
|
+
- 本次更新的文件清单(路径)
|
|
36
|
+
- 回滚方案(如何撤销本次需求变更)
|
|
37
|
+
- 下一步建议命令
|
|
38
|
+
|
|
39
|
+
安全:
|
|
40
|
+
- 不打印 `secrets/test-accounts.json`
|
|
41
|
+
- 不引入任何 token/密钥到仓库
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-req-contract-sync
|
|
3
|
+
description: 合同同步(requirements contract sync)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
用途:从 `REQUIREMENTS.md` 的 FlowSpec 补齐 `requirements/requirements-issues.csv`(只生成骨架,不猜测完成状态)。
|
|
9
|
+
|
|
10
|
+
执行(在 workspace 根目录):
|
|
11
|
+
- `python3 tools/requirements_contract_sync.py --workspace .`
|
|
12
|
+
|
|
13
|
+
输出要求:
|
|
14
|
+
- 说明新增/更新了多少条
|
|
15
|
+
- 明确下一步:手工补齐 CRUD/Inputs/Outputs/Business_Logic/Tests,并将可开工条目标为 `Spec_Status=READY`
|
|
16
|
+
|
|
17
|
+
下一步建议:`$ws-req-contract-validate`
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-req-contract-validate
|
|
3
|
+
description: 合同校验(requirements contract validate)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
执行(失败则修正 CSV 后重试):
|
|
9
|
+
- `python3 tools/requirements_contract.py validate`
|
|
10
|
+
|
|
11
|
+
输出要求:
|
|
12
|
+
- 若失败:列出前 20 条缺失字段(Req_ID + field),并给出最小补齐建议
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-req-flow-sync
|
|
3
|
+
description: Flow 同步(生成 api-flow 与场景执行合同)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出;命令与路径保持原样不翻译。
|
|
7
|
+
|
|
8
|
+
目标:基于 `REQUIREMENTS.md` 的 FlowSpec 生成:
|
|
9
|
+
- `docs/api-flow.mmd`(简短逻辑图,Mermaid)
|
|
10
|
+
- `issues/server-scenario-issues.csv`(场景执行合同:TODO/DONE/BLOCKED)
|
|
11
|
+
|
|
12
|
+
执行(在 workspace 根目录):
|
|
13
|
+
`python3 tools/requirements_flow_gen.py --workspace .`
|
|
14
|
+
|
|
15
|
+
若缺少工具 `tools/requirements_flow_gen.py`:提示用户先运行 `$aiws-init`(默认会安装 optional tools),或执行:
|
|
16
|
+
```bash
|
|
17
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
18
|
+
./node_modules/.bin/aiws init .
|
|
19
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
20
|
+
aiws init .
|
|
21
|
+
else
|
|
22
|
+
npx @aipper/aiws init .
|
|
23
|
+
fi
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
输出要求:只打印生成的文件路径与下一步命令:
|
|
27
|
+
- 查看逻辑图:`cat docs/api-flow.mmd`
|
|
28
|
+
- 查看场景合同:`cat issues/server-scenario-issues.csv`
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-req-review
|
|
3
|
+
description: 需求评审(对齐真值与验收)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:在不修改任何文件的前提下,对 `REQUIREMENTS.md` 做一次整体 QA,输出缺口/冲突/风险,减少实现漂移。
|
|
9
|
+
|
|
10
|
+
执行步骤(强制):
|
|
11
|
+
1) 定位项目根目录:`git rev-parse --show-toplevel`(失败则停止并让用户确认根目录)。
|
|
12
|
+
2) 读取(存在则必须读取;缺失则明确列出,不要臆测):
|
|
13
|
+
- `AI_PROJECT.md`
|
|
14
|
+
- `REQUIREMENTS.md`
|
|
15
|
+
- `AI_WORKSPACE.md`
|
|
16
|
+
- `requirements/CHANGELOG.md`(若存在)
|
|
17
|
+
- `requirements/requirements-issues.csv`(若存在)
|
|
18
|
+
3) 输出固定结构的报告:
|
|
19
|
+
|
|
20
|
+
## Requirements QA
|
|
21
|
+
- 结论:是否可进入实现(是/否/有条件)
|
|
22
|
+
- 漂移风险:最容易导致不一致的点
|
|
23
|
+
- 可验收性缺口:缺少输入/输出/错误码/边界/示例的条目
|
|
24
|
+
- 完整性:Non-goals/兼容性/鉴权/重试/并发/观测性/性能
|
|
25
|
+
- 一致性:与 `AI_PROJECT.md` 约束冲突点
|
|
26
|
+
- 可测试性与证据:最小验证命令 + 期望结果 + 证据路径
|
|
27
|
+
- 风险清单:3–8 条
|
|
28
|
+
- 需要澄清的问题:5–12 个(按优先级)
|
|
29
|
+
|
|
30
|
+
4) 最后询问用户:是否进入需求落盘流程 `$ws-req-change`?(Y/N)
|
|
31
|
+
|
|
32
|
+
安全:不打印 `secrets/test-accounts.json`。
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-review
|
|
3
|
+
description: 评审(提交前审计与证据落盘)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:在提交/交付前审计当前改动,对照真值文件检查是否越界,并把审计证据优先落盘到 `changes/<change-id>/review/`(若无法确定 `change-id` 再回退 `.agentdocs/tmp/review/`)。
|
|
9
|
+
|
|
10
|
+
OpenCode + oMo 优先策略:
|
|
11
|
+
- 若检测到 `.opencode/oh-my-opencode.json`,或当前会话明确可用 `oracle` / `explore` / `librarian`,优先借用这些 agent 做 review。
|
|
12
|
+
- `@oracle` 优先负责独立审查与 findings;`@explore` 用于补 diff 影响面;`@librarian` 用于补 requirements / docs / 依赖上下文。
|
|
13
|
+
- 主 agent 必须负责把 findings 收敛并落盘,不要把子 agent 输出直接当最终 review 结论。
|
|
14
|
+
|
|
15
|
+
阶段定位:
|
|
16
|
+
- review 阶段;负责对当前改动做规范、风险和验证完整性的审计。
|
|
17
|
+
|
|
18
|
+
必需输入:
|
|
19
|
+
- 当前 `git status` / `git diff`
|
|
20
|
+
- 已执行的验证结果
|
|
21
|
+
- 真值文件:`AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`
|
|
22
|
+
- 当前 `change/<change-id>` 上下文(若能识别)
|
|
23
|
+
- 若存在:`changes/<change-id>/analysis/`、`patches/`、已有 `review/` 文件
|
|
24
|
+
|
|
25
|
+
必需输出:
|
|
26
|
+
- 审计文件:`changes/<change-id>/review/codex-review.md` 或回退 `.agentdocs/tmp/review/codex-review.md`
|
|
27
|
+
- `主要风险(Top risks):` 3-8 条
|
|
28
|
+
- `下一步(Next):` 最小修复清单 + 最小验证命令
|
|
29
|
+
|
|
30
|
+
阻断条件:
|
|
31
|
+
- 没有可审计的改动或验证上下文
|
|
32
|
+
- 审计证据无法写盘
|
|
33
|
+
|
|
34
|
+
完成判定:
|
|
35
|
+
- 审计证据已落盘,主要风险和下一步已明确,可作为 commit/deliver 前置输入。
|
|
36
|
+
|
|
37
|
+
步骤(建议):
|
|
38
|
+
1) 先做 preflight:定位项目根目录,读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`,输出约束摘要。
|
|
39
|
+
- 若检测到 oMo:优先让 `@oracle` 做独立审查;必要时再让 `@explore` / `@librarian` 补上下文。
|
|
40
|
+
2) 基于 `git status` / `git diff`(以及你实际运行过的测试结果),对照 `AI_PROJECT.md` 与 `REQUIREMENTS.md` 检查:
|
|
41
|
+
- 是否存在越界目录改动/危险操作
|
|
42
|
+
- 是否有可复现验证命令与证据
|
|
43
|
+
- 是否维护了 `changes/<change-id>/` 或相关 `issues/*.csv`
|
|
44
|
+
- 若存在 `analysis/` / `patches/`:审查这些委托工件是否已被主 agent 理解、是否需要采用/拒绝,并把结论写入 review 文件
|
|
45
|
+
3) 将审计落盘到(目录不存在则创建):
|
|
46
|
+
- 默认:`changes/<change-id>/review/codex-review.md`
|
|
47
|
+
- 回退:`.agentdocs/tmp/review/codex-review.md`(仅在无法确定 `change-id` 时使用)
|
|
48
|
+
- 若已有其它 reviewer 文件:不要覆盖它们;当前 reviewer 应写自己的文件或更新自己的汇总文件
|
|
49
|
+
4) 回复中输出:
|
|
50
|
+
- `证据(Evidence):` 证据文件路径
|
|
51
|
+
- `主要风险(Top risks):` 3–8 条(高→低)
|
|
52
|
+
- `下一步(Next):` 最小修复清单 + 最小验证命令
|
|
53
|
+
|
|
54
|
+
安全:
|
|
55
|
+
- 不打印 secrets。
|
|
56
|
+
- 不执行破坏性命令。
|
|
57
|
+
- 若 oMo agent 不可用,回退为当前 agent 本地 review,不阻断流程。
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-rule
|
|
3
|
+
description: 规则(解释项目规则与边界)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:把用户口述的“项目特有规则”整理成可执行条款,并写入 `AI_PROJECT.md` 的 `AI_PROJECT_RULES_BEGIN/END` 段(托管块外内容会被保留)。
|
|
9
|
+
|
|
10
|
+
安全规则(强制):
|
|
11
|
+
- 不打印/不写入 secrets(token、密钥、内网地址、账号密码)。
|
|
12
|
+
- 不执行破坏性命令。
|
|
13
|
+
|
|
14
|
+
工作流:
|
|
15
|
+
1) 先做 preflight;若缺失 `AI_PROJECT.md`:提示用户先 `$ws-migrate`(或 `$aiws-init`)。
|
|
16
|
+
2) 写入前创建备份(必须):
|
|
17
|
+
`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}`
|
|
18
|
+
3) 先输出“将写入的规则清单”(3–12 条),并要求用户回复 `CONFIRM` 后再落盘。
|
|
19
|
+
4) 用户确认后,**仅更新** BEGIN/END 段内内容(合并去重;写成可检查条款:目录白名单/必须验证命令/禁止项/产物要求)。
|
|
20
|
+
5) 输出必须包含:
|
|
21
|
+
- 更新了哪些文件(路径)
|
|
22
|
+
- 回滚方式(恢复备份文件)
|
|
23
|
+
- 下一步建议:`$aiws-validate`
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-spec-review
|
|
3
|
+
description: 规范审查(requirements / plan / evidence / gate 完整性)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 审查当前改动是否满足真值文件、change 绑定、证据路径和 gate 完整性要求
|
|
10
|
+
- 把“流程/规范层 blocker”与“代码层问题”区分开,优先落盘到 `changes/<change-id>/review/spec-review.md`
|
|
11
|
+
|
|
12
|
+
OpenCode + oMo 优先策略:
|
|
13
|
+
- 若检测到 `.opencode/oh-my-opencode.json`,或当前会话明确可用 `oracle` / `librarian`,优先借用它们做 spec / gate 审查。
|
|
14
|
+
- `@oracle` 优先负责 requirements / gate / evidence 独立审查;`@librarian` 负责补文档、规范、依赖与路径真值。
|
|
15
|
+
- 主 agent 负责把 blocker / warning / next 收敛到最终 review 文件。
|
|
16
|
+
|
|
17
|
+
阶段定位:
|
|
18
|
+
- review 子 gate;负责 requirements / plan / evidence / workflow gate 完整性审查。
|
|
19
|
+
|
|
20
|
+
必需输入:
|
|
21
|
+
- `AI_PROJECT.md`
|
|
22
|
+
- `REQUIREMENTS.md`
|
|
23
|
+
- `AI_WORKSPACE.md`
|
|
24
|
+
- 当前 `git diff`
|
|
25
|
+
- 若存在:`plan/...`、`changes/<change-id>/proposal.md`、`tasks.md`、`review/`、`evidence/`
|
|
26
|
+
|
|
27
|
+
必需输出:
|
|
28
|
+
- `证据(Evidence):` `changes/<change-id>/review/spec-review.md` 或回退 `.agentdocs/tmp/review/spec-review.md`
|
|
29
|
+
- `阻断项(Blockers):` requirements 归因 / gate / evidence 缺口
|
|
30
|
+
- `下一步(Next):` 修复项与最小验证命令
|
|
31
|
+
|
|
32
|
+
阻断条件:
|
|
33
|
+
- 无法定位项目根或真值文件
|
|
34
|
+
- 无法判断当前 change / 归因上下文
|
|
35
|
+
- 无法写 review 证据
|
|
36
|
+
|
|
37
|
+
完成判定:
|
|
38
|
+
- 已落盘 spec review 证据,且明确指出 blocker / warning / next。
|
|
39
|
+
|
|
40
|
+
步骤(建议):
|
|
41
|
+
1) 先运行 `$ws-preflight`。
|
|
42
|
+
- 若检测到 oMo:优先让 `@oracle` 做 spec review 草稿;需要补规范上下文时再调用 `@librarian`。
|
|
43
|
+
2) 对照 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md` 检查:
|
|
44
|
+
- 当前改动能否归因到 `Req_ID` / `Problem_ID`
|
|
45
|
+
- `plan/...`、`proposal.md`、`tasks.md`、`evidence/` 是否与改动保持一致
|
|
46
|
+
- 是否存在越界目录改动、危险操作、未声明的非目标扩张
|
|
47
|
+
- 是否已经准备好可复现验证入口
|
|
48
|
+
3) 把结论落盘到:
|
|
49
|
+
- 默认:`changes/<change-id>/review/spec-review.md`
|
|
50
|
+
- 回退:`.agentdocs/tmp/review/spec-review.md`
|
|
51
|
+
4) 输出:
|
|
52
|
+
- `证据(Evidence):`
|
|
53
|
+
- `阻断项(Blockers):`
|
|
54
|
+
- `警告(Warnings):`
|
|
55
|
+
- `下一步(Next):`
|
|
56
|
+
|
|
57
|
+
重点:
|
|
58
|
+
- 这是 spec / gate review,不是代码质量 review。
|
|
59
|
+
- 若发现实现质量或回归问题,转交给 `$ws-quality-review`。
|
|
60
|
+
|
|
61
|
+
安全:
|
|
62
|
+
- 不打印 secrets。
|
|
63
|
+
- 不执行破坏性命令。
|
|
64
|
+
- 若 oMo agent 不可用,回退为当前 agent 本地 spec review。
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-submodule-setup
|
|
3
|
+
description: 子模块分支对齐(写入 .gitmodules 的 submodule.<name>.branch;减少 detached 与人为差异)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 为每个 submodule 写入 `.gitmodules` 的 `submodule.<name>.branch`,让 `ws-pull` / `ws-finish` 能确定性地“挂回分支/fast-forward push”,避免 origin 多分支时靠猜导致偏差。
|
|
10
|
+
- 该变更是 **superproject 的团队真值**:需要提交 `.gitmodules`。
|
|
11
|
+
|
|
12
|
+
安全约束(强制):
|
|
13
|
+
- 不自动提交、不自动 push(必须先输出 diff 并让用户确认)
|
|
14
|
+
- 不在 submodule 中做破坏性操作(不 `reset --hard` / 不改动远端)
|
|
15
|
+
|
|
16
|
+
步骤(建议):
|
|
17
|
+
1) 确认工作区干净(否则停止):
|
|
18
|
+
```bash
|
|
19
|
+
git status --porcelain
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
2) 列出 submodules(没有则停止并说明无需配置):
|
|
23
|
+
```bash
|
|
24
|
+
test -f .gitmodules || { echo "no .gitmodules"; exit 0; }
|
|
25
|
+
git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3) 对每个 submodule,输出当前配置与建议分支(让用户确认每个 submodule 的 branch):
|
|
29
|
+
```bash
|
|
30
|
+
while read -r key sub_path; do
|
|
31
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
32
|
+
echo "== submodule: ${name} path=${sub_path} =="
|
|
33
|
+
echo "[current] branch=$(git config --file .gitmodules --get submodule.${name}.branch || true)"
|
|
34
|
+
echo "[origin] HEAD=$(git -C \"${sub_path}\" symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null || true)"
|
|
35
|
+
git -C "${sub_path}" branch -r --list "origin/*" | sed -n '1,30p' || true
|
|
36
|
+
echo "[choose] set one of:"
|
|
37
|
+
echo " - a concrete branch, e.g. main / master / release/x.y"
|
|
38
|
+
echo " - '.' to follow superproject current branch name (only if your team uses matching branch names)"
|
|
39
|
+
done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$')
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
4) 逐个写入分支配置(每次写完都回显,避免误配):
|
|
43
|
+
```bash
|
|
44
|
+
# Example:
|
|
45
|
+
# git submodule set-branch --branch main path/to/submodule
|
|
46
|
+
# git submodule set-branch --branch . path/to/submodule
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
5) 输出变更并让用户确认是否提交:
|
|
50
|
+
```bash
|
|
51
|
+
git diff -- .gitmodules
|
|
52
|
+
git status --porcelain
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
6) 若用户确认要提交:
|
|
56
|
+
```bash
|
|
57
|
+
git add .gitmodules
|
|
58
|
+
git commit -m "chore(submodule): set tracking branches"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
输出要求:
|
|
62
|
+
- `Submodules:` name/path + 选择的 branch(每个都列出)
|
|
63
|
+
- `Diff:` `.gitmodules` 的 diff(或至少 `git diff -- .gitmodules` 的摘要)
|
|
64
|
+
- `Next:` 提示后续用 `$ws-pull` 拉取可自动减少 detached;`aiws validate` 会检查该配置是否齐全
|
|
65
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-verify-before-complete
|
|
3
|
+
description: 完成前验证(finish / handoff 前检查双审查与 validate/evidence 是否齐全)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 在进入 `$ws-finish` / `$ws-handoff` 前,检查 review、validate stamp 和证据是否齐全
|
|
10
|
+
- 输出明确的 pass/fail 结论,避免“看起来完成了但 gate 没过”的伪完成
|
|
11
|
+
|
|
12
|
+
阶段定位:
|
|
13
|
+
- finish 前 gate;负责 completion readiness 检查,不直接做 merge / push / handoff。
|
|
14
|
+
|
|
15
|
+
必需输入:
|
|
16
|
+
- `changes/<change-id>/review/spec-review.md`
|
|
17
|
+
- `changes/<change-id>/review/quality-review.md`
|
|
18
|
+
- `.agentdocs/tmp/aiws-validate/*.json`
|
|
19
|
+
- 若存在:`changes/<change-id>/evidence/...`、`git status`
|
|
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
|
+
- 不执行破坏性命令。
|