@aipper/aiws-spec 0.0.28 → 0.0.30

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 (138) 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 +108 -2
  8. package/docs/workflow-delegation-contracts.md +13 -0
  9. package/docs/workflow-delegation-contracts.schema.json +152 -0
  10. package/docs/workflow-governance-rules.json +47 -6
  11. package/docs/workflow-governance-rules.md +8 -7
  12. package/docs/workflow-governance-rules.schema.json +39 -1
  13. package/docs/workflow-review-gates.json +6 -0
  14. package/docs/workflow-review-gates.md +14 -5
  15. package/docs/workflow-review-gates.schema.json +4 -0
  16. package/docs/workflow-router-rules.json +72 -8
  17. package/docs/workflow-router-rules.md +21 -14
  18. package/docs/workflow-router-rules.schema.json +4 -0
  19. package/docs/workflow-stage-contracts.json +24 -5
  20. package/docs/workflow-stage-contracts.md +16 -15
  21. package/docs/workflow-stage-contracts.schema.json +12 -1
  22. package/package.json +1 -1
  23. package/templates/workspace/.agents/skills/using-aiws/SKILL.md +16 -10
  24. package/templates/workspace/.agents/skills/ws-commit/SKILL.md +6 -118
  25. package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +6 -218
  26. package/templates/workspace/.agents/skills/ws-dev/SKILL.md +82 -141
  27. package/templates/workspace/.agents/skills/ws-finish/SKILL.md +9 -204
  28. package/templates/workspace/.agents/skills/ws-handoff/SKILL.md +10 -44
  29. package/templates/workspace/.agents/skills/ws-migrate/SKILL.md +6 -42
  30. package/templates/workspace/.agents/skills/ws-plan-verify/SKILL.md +6 -58
  31. package/templates/workspace/.agents/skills/ws-pull/SKILL.md +8 -109
  32. package/templates/workspace/.agents/skills/ws-push/SKILL.md +8 -100
  33. package/templates/workspace/.agents/skills/ws-review/SKILL.md +6 -1
  34. package/templates/workspace/.agents/skills/ws-submodule-setup/SKILL.md +10 -57
  35. package/templates/workspace/.agents/skills/ws-verify-before-complete/SKILL.md +12 -53
  36. package/templates/workspace/{changes → .aiws/changes}/README.md +20 -23
  37. package/templates/workspace/{changes → .aiws/changes}/templates/proposal.md +12 -12
  38. package/templates/workspace/{changes → .aiws/changes}/templates/tasks.md +8 -8
  39. package/templates/workspace/{issues → .aiws/issues}/problem-issues.csv +1 -1
  40. package/templates/workspace/.aiws/journal/.gitkeep +1 -0
  41. package/templates/workspace/{requirements → .aiws/requirements}/requirements-issues.csv +1 -1
  42. package/templates/workspace/.aiws/tmp/.gitkeep +0 -0
  43. package/templates/workspace/{tools → .aiws/tools}/requirements_contract.py +2 -2
  44. package/templates/workspace/{tools → .aiws/tools}/requirements_contract_sync.py +2 -2
  45. package/templates/workspace/{tools → .aiws/tools}/requirements_flow_gen.py +1 -1
  46. package/templates/workspace/{tools → .aiws/tools}/server_test_runner.py +10 -10
  47. package/templates/workspace/{tools → .aiws/tools}/ws_change_check.py +23 -23
  48. package/templates/workspace/{tools → .aiws/tools}/ws_resolve_sub_target.sh +2 -2
  49. package/templates/workspace/{tools → .aiws/tools}/ws_tasks_plan.py +3 -3
  50. package/templates/workspace/.claude/commands/ws-review.md +5 -1
  51. package/templates/workspace/.claude/settings.json.example +26 -0
  52. package/templates/workspace/.claude/skills/ws-commit/SKILL.md +6 -118
  53. package/templates/workspace/.claude/skills/ws-deliver/SKILL.md +6 -218
  54. package/templates/workspace/.claude/skills/ws-dev/SKILL.md +52 -141
  55. package/templates/workspace/.claude/skills/ws-finish/SKILL.md +9 -204
  56. package/templates/workspace/.claude/skills/ws-handoff/SKILL.md +10 -44
  57. package/templates/workspace/.claude/skills/ws-migrate/SKILL.md +6 -42
  58. package/templates/workspace/.claude/skills/ws-plan-verify/SKILL.md +6 -49
  59. package/templates/workspace/.claude/skills/ws-pull/SKILL.md +8 -109
  60. package/templates/workspace/.claude/skills/ws-push/SKILL.md +8 -100
  61. package/templates/workspace/.claude/skills/ws-review/SKILL.md +6 -1
  62. package/templates/workspace/.claude/skills/ws-submodule-setup/SKILL.md +10 -57
  63. package/templates/workspace/.claude/skills/ws-verify-before-complete/SKILL.md +12 -53
  64. package/templates/workspace/.githooks/pre-commit +13 -0
  65. package/templates/workspace/.githooks/pre-push +7 -0
  66. package/templates/workspace/.opencode/command/ws-auto.md +33 -0
  67. package/templates/workspace/.opencode/command/ws-autonomy.md +25 -0
  68. package/templates/workspace/.opencode/command/ws-review.md +5 -1
  69. package/templates/workspace/.opencode/commands/ws-auto.md +33 -0
  70. package/templates/workspace/.opencode/commands/ws-autonomy.md +25 -0
  71. package/templates/workspace/.opencode/commands/ws-commit.md +4 -56
  72. package/templates/workspace/.opencode/commands/ws-deliver.md +10 -50
  73. package/templates/workspace/.opencode/commands/ws-finish.md +11 -3
  74. package/templates/workspace/.opencode/commands/ws-handoff.md +9 -17
  75. package/templates/workspace/.opencode/commands/ws-migrate.md +10 -17
  76. package/templates/workspace/.opencode/commands/ws-plan-verify.md +5 -15
  77. package/templates/workspace/.opencode/commands/ws-pull.md +6 -75
  78. package/templates/workspace/.opencode/commands/ws-push.md +7 -82
  79. package/templates/workspace/.opencode/commands/ws-review.md +5 -1
  80. package/templates/workspace/.opencode/commands/ws-submodule-setup.md +8 -47
  81. package/templates/workspace/.opencode/commands/ws-verify-before-complete.md +10 -19
  82. package/templates/workspace/.opencode/helpers/approval-whitelist-check.sh +148 -0
  83. package/templates/workspace/.opencode/helpers/approval-whitelist-run.sh +82 -0
  84. package/templates/workspace/.opencode/helpers/approval-whitelist-watchdog.sh +144 -0
  85. package/templates/workspace/.opencode/helpers/tmux-swarm-rescue.sh +56 -0
  86. package/templates/workspace/.opencode/helpers/tmux-swarm-scan.sh +46 -0
  87. package/templates/workspace/.opencode/lib/aiws-context.js +953 -0
  88. package/templates/workspace/.opencode/oh-my-opencode.json.example +64 -4
  89. package/templates/workspace/.opencode/plugins/aiws-inject-context.js +201 -0
  90. package/templates/workspace/.opencode/plugins/aiws-session-start.js +86 -0
  91. package/templates/workspace/.opencode/plugins/aiws-workflow-state.js +116 -0
  92. package/templates/workspace/.opencode/scripts/ws-plan-gen-submodule-targets.sh +27 -0
  93. package/templates/workspace/.opencode/scripts/ws-plan-setup-worktree.sh +31 -0
  94. package/templates/workspace/.opencode/skills/using-aiws/SKILL.md +130 -77
  95. package/templates/workspace/.opencode/skills/ws-analyze/SKILL.md +1 -1
  96. package/templates/workspace/.opencode/skills/ws-auto/SKILL.md +46 -0
  97. package/templates/workspace/.opencode/skills/ws-autonomy/SKILL.md +62 -0
  98. package/templates/workspace/.opencode/skills/ws-bugfix/SKILL.md +1 -1
  99. package/templates/workspace/.opencode/skills/ws-commit/SKILL.md +6 -118
  100. package/templates/workspace/.opencode/skills/ws-delegate/SKILL.md +115 -40
  101. package/templates/workspace/.opencode/skills/ws-deliver/SKILL.md +6 -218
  102. package/templates/workspace/.opencode/skills/ws-dev/SKILL.md +105 -146
  103. package/templates/workspace/.opencode/skills/ws-dev-lite/SKILL.md +23 -7
  104. package/templates/workspace/.opencode/skills/ws-finish/SKILL.md +9 -204
  105. package/templates/workspace/.opencode/skills/ws-frontend-design/SKILL.md +1 -1
  106. package/templates/workspace/.opencode/skills/ws-handoff/SKILL.md +10 -44
  107. package/templates/workspace/.opencode/skills/ws-intake/SKILL.md +43 -4
  108. package/templates/workspace/.opencode/skills/ws-migrate/SKILL.md +6 -42
  109. package/templates/workspace/.opencode/skills/ws-plan/SKILL.md +15 -55
  110. package/templates/workspace/.opencode/skills/ws-plan-verify/SKILL.md +6 -49
  111. package/templates/workspace/.opencode/skills/ws-preflight/SKILL.md +1 -1
  112. package/templates/workspace/.opencode/skills/ws-pull/SKILL.md +8 -109
  113. package/templates/workspace/.opencode/skills/ws-push/SKILL.md +8 -100
  114. package/templates/workspace/.opencode/skills/ws-quality-review/SKILL.md +7 -2
  115. package/templates/workspace/.opencode/skills/ws-req-change/SKILL.md +1 -1
  116. package/templates/workspace/.opencode/skills/ws-req-contract-sync/SKILL.md +1 -1
  117. package/templates/workspace/.opencode/skills/ws-req-contract-validate/SKILL.md +1 -1
  118. package/templates/workspace/.opencode/skills/ws-req-flow-sync/SKILL.md +1 -1
  119. package/templates/workspace/.opencode/skills/ws-req-review/SKILL.md +1 -1
  120. package/templates/workspace/.opencode/skills/ws-review/SKILL.md +35 -4
  121. package/templates/workspace/.opencode/skills/ws-rule/SKILL.md +1 -1
  122. package/templates/workspace/.opencode/skills/ws-spec-review/SKILL.md +1 -1
  123. package/templates/workspace/.opencode/skills/ws-submodule-setup/SKILL.md +10 -57
  124. package/templates/workspace/.opencode/skills/ws-verify-before-complete/SKILL.md +45 -55
  125. package/templates/workspace/AGENTS.md +32 -84
  126. package/templates/workspace/AI_PROJECT.md +5 -5
  127. package/templates/workspace/AI_WORKSPACE.md +1 -1
  128. package/templates/workspace/REQUIREMENTS.md +1 -1
  129. package/templates/workspace/gitignore +1 -1
  130. package/templates/workspace/manifest.json +215 -395
  131. /package/templates/workspace/{changes → .aiws/changes}/templates/design.md +0 -0
  132. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/README.md +0 -0
  133. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/architecture.md +0 -0
  134. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/implementation-plan.md +0 -0
  135. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/progress.md +0 -0
  136. /package/templates/workspace/{memory-bank → .aiws/memory-bank}/tech-stack.md +0 -0
  137. /package/templates/workspace/{requirements → .aiws/requirements}/CHANGELOG.md +0 -0
  138. /package/templates/workspace/{secrets → .aiws/secrets}/test-accounts.example.json +0 -0
