@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,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 交接:查看归档 change 的 handoff.md(标准由 aiws change finish --push 自动归档生成)
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-handoff -->
|
|
5
|
+
# ws handoff
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:
|
|
10
|
+
- 交接与回放:通过 `handoff.md` 让已归档的 change 可被下一位/下一次会话快速接力。
|
|
11
|
+
- handoff 文件位置:`changes/archive/<date>-<change-id>/handoff.md`(默认由 `aiws change finish --push` 自动归档时生成)。
|
|
12
|
+
|
|
13
|
+
执行建议:
|
|
14
|
+
1) 先确认 change 已通过 `/ws-finish` 或 `aiws change finish --push` 完成自动归档。
|
|
15
|
+
2) 查看 handoff:
|
|
16
|
+
```bash
|
|
17
|
+
change_id="<change-id>"
|
|
18
|
+
ls -1 changes/archive/*-"${change_id}"/handoff.md
|
|
19
|
+
sed -n '1,160p' changes/archive/*-"${change_id}"/handoff.md
|
|
20
|
+
```
|
|
21
|
+
3) 依赖提示:
|
|
22
|
+
- 若你在某个 change 的 `proposal.md` 声明了 `Depends_On`,`aiws change start` 会尝试读取依赖 change 的 `handoff.md` 并输出摘要(前提:依赖已归档且 handoff 存在)。
|
|
23
|
+
- 若是历史/异常场景尚未归档,再手工运行 `/p-aiws-change-archive`。
|
|
24
|
+
<!-- AIWS_MANAGED_END:opencode:ws-handoff -->
|
|
25
|
+
|
|
26
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 迁移:把仓库对齐到 aiws workspace 模板
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-migrate -->
|
|
5
|
+
# ws migrate
|
|
6
|
+
|
|
7
|
+
用中文输出;命令与路径保持原样不翻译。
|
|
8
|
+
|
|
9
|
+
目标:把当前仓库补齐为 aiws workspace 模板,并启用可验证门禁。
|
|
10
|
+
|
|
11
|
+
执行(在项目根目录):
|
|
12
|
+
1) 若已存在 `.aiws/manifest.json`:`npx @aipper/aiws update .`
|
|
13
|
+
2) 否则:`npx @aipper/aiws init .`
|
|
14
|
+
3) 门禁校验:`npx @aipper/aiws validate .`
|
|
15
|
+
4) 启用本机 git hooks(推荐,本地生效):`git config core.hooksPath .githooks`
|
|
16
|
+
|
|
17
|
+
回滚:
|
|
18
|
+
- 恢复最近一次快照:`npx @aipper/aiws rollback . latest`
|
|
19
|
+
|
|
20
|
+
约束:
|
|
21
|
+
- 不写入任何 secrets。
|
|
22
|
+
- 不执行破坏性命令。
|
|
23
|
+
<!-- AIWS_MANAGED_END:opencode:ws-migrate -->
|
|
24
|
+
|
|
25
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 计划质检:执行前检查并给出最小修正项
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-plan-verify -->
|
|
5
|
+
# ws plan verify
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:
|
|
10
|
+
- 执行前检查计划是否跑偏,并给出最小修正项。
|
|
11
|
+
|
|
12
|
+
执行建议:
|
|
13
|
+
1) 先运行 `/ws-preflight`。
|
|
14
|
+
2) 运行严格门禁:
|
|
15
|
+
```bash
|
|
16
|
+
if [[ -x "./node_modules/.bin/aiws" ]]; then
|
|
17
|
+
./node_modules/.bin/aiws change validate <change-id> --strict
|
|
18
|
+
elif command -v aiws >/dev/null 2>&1; then
|
|
19
|
+
aiws change validate <change-id> --strict
|
|
20
|
+
else
|
|
21
|
+
npx @aipper/aiws change validate <change-id> --strict
|
|
22
|
+
fi
|
|
23
|
+
```
|
|
24
|
+
3) 若失败:先修 `proposal.md` / `plan` 的绑定字段与验证命令,再复跑。
|
|
25
|
+
4) 通过后再进入 `/ws-dev`。
|
|
26
|
+
<!-- AIWS_MANAGED_END:opencode:ws-plan-verify -->
|
|
27
|
+
|
|
28
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 规划:生成可落盘 plan 工件
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-plan -->
|
|
5
|
+
# ws plan
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:
|
|
10
|
+
- 若尚未进入本次 change 的工作上下文:先建立 `change/<change-id>` 分支 / worktree,再生成可落盘执行计划(供 /ws-dev 执行)。
|
|
11
|
+
|
|
12
|
+
执行建议:
|
|
13
|
+
1) 先运行 `/ws-preflight`(对齐 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md`)。
|
|
14
|
+
- 若检测到 `.opencode/oh-my-opencode.json` 或当前会话明确可用 `planner-sisyphus` / `explore` / `librarian`:优先按 `packages/spec/docs/opencode-omo-adapter.md` 借用这些 agent。
|
|
15
|
+
- 计划主框架优先 `planner-sisyphus`;结构探索优先 `@explore`;规范/文档查证优先 `@librarian`。
|
|
16
|
+
2) 若当前不在 `change/<change-id>` 分支 / worktree,先调用 `aiws change start <change-id>` 建立上下文:
|
|
17
|
+
- 仓库已有提交:优先 `aiws change start <change-id> --hooks --worktree`;若声明了 submodules,加 `--submodules`
|
|
18
|
+
- 仓库尚无提交 / 不满足 worktree 前置条件:回退 `aiws change start <change-id> --hooks --no-switch`
|
|
19
|
+
3) 若上一步创建了 worktree:切到输出的 `worktree:` 路径,后续所有计划文件都写在该 worktree 中。
|
|
20
|
+
4) 生成或更新计划文件:`plan/YYYY-MM-DD_HH-MM-SS-<slug>.md`。
|
|
21
|
+
5) 计划至少包含:`Bindings`、`Goal`、`Non-goals`、`Scope`、`Plan`、`Verify`、`Risks & Rollback`、`Evidence`。
|
|
22
|
+
6) 若已有 `changes/<change-id>/proposal.md`,对齐 `Plan_File` / `Contract_Row` / `Evidence_Path`。
|
|
23
|
+
7) 完成后先运行 `/ws-plan-verify`,通过再进入 `/ws-dev`。
|
|
24
|
+
8) 若 oMo 不可用:回退为普通 OpenCode `plan` / 当前 agent 本地规划,但仍必须落盘完整 `plan/...`。
|
|
25
|
+
<!-- AIWS_MANAGED_END:opencode:ws-plan -->
|
|
26
|
+
|
|
27
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 预检:读取真值文件并输出约束摘要
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-preflight -->
|
|
5
|
+
# ws preflight
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:在开始任何“写代码/改配置/落盘文件”之前,对齐工作区真值文件,避免规则漂移。
|
|
10
|
+
|
|
11
|
+
执行步骤(强制):
|
|
12
|
+
1) 定位项目根目录:
|
|
13
|
+
- 优先:`git rev-parse --show-toplevel`
|
|
14
|
+
- 若失败:停止并让用户确认当前目录是否为项目根(不要猜测)。
|
|
15
|
+
2) 在项目根目录读取以下文件(存在则必须读取;缺失则明确报告缺失项,不要臆测内容):
|
|
16
|
+
- `AI_PROJECT.md`
|
|
17
|
+
- `REQUIREMENTS.md`
|
|
18
|
+
- `AI_WORKSPACE.md`
|
|
19
|
+
3) 输出:
|
|
20
|
+
- `Root:` <项目根路径>
|
|
21
|
+
- `Found:` <实际读取到的文件列表>
|
|
22
|
+
- `Missing:` <缺失文件列表>
|
|
23
|
+
- `OpenCode mode:`
|
|
24
|
+
- 若检测到 `.opencode/oh-my-opencode.json`:`oMo-enabled`
|
|
25
|
+
- 否则:`standard-opencode`
|
|
26
|
+
- 若为 `oMo-enabled`:附一句说明后续 `ws-plan` / `ws-review` / `ws-spec-review` / `ws-quality-review` / `ws-delegate` 会优先借用 oMo agent
|
|
27
|
+
- `Key rules:` 3–8 条 bullet(范围/禁止项/必须产物/必须验证命令)
|
|
28
|
+
|
|
29
|
+
安全:
|
|
30
|
+
- 不打印 secrets;遇到疑似敏感值只提示“存在风险”但不要复述原文。
|
|
31
|
+
- 不执行破坏性命令。
|
|
32
|
+
<!-- AIWS_MANAGED_END:opencode:ws-preflight -->
|
|
33
|
+
|
|
34
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 拉取:fast-forward 拉取并对齐 submodules(尽量避免 detached)
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-pull -->
|
|
5
|
+
# ws pull
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:安全拉取 superproject,并对齐 submodules,尽量把 submodule 从 detached HEAD “挂回”分支(仅当该分支包含 gitlink commit),减少人为操作差异。
|
|
10
|
+
|
|
11
|
+
安全约束(强制):
|
|
12
|
+
- 不执行破坏性命令;不自动提交/不自动 push
|
|
13
|
+
- 若工作区不干净:停止并要求用户先 commit 或 stash
|
|
14
|
+
- `git pull` 默认只允许 fast-forward(避免隐式 merge/rebase)
|
|
15
|
+
|
|
16
|
+
步骤(建议):
|
|
17
|
+
1) 输出上下文并检查工作区干净:
|
|
18
|
+
```bash
|
|
19
|
+
git rev-parse --show-toplevel
|
|
20
|
+
git branch --show-current
|
|
21
|
+
git status --porcelain
|
|
22
|
+
```
|
|
23
|
+
若 `git status --porcelain` 非空:停止。
|
|
24
|
+
|
|
25
|
+
2) 拉取 superproject(fast-forward only):
|
|
26
|
+
```bash
|
|
27
|
+
git pull --ff-only
|
|
28
|
+
```
|
|
29
|
+
若失败:停止并说明需要用户明确选择 `git pull --rebase` 或手动处理。
|
|
30
|
+
|
|
31
|
+
3) 更新 submodules 到 superproject 记录的 gitlink commit:
|
|
32
|
+
```bash
|
|
33
|
+
if [[ -f .gitmodules ]]; then
|
|
34
|
+
git submodule sync --recursive
|
|
35
|
+
git submodule update --init --recursive
|
|
36
|
+
else
|
|
37
|
+
echo "[info] no .gitmodules"
|
|
38
|
+
fi
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
4) (可选但推荐)把 submodule 从 detached HEAD 尽量“挂回分支”(不改动 gitlink commit):
|
|
42
|
+
为避免 origin 多分支时“猜错分支”,本步骤只在 `.gitmodules` 明确配置了 `submodule.<name>.branch` 时才执行;否则保持 detached 并提示先运行 `/ws-submodule-setup` 对齐配置。
|
|
43
|
+
```bash
|
|
44
|
+
if [[ -f .gitmodules ]]; then
|
|
45
|
+
base_branch="$(git branch --show-current)"
|
|
46
|
+
git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null \
|
|
47
|
+
| while read -r key sub_path; do
|
|
48
|
+
[[ -z "${sub_path:-}" ]] && continue
|
|
49
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
50
|
+
echo "== submodule: ${sub_path} (${name}) =="
|
|
51
|
+
sub_sha="$(git rev-parse "HEAD:${sub_path}" 2>/dev/null || true)"
|
|
52
|
+
[[ -z "${sub_sha:-}" ]] && { echo "[warn] no gitlink sha"; continue; }
|
|
53
|
+
|
|
54
|
+
cfg_branch="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
|
|
55
|
+
if [[ "${cfg_branch:-}" == "." ]]; then cfg_branch="$base_branch"; fi
|
|
56
|
+
if [[ -z "${cfg_branch:-}" ]]; then
|
|
57
|
+
echo "[warn] ${sub_path}: missing .gitmodules submodule.${name}.branch; keep detached (run ws-submodule-setup)"
|
|
58
|
+
continue
|
|
59
|
+
fi
|
|
60
|
+
target_branch="${cfg_branch}"
|
|
61
|
+
pin_branch="aiws/pin/${target_branch}"
|
|
62
|
+
|
|
63
|
+
git -C "${sub_path}" fetch origin --prune || true
|
|
64
|
+
if git -C "${sub_path}" show-ref --verify --quiet "refs/remotes/origin/${target_branch}"; then
|
|
65
|
+
if git -C "${sub_path}" merge-base --is-ancestor "${sub_sha}" "origin/${target_branch}"; then
|
|
66
|
+
git -C "${sub_path}" checkout -B "${pin_branch}" "${sub_sha}"
|
|
67
|
+
git -C "${sub_path}" branch --set-upstream-to "origin/${target_branch}" "${pin_branch}" >/dev/null 2>&1 || true
|
|
68
|
+
echo "[ok] attached ${sub_path} to ${pin_branch} (upstream=origin/${target_branch}) at ${sub_sha}"
|
|
69
|
+
else
|
|
70
|
+
echo "[warn] ${sub_path}: ${sub_sha} is not in origin/${target_branch}; keep detached"
|
|
71
|
+
fi
|
|
72
|
+
else
|
|
73
|
+
echo "[warn] ${sub_path}: origin/${target_branch} not found; keep detached"
|
|
74
|
+
fi
|
|
75
|
+
done
|
|
76
|
+
fi
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
可选(方案 2,一次性设置 submodule 跟踪分支,会改 `.gitmodules`,需提交):
|
|
80
|
+
```bash
|
|
81
|
+
git submodule set-branch --branch main <sub_path>
|
|
82
|
+
git add .gitmodules
|
|
83
|
+
git commit -m "chore(submodule): set tracking branch"
|
|
84
|
+
```
|
|
85
|
+
<!-- AIWS_MANAGED_END:opencode:ws-pull -->
|
|
86
|
+
|
|
87
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 推送:submodule 感知(先 submodules 后 superproject;fast-forward;不 force)
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-push -->
|
|
5
|
+
# ws push
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:安全 push 当前仓库;若仓库包含 submodules,则先 push submodules,再 push superproject(默认 fast-forward;不 force)。
|
|
10
|
+
|
|
11
|
+
强制约束:
|
|
12
|
+
- 不自动提交、不自动 `git add -A`
|
|
13
|
+
- 不使用 `--force` / `--force-with-lease`
|
|
14
|
+
- 若工作区不干净:停止并要求先 commit 或 stash
|
|
15
|
+
|
|
16
|
+
步骤(建议):
|
|
17
|
+
1) 输出上下文并检查工作区干净:
|
|
18
|
+
```bash
|
|
19
|
+
git branch --show-current
|
|
20
|
+
git status --porcelain
|
|
21
|
+
git status -sb
|
|
22
|
+
```
|
|
23
|
+
若 `git status --porcelain` 非空:停止。
|
|
24
|
+
|
|
25
|
+
2) 判断是否存在 submodules:
|
|
26
|
+
```bash
|
|
27
|
+
if [[ -f .gitmodules ]]; then
|
|
28
|
+
git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' || true
|
|
29
|
+
fi
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
3) 若没有 submodules:正常 push(仍需用户确认远端/分支):
|
|
33
|
+
```bash
|
|
34
|
+
git remote -v
|
|
35
|
+
git push
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
4) 若有 submodules:先检查 `.gitmodules` 的 `submodule.<name>.branch` 是否齐全(缺失则停止并提示 `/ws-submodule-setup`):
|
|
39
|
+
```bash
|
|
40
|
+
missing=0
|
|
41
|
+
while read -r key sub_path; do
|
|
42
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
43
|
+
b="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
|
|
44
|
+
if [[ -z "${b:-}" ]]; then
|
|
45
|
+
echo "error: missing .gitmodules submodule.${name}.branch (path=${sub_path})"
|
|
46
|
+
missing=1
|
|
47
|
+
fi
|
|
48
|
+
done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null || true)
|
|
49
|
+
if [[ "$missing" -ne 0 ]]; then
|
|
50
|
+
echo "hint: run /ws-submodule-setup (and commit .gitmodules), then retry"
|
|
51
|
+
exit 2
|
|
52
|
+
fi
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
5) 逐个 push submodules(fast-forward only),再 push superproject:
|
|
56
|
+
```bash
|
|
57
|
+
base_branch="$(git branch --show-current)"
|
|
58
|
+
|
|
59
|
+
git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$' 2>/dev/null \
|
|
60
|
+
| while read -r key sub_path; do
|
|
61
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
62
|
+
echo "== submodule: ${sub_path} (${name}) =="
|
|
63
|
+
|
|
64
|
+
if [[ -n "$(git -C "${sub_path}" status --porcelain 2>/dev/null || true)" ]]; then
|
|
65
|
+
echo "error: submodule dirty: ${sub_path}"
|
|
66
|
+
exit 2
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
cfg_branch="$(git config --file .gitmodules --get "submodule.${name}.branch" 2>/dev/null || true)"
|
|
70
|
+
if [[ "${cfg_branch:-}" == "." ]]; then cfg_branch="$base_branch"; fi
|
|
71
|
+
target_branch="${cfg_branch}"
|
|
72
|
+
|
|
73
|
+
git -C "${sub_path}" fetch origin --prune
|
|
74
|
+
if ! git -C "${sub_path}" show-ref --verify --quiet "refs/remotes/origin/${target_branch}"; then
|
|
75
|
+
echo "error: missing origin/${target_branch} for ${sub_path}"
|
|
76
|
+
exit 2
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
if ! git -C "${sub_path}" merge-base --is-ancestor "origin/${target_branch}" HEAD; then
|
|
80
|
+
echo "error: non-fast-forward (submodule=${sub_path}, branch=${target_branch})"
|
|
81
|
+
exit 2
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
git -C "${sub_path}" push origin "HEAD:refs/heads/${target_branch}"
|
|
85
|
+
done
|
|
86
|
+
|
|
87
|
+
git remote -v
|
|
88
|
+
git push
|
|
89
|
+
```
|
|
90
|
+
<!-- AIWS_MANAGED_END:opencode:ws-push -->
|
|
91
|
+
|
|
92
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
93
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 质量审查:行为回归 / 测试覆盖 / 实现质量
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-quality-review -->
|
|
5
|
+
# ws quality review
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:审查行为回归、边界条件、测试覆盖与实现质量。
|
|
10
|
+
|
|
11
|
+
步骤(建议):
|
|
12
|
+
1) 读取 `git diff`、已执行的验证结果和相关代码。
|
|
13
|
+
- 若检测到 `.opencode/oh-my-opencode.json` 或当前会话明确可用 `oracle` / `explore`:优先按 `packages/spec/docs/opencode-omo-adapter.md` 借用这些 agent。
|
|
14
|
+
- 质量/回归审查优先 `@oracle`;代码路径与影响面补充优先 `@explore`。
|
|
15
|
+
2) 检查:
|
|
16
|
+
- 是否存在行为回归或明显 bug 风险
|
|
17
|
+
- 边界条件 / 失败路径是否覆盖
|
|
18
|
+
- 测试是否足以支撑当前改动
|
|
19
|
+
3) 将结论落盘到:
|
|
20
|
+
- 默认:`changes/<change-id>/review/quality-review.md`
|
|
21
|
+
- 回退:`.agentdocs/tmp/review/quality-review.md`
|
|
22
|
+
4) 输出:
|
|
23
|
+
- `证据(Evidence):`
|
|
24
|
+
- `主要发现(Findings):`
|
|
25
|
+
- `测试缺口(Gaps):`
|
|
26
|
+
- `下一步(Next):`
|
|
27
|
+
5) 若 oMo 不可用:回退为当前 agent 本地 quality review。
|
|
28
|
+
<!-- AIWS_MANAGED_END:opencode:ws-quality-review -->
|
|
29
|
+
|
|
30
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 需求变更:更新 REQUIREMENTS 并同步执行合同
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-req-change -->
|
|
5
|
+
# ws req change
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:记录需求变更(更新 `REQUIREMENTS.md` + 追加 `requirements/CHANGELOG.md`),并同步/校验执行合同 `requirements/requirements-issues.csv`。
|
|
10
|
+
|
|
11
|
+
步骤(必须按顺序):
|
|
12
|
+
1) 读取:`AI_PROJECT.md`、`REQUIREMENTS.md`、`AI_WORKSPACE.md`、`requirements/CHANGELOG.md`(缺失则创建目录与文件)。
|
|
13
|
+
2) 先产出“拟变更方案”(不要立刻写文件):
|
|
14
|
+
- 变更摘要(1–5 条)
|
|
15
|
+
- 影响范围(API/鉴权/字段/状态码/测试边界)
|
|
16
|
+
- 回滚思路(1–2 条)
|
|
17
|
+
3) 对比与冲突检查(强制,不写文件):
|
|
18
|
+
- 对比“变更前 vs 拟变更后”的差异清单(新增/删除/语义变化)
|
|
19
|
+
- 整理潜在冲突/不确定点(只列“最可能影响验收/实现”的,避免噪音)
|
|
20
|
+
4) 逐条澄清(强制,避免一次问完):
|
|
21
|
+
- 若存在潜在冲突/不确定点:**本轮只问 1 个**最高优先级问题(给出 2–4 个可选答案或二选一),然后停止,等待用户回复;不要继续问下一题,也不要写文件。
|
|
22
|
+
- 收到用户回复后:更新“拟变更方案”,回到步骤 3) 重新对比,直至没有未决问题。
|
|
23
|
+
5) 强制停下来让用户确认:是否继续落盘?(Y/N)
|
|
24
|
+
6) 用户确认 Y 后再写入:
|
|
25
|
+
- 更新 `REQUIREMENTS.md`(只保留当前有效版本,不在此堆历史)
|
|
26
|
+
- 追加 `requirements/CHANGELOG.md`
|
|
27
|
+
7) 同步/补齐需求执行合同(强制,自动处理 FlowSpec 有/无两种情况):
|
|
28
|
+
- `python3 tools/requirements_contract_sync.py --workspace .`
|
|
29
|
+
- 说明:若 `REQUIREMENTS.md` 中不存在 FlowSpec(或 flows 为空),该命令只会确保 `requirements/requirements-issues.csv` 表头存在并给出 WARN(这是预期行为,不要当成失败)。
|
|
30
|
+
8) 校验需求执行合同(强制):`python3 tools/requirements_contract.py validate`
|
|
31
|
+
9) 同步场景合同(可选,但若存在 FlowSpec 则强烈建议自动执行):
|
|
32
|
+
- 若 `REQUIREMENTS.md` 同时包含 `<!-- FLOW_SPEC_BEGIN -->` 与 `<!-- FLOW_SPEC_END -->`:运行 `/ws-req-flow-sync`
|
|
33
|
+
- 否则:跳过,并提示用户“可以先不维护 FlowSpec;后续需要场景回归时再补”
|
|
34
|
+
|
|
35
|
+
输出必须包含:
|
|
36
|
+
- 本次更新的文件清单(路径)
|
|
37
|
+
- 回滚方案(如何撤销本次需求变更)
|
|
38
|
+
- 下一步建议命令
|
|
39
|
+
|
|
40
|
+
安全:
|
|
41
|
+
- 不打印 `secrets/test-accounts.json`
|
|
42
|
+
- 不引入任何 token/密钥到仓库
|
|
43
|
+
<!-- AIWS_MANAGED_END:opencode:ws-req-change -->
|
|
44
|
+
|
|
45
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 合同同步:把 REQUIREMENTS FlowSpec 同步到 requirements-issues.csv
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-req-contract-sync -->
|
|
5
|
+
# ws req contract sync
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
用途:从 `REQUIREMENTS.md` 的 FlowSpec 补齐 `requirements/requirements-issues.csv`(只生成骨架,不猜测完成状态)。
|
|
10
|
+
|
|
11
|
+
执行(在 workspace 根目录):
|
|
12
|
+
- `python3 tools/requirements_contract_sync.py --workspace .`
|
|
13
|
+
|
|
14
|
+
输出要求:
|
|
15
|
+
- 说明新增/更新了多少条
|
|
16
|
+
- 明确下一步:手工补齐 CRUD/Inputs/Outputs/Business_Logic/Tests,并将可开工条目标为 `Spec_Status=READY`
|
|
17
|
+
|
|
18
|
+
下一步建议:`/ws-req-contract-validate`
|
|
19
|
+
<!-- AIWS_MANAGED_END:opencode:ws-req-contract-sync -->
|
|
20
|
+
|
|
21
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 合同校验:校验 requirements-issues.csv 字段完整性
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-req-contract-validate -->
|
|
5
|
+
# ws req contract validate
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
执行(失败则修正 CSV 后重试):
|
|
10
|
+
- `python3 tools/requirements_contract.py validate`
|
|
11
|
+
|
|
12
|
+
输出要求:
|
|
13
|
+
- 若失败:列出前 20 条缺失字段(Req_ID + field),并给出最小补齐建议
|
|
14
|
+
<!-- AIWS_MANAGED_END:opencode:ws-req-contract-validate -->
|
|
15
|
+
|
|
16
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Flow 同步:从 REQUIREMENTS 生成 api-flow 与场景执行合同
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-req-flow-sync -->
|
|
5
|
+
# ws req flow sync
|
|
6
|
+
|
|
7
|
+
用中文输出;命令与路径保持原样不翻译。
|
|
8
|
+
|
|
9
|
+
目标:基于 `REQUIREMENTS.md` 的 FlowSpec 生成:
|
|
10
|
+
- `docs/api-flow.mmd`(简短逻辑图,Mermaid)
|
|
11
|
+
- `issues/server-scenario-issues.csv`(场景执行合同:TODO/DONE/BLOCKED)
|
|
12
|
+
|
|
13
|
+
执行(在 workspace 根目录):
|
|
14
|
+
`python3 tools/requirements_flow_gen.py --workspace .`
|
|
15
|
+
|
|
16
|
+
若缺少工具 `tools/requirements_flow_gen.py`:提示用户先运行 `npx @aipper/aiws init .`(默认会安装 optional tools)。
|
|
17
|
+
|
|
18
|
+
输出要求:只打印生成的文件路径与下一步命令:
|
|
19
|
+
- 查看逻辑图:`cat docs/api-flow.mmd`
|
|
20
|
+
- 查看场景合同:`cat issues/server-scenario-issues.csv`
|
|
21
|
+
<!-- AIWS_MANAGED_END:opencode:ws-req-flow-sync -->
|
|
22
|
+
|
|
23
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 需求评审:对 REQUIREMENTS 做整体 QA(不改文件)
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-req-review -->
|
|
5
|
+
# ws req review
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:在不修改任何文件的前提下,对 `REQUIREMENTS.md` 做一次整体 QA,输出缺口/冲突/风险,减少实现漂移。
|
|
10
|
+
|
|
11
|
+
执行步骤(强制):
|
|
12
|
+
1) 定位项目根目录:`git rev-parse --show-toplevel`(失败则停止并让用户确认根目录)。
|
|
13
|
+
2) 读取(存在则必须读取;缺失则明确列出,不要臆测):
|
|
14
|
+
- `AI_PROJECT.md`
|
|
15
|
+
- `REQUIREMENTS.md`
|
|
16
|
+
- `AI_WORKSPACE.md`
|
|
17
|
+
- `requirements/CHANGELOG.md`(若存在)
|
|
18
|
+
- `requirements/requirements-issues.csv`(若存在)
|
|
19
|
+
3) 输出固定结构的报告:
|
|
20
|
+
|
|
21
|
+
## Requirements QA
|
|
22
|
+
- 结论:是否可进入实现(是/否/有条件)
|
|
23
|
+
- 漂移风险:最容易导致不一致的点
|
|
24
|
+
- 可验收性缺口:缺少输入/输出/错误码/边界/示例的条目
|
|
25
|
+
- 完整性:Non-goals/兼容性/鉴权/重试/并发/观测性/性能
|
|
26
|
+
- 一致性:与 `AI_PROJECT.md` 约束冲突点
|
|
27
|
+
- 可测试性与证据:最小验证命令 + 期望结果 + 证据路径
|
|
28
|
+
- 风险清单:3–8 条
|
|
29
|
+
- 需要澄清的问题:5–12 个(按优先级)
|
|
30
|
+
|
|
31
|
+
4) 最后询问用户:是否进入需求落盘流程 `/ws-req-change`?(Y/N)
|
|
32
|
+
|
|
33
|
+
安全:不打印 `secrets/test-accounts.json`。
|
|
34
|
+
<!-- AIWS_MANAGED_END:opencode:ws-req-review -->
|
|
35
|
+
|
|
36
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 评审:提交前审计改动并落盘证据
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-review -->
|
|
5
|
+
# ws review
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:在提交/交付前审计当前改动,对照真值文件检查是否越界,并把审计证据优先落盘到 `changes/<change-id>/review/`(若无法确定 `change-id` 再回退 `.agentdocs/tmp/review/`)。
|
|
10
|
+
|
|
11
|
+
步骤(建议):
|
|
12
|
+
1) 先运行 `/ws-preflight`。
|
|
13
|
+
- 若检测到 `.opencode/oh-my-opencode.json` 或当前会话明确可用 `oracle` / `explore` / `librarian`:优先按 `packages/spec/docs/opencode-omo-adapter.md` 借用这些 agent。
|
|
14
|
+
- 独立审查优先 `@oracle`;diff 影响面优先 `@explore`;规范/文档上下文优先 `@librarian`。
|
|
15
|
+
2) 基于 `git status` / `git diff`(以及你实际运行过的测试结果),对照 `AI_PROJECT.md` 与 `REQUIREMENTS.md` 检查:
|
|
16
|
+
- 是否存在越界目录改动/危险操作
|
|
17
|
+
- 是否有可复现验证命令与证据
|
|
18
|
+
- 是否维护了 `changes/<change-id>/` 或相关 `issues/*.csv`
|
|
19
|
+
3) 将审计落盘到(目录不存在则创建):
|
|
20
|
+
- 默认:`changes/<change-id>/review/codex-review.md`
|
|
21
|
+
- 回退:`.agentdocs/tmp/review/codex-review.md`(仅在无法确定 `change-id` 时使用)
|
|
22
|
+
4) 回复中输出:
|
|
23
|
+
- `证据(Evidence):` 证据文件路径
|
|
24
|
+
- `主要风险(Top risks):` 3–8 条(高→低)
|
|
25
|
+
- `下一步(Next):` 最小修复清单 + 最小验证命令
|
|
26
|
+
5) 若 oMo 不可用:回退为当前 agent 本地 review,不阻断流程。
|
|
27
|
+
|
|
28
|
+
安全:
|
|
29
|
+
- 不打印 secrets。
|
|
30
|
+
- 不执行破坏性命令。
|
|
31
|
+
<!-- AIWS_MANAGED_END:opencode:ws-review -->
|
|
32
|
+
|
|
33
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 规则:把口述规则整理并写入 AI_PROJECT.md 托管段
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-rule -->
|
|
5
|
+
# ws rule
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:把用户口述的“项目特有规则”整理成可执行条款,并写入 `AI_PROJECT.md` 的 `AI_PROJECT_RULES_BEGIN/END` 段(托管块外内容会被保留)。
|
|
10
|
+
|
|
11
|
+
安全规则(强制):
|
|
12
|
+
- 不打印/不写入 secrets(token、密钥、内网地址、账号密码)。
|
|
13
|
+
- 不执行破坏性命令。
|
|
14
|
+
|
|
15
|
+
工作流:
|
|
16
|
+
1) 先运行 `/ws-preflight`;若缺失 `AI_PROJECT.md`:提示用户先 `/ws-migrate` 或运行 `npx @aipper/aiws init .`。
|
|
17
|
+
2) 写入前创建备份(必须):
|
|
18
|
+
`ts="$(date +%Y%m%d-%H%M%S)"; mkdir -p .aiws/backups/manual; cp -a AI_PROJECT.md .aiws/backups/manual/AI_PROJECT.md.bak.${ts}`
|
|
19
|
+
3) 先输出“将写入的规则清单”(3–12 条),并要求用户回复 `CONFIRM` 后再落盘。
|
|
20
|
+
4) 用户确认后,**仅更新** BEGIN/END 段内内容(合并去重;写成可检查条款:目录白名单/必须验证命令/禁止项/产物要求)。
|
|
21
|
+
5) 输出必须包含:
|
|
22
|
+
- 更新了哪些文件(路径)
|
|
23
|
+
- 回滚方式(恢复备份文件)
|
|
24
|
+
- 下一步建议:`aiws validate .`
|
|
25
|
+
<!-- AIWS_MANAGED_END:opencode:ws-rule -->
|
|
26
|
+
|
|
27
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 规范审查:requirements / plan / evidence / gate 完整性
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-spec-review -->
|
|
5
|
+
# ws spec review
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:审查 requirements 归因、plan/change 绑定、evidence 与 workflow gate 完整性。
|
|
10
|
+
|
|
11
|
+
步骤(建议):
|
|
12
|
+
1) 先运行 `/ws-preflight`。
|
|
13
|
+
- 若检测到 `.opencode/oh-my-opencode.json` 或当前会话明确可用 `oracle` / `librarian`:优先按 `packages/spec/docs/opencode-omo-adapter.md` 借用这些 agent。
|
|
14
|
+
- requirements / gate / evidence 审查优先 `@oracle`;规范与文档真值补充优先 `@librarian`。
|
|
15
|
+
2) 对照 `AI_PROJECT.md` / `REQUIREMENTS.md` / `AI_WORKSPACE.md` 检查:
|
|
16
|
+
- 当前改动是否能归因到 `Req_ID` / `Problem_ID`
|
|
17
|
+
- `plan/...`、`proposal.md`、`tasks.md`、`evidence/` 是否保持一致
|
|
18
|
+
- 是否存在越界改动、危险操作或缺失 gate
|
|
19
|
+
3) 将结论落盘到:
|
|
20
|
+
- 默认:`changes/<change-id>/review/spec-review.md`
|
|
21
|
+
- 回退:`.agentdocs/tmp/review/spec-review.md`
|
|
22
|
+
4) 输出:
|
|
23
|
+
- `证据(Evidence):`
|
|
24
|
+
- `阻断项(Blockers):`
|
|
25
|
+
- `警告(Warnings):`
|
|
26
|
+
- `下一步(Next):`
|
|
27
|
+
5) 若 oMo 不可用:回退为当前 agent 本地 spec review。
|
|
28
|
+
<!-- AIWS_MANAGED_END:opencode:ws-spec-review -->
|
|
29
|
+
|
|
30
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 子模块分支对齐(写入 .gitmodules 的 submodule.<name>.branch)
|
|
3
|
+
---
|
|
4
|
+
<!-- AIWS_MANAGED_BEGIN:opencode:ws-submodule-setup -->
|
|
5
|
+
# ws submodule setup
|
|
6
|
+
|
|
7
|
+
用中文输出(命令/路径/代码标识符保持原样不翻译)。
|
|
8
|
+
|
|
9
|
+
目标:为每个 submodule 写入 `.gitmodules` 的 `submodule.<name>.branch`(团队真值),让 `/ws-pull`、`/ws-finish` 能确定性地减少 detached 与人为差异;并使 `aiws validate` 的 submodule 分支门禁通过。
|
|
10
|
+
|
|
11
|
+
约束:
|
|
12
|
+
- 不自动提交、不自动 push(必须先输出 diff 并让用户确认)
|
|
13
|
+
- 不做破坏性命令
|
|
14
|
+
|
|
15
|
+
步骤(建议):
|
|
16
|
+
1) 确认工作区干净:
|
|
17
|
+
```bash
|
|
18
|
+
git status --porcelain
|
|
19
|
+
```
|
|
20
|
+
非空则停止。
|
|
21
|
+
|
|
22
|
+
2) 列出 submodules:
|
|
23
|
+
```bash
|
|
24
|
+
test -f .gitmodules || { echo "no .gitmodules"; exit 0; }
|
|
25
|
+
git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3) 对每个 submodule 让用户选择目标分支(推荐具体分支名;可选 `.` 表示跟随 superproject 分支名):
|
|
29
|
+
```bash
|
|
30
|
+
while read -r key sub_path; do
|
|
31
|
+
name="${key#submodule.}"; name="${name%.path}"
|
|
32
|
+
echo "== submodule: ${name} path=${sub_path} =="
|
|
33
|
+
echo "[current] branch=$(git config --file .gitmodules --get submodule.${name}.branch || true)"
|
|
34
|
+
echo "[origin] HEAD=$(git -C \"${sub_path}\" symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null || true)"
|
|
35
|
+
done < <(git config --file .gitmodules --get-regexp '^submodule\\..*\\.path$')
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
4) 写入分支配置:
|
|
39
|
+
```bash
|
|
40
|
+
git submodule set-branch --branch <branch-or-dot> <sub_path>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
5) 输出 diff 并让用户确认是否提交:
|
|
44
|
+
```bash
|
|
45
|
+
git diff -- .gitmodules
|
|
46
|
+
git status --porcelain
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
6) 用户确认后提交:
|
|
50
|
+
```bash
|
|
51
|
+
git add .gitmodules
|
|
52
|
+
git commit -m "chore(submodule): set tracking branches"
|
|
53
|
+
```
|
|
54
|
+
<!-- AIWS_MANAGED_END:opencode:ws-submodule-setup -->
|
|
55
|
+
|
|
56
|
+
可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
|
|
57
|
+
|