@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,70 @@
|
|
|
1
|
+
# workflow-stage-contracts
|
|
2
|
+
|
|
3
|
+
<!-- Generated from packages/spec/docs/workflow-stage-contracts.json by scripts/sync-workflow-stage-contracts.mjs. Do not hand edit. -->
|
|
4
|
+
|
|
5
|
+
## 目的
|
|
6
|
+
|
|
7
|
+
这份文档把 `aiws` 核心 `ws-*` workflow 的阶段契约写成统一真值,避免不同工具、不同协作者把同一个入口用成不同语义。
|
|
8
|
+
|
|
9
|
+
重点不是“命令名长什么样”,而是每个阶段必须收什么输入、产出什么结果、在什么情况下必须停止。
|
|
10
|
+
|
|
11
|
+
## 标准链路
|
|
12
|
+
|
|
13
|
+
默认链路:
|
|
14
|
+
|
|
15
|
+
`ws-preflight` -> `ws-plan` -> `ws-plan-verify` -> `ws-dev` -> `ws-review` -> `ws-commit` -> `ws-deliver` -> `ws-finish` -> `ws-handoff`
|
|
16
|
+
|
|
17
|
+
说明:
|
|
18
|
+
- ws-deliver 用于多 repo / submodule 场景的顺序提交与交付准备。
|
|
19
|
+
- ws-finish 用于 fast-forward 合并、push、worktree cleanup,并在完整 finish 后自动归档 change。
|
|
20
|
+
- ws-handoff 通常在 finish 自动归档后使用,用于查看/补充归档交接说明。
|
|
21
|
+
- 若存在独立 change worktree,治理信号应优先读取该 worktree;若 worktree metadata 已 stale,则降级为 warning 并回退到当前 worktree。
|
|
22
|
+
|
|
23
|
+
## 阶段表
|
|
24
|
+
|
|
25
|
+
| Stage | 目标 | 必需输入 | 必需输出 | 阻断条件 | 下一步 |
|
|
26
|
+
| --- | --- | --- | --- | --- | --- |
|
|
27
|
+
| `ws-preflight` | 对齐真值文件与协作约束 | 项目根;AI_PROJECT.md;REQUIREMENTS.md;AI_WORKSPACE.md | Root / Found / Missing / Key rules / Next | 无法确定项目根;真值缺失 | ws-plan 或 ws-dev |
|
|
28
|
+
| `ws-plan` | 建立 change 绑定并落盘计划 | 任务描述;真值文件;proposal.md(若存在) | plan/...;Bindings;Verify;Risks;Evidence;Next | 绑定不清;dirty 工作区无法安全建 context;无法写盘 | ws-plan-verify |
|
|
29
|
+
| `ws-plan-verify` | 检查计划是否满足严格契约 | plan/...;proposal.md;当前 change | Quality gate;Fix list;可执行最小计划摘要 | strict 校验失败;无法定位 change | 修计划后重跑或进入 ws-dev |
|
|
30
|
+
| `ws-dev` | 实施最小改动并验证 | 真值文件;归因目标;计划(medium/complex) | Changed;Verify;Evidence;Next | 无法归因;没有验证入口;change 上下文不安全 | ws-review / ws-commit |
|
|
31
|
+
| `ws-review` | 审计规范、风险与验证完整性 | 当前 diff;验证结果;真值文件 | review 文件;Top risks;Next | 无改动可审;无法写审计证据 | ws-commit 或修复后重审 |
|
|
32
|
+
| `ws-commit` | 串联 review、validate、commit 确认 | staged diff;review 证据;validate stamp;用户确认的 message | Evidence;Context;Commit | 无 staged changes;submodule dirty;validate 失败;message 未确认 | ws-deliver / ws-finish |
|
|
33
|
+
| `ws-deliver` | 在 submodule 场景下完成顺序提交与证据收敛 | change 上下文;.gitmodules;submodules.targets;各 repo 状态 | submodule 提交摘要;superproject 提交摘要;Evidence | submodule 真值不完整;不在正确 change;commit 未确认 | ws-finish |
|
|
34
|
+
| `ws-finish` | 安全合并、push、cleanup,并自动归档 | 干净工作区;已提交的 change;push 目标;submodule 真值(若有) | Merge;Push;Worktree cleanup;Archive/Handoff;Evidence | dirty 工作区;ff 失败;submodule 无法安全 push | ws-handoff |
|
|
35
|
+
| `ws-handoff` | 查看/补充可接力的归档交接说明 | 已归档的 change | changes/archive/.../handoff.md;Next | 无法定位已归档 change;handoff 无法生成或读取 | 新 change 通过 Depends_On 接力 |
|
|
36
|
+
|
|
37
|
+
## 统一规则
|
|
38
|
+
|
|
39
|
+
- 每个阶段都必须回指真值文件或 change 工件,不能只依赖会话上下文。
|
|
40
|
+
- 每个阶段都必须有明确输出,不能只给“建议继续”而不留下工件或证据。
|
|
41
|
+
- 遇到阻断条件时必须停止,不能为了推进速度跳过门禁。
|
|
42
|
+
- 如果一个阶段没有留下可审计路径,它就不算真正完成。
|
|
43
|
+
- `ws-finish` 只有在 merge、push、cleanup、archive 都完成后才算完成;仅本地 merge 成功不等于可进入 `ws-handoff`。
|
|
44
|
+
|
|
45
|
+
## 证据约定
|
|
46
|
+
|
|
47
|
+
最少证据集合:
|
|
48
|
+
|
|
49
|
+
- planning:`plan/...`、`changes/<change-id>/proposal.md`、`tasks.md`
|
|
50
|
+
- review:`changes/<change-id>/review/...` 或 `.agentdocs/tmp/review/...`
|
|
51
|
+
- validate:`.agentdocs/tmp/aiws-validate/*.json`
|
|
52
|
+
- deliver / finish:`changes/<change-id>/evidence/...`、`state`、merge / push 结果
|
|
53
|
+
- handoff:`changes/archive/.../handoff.md`
|
|
54
|
+
|
|
55
|
+
补充:
|
|
56
|
+
- tmp review 证据可以作为“进入 commit gate”的临时治理信号,但在交付前应通过 `aiws change evidence` 收敛为持久 review 证据。
|
|
57
|
+
- finish 生命周期建议区分“本地开始”和“完整完成”两类信号,避免仅凭本地 merge 就误导到 handoff。
|
|
58
|
+
|
|
59
|
+
## 与产品定位的关系
|
|
60
|
+
|
|
61
|
+
这份阶段契约文档是 `aiws` “治理内核”定位的直接落点:
|
|
62
|
+
|
|
63
|
+
- `packages/spec/` 继续作为规则真值层
|
|
64
|
+
- `ws-*` 阶段契约是工作流治理层
|
|
65
|
+
- `docs/workflow-stage-contracts.json` 是运行时阶段契约的机器可读真值
|
|
66
|
+
- `docs/workflow-governance-rules.json` 是运行时阶段推断的机器可读真值
|
|
67
|
+
- CLI / tool-native files 是执行与分发层
|
|
68
|
+
- review / validate / handoff 等工件属于证据与审计层
|
|
69
|
+
|
|
70
|
+
如果未来要吸收新的 skill、协同角色或外部 workflow,优先判断它能否被映射到这张阶段表;不能稳定映射的能力,不应直接成为核心真值。
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"required": [
|
|
4
|
+
"version",
|
|
5
|
+
"title",
|
|
6
|
+
"description",
|
|
7
|
+
"purpose",
|
|
8
|
+
"standardChain",
|
|
9
|
+
"notes",
|
|
10
|
+
"stages",
|
|
11
|
+
"unifiedRules",
|
|
12
|
+
"evidence",
|
|
13
|
+
"positioning"
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"version": { "type": "integer" },
|
|
17
|
+
"title": { "type": "string", "minLength": 1 },
|
|
18
|
+
"description": { "type": "string", "minLength": 1 },
|
|
19
|
+
"purpose": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"minItems": 1,
|
|
22
|
+
"items": { "type": "string", "minLength": 1 }
|
|
23
|
+
},
|
|
24
|
+
"standardChain": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"minItems": 1,
|
|
27
|
+
"items": { "type": "string", "minLength": 1, "pattern": "^ws-[a-z0-9-]+$" }
|
|
28
|
+
},
|
|
29
|
+
"notes": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"minItems": 1,
|
|
32
|
+
"items": { "type": "string", "minLength": 1 }
|
|
33
|
+
},
|
|
34
|
+
"stages": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"minItems": 1,
|
|
37
|
+
"items": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"required": ["stage", "goal", "requiredInputs", "requiredOutputs", "blockers", "next"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"stage": { "type": "string", "minLength": 1, "pattern": "^ws-[a-z0-9-]+$" },
|
|
42
|
+
"goal": { "type": "string", "minLength": 1 },
|
|
43
|
+
"requiredInputs": { "type": "string", "minLength": 1 },
|
|
44
|
+
"requiredOutputs": { "type": "string", "minLength": 1 },
|
|
45
|
+
"blockers": { "type": "string", "minLength": 1 },
|
|
46
|
+
"next": { "type": "string", "minLength": 1 }
|
|
47
|
+
},
|
|
48
|
+
"additionalProperties": false
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"unifiedRules": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"minItems": 1,
|
|
54
|
+
"items": { "type": "string", "minLength": 1 }
|
|
55
|
+
},
|
|
56
|
+
"evidence": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"required": ["intro", "minimum", "notes"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"intro": { "type": "string", "minLength": 1 },
|
|
61
|
+
"minimum": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"minItems": 1,
|
|
64
|
+
"items": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"required": ["label", "value"],
|
|
67
|
+
"properties": {
|
|
68
|
+
"label": { "type": "string", "minLength": 1 },
|
|
69
|
+
"value": { "type": "string", "minLength": 1 }
|
|
70
|
+
},
|
|
71
|
+
"additionalProperties": false
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"notes": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"minItems": 1,
|
|
77
|
+
"items": { "type": "string", "minLength": 1 }
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"additionalProperties": false
|
|
81
|
+
},
|
|
82
|
+
"positioning": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": ["intro", "layers", "closing"],
|
|
85
|
+
"properties": {
|
|
86
|
+
"intro": { "type": "string", "minLength": 1 },
|
|
87
|
+
"layers": {
|
|
88
|
+
"type": "array",
|
|
89
|
+
"minItems": 1,
|
|
90
|
+
"items": { "type": "string", "minLength": 1 }
|
|
91
|
+
},
|
|
92
|
+
"closing": { "type": "string", "minLength": 1 }
|
|
93
|
+
},
|
|
94
|
+
"additionalProperties": false
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"additionalProperties": false
|
|
98
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-aiws
|
|
3
|
+
description: 默认 workflow bootstrap/router:先读真值,再路由到正确的 ws-* 入口
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 作为默认入口,先读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`
|
|
10
|
+
- 先判定当前任务属于哪个 workflow,再进入具体 `ws-*` skill
|
|
11
|
+
- 若任务意图、归因或验证入口不明确:先澄清,不直接进入实现
|
|
12
|
+
|
|
13
|
+
阶段定位:
|
|
14
|
+
- bootstrap/router 阶段;负责 workflow 分流,而不是直接完成实现。
|
|
15
|
+
|
|
16
|
+
必需输入:
|
|
17
|
+
- 当前任务描述
|
|
18
|
+
- `AI_PROJECT.md`
|
|
19
|
+
- `REQUIREMENTS.md`
|
|
20
|
+
- `AI_WORKSPACE.md`
|
|
21
|
+
- 若已存在:当前 `change/<change-id>` 上下文、`plan/...`、`changes/<change-id>/...`
|
|
22
|
+
|
|
23
|
+
必需输出:
|
|
24
|
+
- `Root:` 当前项目根
|
|
25
|
+
- `Found:` 实际读取到的真值文件
|
|
26
|
+
- `Task intent:` 当前任务意图分类
|
|
27
|
+
- `Binding:` `Req_ID` / `Problem_ID` / change 上下文是否清晰
|
|
28
|
+
- `Route:` 选中的下一步 skill
|
|
29
|
+
- `Why:` 选择该 route 的原因
|
|
30
|
+
- `Next:` 进入对应 skill,或先提澄清问题
|
|
31
|
+
|
|
32
|
+
阻断条件:
|
|
33
|
+
- 无法确定项目根目录
|
|
34
|
+
- 缺失任一真值文件
|
|
35
|
+
- 无法明确当前任务意图
|
|
36
|
+
- 无法明确归因或验证入口,且不能安全推断
|
|
37
|
+
|
|
38
|
+
完成判定:
|
|
39
|
+
- 已经明确给出单一路由结果,并进入对应 `ws-*` skill;或已提出关键澄清问题并停止。
|
|
40
|
+
|
|
41
|
+
执行步骤(强制):
|
|
42
|
+
1) 先遵守 `$ws-preflight` 的真值读取要求:
|
|
43
|
+
- 定位项目根目录
|
|
44
|
+
- 读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`
|
|
45
|
+
- 输出 `Root:` / `Found:` / `Missing:`
|
|
46
|
+
2) 若缺失任一真值文件:
|
|
47
|
+
- 不进入实现
|
|
48
|
+
- 输出下一步:先 `aiws init .`(或 `npx @aipper/aiws init .`),然后重新执行 `$using-aiws`
|
|
49
|
+
- 此时 route 视为 `$ws-preflight`
|
|
50
|
+
3) 根据 `packages/spec/docs/workflow-router-rules.json` 判定任务属于哪一类:
|
|
51
|
+
- 需求/验收/合同变更:`$ws-req-review`
|
|
52
|
+
- 评审/审计/找风险:`$ws-review`
|
|
53
|
+
- finish / merge / push / cleanup:`$ws-finish`
|
|
54
|
+
- handoff / archive summary:`$ws-handoff`
|
|
55
|
+
- 中大型实现、需要方案、需要 change/worktree:`$ws-plan`
|
|
56
|
+
- 小步明确实现/修复/配置调整:`$ws-dev`(若是 simple/local 单点修复,且用户明确希望走轻量入口,可显式进入 `$ws-dev-lite`)
|
|
57
|
+
4) 若任务意图或归因不明确:
|
|
58
|
+
- 只问 1-3 个关键澄清问题
|
|
59
|
+
- 明确写出缺的是什么:意图、`Req_ID` / `Problem_ID`、verify、change 上下文
|
|
60
|
+
- 然后停止;不要直接写代码
|
|
61
|
+
5) 若已确定 route:
|
|
62
|
+
- 先输出:
|
|
63
|
+
- `Task intent:`
|
|
64
|
+
- `Binding:`
|
|
65
|
+
- `Route:`
|
|
66
|
+
- `Why:`
|
|
67
|
+
- 若 `Route: $ws-dev` 且任务属于 simple/local 单点修复:
|
|
68
|
+
- `Next:` 可优先进入 `$ws-dev-lite`
|
|
69
|
+
- 否则:
|
|
70
|
+
- `Next:` 进入对应主 skill
|
|
71
|
+
- 然后在同一轮中继续遵循对应 skill 的契约
|
|
72
|
+
6) 路由约束:
|
|
73
|
+
- router 自己不是实现阶段;不要在给出 route 之前直接改代码
|
|
74
|
+
- 除非用户只想听判断结果,否则给出 route 后应继续按对应 skill 的规则推进
|
|
75
|
+
- 一次只选择一个主 route;不要把 `ws-plan` / `ws-dev` / `ws-review` / `ws-finish` 混成并行终态
|
|
76
|
+
7) 若执行过程中发现复杂度升高:
|
|
77
|
+
- 从 `$ws-dev` 回退到 `$ws-plan`
|
|
78
|
+
- 从 `$ws-finish` 回退到前置门禁而不是硬推完成
|
|
79
|
+
|
|
80
|
+
输出模板:
|
|
81
|
+
- `Root:` <path>
|
|
82
|
+
- `Found:` <files>
|
|
83
|
+
- `Task intent:` <分类>
|
|
84
|
+
- `Binding:` <清晰 / 缺失项>
|
|
85
|
+
- `Route:` <$ws-... 或 clarify>
|
|
86
|
+
- `Why:` <一句到三句>
|
|
87
|
+
- `Next:` <继续执行对应 skill,或提出澄清问题>
|
|
@@ -19,7 +19,33 @@ description: 提交(当前分支可直提;submodule 感知;先审计/门
|
|
|
19
19
|
- 不写入任何 secrets
|
|
20
20
|
- 检测到 submodule 有未提交改动时,不允许直接提交 superproject(先处理 submodule)
|
|
21
21
|
- commit message 优先使用中文(命令/路径/代码标识符保持原样不翻译);格式建议:`<类型>: <简述>`(例如 `修复: 登录页空指针`、`功能: 新增 submodule targets 校验`、`重构: 提取共享脚本`)
|
|
22
|
-
- 若启用了 `.githooks/commit-msg
|
|
22
|
+
- 若启用了 `.githooks/commit-msg`:默认按仓库角色区分
|
|
23
|
+
- superproject / root 仓库(存在 `.gitmodules`)默认允许自由 commit message
|
|
24
|
+
- submodule / 普通仓库默认提示优先中文
|
|
25
|
+
- 只有在 `git config aiws.commitMessagePolicy strict` 时才会拒绝全英文首行(`Merge/Revert/fixup!/squash!` 例外)
|
|
26
|
+
|
|
27
|
+
阶段定位:
|
|
28
|
+
- commit gate;负责在提交前收敛 review、validate 和 message 确认,不允许跳过 hooks。
|
|
29
|
+
|
|
30
|
+
必需输入:
|
|
31
|
+
- 当前分支与 staged diff
|
|
32
|
+
- `$ws-review` 生成的审计证据
|
|
33
|
+
- `aiws validate . --stamp` 生成的校验证据
|
|
34
|
+
- 用户确认后的 commit message
|
|
35
|
+
|
|
36
|
+
必需输出:
|
|
37
|
+
- `证据(Evidence):` review 文件路径 + validate stamp 路径
|
|
38
|
+
- `上下文(Context):` 当前分支、submodule 检测结果、阻断原因(若有)
|
|
39
|
+
- `提交信息(Commit):` 最终提交信息
|
|
40
|
+
|
|
41
|
+
阻断条件:
|
|
42
|
+
- 没有 staged changes
|
|
43
|
+
- submodule 工作区不干净或 detached 处理不完整
|
|
44
|
+
- 用户未确认 commit message
|
|
45
|
+
- validate 失败
|
|
46
|
+
|
|
47
|
+
完成判定:
|
|
48
|
+
- 提交已完成,证据路径明确,且没有通过 `--no-verify` 绕过门禁。
|
|
23
49
|
|
|
24
50
|
执行步骤(建议):
|
|
25
51
|
1) 运行 `$ws-preflight`(确保真值文件就绪)。
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-delegate
|
|
3
|
+
description: 原生多 agent 委托入口(Codex 优先;先定义角色/边界/工件/降级,再决定是否委托)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:在 AIWS 治理约束下,只有在任务已绑定且 scope 可控时,才使用当前工具的原生多 agent / sub-agent 能力;否则明确降级为单 agent + 协同工件模式。
|
|
9
|
+
|
|
10
|
+
阶段定位:
|
|
11
|
+
- implementation / review 的辅助入口;它不是独立 workflow 阶段,也不能绕过 `ws-plan`、`ws-dev`、`ws-review`、`ws-finish`。
|
|
12
|
+
|
|
13
|
+
必需输入:
|
|
14
|
+
- 真值文件:`AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`
|
|
15
|
+
- delegation contract:`packages/spec/docs/workflow-delegation-contracts.md`
|
|
16
|
+
- 当前任务已绑定 `Req_ID` / change / Verify 入口
|
|
17
|
+
- 拟委托子任务的角色划分、读写边界、artifact 目标与 fallback
|
|
18
|
+
|
|
19
|
+
必需输出:
|
|
20
|
+
- `Delegation Plan:` 逐项写清 role / task / readScope / writeScope / artifactTargets / fallback
|
|
21
|
+
- `Execution Mode:` 明确是 `native multi-agent` 还是 `fallback single-agent`
|
|
22
|
+
- `Evidence:` 委托产物路径(`analysis/` / `patches/` / `review/` / `evidence/`)
|
|
23
|
+
- `Next:` 收敛后应回到 `ws-dev`、`ws-review`、`ws-commit` 或 `ws-finish`
|
|
24
|
+
|
|
25
|
+
阻断条件:
|
|
26
|
+
- 无法绑定到 `Req_ID` / change / Verify
|
|
27
|
+
- 没有明确的 `writeScope` / `artifactTargets`
|
|
28
|
+
- 当前工具缺少稳定 native delegation 能力,且你又不能接受降级执行
|
|
29
|
+
- 任务规模太小,引入委托只会增加复杂度
|
|
30
|
+
|
|
31
|
+
完成判定:
|
|
32
|
+
- 已经明确本次是否适合委托
|
|
33
|
+
- 若适合:delegation plan 已声明并执行,产物回收到 AIWS 约定路径
|
|
34
|
+
- 若不适合:已明确降级原因,并回到单 agent 流程继续执行
|
|
35
|
+
|
|
36
|
+
步骤(建议):
|
|
37
|
+
1) 先读取真值文件与 `packages/spec/docs/workflow-delegation-contracts.md`,确认这不是“为了多 agent 而多 agent”。
|
|
38
|
+
2) 判断当前任务是否真的需要委托:
|
|
39
|
+
- 需要并行的只读探索
|
|
40
|
+
- 需要把实现与审查拆开
|
|
41
|
+
- 有明确、互不重叠的写入边界
|
|
42
|
+
- 委托收益大于协调成本
|
|
43
|
+
3) 先写 `Delegation Plan:`,至少包含:
|
|
44
|
+
- `role`
|
|
45
|
+
- `task`
|
|
46
|
+
- `readScope`
|
|
47
|
+
- `writeScope`
|
|
48
|
+
- `artifactTargets`
|
|
49
|
+
- `fallback`
|
|
50
|
+
4) 若当前环境支持原生多 agent:
|
|
51
|
+
- 优先把探索型工作交给 `explorer`
|
|
52
|
+
- 只把显式授权的文件范围交给 `worker`
|
|
53
|
+
- 至少保留一个独立 `reviewer`
|
|
54
|
+
- 由主 agent / `integrator` 统一收敛结果
|
|
55
|
+
5) 若当前环境不支持,或无法稳定约束 scope:
|
|
56
|
+
- 明确输出 `Execution Mode: fallback single-agent`
|
|
57
|
+
- 仍按 AIWS 协同工件约定执行:
|
|
58
|
+
- `changes/<id>/analysis/`
|
|
59
|
+
- `changes/<id>/patches/`
|
|
60
|
+
- `changes/<id>/review/`
|
|
61
|
+
- `changes/<id>/evidence/`
|
|
62
|
+
6) 不论是否启用原生多 agent,都不要跳过:
|
|
63
|
+
- 需求归因
|
|
64
|
+
- 验证命令
|
|
65
|
+
- review convergence
|
|
66
|
+
- finish / handoff gate
|
|
67
|
+
|
|
68
|
+
Codex 优先说明:
|
|
69
|
+
- 若当前环境支持原生多 agent / sub-agent,就按 delegation contract 显式拆 role 与 scope。
|
|
70
|
+
- 若不支持,或你无法保证写边界,直接降级,不临时发明新的 runtime/controller。
|
|
71
|
+
|
|
72
|
+
安全:
|
|
73
|
+
- 不把 `aiws` 变成统一 orchestrator。
|
|
74
|
+
- 不让 delegated agent 越权写未授权文件。
|
|
75
|
+
- 不把 `patches/` 视为“已合并代码”。
|
|
@@ -25,6 +25,28 @@ description: 交付(submodules + superproject 分步提交,并安全合并
|
|
|
25
25
|
- 该 repo 的 `git diff --staged`
|
|
26
26
|
并让用户确认 commit message(每个 repo 单独确认)。
|
|
27
27
|
|
|
28
|
+
阶段定位:
|
|
29
|
+
- delivery 阶段;负责在多 repo / submodule 场景下完成顺序提交、证据收敛和最终合并前准备。
|
|
30
|
+
|
|
31
|
+
必需输入:
|
|
32
|
+
- 当前 `change/<change-id>` 上下文
|
|
33
|
+
- 若存在 submodule:`.gitmodules` + `changes/<change-id>/submodules.targets`
|
|
34
|
+
- 各 repo 当前状态与 staged diff
|
|
35
|
+
|
|
36
|
+
必需输出:
|
|
37
|
+
- `Submodules:` 每个 submodule 的提交摘要
|
|
38
|
+
- `Superproject:` 主仓库提交摘要
|
|
39
|
+
- `Evidence:` validate stamp 与持久证据路径
|
|
40
|
+
- `Next:` 进入 `$ws-finish` 或 `aiws change finish`
|
|
41
|
+
|
|
42
|
+
阻断条件:
|
|
43
|
+
- 不在正确的 change 上下文
|
|
44
|
+
- submodule branch / targets 真值不完整
|
|
45
|
+
- 任一 repo 未确认 commit message 或存在未处理冲突
|
|
46
|
+
|
|
47
|
+
完成判定:
|
|
48
|
+
- submodule 与 superproject 提交都已完成,证据已收敛,且可以安全进入 finish 阶段。
|
|
49
|
+
|
|
28
50
|
建议流程(按顺序):
|
|
29
51
|
|
|
30
52
|
## 0) submodule branch 真值检查(减少 detached 与人为差异)
|
|
@@ -196,10 +218,9 @@ aiws change state "${change_id}" --write
|
|
|
196
218
|
aiws change finish <change-id> --into <base-branch>
|
|
197
219
|
```
|
|
198
220
|
|
|
199
|
-
## F)
|
|
200
|
-
|
|
201
|
-
aiws change archive
|
|
202
|
-
```
|
|
221
|
+
## F) 归档说明
|
|
222
|
+
- 标准链路下不需要再单独执行 `aiws change archive <change-id>`。
|
|
223
|
+
- 进入 `$ws-finish` 并使用 `aiws change finish --push` 时,会自动完成 archive + handoff。
|
|
203
224
|
|
|
204
225
|
输出要求:
|
|
205
226
|
- `Submodules:` 每个 submodule 的分支/提交摘要(repo → commit sha → message)
|
|
@@ -7,6 +7,29 @@ description: 开发(按需求实现并验证;适用于任何需要修改代
|
|
|
7
7
|
|
|
8
8
|
目标:在 AIWS 约束下完成一个可回放、可验证的小步交付。
|
|
9
9
|
|
|
10
|
+
阶段定位:
|
|
11
|
+
- implementation 阶段;负责在既定计划/需求绑定下完成最小实现与验证。
|
|
12
|
+
|
|
13
|
+
必需输入:
|
|
14
|
+
- 真值文件:`AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`
|
|
15
|
+
- 当前任务的归因目标(`Req_ID` 或 `Problem_ID`)
|
|
16
|
+
- 若为 medium/complex:已通过 `$ws-plan` / `$ws-plan-verify` 的计划
|
|
17
|
+
- 当前 `change/<change-id>` 上下文或等价变更归因
|
|
18
|
+
|
|
19
|
+
必需输出:
|
|
20
|
+
- `变更文件(Changed):` 实际改动清单
|
|
21
|
+
- `验证(Verify):` 实际运行的命令与结果说明
|
|
22
|
+
- `证据(Evidence):` `plan/...`、`changes/<change-id>/...`、`.agentdocs/tmp/...` 等证据路径
|
|
23
|
+
- `Next:` 若准备提交,建议 `$ws-review` 或 `$ws-commit`
|
|
24
|
+
|
|
25
|
+
阻断条件:
|
|
26
|
+
- 无法把改动归因到 `REQUIREMENTS.md` 或问题单
|
|
27
|
+
- 没有可复现验证入口
|
|
28
|
+
- 需要创建 change 上下文但当前工作区状态不允许安全切换
|
|
29
|
+
|
|
30
|
+
完成判定:
|
|
31
|
+
- 改动已落盘、验证已执行或明确未执行原因、证据路径可回放,并可进入 review/commit 阶段。
|
|
32
|
+
|
|
10
33
|
建议流程:
|
|
11
34
|
1) 先做 preflight:定位项目根目录,读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`,输出约束摘要。
|
|
12
35
|
- 若是中大型任务:建议先用 `$ws-plan` 生成 `plan/` 工件,再进入实现(便于可回放与对齐验证入口)。
|
|
@@ -117,11 +140,16 @@ cat "${targets}"
|
|
|
117
140
|
```
|
|
118
141
|
- 若你明确要在 superproject 直接切分支:`aiws change start <change-id> --hooks --switch`(仅在存在 `.gitmodules` 时有意义;会尝试让 submodules 工作区跟随 superproject 指针)
|
|
119
142
|
- 或手工:`git switch -c change/<change-id>`,并创建 `changes/<change-id>/proposal.md` 与 `changes/<change-id>/tasks.md`(参考 `changes/README.md`)
|
|
120
|
-
3)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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 也会阻断):
|
|
125
153
|
```bash
|
|
126
154
|
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
127
155
|
./node_modules/.bin/aiws validate .
|
|
@@ -131,7 +159,8 @@ else
|
|
|
131
159
|
npx @aipper/aiws validate .
|
|
132
160
|
fi
|
|
133
161
|
```
|
|
134
|
-
|
|
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 安全合并回目标分支)。
|
|
135
164
|
|
|
136
165
|
输出要求:
|
|
137
166
|
- `变更文件(Changed):` 文件清单
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-dev-lite
|
|
3
|
+
description: 轻量开发(simple/local 单点修复;最小改动 + 最小验证)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:在不引入完整重流程的前提下,完成一次 simple/local 小问题修复,并保持可验证、可追溯。
|
|
9
|
+
|
|
10
|
+
定位:
|
|
11
|
+
- `ws-dev` 的轻量入口,不是新的 workflow stage。
|
|
12
|
+
- 适用于单点修复、局部配置调整、明确回归修复;不适用于中大型任务。
|
|
13
|
+
|
|
14
|
+
适用前提:
|
|
15
|
+
- 目标明确,且能归因到 `Req_ID` 或 `Problem_ID`
|
|
16
|
+
- 验证入口明确,且能做最小可复现验证
|
|
17
|
+
- 一般只影响单文件或紧密相关的小范围文件
|
|
18
|
+
- 不需要先改 `REQUIREMENTS.md`,也不需要先单独做 review
|
|
19
|
+
|
|
20
|
+
立即升级回主流程的情形:
|
|
21
|
+
- 发现任务其实是 medium/complex、跨模块、跨目录或需要方案设计
|
|
22
|
+
- 无法明确归因、verify、change 上下文
|
|
23
|
+
- 需要新建复杂 change/worktree 或处理 submodule 目标分支真值
|
|
24
|
+
- 修复过程中出现连锁改动、需要补系统性测试或需求调整
|
|
25
|
+
|
|
26
|
+
默认约束:
|
|
27
|
+
- 先做 `$ws-preflight`
|
|
28
|
+
- 默认不创建 `plan/...`
|
|
29
|
+
- 默认不跑 `$ws-plan-verify`
|
|
30
|
+
- 默认不要求先做双 review
|
|
31
|
+
- 若后续准备提交/交付,仍需进入 `$ws-review` / `$ws-commit` / `$ws-finish`
|
|
32
|
+
|
|
33
|
+
执行步骤:
|
|
34
|
+
1) 先读取 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`,输出约束摘要。
|
|
35
|
+
2) 先判断自己是否真的属于 lite:
|
|
36
|
+
- 用一句话写清 `Goal`
|
|
37
|
+
- 用一句话写清 `Why lite`
|
|
38
|
+
- 若说不清,立刻回退到 `$ws-dev` 或 `$ws-plan`
|
|
39
|
+
3) 在当前 change 上下文内实施最小改动:
|
|
40
|
+
- 不为“形式完整”额外扩 scope
|
|
41
|
+
- 不默认补与本问题无关的重构或测试矩阵
|
|
42
|
+
4) 运行最小可复现验证:
|
|
43
|
+
- 优先使用 `AI_WORKSPACE.md` 已声明的命令
|
|
44
|
+
- 若只需局部回归,允许运行更窄的验证,但要说明为什么足够
|
|
45
|
+
5) 留下至少一个可追溯证据:
|
|
46
|
+
- 实际改动文件
|
|
47
|
+
- 或 `.agentdocs/tmp/...`
|
|
48
|
+
- 或 `changes/<change-id>/...`
|
|
49
|
+
6) 输出:
|
|
50
|
+
- `变更文件(Changed):`
|
|
51
|
+
- `验证(Verify):`
|
|
52
|
+
- `证据(Evidence):`
|
|
53
|
+
- `Next:` 若准备提交,进入 `$ws-review` 或 `$ws-commit`
|
|
54
|
+
|
|
55
|
+
输出要求:
|
|
56
|
+
- 明确说明为什么这是 lite,而不是完整 `ws-dev`
|
|
57
|
+
- 未运行不声称已运行
|
|
58
|
+
- 一旦发现复杂度升高,立刻停止 lite 叙事,切回 `$ws-dev` 或 `$ws-plan`
|
|
@@ -17,6 +17,30 @@ description: 收尾(门禁 + 安全合并 + submodule→主仓库顺序 push
|
|
|
17
17
|
- 若使用 worktree:在目标分支所在 worktree 执行(`aiws change finish` 会提示正确的 worktree)
|
|
18
18
|
- 若存在 `.gitmodules`:必须为每个 submodule 配置 `submodule.<name>.branch`(否则无法确定性减少 detached;先运行 `$ws-submodule-setup` 并提交 `.gitmodules`)
|
|
19
19
|
|
|
20
|
+
阶段定位:
|
|
21
|
+
- finish 阶段;负责把已提交的 change 安全合并回目标分支,并按约束完成 push / worktree cleanup。
|
|
22
|
+
|
|
23
|
+
必需输入:
|
|
24
|
+
- 干净的当前工作区
|
|
25
|
+
- 已提交完成的 `change/<change-id>`
|
|
26
|
+
- 若存在 submodule:`.gitmodules` 与 `changes/<change-id>/submodules.targets`
|
|
27
|
+
- 当前 push 目标说明(remote / branch)
|
|
28
|
+
|
|
29
|
+
必需输出:
|
|
30
|
+
- `Merge:` `aiws change finish` 的结果(from / into)
|
|
31
|
+
- `Push:` 实际 remote / branch 或未 push 原因
|
|
32
|
+
- `Worktree cleanup:` 清理结果
|
|
33
|
+
- `Evidence:` validate stamp / evidence / state 路径
|
|
34
|
+
|
|
35
|
+
阻断条件:
|
|
36
|
+
- 工作区不干净
|
|
37
|
+
- 缺失 submodule branch / targets 真值
|
|
38
|
+
- fast-forward 失败
|
|
39
|
+
- 子模块目标分支无法安全 push
|
|
40
|
+
|
|
41
|
+
完成判定:
|
|
42
|
+
- change 已安全合并回目标分支,必要的 push 与 worktree cleanup 已完成或明确说明未完成原因。
|
|
43
|
+
|
|
20
44
|
建议步骤:
|
|
21
45
|
0) 若存在 `.gitmodules`,先检查 submodule branch 配置是否齐全(缺失则停止并提示 setup):
|
|
22
46
|
```bash
|
|
@@ -182,15 +206,4 @@ fi
|
|
|
182
206
|
```
|
|
183
207
|
说明:
|
|
184
208
|
- 该命令内部已经包含主仓库 push 成功后安全清理独立 change worktree 的逻辑。
|
|
185
|
-
|
|
186
|
-
7) (可选)归档变更工件(完成交付后推荐):
|
|
187
|
-
```bash
|
|
188
|
-
change_id="<change-id>"
|
|
189
|
-
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
190
|
-
./node_modules/.bin/aiws change archive "${change_id}"
|
|
191
|
-
elif command -v aiws >/dev/null 2>&1; then
|
|
192
|
-
aiws change archive "${change_id}"
|
|
193
|
-
else
|
|
194
|
-
npx @aipper/aiws change archive "${change_id}"
|
|
195
|
-
fi
|
|
196
|
-
```
|
|
209
|
+
- 当 `--push` 完整成功时,还会自动把 `changes/<change-id>/` 归档到 `changes/archive/...`,生成 `handoff.md`,并补一个 `归档: <change-id>` commit。
|