@fitlab-ai/agent-infra 0.6.5 → 0.7.0

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 (181) hide show
  1. package/README.md +51 -25
  2. package/README.zh-CN.md +49 -23
  3. package/dist/lib/defaults.json +1 -0
  4. package/dist/lib/init.js +3 -0
  5. package/dist/lib/sandbox/commands/create.js +4 -2
  6. package/dist/lib/sandbox/commands/enter.js +15 -4
  7. package/dist/lib/sandbox/commands/list-running.js +108 -0
  8. package/dist/lib/sandbox/commands/ls.js +24 -45
  9. package/dist/lib/sandbox/commands/rebuild.js +4 -2
  10. package/dist/lib/sandbox/config.js +3 -0
  11. package/dist/lib/sandbox/index.js +2 -1
  12. package/dist/lib/sandbox/runtimes/ai-tools.dockerfile +10 -6
  13. package/dist/lib/sandbox/tools.js +213 -8
  14. package/dist/lib/update.js +12 -1
  15. package/lib/defaults.json +1 -0
  16. package/lib/init.ts +10 -0
  17. package/lib/sandbox/commands/create.ts +10 -2
  18. package/lib/sandbox/commands/enter.ts +14 -4
  19. package/lib/sandbox/commands/list-running.ts +135 -0
  20. package/lib/sandbox/commands/ls.ts +28 -49
  21. package/lib/sandbox/commands/rebuild.ts +9 -2
  22. package/lib/sandbox/config.ts +7 -0
  23. package/lib/sandbox/index.ts +2 -1
  24. package/lib/sandbox/runtimes/ai-tools.dockerfile +10 -6
  25. package/lib/sandbox/tools.ts +248 -9
  26. package/lib/update.ts +15 -1
  27. package/package.json +1 -1
  28. package/templates/.agents/QUICKSTART.en.md +1 -1
  29. package/templates/.agents/QUICKSTART.zh-CN.md +1 -1
  30. package/templates/.agents/README.en.md +79 -2
  31. package/templates/.agents/README.zh-CN.md +79 -2
  32. package/templates/.agents/rules/create-issue.en.md +1 -1
  33. package/templates/.agents/rules/create-issue.github.en.md +1 -1
  34. package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
  35. package/templates/.agents/rules/create-issue.zh-CN.md +1 -1
  36. package/templates/.agents/rules/issue-sync.github.en.md +6 -5
  37. package/templates/.agents/rules/issue-sync.github.zh-CN.md +6 -5
  38. package/templates/.agents/rules/milestone-inference.github.en.md +2 -2
  39. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +2 -2
  40. package/templates/.agents/rules/no-mid-flow-questions.en.md +57 -0
  41. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +57 -0
  42. package/templates/.agents/rules/pr-sync.github.en.md +4 -5
  43. package/templates/.agents/rules/pr-sync.github.zh-CN.md +4 -5
  44. package/templates/.agents/rules/task-management.en.md +9 -6
  45. package/templates/.agents/rules/task-management.zh-CN.md +9 -6
  46. package/templates/.agents/rules/testing-discipline.en.md +2 -2
  47. package/templates/.agents/rules/testing-discipline.zh-CN.md +2 -2
  48. package/templates/.agents/scripts/validate-artifact.js +1 -1
  49. package/templates/.agents/skills/analyze-task/SKILL.en.md +16 -4
  50. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +16 -4
  51. package/templates/.agents/skills/check-task/SKILL.en.md +43 -32
  52. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +42 -31
  53. package/templates/.agents/skills/code-task/SKILL.en.md +117 -0
  54. package/templates/.agents/skills/{implement-task → code-task}/SKILL.zh-CN.md +51 -24
  55. package/templates/.agents/skills/{implement-task → code-task}/config/verify.en.json +4 -4
  56. package/templates/.agents/skills/{implement-task → code-task}/config/verify.zh-CN.json +4 -4
  57. package/templates/.agents/skills/{implement-task → code-task}/reference/branch-management.zh-CN.md +2 -2
  58. package/templates/.agents/skills/{implement-task/reference/implementation-rules.en.md → code-task/reference/code-rules.en.md} +6 -6
  59. package/templates/.agents/skills/{implement-task/reference/implementation-rules.zh-CN.md → code-task/reference/code-rules.zh-CN.md} +3 -3
  60. package/templates/.agents/skills/code-task/reference/dual-mode.en.md +69 -0
  61. package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +69 -0
  62. package/templates/.agents/skills/{refine-task/reference/fix-workflow.en.md → code-task/reference/fix-mode.en.md} +12 -12
  63. package/templates/.agents/skills/{refine-task/reference/fix-workflow.zh-CN.md → code-task/reference/fix-mode.zh-CN.md} +8 -8
  64. package/templates/.agents/skills/code-task/reference/output-template.en.md +20 -0
  65. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +20 -0
  66. package/templates/.agents/skills/{implement-task → code-task}/reference/report-template.en.md +4 -4
  67. package/templates/.agents/skills/{implement-task → code-task}/reference/report-template.zh-CN.md +3 -3
  68. package/templates/.agents/skills/code-task/scripts/detect-mode.js +370 -0
  69. package/templates/.agents/skills/commit/SKILL.en.md +2 -2
  70. package/templates/.agents/skills/commit/SKILL.zh-CN.md +2 -2
  71. package/templates/.agents/skills/commit/reference/task-status-update.en.md +10 -6
  72. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +10 -6
  73. package/templates/.agents/skills/complete-task/SKILL.en.md +5 -3
  74. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +5 -3
  75. package/templates/.agents/skills/create-pr/SKILL.en.md +17 -1
  76. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +17 -1
  77. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  78. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  79. package/templates/.agents/skills/import-dependabot/SKILL.en.md +2 -2
  80. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +2 -2
  81. package/templates/.agents/skills/import-issue/SKILL.en.md +3 -3
  82. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +3 -3
  83. package/templates/.agents/skills/plan-task/SKILL.en.md +4 -4
  84. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -4
  85. package/templates/.agents/skills/restore-task/SKILL.en.md +4 -3
  86. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +4 -3
  87. package/templates/.agents/skills/review-analysis/SKILL.en.md +76 -0
  88. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +102 -0
  89. package/templates/.agents/skills/review-analysis/config/verify.en.json +51 -0
  90. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +51 -0
  91. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +87 -0
  92. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +87 -0
  93. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +90 -0
  94. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +91 -0
  95. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +47 -0
  96. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +47 -0
  97. package/templates/.agents/skills/{review-task → review-code}/SKILL.en.md +11 -9
  98. package/templates/.agents/skills/{review-task → review-code}/SKILL.zh-CN.md +15 -9
  99. package/templates/.agents/skills/{review-task → review-code}/config/verify.en.json +7 -5
  100. package/templates/.agents/skills/{review-task → review-code}/config/verify.zh-CN.json +6 -4
  101. package/templates/.agents/skills/{review-task → review-code}/reference/output-templates.en.md +21 -17
  102. package/templates/.agents/skills/{review-task → review-code}/reference/output-templates.zh-CN.md +19 -15
  103. package/templates/.agents/skills/{review-task → review-code}/reference/report-template.en.md +5 -6
  104. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +91 -0
  105. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +48 -0
  106. package/templates/.agents/skills/{review-task → review-code}/reference/review-criteria.zh-CN.md +10 -4
  107. package/templates/.agents/skills/review-plan/SKILL.en.md +76 -0
  108. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +102 -0
  109. package/templates/.agents/skills/{refine-task → review-plan}/config/verify.en.json +14 -10
  110. package/templates/.agents/skills/{refine-task → review-plan}/config/verify.zh-CN.json +14 -10
  111. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +87 -0
  112. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +87 -0
  113. package/templates/.agents/skills/review-plan/reference/report-template.en.md +90 -0
  114. package/templates/.agents/skills/{review-task → review-plan}/reference/report-template.zh-CN.md +3 -3
  115. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +47 -0
  116. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +47 -0
  117. package/templates/.agents/skills/test/SKILL.en.md +2 -2
  118. package/templates/.agents/skills/test/SKILL.zh-CN.md +13 -31
  119. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +1 -0
  120. package/templates/.agents/templates/task.en.md +3 -3
  121. package/templates/.agents/templates/task.zh-CN.md +2 -2
  122. package/templates/.agents/workflows/bug-fix.en.yaml +126 -80
  123. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +90 -44
  124. package/templates/.agents/workflows/feature-development.en.yaml +115 -70
  125. package/templates/.agents/workflows/feature-development.zh-CN.yaml +92 -47
  126. package/templates/.agents/workflows/refactoring.en.yaml +123 -78
  127. package/templates/.agents/workflows/refactoring.zh-CN.yaml +89 -44
  128. package/templates/.claude/commands/code-task.en.md +8 -0
  129. package/templates/.claude/commands/code-task.zh-CN.md +8 -0
  130. package/templates/.claude/commands/review-analysis.en.md +8 -0
  131. package/templates/.claude/commands/review-analysis.zh-CN.md +8 -0
  132. package/templates/.claude/commands/review-code.en.md +8 -0
  133. package/templates/.claude/commands/review-code.zh-CN.md +8 -0
  134. package/templates/.claude/commands/review-plan.en.md +8 -0
  135. package/templates/.claude/commands/review-plan.zh-CN.md +8 -0
  136. package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +1 -1
  137. package/templates/.gemini/commands/_project_/code-task.en.toml +8 -0
  138. package/templates/.gemini/commands/_project_/code-task.zh-CN.toml +8 -0
  139. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +1 -1
  140. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +1 -1
  141. package/templates/.gemini/commands/_project_/review-analysis.en.toml +8 -0
  142. package/templates/.gemini/commands/_project_/review-analysis.zh-CN.toml +8 -0
  143. package/templates/.gemini/commands/_project_/review-code.en.toml +8 -0
  144. package/templates/.gemini/commands/_project_/review-code.zh-CN.toml +8 -0
  145. package/templates/.gemini/commands/_project_/review-plan.en.toml +8 -0
  146. package/templates/.gemini/commands/_project_/review-plan.zh-CN.toml +8 -0
  147. package/templates/.opencode/commands/code-task.en.md +11 -0
  148. package/templates/.opencode/commands/code-task.zh-CN.md +11 -0
  149. package/templates/.opencode/commands/review-analysis.en.md +11 -0
  150. package/templates/.opencode/commands/review-analysis.zh-CN.md +11 -0
  151. package/templates/.opencode/commands/review-code.en.md +11 -0
  152. package/templates/.opencode/commands/review-code.zh-CN.md +11 -0
  153. package/templates/.opencode/commands/review-plan.en.md +11 -0
  154. package/templates/.opencode/commands/review-plan.zh-CN.md +11 -0
  155. package/templates/.agents/skills/implement-task/SKILL.en.md +0 -173
  156. package/templates/.agents/skills/implement-task/reference/output-template.en.md +0 -20
  157. package/templates/.agents/skills/implement-task/reference/output-template.zh-CN.md +0 -20
  158. package/templates/.agents/skills/refine-task/SKILL.en.md +0 -153
  159. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +0 -153
  160. package/templates/.agents/skills/refine-task/reference/report-template.en.md +0 -64
  161. package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +0 -64
  162. package/templates/.agents/skills/review-task/reference/review-criteria.en.md +0 -42
  163. package/templates/.claude/commands/implement-task.en.md +0 -8
  164. package/templates/.claude/commands/implement-task.zh-CN.md +0 -8
  165. package/templates/.claude/commands/refine-task.en.md +0 -8
  166. package/templates/.claude/commands/refine-task.zh-CN.md +0 -8
  167. package/templates/.claude/commands/review-task.en.md +0 -8
  168. package/templates/.claude/commands/review-task.zh-CN.md +0 -8
  169. package/templates/.gemini/commands/_project_/implement-task.en.toml +0 -8
  170. package/templates/.gemini/commands/_project_/implement-task.zh-CN.toml +0 -8
  171. package/templates/.gemini/commands/_project_/refine-task.en.toml +0 -8
  172. package/templates/.gemini/commands/_project_/refine-task.zh-CN.toml +0 -8
  173. package/templates/.gemini/commands/_project_/review-task.en.toml +0 -8
  174. package/templates/.gemini/commands/_project_/review-task.zh-CN.toml +0 -8
  175. package/templates/.opencode/commands/implement-task.en.md +0 -11
  176. package/templates/.opencode/commands/implement-task.zh-CN.md +0 -11
  177. package/templates/.opencode/commands/refine-task.en.md +0 -11
  178. package/templates/.opencode/commands/refine-task.zh-CN.md +0 -11
  179. package/templates/.opencode/commands/review-task.en.md +0 -11
  180. package/templates/.opencode/commands/review-task.zh-CN.md +0 -11
  181. /package/templates/.agents/skills/{implement-task → code-task}/reference/branch-management.en.md +0 -0
