@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.
Files changed (107) hide show
  1. package/docs/cli-interface.md +10 -12
  2. package/docs/opencode-autonomous-swarm.md +178 -0
  3. package/docs/opencode-omo-adapter.md +123 -4
  4. package/docs/opencode-omo-validation-checklist.md +47 -0
  5. package/docs/opencode-subagent-first.md +187 -0
  6. package/docs/workflow-delegation-context-injection.md +217 -0
  7. package/docs/workflow-delegation-contracts.json +68 -1
  8. package/docs/workflow-delegation-contracts.md +3 -0
  9. package/docs/workflow-delegation-contracts.schema.json +95 -0
  10. package/docs/workflow-governance-rules.json +47 -6
  11. package/docs/workflow-governance-rules.md +7 -6
  12. package/docs/workflow-governance-rules.schema.json +39 -1
  13. package/docs/workflow-router-rules.json +63 -8
  14. package/docs/workflow-router-rules.md +15 -6
  15. package/docs/workflow-stage-contracts.json +16 -8
  16. package/docs/workflow-stage-contracts.md +7 -7
  17. package/package.json +1 -1
  18. package/templates/workspace/.agents/skills/using-aiws/SKILL.md +22 -8
  19. package/templates/workspace/.agents/skills/ws-commit/SKILL.md +6 -118
  20. package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +6 -218
  21. package/templates/workspace/.agents/skills/ws-dev/SKILL.md +52 -141
  22. package/templates/workspace/.agents/skills/ws-finish/SKILL.md +6 -205
  23. package/templates/workspace/.agents/skills/ws-handoff/SKILL.md +10 -44
  24. package/templates/workspace/.agents/skills/ws-intake/SKILL.md +87 -0
  25. package/templates/workspace/.agents/skills/ws-plan/SKILL.md +15 -9
  26. package/templates/workspace/.agents/skills/ws-plan-verify/SKILL.md +6 -49
  27. package/templates/workspace/.agents/skills/ws-review/SKILL.md +6 -1
  28. package/templates/workspace/.agents/skills/ws-verify-before-complete/SKILL.md +12 -53
  29. package/templates/workspace/.claude/commands/ws-intake.md +19 -0
  30. package/templates/workspace/.claude/commands/ws-review.md +5 -1
  31. package/templates/workspace/.claude/settings.json.example +26 -0
  32. package/templates/workspace/.claude/skills/ws-commit/SKILL.md +6 -118
  33. package/templates/workspace/.claude/skills/ws-deliver/SKILL.md +6 -218
  34. package/templates/workspace/.claude/skills/ws-dev/SKILL.md +52 -141
  35. package/templates/workspace/.claude/skills/ws-finish/SKILL.md +6 -205
  36. package/templates/workspace/.claude/skills/ws-handoff/SKILL.md +10 -44
  37. package/templates/workspace/.claude/skills/ws-intake/SKILL.md +31 -0
  38. package/templates/workspace/.claude/skills/ws-plan-verify/SKILL.md +6 -49
  39. package/templates/workspace/.claude/skills/ws-review/SKILL.md +6 -1
  40. package/templates/workspace/.claude/skills/ws-verify-before-complete/SKILL.md +12 -53
  41. package/templates/workspace/.opencode/command/ws-auto.md +33 -0
  42. package/templates/workspace/.opencode/command/ws-autonomy.md +25 -0
  43. package/templates/workspace/.opencode/command/ws-intake.md +22 -0
  44. package/templates/workspace/.opencode/command/ws-review.md +5 -1
  45. package/templates/workspace/.opencode/commands/ws-auto.md +33 -0
  46. package/templates/workspace/.opencode/commands/ws-autonomy.md +25 -0
  47. package/templates/workspace/.opencode/commands/ws-commit.md +4 -56
  48. package/templates/workspace/.opencode/commands/ws-deliver.md +10 -50
  49. package/templates/workspace/.opencode/commands/ws-finish.md +8 -65
  50. package/templates/workspace/.opencode/commands/ws-handoff.md +9 -17
  51. package/templates/workspace/.opencode/commands/ws-intake.md +22 -0
  52. package/templates/workspace/.opencode/commands/ws-migrate.md +10 -17
  53. package/templates/workspace/.opencode/commands/ws-plan-verify.md +5 -15
  54. package/templates/workspace/.opencode/commands/ws-pull.md +6 -75
  55. package/templates/workspace/.opencode/commands/ws-push.md +7 -82
  56. package/templates/workspace/.opencode/commands/ws-review.md +5 -1
  57. package/templates/workspace/.opencode/commands/ws-submodule-setup.md +8 -47
  58. package/templates/workspace/.opencode/commands/ws-verify-before-complete.md +10 -19
  59. package/templates/workspace/.opencode/helpers/approval-whitelist-check.sh +148 -0
  60. package/templates/workspace/.opencode/helpers/approval-whitelist-run.sh +82 -0
  61. package/templates/workspace/.opencode/helpers/approval-whitelist-watchdog.sh +144 -0
  62. package/templates/workspace/.opencode/helpers/tmux-swarm-rescue.sh +56 -0
  63. package/templates/workspace/.opencode/helpers/tmux-swarm-scan.sh +46 -0
  64. package/templates/workspace/.opencode/oh-my-opencode.json.example +64 -4
  65. package/templates/workspace/.opencode/skills/using-aiws/SKILL.md +93 -77
  66. package/templates/workspace/.opencode/skills/ws-analyze/SKILL.md +1 -1
  67. package/templates/workspace/.opencode/skills/ws-auto/SKILL.md +46 -0
  68. package/templates/workspace/.opencode/skills/ws-autonomy/SKILL.md +62 -0
  69. package/templates/workspace/.opencode/skills/ws-bugfix/SKILL.md +1 -1
  70. package/templates/workspace/.opencode/skills/ws-commit/SKILL.md +6 -118
  71. package/templates/workspace/.opencode/skills/ws-delegate/SKILL.md +93 -40
  72. package/templates/workspace/.opencode/skills/ws-deliver/SKILL.md +6 -218
  73. package/templates/workspace/.opencode/skills/ws-dev/SKILL.md +53 -142
  74. package/templates/workspace/.opencode/skills/ws-dev-lite/SKILL.md +19 -6
  75. package/templates/workspace/.opencode/skills/ws-finish/SKILL.md +6 -205
  76. package/templates/workspace/.opencode/skills/ws-frontend-design/SKILL.md +1 -1
  77. package/templates/workspace/.opencode/skills/ws-handoff/SKILL.md +10 -44
  78. package/templates/workspace/.opencode/skills/ws-intake/SKILL.md +40 -0
  79. package/templates/workspace/.opencode/skills/ws-migrate/SKILL.md +6 -42
  80. package/templates/workspace/.opencode/skills/ws-plan/SKILL.md +4 -2
  81. package/templates/workspace/.opencode/skills/ws-plan-verify/SKILL.md +6 -49
  82. package/templates/workspace/.opencode/skills/ws-preflight/SKILL.md +1 -1
  83. package/templates/workspace/.opencode/skills/ws-pull/SKILL.md +8 -109
  84. package/templates/workspace/.opencode/skills/ws-push/SKILL.md +8 -100
  85. package/templates/workspace/.opencode/skills/ws-quality-review/SKILL.md +1 -1
  86. package/templates/workspace/.opencode/skills/ws-req-change/SKILL.md +1 -1
  87. package/templates/workspace/.opencode/skills/ws-req-contract-sync/SKILL.md +1 -1
  88. package/templates/workspace/.opencode/skills/ws-req-contract-validate/SKILL.md +1 -1
  89. package/templates/workspace/.opencode/skills/ws-req-flow-sync/SKILL.md +1 -1
  90. package/templates/workspace/.opencode/skills/ws-req-review/SKILL.md +1 -1
  91. package/templates/workspace/.opencode/skills/ws-review/SKILL.md +14 -3
  92. package/templates/workspace/.opencode/skills/ws-rule/SKILL.md +1 -1
  93. package/templates/workspace/.opencode/skills/ws-spec-review/SKILL.md +1 -1
  94. package/templates/workspace/.opencode/skills/ws-submodule-setup/SKILL.md +10 -57
  95. package/templates/workspace/.opencode/skills/ws-verify-before-complete/SKILL.md +12 -53
  96. package/templates/workspace/AGENTS.md +12 -5
  97. package/templates/workspace/AI_PROJECT.md +1 -1
  98. package/templates/workspace/changes/README.md +9 -12
  99. package/templates/workspace/manifest.json +277 -203
  100. package/templates/workspace/.agents/skills/ws-migrate/SKILL.md +0 -54
  101. package/templates/workspace/.agents/skills/ws-pull/SKILL.md +0 -119
  102. package/templates/workspace/.agents/skills/ws-push/SKILL.md +0 -110
  103. package/templates/workspace/.agents/skills/ws-submodule-setup/SKILL.md +0 -65
  104. package/templates/workspace/.claude/skills/ws-migrate/SKILL.md +0 -54
  105. package/templates/workspace/.claude/skills/ws-pull/SKILL.md +0 -119
  106. package/templates/workspace/.claude/skills/ws-push/SKILL.md +0 -110
  107. package/templates/workspace/.claude/skills/ws-submodule-setup/SKILL.md +0 -65
