@aipper/aiws-spec 0.0.24 → 0.0.26
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 +91 -6
- 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 +30 -22
- 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 +87 -0
- package/templates/workspace/.agents/skills/ws-commit/SKILL.md +27 -1
- package/templates/workspace/.agents/skills/ws-delegate/SKILL.md +75 -0
- package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +25 -4
- package/templates/workspace/.agents/skills/ws-dev/SKILL.md +35 -6
- package/templates/workspace/.agents/skills/ws-dev-lite/SKILL.md +58 -0
- package/templates/workspace/.agents/skills/ws-finish/SKILL.md +25 -12
- package/templates/workspace/.agents/skills/ws-frontend-design/SKILL.md +126 -0
- package/templates/workspace/.agents/skills/ws-handoff/SKILL.md +25 -4
- package/templates/workspace/.agents/skills/ws-plan/SKILL.md +25 -1
- package/templates/workspace/.agents/skills/ws-plan-verify/SKILL.md +20 -0
- package/templates/workspace/.agents/skills/ws-preflight/SKILL.md +23 -0
- package/templates/workspace/.agents/skills/ws-quality-review/SKILL.md +56 -0
- package/templates/workspace/.agents/skills/ws-review/SKILL.md +24 -0
- package/templates/workspace/.agents/skills/ws-spec-review/SKILL.md +57 -0
- package/templates/workspace/.agents/skills/ws-verify-before-complete/SKILL.md +59 -0
- package/templates/workspace/.aiws/manifest.json +2 -6
- package/templates/workspace/.claude/commands/using-aiws.md +25 -0
- package/templates/workspace/.claude/commands/ws-dev-lite.md +31 -0
- package/templates/workspace/.claude/commands/ws-finish.md +1 -1
- package/templates/workspace/.claude/commands/ws-handoff.md +3 -2
- package/templates/workspace/.claude/commands/ws-quality-review.md +24 -0
- package/templates/workspace/.claude/commands/ws-review.md +2 -2
- 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 +87 -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 +130 -0
- package/templates/workspace/.claude/skills/ws-deliver/SKILL.md +230 -0
- package/templates/workspace/.claude/skills/ws-dev/SKILL.md +168 -0
- package/templates/workspace/.claude/skills/ws-dev-lite/SKILL.md +58 -0
- package/templates/workspace/.claude/skills/ws-finish/SKILL.md +209 -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/.githooks/commit-msg +10 -0
- package/templates/workspace/.opencode/command/using-aiws.md +30 -0
- package/templates/workspace/.opencode/command/ws-delegate.md +33 -0
- package/templates/workspace/.opencode/command/ws-dev-lite.md +34 -0
- package/templates/workspace/.opencode/command/ws-finish.md +1 -1
- package/templates/workspace/.opencode/command/ws-handoff.md +4 -3
- package/templates/workspace/.opencode/command/ws-plan.md +3 -0
- package/templates/workspace/.opencode/command/ws-preflight.md +4 -0
- package/templates/workspace/.opencode/command/ws-quality-review.md +30 -0
- package/templates/workspace/.opencode/command/ws-review.md +5 -2
- 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 +30 -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/{.iflow/commands/ws-deliver.toml → .opencode/commands/ws-deliver.md} +13 -13
- package/templates/workspace/.opencode/commands/ws-dev-lite.md +34 -0
- package/templates/workspace/.opencode/commands/ws-dev.md +36 -0
- package/templates/workspace/{.iflow/commands/ws-finish.toml → .opencode/commands/ws-finish.md} +46 -29
- package/templates/workspace/.opencode/commands/ws-handoff.md +26 -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 +91 -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 +130 -0
- package/templates/workspace/.opencode/skills/ws-delegate/SKILL.md +63 -0
- package/templates/workspace/.opencode/skills/ws-deliver/SKILL.md +230 -0
- package/templates/workspace/.opencode/skills/ws-dev/SKILL.md +168 -0
- package/templates/workspace/.opencode/skills/ws-dev-lite/SKILL.md +58 -0
- package/templates/workspace/.opencode/skills/ws-finish/SKILL.md +209 -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 +74 -30
- package/templates/workspace/AI_PROJECT.md +1 -1
- package/templates/workspace/AI_WORKSPACE.md +1 -1
- package/templates/workspace/changes/README.md +25 -4
- package/templates/workspace/changes/templates/proposal.md +15 -0
- package/templates/workspace/changes/templates/tasks.md +9 -2
- package/templates/workspace/manifest.json +340 -82
- package/templates/workspace/memory-bank/README.md +1 -2
- package/templates/workspace/tools/ws_change_check.py +26 -4
- package/templates/workspace/.iflow/agents/feature-reviewer.md +0 -27
- package/templates/workspace/.iflow/agents/requirements-analyst.md +0 -24
- package/templates/workspace/.iflow/agents/server-commit-manager.md +0 -28
- package/templates/workspace/.iflow/agents/server-fix-implementer.md +0 -31
- package/templates/workspace/.iflow/agents/server-test-planner.md +0 -28
- package/templates/workspace/.iflow/agents/server-test-triager.md +0 -30
- package/templates/workspace/.iflow/commands/aiws-init.toml +0 -24
- package/templates/workspace/.iflow/commands/aiws-rollback.toml +0 -18
- package/templates/workspace/.iflow/commands/aiws-update.toml +0 -23
- package/templates/workspace/.iflow/commands/aiws-validate.toml +0 -18
- package/templates/workspace/.iflow/commands/server-commit.toml +0 -27
- package/templates/workspace/.iflow/commands/server-drain.toml +0 -99
- package/templates/workspace/.iflow/commands/server-fix-and-commit.toml +0 -27
- package/templates/workspace/.iflow/commands/server-fix.toml +0 -65
- package/templates/workspace/.iflow/commands/server-test-plan.toml +0 -62
- package/templates/workspace/.iflow/commands/server-test.toml +0 -58
- package/templates/workspace/.iflow/commands/server-triage.toml +0 -38
- package/templates/workspace/.iflow/commands/server_test-plan.toml +0 -12
- package/templates/workspace/.iflow/commands/server_test.toml +0 -12
- package/templates/workspace/.iflow/commands/ws-analyze.toml +0 -33
- package/templates/workspace/.iflow/commands/ws-commit.toml +0 -46
- package/templates/workspace/.iflow/commands/ws-contract-check.toml +0 -69
- package/templates/workspace/.iflow/commands/ws-dev.toml +0 -34
- package/templates/workspace/.iflow/commands/ws-doctor.toml +0 -141
- package/templates/workspace/.iflow/commands/ws-env-doctor.toml +0 -74
- package/templates/workspace/.iflow/commands/ws-feature-deliver.toml +0 -44
- package/templates/workspace/.iflow/commands/ws-feature-plan.toml +0 -47
- package/templates/workspace/.iflow/commands/ws-init.toml +0 -53
- package/templates/workspace/.iflow/commands/ws-memory-bank-init.toml +0 -100
- package/templates/workspace/.iflow/commands/ws-migrate.toml +0 -59
- package/templates/workspace/.iflow/commands/ws-preflight.toml +0 -30
- package/templates/workspace/.iflow/commands/ws-pull.toml +0 -47
- package/templates/workspace/.iflow/commands/ws-push.toml +0 -40
- package/templates/workspace/.iflow/commands/ws-req-change.toml +0 -64
- package/templates/workspace/.iflow/commands/ws-req-contract-sync.toml +0 -25
- package/templates/workspace/.iflow/commands/ws-req-contract-validate.toml +0 -16
- package/templates/workspace/.iflow/commands/ws-req-flow-sync.toml +0 -36
- package/templates/workspace/.iflow/commands/ws-req-review.toml +0 -56
- package/templates/workspace/.iflow/commands/ws-review.toml +0 -33
- package/templates/workspace/.iflow/commands/ws-rule.toml +0 -43
- package/templates/workspace/.iflow/commands/ws-submodule-setup.toml +0 -32
- package/templates/workspace/tools/iflow_watchdog.sh +0 -138
- package/templates/workspace/tools/install_iflow_watchdog_systemd_user.sh +0 -118
- package/templates/workspace/tools/systemd/iflow-watchdog@.service +0 -16
- package/templates/workspace/tools/systemd/iflow-watchdog@.timer +0 -11
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-plan-verify
|
|
3
|
+
description: 计划质检(执行前检查计划是否过长/跑偏,并给出最小修正清单)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 在进入 `$ws-dev` 前,对 `plan/...` 与 `changes/<change-id>/proposal.md` 做一次“硬约束”质检
|
|
10
|
+
- 避免计划过长、步骤不够具体、验证不可复现、与需求合同绑定不一致
|
|
11
|
+
- 失败时只给最小修正项,修完后再进入实现
|
|
12
|
+
|
|
13
|
+
适用时机:
|
|
14
|
+
- 已执行过 `$ws-plan`,且准备开始编码
|
|
15
|
+
- 或用户反馈“计划太长/容易跑偏”,需要先压缩并对齐
|
|
16
|
+
|
|
17
|
+
阶段定位:
|
|
18
|
+
- planning gate;负责在编码前检查计划是否满足 change 严格契约。
|
|
19
|
+
|
|
20
|
+
必需输入:
|
|
21
|
+
- 当前 `plan/...`
|
|
22
|
+
- `changes/<change-id>/proposal.md`
|
|
23
|
+
- 当前 change 上下文
|
|
24
|
+
|
|
25
|
+
必需输出:
|
|
26
|
+
- `Quality gate:` pass/fail
|
|
27
|
+
- `Fix list:` 最小修正项
|
|
28
|
+
- `Next:` 通过则 `$ws-dev`,未通过则继续修正并复跑
|
|
29
|
+
|
|
30
|
+
阻断条件:
|
|
31
|
+
- 无法定位当前 change 或计划文件
|
|
32
|
+
- `aiws change validate <change-id> --strict` 未通过
|
|
33
|
+
|
|
34
|
+
完成判定:
|
|
35
|
+
- 计划满足严格门禁,且后续实现可以在不补需求/补绑定的情况下直接开始。
|
|
36
|
+
|
|
37
|
+
执行步骤(建议):
|
|
38
|
+
1) 先运行 `$ws-preflight`。
|
|
39
|
+
2) 识别 change 上下文:
|
|
40
|
+
- 优先从当前分支推断 `change/<change-id>`
|
|
41
|
+
- 若无法推断:读取 `changes/*/proposal.md` 中的 `Change_ID`,并让用户确认本次要质检的 change
|
|
42
|
+
3) 运行严格门禁(这是硬约束入口):
|
|
43
|
+
```bash
|
|
44
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
45
|
+
./node_modules/.bin/aiws change validate <change-id> --strict
|
|
46
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
47
|
+
aiws change validate <change-id> --strict
|
|
48
|
+
else
|
|
49
|
+
npx @aipper/aiws change validate <change-id> --strict
|
|
50
|
+
fi
|
|
51
|
+
```
|
|
52
|
+
4) 若失败:按报错逐条修正 `proposal.md` / `plan/...`,优先级如下:
|
|
53
|
+
- 先修绑定:`Change_ID` / `Req_ID|Problem_ID` / `Contract_Row` / `Plan_File` / `Evidence_Path`
|
|
54
|
+
- 再修计划质量:必需章节、步骤数量、步骤具体性、验证命令与预期
|
|
55
|
+
5) 复跑 strict 校验,直到通过。
|
|
56
|
+
6) 输出“可执行最小计划摘要”(3-8 步),再进入 `$ws-dev`。
|
|
57
|
+
|
|
58
|
+
输出要求:
|
|
59
|
+
- `Quality gate:` pass/fail
|
|
60
|
+
- `Fix list:` 仅保留必须修改项(按阻断级别排序)
|
|
61
|
+
- `Next:` 通过后建议 `$ws-dev`;未通过则继续修正并复跑 strict
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-preflight
|
|
3
|
+
description: 预检(提交前快速检查与建议)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:在开始任何“写代码/改配置/落盘文件”之前,对齐工作区真值文件,避免规则漂移。
|
|
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
|
+
|
|
33
|
+
执行步骤(强制):
|
|
34
|
+
1) 定位项目根目录:
|
|
35
|
+
- 优先:`git rev-parse --show-toplevel`
|
|
36
|
+
- 若失败:停止并让用户确认当前目录是否为项目根(不要猜测)。
|
|
37
|
+
2) 在项目根目录读取以下文件(存在则必须读取;缺失则明确报告缺失项,不要臆测内容):
|
|
38
|
+
- `AI_PROJECT.md`
|
|
39
|
+
- `REQUIREMENTS.md`
|
|
40
|
+
- `AI_WORKSPACE.md`
|
|
41
|
+
3) 若缺失任意真值文件:不要继续“写代码/改配置/落盘文件”。先输出缺失项,并给出下一步建议:
|
|
42
|
+
- `npx @aipper/aiws init .`(或 `aiws init .`)初始化真值文件
|
|
43
|
+
- 然后重新执行 `$ws-preflight`
|
|
44
|
+
4) 输出:
|
|
45
|
+
- `Root:` <项目根路径>
|
|
46
|
+
- `Found:` <实际读取到的文件列表>
|
|
47
|
+
- `Missing:` <缺失文件列表>
|
|
48
|
+
- `Key rules:` 3–8 条 bullet(范围/禁止项/必须产物/必须验证命令)
|
|
49
|
+
5) 若存在 `.gitmodules`:
|
|
50
|
+
- 输出 submodule 列表:`git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$'`
|
|
51
|
+
- 检查每个 submodule 是否配置 `submodule.<name>.branch`(缺失则提示先运行 `$ws-submodule-setup`;否则 `aiws validate .` 会失败)
|
|
52
|
+
|
|
53
|
+
安全:
|
|
54
|
+
- 不打印 secrets;遇到疑似敏感值只提示“存在风险”但不要复述原文。
|
|
55
|
+
- 不执行破坏性命令。
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-pull
|
|
3
|
+
description: 拉取并对齐 submodules(避免 detached;减少人为差异)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
背景:
|
|
9
|
+
- Git submodule 在别的电脑 `git submodule update` 后常见现象是子模块处于 detached HEAD(因为主仓库记录的是固定 gitlink commit)。
|
|
10
|
+
- detached 本身不一定是错,但会增加“需要手动切分支/容易忘”的操作差异。
|
|
11
|
+
|
|
12
|
+
目标:
|
|
13
|
+
- 安全拉取 superproject(默认只允许 fast-forward)
|
|
14
|
+
- 初始化/同步 submodules(`--init --recursive`)
|
|
15
|
+
- 在**不改动 superproject gitlink commit** 的前提下,尽量把每个 submodule 从 detached HEAD “挂回”到一个**确定的目标分支**(仅当该分支包含 gitlink commit 时)
|
|
16
|
+
- 若未配置 `.gitmodules` 的 `submodule.<name>.branch`:保持 detached,并提示先运行 `$ws-submodule-setup`
|
|
17
|
+
|
|
18
|
+
安全约束(强制):
|
|
19
|
+
- 不执行破坏性命令(不 `reset --hard` 主仓库;不改动远端)
|
|
20
|
+
- 不自动提交/不自动 push
|
|
21
|
+
- 若工作区不干净:停止并要求用户先 commit 或 stash(不要自动处理)
|
|
22
|
+
|
|
23
|
+
执行步骤(建议):
|
|
24
|
+
0) 输出上下文:
|
|
25
|
+
```bash
|
|
26
|
+
git rev-parse --show-toplevel
|
|
27
|
+
git branch --show-current
|
|
28
|
+
git status --porcelain
|
|
29
|
+
```
|
|
30
|
+
若 `git status --porcelain` 非空:停止,要求用户先清理工作区(commit 或 stash)。
|
|
31
|
+
|
|
32
|
+
1) 拉取 superproject(默认只允许 fast-forward,避免隐式 merge/rebase):
|
|
33
|
+
```bash
|
|
34
|
+
git pull --ff-only
|
|
35
|
+
```
|
|
36
|
+
若失败(需要 merge/rebase):停止并向用户解释原因,让用户明确选择 `git pull --rebase` 或手动处理。
|
|
37
|
+
|
|
38
|
+
2) 同步并更新 submodules 到 superproject 记录的 gitlink commit:
|
|
39
|
+
```bash
|
|
40
|
+
if [[ -f .gitmodules ]]; then
|
|
41
|
+
git submodule sync --recursive
|
|
42
|
+
git submodule update --init --recursive
|
|
43
|
+
else
|
|
44
|
+
echo "[info] no .gitmodules"
|
|
45
|
+
fi
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
3) (可选但推荐)把 submodule 从 detached HEAD 尽量“挂回分支”,减少手工操作差异:
|
|
49
|
+
|
|
50
|
+
说明:
|
|
51
|
+
- 该步骤不会改变 superproject 的 gitlink commit(也不会让主仓库出现“submodule modified”)。
|
|
52
|
+
- 只在目标分支包含该 gitlink commit 时才执行“挂回”;否则保持 detached 并提示原因。
|
|
53
|
+
- 为了避免 origin 分支较多时“猜错分支”,本步骤**只在** `.gitmodules` 明确配置了 `submodule.<name>.branch` 时才执行“挂回分支”;否则保持 detached 并提示先运行 `$ws-submodule-setup` 对齐配置。
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
if [[ -f .gitmodules ]]; then
|
|
57
|
+
base_branch="$(git branch --show-current)"
|
|
58
|
+
git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null \
|
|
59
|
+
| while read -r key sub_path; do
|
|
60
|
+
[[ -z "${sub_path:-}" ]] && continue
|
|
61
|
+
name="${key#submodule.}"
|
|
62
|
+
name="${name%.path}"
|
|
63
|
+
echo "== submodule: ${sub_path} (${name}) =="
|
|
64
|
+
|
|
65
|
+
sub_sha="$(git rev-parse "HEAD:${sub_path}" 2>/dev/null || true)"
|
|
66
|
+
if [[ -z "${sub_sha:-}" ]]; then
|
|
67
|
+
echo "[warn] failed to read gitlink sha for ${sub_path}"
|
|
68
|
+
continue
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
cfg_branch="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
|
|
72
|
+
if [[ "${cfg_branch:-}" == "." ]]; then cfg_branch="$base_branch"; fi
|
|
73
|
+
if [[ -z "${cfg_branch:-}" ]]; then
|
|
74
|
+
echo "[warn] ${sub_path}: missing .gitmodules submodule.${name}.branch; keep detached (run ws-submodule-setup to set it)"
|
|
75
|
+
continue
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
target_branch="${cfg_branch}"
|
|
79
|
+
pin_branch="aiws/pin/${target_branch}"
|
|
80
|
+
|
|
81
|
+
git -C "${sub_path}" fetch origin --prune || true
|
|
82
|
+
|
|
83
|
+
if git -C "${sub_path}" show-ref --verify --quiet "refs/remotes/origin/${target_branch}"; then
|
|
84
|
+
if git -C "${sub_path}" merge-base --is-ancestor "${sub_sha}" "origin/${target_branch}"; then
|
|
85
|
+
# 不改动现有分支(避免把已有 main/master 等分支强行指回旧 commit)
|
|
86
|
+
# 仅创建/更新一个 AIWS 专用 pin 分支指向 gitlink commit,从 detached “挂回分支”。
|
|
87
|
+
git -C "${sub_path}" checkout -B "${pin_branch}" "${sub_sha}"
|
|
88
|
+
git -C "${sub_path}" branch --set-upstream-to "origin/${target_branch}" "${pin_branch}" >/dev/null 2>&1 || true
|
|
89
|
+
echo "[ok] attached ${sub_path} to ${pin_branch} (upstream=origin/${target_branch}) at ${sub_sha}"
|
|
90
|
+
else
|
|
91
|
+
echo "[warn] ${sub_path}: ${sub_sha} is not in origin/${target_branch}; keep detached"
|
|
92
|
+
fi
|
|
93
|
+
else
|
|
94
|
+
echo "[warn] ${sub_path}: origin/${target_branch} not found; keep detached"
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
git -C "${sub_path}" rev-parse --abbrev-ref HEAD 2>/dev/null || true
|
|
98
|
+
git -C "${sub_path}" status -sb || true
|
|
99
|
+
done
|
|
100
|
+
fi
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
4) 一次性配置(方案 2):为每个 submodule 写入跟踪分支,便于团队统一(需要用户确认,会改动 `.gitmodules`):
|
|
104
|
+
```bash
|
|
105
|
+
# 示例:把某个 submodule 固定跟踪 main(会写入 .gitmodules 的 submodule.<name>.branch)
|
|
106
|
+
git submodule set-branch --branch main <sub_path>
|
|
107
|
+
|
|
108
|
+
# 提示:该变更需要提交到 superproject
|
|
109
|
+
git add .gitmodules
|
|
110
|
+
git commit -m "chore(submodule): set tracking branch"
|
|
111
|
+
```
|
|
112
|
+
建议:
|
|
113
|
+
- 只有当团队明确希望“子模块按分支滚动”(而不是锁定固定 commit)时,才采用方案 2。
|
|
114
|
+
- 若只是想避免 detached 但仍锁定 gitlink commit:优先使用步骤 3(不改 `.gitmodules`)。
|
|
115
|
+
- 推荐用 `$ws-submodule-setup` 交互式对齐所有 submodules 的 branch,并提交 `.gitmodules`。
|
|
116
|
+
|
|
117
|
+
输出要求:
|
|
118
|
+
- `Context:` 当前分支 + 是否存在 `.gitmodules` + submodule 列表
|
|
119
|
+
- `Result:` pull 是否 fast-forward;每个 submodule 是否成功“挂回分支”,失败原因是什么
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-push
|
|
3
|
+
description: 推送(submodule 感知:先 submodules 后 superproject;fast-forward 安全)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 在不自动提交的前提下,安全 push 当前仓库
|
|
10
|
+
- 若仓库包含 submodules:按 `submodules -> superproject` 顺序 push,减少“别人拉取后子模块 detached/分叉”的协作摩擦
|
|
11
|
+
- 若不包含 submodules:按普通 git 仓库的规则 push
|
|
12
|
+
|
|
13
|
+
安全约束(强制):
|
|
14
|
+
- 不自动提交、不自动 `git add -A`
|
|
15
|
+
- 不使用 `--force` / `--force-with-lease`
|
|
16
|
+
- 默认只允许 fast-forward push(发现分叉则停止并提示人工处理)
|
|
17
|
+
- 若工作区不干净:停止并要求先 commit 或 stash
|
|
18
|
+
|
|
19
|
+
执行步骤(建议):
|
|
20
|
+
0) 输出上下文:
|
|
21
|
+
```bash
|
|
22
|
+
git branch --show-current
|
|
23
|
+
git status --porcelain
|
|
24
|
+
git status -sb
|
|
25
|
+
```
|
|
26
|
+
若 `git status --porcelain` 非空:停止。
|
|
27
|
+
|
|
28
|
+
1) 判断是否存在 submodules:
|
|
29
|
+
```bash
|
|
30
|
+
if [[ -f .gitmodules ]]; then
|
|
31
|
+
git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' || true
|
|
32
|
+
else
|
|
33
|
+
echo "[info] no .gitmodules"
|
|
34
|
+
fi
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2) 若不存在 `.gitmodules` 或没有 submodule 条目:按普通仓库 push(仍需用户确认):
|
|
38
|
+
```bash
|
|
39
|
+
git remote -v
|
|
40
|
+
git push
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
3) 若存在 submodules:先检查 `.gitmodules` 的 branch 真值是否齐全(缺失则停止并提示 setup):
|
|
44
|
+
```bash
|
|
45
|
+
missing=0
|
|
46
|
+
while read -r key sub_path; do
|
|
47
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
48
|
+
b="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
|
|
49
|
+
if [[ -z "${b:-}" ]]; then
|
|
50
|
+
echo "error: missing .gitmodules submodule.${name}.branch (path=${sub_path})"
|
|
51
|
+
missing=1
|
|
52
|
+
fi
|
|
53
|
+
done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
|
|
54
|
+
if [[ "$missing" -ne 0 ]]; then
|
|
55
|
+
echo "hint: run $ws-submodule-setup (and commit .gitmodules), then retry"
|
|
56
|
+
exit 2
|
|
57
|
+
fi
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
4) 逐个 push submodules(fast-forward only),再 push superproject:
|
|
61
|
+
```bash
|
|
62
|
+
base_branch="$(git branch --show-current)"
|
|
63
|
+
change_id="$(echo "${base_branch}" | sed -n 's|^change/||p')"
|
|
64
|
+
targets="changes/${change_id}/submodules.targets"
|
|
65
|
+
# Note: if not on a change/ branch, change_id is empty and targets file won't exist;
|
|
66
|
+
# resolution falls back to .gitmodules submodule.<name>.branch via ws_resolve_sub_target.
|
|
67
|
+
|
|
68
|
+
source tools/ws_resolve_sub_target.sh
|
|
69
|
+
|
|
70
|
+
git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null \
|
|
71
|
+
| while read -r key sub_path; do
|
|
72
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
73
|
+
echo "== submodule: ${sub_path} (${name}) =="
|
|
74
|
+
|
|
75
|
+
# submodule 工作区必须干净
|
|
76
|
+
if [[ -n "$(git -C "${sub_path}" status --porcelain 2>/dev/null || true)" ]]; then
|
|
77
|
+
echo "error: submodule dirty: ${sub_path}"
|
|
78
|
+
exit 2
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
ws_resolve_sub_target "${sub_path}" "${name}" "${targets}" "${base_branch}" || exit 2
|
|
82
|
+
target_branch="${_resolved_branch}"
|
|
83
|
+
remote="${_resolved_remote}"
|
|
84
|
+
|
|
85
|
+
git -C "${sub_path}" fetch "${remote}" --prune
|
|
86
|
+
if ! git -C "${sub_path}" show-ref --verify --quiet "refs/remotes/${remote}/${target_branch}"; then
|
|
87
|
+
echo "error: missing ${remote}/${target_branch} for ${sub_path}"
|
|
88
|
+
exit 2
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
# fast-forward only: <remote>/<branch> 必须是 HEAD 的祖先
|
|
92
|
+
if ! git -C "${sub_path}" merge-base --is-ancestor "${remote}/${target_branch}" HEAD; then
|
|
93
|
+
echo "error: non-fast-forward (submodule=${sub_path}, remote=${remote}, branch=${target_branch})"
|
|
94
|
+
echo "hint: rebase/merge in submodule, then retry"
|
|
95
|
+
exit 2
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
# push HEAD -> <remote>/<branch>(不 force)
|
|
99
|
+
git -C "${sub_path}" push "${remote}" "HEAD:refs/heads/${target_branch}"
|
|
100
|
+
done
|
|
101
|
+
|
|
102
|
+
# 最后 push superproject(仍需用户确认远端/分支)
|
|
103
|
+
git remote -v
|
|
104
|
+
git push
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
输出要求:
|
|
108
|
+
- `Context:` 当前分支 + 是否有 submodules
|
|
109
|
+
- `Submodules:` 每个 submodule push 的目标分支与结果(成功/阻断原因)
|
|
110
|
+
- `Superproject:` push 结果
|
|
@@ -0,0 +1,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
|
+
- 不执行破坏性命令。
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-req-change
|
|
3
|
+
description: 需求变更(更新 REQUIREMENTS 并同步执行合同)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:记录需求变更(更新 `REQUIREMENTS.md` + 追加 `requirements/CHANGELOG.md`),并同步/校验执行合同 `requirements/requirements-issues.csv`。
|
|
9
|
+
|
|
10
|
+
步骤(必须按顺序):
|
|
11
|
+
1) 读取:`AI_PROJECT.md`、`REQUIREMENTS.md`、`AI_WORKSPACE.md`、`requirements/CHANGELOG.md`(缺失则创建目录与文件)。
|
|
12
|
+
2) 先产出“拟变更方案”(不要立刻写文件):
|
|
13
|
+
- 变更摘要(1–5 条)
|
|
14
|
+
- 影响范围(API/鉴权/字段/状态码/测试边界)
|
|
15
|
+
- 回滚思路(1–2 条)
|
|
16
|
+
3) 对比与冲突检查(强制,不写文件):
|
|
17
|
+
- 对比“变更前 vs 拟变更后”的差异清单(新增/删除/语义变化)
|
|
18
|
+
- 整理潜在冲突/不确定点(只列“最可能影响验收/实现”的,避免噪音)
|
|
19
|
+
4) 逐条澄清(强制,避免一次问完):
|
|
20
|
+
- 若存在潜在冲突/不确定点:**本轮只问 1 个**最高优先级问题(给出 2–4 个可选答案或二选一),然后停止,等待用户回复;不要继续问下一题,也不要写文件。
|
|
21
|
+
- 收到用户回复后:更新“拟变更方案”,回到步骤 3) 重新对比,直至没有未决问题。
|
|
22
|
+
5) 强制停下来让用户确认:是否继续落盘?(Y/N)
|
|
23
|
+
6) 用户确认 Y 后再写入:
|
|
24
|
+
- 更新 `REQUIREMENTS.md`(只保留当前有效版本,不在此堆历史)
|
|
25
|
+
- 追加 `requirements/CHANGELOG.md`
|
|
26
|
+
7) 同步/补齐需求执行合同(强制,自动处理 FlowSpec 有/无两种情况):
|
|
27
|
+
- `python3 tools/requirements_contract_sync.py --workspace .`
|
|
28
|
+
- 说明:若 `REQUIREMENTS.md` 中不存在 FlowSpec(或 flows 为空),该命令只会确保 `requirements/requirements-issues.csv` 表头存在并给出 WARN(这是预期行为,不要当成失败)。
|
|
29
|
+
8) 校验需求执行合同(强制):`python3 tools/requirements_contract.py validate`
|
|
30
|
+
9) 同步场景合同(可选,但若存在 FlowSpec 则强烈建议自动执行):
|
|
31
|
+
- 若 `REQUIREMENTS.md` 同时包含 `<!-- FLOW_SPEC_BEGIN -->` 与 `<!-- FLOW_SPEC_END -->`:运行 `$ws-req-flow-sync`
|
|
32
|
+
- 否则:跳过,并提示用户“可以先不维护 FlowSpec;后续需要场景回归时再补”
|
|
33
|
+
|
|
34
|
+
输出必须包含:
|
|
35
|
+
- 本次更新的文件清单(路径)
|
|
36
|
+
- 回滚方案(如何撤销本次需求变更)
|
|
37
|
+
- 下一步建议命令
|
|
38
|
+
|
|
39
|
+
安全:
|
|
40
|
+
- 不打印 `secrets/test-accounts.json`
|
|
41
|
+
- 不引入任何 token/密钥到仓库
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-req-contract-sync
|
|
3
|
+
description: 合同同步(requirements contract sync)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
用途:从 `REQUIREMENTS.md` 的 FlowSpec 补齐 `requirements/requirements-issues.csv`(只生成骨架,不猜测完成状态)。
|
|
9
|
+
|
|
10
|
+
执行(在 workspace 根目录):
|
|
11
|
+
- `python3 tools/requirements_contract_sync.py --workspace .`
|
|
12
|
+
|
|
13
|
+
输出要求:
|
|
14
|
+
- 说明新增/更新了多少条
|
|
15
|
+
- 明确下一步:手工补齐 CRUD/Inputs/Outputs/Business_Logic/Tests,并将可开工条目标为 `Spec_Status=READY`
|
|
16
|
+
|
|
17
|
+
下一步建议:`$ws-req-contract-validate`
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-req-contract-validate
|
|
3
|
+
description: 合同校验(requirements contract validate)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
执行(失败则修正 CSV 后重试):
|
|
9
|
+
- `python3 tools/requirements_contract.py validate`
|
|
10
|
+
|
|
11
|
+
输出要求:
|
|
12
|
+
- 若失败:列出前 20 条缺失字段(Req_ID + field),并给出最小补齐建议
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-req-flow-sync
|
|
3
|
+
description: Flow 同步(生成 api-flow 与场景执行合同)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出;命令与路径保持原样不翻译。
|
|
7
|
+
|
|
8
|
+
目标:基于 `REQUIREMENTS.md` 的 FlowSpec 生成:
|
|
9
|
+
- `docs/api-flow.mmd`(简短逻辑图,Mermaid)
|
|
10
|
+
- `issues/server-scenario-issues.csv`(场景执行合同:TODO/DONE/BLOCKED)
|
|
11
|
+
|
|
12
|
+
执行(在 workspace 根目录):
|
|
13
|
+
`python3 tools/requirements_flow_gen.py --workspace .`
|
|
14
|
+
|
|
15
|
+
若缺少工具 `tools/requirements_flow_gen.py`:提示用户先运行 `$aiws-init`(默认会安装 optional tools),或执行:
|
|
16
|
+
```bash
|
|
17
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
18
|
+
./node_modules/.bin/aiws init .
|
|
19
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
20
|
+
aiws init .
|
|
21
|
+
else
|
|
22
|
+
npx @aipper/aiws init .
|
|
23
|
+
fi
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
输出要求:只打印生成的文件路径与下一步命令:
|
|
27
|
+
- 查看逻辑图:`cat docs/api-flow.mmd`
|
|
28
|
+
- 查看场景合同:`cat issues/server-scenario-issues.csv`
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-req-review
|
|
3
|
+
description: 需求评审(对齐真值与验收)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:在不修改任何文件的前提下,对 `REQUIREMENTS.md` 做一次整体 QA,输出缺口/冲突/风险,减少实现漂移。
|
|
9
|
+
|
|
10
|
+
执行步骤(强制):
|
|
11
|
+
1) 定位项目根目录:`git rev-parse --show-toplevel`(失败则停止并让用户确认根目录)。
|
|
12
|
+
2) 读取(存在则必须读取;缺失则明确列出,不要臆测):
|
|
13
|
+
- `AI_PROJECT.md`
|
|
14
|
+
- `REQUIREMENTS.md`
|
|
15
|
+
- `AI_WORKSPACE.md`
|
|
16
|
+
- `requirements/CHANGELOG.md`(若存在)
|
|
17
|
+
- `requirements/requirements-issues.csv`(若存在)
|
|
18
|
+
3) 输出固定结构的报告:
|
|
19
|
+
|
|
20
|
+
## Requirements QA
|
|
21
|
+
- 结论:是否可进入实现(是/否/有条件)
|
|
22
|
+
- 漂移风险:最容易导致不一致的点
|
|
23
|
+
- 可验收性缺口:缺少输入/输出/错误码/边界/示例的条目
|
|
24
|
+
- 完整性:Non-goals/兼容性/鉴权/重试/并发/观测性/性能
|
|
25
|
+
- 一致性:与 `AI_PROJECT.md` 约束冲突点
|
|
26
|
+
- 可测试性与证据:最小验证命令 + 期望结果 + 证据路径
|
|
27
|
+
- 风险清单:3–8 条
|
|
28
|
+
- 需要澄清的问题:5–12 个(按优先级)
|
|
29
|
+
|
|
30
|
+
4) 最后询问用户:是否进入需求落盘流程 `$ws-req-change`?(Y/N)
|
|
31
|
+
|
|
32
|
+
安全:不打印 `secrets/test-accounts.json`。
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-review
|
|
3
|
+
description: 评审(提交前审计与证据落盘)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:在提交/交付前审计当前改动,对照真值文件检查是否越界,并把审计证据优先落盘到 `changes/<change-id>/review/`(若无法确定 `change-id` 再回退 `.agentdocs/tmp/review/`)。
|
|
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
|
+
|
|
32
|
+
步骤(建议):
|
|
33
|
+
1) 先做 preflight:定位项目根目录,读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`,输出约束摘要。
|
|
34
|
+
2) 基于 `git status` / `git diff`(以及你实际运行过的测试结果),对照 `AI_PROJECT.md` 与 `REQUIREMENTS.md` 检查:
|
|
35
|
+
- 是否存在越界目录改动/危险操作
|
|
36
|
+
- 是否有可复现验证命令与证据
|
|
37
|
+
- 是否维护了 `changes/<change-id>/` 或相关 `issues/*.csv`
|
|
38
|
+
- 若存在 `analysis/` / `patches/`:审查这些委托工件是否已被主 agent 理解、是否需要采用/拒绝,并把结论写入 review 文件
|
|
39
|
+
3) 将审计落盘到(目录不存在则创建):
|
|
40
|
+
- 默认:`changes/<change-id>/review/codex-review.md`
|
|
41
|
+
- 回退:`.agentdocs/tmp/review/codex-review.md`(仅在无法确定 `change-id` 时使用)
|
|
42
|
+
- 若已有其它 reviewer 文件:不要覆盖它们;当前 reviewer 应写自己的文件或更新自己的汇总文件
|
|
43
|
+
4) 回复中输出:
|
|
44
|
+
- `证据(Evidence):` 证据文件路径
|
|
45
|
+
- `主要风险(Top risks):` 3–8 条(高→低)
|
|
46
|
+
- `下一步(Next):` 最小修复清单 + 最小验证命令
|
|
47
|
+
|
|
48
|
+
安全:
|
|
49
|
+
- 不打印 secrets。
|
|
50
|
+
- 不执行破坏性命令。
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-rule
|
|
3
|
+
description: 规则(解释项目规则与边界)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:把用户口述的“项目特有规则”整理成可执行条款,并写入 `AI_PROJECT.md` 的 `AI_PROJECT_RULES_BEGIN/END` 段(托管块外内容会被保留)。
|
|
9
|
+
|
|
10
|
+
安全规则(强制):
|
|
11
|
+
- 不打印/不写入 secrets(token、密钥、内网地址、账号密码)。
|
|
12
|
+
- 不执行破坏性命令。
|
|
13
|
+
|
|
14
|
+
工作流:
|
|
15
|
+
1) 先做 preflight;若缺失 `AI_PROJECT.md`:提示用户先 `$ws-migrate`(或 `$aiws-init`)。
|
|
16
|
+
2) 写入前创建备份(必须):
|
|
17
|
+
`ts="$(date +%Y%m%d-%H%M%S)"; mkdir -p .aiws/backups/manual; cp -a AI_PROJECT.md .aiws/backups/manual/AI_PROJECT.md.bak.${ts}`
|
|
18
|
+
3) 先输出“将写入的规则清单”(3–12 条),并要求用户回复 `CONFIRM` 后再落盘。
|
|
19
|
+
4) 用户确认后,**仅更新** BEGIN/END 段内内容(合并去重;写成可检查条款:目录白名单/必须验证命令/禁止项/产物要求)。
|
|
20
|
+
5) 输出必须包含:
|
|
21
|
+
- 更新了哪些文件(路径)
|
|
22
|
+
- 回滚方式(恢复备份文件)
|
|
23
|
+
- 下一步建议:`$aiws-validate`
|
|
@@ -0,0 +1,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
|
+
- 不执行破坏性命令。
|