@@ -1,168 +1,127 @@
1
1
  ---
2
2
  name: ws-dev
3
- description: 开发(按需求实现并验证;适用于任何需要修改代码/配置的任务)
3
+ description: 使用时机:需要修改代码、配置、测试时。触发词:实现、修复、开发、编码、写代码、改bug。注意:需求未冻结先用 ws-intake;极简修复可走 ws-dev-lite。
4
4
  ---
5
5
 
6
6
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
7
7
 
8
8
  目标:在 AIWS 约束下完成一个可回放、可验证的小步交付。
9
9
 
10
- 阶段定位:
11
- - implementation 阶段;负责在既定计划/需求绑定下完成最小实现与验证。
10
+ 阶段定位:implementation 阶段。
11
+
12
+ ## 必需输入
12
13
 
13
- 必需输入:
14
14
  - 真值文件:`AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`
15
15
  - 当前任务的归因目标(`Req_ID` 或 `Problem_ID`)
16
16
  - 若为 medium/complex:已通过 `$ws-plan` / `$ws-plan-verify` 的计划
17
17
  - 当前 `change/<change-id>` 上下文或等价变更归因
18
18
 
19
- 必需输出:
19
+ ## 必需输出
20
+
20
21
  - `变更文件(Changed):` 实际改动清单