@@ -1,110 +1,18 @@
1
1
  ---
2
2
  name: ws-push
3
- description: 推送(submodule 感知:先 submodules superproject;fast-forward 安全)
3
+ description: Thin wrapper for `aiws ws-push`
4
4
  ---
5
5
 
6
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
6
+ # ws-push
7
7
 
8
- 目标:
9
- - 在不自动提交的前提下,安全 push 当前仓库
10
- - 若仓库包含 submodules:按 `submodules -> superproject` 顺序 push,减少“别人拉取后子模块 detached/分叉”的协作摩擦
11
- - 若不包含 submodules:按普通 git 仓库的规则 push
8
+ Thin skill wrapper. Delegates to `aiws ws-push`. See `aiws ws-push --help` for details.
12
9
 
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
10
  ```bash
30
- if [[ -f .gitmodules ]]; then
31
- git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' || true
11
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
12
+ ./node_modules/.bin/aiws ws-push
13
+ elif command -v aiws >/dev/null 2>&1; then
14
+ aiws ws-push
32
15
  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
16
+ npx @aipper/aiws ws-push
57
17
  fi
58
18
  ```
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 结果
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ws-quality-review
3
- description: 质量审查(行为回归 / 测试覆盖 / 实现质量)
3
+ description: 使用时机:需要审查实现质量、测试覆盖时。触发词:质量审查、质量、回归、覆盖、代码体检。注意:流程完整性审查请用 ws-spec-review。
4
4
  ---
