@fitlab-ai/agent-infra 0.9.1 → 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 (283) hide show
  1. package/README.md +16 -4
  2. package/README.zh-CN.md +16 -4
  3. package/bin/cli.ts +12 -0
  4. package/dist/bin/cli.js +14 -0
  5. package/dist/bin/internal-cli.js +15 -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/release-workflow.js +71 -16
  31. package/dist/lib/internal/task-orchestration.js +151 -0
  32. package/dist/lib/internal/task-review.js +65 -0
  33. package/dist/lib/merge.js +2 -1
  34. package/dist/lib/platform/adapters.js +38 -1
  35. package/dist/lib/platform/change-request-git-evidence.js +113 -0
  36. package/dist/lib/platform/merged-pr-equivalence.js +41 -11
  37. package/dist/lib/platform/pr-checks.js +38 -10
  38. package/dist/lib/platform/pull-requests.js +110 -6
  39. package/dist/lib/platform/releases.js +1 -1
  40. package/dist/lib/platform/verification-required.js +8 -10
  41. package/dist/lib/prompt.js +15 -3
  42. package/dist/lib/release/channels.js +4 -1
  43. package/dist/lib/release/workflow.js +4 -2
  44. package/dist/lib/remove-dir.js +25 -0
  45. package/dist/lib/run/tui.js +8 -2
  46. package/dist/lib/sandbox/agent-client-reconciler.js +234 -0
  47. package/dist/lib/sandbox/clipboard/linux.js +2 -1
  48. package/dist/lib/sandbox/commands/create.js +76 -180
  49. package/dist/lib/sandbox/commands/enter.js +17 -1
  50. package/dist/lib/sandbox/commands/prune.js +2 -2
  51. package/dist/lib/sandbox/commands/rm.js +3 -2
  52. package/dist/lib/sandbox/config.js +21 -4
  53. package/dist/lib/sandbox/constants.js +3 -0
  54. package/dist/lib/sandbox/dockerfile.js +2 -1
  55. package/dist/lib/sandbox/managed-fs.js +10 -5
  56. package/dist/lib/sandbox/recovery.js +52 -36
  57. package/dist/lib/sandbox/shell.js +1 -1
  58. package/dist/lib/sandbox/tool-types.js +8 -0
  59. package/dist/lib/sandbox/tools.js +2 -126
  60. package/dist/lib/task/artifact-lifecycle.js +1 -49
  61. package/dist/lib/task/commands/decisions.js +50 -20
  62. package/dist/lib/task/delegation-receipts.js +107 -0
  63. package/dist/lib/task/events.js +100 -1
  64. package/dist/lib/task/orchestration.js +420 -0
  65. package/dist/lib/task/review-artifacts.js +143 -59
  66. package/dist/lib/task/review-finalization.js +166 -0
  67. package/dist/lib/task/review-fingerprint.js +4 -0
  68. package/dist/lib/task/verification-checks.js +2 -1
  69. package/dist/lib/task/verification-engine.js +156 -28
  70. package/dist/lib/task/verification-review.js +1 -1
  71. package/dist/lib/task/verification.js +3 -1
  72. package/dist/lib/task/workspace-snapshot.js +34 -0
  73. package/dist/lib/update.js +42 -161
  74. package/lib/agent-client.ts +214 -0
  75. package/lib/agent-clients/adapter.ts +461 -0
  76. package/lib/agent-clients/adapters/claude-code.ts +70 -0
  77. package/lib/agent-clients/adapters/codex-sandbox.ts +245 -0
  78. package/lib/agent-clients/adapters/codex.ts +58 -0
  79. package/lib/agent-clients/adapters/gemini-cli.ts +65 -0
  80. package/lib/agent-clients/adapters/index.ts +27 -0
  81. package/lib/agent-clients/adapters/opencode.ts +66 -0
  82. package/lib/agent-clients/config.ts +278 -0
  83. package/lib/agent-clients/custom-tuis.ts +149 -0
  84. package/lib/agent-clients/invocation.ts +19 -0
  85. package/lib/agent-clients/next-steps.ts +72 -0
  86. package/lib/agent-clients/project-assets.ts +96 -0
  87. package/lib/agent-clients/reconcile.ts +324 -0
  88. package/lib/agent-clients/registry.ts +144 -0
  89. package/lib/agent-clients/schema.ts +62 -0
  90. package/lib/agent-clients/types.ts +78 -0
  91. package/lib/benchmark/schemas/v1.0.0/case-manifest.schema.json +120 -0
  92. package/lib/benchmark/schemas/v1.0.0/common.schema.json +109 -0
  93. package/lib/benchmark/schemas/v1.0.0/grader-result.schema.json +160 -0
  94. package/lib/benchmark/schemas/v1.0.0/run-manifest.schema.json +122 -0
  95. package/lib/benchmark/schemas/v1.0.0/subject.schema.json +227 -0
  96. package/lib/builtin-tuis.ts +16 -15
  97. package/lib/defaults.json +24 -12
  98. package/lib/git/review-snapshot.ts +39 -9
  99. package/lib/git/reviewed-commit-equivalence.ts +135 -0
  100. package/lib/init.ts +53 -121
  101. package/lib/internal/agent-client.ts +131 -0
  102. package/lib/internal/git-workflow.ts +1 -1
  103. package/lib/internal/release-workflow.ts +68 -16
  104. package/lib/internal/task-orchestration.ts +132 -0
  105. package/lib/internal/task-review.ts +65 -0
  106. package/lib/merge.ts +2 -1
  107. package/lib/platform/adapters.ts +142 -3
  108. package/lib/platform/change-request-git-evidence.ts +159 -0
  109. package/lib/platform/merged-pr-equivalence.ts +51 -14
  110. package/lib/platform/pr-checks.ts +50 -22
  111. package/lib/platform/pull-requests.ts +134 -25
  112. package/lib/platform/releases.ts +1 -1
  113. package/lib/platform/verification-required.ts +12 -10
  114. package/lib/prompt.ts +16 -3
  115. package/lib/release/channels.ts +4 -1
  116. package/lib/release/workflow.ts +4 -3
  117. package/lib/remove-dir.ts +28 -0
  118. package/lib/run/tui.ts +9 -1
  119. package/lib/sandbox/agent-client-reconciler.ts +378 -0
  120. package/lib/sandbox/clipboard/linux.ts +2 -1
  121. package/lib/sandbox/commands/create.ts +111 -192
  122. package/lib/sandbox/commands/enter.ts +23 -1
  123. package/lib/sandbox/commands/prune.ts +2 -2
  124. package/lib/sandbox/commands/rm.ts +3 -2
  125. package/lib/sandbox/config.ts +31 -4
  126. package/lib/sandbox/constants.ts +6 -0
  127. package/lib/sandbox/dockerfile.ts +2 -1
  128. package/lib/sandbox/managed-fs.ts +18 -5
  129. package/lib/sandbox/recovery.ts +98 -67
  130. package/lib/sandbox/shell.ts +1 -1
  131. package/lib/sandbox/tool-types.ts +143 -0
  132. package/lib/sandbox/tools.ts +5 -157
  133. package/lib/task/artifact-lifecycle.ts +1 -38
  134. package/lib/task/commands/decisions.ts +53 -20
  135. package/lib/task/delegation-receipts.ts +170 -0
  136. package/lib/task/events.ts +110 -2
  137. package/lib/task/orchestration.ts +543 -0
  138. package/lib/task/review-artifacts.ts +201 -69
  139. package/lib/task/review-finalization.ts +275 -0
  140. package/lib/task/review-fingerprint.ts +5 -0
  141. package/lib/task/verification-checks.ts +2 -1
  142. package/lib/task/verification-engine.ts +177 -28
  143. package/lib/task/verification-review.ts +1 -0
  144. package/lib/task/verification.ts +5 -2
  145. package/lib/task/workspace-snapshot.ts +36 -0
  146. package/lib/update.ts +48 -184
  147. package/package.json +2 -2
  148. package/templates/.agents/README.en.md +21 -20
  149. package/templates/.agents/README.zh-CN.md +21 -20
  150. package/templates/.agents/hooks/lifecycle-delegation.js +64 -0
  151. package/templates/.agents/rules/README.en.md +2 -0
  152. package/templates/.agents/rules/README.zh-CN.md +2 -0
  153. package/templates/.agents/rules/commit-and-pr.en.md +1 -0
  154. package/templates/.agents/rules/commit-and-pr.zh-CN.md +1 -0
  155. package/templates/.agents/rules/human-decision-context.en.md +14 -12
  156. package/templates/.agents/rules/human-decision-context.zh-CN.md +14 -12
  157. package/templates/.agents/rules/lifecycle-orchestration.en.md +21 -0
  158. package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +21 -0
  159. package/templates/.agents/rules/next-step-output.en.md +16 -0
  160. package/templates/.agents/rules/next-step-output.zh-CN.md +16 -0
  161. package/templates/.agents/rules/no-mid-flow-questions.en.md +2 -0
  162. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +2 -0
  163. package/templates/.agents/rules/release-commands.github.en.md +11 -5
  164. package/templates/.agents/rules/release-commands.github.zh-CN.md +11 -5
  165. package/templates/.agents/rules/review-handshake.en.md +4 -4
  166. package/templates/.agents/rules/review-handshake.zh-CN.md +4 -4
  167. package/templates/.agents/rules/review-method.en.md +113 -0
  168. package/templates/.agents/rules/review-method.zh-CN.md +98 -0
  169. package/templates/.agents/skills/analyze-task/SKILL.en.md +5 -5
  170. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +5 -5
  171. package/templates/.agents/skills/block-task/SKILL.en.md +4 -4
  172. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +4 -4
  173. package/templates/.agents/skills/cancel-task/SKILL.en.md +4 -4
  174. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +5 -5
  175. package/templates/.agents/skills/check-task/SKILL.en.md +16 -16
  176. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +16 -16
  177. package/templates/.agents/skills/close-codescan/SKILL.en.md +4 -4
  178. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +4 -4
  179. package/templates/.agents/skills/close-dependabot/SKILL.en.md +4 -4
  180. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +4 -4
  181. package/templates/.agents/skills/code-task/SKILL.en.md +1 -1
  182. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +2 -2
  183. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +14 -16
  184. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +14 -16
  185. package/templates/.agents/skills/code-task/reference/output-template.en.md +3 -3
  186. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +3 -3
  187. package/templates/.agents/skills/commit/SKILL.en.md +11 -1
  188. package/templates/.agents/skills/commit/SKILL.zh-CN.md +11 -1
  189. package/templates/.agents/skills/commit/reference/task-status-update.en.md +24 -28
  190. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +24 -28
  191. package/templates/.agents/skills/complete-task/SKILL.en.md +2 -2
  192. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +2 -2
  193. package/templates/.agents/skills/create-pr/SKILL.en.md +10 -10
  194. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +10 -10
  195. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +3 -3
  196. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +3 -3
  197. package/templates/.agents/skills/create-task/SKILL.en.md +11 -11
  198. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +11 -11
  199. package/templates/.agents/skills/import-codescan/SKILL.en.md +5 -5
  200. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +5 -5
  201. package/templates/.agents/skills/import-dependabot/SKILL.en.md +5 -5
  202. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +5 -5
  203. package/templates/.agents/skills/import-issue/SKILL.en.md +5 -5
  204. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
  205. package/templates/.agents/skills/init-labels/SKILL.en.md +4 -4
  206. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +4 -4
  207. package/templates/.agents/skills/init-milestones/SKILL.en.md +4 -4
  208. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +4 -4
  209. package/templates/.agents/skills/plan-task/SKILL.en.md +5 -5
  210. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +5 -5
  211. package/templates/.agents/skills/refine-title/SKILL.en.md +1 -1
  212. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -1
  213. package/templates/.agents/skills/release/SKILL.en.md +1 -1
  214. package/templates/.agents/skills/review-analysis/SKILL.en.md +13 -2
  215. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +14 -3
  216. package/templates/.agents/skills/review-analysis/config/verify.en.json +6 -0
  217. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +6 -0
  218. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +13 -15
  219. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +13 -15
  220. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +51 -5
  221. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +52 -6
  222. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +25 -22
  223. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +25 -22
  224. package/templates/.agents/skills/review-code/SKILL.en.md +28 -8
  225. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +28 -8
  226. package/templates/.agents/skills/review-code/config/verify.en.json +7 -0
  227. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +7 -0
  228. package/templates/.agents/skills/review-code/reference/concurrency-risks.en.md +25 -0
  229. package/templates/.agents/skills/review-code/reference/concurrency-risks.zh-CN.md +25 -0
  230. package/templates/.agents/skills/review-code/reference/cross-platform-risks.en.md +27 -0
  231. package/templates/.agents/skills/review-code/reference/cross-platform-risks.zh-CN.md +27 -0
  232. package/templates/.agents/skills/review-code/reference/documentation-antipatterns.en.md +13 -0
  233. package/templates/.agents/skills/review-code/reference/documentation-antipatterns.zh-CN.md +13 -0
  234. package/templates/.agents/skills/review-code/reference/migration-risks.en.md +25 -0
  235. package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +25 -0
  236. package/templates/.agents/skills/review-code/reference/output-templates.en.md +22 -24
  237. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +22 -24
  238. package/templates/.agents/skills/review-code/reference/report-template.en.md +54 -7
  239. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +54 -7
  240. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +29 -24
  241. package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +29 -24
  242. package/templates/.agents/skills/review-code/reference/security-risks.en.md +25 -0
  243. package/templates/.agents/skills/review-code/reference/security-risks.zh-CN.md +25 -0
  244. package/templates/.agents/skills/review-plan/SKILL.en.md +13 -2
  245. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +14 -3
  246. package/templates/.agents/skills/review-plan/config/verify.en.json +6 -0
  247. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +6 -0
  248. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +13 -15
  249. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +13 -15
  250. package/templates/.agents/skills/review-plan/reference/report-template.en.md +61 -5
  251. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +61 -5
  252. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +21 -24
  253. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +21 -24
  254. package/templates/.agents/skills/run-task/SKILL.en.md +22 -0
  255. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +22 -0
  256. package/templates/.agents/skills/run-task/config/verify.en.json +9 -0
  257. package/templates/.agents/skills/run-task/config/verify.zh-CN.json +9 -0
  258. package/templates/.agents/skills/test/SKILL.en.md +4 -4
  259. package/templates/.agents/skills/test/SKILL.zh-CN.md +4 -4
  260. package/templates/.agents/skills/test-integration/SKILL.en.md +4 -4
  261. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +4 -4
  262. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +5 -5
  263. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +5 -5
  264. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +647 -203
  265. package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +4 -4
  266. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +4 -4
  267. package/templates/.agents/skills/watch-pr/SKILL.en.md +8 -8
  268. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +8 -8
  269. package/templates/.claude/agents/agent-infra-lifecycle-executor.en.md +6 -0
  270. package/templates/.claude/agents/agent-infra-lifecycle-executor.zh-CN.md +6 -0
  271. package/templates/.claude/agents/agent-infra-lifecycle-reviewer.en.md +6 -0
  272. package/templates/.claude/agents/agent-infra-lifecycle-reviewer.zh-CN.md +6 -0
  273. package/templates/.claude/commands/run-task.en.md +8 -0
  274. package/templates/.claude/commands/run-task.zh-CN.md +8 -0
  275. package/templates/.claude/settings.json +24 -0
  276. package/templates/.codex/agents/agent-infra-lifecycle-executor.en.toml +3 -0
  277. package/templates/.codex/agents/agent-infra-lifecycle-executor.zh-CN.toml +3 -0
  278. package/templates/.codex/agents/agent-infra-lifecycle-reviewer.en.toml +3 -0
  279. package/templates/.codex/agents/agent-infra-lifecycle-reviewer.zh-CN.toml +3 -0
  280. package/templates/.gemini/commands/_project_/run-task.en.toml +8 -0
  281. package/templates/.gemini/commands/_project_/run-task.zh-CN.toml +8 -0
  282. package/templates/.opencode/commands/run-task.en.md +11 -0
  283. package/templates/.opencode/commands/run-task.zh-CN.md +11 -0