@@ -224,8 +224,8 @@ Supported `invoke` placeholders:
224
224
 
225
225
  | Placeholder | Replaced with | Example |
226
226
  |-------------|---------------|---------|
227
- | `${skillName}` | The skill command name, such as `review-task` or `commit`. | `<your-cli> ${skillName}` -> `<your-cli> review-task` |
228
- | `${projectName}` | The `.airc.json` `project` value. Use this for namespaced commands. | `/${projectName}:${skillName}` -> `/agent-infra:review-task` |
227
+ | `${skillName}` | The skill command name, such as `review-code` or `commit`. | `<your-cli> ${skillName}` -> `<your-cli> review-code` |
228
+ | `${projectName}` | The `.airc.json` `project` value. Use this for namespaced commands. | `/${projectName}:${skillName}` -> `/agent-infra:review-code` |
229
229
 
230
230
  Non-namespaced custom TUI:
231
231
 
@@ -258,6 +258,83 @@ Namespaced custom TUI:
258
258
 
259
259
  `customTUIs` should contain one entry per custom TUI. To let `update-agent-infra` generate command files for custom skills, keep at least one existing command file in `dir` that references a built-in skill path such as `.agents/skills/analyze-task/SKILL.md`; agent-infra uses that file as the format reference.
260
260
 
