@fitlab-ai/agent-infra 0.9.0 → 0.9.2

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 (327) hide show
  1. package/README.md +22 -5
  2. package/README.zh-CN.md +21 -5
  3. package/bin/cli.ts +12 -0
  4. package/dist/bin/cli.js +14 -0
  5. package/dist/bin/internal-cli.js +20 -0
  6. package/dist/lib/agent-client.js +163 -0
  7. package/dist/lib/agent-clients/adapter.js +294 -0
  8. package/dist/lib/agent-clients/adapters/claude-code.js +62 -0
  9. package/dist/lib/agent-clients/adapters/codex-sandbox.js +210 -0
  10. package/dist/lib/agent-clients/adapters/codex.js +54 -0
  11. package/dist/lib/agent-clients/adapters/gemini-cli.js +64 -0
  12. package/dist/lib/agent-clients/adapters/index.js +20 -0
  13. package/dist/lib/agent-clients/adapters/opencode.js +64 -0
  14. package/dist/lib/agent-clients/config.js +177 -0
  15. package/dist/lib/agent-clients/custom-tuis.js +99 -0
  16. package/dist/lib/agent-clients/invocation.js +9 -0
  17. package/dist/lib/agent-clients/next-steps.js +38 -0
  18. package/dist/lib/agent-clients/project-assets.js +45 -0
  19. package/dist/lib/agent-clients/reconcile.js +235 -0
  20. package/dist/lib/agent-clients/registry.js +72 -0
  21. package/dist/lib/agent-clients/schema.js +57 -0
  22. package/dist/lib/agent-clients/types.js +29 -0
  23. package/dist/lib/builtin-tuis.js +9 -14
  24. package/dist/lib/defaults.json +85 -73
  25. package/dist/lib/git/review-snapshot.js +25 -10
  26. package/dist/lib/git/reviewed-commit-equivalence.js +110 -0
  27. package/dist/lib/init.js +47 -91
  28. package/dist/lib/internal/agent-client.js +117 -0
  29. package/dist/lib/internal/git-workflow.js +1 -1
  30. package/dist/lib/internal/platform-release-notes.js +53 -0
  31. package/dist/lib/internal/release-workflow.js +175 -17
  32. package/dist/lib/internal/task-orchestration.js +151 -0
  33. package/dist/lib/internal/task-review.js +65 -0
  34. package/dist/lib/merge.js +2 -1
  35. package/dist/lib/platform/adapters.js +38 -1
  36. package/dist/lib/platform/change-request-git-evidence.js +113 -0
  37. package/dist/lib/platform/github-release-notes.js +96 -0
  38. package/dist/lib/platform/issues.js +4 -2
  39. package/dist/lib/platform/merged-pr-equivalence.js +84 -0
  40. package/dist/lib/platform/pr-checks.js +43 -15
  41. package/dist/lib/platform/pull-requests.js +113 -7
  42. package/dist/lib/platform/release-notes.js +143 -0
  43. package/dist/lib/platform/releases.js +1 -1
  44. package/dist/lib/platform/verification-required.js +31 -9
  45. package/dist/lib/prompt.js +15 -3
  46. package/dist/lib/release/channels.js +4 -1
  47. package/dist/lib/release/workflow.js +4 -2
  48. package/dist/lib/remove-dir.js +25 -0
  49. package/dist/lib/run/tui.js +8 -2
  50. package/dist/lib/sandbox/agent-client-reconciler.js +234 -0
  51. package/dist/lib/sandbox/build-proxy.js +63 -0
  52. package/dist/lib/sandbox/clipboard/linux.js +2 -1
  53. package/dist/lib/sandbox/commands/create.js +133 -189
  54. package/dist/lib/sandbox/commands/enter.js +17 -1
  55. package/dist/lib/sandbox/commands/prune.js +2 -2
  56. package/dist/lib/sandbox/commands/rebuild.js +24 -7
  57. package/dist/lib/sandbox/commands/rm.js +3 -2
  58. package/dist/lib/sandbox/config.js +21 -4
  59. package/dist/lib/sandbox/constants.js +3 -0
  60. package/dist/lib/sandbox/dockerfile.js +2 -1
  61. package/dist/lib/sandbox/image-build.js +2 -1
  62. package/dist/lib/sandbox/managed-fs.js +10 -5
  63. package/dist/lib/sandbox/recovery.js +52 -36
  64. package/dist/lib/sandbox/runtimes/ai-tools.dockerfile +24 -3
  65. package/dist/lib/sandbox/runtimes/base.dockerfile +8 -1
  66. package/dist/lib/sandbox/runtimes/java17.dockerfile +8 -1
  67. package/dist/lib/sandbox/runtimes/java21.dockerfile +8 -1
  68. package/dist/lib/sandbox/runtimes/node20.dockerfile +8 -1
  69. package/dist/lib/sandbox/runtimes/node22.dockerfile +8 -1
  70. package/dist/lib/sandbox/runtimes/python3.dockerfile +8 -1
  71. package/dist/lib/sandbox/shell.js +3 -2
  72. package/dist/lib/sandbox/tool-types.js +8 -0
  73. package/dist/lib/sandbox/tools.js +2 -126
  74. package/dist/lib/task/artifact-lifecycle.js +1 -49
  75. package/dist/lib/task/commands/decisions.js +50 -20
  76. package/dist/lib/task/commands/issue-body.js +10 -5
  77. package/dist/lib/task/delegation-receipts.js +107 -0
  78. package/dist/lib/task/events.js +101 -2
  79. package/dist/lib/task/issue-form.js +2 -0
  80. package/dist/lib/task/orchestration.js +420 -0
  81. package/dist/lib/task/review-artifacts.js +143 -59
  82. package/dist/lib/task/review-finalization.js +166 -0
  83. package/dist/lib/task/review-fingerprint.js +13 -0
  84. package/dist/lib/task/verification-checks.js +2 -1
  85. package/dist/lib/task/verification-engine.js +168 -23
  86. package/dist/lib/task/verification-review.js +1 -1
  87. package/dist/lib/task/verification.js +4 -2
  88. package/dist/lib/task/workspace-snapshot.js +34 -0
  89. package/dist/lib/update.js +42 -161
  90. package/lib/agent-client.ts +214 -0
  91. package/lib/agent-clients/adapter.ts +461 -0
  92. package/lib/agent-clients/adapters/claude-code.ts +70 -0
  93. package/lib/agent-clients/adapters/codex-sandbox.ts +245 -0
  94. package/lib/agent-clients/adapters/codex.ts +58 -0
  95. package/lib/agent-clients/adapters/gemini-cli.ts +65 -0
  96. package/lib/agent-clients/adapters/index.ts +27 -0
  97. package/lib/agent-clients/adapters/opencode.ts +66 -0
  98. package/lib/agent-clients/config.ts +278 -0
  99. package/lib/agent-clients/custom-tuis.ts +149 -0
  100. package/lib/agent-clients/invocation.ts +19 -0
  101. package/lib/agent-clients/next-steps.ts +72 -0
  102. package/lib/agent-clients/project-assets.ts +96 -0
  103. package/lib/agent-clients/reconcile.ts +324 -0
  104. package/lib/agent-clients/registry.ts +144 -0
  105. package/lib/agent-clients/schema.ts +62 -0
  106. package/lib/agent-clients/types.ts +78 -0
  107. package/lib/benchmark/schemas/v1.0.0/case-manifest.schema.json +120 -0
  108. package/lib/benchmark/schemas/v1.0.0/common.schema.json +109 -0
  109. package/lib/benchmark/schemas/v1.0.0/grader-result.schema.json +160 -0
  110. package/lib/benchmark/schemas/v1.0.0/run-manifest.schema.json +122 -0
  111. package/lib/benchmark/schemas/v1.0.0/subject.schema.json +227 -0
  112. package/lib/builtin-tuis.ts +16 -15
  113. package/lib/defaults.json +24 -12
  114. package/lib/git/review-snapshot.ts +39 -9
  115. package/lib/git/reviewed-commit-equivalence.ts +135 -0
  116. package/lib/init.ts +53 -121
  117. package/lib/internal/agent-client.ts +131 -0
  118. package/lib/internal/git-workflow.ts +1 -1
  119. package/lib/internal/platform-release-notes.ts +55 -0
  120. package/lib/internal/release-workflow.ts +172 -18
  121. package/lib/internal/task-orchestration.ts +132 -0
  122. package/lib/internal/task-review.ts +65 -0
  123. package/lib/merge.ts +2 -1
  124. package/lib/platform/adapters.ts +142 -3
  125. package/lib/platform/change-request-git-evidence.ts +159 -0
  126. package/lib/platform/github-release-notes.ts +132 -0
  127. package/lib/platform/issues.ts +6 -4
  128. package/lib/platform/merged-pr-equivalence.ts +107 -0
  129. package/lib/platform/pr-checks.ts +57 -28
  130. package/lib/platform/pull-requests.ts +140 -25
  131. package/lib/platform/release-notes.ts +167 -0
  132. package/lib/platform/releases.ts +1 -1
  133. package/lib/platform/verification-required.ts +37 -9
  134. package/lib/prompt.ts +16 -3
  135. package/lib/release/channels.ts +4 -1
  136. package/lib/release/workflow.ts +4 -3
  137. package/lib/remove-dir.ts +28 -0
  138. package/lib/run/tui.ts +9 -1
  139. package/lib/sandbox/agent-client-reconciler.ts +378 -0
  140. package/lib/sandbox/build-proxy.ts +94 -0
  141. package/lib/sandbox/clipboard/linux.ts +2 -1
  142. package/lib/sandbox/commands/create.ts +188 -203
  143. package/lib/sandbox/commands/enter.ts +23 -1
  144. package/lib/sandbox/commands/prune.ts +2 -2
  145. package/lib/sandbox/commands/rebuild.ts +29 -7
  146. package/lib/sandbox/commands/rm.ts +3 -2
  147. package/lib/sandbox/config.ts +31 -4
  148. package/lib/sandbox/constants.ts +6 -0
  149. package/lib/sandbox/dockerfile.ts +2 -1
  150. package/lib/sandbox/image-build.ts +4 -1
  151. package/lib/sandbox/managed-fs.ts +18 -5
  152. package/lib/sandbox/recovery.ts +98 -67
  153. package/lib/sandbox/runtimes/ai-tools.dockerfile +24 -3
  154. package/lib/sandbox/runtimes/base.dockerfile +8 -1
  155. package/lib/sandbox/runtimes/java17.dockerfile +8 -1
  156. package/lib/sandbox/runtimes/java21.dockerfile +8 -1
  157. package/lib/sandbox/runtimes/node20.dockerfile +8 -1
  158. package/lib/sandbox/runtimes/node22.dockerfile +8 -1
  159. package/lib/sandbox/runtimes/python3.dockerfile +8 -1
  160. package/lib/sandbox/shell.ts +4 -2
  161. package/lib/sandbox/tool-types.ts +143 -0
  162. package/lib/sandbox/tools.ts +5 -157
  163. package/lib/task/artifact-lifecycle.ts +1 -38
  164. package/lib/task/commands/decisions.ts +53 -20
  165. package/lib/task/commands/issue-body.ts +10 -5
  166. package/lib/task/delegation-receipts.ts +170 -0
  167. package/lib/task/events.ts +111 -3
  168. package/lib/task/issue-form.ts +4 -0
  169. package/lib/task/orchestration.ts +543 -0
  170. package/lib/task/review-artifacts.ts +201 -69
  171. package/lib/task/review-finalization.ts +275 -0
  172. package/lib/task/review-fingerprint.ts +15 -1
  173. package/lib/task/verification-checks.ts +2 -1
  174. package/lib/task/verification-engine.ts +190 -25
  175. package/lib/task/verification-review.ts +2 -0
  176. package/lib/task/verification.ts +6 -3
  177. package/lib/task/workspace-snapshot.ts +36 -0
  178. package/lib/update.ts +48 -184
  179. package/package.json +2 -2
  180. package/templates/.agents/README.en.md +21 -20
  181. package/templates/.agents/README.zh-CN.md +21 -20
  182. package/templates/.agents/hooks/lifecycle-delegation.js +64 -0
  183. package/templates/.agents/rules/README.en.md +2 -0
  184. package/templates/.agents/rules/README.zh-CN.md +2 -0
  185. package/templates/.agents/rules/commit-and-pr.en.md +1 -0
  186. package/templates/.agents/rules/commit-and-pr.zh-CN.md +1 -0
  187. package/templates/.agents/rules/human-decision-context.en.md +14 -12
  188. package/templates/.agents/rules/human-decision-context.zh-CN.md +14 -12
  189. package/templates/.agents/rules/lifecycle-orchestration.en.md +21 -0
  190. package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +21 -0
  191. package/templates/.agents/rules/next-step-output.en.md +16 -0
  192. package/templates/.agents/rules/next-step-output.zh-CN.md +16 -0
  193. package/templates/.agents/rules/no-mid-flow-questions.en.md +2 -0
  194. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +2 -0
  195. package/templates/.agents/rules/release-commands.en.md +2 -2
  196. package/templates/.agents/rules/release-commands.github.en.md +15 -39
  197. package/templates/.agents/rules/release-commands.github.zh-CN.md +14 -38
  198. package/templates/.agents/rules/release-commands.zh-CN.md +2 -2
  199. package/templates/.agents/rules/review-handshake.en.md +4 -3
  200. package/templates/.agents/rules/review-handshake.zh-CN.md +4 -3
  201. package/templates/.agents/rules/review-method.en.md +113 -0
  202. package/templates/.agents/rules/review-method.zh-CN.md +98 -0
  203. package/templates/.agents/rules/testing-discipline.en.md +20 -2
  204. package/templates/.agents/rules/testing-discipline.zh-CN.md +20 -2
  205. package/templates/.agents/skills/analyze-task/SKILL.en.md +9 -6
  206. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +9 -6
  207. package/templates/.agents/skills/block-task/SKILL.en.md +4 -4
  208. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +4 -4
  209. package/templates/.agents/skills/cancel-task/SKILL.en.md +4 -4
  210. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +5 -5
  211. package/templates/.agents/skills/check-task/SKILL.en.md +16 -16
  212. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +16 -16
  213. package/templates/.agents/skills/close-codescan/SKILL.en.md +4 -4
  214. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +4 -4
  215. package/templates/.agents/skills/close-dependabot/SKILL.en.md +4 -4
  216. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +4 -4
  217. package/templates/.agents/skills/code-task/SKILL.en.md +1 -1
  218. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +2 -2
  219. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +14 -16
  220. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +14 -16
  221. package/templates/.agents/skills/code-task/reference/output-template.en.md +3 -3
  222. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +3 -3
  223. package/templates/.agents/skills/commit/SKILL.en.md +11 -1
  224. package/templates/.agents/skills/commit/SKILL.zh-CN.md +11 -1
  225. package/templates/.agents/skills/commit/reference/task-status-update.en.md +24 -28
  226. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +24 -28
  227. package/templates/.agents/skills/complete-task/SKILL.en.md +3 -3
  228. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +3 -3
  229. package/templates/.agents/skills/complete-task/config/verify.en.json +0 -1
  230. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +0 -1
  231. package/templates/.agents/skills/create-pr/SKILL.en.md +10 -10
  232. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +10 -10
  233. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +3 -3
  234. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +3 -3
  235. package/templates/.agents/skills/create-release-note/SKILL.en.md +17 -38
  236. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +16 -37
  237. package/templates/.agents/skills/create-task/SKILL.en.md +15 -11
  238. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +15 -11
  239. package/templates/.agents/skills/create-task/reference/context-capture.en.md +29 -0
  240. package/templates/.agents/skills/create-task/reference/context-capture.zh-CN.md +29 -0
  241. package/templates/.agents/skills/import-codescan/SKILL.en.md +5 -5
  242. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +5 -5
  243. package/templates/.agents/skills/import-dependabot/SKILL.en.md +5 -5
  244. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +5 -5
  245. package/templates/.agents/skills/import-issue/SKILL.en.md +5 -5
  246. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
  247. package/templates/.agents/skills/init-labels/SKILL.en.md +4 -4
  248. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +4 -4
  249. package/templates/.agents/skills/init-milestones/SKILL.en.md +4 -4
  250. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +4 -4
  251. package/templates/.agents/skills/plan-task/SKILL.en.md +5 -5
  252. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +5 -5
  253. package/templates/.agents/skills/refine-title/SKILL.en.md +1 -1
  254. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -1
  255. package/templates/.agents/skills/release/SKILL.en.md +1 -1
  256. package/templates/.agents/skills/review-analysis/SKILL.en.md +13 -2
  257. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +14 -3
  258. package/templates/.agents/skills/review-analysis/config/verify.en.json +6 -0
  259. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +6 -0
  260. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +13 -15
  261. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +13 -15
  262. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +51 -5
  263. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +52 -6
  264. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +25 -22
  265. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +25 -22
  266. package/templates/.agents/skills/review-code/SKILL.en.md +28 -8
  267. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +28 -8
  268. package/templates/.agents/skills/review-code/config/verify.en.json +7 -0
  269. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +7 -0
  270. package/templates/.agents/skills/review-code/reference/concurrency-risks.en.md +25 -0
  271. package/templates/.agents/skills/review-code/reference/concurrency-risks.zh-CN.md +25 -0
  272. package/templates/.agents/skills/review-code/reference/cross-platform-risks.en.md +27 -0
  273. package/templates/.agents/skills/review-code/reference/cross-platform-risks.zh-CN.md +27 -0
  274. package/templates/.agents/skills/review-code/reference/documentation-antipatterns.en.md +13 -0
  275. package/templates/.agents/skills/review-code/reference/documentation-antipatterns.zh-CN.md +13 -0
  276. package/templates/.agents/skills/review-code/reference/migration-risks.en.md +25 -0
  277. package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +25 -0
  278. package/templates/.agents/skills/review-code/reference/output-templates.en.md +22 -24
  279. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +22 -24
  280. package/templates/.agents/skills/review-code/reference/report-template.en.md +54 -7
  281. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +54 -7
  282. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +29 -24
  283. package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +29 -24
  284. package/templates/.agents/skills/review-code/reference/security-risks.en.md +25 -0
  285. package/templates/.agents/skills/review-code/reference/security-risks.zh-CN.md +25 -0
  286. package/templates/.agents/skills/review-plan/SKILL.en.md +13 -2
  287. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +14 -3
  288. package/templates/.agents/skills/review-plan/config/verify.en.json +6 -0
  289. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +6 -0
  290. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +13 -15
  291. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +13 -15
  292. package/templates/.agents/skills/review-plan/reference/report-template.en.md +61 -5
  293. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +61 -5
  294. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +21 -24
  295. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +21 -24
  296. package/templates/.agents/skills/run-task/SKILL.en.md +22 -0
  297. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +22 -0
  298. package/templates/.agents/skills/run-task/config/verify.en.json +9 -0
  299. package/templates/.agents/skills/run-task/config/verify.zh-CN.json +9 -0
  300. package/templates/.agents/skills/test/SKILL.en.md +4 -4
  301. package/templates/.agents/skills/test/SKILL.zh-CN.md +4 -4
  302. package/templates/.agents/skills/test-integration/SKILL.en.md +4 -4
  303. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +4 -4
  304. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +5 -5
  305. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +5 -5
  306. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +647 -203
  307. package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +4 -4
  308. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +4 -4
  309. package/templates/.agents/skills/watch-pr/SKILL.en.md +8 -8
  310. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +8 -8
  311. package/templates/.agents/templates/task.en.md +18 -0
  312. package/templates/.agents/templates/task.zh-CN.md +18 -0
  313. package/templates/.claude/agents/agent-infra-lifecycle-executor.en.md +6 -0
  314. package/templates/.claude/agents/agent-infra-lifecycle-executor.zh-CN.md +6 -0
  315. package/templates/.claude/agents/agent-infra-lifecycle-reviewer.en.md +6 -0
  316. package/templates/.claude/agents/agent-infra-lifecycle-reviewer.zh-CN.md +6 -0
  317. package/templates/.claude/commands/run-task.en.md +8 -0
  318. package/templates/.claude/commands/run-task.zh-CN.md +8 -0
  319. package/templates/.claude/settings.json +24 -0
  320. package/templates/.codex/agents/agent-infra-lifecycle-executor.en.toml +3 -0
  321. package/templates/.codex/agents/agent-infra-lifecycle-executor.zh-CN.toml +3 -0
  322. package/templates/.codex/agents/agent-infra-lifecycle-reviewer.en.toml +3 -0
  323. package/templates/.codex/agents/agent-infra-lifecycle-reviewer.zh-CN.toml +3 -0
  324. package/templates/.gemini/commands/_project_/run-task.en.toml +8 -0
  325. package/templates/.gemini/commands/_project_/run-task.zh-CN.toml +8 -0
  326. package/templates/.opencode/commands/run-task.en.md +11 -0
  327. package/templates/.opencode/commands/run-task.zh-CN.md +11 -0