@@ -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 记录和修复报告必须引用同一轮次
@@ -2,6 +2,8 @@
2
2
 
3
3
  When reporting that implementation is complete, use the following standard format:
4
4
 
5
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill review-code --task-ref {task-ref}`.
6
+
5
7
  ```text
6
8
  Task {task-id} code implementation complete.
7
9
 
@@ -14,7 +16,5 @@ Output files:
14
16
  - Code report: .agents/workspace/active/{task-id}/{code-artifact}
15
17
 
16
18
  Next step - code review:
17
- - Claude Code / OpenCode: /review-code {task-ref}
18
- - Gemini CLI: /{{project}}:review-code {task-ref}
19
- - Codex CLI: $review-code {task-ref}
19
+ {next-step-commands}
20
20
  ```
@@ -2,6 +2,8 @@
2
2
 
3
3
  向用户汇报实现完成时,使用以下标准格式:
4
4
 
5
+ 使用 `agent-infra-internal agent-client next-steps --skill review-code --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
6
+
5
7
  ```text
6
8
  任务 {task-id} 实现完成。
7
9
 
@@ -14,7 +16,5 @@
14
16
  - 实现报告:.agents/workspace/active/{task-id}/{code-artifact}
15
17
 
16
18
  下一步 - 代码审查:
17
- - Claude Code / OpenCode:/review-code {task-ref}
18
- - Gemini CLI:/{{project}}:review-code {task-ref}
19
- - Codex CLI:$review-code {task-ref}
19
+ {next-step-commands}
20
20
  ```