261
+ ## Sandbox Custom Tools
262
+
263
+ `customTUIs` (above) generates slash-command files but does not change the sandbox image. To install a non-npm TUI (pip / cargo / curl-based / pre-built binary) into the sandbox image and live-mount its credentials, declare it under `sandbox.customTools` in `.agents/.airc.json`. Built-in tools (`claude-code`, `codex`, `opencode`, `gemini-cli`) keep working unchanged.
264
+
265
+ ### Required fields
266
+
267
+ | Field | Meaning |
268
+ |-------|---------|
269
+ | `id` | Lowercase id matching `^[a-z0-9][a-z0-9-]*$`. Referenced from `sandbox.tools`. Must not collide with a built-in id. |
270
+ | `install` | Install descriptor. `{ "type": "npm", "cmd": "<npm package spec>" }` runs `npm install -g <cmd>`. `{ "type": "shell", "cmd": "<shell>" }` runs the shell command(s) as `devuser` during image build. `cmd` must be non-empty. |
271
+
272
+ Minimal entry — the contract for getting a tool into the image is just these two fields:
273
+
274
+ ```json
275
+ {
276
+ "sandbox": {
277
+ "tools": ["my-shell-tool"],
278
+ "customTools": [
279
+ {
280
+ "id": "my-shell-tool",
281
+ "install": { "type": "shell", "cmd": "curl -fsSL https://example.com/install.sh | bash" }
282
+ }
283
+ ]
284
+ }
285
+ }
286
+ ```
287
+
288
+ ### Optional integration fields
289
+
290
+ Add only the fields your tool actually needs. Omit them and the loader fills sensible defaults; provide them and the loader uses your value. Provide an explicit empty string and the loader rejects it (preventing silent install-verification bypass).
291
+
292
+ | Field | Default when omitted | When to provide |
293
+ |-------|---------------------|-----------------|
294
+ | `name` | `id` | A friendlier display name in sandbox reports / hints. |
295
+ | `containerMount` | `/home/devuser/.<id>` | Your tool stores its config / state somewhere other than `~/.<id>`. Must be an absolute path. |
296
+ | `versionCmd` | `which <id>` | The installed binary name differs from `id` (e.g. id `anthropic-claude`, binary `claude`); set `"claude --version"` so sandbox-create can verify the install. |
297
+ | `setupHint` | `Run \`<id>\` inside the container to set up.` | The setup story is non-obvious and worth a one-liner. |
298
+ | `envVars` | (none) | Your tool reads config from a path the env points to (e.g. `XDG_CONFIG_HOME`-style or a custom `*_CONFIG` env). Shape: `Record<string, string>`. |
299
+ | `hostPreSeedFiles` / `hostPreSeedDirs` | (none) | Seed the tool's sandbox dir from host files / directories on first launch. |
300
+ | `pathRewriteFiles` | (none) | Seeded files contain absolute host paths that need rewriting to container paths. |
301
+ | `hostLiveMounts` | (none) | Share host credentials live (e.g. OAuth tokens) with the container. Read-write. |
302
+ | `postSetupCmds` | (none) | Run commands inside the container after first setup (e.g. symlinks). |
303
+
304
+ > **`sandboxBase` is not user-configurable.** The loader always assigns `~/.agent-infra/sandboxes/<id>` so `ai sandbox rm` / `prune` can find tool state. Any `sandboxBase` value in `customTools` entries is silently ignored.
305
+
306
+ Real-world example — `anthropic-claude` as a user-defined id with binary name `claude` and host credential live-mount:
307
+
308
+ ```json
309
+ {
310
+ "sandbox": {
311
+ "tools": ["claude-code", "anthropic-claude"],
312
+ "customTools": [
313
+ {
314
+ "id": "anthropic-claude",
315
+ "install": { "type": "npm", "cmd": "@anthropic-ai/claude-code@stable" },
316
+ "versionCmd": "claude --version",
317
+ "hostLiveMounts": [
318
+ { "hostPath": "~/.claude/.credentials.json", "containerSubpath": ".credentials.json" }
319
+ ]
320
+ }
321
+ ]
322
+ }
323
+ }
324
+ ```
325
+
326
+ ### Trust boundary and execution context
327
+
328
+ - `install.cmd` runs as user `devuser` (non-root) during `docker build`. It can write to the container's filesystem but cannot escape to the host. The trust model is the same as for the `sandbox.dockerfile` escape hatch — you own the `.airc.json` in your repo, so you own what runs at build time.
329
+ - Because the build runs as `devuser`, shell installs cannot `sudo` / `apt-get`. Available options for non-npm distributions:
330
+ - User-scope installers landing in `~/.local/bin`, `~/.cargo/bin`, `~/.npm-global/bin` (e.g. `pipx`, `cargo install`, `curl … | bash` with `INSTALL_DIR=$HOME/.local/bin`).
331
+ - When you genuinely need root or system packages, fall back to the existing `sandbox.dockerfile` field and own the full Dockerfile.
332
+ - Changing `install.cmd` (or any field that participates in the image signature) triggers exactly one image rebuild on the next `ai sandbox` invocation.
333
+
334
+ ### Interaction with `sandbox.dockerfile`
335
+
336
+ When you set `sandbox.dockerfile` to point at your own Dockerfile, agent-infra still passes both `AI_TOOL_PACKAGES` (space-separated npm package specs) and `AI_TOOLS_SHELL_INSTALL_B64` (base64-encoded shell install script) as `--build-arg`. Your custom Dockerfile decides whether to consume them; if it does not declare the matching `ARG`, the shell installs for `customTools` are silently skipped — taking over the Dockerfile means taking over the install path.
337
+
261
338
  ## Skill Authoring Conventions
262
339
 
263
340
  When writing or updating `.agents/skills/*/SKILL.md` files and their templates, keep step numbering consistent:
@@ -224,8 +224,8 @@ args: "<task-id>" # 可选
224
224
 
225
225
  | 占位符 | 替换为 | 示例 |
226
226
  |--------|--------|------|
227
- | `${skillName}` | skill 命令名,例如 `review-task` 或 `commit`。 | `<your-cli> ${skillName}` -> `<your-cli> review-task` |
228
- | `${projectName}` | `.airc.json` 中的 `project` 值,适用于带命名空间的命令。 | `/${projectName}:${skillName}` -> `/agent-infra:review-task` |
227
+ | `${skillName}` | skill 命令名,例如 `review-code` 或 `commit`。 | `<your-cli> ${skillName}` -> `<your-cli> review-code` |
228
+ | `${projectName}` | `.airc.json` 中的 `project` 值,适用于带命名空间的命令。 | `/${projectName}:${skillName}` -> `/agent-infra:review-code` |
229
229
 