5
5
 
6
6
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ws-req-change
3
- description: 需求变更(更新 REQUIREMENTS 并同步执行合同)
3
+ description: 使用时机:需要修改需求文档、验收标准时。触发词:需求变更、验收、修改需求、REQUIREMENTS。注意:需求评审未通过请先走 ws-req-review。
4
4
  ---
5
5
 
6
6
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ws-req-contract-sync
3
- description: 合同同步(requirements contract sync
3
+ description: 使用时机:需要同步需求执行合同到代码时。触发词:合同同步、contract、req sync。注意:合同内容变更请先 ws-req-change。
4
4
  ---
5
5
 
6
6
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ws-req-contract-validate
3
- description: 合同校验(requirements contract validate
3
+ description: 使用时机:需要校验需求合同完整性时。触发词:合同校验、contract validate、需求核对。注意:合同未同步请先 ws-req-contract-sync。
4
4
  ---
5
5
 
6
6
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ws-req-flow-sync
3
- description: Flow 同步(生成 api-flow 与场景执行合同)
3
+ description: 使用时机:需要同步 API flow 和场景执行合同时。触发词:flow 同步、api flow、场景合同。注意:flow 定义变更请先 ws-req-change。
4
4
  ---
5
5
 
6
6
  用中文输出;命令与路径保持原样不翻译。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ws-req-review
3
- description: 需求评审(对齐真值与验收)
3
+ description: 使用时机:需要评审需求、验收条件、合同时。触发词:需求评审、验收评审、合同评审。注意:需求已确认直接进 ws-plan。
4
4
  ---
5
5
 
6
6
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
@@ -1,11 +1,12 @@
1
1
  ---
2
2
  name: ws-review
3
- description: 评审(提交前审计与证据落盘)
3
+ description: 使用时机:需要审计当前改动、查找风险时。触发词:审计、评审、review、风险检查、回归检查。注意:高风险变更应补 ws-spec-review + ws-quality-review。
4
4
  ---
5
5
 
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
  OpenCode + oMo 优先策略:
11
12
  - 若检测到 `.opencode/oh-my-opencode.json`,或当前会话明确可用 `oracle` / `explore` / `librarian`,优先借用这些 agent 做 review。
@@ -42,11 +43,21 @@ OpenCode + oMo 优先策略:
42
43
  - 是否有可复现验证命令与证据
43
44
  - 是否维护了 `changes/<change-id>/` 或相关 `issues/*.csv`
44
45
  - 若存在 `analysis/` / `patches/`:审查这些委托工件是否已被主 agent 理解、是否需要采用/拒绝,并把结论写入 review 文件
45
- 3) 将审计落盘到(目录不存在则创建):
46
+ 3) Workflow State Suffix 审计(检查 4 种后缀使用是否一致):
47
+ - `session` 后缀:只由 ws-dev-lite / ws-intake 写入,标记会话级进度(如 `[workflow-state:session:in_progress]`)
48
+ - `gate` 后缀:由 ws-dev / ws-plan-verify 写入,标记计划/实现门禁结果(如 `[workflow-state:gate:plan_passed]`)
49
+ - `plan` 后缀:由 ws-plan 写入,标记计划阶段状态(如 `[workflow-state:plan:in_progress]`)
50
+ - `gateway` 后缀:由 ws-finish / ws-deliver 写入,标记交付门禁结果(如 `[workflow-state:gateway:finish_gate_ok]`)
51
+ - 检查当前 change 中使用的后缀类型是否正确对应所在阶段;若出现混用(如 session 与 gate 在同一文件),在审计报告中标记异常并说明应该修正的方向。
52
+ 4) 将审计落盘到(目录不存在则创建):
46
53
  - 默认:`changes/<change-id>/review/codex-review.md`