@@ -11,6 +11,8 @@ Create a Git commit without overwriting user work and update the related task st
11
11
 
12
12
  When updating related `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
13
13
 
14
+ Direct invocation still requires explicit user authorization. For an active orchestration run, only its unconsumed one-use `commitAuthorization` is equivalent authorization for this round; orchestration core must consume it after success, and every other commit gate remains unchanged.
15
+
14
16
  ## Common Rationalizations and Rebuttals
15
17
 
16
18
  | Rationalization | Rebuttal |
@@ -98,7 +100,7 @@ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
98
100
 
99
101
  > The full five-case status matrix, prerequisite checks, and multi-TUI next-step commands live in `reference/task-status-update.md`. Read `reference/task-status-update.md` before updating task state.
100
102
 
101
- > **IMPORTANT**: When showing the next step, output every TUI command format in full and directly use the standard template from `reference/task-status-update.md`. 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).
103
+ > Before rendering next steps, read `.agents/rules/next-step-output.md` and invoke the shared helper for the scenario selected from `reference/task-status-update.md`.
102
104
 
103
105
  Append the Commit Activity Log entry and choose exactly one next-step case:
104
106
  - open PR and successful push -> `watch-pr {task-ref}`; this takes precedence over the final-commit `prFlow` route
@@ -142,6 +144,14 @@ Handle the result as follows:
142
144
 
143
145
  Keep the gate output in your reply as fresh evidence. Do not claim completion without output from this run.
144
146
 
147
+ After the gate passes, declare the orchestrated commit stage complete. This command is a no-op when no active orchestration run exists, so the direct commit path remains unchanged:
148
+
149
+ ```bash
150
+ agent-infra-internal task-orchestration {task-id} stage-completed --agent {agent}
151
+ ```
152
+
153
+ Stop if the command fails; a run without the full receipt lifecycle must not be marked completed.
154
+
145
155
  ## Notes
146
156
 
147
157
  - Never commit secrets such as `.env`, credentials, or keys
@@ -11,6 +11,8 @@ description: >
11
11
 
12
12
  更新关联 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
13
13
 
14
+ 直接调用仍要求用户显式授权。若存在 active orchestration run,只有未消费的一次性 `commitAuthorization` 可作为本轮等价授权;提交成功后必须由 orchestration core 消费,其他提交门禁保持不变。
15
+
14
16
  ## 常见违规借口与反驳
15
17
 
16
18
  | 借口 | 反驳 |
@@ -98,7 +100,7 @@ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
98
100
 
99
101
  > 完整的 5 种状态分支、前置条件检查和多 TUI 下一步命令见 `reference/task-status-update.md`。更新任务状态前,先读取 `reference/task-status-update.md`。
100
102
 
101
- > **重要**:向用户展示下一步时,必须完整输出所有 TUI 命令格式,并直接使用 `reference/task-status-update.md` 中对应场景的标准模板。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
103
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,并按 `reference/task-status-update.md` 的已选场景调用统一 helper。
102
104
 
103
105
  追加 Commit 的 Activity Log,并且只能选择一个下一步分支:
104
106
  - 已有开放 PR 且 push 成功 -> `watch-pr {task-ref}`;该分支优先于最终提交的 `prFlow` 路由
@@ -142,6 +144,14 @@ agent-infra-internal task-verify {task-id} commit.completed --format text
142
144
 
143
145
  将校验输出保留在回复中作为当次验证输出。没有当次校验输出,不得声明完成。
144
146
 
147
+ 校验通过后,声明编排中的 commit 阶段已完成;无 active orchestration run 时该命令为 no-op,不改变直接提交路径:
148
+
149
+ ```bash
150
+ agent-infra-internal task-orchestration {task-id} stage-completed --agent {agent}
151
+ ```
152
+
153
+ 命令失败时停止,不得把缺少完整 receipt 生命周期的 run 标记为完成。
154
+
145
155
  ## 注意事项
146
156
 
147
157
  - 不要提交 `.env`、凭据、密钥等敏感文件
@@ -30,11 +30,11 @@ This field is the only baseline for the `complete-task` `post-review-commit` gat
30
30
 
31
31
  After a new commit or the restricted push-only path is successfully pushed to an existing open PR, the only next step is to watch required checks for the new head:
32
32
 
33
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill watch-pr --task-ref {task-ref}`.
34
+
33
35
  ```text
34
36
  Next step - watch PR checks:
35
- - Claude Code / OpenCode: /watch-pr {task-ref}
36
- - Gemini CLI: /{{project}}:watch-pr {task-ref}
37
- - Codex CLI: $watch-pr {task-ref}
37
+ {next-step-commands}
38
38
  ```