230
230
  不带命名空间的自定义 TUI:
231
231
 
@@ -258,6 +258,83 @@ args: "<task-id>" # 可选
258
258
 
259
259
  `customTUIs` 每个条目对应一个自定义 TUI。若希望 `update-agent-infra` 为自定义 skill 生成命令文件,请在 `dir` 中保留至少一个引用内置 skill 路径的既有命令文件,例如 `.agents/skills/analyze-task/SKILL.md`;agent-infra 会以该文件作为格式参考。
260
260
 
261
+ ## 沙箱自定义工具(Sandbox Custom Tools)
262
+
263
+ 上文 `customTUIs` 只负责生成 slash-command 文件,**不影响沙箱镜像**。如果要把一个非 npm 分发的 TUI(pip / cargo / curl 脚本 / 裸二进制)装进沙箱镜像、并 live-mount 它的凭证目录,需要在 `.agents/.airc.json` 的 `sandbox.customTools` 中声明。内建的四个工具(`claude-code` / `codex` / `opencode` / `gemini-cli`)行为保持不变。
264
+
265
+ ### 必填字段
266
+
267
+ | 字段 | 含义 |
268
+ |------|------|
269
+ | `id` | 小写 id,匹配 `^[a-z0-9][a-z0-9-]*$`;由 `sandbox.tools` 引用;不可与内建 id 冲突。 |
270
+ | `install` | 安装描述符。`{ "type": "npm", "cmd": "<npm 包规范>" }` 执行 `npm install -g <cmd>`;`{ "type": "shell", "cmd": "<shell>" }` 在镜像构建阶段以 `devuser` 执行 shell。`cmd` 必须非空。 |
271
+
272
+ 最小入口——把一个工具装进镜像所需的契约只有这两个字段:
273
+
274
+ ```json
275
+ {
276
+ "sandbox": {
277
+ "tools": ["my-shell-tool"],
278
+ "customTools": [
279
+ {
280
+ "id": "my-shell-tool",
281
+ "install": { "type": "shell", "cmd": "curl -fsSL https://example.com/install.sh | bash" }
282
+ }
283
+ ]
284
+ }
285
+ }
286
+ ```
287
+
288
+ ### 可选集成字段
289
+
290
+ 只在你的工具真正需要时才加。**省略**则 loader 用合理默认值;**显式提供**则用你给的值;**显式给空串**会被拒绝(防止安装验证被绕过)。
291
+
292
+ | 字段 | 省略时的默认值 | 什么时候应该提供 |
293
+ |------|---------------|----------------|
294
+ | `name` | `id` | 想在沙箱报告 / 提示里显示更友好的名称。 |
295
+ | `containerMount` | `/home/devuser/.<id>` | 工具的配置 / 状态目录不在 `~/.<id>` 而在别处。必须是绝对路径。 |
296
+ | `versionCmd` | `which <id>` | 安装后的可执行文件名与 `id` 不同(例如 id 是 `anthropic-claude`,二进制名是 `claude`);填 `"claude --version"` 让 sandbox-create 能验证安装。 |
297
+ | `setupHint` | `Run \`<id>\` inside the container to set up.` | setup 流程不一目了然,值得用一行说明。 |
298
+ | `envVars` | (无) | 工具通过环境变量找配置(如 `XDG_CONFIG_HOME` 风格或自定义 `*_CONFIG` 变量)。形状:`Record<string, string>`。 |
299
+ | `hostPreSeedFiles` / `hostPreSeedDirs` | (无) | 首次启动时从宿主复制文件 / 目录到工具沙箱配置目录。 |
300
+ | `pathRewriteFiles` | (无) | seed 进来的文件里有宿主绝对路径,需要改写为容器路径。 |
301
+ | `hostLiveMounts` | (无) | 把宿主凭证(如 OAuth token)实时挂进容器,读写共享。 |
302
+ | `postSetupCmds` | (无) | 首次安装完成后在容器内执行命令(如建符号链接)。 |
303
+
304
+ > **`sandboxBase` 不由用户配置。** loader 永远使用 `~/.agent-infra/sandboxes/<id>`,这样 `ai sandbox rm` / `prune` 才能找到工具状态目录。`customTools` 条目里写的任何 `sandboxBase` 都会被静默忽略。
305
+
306
+ 实际场景示例——`anthropic-claude` 作为用户自定义 id,二进制名是 `claude`,并把宿主凭证 live-mount 进来:
307
+
308
+ ```json
309
+ {
310
+ "sandbox": {
311
+ "tools": ["claude-code", "anthropic-claude"],
312
+ "customTools": [
313
+ {
314
+ "id": "anthropic-claude",
315
+ "install": { "type": "npm", "cmd": "@anthropic-ai/claude-code@stable" },
316
+ "versionCmd": "claude --version",
317
+ "hostLiveMounts": [
318
+ { "hostPath": "~/.claude/.credentials.json", "containerSubpath": ".credentials.json" }
319
+ ]
320
+ }
321
+ ]
322
+ }
323
+ }
324
+ ```
325
+
326
+ ### 信任边界与执行身份
327
+
328
+ - `install.cmd` 在 `docker build` 阶段以 `devuser`(非 root)身份执行,只能写容器内文件系统,不能逃逸到宿主。信任模型与现有 `sandbox.dockerfile` 一致:你是 `.airc.json` 的作者,本次构建做什么由你负责。
329
+ - 因为不是 root,shell 安装无法 `sudo` / `apt-get`。非 npm 分发的几条可用路径:
330
+ - 用户态安装器,落到 `~/.local/bin`、`~/.cargo/bin`、`~/.npm-global/bin`(如 `pipx`、`cargo install`、`curl … | bash` 配合 `INSTALL_DIR=$HOME/.local/bin`)。
331
+ - 确实需要 root / 系统包时,仍走原有 `sandbox.dockerfile` 字段,接管整个 Dockerfile。
332
+ - 修改 `install.cmd` 或任何参与镜像签名的字段,下次 `ai sandbox` 命令会触发一次镜像重建。
333
+
334
+ ### 与 `sandbox.dockerfile` 的交互
335
+
336
+ 当 `sandbox.dockerfile` 指向自定义 Dockerfile 时,agent-infra 仍会把 `AI_TOOL_PACKAGES`(空格分隔的 npm 包规范)和 `AI_TOOLS_SHELL_INSTALL_B64`(base64 编码的 shell 安装脚本)作为 `--build-arg` 传入。你的自定义 Dockerfile 若未声明对应 `ARG`,shell 安装路径会被 docker build 静默忽略——这是接管 Dockerfile 后的应有代价。
337
+
261
338
  ## Skill 编写规范
262
339
 
263
340
  编写或维护 `.agents/skills/*/SKILL.md` 及其模板时,步骤编号遵循以下规则:
@@ -2,4 +2,4 @@
2
2
 
3
3
  This code platform does not provide an Issue creation rule.
4
4
 