21
22
  - `验证(Verify):` 实际运行的命令与结果说明
22
23
  - `证据(Evidence):` `plan/...`、`changes/<change-id>/...`、`.agentdocs/tmp/...` 等证据路径
23
24
  - `Next:` 若准备提交,建议 `$ws-review` 或 `$ws-commit`
24
25
 
25
- 阻断条件:
26
- - 无法把改动归因到 `REQUIREMENTS.md` 或问题单
27
- - 没有可复现验证入口
28
- - 需要创建 change 上下文但当前工作区状态不允许安全切换
29
-
30
- 完成判定:
31
- - 改动已落盘、验证已执行或明确未执行原因、证据路径可回放,并可进入 review/commit 阶段。
32
-
33
- 建议流程:
34
- 1) 先做 preflight:定位项目根目录,读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`,输出约束摘要。
35
- - 若是中大型任务:建议先用 `$ws-plan` 生成 `plan/` 工件,再进入实现(便于可回放与对齐验证入口)。
36
- - 若已有 `plan/` 工件:先执行 `$ws-plan-verify`;通过后再进入实现(防止计划过长/跑偏)。
37
- - 若 `$ws-plan` 刚创建了 `change/<change-id>` worktree:后续实现必须在该 worktree 中继续;不要回到原工作区重复 `aiws change start ...`
38
- 2) 建立变更归因(推荐):
39
- - ⚠️ 若你准备执行 `aiws change start ... --switch/--worktree` 或手工 `git switch ...` 改变 checkout 上下文,先确认工作区状态:`git status --porcelain`。否则切分支/创建 worktree 后,未提交改动可能看起来丢了(worktree 只从 `HEAD` checkout,未提交内容会留在原目录)。
40
- - 若当前目录已经是 `change/<change-id>` worktree(例如由 `$ws-plan` 创建):直接在这里继续,不要再创建第二个 worktree,也不要回原工作区写代码。
41
- - 若 `git status --porcelain` 非空仅因为上一轮 `$ws-plan` / `aiws change new|sync` 生成了 `plan/...`、`changes/<change-id>/proposal.md`、`tasks.md`、`design.md`、`submodules.targets`,这是预期行为,不等于流程出错。处理方式:
42
- - 已经在 `change/<change-id>` 分支:直接继续实现,并把这些文件作为计划/证据工件保留。
43
- - 还没进入 `change/<change-id>`:先运行 `aiws change start <change-id> --hooks --no-switch` 建立 change 上下文;若你仍要 `--switch/--worktree`,先提交这些规划工件,再切换上下文。
44
- - 强制(当你准备执行 `aiws change start ... --worktree/--switch` 创建新 change 时):先同步线上代码(含 submodules),避免基线过旧导致的 rebase/冲突与别人已更新但本地没拉的协作摩擦。
45
- - 若你已经在 `change/<change-id>` 上继续开发:不要在此处强制 pull(避免把远端变动拉进变更分支);改为按需 `git fetch`/rebase,并保持门禁与验证可复现。
46
- - 在 AI 工具中运行:`$ws-pull`(推荐;会在工作区不干净时阻断)
47
- - 或等价手工(必须工作区干净;失败则停止并人工处理):
48
- ```bash
49
- cur="$(git branch --show-current)"
50
- if [[ "${cur}" =~ ^(change|changes|ws|ws-change)/ ]]; then
51
- echo "info: already on change branch (${cur}); skip pull here"
52
- else
53
- git status --porcelain
54
- git pull --ff-only
55
- if [[ -f .gitmodules ]]; then
56
- git submodule sync --recursive
57
- git submodule update --init --recursive
58
- fi
59
- fi
60
- ```
61
- - 推荐更安全(默认):`aiws change start <change-id> --hooks --no-switch`(只创建分支/工件 + 启用 hooks;不切分支)
62
- - 准备进入实现时:若当前已在 `change/<change-id>` 直接继续;若需切换到该分支,先确认除规划工件外无额外未提交改动,再执行:`git switch change/<change-id>`
63
- - 若你明确要一键切分支(不推荐,且 dirty 会被拦截):`aiws change start <change-id> --hooks --switch`
64
- - superproject + submodule(推荐):`aiws change start <change-id> --hooks --worktree --submodules`(创建独立 worktree;当前目录分支保持不变;会在新 worktree 内初始化 submodules;若忘了 `--submodules` 也会强制初始化)
65
- - 若后续需要在 detached submodule 内提交:先挂到 `aiws/pin/<target-branch>`;不要直接切 `change/<change-id>` / `main` / `master`
66
- - 若仓库存在 submodule(`.gitmodules` 声明了 submodule 条目):进入编码前必须准备好 `changes/<change-id>/submodules.targets`,并把每个 submodule 挂到对应的 `aiws/pin/<target_branch>`(必要时切到 `<remote>/<target_branch>`;这可能会改变 superproject 的 gitlink 指针,属于预期的选渠道行为;缺失该文件会被门禁阻断)
67
- - 允许用当前 submodule 状态来做默认预填,但必须显式说明来源,并最终落盘到 `submodules.targets`:
68
- - detached HEAD:默认建议取 `.gitmodules` 中声明的 `submodule.<name>.branch`
69
- - 已附着在某个本地分支:默认建议取该 submodule 的当前分支名
70
- - 上述两条都只是建议值,不是运行时真值;真正的 finish/push 只认 `changes/<change-id>/submodules.targets`
71
- ```bash
72
- change_id="<change-id>"
73
- targets="changes/${change_id}/submodules.targets"
74
- has_submodules=0
75
- if [[ -f .gitmodules ]]; then
76
- if git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' >/dev/null 2>&1; then
77
- has_submodules=1
78
- fi
79
- fi
80
- if [[ "${has_submodules}" -eq 1 && ! -f "${targets}" ]]; then
81
- echo "error: missing ${targets} (required when .gitmodules declares submodules)"
82
- echo "hint: create it first; defaults may be inferred, but the final truth must be written explicitly"
83
- exit 2
84
- fi
85
-
86
- if [[ -f "${targets}" ]]; then
87
- echo "info: applying submodule targets: ${targets}"
88
- while read -r sub_path target_branch remote; do
89
- [[ -z "${sub_path:-}" ]] && continue
90
- [[ "${sub_path}" == \#* ]] && continue
91
- [[ -z "${target_branch:-}" ]] && { echo "error: missing target_branch for path=${sub_path}"; exit 2; }
92
- remote="${remote:-origin}"
93
-
94
- echo "== submodule: ${sub_path} target=${remote}/${target_branch} =="
95
- if [[ -n "$(git -C "${sub_path}" status --porcelain 2>/dev/null)" ]]; then
96
- echo "error: submodule dirty: ${sub_path} (commit/stash first)"
97
- exit 2
98
- fi
99
- git -C "${sub_path}" fetch "${remote}" --prune
100
- # 选渠道:默认切到远端目标分支,并用 pin 分支承载本地提交(避免 detached)
101
- git -C "${sub_path}" checkout -B "aiws/pin/${target_branch}" "${remote}/${target_branch}"
102
- git -C "${sub_path}" branch --set-upstream-to "${remote}/${target_branch}" "aiws/pin/${target_branch}" >/dev/null 2>&1 || true
103
- git -C "${sub_path}" status -sb
104
- done < "${targets}"
105
-
106
- # 检查 superproject 的 gitlink 是否发生变化(预期:若切了不同渠道,会看到差异)
107
- git diff --submodule
108
- fi
109
- ```
110
- - 若你还没写 `submodules.targets`,可按下面方式先生成建议值,再人工确认后落盘:
111
- ```bash
112
- change_id="<change-id>"
113
- targets="changes/${change_id}/submodules.targets"
114
- : > "${targets}"
115
-
116
- git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null | while read -r key sub_path; do
117
- name="${key#submodule.}"; name="${name%.path}"
118
- current_branch="$(git -C "${sub_path}" branch --show-current 2>/dev/null || true)"
119
- declared_branch="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
120
-
121
- if [[ -n "${current_branch}" ]]; then
122
- inferred_branch="${current_branch}"
123
- inferred_from="current branch"
124
- else
125
- inferred_branch="${declared_branch}"
126
- inferred_from=".gitmodules"
127
- fi
128
-
129
- if [[ -z "${inferred_branch}" ]]; then
130
- echo "error: cannot infer target branch for ${sub_path}; set it manually"
131
- exit 2
132
- fi
133
-
134
- printf "%s %s\n" "${sub_path}" "${inferred_branch}" >> "${targets}"
135
- echo "info: ${sub_path} -> ${inferred_branch} (inferred from ${inferred_from}; remote defaults to origin unless you edit ${targets})"
136
- done
137
-
138
- echo "review required: ${targets}"
139
- cat "${targets}"
140
- ```
141
- - 若你明确要在 superproject 直接切分支:`aiws change start <change-id> --hooks --switch`(仅在存在 `.gitmodules` 时有意义;会尝试让 submodules 工作区跟随 superproject 指针)
142
- - 或手工:`git switch -c change/<change-id>`,并创建 `changes/<change-id>/proposal.md` 与 `changes/<change-id>/tasks.md`(参考 `changes/README.md`)
143
- 3) 若需要外部 / 子 agent 协作:
144
- - 分析结论落盘到 `changes/<change-id>/analysis/`
145
- - patch 草案落盘到 `changes/<change-id>/patches/`
146
- - 不要把 `patches/` 当成“已应用代码”;主 agent 必须先审查再决定是否采用
147
- - 若采用了委托结果,后续在 `ws-review` 或 `changes/<change-id>/review/` 中收敛最终结论
148
- 4) 如涉及需求调整:先做需求评审(可用 `$ws-req-review`)→ 用户确认后再做需求落盘(可用 `$ws-req-change`)(避免需求漂移)。
149
- 5) 实施最小改动:任何改动都要能归因到 `REQUIREMENTS.md`(验收)或 `issues/problem-issues.csv`(问题)。
150
- 6) 运行 `AI_WORKSPACE.md` 里声明的验证命令;未运行不声称已运行。
151
- 7) 多步任务(≥2 步):使用 `update_plan` 工具跟踪 `pending → in_progress → completed`,每完成一步立即更新(不要事后批量更新)。
152
- 8) 提交前强制门禁(commit/push hooks 也会阻断):
153
- ```bash
154
- if [[ -x "./node_modules/.bin/aiws" ]]; then
155
- ./node_modules/.bin/aiws validate .
156
- elif command -v aiws >/dev/null 2>&1; then
26
+ ## 前置条件(硬阻断 — 必须最先检查)
27
+
28
+ 在开始任何代码改动之前,必须完成以下检查:
29
+
30
+ 1. **Design Gate**:若 `changes/<change-id>/proposal.md` 不存在:
31
+ - 立即停止,不要写代码
32
+ - 输出:`BLOCKED: 缺少 proposal。请先执行 $ws-plan 创建变更计划与任务分解。`
33
+ 2. **Task Gate**:若 `changes/<change-id>/tasks.md` 不存在:
34
+ - 立即停止,不要写代码
35
+ - 输出:`BLOCKED: 缺少 tasks。请先执行 $ws-plan 创建任务分解。`
36
+
37
+ > 例外:`ws-dev-lite` 是轻量入口,可豁免 Design Gate,但仅限单文件/typo/config/bugfix 场景。
38
+
39
+ ## TDD 约束(强制)
40
+
41
+ 对于所有需要编写新代码或修改业务逻辑的任务,必须遵守 RED-GREEN-REFACTOR 流程:
42
+
43
+ 1. **RED**:先编写测试用例,运行并确认测试失败(或确认现有测试覆盖缺口)
44
+ 2. **GREEN**:编写最小实现代码使测试通过
45
+ 3. **REFACTOR**:重构代码,保持测试通过
46
+
47
+ 禁止:
48
+ - 先写实现代码再补测试
49
+ - 跳过测试步骤直接提交
50
+
51
+ 自我检查顺序(每次修改后):`lint typecheck test`。若项目无对应脚本则跳过该项。
52
+
53
+ ## 完成判定
54
+
55
+ 改动已落盘、验证已执行或明确未执行原因、证据路径可回放,并可进入 review/commit 阶段。
56
+
57
+ ## 建议流程
58
+
59
+ ### 1. Preflight
60
+
61
+ 定位项目根目录,读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`,输出约束摘要。
62
+
63
+ - 中大型任务:建议先用 `$ws-plan` 生成 `plan/` 工件。
64
+ - 中大型任务默认执行 [3.1 自我修正循环](#31-自我修正循环evaluate-optimize)——这是必经步骤,不是可选项:实现后先自审修正(最多 2 轮),再进入 review
65
+ - 已有计划:先 `$ws-plan-verify`,通过后进入实现。
66
+ - `$ws-plan` 已创建 worktree:直接在该 worktree 中继续。
67
+
68
+ ### 1.5 Spec Refresh(进入实现前必做)
69
+
70
+ 在开始任何代码改动前,强制重读并输出摘要:
71
+ - `AI_PROJECT.md` 安全边界(哪些目录不能动、哪些约束必须遵守)
72
+ - `REQUIREMENTS.md` 中与本次 `Req_ID` 相关的条目(摘要 2-3 段即可)
73
+
74
+ 目的:避免落地时遗忘约束或需求边界。仅需 2-3 段摘要,不需要全文复读。
75
+
76
+ ### 2. 建立变更归因
77
+
78
+ - 若 `git status --porcelain` 仅有计划/工件文件,属于预期行为,继续即可。
79
+ - 若需创建新 change:`aiws change start <change-id> --hooks --no-switch`
80
+ - 若需切换分支:先确认无额外未提交改动,再 `git switch change/<change-id>`
81
+ - 若存在 submodule(`.gitmodules`):进入编码前必须准备好 `changes/<change-id>/submodules.targets`。`aiws change start` `--submodules` 标志会自动处理。参考 `changes/README.md` 和 `changes/<change-id>/submodules.targets` 格式。
82
+
83
+ ### 3. 实现策略:默认 dispatch aiws-worker(Subagent-First)
84
+
85
+ 详细执行循环见 `packages/spec/docs/opencode-subagent-first.md`。
86
+
87
+ - session **默认不直接写实现代码**;通过 `$ws-delegate` 派发 `aiws-worker`
88
+ - `task()` 调用中指定 `role: worker`,让 `aiws-inject-context` 插件自动注入 JSONL 上下文
89
+ - worker 返回后,派发 `aiws-reviewer` 做独立审查
90
+ - 根据 review 结果决定 fix 或收敛 evidence
91
+ - **Inline escape hatch**:如果用户明确说"你直接改"或"do it inline",主 session 可直接写代码,但必须落盘 evidence 记录理由
92
+
93
+ **验证先行推荐**:对于非 trivial 改动,建议先确认验证入口再开始实现:
94
+ 1. 先确认 `AI_WORKSPACE.md` 中对应的验证命令
95
+ 2. 若验证命令不明确:先补验证入口,再开始实现
96
+ 3. 可选模式(不强求 TDD):先写最小验证 实现 补完整验证
97
+
98
+ ### 3.1 自我修正循环(evaluate-optimize)——必经步骤
99
+
100
+ dispatch subagent 前,主 session 必须执行最多 **2 轮** 自审+修正循环:
101
+
102
+ 1. **实现** subagent 产出代码
103
+ 2. **自审** session 检查:lint/type-check 是否通过?是否符合现有代码模式?是否有明显 bug?
104
+ 3. **修正** 如果发现问题,要求 subagent 修正后重新提交
105
+ 4. **2 轮上限** → 如果 2 轮后仍有问题,升级到 `$ws-review` 做正式审查
106
+
107
+ **适用场景**:所有非 trivial 改动(单文件修复、配置调整、小步实现、中大型任务均适用)。不适合跨模块架构变更——此类变更直接走 $ws-review。
108
+
109
+ **注意**:这不是替代 `$ws-review` 的门禁;自审通过后仍需走正式 review gate。
110
+
111
+ ### 4. 其他规则
112
+
113
+ - 需求调整:先 `$ws-req-review` → 确认后 `$ws-req-change`
114
+ - 最小改动:每处改动必须归因到 `REQUIREMENTS.md` 或 `issues/problem-issues.csv`
115
+ - 验证:运行 `AI_WORKSPACE.md` 声明的命令;未运行不声称已运行
116
+ - 多步任务:使用 `update_plan` 工具跟踪状态
117
+ - 提交前门禁:
118
+ ```bash
157
119
  aiws validate .
158
- else
159
- npx @aipper/aiws validate .
160
- fi
161
- ```
162
- 9) 若使用了协同工件,交付前建议执行 `aiws change evidence <change-id>`,把 review / validate / collaboration summary 收敛到 `changes/<change-id>/evidence/`。
163
- 10) 交付收尾(推荐,减少手动 merge 出错):运行 `$ws-finish`(底层调用 `aiws change finish`,默认 fast-forward 安全合并回目标分支)。
164
-
165
- 输出要求:
120
+ ```
121
+ - 交付收尾:`$ws-finish`
122
+
123
+ ## 输出要求
124
+
166
125
  - `变更文件(Changed):` 文件清单
167
126
  - `验证(Verify):` 实际运行的命令 + 期望结果
168
- - `证据(Evidence):` 证据路径(例如 `changes/<change-id>/review/...`、`plan/...`、`.agentdocs/tmp/aiws-validate/...` 或 `changes/<change-id>/...`)
127
+ - `证据(Evidence):` 证据路径
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ws-dev-lite
3
- description: 轻量开发(simple/local 单点修复;最小改动 + 最小验证)
3
+ description: 使用时机:单文件/小范围快速修复时。触发词:轻量修复、小改动、单点修复、简单配置。注意:复杂度升高请退回 ws-dev。
4
4
  ---
5
5
 
6
6
  用中文输出(命令/路径/代码标识符保持原样不翻译)。
@@ -14,8 +14,10 @@ description: 轻量开发(simple/local 单点修复;最小改动 + 最小验
14
14
  适用前提:
15
15
  - 目标明确,且能归因到 `Req_ID` 或 `Problem_ID`
16
16
  - 验证入口明确,且能做最小可复现验证
17
- - 一般只影响单文件或紧密相关的小范围文件
17
+ - 一般只影响单文件或紧密相关的小范围文件(≤2 文件,≤100 行)
18
18
  - 不需要先改 `REQUIREMENTS.md`,也不需要先单独做 review
19
+ - 仅限以下场景:typo 修复、配置调整、已知回归修复、单点 bugfix
20
+ - 禁止用于:新 feature 开发、跨模块重构、架构变更
19
21
 
20
22
  立即升级回主流程的情形:
21
23
  - 发现任务其实是 medium/complex、跨模块、跨目录或需要方案设计
@@ -25,6 +27,7 @@ description: 轻量开发(simple/local 单点修复;最小改动 + 最小验
25
27
 
26
28
  默认约束:
27
29
  - 先做 `$ws-preflight`
30
+ - **Escape Hatch**:若用户明确说"跳过流程"/"直接改",允许 early-start 实现,但必须输出 `[escape-hatch: direct-implementation]` 标记,并仍然遵守最小约束(归因、验证、evidence)
28
31
  - 默认不创建 `plan/...`
29
32
  - 默认不跑 `$ws-plan-verify`
30
33
  - 默认不要求先做双 review
@@ -36,17 +39,24 @@ description: 轻量开发(simple/local 单点修复;最小改动 + 最小验
36
39
  - 用一句话写清 `Goal`
37
40
  - 用一句话写清 `Why lite`
38
41
  - 若说不清,立刻回退到 `$ws-dev` 或 `$ws-plan`
39
- 3) 在当前 change 上下文内实施最小改动:
40
- - 不为“形式完整”额外扩 scope
42
+ 3) No-Op 路径(无操作提前退出):
43
+ - 若验证发现目标改动已存在、问题已修复或需求已满足,允许 early exit。
44
+ - 不产生代码改动,但必须输出:
45
+ - `No-Op decision:` 为什么不需要改动
46
+ - `Evidence:` 引用确认状态的命令输出(如 grep、test、diff 结果)
47
+ - `Next:` 直接回到上一阶段(`/ws-review` / `/ws-commit` / `/using-aiws`)
48
+ - 禁止:在没有验证的情况下声称"看起来已经实现了"而跳过。
49
+ 4) 在当前 change 上下文内实施最小改动:
50
+ - 不为"形式完整"额外扩 scope
41
51
  - 不默认补与本问题无关的重构或测试矩阵
42
- 4) 运行最小可复现验证:
52
+ 5) 运行最小可复现验证:
43
53
  - 优先使用 `AI_WORKSPACE.md` 已声明的命令