39
39
 
40
40
  If push fails, keep the task active and preserve local HEAD; show diagnostics and manual push guidance only, never `watch-pr` or `complete-task`. This scenario takes precedence over the final `prFlow` route below.
@@ -50,20 +50,20 @@ This scenario ends the run before `git commit` and does not enter the successful
50
50
 
51
51
  Full re-review commands:
52
52
 
53
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill review-code --task-ref {task-ref}`.
54
+
53
55
  ```text
54
56
  Next step - re-run code review:
55
- - Claude Code / OpenCode: /review-code {task-ref}
56
- - Gemini CLI: /{{project}}:review-code {task-ref}
57
- - Codex CLI: $review-code {task-ref}
57
+ {next-step-commands}
58
58
  ```
59
59
 
60
60
  Full staging-only retry commands:
61
61
 
62
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill commit --task-ref {task-ref}`.
63
+
62
64
  ```text
63
65
  Next step - fix staging and retry commit:
64
- - Claude Code / OpenCode: /commit {task-ref}
65
- - Gemini CLI: /{{project}}:commit {task-ref}
66
- - Codex CLI: $commit {task-ref}
66
+ {next-step-commands}
67
67
  ```
68
68
 
69
69
  Before selecting the next step, verify:
@@ -97,34 +97,30 @@ Required next-step commands (rendered by `prFlow`):
97
97
 
