@aipper/aiws-spec 0.0.23 → 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-bugfix/SKILL.md +30 -7
- package/templates/workspace/.agents/skills/ws-commit/SKILL.md +26 -1
- package/templates/workspace/.agents/skills/ws-delegate/SKILL.md +75 -0
- package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +46 -9
- package/templates/workspace/.agents/skills/ws-dev/SKILL.md +81 -11
- package/templates/workspace/.agents/skills/ws-finish/SKILL.md +101 -60
- 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 +61 -2
- 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-bugfix.md +11 -6
- package/templates/workspace/.claude/commands/ws-commit.md +2 -1
- package/templates/workspace/.claude/commands/ws-deliver.md +6 -2
- package/templates/workspace/.claude/commands/ws-dev.md +5 -2
- package/templates/workspace/.claude/commands/ws-finish.md +19 -19
- package/templates/workspace/.claude/commands/ws-plan.md +9 -5
- 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/.codex/prompts/ws-dev.md +5 -1
- package/templates/workspace/.githooks/commit-msg +109 -0
- package/templates/workspace/.iflow/commands/ws-commit.toml +2 -1
- package/templates/workspace/.iflow/commands/ws-deliver.toml +6 -2
- package/templates/workspace/.iflow/commands/ws-finish.toml +19 -19
- package/templates/workspace/.opencode/command/using-aiws.md +29 -0
- package/templates/workspace/.opencode/command/ws-bugfix.md +11 -6
- package/templates/workspace/.opencode/command/ws-commit.md +2 -1
- package/templates/workspace/.opencode/command/ws-delegate.md +33 -0
- package/templates/workspace/.opencode/command/ws-deliver.md +6 -2
- package/templates/workspace/.opencode/command/ws-dev.md +5 -2
- package/templates/workspace/.opencode/command/ws-finish.md +19 -19
- package/templates/workspace/.opencode/command/ws-plan.md +12 -5
- 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 -29
- package/templates/workspace/AI_WORKSPACE.md +4 -4
- package/templates/workspace/changes/README.md +26 -2
- package/templates/workspace/changes/templates/proposal.md +15 -0
- package/templates/workspace/changes/templates/tasks.md +9 -2
- package/templates/workspace/manifest.json +279 -2
- package/templates/workspace/tools/ws_change_check.py +27 -5
- package/templates/workspace/tools/ws_resolve_sub_target.sh +1 -0
|
@@ -14,6 +14,26 @@ description: 计划质检(执行前检查计划是否过长/跑偏,并给出
|
|
|
14
14
|
- 已执行过 `$ws-plan`,且准备开始编码
|
|
15
15
|
- 或用户反馈“计划太长/容易跑偏”,需要先压缩并对齐
|
|
16
16
|
|
|
17
|
+
阶段定位:
|
|
18
|
+
- planning gate;负责在编码前检查计划是否满足 change 严格契约。
|
|
19
|
+
|
|
20
|
+
必需输入:
|
|
21
|
+
- 当前 `plan/...`
|
|
22
|
+
- `changes/<change-id>/proposal.md`
|
|
23
|
+
- 当前 change 上下文
|
|
24
|
+
|
|
25
|
+
必需输出:
|
|
26
|
+
- `Quality gate:` pass/fail
|
|
27
|
+
- `Fix list:` 最小修正项
|
|
28
|
+
- `Next:` 通过则 `$ws-dev`,未通过则继续修正并复跑
|
|
29
|
+
|
|
30
|
+
阻断条件:
|
|
31
|
+
- 无法定位当前 change 或计划文件
|
|
32
|
+
- `aiws change validate <change-id> --strict` 未通过
|
|
33
|
+
|
|
34
|
+
完成判定:
|
|
35
|
+
- 计划满足严格门禁,且后续实现可以在不补需求/补绑定的情况下直接开始。
|
|
36
|
+
|
|
17
37
|
执行步骤(建议):
|
|
18
38
|
1) 先运行 `$ws-preflight`。
|
|
19
39
|
2) 识别 change 上下文:
|
|
@@ -7,6 +7,29 @@ description: 预检(提交前快速检查与建议)
|
|
|
7
7
|
|
|
8
8
|
目标:在开始任何“写代码/改配置/落盘文件”之前,对齐工作区真值文件,避免规则漂移。
|
|
9
9
|
|
|
10
|
+
阶段定位:
|
|
11
|
+
- workflow 入口阶段;负责判断当前仓库是否具备继续执行其它 `ws-*` 阶段的前置条件。
|
|
12
|
+
|
|
13
|
+
必需输入:
|
|
14
|
+
- 当前项目根目录候选路径
|
|
15
|
+
- `AI_PROJECT.md`
|
|
16
|
+
- `REQUIREMENTS.md`
|
|
17
|
+
- `AI_WORKSPACE.md`
|
|
18
|
+
|
|
19
|
+
必需输出:
|
|
20
|
+
- `Root:` 当前项目根
|
|
21
|
+
- `Found:` 实际读取到的真值文件
|
|
22
|
+
- `Missing:` 缺失项
|
|
23
|
+
- `Key rules:` 3-8 条约束摘要
|
|
24
|
+
- `Next:` 若真值齐全,建议进入 `$ws-plan` 或 `$ws-dev`;若缺失,建议先 `aiws init .`
|
|
25
|
+
|
|
26
|
+
阻断条件:
|
|
27
|
+
- 无法确定项目根目录
|
|
28
|
+
- 缺失任一真值文件
|
|
29
|
+
|
|
30
|
+
完成判定:
|
|
31
|
+
- 使用者已经知道当前仓库能否继续进入后续阶段,以及必须遵守的约束与下一步入口。
|
|
32
|
+
|
|
10
33
|
执行步骤(强制):
|
|
11
34
|
1) 定位项目根目录:
|
|
12
35
|
- 优先:`git rev-parse --show-toplevel`
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
阶段定位:
|
|
13
|
+
- review 子 gate;负责实现质量、行为回归与验证覆盖审查。
|
|
14
|
+
|
|
15
|
+
必需输入:
|
|
16
|
+
- 当前 `git diff`
|
|
17
|
+
- 已执行的验证结果
|
|
18
|
+
- 相关代码 / 配置 / 测试文件
|
|
19
|
+
- 若存在:`changes/<change-id>/analysis/`、`patches/`、已有 review 文件
|
|
20
|
+
|
|
21
|
+
必需输出:
|
|
22
|
+
- `证据(Evidence):` `changes/<change-id>/review/quality-review.md` 或回退 `.agentdocs/tmp/review/quality-review.md`
|
|
23
|
+
- `主要发现(Findings):` 高到低排序的问题 / 风险 / 缺失测试
|
|
24
|
+
- `下一步(Next):` 最小修复项与回归命令
|
|
25
|
+
|
|
26
|
+
阻断条件:
|
|
27
|
+
- 没有可审改动
|
|
28
|
+
- 没有任何验证上下文
|
|
29
|
+
- 无法写 review 证据
|
|
30
|
+
|
|
31
|
+
完成判定:
|
|
32
|
+
- 已落盘 quality review 证据,且 findings / 测试缺口 / next 明确。
|
|
33
|
+
|
|
34
|
+
步骤(建议):
|
|
35
|
+
1) 先读取 `git diff`、验证结果与相关代码。
|
|
36
|
+
2) 检查:
|
|
37
|
+
- 行为是否可能回归
|
|
38
|
+
- 边界条件 / 失败路径是否覆盖
|
|
39
|
+
- 测试是否足以支撑改动
|
|
40
|
+
- 是否存在明显复杂度、耦合、可维护性或性能问题
|
|
41
|
+
3) 将结论落盘到:
|
|
42
|
+
- 默认:`changes/<change-id>/review/quality-review.md`
|
|
43
|
+
- 回退:`.agentdocs/tmp/review/quality-review.md`
|
|
44
|
+
4) 输出:
|
|
45
|
+
- `证据(Evidence):`
|
|
46
|
+
- `主要发现(Findings):`
|
|
47
|
+
- `测试缺口(Gaps):`
|
|
48
|
+
- `下一步(Next):`
|
|
49
|
+
|
|
50
|
+
重点:
|
|
51
|
+
- 这是质量 / 回归 review,不替代 requirements / gate review。
|
|
52
|
+
- 若发现流程、归因、evidence 缺口,转交给 `$ws-spec-review`。
|
|
53
|
+
|
|
54
|
+
安全:
|
|
55
|
+
- 不打印 secrets。
|
|
56
|
+
- 不执行破坏性命令。
|
|
@@ -7,15 +7,39 @@ description: 评审(提交前审计与证据落盘)
|
|
|
7
7
|
|
|
8
8
|
目标:在提交/交付前审计当前改动,对照真值文件检查是否越界,并把审计证据优先落盘到 `changes/<change-id>/review/`(若无法确定 `change-id` 再回退 `.agentdocs/tmp/review/`)。
|
|
9
9
|
|
|
10
|
+
阶段定位:
|
|
11
|
+
- review 阶段;负责对当前改动做规范、风险和验证完整性的审计。
|
|
12
|
+
|
|
13
|
+
必需输入:
|
|
14
|
+
- 当前 `git status` / `git diff`
|
|
15
|
+
- 已执行的验证结果
|
|
16
|
+
- 真值文件:`AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`
|
|
17
|
+
- 当前 `change/<change-id>` 上下文(若能识别)
|
|
18
|
+
- 若存在:`changes/<change-id>/analysis/`、`patches/`、已有 `review/` 文件
|
|
19
|
+
|
|
20
|
+
必需输出:
|
|
21
|
+
- 审计文件:`changes/<change-id>/review/codex-review.md` 或回退 `.agentdocs/tmp/review/codex-review.md`
|
|
22
|
+
- `主要风险(Top risks):` 3-8 条
|
|
23
|
+
- `下一步(Next):` 最小修复清单 + 最小验证命令
|
|
24
|
+
|
|
25
|
+
阻断条件:
|
|
26
|
+
- 没有可审计的改动或验证上下文
|
|
27
|
+
- 审计证据无法写盘
|
|
28
|
+
|
|
29
|
+
完成判定:
|
|
30
|
+
- 审计证据已落盘,主要风险和下一步已明确,可作为 commit/deliver 前置输入。
|
|
31
|
+
|
|
10
32
|
步骤(建议):
|
|
11
33
|
1) 先做 preflight:定位项目根目录,读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`,输出约束摘要。
|
|
12
34
|
2) 基于 `git status` / `git diff`(以及你实际运行过的测试结果),对照 `AI_PROJECT.md` 与 `REQUIREMENTS.md` 检查:
|
|
13
35
|
- 是否存在越界目录改动/危险操作
|
|
14
36
|
- 是否有可复现验证命令与证据
|
|
15
37
|
- 是否维护了 `changes/<change-id>/` 或相关 `issues/*.csv`
|
|
38
|
+
- 若存在 `analysis/` / `patches/`:审查这些委托工件是否已被主 agent 理解、是否需要采用/拒绝,并把结论写入 review 文件
|
|
16
39
|
3) 将审计落盘到(目录不存在则创建):
|
|
17
40
|
- 默认:`changes/<change-id>/review/codex-review.md`
|
|
18
41
|
- 回退:`.agentdocs/tmp/review/codex-review.md`(仅在无法确定 `change-id` 时使用)
|
|
42
|
+
- 若已有其它 reviewer 文件:不要覆盖它们;当前 reviewer 应写自己的文件或更新自己的汇总文件
|
|
19
43
|
4) 回复中输出:
|
|
20
44
|
- `证据(Evidence):` 证据文件路径
|
|
21
45
|
- `主要风险(Top risks):` 3–8 条(高→低)
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
阶段定位:
|
|
13
|
+
- review 子 gate;负责 requirements / plan / evidence / workflow gate 完整性审查。
|
|
14
|
+
|
|
15
|
+
必需输入:
|
|
16
|
+
- `AI_PROJECT.md`
|
|
17
|
+
- `REQUIREMENTS.md`
|
|
18
|
+
- `AI_WORKSPACE.md`
|
|
19
|
+
- 当前 `git diff`
|
|
20
|
+
- 若存在:`plan/...`、`changes/<change-id>/proposal.md`、`tasks.md`、`review/`、`evidence/`
|
|
21
|
+
|
|
22
|
+
必需输出:
|
|
23
|
+
- `证据(Evidence):` `changes/<change-id>/review/spec-review.md` 或回退 `.agentdocs/tmp/review/spec-review.md`
|
|
24
|
+
- `阻断项(Blockers):` requirements 归因 / gate / evidence 缺口
|
|
25
|
+
- `下一步(Next):` 修复项与最小验证命令
|
|
26
|
+
|
|
27
|
+
阻断条件:
|
|
28
|
+
- 无法定位项目根或真值文件
|
|
29
|
+
- 无法判断当前 change / 归因上下文
|
|
30
|
+
- 无法写 review 证据
|
|
31
|
+
|
|
32
|
+
完成判定:
|
|
33
|
+
- 已落盘 spec review 证据,且明确指出 blocker / warning / next。
|
|
34
|
+
|
|
35
|
+
步骤(建议):
|
|
36
|
+
1) 先运行 `$ws-preflight`。
|
|
37
|
+
2) 对照 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md` 检查:
|
|
38
|
+
- 当前改动能否归因到 `Req_ID` / `Problem_ID`
|
|
39
|
+
- `plan/...`、`proposal.md`、`tasks.md`、`evidence/` 是否与改动保持一致
|
|
40
|
+
- 是否存在越界目录改动、危险操作、未声明的非目标扩张
|
|
41
|
+
- 是否已经准备好可复现验证入口
|
|
42
|
+
3) 把结论落盘到:
|
|
43
|
+
- 默认:`changes/<change-id>/review/spec-review.md`
|
|
44
|
+
- 回退:`.agentdocs/tmp/review/spec-review.md`
|
|
45
|
+
4) 输出:
|
|
46
|
+
- `证据(Evidence):`
|
|
47
|
+
- `阻断项(Blockers):`
|
|
48
|
+
- `警告(Warnings):`
|
|
49
|
+
- `下一步(Next):`
|
|
50
|
+
|
|
51
|
+
重点:
|
|
52
|
+
- 这是 spec / gate review,不是代码质量 review。
|
|
53
|
+
- 若发现实现质量或回归问题,转交给 `$ws-quality-review`。
|
|
54
|
+
|
|
55
|
+
安全:
|
|
56
|
+
- 不打印 secrets。
|
|
57
|
+
- 不执行破坏性命令。
|
|
@@ -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
|
+
- 不执行破坏性命令。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- AIWS_MANAGED_BEGIN:claude:using-aiws -->
|
|
2
|
+
# using aiws
|
|
3
|
+
|
|
4
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
5
|
+
|
|
6
|
+
目标:
|
|
7
|
+
- 把当前任务先路由到正确的 AIWS workflow,而不是直接跳进实现。
|
|
8
|
+
|
|
9
|
+
执行建议:
|
|
10
|
+
1) 先读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`。
|
|
11
|
+
2) 若缺失任一真值文件:先 `/ws-preflight`,必要时运行 `aiws init .`,不要继续实现。
|
|
12
|
+
3) 若任务意图、归因或验证入口不明确:先提 1-3 个关键澄清问题并停止。
|
|
13
|
+
4) 路由规则:
|
|
14
|
+
- 需求/验收/合同变更:`/ws-req-review`
|
|
15
|
+
- 中大型实现或需要 change/worktree:`/ws-plan`
|
|
16
|
+
- 小步明确实现:`/ws-dev`
|
|
17
|
+
- 评审/审计:`/ws-review`
|
|
18
|
+
- finish / merge / push / cleanup:`/ws-finish`
|
|
19
|
+
- handoff / archive summary:`/ws-handoff`
|
|
20
|
+
5) 输出 `Task intent:` / `Binding:` / `Route:` / `Why:` / `Next:`。
|
|
21
|
+
6) 除非用户只要路由判断,否则给出 route 后继续遵循对应入口的契约。
|
|
22
|
+
<!-- AIWS_MANAGED_END:claude:using-aiws -->
|
|
23
|
+
|
|
24
|
+
可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
|
|
@@ -8,15 +8,20 @@
|
|
|
8
8
|
|
|
9
9
|
建议流程:
|
|
10
10
|
1) 先运行 `/ws-preflight`。
|
|
11
|
-
2)
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
2) 若当前不在 `change/<change-id>` 分支 / worktree,先建立 change 上下文:
|
|
12
|
+
- 工作区先保持干净
|
|
13
|
+
- 仓库已有提交:优先 `aiws change start <change-id> --hooks --worktree`
|
|
14
|
+
- superproject + submodule:优先 `aiws change start <change-id> --hooks --worktree --submodules`
|
|
15
|
+
- 仓库尚无提交 / 不满足 worktree 前置条件:回退 `aiws change start <change-id> --hooks --no-switch`
|
|
16
|
+
3) 若上一步创建了 worktree:后续 bug 证据、CSV 更新、`/ws-dev` 修复都必须在该 worktree 中继续。
|
|
17
|
+
4) 通过已配置 zentao MCP 拉取 bug 字段与附件列表。
|
|
18
|
+
5) 落盘证据到当前 active change 上下文的 `changes/<change-id>/bug/`:
|
|
14
19
|
- `zentao-bug-<bug-id>.json`
|
|
15
20
|
- `zentao-bug-<bug-id>.md`
|
|
16
21
|
- `images/<bug-id>/...`
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
6) upsert 当前 active change 上下文中的 `issues/fix_bus_issues.csv`(主键 `Bug_ID`)。
|
|
23
|
+
7) 进入 `/ws-dev` 修复并回填状态字段 `Fix_Status/Verify_Command/Updated_At`。
|
|
24
|
+
8) 质量门:`aiws change validate <change-id> --strict` + `aiws validate . --stamp`。
|
|
20
25
|
|
|
21
26
|
强制约束:
|
|
22
27
|
- 不自动 commit / push。
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
- 不使用 `--no-verify` 绕过 hooks
|
|
12
12
|
- 不自动 push
|
|
13
13
|
- 不打印 secrets
|
|
14
|
+
- commit message 优先使用中文;若启用了 `.githooks/commit-msg`,默认仅提示,只有 strict 模式才会拒绝全英文首行(`Merge/Revert/fixup!/squash!` 例外)
|
|
14
15
|
|
|
15
16
|
步骤(建议):
|
|
16
17
|
1) 先运行 `/ws-preflight`。
|
|
@@ -51,7 +52,7 @@ git status --porcelain
|
|
|
51
52
|
git diff --staged --submodule=short
|
|
52
53
|
```
|
|
53
54
|
7) 若没有 staged changes:停止并提示用户先明确要提交哪些文件(例如 `git add -p` 或 `git add <path>`)。
|
|
54
|
-
8)
|
|
55
|
+
8) 优先生成并确认中文 commit message(格式建议:`<类型>: <简述>`;若用户明确要求英文也可保留,但 strict 模式下会被 hook 拒绝)。
|
|
55
56
|
9) 执行提交(不带 `--no-verify`):
|
|
56
57
|
```bash
|
|
57
58
|
git commit -m "<message>"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
5
5
|
|
|
6
|
-
目标:适配 superproject + submodule
|
|
6
|
+
目标:适配 superproject + submodule(数量不固定)的交付收尾,降低提交顺序和合并回 base 分支的出错概率:
|
|
7
7
|
1) 先逐个提交 submodule(每个 repo 单独确认 commit message;默认 `git add -p`)
|
|
8
8
|
2) 再提交 superproject(包含 submodule gitlink 指针更新 + 自身改动/变更工件)
|
|
9
9
|
3) 最后 fast-forward 合并回目标分支(复用 `aiws change finish`;建议用 `/ws-finish`)
|
|
@@ -16,11 +16,15 @@
|
|
|
16
16
|
建议流程(按顺序):
|
|
17
17
|
1) 先运行 `/ws-preflight`。
|
|
18
18
|
2) 如果存在 `.gitmodules` 但缺少 `submodule.<name>.branch`,先运行 `/ws-submodule-setup` 并提交 `.gitmodules`(否则 `aiws validate .` 会失败,且 submodule 工作流会产生人为差异)。
|
|
19
|
+
2.1) 若存在 submodule:必须准备 `changes/<change-id>/submodules.targets`,并覆盖所有 submodule path;这是本次交付的目标分支真值。
|
|
20
|
+
- 生成该文件时可先做默认预填:detached HEAD 默认建议取 `.gitmodules` 声明分支;已附着在本地分支时默认建议取当前分支。
|
|
21
|
+
- 上述都只是建议值;真正的 deliver/finish 只认 `submodules.targets`。
|
|
19
22
|
2) 发现 submodules:
|
|
20
23
|
- `git submodule status --recursive`
|
|
21
24
|
3) 逐个提交 submodules(按上一步顺序):
|
|
22
25
|
- `git -C "<sub_path>" status --porcelain`
|
|
23
|
-
-
|
|
26
|
+
- 先说明该 submodule 目标分支的来源:attached branch 默认建议取当前分支;detached HEAD 默认建议取 `.gitmodules`;若与 `submodules.targets` 已落盘值冲突,则以 `submodules.targets` 为准
|
|
27
|
+
- 若当前为 detached HEAD:不要直接切 `change/<change-id>` / `main` / `master`;先按 `submodules.targets`(若分支为 `.` 则展开为 `.ws-change.json` 的 `base_branch`)挂到 `aiws/pin/<target-branch>`
|
|
24
28
|
- `git -C "<sub_path>" add -p`
|
|
25
29
|
- `git -C "<sub_path>" diff --staged --stat`
|
|
26
30
|
- 生成并让用户确认该 submodule 的 commit message(每个 repo 单独确认)
|
|
@@ -7,10 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
建议流程:
|
|
9
9
|
1) 先运行 `/ws-preflight`(读真值文件并输出约束摘要)。
|
|
10
|
+
- 若 `/ws-plan` 刚创建了 `change/<change-id>` worktree:后续实现必须在该 worktree 中继续;不要回原工作区重复 `aiws change start ...`
|
|
10
11
|
2) 建立变更归因(推荐):
|
|
11
|
-
- ⚠️
|
|
12
|
+
- ⚠️ 若准备切分支/创建 worktree,先看 `git status --porcelain`;否则切换上下文后,未提交改动可能“看起来丢了”。
|
|
13
|
+
- 若当前目录已经是 `change/<change-id>` worktree(例如由 `/ws-plan` 创建):直接在这里继续,不要再创建第二个 worktree,也不要回原工作区写代码。
|
|
14
|
+
- 若非空仅因为 `/ws-plan` 生成了 `plan/...` 或 `changes/<change-id>/...`,这是预期行为;此时优先 `aiws change start <change-id> --hooks --no-switch`,若仍要 `--switch/--worktree`,先提交这些规划工件。
|
|
12
15
|
- 推荐更安全(默认):`aiws change start <change-id> --hooks --no-switch`(只创建分支/工件 + 启用 hooks;不切分支)
|
|
13
|
-
-
|
|
16
|
+
- 准备进入实现时:若当前已在 `change/<change-id>` 直接继续;若需切换到该分支,先确认除规划工件外无额外未提交改动,再执行:`git switch change/<change-id>`
|
|
14
17
|
- 若你明确要“一键切分支”(不推荐,且 dirty 会被拦截):`aiws change start <change-id> --hooks --switch`
|
|
15
18
|
- superproject + submodule(推荐):`aiws change start <change-id> --hooks --worktree --submodules`
|
|
16
19
|
- 若后续需要在 detached submodule 内提交:先挂到 `aiws/pin/<target-branch>`;不要直接切 `change/<change-id>` / `main` / `master`
|
|
@@ -34,34 +34,34 @@ fi
|
|
|
34
34
|
2) (推荐)门禁校验并落盘证据:`aiws validate . --stamp`(未安装全局 aiws 时可用 `npx @aipper/aiws validate . --stamp`)。
|
|
35
35
|
2.1) (强烈建议)收敛持久证据并回填 `Evidence_Path`:`aiws change evidence <change-id>`(未安装全局 aiws 时可用 `npx @aipper/aiws change evidence <change-id>`)。
|
|
36
36
|
2.2) (可选)生成状态快照(建议):`aiws change state <change-id> --write`。
|
|
37
|
-
3)
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
3) 若不存在 `.gitmodules`,或 submodules 已按顺序处理完成,优先直接执行最小收尾闭环:
|
|
38
|
+
- `aiws change finish <change-id> --push`
|
|
39
|
+
- 若当前就在 `change/<change-id>` 分支上,也可省略 `<change-id>`
|
|
40
|
+
- 该命令会在 fast-forward 合并成功后 push 目标分支;默认优先使用 upstream 配置(`branch.<name>.remote` + `branch.<name>.merge`),只有在你明确知道要推向别的 remote 时才追加 `--remote <name>`
|
|
41
|
+
- 若 `change/<change-id>` 位于独立 worktree,且该 worktree 干净,则会在 push 成功后自动执行 `git worktree remove` + `git worktree prune`
|
|
42
|
+
- AI 入口执行前,应先向用户说明将要 push 的 remote/branch;显式传入 `--push` 即视为确认
|
|
43
|
+
4) 若提示无法 fast-forward:先在 change 分支(或对应 worktree)里 `git rebase <target-branch>`,再重试 `aiws change finish --push`。
|
|
44
|
+
5) 若需要先处理 submodules,则按顺序处理每个 submodule(减少 detached;再 push):
|
|
45
|
+
- 先显式解析 base branch,不要用当前分支名替代:
|
|
46
|
+
- `python3 - <<'PY'`
|
|
47
|
+
- `import json, pathlib; meta = pathlib.Path("changes") / "<change-id>" / ".ws-change.json"; print((json.loads(meta.read_text(encoding="utf-8")).get("base_branch") or "").strip())`
|
|
48
|
+
- `PY`
|
|
42
49
|
- 发现 submodules:`git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$'`
|
|
43
50
|
- 对每个 `<sub_path>`:
|
|
44
51
|
- 读取 superproject 当前 gitlink:`git rev-parse "HEAD:<sub_path>"`
|
|
45
|
-
-
|
|
46
|
-
-
|
|
52
|
+
- 目标分支真值:`changes/<change-id>/submodules.targets`;若条目里分支写 `.`,则展开为刚才解析出的 `base_branch`
|
|
53
|
+
- 生成/检查 `submodules.targets` 时,detached HEAD 默认建议取 `.gitmodules` 的 `submodule.<name>.branch`;已附着在本地分支时默认建议取当前分支;这些都只是预填建议,不是 finish/push 的运行时真值
|
|
54
|
+
- 不要直接切 `change/<change-id>` / `main` / `master` 来解 detached
|
|
47
55
|
- 用 pin 分支挂回(不改动现有 main/master 指针):`git -C "<sub_path>" checkout -B "aiws/pin/<target-branch>" <gitlink-sha>`
|
|
48
56
|
- 仅当 `<gitlink-sha>` 属于 `origin/<target-branch>` 历史时才允许 push;否则停止并人工处理分叉
|
|
49
57
|
- push(只允许 fast-forward):`git -C "<sub_path>" push origin "<gitlink-sha>:refs/heads/<target-branch>"`
|
|
50
58
|
6) 任一 submodule 不满足 fast-forward 条件时立即停止(不要继续 push 主仓库)。
|
|
51
|
-
7) submodules
|
|
52
|
-
- `
|
|
53
|
-
|
|
54
|
-
- `git push`
|
|
55
|
-
8) push 成功后,清理 `change/<change-id>` 对应 worktree(若存在且不是当前 worktree):
|
|
56
|
-
- `change_ref="refs/heads/change/<change-id>"`
|
|
57
|
-
- `main_wt="$(git rev-parse --show-toplevel)"`
|
|
58
|
-
- `change_wt="$(git worktree list --porcelain | awk -v ref="$change_ref" '$1=="worktree"{wt=substr($0,10)} $1=="branch"&&$2==ref{print wt; exit}')"`
|
|
59
|
-
- 若 `change_wt` 非空且不等于 `main_wt`:先输出并让用户确认,再执行 `git worktree remove "$change_wt"`(不带 `--force`),最后 `git worktree prune`
|
|
60
|
-
- 若 `git -C "$change_wt" status --porcelain` 非空:停止并提示先清理该 worktree
|
|
61
|
-
9) (可选)交付完成后归档变更工件:`aiws change archive <change-id>`。
|
|
59
|
+
7) submodules 全部成功后,再回到主仓库执行:
|
|
60
|
+
- `aiws change finish <change-id> --push`
|
|
61
|
+
8) (可选)交付完成后归档变更工件:`aiws change archive <change-id>`。
|
|
62
62
|
|
|
63
63
|
安全:
|
|
64
|
-
- push
|
|
64
|
+
- push 前先输出状态并说明远端/分支。
|
|
65
65
|
- 不执行破坏性命令。
|
|
66
66
|
<!-- AIWS_MANAGED_END:claude:ws-finish -->
|
|
67
67
|
|
|
@@ -4,14 +4,18 @@
|
|
|
4
4
|
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
5
5
|
|
|
6
6
|
目标:
|
|
7
|
-
-
|
|
7
|
+
- 若尚未进入本次 change 的工作上下文:先建立 `change/<change-id>` 分支 / worktree,再生成可落盘执行计划(供 /ws-dev 执行)。
|
|
8
8
|
|
|
9
9
|
执行建议:
|
|
10
10
|
1) 先运行 `/ws-preflight`(对齐 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`)。
|
|
11
|
-
2)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
2) 若当前不在 `change/<change-id>` 分支 / worktree,先调用 `aiws change start <change-id>` 建立上下文:
|
|
12
|
+
- 仓库已有提交:优先 `aiws change start <change-id> --hooks --worktree`;若声明了 submodules,加 `--submodules`
|
|
13
|
+
- 仓库尚无提交 / 不满足 worktree 前置条件:回退 `aiws change start <change-id> --hooks --no-switch`
|
|
14
|
+
3) 若上一步创建了 worktree:切到输出的 `worktree:` 路径,后续所有计划文件都写在该 worktree 中。
|
|
15
|
+
4) 生成或更新计划文件:`plan/YYYY-MM-DD_HH-MM-SS-<slug>.md`。
|
|
16
|
+
5) 计划至少包含:`绑定信息(Bindings)`、`目标(Goal)`、`非目标(Non-goals)`、`范围(Scope)`、`执行计划(Plan)`、`验证(Verify)`、`风险与回滚(Risks & Rollback)`、`证据(Evidence)`。
|
|
17
|
+
6) 若已有 `changes/<change-id>/proposal.md`,对齐 `计划文件(Plan_File)` / `合同行(Contract_Row)` / `证据路径(Evidence_Path)`。
|
|
18
|
+
7) 完成后先运行 `/ws-plan-verify`,通过再进入 `/ws-dev`。
|
|
15
19
|
<!-- AIWS_MANAGED_END:claude:ws-plan -->
|
|
16
20
|
|
|
17
21
|
可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- AIWS_MANAGED_BEGIN:claude:ws-quality-review -->
|
|
2
|
+
# ws quality review
|
|
3
|
+
|
|
4
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
5
|
+
|
|
6
|
+
目标:审查行为回归、边界条件、测试覆盖与实现质量。
|
|
7
|
+
|
|
8
|
+
步骤(建议):
|
|
9
|
+
1) 读取 `git diff`、已执行的验证结果和相关代码。
|
|
10
|
+
2) 检查:
|
|
11
|
+
- 是否存在行为回归或明显 bug 风险
|
|
12
|
+
- 边界条件 / 失败路径是否覆盖
|
|
13
|
+
- 测试是否足以支撑当前改动
|
|
14
|
+
3) 将结论落盘到:
|
|
15
|
+
- 默认:`changes/<change-id>/review/quality-review.md`
|
|
16
|
+
- 回退:`.agentdocs/tmp/review/quality-review.md`
|
|
17
|
+
4) 输出:
|
|
18
|
+
- `证据(Evidence):`
|
|
19
|
+
- `主要发现(Findings):`
|
|
20
|
+
- `测试缺口(Gaps):`
|
|
21
|
+
- `下一步(Next):`
|
|
22
|
+
<!-- AIWS_MANAGED_END:claude:ws-quality-review -->
|
|
23
|
+
|
|
24
|
+
可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- AIWS_MANAGED_BEGIN:claude:ws-spec-review -->
|
|
2
|
+
# ws spec review
|
|
3
|
+
|
|
4
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
5
|
+
|
|
6
|
+
目标:审查 requirements 归因、plan/change 绑定、evidence 与 workflow gate 完整性。
|
|
7
|
+
|
|
8
|
+
步骤(建议):
|
|
9
|
+
1) 先运行 `/ws-preflight`。
|
|
10
|
+
2) 对照 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md` 检查:
|
|
11
|
+
- 当前改动是否能归因到 `Req_ID` / `Problem_ID`
|
|
12
|
+
- `plan/...`、`proposal.md`、`tasks.md`、`evidence/` 是否保持一致
|
|
13
|
+
- 是否存在越界改动、危险操作或缺失 gate
|
|
14
|
+
3) 将结论落盘到:
|
|
15
|
+
- 默认:`changes/<change-id>/review/spec-review.md`
|
|
16
|
+
- 回退:`.agentdocs/tmp/review/spec-review.md`
|
|
17
|
+
4) 输出:
|
|
18
|
+
- `证据(Evidence):`
|
|
19
|
+
- `阻断项(Blockers):`
|
|
20
|
+
- `警告(Warnings):`
|
|
21
|
+
- `下一步(Next):`
|
|
22
|
+
<!-- AIWS_MANAGED_END:claude:ws-spec-review -->
|
|
23
|
+
|
|
24
|
+
可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- AIWS_MANAGED_BEGIN:claude:ws-verify-before-complete -->
|
|
2
|
+
# ws verify before complete
|
|
3
|
+
|
|
4
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
5
|
+
|
|
6
|
+
目标:在 `/ws-finish` 或 `/ws-handoff` 前检查双审查、validate stamp 与 evidence 是否齐全。
|
|
7
|
+
|
|
8
|
+
步骤(建议):
|
|
9
|
+
1) 检查以下最小 gate:
|
|
10
|
+
- `changes/<change-id>/review/spec-review.md`
|
|
11
|
+
- `changes/<change-id>/review/quality-review.md`
|
|
12
|
+
- `.agentdocs/tmp/aiws-validate/*.json`
|
|
13
|
+
2) 若存在 `changes/<change-id>/evidence/`,检查 review / validate / collaboration summary 是否已收敛。
|
|
14
|
+
3) 将结果落盘到:
|
|
15
|
+
- 默认:`changes/<change-id>/evidence/verify-before-complete.md`
|
|
16
|
+
- 回退:`.agentdocs/tmp/review/verify-before-complete.md`
|
|
17
|
+
4) 输出:
|
|
18
|
+
- `证据(Evidence):`
|
|
19
|
+
- `结论(Result): pass|fail`
|
|
20
|
+
- `缺失项(Missing):`
|
|
21
|
+
- `下一步(Next):`
|
|
22
|
+
<!-- AIWS_MANAGED_END:claude:ws-verify-before-complete -->
|
|
23
|
+
|
|
24
|
+
可在下方追加本项目对 Claude Code 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: p-aiws-change-archive
|
|
3
|
+
description: 私有:归档变更工件(会先做严格校验并生成 handoff.md)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
目标:
|
|
7
|
+
- 将 `changes/<change-id>/` 归档到 `changes/archive/<YYYY-MM-DD>/...`
|
|
8
|
+
|
|
9
|
+
执行(在仓库根目录):
|
|
10
|
+
```bash
|
|
11
|
+
change_id="<change-id>"
|
|
12
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
13
|
+
./node_modules/.bin/aiws change archive "$change_id"
|
|
14
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
15
|
+
aiws change archive "$change_id"
|
|
16
|
+
else
|
|
17
|
+
npx @aipper/aiws change archive "$change_id"
|
|
18
|
+
fi
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
说明:
|
|
22
|
+
- `archive` 默认会先跑严格校验并要求 tasks 全部勾选
|
|
23
|
+
- `--force` 会绕过部分门禁(不推荐)
|
|
24
|
+
- 归档后会生成交接文档:`changes/archive/<date>-<change-id>/handoff.md`
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: p-aiws-change-finish
|
|
3
|
+
description: 私有:安全合并 change/<change-id> 回目标分支(默认 fast-forward)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
目标:
|
|
7
|
+
- 将 `change/<change-id>` fast-forward 合并回目标分支,减少手输分支名导致的错误
|
|
8
|
+
|
|
9
|
+
执行(在目标分支所在 worktree 的仓库根目录):
|
|
10
|
+
```bash
|
|
11
|
+
change_id="<change-id>"
|
|
12
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
13
|
+
./node_modules/.bin/aiws change finish "$change_id"
|
|
14
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
15
|
+
aiws change finish "$change_id"
|
|
16
|
+
else
|
|
17
|
+
npx @aipper/aiws change finish "$change_id"
|
|
18
|
+
fi
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
说明:
|
|
22
|
+
- 默认等价于:`git merge --ff-only change/<change-id>`
|
|
23
|
+
- 若你当前就在 `change/<change-id>` 分支上,`finish` 会尝试读取 `changes/<change-id>/.ws-change.json` 的 `base_branch` 作为目标分支
|
|
24
|
+
- 若无法 fast-forward:先在 change 分支(或对应 worktree)里 `git rebase <target-branch>`,再重试 `aiws change finish`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: p-aiws-change-list
|
|
3
|
+
description: 私有:列出 changes 工件(只读)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
目标:
|
|
7
|
+
- 列出当前仓库的变更工件与状态
|
|
8
|
+
|
|
9
|
+
执行(在仓库根目录):
|
|
10
|
+
```bash
|
|
11
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
12
|
+
./node_modules/.bin/aiws change list
|
|
13
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
14
|
+
aiws change list
|
|
15
|
+
else
|
|
16
|
+
npx @aipper/aiws change list
|
|
17
|
+
fi
|
|
18
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: p-aiws-change-new
|
|
3
|
+
description: 私有:创建 changes/<change-id> 工件
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
目标:
|
|
7
|
+
- 创建 `changes/<change-id>/` 工件目录与基础文件(proposal/tasks/可选 design)
|
|
8
|
+
|
|
9
|
+
要求:
|
|
10
|
+
- `change-id` 必须是 kebab-case:`^[a-z0-9]+(-[a-z0-9]+)*$`
|
|
11
|
+
|
|
12
|
+
执行(在仓库根目录):
|
|
13
|
+
```bash
|
|
14
|
+
change_id="<change-id>"
|
|
15
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
16
|
+
./node_modules/.bin/aiws change new "$change_id"
|
|
17
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
18
|
+
aiws change new "$change_id"
|
|
19
|
+
else
|
|
20
|
+
npx @aipper/aiws change new "$change_id"
|
|
21
|
+
fi
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
可选参数:
|
|
25
|
+
- `--title <title>`:写入标题
|
|
26
|
+
- `--no-design`:不生成 design.md
|