5
- `create-task` skips the cascade Issue creation step on this platform; the local `task.md` remains a valid artifact. If you later want to bind the task to an Issue, manually write `issue_number` into `task.md` and the subsequent skills (`commit` / `refine-task` / `complete-task`, etc.) will pick up Issue metadata syncing through the existing cascade rules.
5
+ `create-task` skips the cascade Issue creation step on this platform; the local `task.md` remains a valid artifact. If you later want to bind the task to an Issue, manually write `issue_number` into `task.md` and the subsequent skills (`commit` / `code-task` / `complete-task`, etc.) will pick up Issue metadata syncing through the existing cascade rules.
@@ -5,7 +5,7 @@ After `create-task` writes the local `task.md`, follow this rule to cascade Issu
5
5
  ## Boundary
6
6
 
7
7
  - Issue title and body must come from `task.md` only
8
- - Do not read `analysis.md`, `plan.md`, `implementation.md`, or any review artifact
8
+ - Do not read `analysis.md`, `review-analysis.md`, `plan.md`, `review-plan.md`, `code.md`, or any review-code artifact
9
9
  - Persistent outputs are limited to the remote Issue and the `issue_number` written back to `task.md`
10
10
  - If Issue creation fails, do not roll back `task.md`; the current task remains valid for the workflow, and the user can later manually fill `issue_number` so other skills' cascade sync takes over
11
11
 
@@ -5,7 +5,7 @@
5
5
  ## 行为边界
6
6
 
7
7
  - Issue 标题和正文只能来自 `task.md`
8
- - 不读取 `analysis.md`、`plan.md`、`implementation.md` 或审查产物
8
+ - 不读取 `analysis.md`、`review-analysis.md`、`plan.md`、`review-plan.md`、`code.md` 或代码审查产物
9
9
  - 持久产物只有:远端 Issue + `task.md` 中回写的 `issue_number`
10
10
  - Issue 创建失败时不回滚 `task.md`;当前 task 仍可继续后续工作流,未来可由用户手动写入 `issue_number`,让其它技能的级联同步接管
11
11
 
@@ -2,4 +2,4 @@
2
2
 
3
3
  当前代码平台未提供 Issue 创建规则。
4
4
 
5
- `create-task` 在本平台上会跳过级联创建 Issue 步骤;本地 `task.md` 仍然是有效产物。如果将来需要把任务绑定到一个 Issue,可手动在 `task.md` 中写入 `issue_number`,后续技能(`commit` / `refine-task` / `complete-task` 等)会按既有的级联同步规则自动接管 Issue 元数据更新。
5
+ `create-task` 在本平台上会跳过级联创建 Issue 步骤;本地 `task.md` 仍然是有效产物。如果将来需要把任务绑定到一个 Issue,可手动在 `task.md` 中写入 `issue_number`,后续技能(`commit` / `code-task` / `complete-task` 等)会按既有的级联同步规则自动接管 Issue 元数据更新。
@@ -123,7 +123,7 @@ When a skill creates or imports an Issue, automatically add the current executor
123
123
 
124
124
  ## `in:` Label Sync
125
125
 
126
- > **Trigger timing**: run `in:` label sync only after code is committed (the `commit` skill). Do not run it during `implement-task` or `refine-task`. During `create-pr`, only copy the labels from the Issue to the PR without recomputing them.
126
+ > **Trigger timing**: run `in:` label sync only after code is committed (the `commit` skill). Do not run it during `code-task`. During `create-pr`, only copy the labels from the Issue to the PR without recomputing them.
127
127
 
128
128
  Read the `labels.in` mapping from `.agents/.airc.json`.
129
129
 
@@ -262,7 +262,7 @@ task comment sync always runs and is never downgraded.
262
262
 
263
263
  ## Backfill Rules (run before `/complete-task` archives)
264
264
 
265
- - Scan `task.md`, `analysis*.md`, `plan*.md`, `implementation*.md`, `review*.md`, and `refinement*.md` in the task directory
265
+ - Scan `task.md`, `analysis*.md`, `review-analysis*.md`, `plan*.md`, `review-plan*.md`, `code*.md`, and `review-code*.md` in the task directory
266
266
  - Check whether each `{file-stem}` was already published by its hidden marker; publish only missing artifacts
267
267
  - Backfill only appends missing comments and never deletes or reorders existing comments
268
268
  - Resolve `{agent}` for backfilled comments in this order:
@@ -281,10 +281,11 @@ Title mapping:
281
281
 
282
282
  - `task` -> `Task File`
283
283
  - `analysis` / `analysis-r{N}` -> `Requirements Analysis` / `Requirements Analysis (Round {N})`
284
+ - `review-analysis` / `review-analysis-r{N}` -> `Requirements Analysis Review (Round 1)` / `Requirements Analysis Review (Round {N})`
284
285
  - `plan` / `plan-r{N}` -> `Technical Plan` / `Technical Plan (Round {N})`
285
- - `implementation` / `implementation-r{N}` -> `Implementation Report (Round 1)` / `Implementation Report (Round {N})`
286
- - `review` / `review-r{N}` -> `Review Report (Round 1)` / `Review Report (Round {N})`
287
- - `refinement` / `refinement-r{N}` -> `Refinement Report (Round 1)` / `Refinement Report (Round {N})`
286
+ - `review-plan` / `review-plan-r{N}` -> `Technical Plan Review (Round 1)` / `Technical Plan Review (Round {N})`
287
+ - `code` / `code-r{N}` -> `Code Report (Round 1)` / `Code Report (Round {N})`
288
+ - `review-code` / `review-code-r{N}` -> `Code Review (Round 1)` / `Code Review (Round {N})`
288
289
  - `summary` -> `Delivery Summary`
289
290
 
290
291
  Backfilled comments are also not gated by `has_triage` or `has_push`.
@@ -123,7 +123,7 @@ fi
123
123
 
124
124
  ## `in:` label 同步
125
125
 
126
- > **触发时机**:`in:` label 同步应在代码提交后(commit 技能)执行,不在 implement-task 或 refine-task 阶段执行。create-pr 阶段仅从 Issue 复制到 PR,不重新计算。
126
+ > **触发时机**:`in:` label 同步应在代码提交后(commit 技能)执行,不在 code-task 阶段执行。create-pr 阶段仅从 Issue 复制到 PR,不重新计算。
127
127
 
128
128
  读取 `.agents/.airc.json` 的 `labels.in` 映射。
129
129
 
@@ -262,7 +262,7 @@ task 留言同步始终执行,不受权限降级影响。
262
262
 
263
263
  ## 补发规则(`/complete-task` 归档前执行)
264
264
 
265
- - 扫描任务目录中的 `task.md`、`analysis*.md`、`plan*.md`、`implementation*.md`、`review*.md`、`refinement*.md`
265
+ - 扫描任务目录中的 `task.md`、`analysis*.md`、`review-analysis*.md`、`plan*.md`、`review-plan*.md`、`code*.md`、`review-code*.md`
266
266
  - 对每个 `{file-stem}` 用隐藏标记检查是否已发布;未发布则补发,已发布则跳过