98
98
  `prFlow="disabled"` -> single option "complete directly":
99
99
 
100
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}`.
101
+
100
102
  ```text
101
103
  Next step - complete and archive the task:
102
- - Claude Code / OpenCode: /complete-task {task-ref}
103
- - Gemini CLI: /{{project}}:complete-task {task-ref}
104
- - Codex CLI: $complete-task {task-ref}
104
+ {next-step-commands}
105
105
  ```
106
106
 
107
107
  `prFlow="required"` -> single option "go through the PR flow":
108
108
 
109
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill create-pr --task-ref {task-ref}`.
110
+
109
111
  ```text
110
112
  Next step - create Pull Request:
111
- - Claude Code / OpenCode: /create-pr {task-ref}
112
- - Gemini CLI: /{{project}}:create-pr {task-ref}
113
- - Codex CLI: $create-pr {task-ref}
113
+ {next-step-commands}
114
114
  ```
115
115
 
116
- field absent -> two options:
116
+ field absent -> choose one path, then invoke the helper exactly once:
117
+
118
+ - PR flow: `agent-infra-internal agent-client next-steps --skill create-pr --task-ref {task-ref}`
119
+ - Complete directly: `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}`
117
120
 
118
121
  ```text
119
- Next step - choose one:
120
- - Go through the PR flow:
121
- - Claude Code / OpenCode: /create-pr {task-ref}
122
- - Gemini CLI: /{{project}}:create-pr {task-ref}
123
- - Codex CLI: $create-pr {task-ref}
124
- - Complete directly (no PR):
125
- - Claude Code / OpenCode: /complete-task {task-ref}
126
- - Gemini CLI: /{{project}}:complete-task {task-ref}
127
- - Codex CLI: $complete-task {task-ref}
122
+ Next step - {selected path}:
123
+ {next-step-commands}
128
124
  ```
129
125
 
130
126
  ### Case 2: More Work Remains
@@ -145,11 +141,11 @@ If this commit hands work over to code review:
145
141
 
146
142
  Required next-step commands:
147
143
 
144
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill review-code --task-ref {task-ref}`.
145
+
148
146
  ```text
149
147
  Next step - code review:
150
- - Claude Code / OpenCode: /review-code {task-ref}
151
- - Gemini CLI: /{{project}}:review-code {task-ref}
152
- - Codex CLI: $review-code {task-ref}
148
+ {next-step-commands}
153
149
  ```
154
150
 
155
151
  > Note: beyond the cases above, if `task.md` contains a valid `pr_number`, the commit skill must sync the PR summary via `reference/pr-summary-sync.md` before entering the verification gate.
@@ -30,11 +30,11 @@ last_reviewed_commit: {new_head}
30
30
 
31
31
  新 commit 或受限 push-only 场景成功推送到已有开放 PR 后,唯一下一步是监控新 head 的 required checks:
32
32
 
33
+ 使用 `agent-infra-internal agent-client next-steps --skill watch-pr --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
34
+
33
35
  ```text
34
36
  下一步 - 监控 PR 检查:
35
- - Claude Code / OpenCode: /watch-pr {task-ref}
36
- - Gemini CLI: /{{project}}:watch-pr {task-ref}
37
- - Codex CLI: $watch-pr {task-ref}
37
+ {next-step-commands}
38
38
  ```
39
39
 