44
54
  - 若只需局部回归,允许运行更窄的验证,但要说明为什么足够
45
- 5) 留下至少一个可追溯证据:
55
+ 6) 留下至少一个可追溯证据:
46
56
  - 实际改动文件
47
57
  - 或 `.agentdocs/tmp/...`
48
58
  - 或 `changes/<change-id>/...`
49
- 6) 输出:
59
+ 7) 输出:
50
60
  - `变更文件(Changed):`
51
61
  - `验证(Verify):`
52
62
  - `证据(Evidence):`
@@ -56,3 +66,9 @@ description: 轻量开发(simple/local 单点修复;最小改动 + 最小验
56
66
  - 明确说明为什么这是 lite,而不是完整 `ws-dev`
57
67
  - 未运行不声称已运行
58
68
  - 一旦发现复杂度升高,立刻停止 lite 叙事,切回 `$ws-dev` 或 `$ws-plan`
69
+
70
+ Workflow State Suffix(会话门禁约定):
71
+ - `ws-dev-lite` 使用 `session` 后缀(而非 `gate` 后缀)记录本次会话结果。
72
+ - `gate` 后缀保留给 `ws-dev` / `ws-plan-verify` 的完整计划门禁;不要在本 skill 中使用 `gate` 后缀。
73
+ - 若需要与 `ws-dev` 共享状态:先通过 `$ws-dev` 建立 `gate` 后缀记录,再回到 lite 修复。
74
+ - 详细参见 `ws-dev` 的 Workflow State Suffix 约定。
@@ -1,217 +1,22 @@
1
1
  ---
2
2
  name: ws-finish
3
- description: 收尾(门禁 + 安全合并 + submodule→主仓库顺序 push
3
+ description: `aiws finish` 的收尾入口(finish_resume_required
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 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`)
10
+ 关键契约:
11
+ - `aiws change status <change-id>` 输出 `governance_rule: finish_resume_required`,继续执行 `aiws change finish <change-id> --push`
12
+ - 普通 finish 的 `validate/evidence/state` 仍应在 `change/<change-id>` worktree 完成,不要在目标 worktree 里跑 `aiws validate . --stamp`
20
13
 
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
14
  ```bash
206
- change_id="<change-id>"
207
15
  if [[ -x "./node_modules/.bin/aiws" ]]; then
208
- ./node_modules/.bin/aiws change finish "${change_id}" --push
16
+ ./node_modules/.bin/aiws finish
209
17
  elif command -v aiws >/dev/null 2>&1; then
210
- aiws change finish "${change_id}" --push
18
+ aiws finish
211
19
  else
212
- npx @aipper/aiws change finish "${change_id}" --push
20
+ npx @aipper/aiws finish
213
21
  fi
214
22
  ```
215
- 说明:
216
- - 该命令内部已经包含主仓库 push 成功后安全清理独立 change worktree 的逻辑。
217
- - 当 `--push` 完整成功时,还会自动把 `changes/<change-id>/` 归档到 `changes/archive/...`,生成 `handoff.md`,并补一个 `归档: <change-id>` commit。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ws-frontend-design
3
- description: 前端设计实现(用于视觉型 landing page / 网站 / 应用界面 / demo / prototype;强调构图、层级、图像、动效与克制,不做通用卡片墙)
3
+ description: 使用时机:需要前端设计、UI/UX 实现时。触发词:设计、前端、UI、页面、视觉、界面。注意:非视觉实现请用 ws-dev。
4
4
  ---
5
5
 
6
6
  用中文输出(命令/路径/代码标识符保持原样不翻译)。