267
267
  - 补发只追加缺失评论,不删除或重排已有评论
268
268
  - 补发评论的 `{agent}` 按以下顺序确定:
@@ -281,10 +281,11 @@ task 留言同步始终执行,不受权限降级影响。
281
281
 
282
282
  - `task` -> `任务文件`
283
283
  - `analysis` / `analysis-r{N}` -> `需求分析` / `需求分析(Round {N})`
284
+ - `review-analysis` / `review-analysis-r{N}` -> `需求分析审查(Round 1)` / `需求分析审查(Round {N})`
284
285
  - `plan` / `plan-r{N}` -> `技术方案` / `技术方案(Round {N})`
285
- - `implementation` / `implementation-r{N}` -> `实现报告(Round 1)` / `实现报告(Round {N})`
286
- - `review` / `review-r{N}` -> `审查报告(Round 1)` / `审查报告(Round {N})`
287
- - `refinement` / `refinement-r{N}` -> `修复报告(Round 1)` / `修复报告(Round {N})`
286
+ - `review-plan` / `review-plan-r{N}` -> `技术方案审查(Round 1)` / `技术方案审查(Round {N})`
287
+ - `code` / `code-r{N}` -> `实现报告(Round 1)` / `实现报告(Round {N})`
288
+ - `review-code` / `review-code-r{N}` -> `代码审查(Round 1)` / `代码审查(Round {N})`
288
289
  - `summary` -> `交付摘要`
289
290
 
290
291
  补发评论同样不受 `has_triage` / `has_push` 限制。
@@ -1,6 +1,6 @@
1
1
  # Milestone Inference Rules
2
2
 
3
- Read this file before the `create-task` platform rule, `implement-task`, or `create-pr` handles a milestone.
3
+ Read this file before the `create-task` platform rule, `code-task`, or `create-pr` handles a milestone.
4
4
 
5
5
  ## General Principles
6
6
 
@@ -56,7 +56,7 @@ fi
56
56
 
57
57
  If `has_triage=false`, inference returns empty, or `gh issue edit` fails, skip and continue without blocking the `import-issue` workflow.
58
58
 
59
- ## Phase 2: `implement-task`
59
+ ## Phase 2: `code-task`
60
60
 
61
61
  Goal: narrow the Issue milestone from a release line to a concrete version when implementation starts.
62
62
 
@@ -1,6 +1,6 @@
1
1
  # Milestone 推断规则
2
2
 
3
- 在 `create-task` 的平台规则、`implement-task` 或 `create-pr` 处理 milestone 之前先读取本文件。
3
+ 在 `create-task` 的平台规则、`code-task` 或 `create-pr` 处理 milestone 之前先读取本文件。
4
4
 
5
5
  ## 通用原则
6
6
 
@@ -56,7 +56,7 @@ fi
56
56
 
57
57
  如果 `has_triage=false`、推断结果为空、或 `gh issue edit` 失败,跳过并继续,不阻断 `import-issue` 工作流。
58
58
 
59
- ## 阶段 2:`implement-task`
59
+ ## 阶段 2:`code-task`
60
60
 
61
61
  目标:开始开发时,把 Issue milestone 从版本线收窄到具体版本。
62
62
 
@@ -0,0 +1,57 @@
1
+ # General Rule - No Mid-Flow Questions During SKILL Execution
2
+
3
+ > **Scope**: this rule applies to **all SKILL** executions.
4
+ > Only the two exemption categories below may ask the user; any other mid-flow question is a violation.
5
+
6
+ ## Exemption Categories
7
+
8
+ ### Exemption 1: Literal clarification of entry-point natural-language input
9
+
10
+ Allowed only when the SKILL's core responsibility is to process **natural-language input the user provided in this invocation**, and that input is unparseable or self-contradictory. The clarification must be about the **literal input itself**; it must not be used to solicit implementation preferences.
11
+
12
+ SKILLs currently covered by this exemption:
13
+
14
+ - `create-task`: may clarify the task description itself when the user-provided description is unclear
15
+ - `refine-title`: requires the user's final confirmation (y/n) for a generated title
16
+
17
+ ### Exemption 2: Short confirmation before truly irreversible destructive operations
18
+
19
+ Any SKILL may pause briefly before the following irreversible operations; routine design choices do not qualify:
20
+
21
+ - `git push --force`, `rm -rf` against the user's worktree, etc.
22
+ - Deleting or overwriting shared remote resources (e.g., shared GitHub labels)
23
+ - Overwriting uncommitted local changes
24
+
25
+ SKILLs currently covered by this exemption:
26
+
27
+ - `init-labels`: may confirm before deleting legacy labels not in the final mapping
28
+ - `commit`: may stop and confirm when its plan conflicts with the user's uncommitted changes
29
+
30
+ ## No-Mid-Flow-Questions Clause (default behavior)
31
+
32
+ For every SKILL execution context not covered by the two exemptions above, the default behavior is:
33
+
34
+ 1. Do not call any user-question tool, including but not limited to `AskUserQuestion` and equivalent mechanisms that ask the user to choose.
35
+ 2. When uncertain, proceed with the most robust option without interrupting the flow. Use this priority order:
36
+ 1. Prefer the option consistent with existing code, documentation, and rules
37
+ 2. Prefer the more reversible option
38
+ 3. Prefer the option with the smaller impact area
39
+ 3. If assumptions or open questions exist, write them into fixed artifact sections instead of leaving them suspended in the conversation:
40
+ - English artifacts use `## Assumptions` / `## Open Questions`; Chinese artifacts use `## 假设` / `## 未决问题`
41
+ - Meaning: the assumptions section records assumptions used for this run that may be revisited later; the open questions section records unresolved questions for human review
42
+ - If the artifact template does not reserve these sections, append them as needed. If there are no assumptions or open questions, do not force empty sections.
43
+
44
+ ## Human Review Checkpoint Semantics
45
+
46
+ A mandatory human review checkpoint means:
47
+
48
+ - Stop after producing the artifact: once the skill finishes an artifact such as `plan.md`, end the current invocation and wait for the user to explicitly trigger the next skill command
49
+ - Do not pause mid-process to ask for input: do not insert interruptions such as "Do you prefer option A or B?" between execution steps
50
+
51
+ If a key decision needs human judgment during execution, follow the assumptions and open questions rule above: record it in the artifact's "Open Questions" / `未决问题` section for the user to address at the review checkpoint.
52
+
53
+ ## Anchor Location
54
+
55
+ This rule's sole global anchor lives in the project-level AGENTS.md "AI Behavior Principles" preamble, which every AI tool loads. Individual SKILL.md files no longer reference this rule, so no per-skill duplicate bullet needs to be maintained.
56
+
57
+ When executing any SKILL, if AGENTS.md's preamble notes "follow this rule first," the LLM should **proactively Read** this file to load the complete exemption list and concrete constraints.
@@ -0,0 +1,57 @@
1
+ # 通用规则 - SKILL 执行禁言
2
+
3
+ > **适用范围**:本规则适用于**所有 SKILL** 的执行过程。
4
+ > 仅以下两类例外可向用户提问;不属于这两类的发问一律按违规处理。
5
+
6
+ ## 例外类型
7
+
8
+ ### 例外 1:入口式自然语言入参的字面澄清
9
+
10
+ 仅当 SKILL 的本职职责就是处理**用户当次提供的自然语言入参**时,如果该入参无法解析或自相矛盾,可直接就**该入参字面**向用户澄清。不允许借此征求实现方案的偏好。
11
+
12
+ 当前归入本例外的 SKILL:
13
+
14
+ - `create-task`:用户提供的任务描述不清晰时可澄清描述本身
15
+ - `refine-title`:生成的新标题需要用户最终确认(y/n)
16
+
17
+ ### 例外 2:不可逆破坏性操作前的短暂确认
18
+
19
+ 任何 SKILL 在以下不可逆操作前可短暂确认;常规方案选择不属于此类:
20
+
21
+ - `git push --force`、`rm -rf` 用户工作树等
22
+ - 删除/覆盖远端共享资源(如 GitHub 共享 label)
23
+ - 覆盖用户未提交的本机改动
24
+
25
+ 当前归入本例外的 SKILL:
26
+
27
+ - `init-labels`:删除不在最终映射中的旧 label 前可确认
28
+ - `commit`:检测到与用户未提交改动冲突时可停下确认
29
+
30
+ ## 禁言条款(默认行为)
31
+
32
+ 不属于上述两类例外的所有 SKILL 执行场景,遵循以下默认行为:
33
+
34
+ 1. **禁止调用**任何向用户发问的工具(包括但不限于 `AskUserQuestion` 及等价的「征求用户选择」机制)。
35
+ 2. **不确定时**,按「最稳健方案」自主推进,不中断对话。最稳健方案的判定优先级:
36
+ 1. 与现有代码 / 文档 / 规则一致的方案优先
37
+ 2. 可逆性更高的方案优先
38
+ 3. 影响面更小的方案优先
39
+ 3. **如存在假设或未决问题**,写入产物中的固定段落,不在对话中悬置:
40
+ - 中文产物用 `## 假设` / `## 未决问题`;英文产物用 `## Assumptions` / `## Open Questions`
41
+ - 含义:`假设` 段记录本次按某假设推进、未来若假设不成立可推翻;`未决问题` 段记录本次未决、需要人工审查时裁定的问题
42
+ - 产物模板未预留这两段时,按需追加;没有假设或未决问题时不必强行写空段。
43
+
44
+ ## 人工审查检查点语义
45
+
46
+ 「强制性人工审查检查点」(mandatory human review checkpoint)的语义是:
47
+
48
+ - **产出后停止**:技能完成产物(如 `plan.md`)后立即结束本轮调用,等待用户主动触发下一个技能命令
49
+ - **不是过程中暂停征求意见**:不允许在执行步骤之间插入「请问您倾向 A 还是 B?」之类的中断
50
+
51
+ 如果在执行过程中发现需要用户裁定的关键决策,按上文「假设与未决问题」处理,记录到产物的「未决问题」/`Open Questions` 段落,由用户在审查检查点统一回应。
52
+
53
+ ## 锚点位置
54
+
55
+ 本规则的唯一全局锚点在项目级 AGENTS.md 的「AI 行为准则」preamble,所有 AI 工具加载 AGENTS.md 时即可见。各 SKILL.md 不再单独引用本规则,避免在每个 SKILL 顶部维护重复 bullet。
56
+
57
+ LLM 在执行任一 SKILL 时,若 AGENTS.md 的 preamble 已说明「优先遵循本规则」,应**主动 Read** 本文件以获取完整的例外列表与具体约束。
@@ -24,14 +24,13 @@ Within one PR, a given `{task-id}` must have only one summary comment with this
24
24
 
