@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,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`
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-finish
|
|
3
|
+
description: 收尾(门禁 + 安全合并 + submodule→主仓库顺序 push)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 在结束一次变更交付时,用 fast-forward 安全合并 `change/<change-id>` 回目标分支,减少手输分支名导致的错误
|
|
10
|
+
- 合并成功后,按 `submodule -> superproject` 顺序 push,避免遗漏导致其它仓库拉取异常
|
|
11
|
+
- 不自动删分支;AI 入口执行前应先向用户说明将要 push 的 remote/branch,显式传入 `--push` 即视为确认
|
|
12
|
+
- 若团队希望减少 submodule detached 的人为差异:建议在 `.gitmodules` 配置 `submodule.<name>.branch`,并在日常拉取时使用 `$ws-pull`
|
|
13
|
+
|
|
14
|
+
前置(必须):
|
|
15
|
+
- 工作区是干净的:`git status --porcelain` 无输出(若有未提交改动:先 commit 或 stash)
|
|
16
|
+
- change 分支已存在:`change/<change-id>`(也支持 `changes/`、`ws/`、`ws-change/`)
|
|
17
|
+
- 若使用 worktree:在目标分支所在 worktree 执行(`aiws change finish` 会提示正确的 worktree)
|
|
18
|
+
- 若存在 `.gitmodules`:必须为每个 submodule 配置 `submodule.<name>.branch`(否则无法确定性减少 detached;先运行 `$ws-submodule-setup` 并提交 `.gitmodules`)
|
|
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
|
+
|
|
44
|
+
建议步骤:
|
|
45
|
+
0) 若存在 `.gitmodules`,先检查 submodule branch 配置是否齐全(缺失则停止并提示 setup):
|
|
46
|
+
```bash
|
|
47
|
+
if [[ -f .gitmodules ]]; then
|
|
48
|
+
missing=0
|
|
49
|
+
while read -r key sub_path; do
|
|
50
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
51
|
+
b="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
|
|
52
|
+
if [[ -z "${b:-}" ]]; then
|
|
53
|
+
echo "error: missing .gitmodules submodule.${name}.branch (path=${sub_path})"
|
|
54
|
+
missing=1
|
|
55
|
+
fi
|
|
56
|
+
done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
|
|
57
|
+
if [[ "$missing" -ne 0 ]]; then
|
|
58
|
+
echo "hint: run $ws-submodule-setup (and commit .gitmodules), then retry"
|
|
59
|
+
exit 2
|
|
60
|
+
fi
|
|
61
|
+
fi
|
|
62
|
+
```
|
|
63
|
+
1) (推荐)先跑一次门禁并落盘证据:
|
|
64
|
+
```bash
|
|
65
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
66
|
+
./node_modules/.bin/aiws validate . --stamp
|
|
67
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
68
|
+
aiws validate . --stamp
|
|
69
|
+
else
|
|
70
|
+
npx @aipper/aiws validate . --stamp
|
|
71
|
+
fi
|
|
72
|
+
```
|
|
73
|
+
1.1) (强烈建议)收敛持久证据并回填 `Evidence_Path`:
|
|
74
|
+
```bash
|
|
75
|
+
change_id="<change-id>"
|
|
76
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
77
|
+
./node_modules/.bin/aiws change evidence "${change_id}"
|
|
78
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
79
|
+
aiws change evidence "${change_id}"
|
|
80
|
+
else
|
|
81
|
+
npx @aipper/aiws change evidence "${change_id}"
|
|
82
|
+
fi
|
|
83
|
+
```
|
|
84
|
+
1.2) (可选)生成状态快照(建议):
|
|
85
|
+
```bash
|
|
86
|
+
aiws change state "${change_id}" --write
|
|
87
|
+
```
|
|
88
|
+
2) 若不存在 `.gitmodules`,或 submodules 已按顺序处理完成,优先直接使用最小收尾闭环:
|
|
89
|
+
```bash
|
|
90
|
+
# 若当前就在 change/<change-id> 分支上,可省略 <change-id>
|
|
91
|
+
change_id="<change-id>"
|
|
92
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
93
|
+
./node_modules/.bin/aiws change finish "${change_id}" --push
|
|
94
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
95
|
+
aiws change finish "${change_id}" --push
|
|
96
|
+
else
|
|
97
|
+
npx @aipper/aiws change finish "${change_id}" --push
|
|
98
|
+
fi
|
|
99
|
+
```
|
|
100
|
+
说明:
|
|
101
|
+
- 该命令会在 fast-forward 合并成功后 push 目标分支。
|
|
102
|
+
- 默认会优先使用当前分支的 upstream 配置(`branch.<name>.remote` + `branch.<name>.merge`);只有在你明确知道要推向别的 remote 时,才追加 `--remote <name>`。
|
|
103
|
+
- 若 `change/<change-id>` 位于独立 worktree,且该 worktree 干净,则会在 push 成功后自动执行 `git worktree remove` + `git worktree prune`。
|
|
104
|
+
- AI 工具内执行前,应先向用户说明将要 push 的 remote/branch;CLI 本身只有在显式传入 `--push` 时才会真正执行 push。
|
|
105
|
+
|
|
106
|
+
3) 若你需要先处理 submodules,则不要依赖当前分支名推断目标分支,先显式解析 `base_branch`,再执行 submodule 步骤,最后回到主仓库执行 `aiws change finish --push`:
|
|
107
|
+
```bash
|
|
108
|
+
change_id="<change-id>"
|
|
109
|
+
base_branch="$(python3 - <<'PY'
|
|
110
|
+
import json, pathlib
|
|
111
|
+
change_id = "<change-id>"
|
|
112
|
+
meta = pathlib.Path("changes") / change_id / ".ws-change.json"
|
|
113
|
+
data = json.loads(meta.read_text(encoding="utf-8"))
|
|
114
|
+
print((data.get("base_branch") or "").strip())
|
|
115
|
+
PY
|
|
116
|
+
)"
|
|
117
|
+
test -n "$base_branch"
|
|
118
|
+
```
|
|
119
|
+
4) 若 fast-forward 失败(提示需要 rebase):先在 change 分支(或对应 worktree)里 `git rebase <target-branch>`,再重试 `aiws change finish --push`。
|
|
120
|
+
5) 若存在 `.gitmodules`,先把每个 submodule 的 gitlink commit 合并回其目标分支(解决 detached HEAD),并按顺序 push:
|
|
121
|
+
```bash
|
|
122
|
+
# 不要用当前分支名代替目标分支;这里显式使用 .ws-change.json 的 base_branch
|
|
123
|
+
change_id="<change-id>"
|
|
124
|
+
targets="changes/${change_id}/submodules.targets"
|
|
125
|
+
|
|
126
|
+
# 子模块清单(没有则跳过)
|
|
127
|
+
git config --file .gitmodules --get-regexp '^submodule\..*\.path$' 2>/dev/null || true
|
|
128
|
+
|
|
129
|
+
# 对每个 submodule.<name>.path <sub_path>:
|
|
130
|
+
# 说明:`git submodule update` 会把 submodule checkout 到固定 gitlink commit,导致 detached HEAD。
|
|
131
|
+
# 为减少游离状态的协作摩擦,本步骤采用 pin 分支策略:
|
|
132
|
+
# - `changes/<change-id>/submodules.targets` 是本次 finish/push 的真值;每个 submodule path 都必须在该文件中声明目标分支(可选 remote)
|
|
133
|
+
# - `.gitmodules` 的 `submodule.<name>.branch` 仍建议保留,用于团队默认配置与校验,但不再作为 finish/push 的 fallback
|
|
134
|
+
# - 生成/检查 `submodules.targets` 时可显式说明默认来源:
|
|
135
|
+
# - detached HEAD:默认建议取 `.gitmodules` 的 `submodule.<name>.branch`
|
|
136
|
+
# - 已附着在某个本地分支:默认建议取当前分支
|
|
137
|
+
# - 以上仅为预填建议;真正执行 finish/push 时仍只认 `submodules.targets`
|
|
138
|
+
# - 不要直接切 `change/<change-id>` / `main` / `master` 等业务分支来解 detached
|
|
139
|
+
# - 不改动 submodule 现有分支指针(例如不强行移动 main/master)
|
|
140
|
+
# - 创建/更新本地 pin 分支:`aiws/pin/<target_branch>` 指向 gitlink commit,并将其 upstream 设为 `origin/<target_branch>`
|
|
141
|
+
if git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' >/dev/null 2>&1; then
|
|
142
|
+
if [[ ! -f "${targets}" ]]; then
|
|
143
|
+
echo "error: missing ${targets} (required when .gitmodules declares submodules)"
|
|
144
|
+
exit 2
|
|
145
|
+
fi
|
|
146
|
+
|
|
147
|
+
source tools/ws_resolve_sub_target.sh
|
|
148
|
+
|
|
149
|
+
while read -r key sub_path; do
|
|
150
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
151
|
+
[[ -z "${sub_path:-}" ]] && continue
|
|
152
|
+
echo "== submodule: ${sub_path} (${name}) =="
|
|
153
|
+
|
|
154
|
+
current_branch="$(git -C "${sub_path}" branch --show-current 2>/dev/null || true)"
|
|
155
|
+
declared_branch="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
|
|
156
|
+
if [[ -n "${current_branch}" ]]; then
|
|
157
|
+
echo "info: ${sub_path} default suggestion would be current branch: ${current_branch}"
|
|
158
|
+
elif [[ -n "${declared_branch}" ]]; then
|
|
159
|
+
echo "info: ${sub_path} default suggestion would be .gitmodules branch: ${declared_branch}"
|
|
160
|
+
else
|
|
161
|
+
echo "warn: ${sub_path} has no current branch and no .gitmodules branch; submodules.targets must be filled manually"
|
|
162
|
+
fi
|
|
163
|
+
|
|
164
|
+
sub_sha="$(git rev-parse "HEAD:${sub_path}")"
|
|
165
|
+
|
|
166
|
+
ws_resolve_sub_target "${sub_path}" "${name}" "${targets}" "${base_branch}" || exit 2
|
|
167
|
+
target_branch="${_resolved_branch}"
|
|
168
|
+
remote="${_resolved_remote}"
|
|
169
|
+
pin_branch="aiws/pin/${target_branch}"
|
|
170
|
+
|
|
171
|
+
git -C "${sub_path}" fetch "${remote}" --prune
|
|
172
|
+
if ! git -C "${sub_path}" show-ref --verify --quiet "refs/remotes/${remote}/${target_branch}"; then
|
|
173
|
+
echo "error: ${sub_path}: missing ${remote}/${target_branch}; refusing to push superproject (would break gitlink fetchability)"
|
|
174
|
+
exit 2
|
|
175
|
+
fi
|
|
176
|
+
|
|
177
|
+
# 仅当 gitlink commit 属于 <remote>/<target_branch> 的历史时才挂回分支
|
|
178
|
+
if ! git -C "${sub_path}" merge-base --is-ancestor "${sub_sha}" "${remote}/${target_branch}"; then
|
|
179
|
+
echo "[warn] ${sub_path}: ${sub_sha} is not in ${remote}/${target_branch}; keep detached and stop (need manual reconcile)"
|
|
180
|
+
exit 1
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
git -C "${sub_path}" checkout -B "${pin_branch}" "${sub_sha}"
|
|
184
|
+
git -C "${sub_path}" branch --set-upstream-to "${remote}/${target_branch}" "${pin_branch}" >/dev/null 2>&1 || true
|
|
185
|
+
git -C "${sub_path}" status -sb
|
|
186
|
+
|
|
187
|
+
# push:只允许 fast-forward(若远端分叉会被拒绝;此时必须人工处理)
|
|
188
|
+
git -C "${sub_path}" push "${remote}" "${sub_sha}:refs/heads/${target_branch}"
|
|
189
|
+
done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
|
|
190
|
+
fi
|
|
191
|
+
```
|
|
192
|
+
规则:
|
|
193
|
+
- 每个 submodule 必须先执行 pin 分支挂回 + fast-forward push,再 push 主仓库。
|
|
194
|
+
- 若任一 submodule 的 gitlink commit 不在 `<remote>/<target_branch>` 历史中:立即停止,先人工处理分叉,再继续。
|
|
195
|
+
|
|
196
|
+
6) 仅当 submodules 全部成功后,再在 superproject 当前分支执行最小收尾闭环:
|
|
197
|
+
```bash
|
|
198
|
+
change_id="<change-id>"
|
|
199
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
200
|
+
./node_modules/.bin/aiws change finish "${change_id}" --push
|
|
201
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
202
|
+
aiws change finish "${change_id}" --push
|
|
203
|
+
else
|
|
204
|
+
npx @aipper/aiws change finish "${change_id}" --push
|
|
205
|
+
fi
|
|
206
|
+
```
|
|
207
|
+
说明:
|
|
208
|
+
- 该命令内部已经包含主仓库 push 成功后安全清理独立 change worktree 的逻辑。
|
|
209
|
+
- 当 `--push` 完整成功时,还会自动把 `changes/<change-id>/` 归档到 `changes/archive/...`,生成 `handoff.md`,并补一个 `归档: <change-id>` commit。
|
|
@@ -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>/...` 或截图/审计路径
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-handoff
|
|
3
|
+
description: 交接(归档后生成/查看 changes/archive/.../handoff.md)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 让 change 的交接信息可回放:`handoff.md`(包含:本次完成/改动文件/关键决策/下一步建议/绑定)
|
|
10
|
+
- 若存在协同工件:在 handoff 中一并概述 `analysis/`、`patches/`、`review/`、`evidence/`
|
|
11
|
+
- 指引在归档与依赖场景下如何使用 handoff
|
|
12
|
+
|
|
13
|
+
说明:
|
|
14
|
+
- `handoff.md` 默认由 `aiws change finish --push` 自动归档时生成:`changes/archive/<date>-<change-id>/handoff.md`
|
|
15
|
+
- `Depends_On` 依赖若已归档,`aiws change start` 会尝试读取依赖的 `handoff.md` 并输出摘要
|
|
16
|
+
|
|
17
|
+
阶段定位:
|
|
18
|
+
- handoff / archive 阶段;负责查看或补充已归档 change 的交接说明。
|
|
19
|
+
|
|
20
|
+
必需输入:
|
|
21
|
+
- 已归档的 `change/<change-id>`
|
|
22
|
+
- 对应 archive 目录
|
|
23
|
+
|
|
24
|
+
必需输出:
|
|
25
|
+
- `Change_ID:` 当前交接对象
|
|
26
|
+
- `Handoff:` `changes/archive/.../handoff.md`
|
|
27
|
+
- `Next:` 推荐后续 change / `Depends_On` 关系
|
|
28
|
+
|
|
29
|
+
阻断条件:
|
|
30
|
+
- 无法定位目标 change
|
|
31
|
+
- `handoff.md` 无法生成或读取
|
|
32
|
+
|
|
33
|
+
完成判定:
|
|
34
|
+
- 下一位协作者可以只依赖 `handoff.md` 和绑定信息继续工作,而不需要回溯整段会话。
|
|
35
|
+
|
|
36
|
+
执行建议:
|
|
37
|
+
1) 先运行 `$ws-preflight`。
|
|
38
|
+
2) 先确认本 change 已通过 `aiws change finish <change-id> --push` 完成自动归档。
|
|
39
|
+
3) 查看 handoff:
|
|
40
|
+
```bash
|
|
41
|
+
change_id="<change-id>"
|
|
42
|
+
ls -1 changes/archive/*-"${change_id}"/handoff.md
|
|
43
|
+
sed -n '1,160p' changes/archive/*-"${change_id}"/handoff.md
|
|
44
|
+
```
|
|
45
|
+
4) 若是历史/异常场景,尚未归档且需要手工恢复,再运行 `aiws change archive <change-id>`。
|
|
46
|
+
5) 若要让后续 change 可接力:在 `proposal.md` 里声明 `Blocks`(下一步建议会据此生成)。
|
|
47
|
+
6) 若本 change 使用了外部 / 子 agent 协作:确认关键结论已经进入 `review/` 或 `evidence/`,避免 handoff 只留下原始 patch/分析文件而没有最终结论。
|
|
48
|
+
|
|
49
|
+
输出要求:
|
|
50
|
+
- `Change_ID:` <change-id>
|
|
51
|
+
- `Handoff:` `changes/archive/.../handoff.md`
|
|
52
|
+
- `Next:` 若还有后续工作,建议创建新 change 并在其 `Depends_On` 引用本 change
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-migrate
|
|
3
|
+
description: 迁移(补齐/升级 AIWS 工作区文件)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出;命令与路径保持原样不翻译。
|
|
7
|
+
|
|
8
|
+
目标:把当前仓库补齐为 aiws workspace 模板,并启用可验证门禁。
|
|
9
|
+
|
|
10
|
+
执行(在项目根目录):
|
|
11
|
+
```bash
|
|
12
|
+
if [[ -f ".aiws/manifest.json" ]]; then
|
|
13
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
14
|
+
./node_modules/.bin/aiws update .
|
|
15
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
16
|
+
aiws update .
|
|
17
|
+
else
|
|
18
|
+
npx @aipper/aiws update .
|
|
19
|
+
fi
|
|
20
|
+
else
|
|
21
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
22
|
+
./node_modules/.bin/aiws init .
|
|
23
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
24
|
+
aiws init .
|
|
25
|
+
else
|
|
26
|
+
npx @aipper/aiws init .
|
|
27
|
+
fi
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
31
|
+
./node_modules/.bin/aiws validate .
|
|
32
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
33
|
+
aiws validate .
|
|
34
|
+
else
|
|
35
|
+
npx @aipper/aiws validate .
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
git config core.hooksPath .githooks
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
回滚(恢复最近一次快照):
|
|
42
|
+
```bash
|
|
43
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
44
|
+
./node_modules/.bin/aiws rollback . latest
|
|
45
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
46
|
+
aiws rollback . latest
|
|
47
|
+
else
|
|
48
|
+
npx @aipper/aiws rollback . latest
|
|
49
|
+
fi
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
约束:
|
|
53
|
+
- 不写入任何 secrets。
|
|
54
|
+
- 不执行破坏性命令。
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ws-plan
|
|
3
|
+
description: 规划(生成可落盘 plan/ 工件;供 ws-dev 执行)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
7
|
+
|
|
8
|
+
目标:
|
|
9
|
+
- 对齐真值文件(`AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`)
|
|
10
|
+
- 若尚未进入本次 change 的工作上下文:先建立 `change/<change-id>` 分支 / worktree,再生成计划
|
|
11
|
+
- 为当前任务生成一份可追踪的执行计划文件:`plan/<timestamp>-<slug>.md`
|
|
12
|
+
- 计划必须包含可复现验证命令(优先引用 `AI_WORKSPACE.md`)
|
|
13
|
+
- 计划必须包含“主索引绑定”:`Change_ID` / (`Req_ID` or `Problem_ID`) / `Contract_Row` / `Plan_File` / `Evidence_Path`
|
|
14
|
+
|
|
15
|
+
约束:
|
|
16
|
+
- 不写入任何 secrets(token、账号、内网端点等不得进入 git)
|
|
17
|
+
- 本 skill 只负责“想清楚怎么做 + 落盘计划”,不要直接大规模改动代码
|
|
18
|
+
- 未运行不声称已运行;验证命令要写清“预期结果”
|
|
19
|
+
- 若存在 `changes/<change-id>/proposal.md`,计划与 proposal 的绑定字段必须保持一致(不一致时先修正再继续)
|
|
20
|
+
|
|
21
|
+
阶段定位:
|
|
22
|
+
- planning 阶段;负责把用户目标收敛为 change 绑定、计划文件和验证入口。
|
|
23
|
+
|
|
24
|
+
必需输入:
|
|
25
|
+
- 当前任务描述
|
|
26
|
+
- 真值文件:`AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`
|
|
27
|
+
- 若已存在:`changes/<change-id>/proposal.md`
|
|
28
|
+
- 若已有计划:当前 `plan/...` 文件
|
|
29
|
+
|
|
30
|
+
必需输出:
|
|
31
|
+
- `Plan file:` 实际写入的 `plan/...`
|
|
32
|
+
- `Change context:` 当前生效的 `change/<change-id>` 分支或 worktree
|
|
33
|
+
- `Bindings:` `Change_ID` / `Req_ID|Problem_ID` / `Contract_Row` / `Plan_File` / `Evidence_Path`
|
|
34
|
+
- `Verify:` 可复现验证命令与预期
|
|
35
|
+
- `Next:` 先 `$ws-plan-verify`,通过后再 `$ws-dev`
|
|
36
|
+
|
|
37
|
+
阻断条件:
|
|
38
|
+
- 任务目标或归因绑定不清晰
|
|
39
|
+
- 当前工作区 dirty 且尚未进入可复用的 change 上下文
|
|
40
|
+
- 无法把计划实际写盘
|
|
41
|
+
|
|
42
|
+
完成判定:
|
|
43
|
+
- 计划已落盘、绑定已同步、验证入口明确,后续实现可以直接按计划推进。
|
|
44
|
+
|
|
45
|
+
执行步骤(建议):
|
|
46
|
+
1) 先运行 `$ws-preflight`(读取真值文件并输出约束摘要)。
|
|
47
|
+
2) 若用户任务描述不清:先问 1-3 个关键澄清问题(不要猜)。
|
|
48
|
+
3) 判断复杂度:`simple / medium / complex`(给出一句理由),并估算步骤数。
|
|
49
|
+
4) 识别或建立主索引 / change 上下文:
|
|
50
|
+
- 若存在 `changes/<change-id>/proposal.md`:读取其中 `Change_ID` / `Req_ID` / `Problem_ID` / `Contract_Row` / `Evidence_Path`
|
|
51
|
+
- 若缺失关键绑定:先补齐 proposal(至少 `Change_ID`、`Req_ID|Problem_ID`、`Contract_Row`)再继续生成计划
|
|
52
|
+
- 若当前不在 `change/<change-id>` 分支 / worktree,且本次任务需要新建 change:先调用 `aiws change start` 建立上下文,再继续写 plan
|
|
53
|
+
- 推荐顺序:
|
|
54
|
+
- 工作区已存在未提交改动:不要先写 `plan/...`;先停下来说明原因,并要求用户先 commit/stash,或改用已有 change 上下文
|
|
55
|
+
- 仓库已有提交:优先创建独立 worktree;若仓库声明了 submodules,加上 `--submodules`
|
|
56
|
+
- 仓库尚无提交 / 不满足 worktree 前置条件:回退为 `--no-switch`
|
|
57
|
+
```bash
|
|
58
|
+
change_id="<change-id>"
|
|
59
|
+
if [[ -n "$(git status --porcelain)" ]]; then
|
|
60
|
+
echo "error: working tree dirty before ws-plan creates change context"
|
|
61
|
+
echo "hint: commit/stash first, or continue inside an existing change/<change-id> context"
|
|
62
|
+
exit 2
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
has_commits=0
|
|
66
|
+
git rev-parse --verify HEAD >/dev/null 2>&1 && has_commits=1
|
|
67
|
+
|
|
68
|
+
has_submodules=0
|
|
69
|
+
if [[ -f .gitmodules ]] && git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' >/dev/null 2>&1; then
|
|
70
|
+
has_submodules=1
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
if [[ "${has_commits}" -eq 1 ]]; then
|
|
74
|
+
if [[ "${has_submodules}" -eq 1 ]]; then
|
|
75
|
+
aiws change start "${change_id}" --hooks --worktree --submodules
|
|
76
|
+
else
|
|
77
|
+
aiws change start "${change_id}" --hooks --worktree
|
|
78
|
+
fi
|
|
79
|
+
else
|
|
80
|
+
aiws change start "${change_id}" --hooks --no-switch
|
|
81
|
+
fi
|
|
82
|
+
```
|
|
83
|
+
- 若上一步创建了 worktree:后续所有读取/写入都必须切到 `aiws change start` 输出的 `worktree:` 路径中进行;不要把 `plan/...` 写回原工作区
|
|
84
|
+
5) 生成计划文件:
|
|
85
|
+
- 文件名:`plan/YYYY-MM-DD_HH-MM-SS-<slug>.md`(`<slug>` 用 kebab-case;同一任务调整计划时尽量复用同一文件)
|
|
86
|
+
- 若 `plan/` 不存在先创建
|
|
87
|
+
- 必须实际写入到磁盘(不要只在对话里输出);如因权限/策略无法写盘,必须明确说明原因并输出可复制的完整内容
|
|
88
|
+
- 计划必须写在当前 active change 上下文内:若当前已进入 `change/<change-id>` worktree,则 `plan/...`、`proposal.md`、`tasks.md` 都应写在该 worktree 中
|
|
89
|
+
6) 计划内容至少包含(不要留空):
|
|
90
|
+
- `Bindings`:`Change_ID` / `Req_ID` / `Problem_ID` / `Contract_Row` / `Plan_File` / `Evidence_Path`
|
|
91
|
+
- `Goal`:要达成什么
|
|
92
|
+
- `Non-goals`:明确不做什么(避免 scope creep)
|
|
93
|
+
- `Scope`:将改动的文件/目录清单(不确定就写 `TBD` 并说明如何确定)
|
|
94
|
+
- `Plan`:分步执行(每步尽量落到具体文件/命令;必要时拆 Phase)
|
|
95
|
+
- `Submodules`(当存在 `.gitmodules` 且声明了 submodule 条目时,强制):声明“本次 change 的 submodule 目标分支真值”(用于同一 superproject 分支内的多渠道交付;也避免仅靠 `.gitmodules` 默认分支导致交付推送到错误分支)
|
|
96
|
+
- `Verify`:可复现命令 + 期望结果(优先引用 `AI_WORKSPACE.md` 的入口;必要时补充 e2e)
|
|
97
|
+
- `Risks & Rollback`:风险点 + 回滚方案(例如 git 回滚、`aiws rollback`、恢复备份等)
|
|
98
|
+
- `Evidence`:计划文件路径;若创建了变更工件则附 `changes/<change-id>/...`
|
|
99
|
+
7) 若存在 change proposal:回填并对齐 `proposal.md` 的 `Plan_File`(必要时同步 `Contract_Row` / `Evidence_Path`),保证 plan/proposal 一致。
|
|
100
|
+
8) 运行 `$ws-plan-verify` 作为执行前质量门(计划不过长、不跑偏、验证可复现)。
|
|
101
|
+
9) 若计划涉及“需求/验收”变更:先用 `$ws-req-review` 评审 → 用户确认后再 `$ws-req-change` 落盘(避免需求漂移)。
|
|
102
|
+
10) 多步任务(≥2 步):后续进入实现时,使用 `update_plan` 工具跟踪 `pending → in_progress → completed`。
|
|
103
|
+
|
|
104
|
+
补充:submodule 目标分支真值(强约束;同一 superproject 分支内可多渠道)
|
|
105
|
+
- 背景:`.gitmodules submodule.<name>.branch` 适合作为“团队默认分支真值”,但当同一 superproject 分支需要在不同交付中选择不同 submodule 目标分支(多渠道)时,仅靠 `.gitmodules` 不足。
|
|
106
|
+
- 强约束:当 `.gitmodules` 声明了 submodule 条目时,门禁会要求本次 change 存在该文件且覆盖所有 submodule path(否则 `aiws validate .` / `aiws change validate --strict` 阻断)。
|
|
107
|
+
- 约定:为本次 change 落盘一个“交付目标分支映射”文件,并在后续 `$ws-dev`/`$ws-deliver`/`$ws-finish` 优先使用它:
|
|
108
|
+
- 文件:`changes/<change-id>/submodules.targets`
|
|
109
|
+
- 格式:每行一个 submodule(忽略空行与 `#` 注释),字段用空白分隔(推荐 `TAB`):
|
|
110
|
+
- 第 1 列:submodule path(例如 `vendor/foo`)
|
|
111
|
+
- 第 2 列:target branch(例如 `release/channel-a`)
|
|
112
|
+
- 第 3 列(可选):remote 名(默认 `origin`)
|
|
113
|
+
- 生成模板(建议在确认 `Change_ID` 后执行;如文件已存在先备份再覆盖):
|
|
114
|
+
```bash
|
|
115
|
+
change_id="<change-id>"
|
|
116
|
+
targets="changes/${change_id}/submodules.targets"
|
|
117
|
+
mkdir -p "changes/${change_id}"
|
|
118
|
+
if [[ -f "${targets}" ]]; then
|
|
119
|
+
bak="${targets}.bak.$(date -u +%Y%m%d-%H%M%SZ)"
|
|
120
|
+
cp "${targets}" "${bak}"
|
|
121
|
+
echo "info: backup: ${bak}"
|
|
122
|
+
fi
|
|
123
|
+
: > "${targets}"
|
|
124
|
+
echo "# path<TAB>target_branch<TAB>remote(optional, default=origin)" >> "${targets}"
|
|
125
|
+
while read -r key sub_path; do
|
|
126
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
127
|
+
b="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
|
|
128
|
+
[[ "${b:-}" == "." ]] && b="$(git branch --show-current)" # '.' means "follow superproject branch"
|
|
129
|
+
printf "%s\t%s\t%s\n" "${sub_path}" "${b:-<fill-me>}" "origin" >> "${targets}"
|
|
130
|
+
done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
|
|
131
|
+
echo "ok: wrote ${targets}"
|
|
132
|
+
```
|
|
133
|
+
- 计划里必须写清:本次交付选择的 `targets` 内容,以及后续在 `$ws-dev` 进入编码前会把 submodules 挂到 `aiws/pin/<target_branch>`(必要时先 `fetch`)。
|
|
134
|
+
|
|
135
|
+
输出要求:
|
|
136
|
+
- `Plan file:` <实际写入的路径>
|
|
137
|
+
- `Change context:` <当前 change 分支或 worktree 路径;若新建了 worktree 需明确写出>
|
|
138
|
+
- `Next:` 推荐下一步(先 `$ws-plan-verify`,通过后再 `$ws-dev`;或 `aiws change start <change-id> --hooks`,superproject + submodule 可用 `--worktree`)
|