@aipper/aiws-spec 0.0.51 → 0.0.53

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.
Files changed (102) hide show
  1. package/docs/pi-plugins-manifest.json +10 -9
  2. package/docs/pi-plugins-manifest.md +6 -6
  3. package/docs/skill-manifest.json +18 -0
  4. package/package.json +1 -1
  5. package/templates/workspace/.opencode/README.md +49 -0
  6. package/templates/workspace/.opencode/command/ws-frontend-design.md +17 -0
  7. package/templates/workspace/.opencode/commands/using-aiws.md +18 -7
  8. package/templates/workspace/.opencode/plugins/memory-autoload.js +185 -0
  9. package/templates/workspace/.opencode/skills/codebase-design/SKILL.md +114 -0
  10. package/templates/workspace/.opencode/skills/domain-modeling/SKILL.md +74 -0
  11. package/templates/workspace/.opencode/skills/grill-with-docs/SKILL.md +7 -0
  12. package/templates/workspace/.opencode/skills/tdd/SKILL.md +36 -0
  13. package/templates/workspace/.opencode/skills/using-aiws/SKILL.md +2 -1
  14. package/templates/workspace/.opencode/skills/ws-dev/SKILL.md +24 -3
  15. package/templates/workspace/.opencode/skills/ws-plan/SKILL.md +15 -1
  16. package/templates/workspace/.opencode/skills/ws-review/SKILL.md +22 -0
  17. package/templates/workspace/AGENTS.md +13 -0
  18. package/templates/workspace/manifest.json +9 -121
  19. package/templates/workspace/.opencode/command/p-aiws-change-archive.md +0 -27
  20. package/templates/workspace/.opencode/command/p-aiws-change-finish.md +0 -27
  21. package/templates/workspace/.opencode/command/p-aiws-change-list.md +0 -26
  22. package/templates/workspace/.opencode/command/p-aiws-change-new.md +0 -27
  23. package/templates/workspace/.opencode/command/p-aiws-change-next.md +0 -27
  24. package/templates/workspace/.opencode/command/p-aiws-change-start.md +0 -27
  25. package/templates/workspace/.opencode/command/p-aiws-change-status.md +0 -27
  26. package/templates/workspace/.opencode/command/p-aiws-change-sync.md +0 -27
  27. package/templates/workspace/.opencode/command/p-aiws-change-templates-init.md +0 -26
  28. package/templates/workspace/.opencode/command/p-aiws-change-templates-which.md +0 -26
  29. package/templates/workspace/.opencode/command/p-aiws-change-validate.md +0 -27
  30. package/templates/workspace/.opencode/command/p-aiws-hooks-install.md +0 -26
  31. package/templates/workspace/.opencode/command/p-aiws-hooks-status.md +0 -26
  32. package/templates/workspace/.opencode/command/p-aiws-init.md +0 -23
  33. package/templates/workspace/.opencode/command/p-aiws-rollback.md +0 -16
  34. package/templates/workspace/.opencode/command/p-aiws-update.md +0 -22
  35. package/templates/workspace/.opencode/command/p-aiws-validate.md +0 -17
  36. package/templates/workspace/.opencode/command/ws-analyze.md +0 -30
  37. package/templates/workspace/.opencode/command/ws-auto.md +0 -33
  38. package/templates/workspace/.opencode/command/ws-autonomy.md +0 -25
  39. package/templates/workspace/.opencode/command/ws-bugfix.md +0 -35
  40. package/templates/workspace/.opencode/command/ws-commit.md +0 -87
  41. package/templates/workspace/.opencode/command/ws-delegate.md +0 -33
  42. package/templates/workspace/.opencode/command/ws-deliver.md +0 -75
  43. package/templates/workspace/.opencode/command/ws-handoff.md +0 -43
  44. package/templates/workspace/.opencode/command/ws-intake.md +0 -22
  45. package/templates/workspace/.opencode/command/ws-migrate.md +0 -25
  46. package/templates/workspace/.opencode/command/ws-plan-verify.md +0 -28
  47. package/templates/workspace/.opencode/command/ws-preflight.md +0 -35
  48. package/templates/workspace/.opencode/command/ws-pull.md +0 -87
  49. package/templates/workspace/.opencode/command/ws-push.md +0 -93
  50. package/templates/workspace/.opencode/command/ws-quality-review.md +0 -30
  51. package/templates/workspace/.opencode/command/ws-req-change.md +0 -45
  52. package/templates/workspace/.opencode/command/ws-req-contract-sync.md +0 -21
  53. package/templates/workspace/.opencode/command/ws-req-contract-validate.md +0 -16
  54. package/templates/workspace/.opencode/command/ws-req-flow-sync.md +0 -23
  55. package/templates/workspace/.opencode/command/ws-req-review.md +0 -36
  56. package/templates/workspace/.opencode/command/ws-rule.md +0 -27
  57. package/templates/workspace/.opencode/command/ws-spec-review.md +0 -30
  58. package/templates/workspace/.opencode/command/ws-submodule-setup.md +0 -57
  59. package/templates/workspace/.opencode/command/ws-verify-before-complete.md +0 -27
  60. package/templates/workspace/.opencode/commands/p-aiws-change-archive.md +0 -27
  61. package/templates/workspace/.opencode/commands/p-aiws-change-finish.md +0 -27
  62. package/templates/workspace/.opencode/commands/p-aiws-change-list.md +0 -26
  63. package/templates/workspace/.opencode/commands/p-aiws-change-new.md +0 -27
  64. package/templates/workspace/.opencode/commands/p-aiws-change-next.md +0 -27
  65. package/templates/workspace/.opencode/commands/p-aiws-change-start.md +0 -27
  66. package/templates/workspace/.opencode/commands/p-aiws-change-status.md +0 -27
  67. package/templates/workspace/.opencode/commands/p-aiws-change-sync.md +0 -27
  68. package/templates/workspace/.opencode/commands/p-aiws-change-templates-init.md +0 -26
  69. package/templates/workspace/.opencode/commands/p-aiws-change-templates-which.md +0 -26
  70. package/templates/workspace/.opencode/commands/p-aiws-change-validate.md +0 -27
  71. package/templates/workspace/.opencode/commands/p-aiws-hooks-install.md +0 -26
  72. package/templates/workspace/.opencode/commands/p-aiws-hooks-status.md +0 -26
  73. package/templates/workspace/.opencode/commands/p-aiws-init.md +0 -23
  74. package/templates/workspace/.opencode/commands/p-aiws-rollback.md +0 -16
  75. package/templates/workspace/.opencode/commands/p-aiws-update.md +0 -22
  76. package/templates/workspace/.opencode/commands/p-aiws-validate.md +0 -17
  77. package/templates/workspace/.opencode/commands/ws-analyze.md +0 -30
  78. package/templates/workspace/.opencode/commands/ws-auto.md +0 -33
  79. package/templates/workspace/.opencode/commands/ws-autonomy.md +0 -25
  80. package/templates/workspace/.opencode/commands/ws-bugfix.md +0 -35
  81. package/templates/workspace/.opencode/commands/ws-commit.md +0 -18
  82. package/templates/workspace/.opencode/commands/ws-delegate.md +0 -33
  83. package/templates/workspace/.opencode/commands/ws-deliver.md +0 -18
  84. package/templates/workspace/.opencode/commands/ws-handoff.md +0 -18
  85. package/templates/workspace/.opencode/commands/ws-intake.md +0 -22
  86. package/templates/workspace/.opencode/commands/ws-migrate.md +0 -18
  87. package/templates/workspace/.opencode/commands/ws-plan-verify.md +0 -18
  88. package/templates/workspace/.opencode/commands/ws-preflight.md +0 -35
  89. package/templates/workspace/.opencode/commands/ws-pull.md +0 -18
  90. package/templates/workspace/.opencode/commands/ws-push.md +0 -18
  91. package/templates/workspace/.opencode/commands/ws-quality-review.md +0 -30
  92. package/templates/workspace/.opencode/commands/ws-req-change.md +0 -45
  93. package/templates/workspace/.opencode/commands/ws-req-contract-sync.md +0 -21
  94. package/templates/workspace/.opencode/commands/ws-req-contract-validate.md +0 -16
  95. package/templates/workspace/.opencode/commands/ws-req-flow-sync.md +0 -23
  96. package/templates/workspace/.opencode/commands/ws-req-review.md +0 -36
  97. package/templates/workspace/.opencode/commands/ws-rule.md +0 -27
  98. package/templates/workspace/.opencode/commands/ws-spec-review.md +0 -30
  99. package/templates/workspace/.opencode/commands/ws-submodule-setup.md +0 -18
  100. package/templates/workspace/.opencode/commands/ws-verify-before-complete.md +0 -18
  101. package/templates/workspace/.opencode/skills/ws-handoff/SKILL.md +0 -18
  102. package/templates/workspace/.opencode/skills/ws-intake/SKILL.md +0 -80