47
54
  - 回退:`.agentdocs/tmp/review/codex-review.md`(仅在无法确定 `change-id` 时使用)
48
55
  - 若已有其它 reviewer 文件:不要覆盖它们;当前 reviewer 应写自己的文件或更新自己的汇总文件
49
- 4) 回复中输出:
56
+ 5) 若当前任务已进入"准备提交/交付/finish"的语境,继续补齐 dual review gate:
57
+ - 运行/收敛 `$ws-spec-review`,落盘 `changes/<change-id>/review/spec-review.md`(或回退 `.agentdocs/tmp/review/spec-review.md`)
58
+ - 运行/收敛 `$ws-quality-review`,落盘 `changes/<change-id>/review/quality-review.md`(或回退 `.agentdocs/tmp/review/quality-review.md`)
59
+ - 不要把单个 `codex-review.md` 误当成 finish gate 已完成
60
+ 6) 回复中输出:
50
61
  - `证据(Evidence):` 证据文件路径
51
62
  - `主要风险(Top risks):` 3–8 条(高→低)
52
63
  - `下一步(Next):` 最小修复清单 + 最小验证命令
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ws-rule
3
- description: 规则(解释项目规则与边界)
3
+ description: 使用时机:需要了解项目规则、边界、约束时。触发词:规则、边界、约束、规范、约定。注意:只查询不改代码。
4
4
  ---
5
5
 
6
6
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ws-spec-review
3
- description: 规范审查(requirements / plan / evidence / gate 完整性)
3
+ description: 使用时机:需要审查流程完整性、requirements 归因时。触发词:规范审查、流程审计、spec review。注意:实现质量审查请用 ws-quality-review。
4
4
  ---
5
5
 