@@ -41,6 +41,24 @@ assert.match(content, /^name: code-task$/m); // 正向断言已足够
41
41
 
42
42
  ## 项目级测试策略
43
43
 
44
- 仓库特定的命令、目录约定、覆盖率阈值、CI 集成和报告服务应记录在项目自己的测试文档中。新增测试前先读取该策略,并按测试的可观察范围与运行成本选择对应层级。
44
+ 请为本仓库填写以下各项,记录选定行为及其边界,以便贡献者一致地选择并验证测试。
45
45
 
46
- 如果项目没有定义分层测试套件,RED 与 GREEN 验证都使用项目的完整测试命令。不要在无关改动中自行引入测试层级或覆盖率门禁。
46
+ ### 1. 测试命令
47
+
48
+ > TODO: 记录完整测试命令,以及开发期间使用的可选快速命令。
49
+
50
+ ### 2. 测试目录或层级
51
+
52
+ > TODO: 记录测试目录或层级,以及选择对应目录或层级的规则。
53
+
54
+ ### 3. 覆盖率
55
+
56
+ > TODO: 记录覆盖率采集方式、阈值,以及覆盖率是否阻塞变更。
57
+
58
+ ### 4. 持续集成
59
+
60
+ > TODO: 记录运行测试的 CI 检查,以及哪些检查属于阻塞项或信息项。
61
+
62
+ ### 5. 报告服务
63
+
64
+ > TODO: 记录外部报告服务、徽章或构件,以及它们是否影响验收。
@@ -11,7 +11,7 @@ description: >
11
11
  ## Boundary / Critical Rules