25
25
  Aggregate the latest artifacts in the task directory:
26
26
  - `plan.md` or the latest `plan-r{N}.md`
27
- - `implementation.md` or the latest `implementation-r{N}.md`
28
- - `review.md` or the latest `review-r{N}.md`
29
- - `refinement.md` or the latest `refinement-r{N}.md`
27
+ - `code.md` or the latest `code-r{N}.md`
28
+ - `review-code.md` or the latest `review-code-r{N}.md`
30
29
 
31
30
  Aggregation rules:
32
31
  - extract 2-4 self-contained technical decisions from `plan*`
33
- - build the review-history table from `review*` and `refinement*`
34
- - extract the test summary from `implementation*` or `refinement*`
32
+ - build the review-history table from `review-code*` and `code*`
33
+ - extract the test summary from `code*`
35
34
  - if one artifact class is missing, treat it as "no data for this stage" and continue
36
35
 
37
36
  ## Comment Body Template
@@ -24,14 +24,13 @@
24
24
 
25
25
  聚合当前任务目录中的最新产物:
26
26
  - `plan.md` 或最新 `plan-r{N}.md`
27
- - `implementation.md` 或最新 `implementation-r{N}.md`
28
- - `review.md` 或最新 `review-r{N}.md`
29
- - `refinement.md` 或最新 `refinement-r{N}.md`
27
+ - `code.md` 或最新 `code-r{N}.md`
28
+ - `review-code.md` 或最新 `review-code-r{N}.md`
30
29
 
31
30
  聚合规则:
32
31
  - 从 `plan*` 提取 2-4 条自包含的关键技术决策
33
- - 用 `review*` 与 `refinement*` 构建审查历程表
34
- - 从 `implementation*` 或 `refinement*` 提取测试结果摘要
32
+ - 用 `review-code*` 与 `code*` 构建审查历程表
33
+ - 从 `code*` 提取测试结果摘要
35
34
  - 某一类产物缺失时,按“无该阶段数据”处理并继续生成
36
35
 
37
36
  ## 评论体模板
@@ -5,10 +5,12 @@
5
5
  Map user intent to the corresponding workflow command:
6
6
  - "analyze issue #123" -> `import-issue`
7
7
  - "analyze task TASK-20260306-143022" -> `analyze-task`
8
+ - "review requirement analysis" -> `review-analysis`
8
9
  - "design a plan" -> `plan-task`
9
- - "implement" or "build" -> `implement-task`
10
- - "review" -> `review-task`
11
- - "fix review feedback" -> `refine-task`
10
+ - "review a plan" or "review technical design" -> `review-plan`
11
+ - "implement" or "build" -> `code-task`
12
+ - "code review" or "review code" -> `review-code`
13
+ - "fix review feedback" -> `code-task`
12
14
 
13
15
  ## Task State Management
14
16
 
@@ -25,10 +27,11 @@ Map user intent to the corresponding workflow command:
25
27
  - `import-dependabot`: update `current_step`, `updated_at`, `assigned_to`, `agent_infra_version`
26
28
  - `restore-task`: update `status`, `updated_at`, `assigned_to`, `agent_infra_version`
27
29
  - `analyze-task`: update `current_step`, `updated_at`, `assigned_to`, `agent_infra_version`