6
6
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
@@ -1,65 +1,18 @@
1
1
  ---
2
2
  name: ws-submodule-setup
3
- description: 子模块分支对齐(写入 .gitmodules submodule.<name>.branch;减少 detached 与人为差异)
3
+ description: Thin wrapper for `aiws ws-submodule-setup`
4
4
  ---
5
5
 
6
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
6
+ # ws-submodule-setup
7
7
 
8
- 目标:
9
- - 为每个 submodule 写入 `.gitmodules` 的 `submodule.<name>.branch`,让 `ws-pull` / `ws-finish` 能确定性地“挂回分支/fast-forward push”,避免 origin 多分支时靠猜导致偏差。
10
- - 该变更是 **superproject 的团队真值**:需要提交 `.gitmodules`。
8
+ Thin skill wrapper. Delegates to `aiws ws-submodule-setup`. See `aiws ws-submodule-setup --help` for details.
11
9
 
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
10
  ```bash
44
- # Example:
45
- # git submodule set-branch --branch main path/to/submodule
46
- # git submodule set-branch --branch . path/to/submodule
11
+ if [[ -x "./node_modules/.bin/aiws" ]]; then
12
+ ./node_modules/.bin/aiws ws-submodule-setup
13
+ elif command -v aiws >/dev/null 2>&1; then
14
+ aiws ws-submodule-setup
15
+ else
16
+ npx @aipper/aiws ws-submodule-setup
17
+ fi
47
18
  ```
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
-
@@ -1,59 +1,18 @@
1
1
  ---
2
2
  name: ws-verify-before-complete
3
- description: 完成前验证(finish / handoff 前检查双审查与 validate/evidence 是否齐全)
3
+ description: Thin wrapper for `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
+ Thin skill wrapper. Delegates to `aiws ws-verify-before-complete`. See `aiws ws-verify-before-complete --help` for details.
11
9
 
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
- - 不执行破坏性命令。
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
+ ```
@@ -9,15 +9,16 @@
9
9
  - 不确定先跑 `/using-aiws`(Codex 对应 `$using-aiws`);它会先读真值,再把任务路由到合适的 `ws-*` 入口。