@@ -1,87 +0,0 @@
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 的额外说明(托管块外内容会被保留)。
@@ -1,93 +0,0 @@
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
-
@@ -1,30 +0,0 @@
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 的额外说明(托管块外内容会被保留)。
@@ -1,45 +0,0 @@
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 的额外说明(托管块外内容会被保留)。
@@ -1,21 +0,0 @@
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 的额外说明(托管块外内容会被保留)。
@@ -1,16 +0,0 @@
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 的额外说明(托管块外内容会被保留)。
@@ -1,23 +0,0 @@
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 的额外说明(托管块外内容会被保留)。
@@ -1,36 +0,0 @@
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-superproject-working-tree`(submodule 感知上溯);若为空再用 `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 的额外说明(托管块外内容会被保留)。
@@ -1,27 +0,0 @@
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 的额外说明(托管块外内容会被保留)。
@@ -1,30 +0,0 @@
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 的额外说明(托管块外内容会被保留)。
@@ -1,57 +0,0 @@
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
-
@@ -1,27 +0,0 @@
1
- ---
2
- description: 完成前验证:finish / handoff 前检查双审查与 validate/evidence
3
- ---
4
- <!-- AIWS_MANAGED_BEGIN:opencode:ws-verify-before-complete -->
5
- # ws verify before complete
6
-
7
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
8
-
9
- 目标:在 `/ws-finish` 或 `/ws-handoff` 前检查双审查、validate stamp 与 evidence 是否齐全。
10
-
11
- 步骤(建议):
12
- 1) 检查以下最小 gate:
13
- - `changes/<change-id>/review/spec-review.md`
14
- - `changes/<change-id>/review/quality-review.md`
15
- - `.agentdocs/tmp/aiws-validate/*.json`
16
- 2) 若存在 `changes/<change-id>/evidence/`,检查 review / validate / collaboration summary 是否已收敛。
17
- 3) 将结果落盘到:
18
- - 默认:`changes/<change-id>/evidence/verify-before-complete.md`
19
- - 回退:`.agentdocs/tmp/review/verify-before-complete.md`
20
- 4) 输出:
21
- - `证据(Evidence):`
22
- - `结论(Result): pass|fail`
23
- - `缺失项(Missing):`
24
- - `下一步(Next):`
25
- <!-- AIWS_MANAGED_END:opencode:ws-verify-before-complete -->
26
-
27
- 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -1,27 +0,0 @@
1
- ---
2
- description: 私有:变更归档:归档已完成的 change 工件并生成 handoff.md
3
- ---
4
- <!-- AIWS_MANAGED_BEGIN:opencode:aiws-change-archive -->
5
- # aiws change archive
6
-
7
- (私有原子入口;日常优先用 ws-* 链路。)
8
-
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:
12
- - 归档已完成 change 工件,并生成交接文档:`changes/archive/.../handoff.md`
13
-
14
- 执行(在仓库根目录):
15
- ```bash
16
- change_id="<change-id>"
17
- if [[ -x "./node_modules/.bin/aiws" ]]; then
18
- ./node_modules/.bin/aiws change archive "${change_id}"
19
- elif command -v aiws >/dev/null 2>&1; then
20
- aiws change archive "${change_id}"
21
- else
22
- npx @aipper/aiws change archive "${change_id}"
23
- fi
24
- ```
25
- <!-- AIWS_MANAGED_END:opencode:aiws-change-archive -->
26
-
27
- 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -1,27 +0,0 @@
1
- ---
2
- description: 私有:变更收尾:安全合并 change 分支回目标分支
3
- ---
4
- <!-- AIWS_MANAGED_BEGIN:opencode:aiws-change-finish -->
5
- # aiws change finish
6
-
7
- (私有原子入口;日常优先用 ws-* 链路。)
8
-
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:
12
- - 将 change/<change-id> 安全 fast-forward 合并回目标分支
13
-
14
- 执行(在仓库根目录):
15
- ```bash
16
- change_id="<change-id>" # 可留空(若当前分支可推断)
17
- if [[ -x "./node_modules/.bin/aiws" ]]; then
18
- ./node_modules/.bin/aiws change finish "${change_id}"
19
- elif command -v aiws >/dev/null 2>&1; then
20
- aiws change finish "${change_id}"
21
- else
22
- npx @aipper/aiws change finish "${change_id}"
23
- fi
24
- ```
25
- <!-- AIWS_MANAGED_END:opencode:aiws-change-finish -->
26
-
27
- 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -1,26 +0,0 @@
1
- ---
2
- description: 私有:变更列表:列出当前仓库 change 工件
3
- ---
4
- <!-- AIWS_MANAGED_BEGIN:opencode:aiws-change-list -->
5
- # aiws change list
6
-
7
- (私有原子入口;日常优先用 ws-* 链路。)
8
-
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:
12
- - 列出当前仓库 change 工件
13
-
14
- 执行(在仓库根目录):
15
- ```bash
16
- if [[ -x "./node_modules/.bin/aiws" ]]; then
17
- ./node_modules/.bin/aiws change list
18
- elif command -v aiws >/dev/null 2>&1; then
19
- aiws change list
20
- else
21
- npx @aipper/aiws change list
22
- fi
23
- ```
24
- <!-- AIWS_MANAGED_END:opencode:aiws-change-list -->
25
-
26
- 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -1,27 +0,0 @@
1
- ---
2
- description: 私有:变更新建:创建 changes/<change-id> 工件
3
- ---
4
- <!-- AIWS_MANAGED_BEGIN:opencode:aiws-change-new -->
5
- # aiws change new
6
-
7
- (私有原子入口;日常优先用 ws-* 链路。)
8
-
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:
12
- - 创建 changes/<change-id> 工件目录与基础文件
13
-
14
- 执行(在仓库根目录):
15
- ```bash
16
- change_id="<change-id>"
17
- if [[ -x "./node_modules/.bin/aiws" ]]; then
18
- ./node_modules/.bin/aiws change new "${change_id}"
19
- elif command -v aiws >/dev/null 2>&1; then
20
- aiws change new "${change_id}"
21
- else
22
- npx @aipper/aiws change new "${change_id}"
23
- fi
24
- ```
25
- <!-- AIWS_MANAGED_END:opencode:aiws-change-new -->
26
-
27
- 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。
@@ -1,27 +0,0 @@
1
- ---
2
- description: 私有:变更下一步:输出当前 change 的建议动作
3
- ---
4
- <!-- AIWS_MANAGED_BEGIN:opencode:aiws-change-next -->
5
- # aiws change next
6
-
7
- (私有原子入口;日常优先用 ws-* 链路。)
8
-
9
- 用中文输出(命令/路径/代码标识符保持原样不翻译)。
10
-
11
- 目标:
12
- - 输出 change 下一步建议动作
13
-
14
- 执行(在仓库根目录):
15
- ```bash
16
- change_id="<change-id>" # 可留空(若当前分支可推断)
17
- if [[ -x "./node_modules/.bin/aiws" ]]; then
18
- ./node_modules/.bin/aiws change next "${change_id}"
19
- elif command -v aiws >/dev/null 2>&1; then
20
- aiws change next "${change_id}"
21
- else
22
- npx @aipper/aiws change next "${change_id}"
23
- fi
24
- ```
25
- <!-- AIWS_MANAGED_END:opencode:aiws-change-next -->
26
-
27
- 可在下方追加本项目对 OpenCode 的额外说明(托管块外内容会被保留)。