30
+ - `review-analysis`: update `current_step`, `updated_at`, `agent_infra_version`
28
31
  - `plan-task`: update `current_step`, `updated_at`, `agent_infra_version`
29
- - `implement-task`: update `current_step`, `updated_at`, `agent_infra_version`
30
- - `review-task`: update `current_step`, `updated_at`, `agent_infra_version`
31
- - `refine-task`: update `current_step`, `updated_at`, `agent_infra_version`
32
+ - `review-plan`: update `current_step`, `updated_at`, `agent_infra_version`
33
+ - `code-task`: update `current_step`, `updated_at`, `agent_infra_version`
34
+ - `review-code`: update `current_step`, `updated_at`, `agent_infra_version`
32
35
  - `create-pr`: update `pr_number`, `updated_at`, `agent_infra_version`
33
36
  - `commit`: update `updated_at`, `agent_infra_version`; update `current_step` when needed (see `commit/reference/task-status-update.md`)
34
37
  - `complete-task`: update `status`, `current_step`, `completed_at`, `updated_at`, `agent_infra_version`
@@ -5,10 +5,12 @@
5
5
  根据用户意图自动映射到对应工作流命令:
6
6
  - “分析 issue #123” -> `import-issue`
7
7
  - “分析任务 TASK-20260306-143022” -> `analyze-task`
8
+ - “审查需求分析” -> `review-analysis`
8
9
  - “设计方案” -> `plan-task`
9
- - “实施/实现” -> `implement-task`
10
- - “审查” -> `review-task`
11
- - “修复审查问题” -> `refine-task`
10
+ - “审查方案/审查技术方案” -> `review-plan`
11
+ - “实施/实现” -> `code-task`
12
+ - “审查代码/代码审查” -> `review-code`
13
+ - “修复审查问题” -> `code-task`
12
14
 
13
15
  ## 任务状态管理
14
16
 
@@ -25,10 +27,11 @@
25
27
  - `import-dependabot`:更新 `current_step`、`updated_at`、`assigned_to`、`agent_infra_version`
26
28
  - `restore-task`:更新 `status`、`updated_at`、`assigned_to`、`agent_infra_version`
27
29
  - `analyze-task`:更新 `current_step`、`updated_at`、`assigned_to`、`agent_infra_version`
30
+ - `review-analysis`:更新 `current_step`、`updated_at`、`agent_infra_version`
28
31
  - `plan-task`:更新 `current_step`、`updated_at`、`agent_infra_version`
29
- - `implement-task`:更新 `current_step`、`updated_at`、`agent_infra_version`
30
- - `review-task`:更新 `current_step`、`updated_at`、`agent_infra_version`
31
- - `refine-task`:更新 `current_step`、`updated_at`、`agent_infra_version`
32
+ - `review-plan`:更新 `current_step`、`updated_at`、`agent_infra_version`
33
+ - `code-task`:更新 `current_step`、`updated_at`、`agent_infra_version`
34
+ - `review-code`:更新 `current_step`、`updated_at`、`agent_infra_version`
32
35
  - `create-pr`:更新 `pr_number`、`updated_at`、`agent_infra_version`
33
36
  - `commit`:更新 `updated_at`、`agent_infra_version`;必要时更新 `current_step`(详见 `commit/reference/task-status-update.md`)
34
37
  - `complete-task`:更新 `status`、`current_step`、`completed_at`、`updated_at`、`agent_infra_version`
@@ -12,13 +12,13 @@ When a positive assertion already covers the expected behavior, do not add anoth
12
12
 
13
13
  Bad:
14
14
  ```ts
15
- assert.match(content, /^name: implement-task$/m); // The positive assertion already covers the expected value.
15
+ assert.match(content, /^name: code-task$/m); // The positive assertion already covers the expected value.
16
16
  assert.doesNotMatch(content, /^name: wrong-name$/m); // Redundant: permanently remembers a value that should not appear.
17
17
  ```
18
18
 
19
19
  Good:
20
20
  ```ts
21
- assert.match(content, /^name: implement-task$/m); // The positive assertion is enough.
21
+ assert.match(content, /^name: code-task$/m); // The positive assertion is enough.
22
22
  ```
23
23
 
24
24
  If the positive assertion passes, the value is correct. The extra negative assertion adds no protection, only maintenance cost, and can become a test that permanently remembers a concept after the feature is gone.
@@ -12,13 +12,13 @@
12
12
 
13
13
  ❌ 反例:
14
14
  ```ts
15
- assert.match(content, /^name: implement-task$/m); // 正向已覆盖期望值
15
+ assert.match(content, /^name: code-task$/m); // 正向已覆盖期望值
16
16
  assert.doesNotMatch(content, /^name: wrong-name$/m); // 多余:永久记住一个不该出现的值
17
17
  ```
18
18
 
19
19
  ✅ 正例:
20
20
  ```ts
21
- assert.match(content, /^name: implement-task$/m); // 正向断言已足够
21
+ assert.match(content, /^name: code-task$/m); // 正向断言已足够
22
22
  ```
23
23
 
24
24
  正向断言通过即证明值正确;额外的反向断言不增加保护,只增加维护成本,并会在功能删除后退化为"测试永久记住一个不再存在的概念"。
@@ -203,7 +203,7 @@ function runCheck(type, context) {
203
203
  }
204
204
  }
205
205
 
206
- // === Check Implementations ===
206
+ // === Check Functions ===
207
207
 
208
208
  function checkTaskMeta({ taskDir, config }) {
209
209
  const task = loadTask(taskDir);
@@ -115,6 +115,18 @@ Create `.agents/workspace/active/{task-id}/{analysis-artifact}`.
115
115
  ## Dependencies
116
116
  - {Required dependencies and coordination with other modules}
117
117
 
118
+ ## Assumptions
119
+
120
+ > If this analysis depends on assumptions, list them here; omit this section if there are none.
121
+
122
+ - {assumption}
123
+
124
+ ## Open Questions
125
+
126
+ > If there are unresolved questions for human review, list them here; omit this section if there are none.
127
+
128
+ - {open question}
129
+
118
130
  ## Effort and Complexity Assessment
119
131
  - Complexity: {High/Medium/Low}
120
132
  - Risk level: {High/Medium/Low}
@@ -189,10 +201,10 @@ Summary:
189
201
  Output file:
190
202
  - Analysis report: .agents/workspace/active/{task-id}/{analysis-artifact}
191
203
 
192
- Next step - create technical plan:
193
- - Claude Code / OpenCode: /plan-task {task-id}
194
- - Gemini CLI: /{{project}}:plan-task {task-id}
195
- - Codex CLI: $plan-task {task-id}
204
+ Next step - review the analysis:
205
+ - Claude Code / OpenCode: /review-analysis {task-id}
206
+ - Gemini CLI: /{{project}}:review-analysis {task-id}
207
+ - Codex CLI: $review-analysis {task-id}
196
208
  ```
197
209
 
198
210
  ## Completion Checklist