40
40
  push 失败时保留任务 active 与本地 HEAD,只展示诊断和人工推送提示;不得渲染 `watch-pr` 或 `complete-task`。该场景优先于下方 `prFlow` 终态路由。
@@ -50,20 +50,20 @@ push 失败时保留任务 active 与本地 HEAD,只展示诊断和人工推
50
50
 
51
51
  重新审查的完整命令:
52
52
 
53
+ 使用 `agent-infra-internal agent-client next-steps --skill review-code --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
54
+
53
55
  ```text
54
56
  下一步 - 重新代码审查:
55
- - Claude Code / OpenCode: /review-code {task-ref}
56
- - Gemini CLI: /{{project}}:review-code {task-ref}
57
- - Codex CLI: $review-code {task-ref}
57
+ {next-step-commands}
58
58
  ```
59
59
 
60
60
  仅修正暂存的完整命令:
61
61
 
62
+ 使用 `agent-infra-internal agent-client next-steps --skill commit --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
63
+
62
64
  ```text
63
65
  下一步 - 修正暂存后重新提交:
64
- - Claude Code / OpenCode: /commit {task-ref}
65
- - Gemini CLI: /{{project}}:commit {task-ref}
66
- - Codex CLI: $commit {task-ref}
66
+ {next-step-commands}
67
67
  ```
68
68
 
69
69
  在决定下一步之前,先确认:
@@ -97,34 +97,30 @@ push 失败时保留任务 active 与本地 HEAD,只展示诊断和人工推
97
97
 
98
98
  `prFlow="disabled"` → 单选「直接完成」:
99
99
 
100
+ 使用 `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
101
+
100
102
  ```text
101
103
  下一步 - 完成并归档任务:
102
- - Claude Code / OpenCode: /complete-task {task-ref}
103
- - Gemini CLI: /{{project}}:complete-task {task-ref}
104
- - Codex CLI: $complete-task {task-ref}
104
+ {next-step-commands}
105
105
  ```
106
106
 
107
107
  `prFlow="required"` → 单选「走 PR 流程」:
108
108
 
109
+ 使用 `agent-infra-internal agent-client next-steps --skill create-pr --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
110
+
109
111
  ```text
110
112
  下一步 - 创建 Pull Request:
111
- - Claude Code / OpenCode: /create-pr {task-ref}
112
- - Gemini CLI: /{{project}}:create-pr {task-ref}
113
- - Codex CLI: $create-pr {task-ref}
113
+ {next-step-commands}
114
114
  ```
115
115
 
116
- 字段缺省 → 二选一:
116
+ 字段缺省 → 二选一。选定路径后只运行一次 helper:
117
+
118
+ - 走 PR 流程:`agent-infra-internal agent-client next-steps --skill create-pr --task-ref {task-ref}`
119
+ - 直接完成:`agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}`
117
120
 
118
121
  ```text
119
- 下一步 - 二选一:
120
- - 走 PR 流程:
121
- - Claude Code / OpenCode: /create-pr {task-ref}
122
- - Gemini CLI: /{{project}}:create-pr {task-ref}
123
- - Codex CLI: $create-pr {task-ref}
124
- - 直接完成(无 PR):
125
- - Claude Code / OpenCode: /complete-task {task-ref}
126
- - Gemini CLI: /{{project}}:complete-task {task-ref}
127
- - Codex CLI: $complete-task {task-ref}
122
+ 下一步 - {已选路径}:
123
+ {next-step-commands}
128
124
  ```
129
125
 
130
126
  ### 场景 2:还有后续工作
@@ -145,11 +141,11 @@ push 失败时保留任务 active 与本地 HEAD,只展示诊断和人工推
145
141
 
146
142
  必带下一步命令:
147
143
 
144
+ 使用 `agent-infra-internal agent-client next-steps --skill review-code --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
145
+
148
146
  ```text
149
147
  下一步 - 代码审查:
150
- - Claude Code / OpenCode: /review-code {task-ref}
151
- - Gemini CLI: /{{project}}:review-code {task-ref}
152
- - Codex CLI: $review-code {task-ref}
148
+ {next-step-commands}
153
149
  ```
154
150
 
155
151
  > 注意:上述场景之外,只要 `task.md` 中存在有效 `pr_number`,commit 技能必须先按 `reference/pr-summary-sync.md` 同步 PR 摘要,再进入完成校验。
@@ -87,7 +87,7 @@ Before marking complete, verify ALL of these:
87
87
  - [ ] Code has been reviewed (`review-code.md` or `review-code-r{N}.md` exists, and the latest review verdict is Approved; or review was done externally)
88
88
  - [ ] Code has been committed (no uncommitted changes related to this task)
89
89
  - [ ] Tests are passing
90
- - [ ] The disagreement ledger has no unclosed disagreements or un-re-reviewed post-review commits; local HEAD, `last_reviewed_commit`, and PR head either match strictly or a merged squash has complete platform identity, Git topology, and content-equivalence evidence
90
+ - [ ] The disagreement ledger has no unclosed disagreements or un-re-reviewed post-review commits; on a bound-PR path local HEAD, `last_reviewed_commit`, and PR head either match strictly, or a merged squash has complete platform snapshot and remote Git equivalence evidence and current Git credentials can read the evidence refs; without a valid PR, a single-parent local rewrite is content-equivalent to `last_reviewed_commit` and has no later protected commits
91
91
 
92
92
  > **⚠️ Prerequisite Branch Check — you must decide whether to continue or stop before proceeding:**
93
93
  >
@@ -148,7 +148,7 @@ agent-infra-internal task-verify {task-id} complete-task.preflight --format text
148
148
 
149
149
  This event runs `review-ledger`, `post-review-commit`, then `platform-sync-preflight`. On any non-zero exit (fail/blocked), keep the task active, derive the stable code/target from the gate result, record it through `task-warning ... add --step complete-task ...`, and stop. For a review/head mismatch, rerun `commit` or `review-code`; never fall back to the review baseline.
150
150
 
151
- `--force` does not lift this hard gate: close ledger disagreements; re-review or exempt post-review commits, or prove a content-equivalent single-parent squash merge from the bound PR snapshot and local Git objects; then pass platform preflight. Missing platform facts, Git objects, topology, or content evidence fails closed. Required checks remain enforced before merge by branch protection / rulesets and the `review-code` / `watch-pr` routes.
151
+ `--force` does not lift this hard gate: close ledger disagreements; re-review or exempt post-review commits, use the platform adapter's authoritative snapshot and remote refs for the bound change request (PR/MR) to prove a content-equivalent single-parent squash merge in an isolated temporary repository, or, without a valid change request, prove from local Git objects that the only protected commit is a content-equivalent single-parent rewrite with no later protected commits; then pass platform preflight. An unsupported adapter capability, missing required platform facts, Git objects, topology, or content evidence, or current Git credentials that cannot read the remote evidence refs fails closed. The platform adapter supplies normalized required-checks state, which remains enforced before merge by branch protection / rulesets and the `review-code` / `watch-pr` routes.
152
152
 
153
153
  ### 6. Apply the Local Lifecycle Intent and Verify the Move
154
154
 
@@ -86,7 +86,7 @@ agent-infra-internal task-snapshot {task-id} --format text
86
86
  - [ ] 代码已审查(`review-code.md` 或 `review-code-r{N}.md` 存在,且最新审查结论为 Approved;或已在外部完成审查)
87
87
  - [ ] 代码已提交(没有与此任务相关的未提交变更)
88
88
  - [ ] 测试通过
89
- - [ ] 审查分歧账本无未关闭分歧、无未复审的 post-review 提交;本地 HEAD、`last_reviewed_commit`、PR head 严格一致,或已合并 squash 的平台身份、Git 拓扑与内容等价证据完整
89
+ - [ ] 审查分歧账本无未关闭分歧、无未复审的 post-review 提交;绑定 PR 路径中本地 HEAD、`last_reviewed_commit`、PR head 严格一致,或已合并 squash 的平台快照与远端 Git 等价证据完整且当前 Git 凭据可读取证据 refs;无有效 PR 路径中本地单父重写与 `last_reviewed_commit` 内容等价且之后无受保护提交
90
90
 
91
91
  > **⚠️ 前置条件分支判断 — 你必须先判断“继续”还是“停止”:**
92
92
  >
@@ -147,7 +147,7 @@ agent-infra-internal task-verify {task-id} complete-task.preflight --format text
147
147
 
148
148
  该事件依次执行 `review-ledger`、`post-review-commit`、`platform-sync-preflight`。任一退出码非 0(fail/blocked)时,任务必须继续留在 active;从 gate 结果取稳定 code/target,通过 `task-warning ... add --step complete-task ...` 落账后停止。若审查基线或 head 不一致,必须先重新 `commit` / `review-code`;不得回退审查基线。
149
149
 
150
- `--force` 不解除本硬门禁:未关闭分歧必须先在账本闭合,未复审提交必须重新审查、具备有效豁免,或由绑定 PR 的权威合并快照与本地 Git 对象证明为内容等价的单父 squash merge;平台 preflight 必须通过。平台事实、Git 对象、拓扑或内容证据缺失时 fail closed。required checks 由合并前的分支保护 / ruleset 以及 `review-code` / `watch-pr` 路由承担。
150
+ `--force` 不解除本硬门禁:未关闭分歧必须先在账本闭合,未复审提交必须重新审查、具备有效豁免,或由平台适配器为绑定的变更请求(PR/MR)提供权威合并快照与远端 refs,并在隔离临时仓库中证明单父 squash merge 等价,或在无有效变更请求时由本地 Git 对象证明唯一受保护提交是内容等价的单父重写且之后无受保护提交;平台 preflight 必须通过。适配器不支持所需能力,平台事实、Git 对象、拓扑、内容证据缺失,或当前 Git 凭据不能读取远端证据 refs 时 fail closed。required checks 由平台适配器提供规范化状态,并在合并前通过分支保护 / ruleset 以及 `review-code` / `watch-pr` 路由承担。
151
151
 
152
152
  ### 6. 执行本地生命周期意图并验证转移
153
153
 
@@ -31,12 +31,12 @@ Branch on the result:
31
31
  - absent / `"required"` -> continue to Step 1 below
32
32
  - `"disabled"` -> output the message below and **stop immediately**. Do not run any subsequent numbered step, do not trigger any PR-creation command, do not modify `pr_number` / `pr_status` in `task.md`, and do not publish a PR summary comment:
33
33
 
34
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}`.
35
+
34
36
  ```
35
37
  This project does not enable the PR flow (`.agents/.airc.json` sets `prFlow: "disabled"`).
36
38
  No Pull Request is required; run instead:
37
- - Claude Code / OpenCode: /complete-task {task-ref}
38
- - Gemini CLI: /{{project}}:complete-task {task-ref}
39
- - Codex CLI: $complete-task {task-ref}
39
+ {next-step-commands}
40
40
  ```