12
12
 
13
13
  - This skill only outputs a requirements analysis document (`analysis.md` or `analysis-r{N}.md`) and does not modify any business code
14
- - Base the analysis strictly on the existing requirements, context, and source information in `task.md`
14
+ - Base the analysis strictly on the existing task input, requirements, context, and source information in `task.md`
15
15
  - After executing this skill, you **must** immediately update task status in task.md
16
16
 
17
17
  Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
@@ -56,6 +56,7 @@ Run `agent-infra-internal task-artifact {task-id} inspect --family analysis`. Co
56
56
  ### 3. Read Task Context
57
57
 
58
58
  Read `task.md` carefully to understand:
59
+ - sources, facts and evidence, constraints, decision states, acceptance criteria, and open questions captured under `## Task Input` (fall back compatibly when the section is absent)
59
60
  - task title, description, and requirement list
60
61
  - context information (Issue, PR, branch, alert numbers, etc.)
61
62
  - currently known affected files and constraints
@@ -89,6 +90,8 @@ Runs after Step 0 state check and Step 3 (questioning is an external-state actio
89
90
  - no answer carried → restate `pending_question` and take Scenario B early-exit below (do not increase `question_count`).
90
91
 
91
92
  **4.3 Sufficiency judgment** (objective checklist; any gap hit means insufficient):
93
+ - first aggregate `## Task Input`, description, context, requirements, and remote sources; an analysis-owned `## Requirements` section being unpopulated is not by itself insufficient;
94
+ - goals, scope, constraints, or acceptance criteria already recorded in task input count as provided and must not be asked again;
92
95
  - description/requirements empty, or a single sentence with no verifiable acceptance criteria;
93
96
  - missing goal or impact scope (unclear what to change / who is affected);
94
97
  - requirement items contradict each other, or key terms are undefined and block analysis.
@@ -227,9 +230,11 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
227
230
 
228
231
  > Execute this step only after the verification gate passes.
229
232
 
230
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the short id `NN` (falling back to the full TASK-id when unallocated or released); (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
233
+ > Before rendering next steps, read `.agents/rules/next-step-output.md`, invoke the shared helper only for the selected scenario, and insert its stdout at `{next-step-commands}`.
231
234
 
232
235
  Output format:
236
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill review-analysis --task-ref {task-ref}`.
237
+
233
238
  ```
234
239
  Analysis complete for task {task-id}.
235
240
 
@@ -242,9 +247,7 @@ Output file:
242
247
  - Analysis report: .agents/workspace/active/{task-id}/{analysis-artifact}
243
248
 
244
249
  Next step - review the analysis:
245
- - Claude Code / OpenCode: /review-analysis {task-ref}
246
- - Gemini CLI: /{{project}}:review-analysis {task-ref}
247
- - Codex CLI: $review-analysis {task-ref}
250
+ {next-step-commands}
248
251
  ```
249
252
 
250
253
  ## Completion Checklist
@@ -256,7 +259,7 @@ Next step - review the analysis:
256
259
  - [ ] Updated `assigned_to` in task.md
257
260
  - [ ] Appended an Activity Log entry to task.md
258
261
  - [ ] Marked requirement-analysis as complete in workflow progress
259
- - [ ] Informed the user of the next step (must include all TUI command formats, including any custom TUIs; do not filter)
262
+ - [ ] Rendered the selected next-step commands through the shared helper
260
263
  - [ ] **Did not modify any business code**
261
264
 
262
265
  ## STOP
@@ -11,7 +11,7 @@ description: >
11
11
  ## 行为边界 / 关键规则
12
12
 
13
13
  - 本技能仅产出需求分析文档(`analysis.md` 或 `analysis-r{N}.md`)—— 不修改任何业务代码
14
- - 严格基于 `task.md` 中已有的需求、上下文和来源信息展开分析
14
+ - 严格基于 `task.md` 中已有的任务输入、需求、上下文和来源信息展开分析
15
15
  - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
16
16
 
17
17
  版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
@@ -59,6 +59,7 @@ agent-infra-internal task-event {task-id} analyze.started --agent {agent}
59
59
  ### 3. 阅读任务上下文
60
60
 
61
61
  仔细阅读 `task.md` 以理解:
62
+ - `## 任务输入` 中已捕获的来源、事实与证据、约束、决策状态、验收标准和未决事项(栏目不存在时兼容回退)
62
63
  - 任务标题、描述和需求列表
63
64
  - 上下文信息(Issue、PR、分支、告警编号等)
64
65
  - 当前已知的受影响文件和约束
@@ -92,6 +93,8 @@ agent-infra-internal task-event {task-id} analyze.started --agent {agent}
92
93
  - 未携带答案 → 复述 `pending_question`,按下文场景 B 提问早退(不增加 `question_count`)。
93
94
 
94
95
  **4.3 充分性判定**(客观清单,命中任一缺口即判为不足):
96
+ - 先聚合 `## 任务输入`、描述、上下文、需求及远端来源;分析阶段尚未填写 `## 需求` 本身不构成不足;
97
+ - 已在任务输入中记录的目标、范围、约束或验收标准视为已提供,不得重复询问;
95
98
  - 描述/需求为空,或仅一句话且无可验证的验收标准;
96
99
  - 缺少目标或受影响范围(不知道要改什么 / 影响谁);
97
100
  - 需求条目自相矛盾,或关键名词未定义而无法分析。
@@ -226,9 +229,11 @@ agent-infra-internal task-verify {task-id} analyze.completed --artifact {analysi
226
229
 
227
230
  > 仅在校验通过后执行本步骤。
228
231
 
229
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
232
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
230
233
 
231
234
  输出格式:
235
+ 使用 `agent-infra-internal agent-client next-steps --skill review-analysis --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
236
+
232
237
  ```
233
238
  任务 {task-id} 分析完成。
234
239
 
@@ -241,9 +246,7 @@ agent-infra-internal task-verify {task-id} analyze.completed --artifact {analysi
241
246
  - 分析报告:.agents/workspace/active/{task-id}/{analysis-artifact}
242
247
 
243
248
  下一步 - 审查需求分析:
244
- - Claude Code / OpenCode:/review-analysis {task-ref}
245
- - Gemini CLI:/{{project}}:review-analysis {task-ref}
246
- - Codex CLI:$review-analysis {task-ref}
249
+ {next-step-commands}
247
250
  ```
248
251
 
249
252
  ## 完成检查清单
@@ -255,7 +258,7 @@ agent-infra-internal task-verify {task-id} analyze.completed --artifact {analysi
255
258
  - [ ] 更新了 task.md 中的 `assigned_to`
256
259
  - [ ] 追加了 Activity Log 条目到 task.md
257
260
  - [ ] 在工作流进度中标记了 requirement-analysis 为已完成
258
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,含自定义 TUI,不要筛选)
261
+ - [ ] 已通过统一 helper 渲染已选场景的下一步命令
259
262
  - [ ] **没有修改任何业务代码**
260
263
 
261
264
  ## 停止
@@ -95,11 +95,13 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
95
95
 
96
96
  > Execute this step only after the verification gate passes.
97
97
 
98
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the short id `NN` (falling back to the full TASK-id when unallocated or released); (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
98
+ > Before rendering next steps, read `.agents/rules/next-step-output.md`, invoke the shared helper only for the selected scenario, and insert its stdout at `{next-step-commands}`.
99
99
 
100
100
  > **Optional sandbox-cleanup hint (gated)**: Render the "Optional: clean up this task's sandbox" block — placed after "Archived to" and before "To unblock" in the output below — only when BOTH (1) `.agents/.airc.json` has a `sandbox` field and (2) task.md's `branch` field exists and is not `main` / `master`; otherwise omit the whole block. `{branch}` is the `branch` value from the task.md you already loaded (the task has moved to blocked/, so read it from `.agents/workspace/blocked/{task-id}/task.md`). This block is independent of "Next step" semantics.
101
101
 
102
102
  Output format:
103
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill check-task --task-ref {task-ref}`.
104
+
103
105
  ```
104
106
  Task {task-id} marked as blocked.
105
107
 
@@ -116,9 +118,7 @@ To unblock when the issue is resolved:
116
118
  agent-infra-internal task-lifecycle {task-id} activate --agent {agent} --note "{activation note}"
117
119
 
118
120
  Next step - check task status after unblocking:
119
- - Claude Code / OpenCode: /check-task {task-ref}
120
- - Gemini CLI: /{{project}}:check-task {task-ref}
121
- - Codex CLI: $check-task {task-ref}
121
+ {next-step-commands}
122
122
  ```
123
123
 
124
124
 
@@ -96,11 +96,13 @@ agent-infra-internal task-verify {task-id} block-task.completed --format text
96
96
 
97
97
  > 仅在校验通过后执行本步骤。
98
98
 
99
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
99
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
100
100
 
101
101
  > **可选沙箱清理提示(门控渲染)**:仅当同时满足 (1) `.agents/.airc.json` 存在 `sandbox` 字段、(2) task.md 的 `branch` 字段存在且不是 `main` / `master` 时,才渲染下方输出中「归档路径」之后、「解除阻塞时执行」之前的「可选:清理本任务的沙箱」块;任一不满足则整段省略。`{branch}` 取已读入的 task.md 的 `branch` 值(任务此时已移动到 blocked/,从 `.agents/workspace/blocked/{task-id}/task.md` 读取)。该块独立于「下一步」语义。
102
102
 
103
103
  输出格式:
104
+ 使用 `agent-infra-internal agent-client next-steps --skill check-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
105
+
104
106
  ```
105
107
  任务 {task-id} 已标记为阻塞。
106
108
 
@@ -117,9 +119,7 @@ ai sandbox rm {branch}
117
119
  agent-infra-internal task-lifecycle {task-id} activate --agent {agent} --note "{恢复说明}"
118
120
 
119
121
  下一步 - 检查任务状态(解除阻塞后):
120
- - Claude Code / OpenCode:/check-task {task-ref}
121
- - Gemini CLI:/{{project}}:check-task {task-ref}
122
- - Codex CLI:$check-task {task-ref}
122
+ {next-step-commands}
123
123
  ```
124
124
 
125
125
 
@@ -102,11 +102,13 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
102
102
 
103
103
  > Execute this step only after the verification gate passes.
104
104
 
105
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the short id `NN` (falling back to the full TASK-id when unallocated or released); (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
105
+ > Before rendering next steps, read `.agents/rules/next-step-output.md`, invoke the shared helper only for the selected scenario, and insert its stdout at `{next-step-commands}`.
106
106
 
107
107
  > **Optional sandbox-cleanup hint (gated)**: Render the "Optional: clean up this task's sandbox" block — placed after "Target path" and before "Next step" in the output below — only when BOTH (1) `.agents/.airc.json` has a `sandbox` field and (2) task.md's `branch` field exists and is not `main` / `master`; otherwise omit the whole block. `{branch}` is the `branch` value from the task.md you already loaded (the task has moved to completed/, so read it from `.agents/workspace/completed/{task-id}/task.md`). This block is independent of "Next steps" semantics.
108
108
 
109
109
  Output format:
110
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill check-task --task-ref {task-ref}`.
111
+
110
112
  ```
111
113
  Task {task-id} cancelled; task directory moved to completed/.
112
114
 
@@ -120,9 +122,7 @@ Optional: clean up this task's sandbox
120
122
  ai sandbox rm {branch}
121
123
 
122
124
  Next step - inspect the moved task:
123
- - Claude Code / OpenCode: /check-task {task-ref}
124
- - Gemini CLI: /{{project}}:check-task {task-ref}
125
- - Codex CLI: $check-task {task-ref}
125
+ {next-step-commands}
126
126
  ```
127
127
 
128
128
 
@@ -101,11 +101,13 @@ agent-infra-internal task-verify {task-id} cancel-task.completed --format text
101
101
 
102
102
  > 仅在校验通过后执行本步骤。
103
103
 
104
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
104
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
105
105
 
106
106
  > **可选沙箱清理提示(门控渲染)**:仅当同时满足 (1) `.agents/.airc.json` 存在 `sandbox` 字段、(2) task.md 的 `branch` 字段存在且不是 `main` / `master` 时,才渲染下方输出中「目标路径」之后、「下一步」之前的「可选:清理本任务的沙箱」块;任一不满足则整段省略。`{branch}` 取已读入的 task.md 的 `branch` 值(任务此时已移动到 completed/,从 `.agents/workspace/completed/{task-id}/task.md` 读取)。该块独立于「下一步」语义。
107
107
 
108
108
  输出格式:
109
+ 使用 `agent-infra-internal agent-client next-steps --skill check-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
110
+
109
111
  ```
110
112
  任务 {task-id} 已取消,任务目录已转移到 completed/。
111
113
 
@@ -119,9 +121,7 @@ agent-infra-internal task-verify {task-id} cancel-task.completed --format text
119
121
  ai sandbox rm {branch}
120
122
 
121
123
  下一步 - 查看已转移任务:
122
- - Claude Code / OpenCode:/check-task {task-ref}
123
- - Gemini CLI:/{{project}}:check-task {task-ref}
124
- - Codex CLI:$check-task {task-ref}
124
+ {next-step-commands}
125
125
  ```
126
126
 
127
127
 
@@ -132,7 +132,7 @@ ai sandbox rm {branch}
132
132
  - [ ] 已将任务目录移动到 `.agents/workspace/completed/`
133
133
  - [ ] 已在存在 Issue 时完成 Issue 同步
134
134
  - [ ] 已运行 gate 校验并通过
135
- - [ ] 已向用户展示完整的下一步命令(含自定义 TUI)
135
+ - [ ] 已通过统一 helper 渲染已选场景的下一步命令
136
136
 
137
137
  ## 注意事项
138
138
 
@@ -59,7 +59,7 @@ Workflow progress:
59
59
 
60
60
  ### 3. Recommend Next Action
61
61
 
62
- Recommend the appropriate next skill based on the current workflow state. You must show command formats for all TUI columns in the table below, not just the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name).
62
+ Recommend the appropriate next skill based on the current workflow state.
63
63
 
64
64
  > **⚠️ CONDITION CHECK — you must choose the single matching row in the table below based on `status`, `current_step`, the latest artifacts, and the latest review result:**
65
65
  >
@@ -77,21 +77,21 @@ Recommend the appropriate next skill based on the current workflow state. You mu
77
77
  >
78
78
  > **Important: if the latest review report contains any issue at all, do not use the corresponding review-passed row. Use the corresponding has-issues row instead.**
79
79
  >
80
- > Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the table commands below as the short id `NN` (falling back to the full TASK-id when unallocated or released); (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
81
-
82
- | Current State | Claude Code / OpenCode | Gemini CLI | Codex CLI |
83
- |----------------------------|-----------------------------------------------------|------------------------------------------|-----------------------------------------------------|
84
- | Analysis Complete | `/review-analysis {task-ref}` | `/{{project}}:review-analysis {task-ref}` | `$review-analysis {task-ref}` |
85
- | Analysis Review Passed | `/plan-task {task-ref}` | `/{{project}}:plan-task {task-ref}` | `$plan-task {task-ref}` |
86
- | Analysis Review Has Issues | `/analyze-task {task-ref}` | `/{{project}}:analyze-task {task-ref}` | `$analyze-task {task-ref}` |
87
- | Plan Complete | `/review-plan {task-ref}` | `/{{project}}:review-plan {task-ref}` | `$review-plan {task-ref}` |
88
- | Plan Review Passed | `/code-task {task-ref}` | `/{{project}}:code-task {task-ref}` | `$code-task {task-ref}` |
89
- | Plan Review Has Issues | `/plan-task {task-ref}` | `/{{project}}:plan-task {task-ref}` | `$plan-task {task-ref}` |
90
- | Code Complete | `/review-code {task-ref}` | `/{{project}}:review-code {task-ref}` | `$review-code {task-ref}` |
91
- | Code Review Passed | `/commit` | `/{{project}}:commit` | `$commit` |
92
- | Code Review Has Issues | `/code-task {task-ref}` | `/{{project}}:code-task {task-ref}` | `$code-task {task-ref}` |
93
- | Task Blocked | Unblock the task or provide the missing information | — | Unblock the task or provide the missing information |
94
- | Task Completed | No action needed | — | No action needed |
80
+ > Before rendering the final output, read `.agents/rules/next-step-output.md`. After selecting an actionable row, invoke `agent-infra-internal agent-client next-steps --skill {next-skill} [--task-ref {task-ref}]` exactly once and render stdout verbatim as `{next-step-commands}`. Do not invoke the helper for `Task Blocked` or `Task Completed`. Append the `Completed at` trailing line last.
81
+
82
+ | Current State | next skill | task ref |
83
+ |----------------------------|-------------------|----------|
84
+ | Analysis Complete | `review-analysis` | required |
85
+ | Analysis Review Passed | `plan-task` | required |
86
+ | Analysis Review Has Issues | `analyze-task` | required |
87
+ | Plan Complete | `review-plan` | required |
88
+ | Plan Review Passed | `code-task` | required |
89
+ | Plan Review Has Issues | `plan-task` | required |
90
+ | Code Complete | `review-code` | required |
91
+ | Code Review Passed | `commit` | omitted |
92
+ | Code Review Has Issues | `code-task` | required |
93
+ | Task Blocked | — | — |
94
+ | Task Completed | — | — |
95
95
 
96
96
  ## Notes
97
97
 
@@ -59,7 +59,7 @@ ai task status {task-id}
59
59
 
60
60
  ### 3. 建议下一步操作
61
61
 
62
- 根据当前工作流状态,建议合适的下一个技能。必须展示下表中所有 TUI 列的命令格式,不要只展示当前 AI 代理对应的列。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名):
62
+ 根据当前工作流状态,建议合适的下一个技能:
63
63
 
64
64
  > **⚠️ 条件判断 — 你必须先根据 `status`、`current_step`、最新产物和最新审查结果,选择下表中唯一匹配的一行:**
65
65
  >
@@ -77,21 +77,21 @@ ai task status {task-id}
77
77
  >
78
78
  > **特别注意:只要最新审查报告中存在任何问题,就不能使用对应「审查通过」行。必须改用对应「审查有问题」行。**
79
79
  >
80
- > 渲染最终输出前先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 下方表格中命令的 `{task-ref}` 渲染为短号 `NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
81
-
82
- | 当前状态 | Claude Code / OpenCode | Gemini CLI | Codex CLI |
83
- |--------------------|------------------------------|------------------------------------------|------------------------------|
84
- | 分析完成 | `/review-analysis {task-ref}` | `/{{project}}:review-analysis {task-ref}` | `$review-analysis {task-ref}` |
85
- | 需求分析审查通过 | `/plan-task {task-ref}` | `/{{project}}:plan-task {task-ref}` | `$plan-task {task-ref}` |
86
- | 需求分析审查有问题 | `/analyze-task {task-ref}` | `/{{project}}:analyze-task {task-ref}` | `$analyze-task {task-ref}` |
87
- | 计划完成 | `/review-plan {task-ref}` | `/{{project}}:review-plan {task-ref}` | `$review-plan {task-ref}` |
88
- | 技术方案审查通过 | `/code-task {task-ref}` | `/{{project}}:code-task {task-ref}` | `$code-task {task-ref}` |
89
- | 技术方案审查有问题 | `/plan-task {task-ref}` | `/{{project}}:plan-task {task-ref}` | `$plan-task {task-ref}` |
90
- | 实现完成 | `/review-code {task-ref}` | `/{{project}}:review-code {task-ref}` | `$review-code {task-ref}` |
91
- | 代码审查通过 | `/commit` | `/{{project}}:commit` | `$commit` |
92
- | 代码审查有问题 | `/code-task {task-ref}` | `/{{project}}:code-task {task-ref}` | `$code-task {task-ref}` |
93
- | 任务被阻塞 | 解除阻塞或提供所需信息 | — | 解除阻塞或提供所需信息 |
94
- | 任务已完成 | 无需操作 | — | 无需操作 |
80
+ > 渲染最终输出前先读取 `.agents/rules/next-step-output.md`。选中可执行行后只调用一次 `agent-infra-internal agent-client next-steps --skill {next-skill} [--task-ref {task-ref}]`,将 stdout 原样输出为 `{next-step-commands}`;`任务被阻塞` 与 `任务已完成` 不调用 helper。最后追加 `Completed at` 收尾行。
81
+
82
+ | 当前状态 | next skill | task ref |
83
+ |--------------------|-------------------|----------|
84
+ | 分析完成 | `review-analysis` | required |
85
+ | 需求分析审查通过 | `plan-task` | required |
86
+ | 需求分析审查有问题 | `analyze-task` | required |
87
+ | 计划完成 | `review-plan` | required |
88
+ | 技术方案审查通过 | `code-task` | required |
89
+ | 技术方案审查有问题 | `plan-task` | required |
90
+ | 实现完成 | `review-code` | required |
91
+ | 代码审查通过 | `commit` | omitted |
92
+ | 代码审查有问题 | `code-task` | required |
93
+ | 任务被阻塞 | — | — |
94
+ | 任务已完成 | — | — |
95
95
 
96
96
  ## 注意事项
97
97
 
@@ -89,10 +89,12 @@ Only `status=applied|no-op` means local archival completed. If the API dismissal
89
89
 
90
90
  ### 8. Inform User
91
91
 
92
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the short id `NN` (falling back to the full TASK-id when unallocated or released); (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
92
+ > Before rendering next steps, read `.agents/rules/next-step-output.md`, invoke the shared helper only for the selected scenario, and insert its stdout at `{next-step-commands}`.
93
93
 
94
94
  > **Optional sandbox-cleanup hint (gated)**: Render the "Optional: clean up this task's sandbox" block — placed after the "Note:" line and before "Next step" in the output below — only when ALL of (1) `.agents/.airc.json` has a `sandbox` field, (2) step 7 located a related task by the alert number, and (3) that related task's task.md `branch` field exists and is not `main` / `master`; otherwise omit the whole block. `{branch}` is the `branch` value from the related task.md located in step 7. This block is independent of "Next step" semantics.
95
95
 
96
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}`.
97
+
96
98
  ```
97
99
  Code Scanning alert #{alert-number} dismissed.
98
100
 
@@ -111,9 +113,7 @@ Optional: clean up this task's sandbox
111
113
  ai sandbox rm {branch}
112
114
 
113
115
  Next step - complete and archive the task if a related task exists:
114
- - Claude Code / OpenCode: /complete-task {task-ref}
115
- - Gemini CLI: /{{project}}:complete-task {task-ref}
116
- - Codex CLI: $complete-task {task-ref}
116
+ {next-step-commands}
117
117
  ```
118
118
 
119
119
  ## Notes
@@ -89,10 +89,12 @@ agent-infra-internal task-lifecycle {task-id} close-codescan --agent {agent} \
89
89
 
90
90
  ### 8. 告知用户
91
91
 
92
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
92
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
93
93
 
94
94
  > **可选沙箱清理提示(门控渲染)**:仅当同时满足 (1) `.agents/.airc.json` 存在 `sandbox` 字段、(2) 第 7 步按告警号定位到了关联任务、(3) 该关联任务 task.md 的 `branch` 字段存在且不是 `main` / `master` 时,才渲染下方输出中「注意:…」之后、「下一步」之前的「可选:清理本任务的沙箱」块;任一不满足则整段省略。`{branch}` 取第 7 步定位到的关联任务 task.md 的 `branch` 值。该块独立于「下一步」语义。
95
95
 
96
+ 使用 `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
97
+
96
98
  ```
97
99
  Code Scanning 告警 #{alert-number} 已关闭。
98
100
 
@@ -111,9 +113,7 @@ Code Scanning 告警 #{alert-number} 已关闭。
111
113
  ai sandbox rm {branch}
112
114
 
113
115
  下一步 - 完成并归档任务(如有关联任务):
114
- - Claude Code / OpenCode:/complete-task {task-ref}
115
- - Gemini CLI:/{{project}}:complete-task {task-ref}
116
- - Codex CLI:$complete-task {task-ref}
116
+ {next-step-commands}
117
117
  ```
118
118
 
119
119
  ## 注意事项
@@ -97,10 +97,12 @@ Only `status=applied|no-op` means local archival completed. If the API dismissal
97
97
 
98
98
  ### 8. Inform User
99
99
 
100
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the short id `NN` (falling back to the full TASK-id when unallocated or released); (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
100
+ > Before rendering next steps, read `.agents/rules/next-step-output.md`, invoke the shared helper only for the selected scenario, and insert its stdout at `{next-step-commands}`.
101
101
 
102
102
  > **Optional sandbox-cleanup hint (gated)**: Render the "Optional: clean up this task's sandbox" block — placed after the "Note:" line and before "Next step" in the output below — only when ALL of (1) `.agents/.airc.json` has a `sandbox` field, (2) step 7 located a related task by the alert number, and (3) that related task's task.md `branch` field exists and is not `main` / `master`; otherwise omit the whole block. `{branch}` is the `branch` value from the related task.md located in step 7. This block is independent of "Next step" semantics.
103
103
 
104
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}`.
105
+
104
106
  ```
105
107
  Security alert #{alert-number} dismissed.
106
108
 
@@ -119,9 +121,7 @@ Optional: clean up this task's sandbox
119
121
  ai sandbox rm {branch}
120
122
 
121
123
  Next step - complete and archive the task if a related task exists:
122
- - Claude Code / OpenCode: /complete-task {task-ref}
123
- - Gemini CLI: /{{project}}:complete-task {task-ref}
124
- - Codex CLI: $complete-task {task-ref}
124
+ {next-step-commands}
125
125
  ```
126
126
 
127
127
  ## Notes
@@ -97,10 +97,12 @@ agent-infra-internal task-lifecycle {task-id} close-dependabot --agent {agent} \
97
97
 
98
98
  ### 8. 告知用户
99
99
 
100
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
100
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
101
101
 
102
102
  > **可选沙箱清理提示(门控渲染)**:仅当同时满足 (1) `.agents/.airc.json` 存在 `sandbox` 字段、(2) 第 7 步按告警号定位到了关联任务、(3) 该关联任务 task.md 的 `branch` 字段存在且不是 `main` / `master` 时,才渲染下方输出中「注意:…」之后、「下一步」之前的「可选:清理本任务的沙箱」块;任一不满足则整段省略。`{branch}` 取第 7 步定位到的关联任务 task.md 的 `branch` 值。该块独立于「下一步」语义。
103
103
 
104
+ 使用 `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
105
+
104
106
  ```
105
107
  安全告警 #{alert-number} 已关闭。
106
108
 
@@ -119,9 +121,7 @@ agent-infra-internal task-lifecycle {task-id} close-dependabot --agent {agent} \
119
121
  ai sandbox rm {branch}
120
122
 
121
123
  下一步 - 完成并归档任务(如有关联任务):
122
- - Claude Code / OpenCode:/complete-task {task-ref}
123
- - Gemini CLI:/{{project}}:complete-task {task-ref}
124
- - Codex CLI:$complete-task {task-ref}
124
+ {next-step-commands}
125
125
  ```
126
126
 
127
127
  ## 注意事项
@@ -122,6 +122,6 @@ agent-infra-internal task-verify {task-id} code.completed --artifact {code-artif
122
122
 
123
123
  ### 12. Tell the User
124
124
 
125
- Use `reference/output-template.md` (or `reference/fix-mode.md` in fix mode) and show all TUI command formats.
125
+ Use `reference/output-template.md` (or `reference/fix-mode.md` in fix mode) and render the selected next-step commands through the shared helper.
126
126
 
127
127
  > Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the current task's short id `NN` (see that file for lookup and fallback), while other `{task-id}` placeholders (report titles, paths) keep the full TASK-id form; (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
@@ -178,7 +178,7 @@ agent-infra-internal task-verify {task-id} code.completed --artifact {code-artif
178
178
 
179
179
  > 仅在校验通过后执行本步骤。
180
180
 
181
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。输出格式见 `reference/output-template.md`;修复模式输出见 `reference/fix-mode.md`。
181
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,并按 `reference/output-template.md` 或 `reference/fix-mode.md` 的已选场景调用统一 helper。
182
182
 
183
183
  > 渲染最终输出前先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令的 `{task-ref}` 渲染为当前任务短号 `NN`(取值与回退见该文件),其他 `{task-id}` 占位(报告标题、路径)保持完整 TASK-id 形式;(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
184
184
 
@@ -188,7 +188,7 @@ agent-infra-internal task-verify {task-id} code.completed --artifact {code-artif
188
188
  - [ ] 已创建 `{code-artifact}`
189
189
  - [ ] 所有必需测试通过
190
190
  - [ ] 已更新 task.md 并追加 Activity Log
191
- - [ ] 已向用户展示所有 TUI 格式的下一步命令(含自定义 TUI)
191
+ - [ ] 已通过统一 helper 渲染已选场景的下一步命令
192
192
 
193
193
  ## 停止
194
194
 
@@ -51,13 +51,11 @@ Before writing the code report, run the project's **core subset** as final verif
51
51
 
52
52
  Decision rules:
53
53
  1. always recommend re-review as the default next step, regardless of the severity of fixed issues
54
- 2. direct commit may be offered as an additional option only when all issues are resolved and changes are clearly low risk
55
- 3. if any `Blocker` or `Major` remains unresolved, do not offer direct commit as an option
54
+ 2. direct commit may be selected only when all issues are resolved and the changes are clearly low risk
55
+ 3. do not select direct commit while any `Blocker` or `Major` remains unresolved
56
+ 4. render only the selected branch and invoke the helper exactly once
56
57
 
57
- Prohibition:
58
- - never present direct commit as the only next step — re-review must always be the primary recommendation
59
-
60
- Required output template:
58
+ For the default branch, populate `{next-step-commands}` by running `agent-infra-internal agent-client next-steps --skill review-code --task-ref {task-ref}`:
61
59
 
62
60
  ```text
63
61
  Task {task-id} fix completed.
@@ -71,15 +69,15 @@ Fix status:
71
69
  - Review input: {review-artifact}
72
70
  - Code artifact: {code-artifact}
73
71
 
74
- Next step - re-review or commit:
75
- - Re-review (always recommended):
76
- - Claude Code / OpenCode: /review-code {task-ref}
77
- - Gemini CLI: /{{project}}:review-code {task-ref}
78
- - Codex CLI: $review-code {task-ref}
79
- - Commit directly (optional; only when all issues are resolved and changes are low risk):
80
- - Claude Code / OpenCode: /commit
81
- - Gemini CLI: /{{project}}:commit
82
- - Codex CLI: $commit
72
+ Next step - review again:
73
+ {next-step-commands}
74
+ ```
75
+
76
+ Only when the direct-commit branch satisfies the rules above and is selected, populate `{next-step-commands}` by running `agent-infra-internal agent-client next-steps --skill commit`, then replace the ending with:
77
+
78
+ ```text
79
+ Next step - commit directly:
80
+ {next-step-commands}
83
81
  ```
84
82
 
85
83
  ## Notes
@@ -88,5 +86,5 @@ Next step - re-review or commit:
88
86
  2. **No auto-commit**: do not run `git commit`
89
87
  3. **Scope discipline**: verify each reviewed issue one by one — fix it if it holds, rebut it if it does not; do not expand to issues the review did not list
90
88
  4. **Disagreement handling**: record any disagreement in the report
91
- 5. **Re-review**: always recommend `review-code` as the default next step after fix mode
89
+ 5. **Re-review**: recommend `review-code` as the default next step after fix mode
92
90
  6. **Consistency**: the latest review artifact, Activity Log entry, and code report must reference the same round
@@ -51,13 +51,11 @@ manual-validation 项不在修复范围。处理规则:
51
51
 
52
52
  判断规则:
53
53
  1. 始终将重新审查作为默认推荐的下一步,无论本轮修复了哪个级别的问题
54
- 2. 直接提交仅可作为附加选项,且仅在所有问题均已解决且改动明显低风险时
55
- 3. 如果仍有任何 `Blocker` 或 `Major` 未解决,不要提供直接提交选项
54
+ 2. 直接提交仅可作为已选分支,且仅在所有问题均已解决且改动明显低风险时
55
+ 3. 如果仍有任何 `Blocker` 或 `Major` 未解决,不要选择直接提交
56
+ 4. 只渲染已选分支,且只调用一次 helper
56
57
 
57
- 禁止规则:
58
- - 绝对不要把直接提交写成唯一下一步——重新审查必须始终作为首要推荐
59
-
60
- 必用输出模板:
58
+ 默认分支使用 `agent-infra-internal agent-client next-steps --skill review-code --task-ref {task-ref}` 生成 `{next-step-commands}`:
61
59
 
62
60
  ```text
63
61
  任务 {task-id} 修复完成。
@@ -71,15 +69,15 @@ manual-validation 项不在修复范围。处理规则:
71
69
  - 审查输入:{review-artifact}
72
70
  - 修复产物:{code-artifact}
73
71
 
74
- 下一步 - 重新审查或提交:
75
- - 重新审查(始终推荐):
76
- - Claude Code / OpenCode:/review-code {task-ref}
77
- - Gemini CLI:/{{project}}:review-code {task-ref}
78
- - Codex CLI:$review-code {task-ref}
79
- - 直接提交(可选;仅在所有问题已解决且风险可控时):
80
- - Claude Code / OpenCode:/commit
81
- - Gemini CLI:/{{project}}:commit
82
- - Codex CLI:$commit
72
+ 下一步 - 重新审查:
73
+ {next-step-commands}
74
+ ```
75
+
76
+ 仅当直接提交分支满足上述条件并被选中时,改用 `agent-infra-internal agent-client next-steps --skill commit` 生成 `{next-step-commands}`,并将末尾替换为:
77
+
78
+ ```text
79
+ 下一步 - 直接提交:
80
+ {next-step-commands}
83
81
  ```
84
82
 
85
83
  ## 注意事项
@@ -88,5 +86,5 @@ manual-validation 项不在修复范围。处理规则:
88
86
  2. **禁止自动提交**:不要执行 `git commit`
89
87
  3. **范围约束**:逐条核实审查列出的问题,成立则修复、不成立则反驳;不扩大到审查未列出的问题
90
88
  4. **分歧处理**:如果不同意审查意见,要在报告里明确记录
91
- 5. **重新审查**:修复后始终推荐执行 `review-code`
89
+ 5. **重新审查**:修复后默认推荐执行 `review-code`
92
90
  6. **一致性**:最新审查产物、Activity Log 记录和修复报告必须引用同一轮次