10
10
  - 若你已经明确只是做预检,也可以直接跑 `/ws-preflight`(Codex 对应 `$ws-preflight`);所有实现/修复都以 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md` 为准。
11
11
  - 每次变更建议进入 `change/<change-id>`,并维护 `changes/<change-id>/proposal.md`、`tasks.md`(可选 `design.md`)。
12
- - 若仓库存在 `.gitmodules`:优先 `aiws change start <change-id> --worktree`;不要在当前 superproject worktree 里直接切分支。
12
+ - 若仓库存在 `.gitmodules`:使用 `aiws change start <change-id> --switch`;不要在当前 superproject 里直接手工切分支。
13
13
  - 提交前执行 `aiws validate .`;需要本机门禁时运行 `aiws hooks install .`(或 `git config core.hooksPath .githooks`)。
14
14
  - 不要把敏感信息写入 git:`secrets/test-accounts.json`、`.env*`、token、内网地址等。
15
15
 
16
16
  标准链路(建议默认):
17
17
  - `using-aiws`:默认 bootstrap/router;先读真值,先判 workflow,再进入具体阶段;意图不明确时先澄清。
18
18
  - `ws-preflight`:读取真值文件,输出约束摘要;若真值缺失,先停止,不直接开工。
19
+ - `ws-intake`:计划前置澄清;适用于新需求或中大型变更,按“一题一线程”逐条冻结问题,产出 `plan/*.intake.md` 轻量草案。
19
20
  - `ws-plan`:建立 `change/<change-id>` 绑定,落盘 `plan/...`,明确 Verify / Risks / Evidence。
20
- - `ws-plan-verify`:在编码前做计划质检;不过门禁就先修 plan,不跳步进实现。
21
+ - `ws-plan-verify`:在编码前做计划质检 + 多视角方案审查;不过门禁就先修 plan,不跳步进实现。
21
22
  - `ws-dev`:只做可归因、可验证的小步实现;输出 Changed / Verify / Evidence。
22
23
  - `ws-dev-lite`:`ws-dev` 的轻量入口;适用于 simple/local 单点修复,默认不建 `plan/...`、不跑 `ws-plan-verify`,治理归属仍收敛到 `ws-dev`。
23
24
  - `ws-delegate`:仅在任务已绑定且 scope 可控时,使用原生多 agent / sub-agent;否则明确降级为单 agent + 协同工件模式。
@@ -30,6 +31,7 @@
30
31
  - `ws-handoff`:查看/补充归档后的 handoff,给下一次会话或下一位协作者接力。
31
32
 
32
33
  阶段产物(最少):
34
+ - intake:`plan/*.intake.md`
33
35
  - planning:`plan/...`、`changes/<change-id>/proposal.md`、`tasks.md`
34
36
  - implementation:代码 / 配置改动 + Verify 命令记录
35
37
  - collaboration:`changes/<change-id>/analysis/...`、`patches/...`、`review/...`
@@ -40,14 +42,18 @@
40
42
  OpenCode(如果你主要用 OpenCode,优先):
41
43
  - native skills 在 `.opencode/skills/`;native commands 在 `.opencode/commands/`
42
44
  - 若项目启用了 `.opencode/oh-my-opencode.json`:`ws-plan` / `ws-review` / `ws-spec-review` / `ws-quality-review` / `ws-delegate` 会优先借用 oMo 的 `planner-sisyphus` / `explore` / `librarian` / `oracle`
43
- - 若你想按项目固定这组 agent,可参考 `.opencode/oh-my-opencode.json.example`;它只覆盖 `agents`,不接管 hooks/MCP/LSP
45
+ - 若你想按项目固定这组 agent,可参考 `.opencode/oh-my-opencode.json.example`;它提供 autonomy 示例配置,但仍不接管 hooks/MCP/LSP/runtime
46
+ - 若你要做实验性的“尽量无人值守直到完成”:先看 `/ws-auto`、`/ws-autonomy`、`.claude/settings.json.example` 与 `.opencode/helpers/tmux-swarm-*.sh`
44
47
  - 常用手动入口继续保留在 `.opencode/commands/`(migration window 内 `.opencode/command/` 也会保留);直接使用 `/ws-*`
45
48
  - 若你不确定当前任务该先 plan、dev、review 还是 finish:先用 `/using-aiws`
49
+ - 需求还没冻结、想逐条把问题聊清楚:先用 `/ws-intake`
46
50
  - `/ws-preflight`:读取真值文件并输出约束摘要
47
- - `/ws-plan` / `/ws-plan-verify`:先生成计划,再做执行前质检
51
+ - `/ws-plan` / `/ws-plan-verify`:先生成计划,再做执行前质检与多视角方案审查
48
52
  - `/ws-dev`:常规实现/改配置/改测试
49
53
  - `/ws-dev-lite`:小问题直修;若复杂度升高,立刻回到 `/ws-dev` 或 `/ws-plan`
50
54
  - `/ws-delegate`:按 AIWS 委托合同拆分子任务,并优先借用 oMo agent
55
+ - `/ws-auto`:OpenCode/oMo 自动 bootstrap 入口;会先检查托管内容/是否需要 update,再按条件确保 watchdog 已启动
56
+ - `/ws-autonomy`:OpenCode/oMo 自主协作实验入口;声明 completion/retry/rescue 合同,不接管 runtime controller
51
57
  - `/ws-bugfix`:缺陷修复 + 证据落盘 + CSV 汇总
52
58
  - `/ws-review` / `/ws-commit`:提交前审计、门禁与 commit
53
59
  - `/ws-spec-review` / `/ws-quality-review`:高风险改动建议显式拆成流程审查 + 质量审查
@@ -60,13 +66,14 @@ Claude Code(如果你主要用 Claude Code):
60
66
  - native skills 在 `.claude/skills/`;command-style 兼容入口保留在 `.claude/commands/`
61
67
  - 常用链路可按 `ws-*` / `p-aiws-*` 理解;native skills 与 compatibility commands 指向同一套 AIWS workflow
62
68
  - 若你不确定当前任务该走哪个阶段:先用 `/using-aiws`
69
+ - 需求还没冻结、想逐条把问题聊清楚:先用 `/ws-intake`
63
70
  - 高风险改动或准备 finish 时,建议额外跑 `/ws-spec-review`、`/ws-quality-review`、`/ws-verify-before-complete`
64
71
 
65
72
  Codex(对应入口,可选):
66
73
  - 若你不想先记住阶段,先用 `$using-aiws` 让 router 判定下一步
67
74
  - 对应入口在 `.agents/skills/`;显式调用时使用 `$ws-*`
68
75
  - `$using-aiws`
69
- - `$ws-preflight` / `$ws-plan` / `$ws-plan-verify` / `$ws-dev` / `$ws-dev-lite` / `$ws-delegate` / `$ws-frontend-design`
76
+ - `$ws-preflight` / `$ws-intake` / `$ws-plan` / `$ws-plan-verify` / `$ws-dev` / `$ws-dev-lite` / `$ws-delegate` / `$ws-frontend-design`
70
77
  - `$ws-review` / `$ws-spec-review` / `$ws-quality-review` / `$ws-commit`
71
78
  - `$ws-verify-before-complete` / `$ws-finish` / `$ws-deliver`
72
79
  - `$ws-pull` / `$ws-push` / `$ws-submodule-setup`
@@ -38,7 +38,7 @@
38
38
  推荐(防规则/范围漂移):
39
39
  - 创建工件:补齐 `changes/<change-id>/proposal.md`、`tasks.md`(可选 `design.md`)
40
40
  - 声明 active change(团队共享):切到分支 `change/<change-id>`(也支持 `changes/`、`ws/`、`ws-change/`)
41
- - 若仓库存在 `.gitmodules`:优先使用 `aiws change start <change-id> --worktree`(或至少 `--no-switch`);不要在当前 superproject worktree 里直接手工切分支。
41
+ - 若仓库存在 `.gitmodules`:使用 `aiws change start <change-id> --switch`;不要在当前 superproject 里直接手工切分支。
42
42
  - 若 submodule 因 gitlink checkout 处于 detached HEAD:只允许挂到 `aiws/pin/<target-branch>`;不要直接切 `change/<change-id>` / `main` / `master` 等业务分支来“解 detached”。
43
43
  - 严格校验:`aiws validate .`(包含:漂移检测 + `ws_change_check` + `requirements_contract`)
44
44
  - 启用 hooks(本地生效):`git config core.hooksPath .githooks`(提交/推送时自动跑 `aiws validate .`)
@@ -32,14 +32,11 @@ changes/
32
32
  - `aiws change new <change-id>` 会预创建以上目录,减少临时约定漂移。
33
33
 
34
34
  常用命令(推荐使用 `aiws`;不依赖 dotfiles):
35
- - `aiws change start <change-id>`(默认:切到 `change/<change-id>` 并初始化工件目录;若检测到 `.gitmodules` 则默认优先使用 worktree,失败则回退为不切分支,避免 submodule 状态混乱)
35
+ - `aiws change start <change-id>`(默认:切到 `change/<change-id>` 并初始化工件目录)
36
36
  - `aiws change start <change-id> --no-switch`(superproject + submodule 场景:不切分支,仅准备 `change/<change-id>` 分支与工件目录)
37
- - `aiws change start <change-id> --switch`(显式允许切换 superproject 分支;仅切 superproject,不递归切换 submodule;仅在存在 `.gitmodules` 时有意义)
38
- - `aiws change start <change-id> --worktree`(推荐用于 superproject + submodule:创建独立 worktree;当前目录分支保持不变)
39
- - 可选:`--worktree-dir <path>` 覆盖 worktree 目录
40
- - 可选:`--submodules` 在 worktree 内执行 `git submodule update --init --recursive`
37
+ - `aiws change start <change-id> --switch`(显式允许切换 superproject 分支;仅切 superproject,不递归切换 submodule
41
38
  - `aiws change finish <change-id>`(安全合并:fast-forward 合并回目标分支;在 `change/<change-id>` 分支上执行时会尝试使用 `.ws-change.json` 的 `base_branch` 作为目标分支)
42
- - `aiws change finish <change-id> --push [--remote <name>]`(最小收尾闭环:若存在 `.gitmodules` 则先按 `changes/<id>/submodules.targets` 顺序 push submodule,再 push 目标分支;默认优先遵循 upstream 配置;若 `change/<change-id>` 位于独立 worktree,且该 worktree 干净,则在 push 成功后自动执行 worktree cleanup,并把 `changes/<id>/` 自动归档到 `changes/archive/...`,同时生成 `handoff.md` 与 archive commit)
39
+ - `aiws change finish <change-id> --push [--remote <name>]`(最小收尾闭环:若存在 `.gitmodules` 则先按 `changes/<id>/submodules.targets` 顺序 push submodule,再 push 目标分支;默认优先遵循 upstream 配置;push 成功后把 `changes/<id>/` 自动归档到 `changes/archive/...`,同时生成 `handoff.md` 与 archive commit)
43
40
  - 已 archive 的 `change/<change-id>` 才算真正终态;若只是“已 finish 但仍有 active `changes/<id>/` 未归档”,默认应重跑 `aiws change finish <change-id> --push` 续完收尾,而不是继续开发或复用旧 branch 做新需求。
44
41
  - `aiws change new <change-id>`
45
42
  - `aiws change list`
@@ -55,10 +52,10 @@ Active change(推荐,团队共享):
55
52
  - 切到该分支后,可省略 `<change-id>` 执行:`aiws change status|next|validate|sync`
56
53
 
57
54
  计划质量门(推荐,执行前):
58
- - 先生成计划:`$ws-plan`(若尚未进入 `change/<change-id>` 上下文,应先由它调用 `aiws change start <change-id>` 建立分支 / worktree,再在该上下文内写 `plan/...`)
55
+ - 先生成计划:`$ws-plan`(若尚未进入 `change/<change-id>` 上下文,应先由它调用 `aiws change start <change-id>` 建立分支,再在该上下文内写 `plan/...`)
59
56
  - 再执行计划质检:`$ws-plan-verify`
60
57
  - 最后进入实现:`$ws-dev`
61
- - 若 `$ws-plan` 创建了独立 worktree,后续 `$ws-plan-verify` / `$ws-dev` / `$ws-finish` 都应优先在该 worktree 内继续
58
+ - 若 `$ws-plan` 创建了独立 `change/<change-id>` 分支,后续 `$ws-plan-verify` / `$ws-dev` / `$ws-finish` 都应优先在该分支内继续
62
59
  - 目标:确保计划具备主索引绑定、步骤不过长、验证命令可复现且有预期结果
63
60
 
64
61
  模板覆盖(可选):
@@ -88,10 +85,10 @@ Hooks/CI(推荐,硬约束):
88
85
  - 紧急跳过(不推荐):`WS_CHANGE_HOOK_BYPASS=1 ...`(CI 不应允许跳过)。
89
86
 
90
87
  合并建议(减少人为 merge 引入新问题):
91
- - 优先使用 worktree + fast-forward 合并:
92
- - 完成后在主工作区(例如 `main`)执行:`aiws change finish <change-id>`(等价于 `git merge --ff-only change/<change-id>`)
93
- - 若还要顺手 push 并清理独立 change worktree:`aiws change finish <change-id> --push`
94
- - 若失败:先在 worktree `git rebase main`(或更新 main 后再 rebase),再重试 `--ff-only`
88
+ - 优先使用 fast-forward 合并:
89
+ - 完成后在目标分支(例如 `main`)执行:`aiws change finish <change-id>`(等价于 `git merge --ff-only change/<change-id>`)
90
+ - 若还要顺手 push:`aiws change finish <change-id> --push`
91
+ - 若失败:先在 change 分支 `git rebase main`(或更新 main 后再 rebase),再重试 `--ff-only`
95
92
 
96
93
  协同交付建议:
97
94
  - 委托分析先落到 `changes/<id>/analysis/`,由主 agent 在 `ws-review` 或 `review/*.md` 中收敛结论。