@aipper/aiws-spec 0.0.24 → 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-commit/SKILL.md +23 -0
- package/templates/workspace/.agents/skills/ws-delegate/SKILL.md +75 -0
- package/templates/workspace/.agents/skills/ws-deliver/SKILL.md +22 -0
- package/templates/workspace/.agents/skills/ws-dev/SKILL.md +35 -6
- package/templates/workspace/.agents/skills/ws-finish/SKILL.md +24 -0
- 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 +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/.claude/commands/using-aiws.md +24 -0
- 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/.opencode/command/using-aiws.md +29 -0
- package/templates/workspace/.opencode/command/ws-delegate.md +33 -0
- 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 +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 -30
- package/templates/workspace/changes/README.md +18 -0
- package/templates/workspace/changes/templates/proposal.md +15 -0
- package/templates/workspace/changes/templates/tasks.md +9 -2
- package/templates/workspace/manifest.json +277 -2
- package/templates/workspace/tools/ws_change_check.py +26 -4
|
@@ -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。
|
|
20
|
+
- ws-handoff 通常在 archive 后使用,为下一次会话留下交接说明。
|
|
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;Evidence | dirty 工作区;ff 失败;submodule 无法安全 push | ws-handoff 或 archive |
|
|
35
|
+
| `ws-handoff` | 生成可接力的归档交接说明 | 已归档或待归档的 change | changes/archive/.../handoff.md;Next | 无法定位 change;archive 失败;handoff 无法生成 | 新 change 通过 Depends_On 接力 |
|
|
36
|
+
|
|
37
|
+
## 统一规则
|
|
38
|
+
|
|
39
|
+
- 每个阶段都必须回指真值文件或 change 工件,不能只依赖会话上下文。
|
|
40
|
+
- 每个阶段都必须有明确输出,不能只给“建议继续”而不留下工件或证据。
|
|
41
|
+
- 遇到阻断条件时必须停止,不能为了推进速度跳过门禁。
|
|
42
|
+
- 如果一个阶段没有留下可审计路径,它就不算真正完成。
|
|
43
|
+
- `ws-finish` 只有在 merge、push、cleanup 都完成后才算完成;仅本地 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,83 @@
|
|
|
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`
|
|
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
|
+
- 然后在同一轮中继续遵循对应 skill 的契约
|
|
68
|
+
6) 路由约束:
|
|
69
|
+
- router 自己不是实现阶段;不要在给出 route 之前直接改代码
|
|
70
|
+
- 除非用户只想听判断结果,否则给出 route 后应继续按对应 skill 的规则推进
|
|
71
|
+
- 一次只选择一个主 route;不要把 `ws-plan` / `ws-dev` / `ws-review` / `ws-finish` 混成并行终态
|
|
72
|
+
7) 若执行过程中发现复杂度升高:
|
|
73
|
+
- 从 `$ws-dev` 回退到 `$ws-plan`
|
|
74
|
+
- 从 `$ws-finish` 回退到前置门禁而不是硬推完成
|
|
75
|
+
|
|
76
|
+
输出模板:
|
|
77
|
+
- `Root:` <path>
|
|
78
|
+
- `Found:` <files>
|
|
79
|
+
- `Task intent:` <分类>
|
|
80
|
+
- `Binding:` <清晰 / 缺失项>
|
|
81
|
+
- `Route:` <$ws-... 或 clarify>
|
|
82
|
+
- `Why:` <一句到三句>
|
|
83
|
+
- `Next:` <继续执行对应 skill,或提出澄清问题>
|
|
@@ -21,6 +21,29 @@ description: 提交(当前分支可直提;submodule 感知;先审计/门
|
|
|
21
21
|
- commit message 优先使用中文(命令/路径/代码标识符保持原样不翻译);格式建议:`<类型>: <简述>`(例如 `修复: 登录页空指针`、`功能: 新增 submodule targets 校验`、`重构: 提取共享脚本`)
|
|
22
22
|
- 若启用了 `.githooks/commit-msg`:默认会提示优先中文;只有在 `git config aiws.commitMessagePolicy strict` 时才会拒绝全英文首行(`Merge/Revert/fixup!/squash!` 例外)
|
|
23
23
|
|
|
24
|
+
阶段定位:
|
|
25
|
+
- commit gate;负责在提交前收敛 review、validate 和 message 确认,不允许跳过 hooks。
|
|
26
|
+
|
|
27
|
+
必需输入:
|
|
28
|
+
- 当前分支与 staged diff
|
|
29
|
+
- `$ws-review` 生成的审计证据
|
|
30
|
+
- `aiws validate . --stamp` 生成的校验证据
|
|
31
|
+
- 用户确认后的 commit message
|
|
32
|
+
|
|
33
|
+
必需输出:
|
|
34
|
+
- `证据(Evidence):` review 文件路径 + validate stamp 路径
|
|
35
|
+
- `上下文(Context):` 当前分支、submodule 检测结果、阻断原因(若有)
|
|
36
|
+
- `提交信息(Commit):` 最终提交信息
|
|
37
|
+
|
|
38
|
+
阻断条件:
|
|
39
|
+
- 没有 staged changes
|
|
40
|
+
- submodule 工作区不干净或 detached 处理不完整
|
|
41
|
+
- 用户未确认 commit message
|
|
42
|
+
- validate 失败
|
|
43
|
+
|
|
44
|
+
完成判定:
|
|
45
|
+
- 提交已完成,证据路径明确,且没有通过 `--no-verify` 绕过门禁。
|
|
46
|
+
|
|
24
47
|
执行步骤(建议):
|
|
25
48
|
1) 运行 `$ws-preflight`(确保真值文件就绪)。
|
|
26
49
|
2) 运行 `$ws-review`(优先生成审计证据:`changes/<change-id>/review/codex-review.md`;无 `change-id` 时回退 `.agentdocs/tmp/review/codex-review.md`)。
|
|
@@ -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 与人为差异)
|
|
@@ -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):` 文件清单
|
|
@@ -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
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-frontend-design
|
|
3
|
+
description: 前端设计实现(用于视觉型 landing page / 网站 / 应用界面 / demo / prototype;强调构图、层级、图像、动效与克制,不做通用卡片墙)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 在 AIWS 约束下交付一个可运行、可验证、视觉方向明确的前端界面
|
|
10
|
+
- 先做信息层级与构图,再做组件细节;避免“先堆卡片再补样式”
|
|
11
|
+
- 在品牌页与产品页之间做正确取舍:品牌页重视觉锚点,产品页重可操作性
|
|
12
|
+
|
|
13
|
+
非目标(强制):
|
|
14
|
+
- 不绕过 `$ws-preflight`、`REQUIREMENTS.md`、`AI_WORKSPACE.md`
|
|
15
|
+
- 不因为“追求设计感”而重写无关页面、改动无关设计系统或新增大面积依赖
|
|
16
|
+
- 不默认把已有产品后台改成营销页;dashboard / admin / workspace 优先 utility copy
|
|
17
|
+
- 不把 prompt 语言、设计说明、占位废话直接写进 UI
|
|
18
|
+
|
|
19
|
+
适用场景:
|
|
20
|
+
- 用户要做 landing page、品牌站、活动页、marketing 页面、demo、prototype、game UI
|
|
21
|
+
- 用户要把现有前端界面做成“视觉主导、层级清晰、记忆点强”的版本
|
|
22
|
+
- 用户明确要求美化、重做、提质、增强 art direction / hierarchy / motion
|
|
23
|
+
|
|
24
|
+
前置(建议顺序):
|
|
25
|
+
1) 先运行 `$ws-preflight`。
|
|
26
|
+
2) 判断任务类型(必须选一个):
|
|
27
|
+
- `landing`:品牌/营销/活动页
|
|
28
|
+
- `app-ui`:dashboard / admin / workspace / 工具界面
|
|
29
|
+
- `polish-only`:不改信息架构,只做视觉提质
|
|
30
|
+
3) 判断设计边界(必须说明):
|
|
31
|
+
- `net-new`:全新页面,可建立完整视觉语言
|
|
32
|
+
- `existing-system`:已有设计系统/品牌规范,优先复用
|
|
33
|
+
4) 若任务达到 medium / complex:先用 `$ws-plan` 落盘计划,再进入实现。
|
|
34
|
+
|
|
35
|
+
开始编码前,先写三项(不要跳过):
|
|
36
|
+
- `Visual thesis:` 一句话写清 mood / material / energy
|
|
37
|
+
- `Content plan:` `hero -> support -> detail -> final CTA`(若是 app-ui,则改为 `workspace -> nav -> context -> action`)
|
|
38
|
+
- `Interaction thesis:` 2-3 个动效想法;说明它们如何改善层级/氛围/可感知性
|
|
39
|
+
|
|
40
|
+
设计默认值:
|
|
41
|
+
- 从构图开始,不从组件库开始
|
|
42
|
+
- 第一屏优先做成海报感(poster),不是文档感(document)
|
|
43
|
+
- 默认先找一个强视觉锚点:大图、主视觉平面、关键产品画面、主数据工作区
|
|
44
|
+
- 默认不做卡片墙;优先 section、column、divider、media block、list、plain layout
|
|
45
|
+
- 默认最多两套字体、一种强调色;若已有品牌系统,优先跟随现有 token
|
|
46
|
+
- 优先靠留白、尺度、裁切、对比、对齐建立层级,再考虑装饰
|
|
47
|
+
|
|
48
|
+
landing 规则:
|
|
49
|
+
1) 默认结构:
|
|
50
|
+
- Hero:品牌/产品名、承诺、CTA、一个主视觉
|
|
51
|
+
- Support:一个具体能力 / 证明点 / offer
|
|
52
|
+
- Detail:氛围、流程、产品深度或故事
|
|
53
|
+
- Final CTA:开始、注册、联系、访问
|
|
54
|
+
2) Hero 强约束:
|
|
55
|
+
- 一个 section 只承载一个 dominant idea
|
|
56
|
+
- 默认使用 full-bleed hero;只有内层文字列需要约束宽度
|
|
57
|
+
- 品牌名优先级高于 headline;headline 高于 body;body 高于 CTA
|
|
58
|
+
- 默认不要 hero cards、stat strips、logo clouds、pill soup、floating dashboards
|
|
59
|
+
- headline 在 desktop 约 2-3 行;mobile 一眼读完
|
|
60
|
+
- 若有固定 header,它占用首屏预算;不要让 header + hero 超出初始 viewport
|
|
61
|
+
- 若去掉主视觉后首屏仍几乎成立,说明图像太弱
|
|
62
|
+
|
|
63
|
+
app-ui 规则:
|
|
64
|
+
- 默认偏克制:少颜色、少 chrome、清晰栅格、密度适中、信息可扫读
|
|
65
|
+
- 优先组织为:`primary workspace -> navigation -> secondary context/inspector -> action`
|
|
66
|
+
- 只有当 card 本身就是交互容器时才用 card;否则尽量改回 plain layout
|
|
67
|
+
- 不要把 routine product UI 做成营销落地页
|
|
68
|
+
- 文案优先 orientation / status / action:
|
|
69
|
+
- 好例子:`Selected KPIs`、`Plan status`、`Last sync`
|
|
70
|
+
- 差例子:首页口号、情绪化隐喻、执行摘要横幅
|
|
71
|
+
|
|
72
|
+
图像与媒体:
|
|
73
|
+
- 图像必须承担叙事任务,不能只是补背景
|
|
74
|
+
- 品牌页/空间页/生活方式产品优先真实感强的图,而不是抽象 3D / 假 dashboard
|
|
75
|
+
- 选图时优先有稳定明暗区,便于文字落位
|
|
76
|
+
- 避免图里自带抢戏的 logo、signage、碎字、边框 UI
|
|
77
|
+
- 若需要多个场景,优先多张图,不要拼贴大杂烩
|
|
78
|
+
|
|
79
|
+
文案:
|
|
80
|
+
- 用产品语言,不用设计评论语言
|
|
81
|
+
- headline 负责主要意义;supporting copy 通常一句话够了
|
|
82
|
+
- 每个 section 只负责一件事:explain / prove / deepen / convert
|
|
83
|
+
- 如果删掉 30% 文案后更清楚,就继续删
|
|
84
|
+
|
|
85
|
+
动效:
|
|
86
|
+
- 视觉型页面至少给 2-3 个“有感但克制”的动效:
|
|
87
|
+
- 一个 hero 入场序列
|
|
88
|
+
- 一个 scroll-linked / sticky / depth 效果
|
|
89
|
+
- 一个 hover / reveal / layout transition
|
|
90
|
+
- 动效必须改善层级或氛围,不能只是热闹
|
|
91
|
+
- 要兼顾 mobile 流畅度;支持 `prefers-reduced-motion`
|
|
92
|
+
|
|
93
|
+
工程约束(强制):
|
|
94
|
+
- 先读现有代码,再决定是否沿用已有 design tokens / 组件 / 动效库
|
|
95
|
+
- `existing-system` 场景下,优先复用已有视觉语言;不要无故“整站改头换面”
|
|
96
|
+
- 不新增字体、图片资源、动画库、运行时依赖,除非明确写出原因、来源、license/成本与回滚方式
|
|
97
|
+
- 所有文字覆盖在图像上时,必须保证对比度与点击区域可用
|
|
98
|
+
- 必须同时考虑 desktop / mobile;不要只调一个 viewport
|
|
99
|
+
- 未运行不声称已运行;验证命令优先引用 `AI_WORKSPACE.md`
|
|
100
|
+
|
|
101
|
+
硬规则:
|
|
102
|
+
- No cards by default
|
|
103
|
+
- No hero cards by default
|
|
104
|
+
- No generic SaaS card grid as first impression
|
|
105
|
+
- No more than one dominant idea per section
|
|
106
|
+
- No more than two typefaces without a clear reason
|
|
107
|
+
- No more than one accent color unless the existing product already has a strong system
|
|
108
|
+
- No decorative gradients behind routine product UI
|
|
109
|
+
- No busy imagery behind text
|
|
110
|
+
- No filler copy
|
|
111
|
+
|
|
112
|
+
实现检查(交付前自检):
|
|
113
|
+
- 第一屏能否一眼看出品牌/产品是什么
|
|
114
|
+
- 是否存在一个明确视觉锚点
|
|
115
|
+
- 只扫标题是否能理解页面
|
|
116
|
+
- 每个 section 是否只有一个职责
|
|
117
|
+
- card 是否真有必要
|
|
118
|
+
- 动效是否真的提升层级/氛围
|
|
119
|
+
- 去掉装饰阴影后,页面是否仍然成立
|
|
120
|
+
|
|
121
|
+
输出要求:
|
|
122
|
+
- `Mode:` `landing | app-ui | polish-only`
|
|
123
|
+
- `Visual thesis:` 一句话
|
|
124
|
+
- `Changed:` 改动文件清单
|
|
125
|
+
- `Verify:` 实际运行命令 + 预期结果
|
|
126
|
+
- `Evidence:` 相关 `plan/...`、`changes/<change-id>/...` 或截图/审计路径
|
|
@@ -7,12 +7,33 @@ description: 交接(归档后生成/查看 changes/archive/.../handoff.md)
|
|
|
7
7
|
|
|
8
8
|
目标:
|
|
9
9
|
- 让 change 的交接信息可回放:`handoff.md`(包含:本次完成/改动文件/关键决策/下一步建议/绑定)
|
|
10
|
+
- 若存在协同工件:在 handoff 中一并概述 `analysis/`、`patches/`、`review/`、`evidence/`
|
|
10
11
|
- 指引在归档与依赖场景下如何使用 handoff
|
|
11
12
|
|
|
12
13
|
说明:
|
|
13
14
|
- `handoff.md` 由 `aiws change archive` 自动生成:`changes/archive/<date>-<change-id>/handoff.md`
|
|
14
15
|
- `Depends_On` 依赖若已归档,`aiws change start` 会尝试读取依赖的 `handoff.md` 并输出摘要
|
|
15
16
|
|
|
17
|
+
阶段定位:
|
|
18
|
+
- handoff / archive 阶段;负责把已完成 change 的上下文压缩成后续协作者可直接接手的说明。
|
|
19
|
+
|
|
20
|
+
必需输入:
|
|
21
|
+
- 当前或已归档的 `change/<change-id>`
|
|
22
|
+
- 对应 archive 目录或准备归档的 change 工件
|
|
23
|
+
|
|
24
|
+
必需输出:
|
|
25
|
+
- `Change_ID:` 当前交接对象
|
|
26
|
+
- `Handoff:` `changes/archive/.../handoff.md`
|
|
27
|
+
- `Next:` 推荐后续 change / `Depends_On` 关系
|
|
28
|
+
|
|
29
|
+
阻断条件:
|
|
30
|
+
- 无法定位目标 change
|
|
31
|
+
- 未归档且无法执行 `aiws change archive <change-id>`
|
|
32
|
+
- `handoff.md` 无法生成或读取
|
|
33
|
+
|
|
34
|
+
完成判定:
|
|
35
|
+
- 下一位协作者可以只依赖 `handoff.md` 和绑定信息继续工作,而不需要回溯整段会话。
|
|
36
|
+
|
|
16
37
|
执行建议:
|
|
17
38
|
1) 先运行 `$ws-preflight`。
|
|
18
39
|
2) 若本 change 已完成并准备归档:运行 `aiws change archive <change-id>`(会先做严格校验,并移动目录到 `changes/archive/`,同时生成 `handoff.md`)。
|
|
@@ -23,9 +44,9 @@ ls -1 changes/archive/*-"${change_id}"/handoff.md
|
|
|
23
44
|
sed -n '1,160p' changes/archive/*-"${change_id}"/handoff.md
|
|
24
45
|
```
|
|
25
46
|
4) 若要让后续 change 可接力:在 `proposal.md` 里声明 `Blocks`(下一步建议会据此生成)。
|
|
47
|
+
5) 若本 change 使用了外部 / 子 agent 协作:确认关键结论已经进入 `review/` 或 `evidence/`,避免 handoff 只留下原始 patch/分析文件而没有最终结论。
|
|
26
48
|
|
|
27
49
|
输出要求:
|
|
28
50
|
- `Change_ID:` <change-id>
|
|
29
51
|
- `Handoff:` `changes/archive/.../handoff.md`
|
|
30
52
|
- `Next:` 若还有后续工作,建议创建新 change 并在其 `Depends_On` 引用本 change
|
|
31
|
-
|