41
41
 
42
42
  ### 1. Parse Command Arguments
@@ -105,24 +105,24 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
105
105
 
106
106
  > Execute this step only after the verification gate passes.
107
107
 
108
- > **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).
108
+ > 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}`.
109
109
 
110
110
  Explain the created PR URL, summarize metadata sync and summary-comment results, and recommend watching the PR's checks next (render `{task-ref}` as the short id `NN` per `.agents/rules/next-step-output.md`):
111
111
 
112
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill watch-pr --task-ref {task-ref}`.
113
+
112
114
  ```
113
115
  Next step - Watch PR checks (auto self-heal until required checks are green):
114
- - Claude Code / OpenCode: /watch-pr {task-ref}
115
- - Gemini CLI: /{{project}}:watch-pr {task-ref}
116
- - Codex CLI: $watch-pr {task-ref}
116
+ {next-step-commands}
117
117
  ```
118
118
 
119
119
  Alternatively, to skip active monitoring and attempt completion immediately, use `complete-task`; its required-checks hard gate still fails closed for pending/failed checks or head mismatch:
120
120
 
121
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}`.
122
+
121
123
  ```
122
124
  Next step (alternative) - Skip active monitoring and attempt completion:
123
- - Claude Code / OpenCode: /complete-task {task-ref}
124
- - Gemini CLI: /{{project}}:complete-task {task-ref}
125
- - Codex CLI: $complete-task {task-ref}
125
+ {next-step-commands}
126
126
  ```
127
127
 
128
128
  `watch-pr` is the primary path. The alternative `complete-task` block skips active polling only; it never skips required checks and does not guarantee immediate archival.
@@ -31,12 +31,12 @@ description: >
31
31
  - 缺省 / `"required"` → 继续到下方第 1 步
32
32
  - `"disabled"` → 输出以下消息后**立即停止**,不要执行任何后续编号步骤、不要触发任何 PR 创建命令、不要修改 `task.md` 的 `pr_number` / `pr_status`、不要发布 PR 摘要评论:
33
33
 
34
+ 使用 `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
35
+
34
36
  ```
35
37
  当前项目未启用 PR 流程(`.agents/.airc.json` 中 `prFlow: "disabled"`)。
36
38
  无需创建 Pull Request,请直接运行:
37
- - Claude Code / OpenCode:/complete-task {task-ref}
38
- - Gemini CLI:/{{project}}:complete-task {task-ref}
39
- - Codex CLI:$complete-task {task-ref}
39
+ {next-step-commands}
40
40
  ```
41
41
 
42
42
  ### 1. 解析命令参数
@@ -105,24 +105,24 @@ agent-infra-internal task-verify {task-id} create-pr.completed --format text
105
105
 
106
106
  > 仅在校验通过后执行本步骤。
107
107
 
108
- > **重要**:以下「下一步」中列出的所有 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` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
108
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
109
109
 
110
110
  说明 PR URL、元数据同步结果、摘要评论结果,并推荐下一步进入 PR 监控(按 `.agents/rules/next-step-output.md` 把 `{task-ref}` 渲染为短号 `NN`):
111
111
 
112
+ 使用 `agent-infra-internal agent-client next-steps --skill watch-pr --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
113
+
112
114
  ```
113
115
  下一步 - 监控 PR 检查(required checks 全绿前自动自愈):
114
- - Claude Code / OpenCode:/watch-pr {task-ref}
115
- - Gemini CLI:/{{project}}:watch-pr {task-ref}
116
- - Codex CLI:$watch-pr {task-ref}
116
+ {next-step-commands}
117
117
  ```
118
118
 
119
119
  或者,若想跳过主动监控并立即尝试完成,改用 `complete-task`;其 required-checks 硬门禁仍会对 pending/failed/head mismatch fail-closed:
120
120
 
121
+ 使用 `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
122
+
121
123
  ```
122
124
  下一步(备选)- 跳过主动监控并尝试完成:
123
- - Claude Code / OpenCode:/complete-task {task-ref}
124
- - Gemini CLI:/{{project}}:complete-task {task-ref}
125
- - Codex CLI:$complete-task {task-ref}
125
+ {next-step-commands}
126
126
  ```
127
127
 
128
128
  `watch-pr` 为主路径;上面的 `complete-task` 备选块只跳过主动轮询,不跳过 required checks,也不保证立即归档。
@@ -66,10 +66,10 @@ Create the PR with the create-PR command template in `.agents/rules/issue-pr-com
66
66
 
67
67
  Final user output should include this follow-up path:
68
68
 
69
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}`.
70
+
69
71
  ```text
70
72
  Next steps:
71
73
  - complete the task after the workflow truly finishes:
72
- - Claude Code / OpenCode: /complete-task {task-ref}
73
- - Gemini CLI: /{{project}}:complete-task {task-ref}
74
- - Codex CLI: $complete-task {task-ref}
74
+ {next-step-commands}
75
75
  ```
@@ -66,10 +66,10 @@ Milestone 规则:
66
66
 
67
67
  最终用户输出应包含以下后续路径:
68
68
 
69
+ 使用 `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
70
+
69
71
  ```text
70
72
  Next steps:
71
73
  - complete the task after the workflow truly finishes:
72
- - Claude Code / OpenCode: /complete-task {task-ref}
73
- - Gemini CLI: /{{project}}:complete-task {task-ref}
74
- - Codex CLI: $complete-task {task-ref}
74
+ {next-step-commands}
75
75
  ```