@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
@@ -35,12 +35,14 @@ git rev-parse v<prev-version>
35
35
 
36
36
  ### 3. 参考历史发布说明格式与分类
37
37
 
38
- 获取最近多条已发布的 Release Note 作为格式参考,并参考预定义的完整分类清单:
38
+ 读取一次 typed 发布说明上下文,并参考预定义的完整分类清单:
39
39
 
40
40
  执行前先读取 `.agents/rules/release-commands.md`。
41
41
 
42
42
  ```bash
43
- # Part A:按 `.agents/rules/release-commands.md` 的 release 查询命令逐条获取最近 3 条 Release 的 body
43
+ agent-infra-internal platform-release-notes context \
44
+ --from-tag "v<prev-version>" --to-tag "v<version>" \
45
+ --branch "<base-branch>" --history-limit 3
44
46
  ```
45
47
 
46
48
  **Part B:完整分类清单**
@@ -58,38 +60,11 @@ git rev-parse v<prev-version>
58
60
 
59
61
  ### 4. 收集已合并的 PR 与贡献者
60
62
 
61
- 获取标签之间的日期范围,然后查询已合并的 PR:
62
-
63
- ```bash
64
- # 获取标签日期
65
- git log v<prev-version> --format=%aI -1
66
- git log v<version> --format=%aI -1
67
-
68
- # 获取范围内已合并的 PR(按 `.agents/rules/release-commands.md` 的 merged PR 查询命令执行)
69
- ```
70
-
71
- 同时收集没有 PR 的直接提交:
72
- ```bash
73
- git log v<prev-version>..v<version> --format="%H %s" --no-merges
74
- ```
75
-
76
- 从 commit `Co-authored-by` trailer 中收集协作贡献者:
77
-
78
- ```bash
79
- git log v<prev-version>..v<version> \
80
- --no-merges \
81
- --format='%(trailers:key=Co-authored-by,valueonly,unfold)' \
82
- | grep -v '^$' | sort | uniq -c | sort -rn
83
- ```
84
-
85
- 输出每行一个 `Name <email>`(`uniq -c` 给出该身份在范围内作为 co-author 的 commit 数)。
63
+ 使用步骤 3 返回的 `pullRequests` 与 `commits`。每个 commit 的 `authors` 已按平台事实规范化并包含 git author 与 co-author;技能不读取平台原始字段或邮箱规则。
86
64
 
87
65
  ### 5. 收集关联 Issue
88
66
 
89
- 从每个 PR body 中提取关联的 Issue:
90
- - 匹配模式:`Closes #N`、`Fixes #N`、`Resolves #N`(不区分大小写)
91
-
92
- 按 `.agents/rules/release-commands.md` 的关联 Issue 查询命令读取。
67
+ 使用步骤 3 中每个 PR 的 `closingIssues`,不在通用技能中解析平台专有引用语法。
93
68
 
94
69
  ### 6. 分类变更
95
70
 
@@ -131,13 +106,12 @@ git log v<prev-version>..v<version> \
131
106
  4. **贡献者搜集**:
132
107
  - **数据源**:
133
108
  - PR author:来自 `.agents/rules/release-commands.md` 中已合并 PR 查询规则
134
- - Commit co-authors:来自步骤 4 的 `git log ... --format='%(trailers:key=Co-authored-by,valueonly,unfold)'`
135
- - Issue reporters:来自步骤 5 收集的关联 Issue author(由 `.agents/rules/release-commands.md` 返回)
109
+ - Commit co-authors:来自步骤 3 typed context 的 commit `authors`
110
+ - Issue reporters:来自步骤 3 typed context 的 `closingIssues[].author`
136
111
  - **贡献数定义**:`该人的 PR 数 + 该人作为 co-author 的 commit 数`(同一身份跨来源合并计数)
137
112
  - **Name → `@login` 映射**:
138
- - `Co-authored-by` 原始格式为 `Name <email>`,需要推断对应的 platform `@login`
139
- - 优先从 email 提取:匹配 `.agents/rules/release-commands.md` 中的平台 no-reply 邮箱规则时,按该规则推导小写 login
140
- - 否则按 Name 启发式:取首个空格前的 token 并转为小写(例如 `Claude Opus 4.6 (1M context)` → `@claude`、`Codex` → `@codex`、`Gemini` → `@gemini`)
113
+ - `resolution` 为 `platform-user` 或 `platform-noreply` 时直接采用小写 `login`
114
+ - 仅当 `resolution` 为 `unresolved` 时按 Name 启发式:取首个空格前的 token 并转为小写
141
115
  - 已出现在 PR author 列表中的 login,必须按该 login 合并计数,避免把 `Claude` 和 `@claude` 拆成两个条目
142
116
  - 同一 login 的所有 Name 变体都必须归并后再计数与排序;例如 `Claude` 与 `Claude Opus 4.6 (1M context)` 都映射到 `@claude` 时,应先合并为同一个贡献者
143
117
  - Bot 身份保留原样(如 `dependabot[bot]`)
@@ -170,7 +144,12 @@ NOTES_FILE="$(mktemp "${TMPDIR:-/tmp}/agent-infra-release-notes.XXXXXX")"
170
144
 
171
145
  把 notes 内容写入 `$NOTES_FILE`。
172
146
 
173
- 9.2 按 `.agents/rules/release-commands.md` 的「发布 Release notes」命令执行(命令中的 `{notes-file}` 用 `$NOTES_FILE`;写入已由 release 工作流自动创建/发布的 Release,不存在时兜底创建)。
147
+ 9.2 调用 typed publish intent(命令中的 `{notes-file}` 用 `$NOTES_FILE`);它会更新已存在的 Release,不存在时创建:
148
+
149
+ ```bash
150
+ agent-infra-internal platform-release-notes publish \
151
+ --tag "v<version>" --title "v<version>" --notes-file "$NOTES_FILE"
152
+ ```
174
153
 
175
154
  9.3 无论发布成功或失败,都删除临时文件:
176
155
 
@@ -53,6 +53,8 @@ Extract from the natural-language description:
53
53
  - `<slug>` is a kebab-case slug built from 3-6 English keywords extracted from the task title
54
54
  - **Detailed description**: the cleaned-up original user request
55
55
 
56
+ Before this step, read `reference/context-capture.md`. Classify the information already present in the current request and necessary prior discussion by source and state, ready to write under task.md `## Task Input`; leave missing categories empty and do not infer or analyze them.
57
+
56
58
  If the description is unclear, **ask the user to clarify first**.
57
59
 
58
60
  **Type inference**: choose the best matching type from the following candidates based on the semantics of the task description:
@@ -78,6 +80,7 @@ date +%Y%m%d-%H%M%S
78
80
 
79
81
  - Create the task directory: `.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
80
82
  - Use the `.agents/templates/task.md` template to create the task file: `task.md`
83
+ - Write the structured context captured in step 1 under `## Task Input` so the task remains understandable outside the original conversation
81
84
 
82
85
  **Important**:
83
86
  - Directory naming: `TASK-{yyyyMMdd-HHmmss}` (**must** include the `TASK-` prefix)
@@ -165,9 +168,11 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
165
168
 
166
169
  > Execute this step only after the verification gate passes.
167
170
 
168
- > **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).
171
+ > 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}`.
169
172
 
170
173
  Scenario A: when an Issue was created, output:
174
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}`.
175
+
171
176
  ```
172
177
  Task created and Issue creation cascaded successfully.
173
178
 
@@ -182,12 +187,12 @@ Output file:
182
187
  - Task file: .agents/workspace/active/{task-id}/task.md
183
188
 
184
189
  Next step - run requirements analysis:
185
- - Claude Code / OpenCode: /analyze-task {task-ref}
186
- - Gemini CLI: /{{project}}:analyze-task {task-ref}
187
- - Codex CLI: $analyze-task {task-ref}
190
+ {next-step-commands}
188
191
  ```
189
192
 
190
193
  Scenario B: when no Issue was created, output:
194
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}`.
195
+
191
196
  ```
192
197
  Task created.
193
198
 
@@ -201,12 +206,12 @@ Output file:
201
206
  - Task file: .agents/workspace/active/{task-id}/task.md
202
207
 
203
208
  Next step - run requirements analysis:
204
- - Claude Code / OpenCode: /analyze-task {task-ref}
205
- - Gemini CLI: /{{project}}:analyze-task {task-ref}
206
- - Codex CLI: $analyze-task {task-ref}
209
+ {next-step-commands}
207
210
  ```
208
211
 
209
212
  Scenario C: when Issue creation failed, output:
213
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}`.
214
+
210
215
  ```
211
216
  Task created, but cascade Issue creation failed.
212
217
 
@@ -225,9 +230,7 @@ Output file:
225
230
  - Task file: .agents/workspace/active/{task-id}/task.md
226
231
 
227
232
  Next step - run requirements analysis:
228
- - Claude Code / OpenCode: /analyze-task {task-ref}
229
- - Gemini CLI: /{{project}}:analyze-task {task-ref}
230
- - Codex CLI: $analyze-task {task-ref}
233
+ {next-step-commands}
231
234
 
232
235
  For later platform sync: after fixing auth / network / template issues, manually run the Issue creation flow in `.agents/rules/create-issue.md` for this task; or manually create/find an Issue and write `issue_number` into task.md so later skills can take over cascade sync.
233
236
 
@@ -240,12 +243,13 @@ For later platform sync: after fixing auth / network / template issues, manually
240
243
  ## Completion Checklist
241
244
 
242
245
  - [ ] Created the task file `.agents/workspace/active/{task-id}/task.md`
246
+ - [ ] Wrote and checked `## Task Input` source and state semantics according to `reference/context-capture.md`
243
247
  - [ ] Updated `current_step` to requirement-analysis in task.md
244
248
  - [ ] Updated `updated_at` to the current time in task.md
245
249
  - [ ] Updated `assigned_to` in task.md
246
250
  - [ ] Appended an Activity Log entry to task.md
247
251
  - [ ] Tried cascading Issue creation through `.agents/rules/create-issue.md`; if it failed, kept task.md and recorded the reason
248
- - [ ] Informed the user of the next step (must include all TUI command formats, including any custom TUIs; do not filter)
252
+ - [ ] Rendered the selected next-step commands through the shared helper
249
253
  - [ ] **Did not modify any business code or configuration files**
250
254
 
251
255
  ## STOP
@@ -52,6 +52,8 @@ description: >
52
52
  - `<slug>` 从任务标题提取 3-6 个英文关键词并转为 kebab-case
53
53
  - **详细描述**:整理后的用户原始描述
54
54
 
55
+ 执行本步骤前,先读取 `reference/context-capture.md`。把当前请求及必要前序讨论中已有的信息按来源与状态分类,准备写入 task.md 的 `## 任务输入`;缺失类别保持为空,不执行推导或分析。
56
+
55
57
  如果描述不清晰,**先向用户确认**再继续。
56
58
 
57
59
  **类型推断**:根据任务描述的语义,从以下候选值中选择最匹配的类型:
@@ -77,6 +79,7 @@ date +%Y%m%d-%H%M%S
77
79
 
78
80
  - 创建任务目录:`.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
79
81
  - 使用 `.agents/templates/task.md` 模板创建任务文件:`task.md`
82
+ - 将步骤 1 捕获的结构化上下文写入 `## 任务输入`,确保任务文件脱离原会话后仍可理解
80
83
 
81
84
  **重要**:
82
85
  - 目录命名:`TASK-{yyyyMMdd-HHmmss}`(**必须**包含 `TASK-` 前缀)
@@ -164,9 +167,11 @@ agent-infra-internal task-verify {task-id} create-task.completed --format text
164
167
 
165
168
  > 仅在校验通过后执行本步骤。
166
169
 
167
- > **重要**:以下「下一步」中列出的所有 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` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
170
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
168
171
 
169
172
  场景 A:已创建 Issue 时输出:
173
+ 使用 `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
174
+
170
175
  ```
171
176
  任务已创建,并已级联创建 Issue。
172
177
 
@@ -181,12 +186,12 @@ agent-infra-internal task-verify {task-id} create-task.completed --format text
181
186
  - 任务文件:.agents/workspace/active/{task-id}/task.md
182
187
 
183
188
  下一步 - 执行需求分析:
184
- - Claude Code / OpenCode:/analyze-task {task-ref}
185
- - Gemini CLI:/{{project}}:analyze-task {task-ref}
186
- - Codex CLI:$analyze-task {task-ref}
189
+ {next-step-commands}
187
190
  ```
188
191
 
189
192
  场景 B:未创建 Issue 时输出:
193
+ 使用 `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
194
+
190
195
  ```
191
196
  任务已创建。
192
197
 
@@ -200,12 +205,12 @@ agent-infra-internal task-verify {task-id} create-task.completed --format text
200
205
  - 任务文件:.agents/workspace/active/{task-id}/task.md
201
206
 
202
207
  下一步 - 执行需求分析:
203
- - Claude Code / OpenCode:/analyze-task {task-ref}
204
- - Gemini CLI:/{{project}}:analyze-task {task-ref}
205
- - Codex CLI:$analyze-task {task-ref}
208
+ {next-step-commands}
206
209
  ```
207
210
 
208
211
  场景 C:Issue 创建失败时输出:
212
+ 使用 `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
213
+
209
214
  ```
210
215
  任务已创建,但 Issue 级联创建失败。
211
216
 
@@ -224,9 +229,7 @@ Issue 创建失败:
224
229
  - 任务文件:.agents/workspace/active/{task-id}/task.md
225
230
 
226
231
  下一步 - 执行需求分析:
227
- - Claude Code / OpenCode:/analyze-task {task-ref}
228
- - Gemini CLI:/{{project}}:analyze-task {task-ref}
229
- - Codex CLI:$analyze-task {task-ref}
232
+ {next-step-commands}
230
233
 
231
234
  后续如需平台同步:修复认证/网络/模板问题后,可按 `.agents/rules/create-issue.md` 对当前任务手动执行一次 Issue 创建;或手动创建/查找 Issue,并把 `issue_number` 写入 task.md,后续技能会接管级联同步。
232
235
 
@@ -239,12 +242,13 @@ Issue 创建失败:
239
242
  ## 完成检查清单
240
243
 
241
244
  - [ ] 创建了任务文件 `.agents/workspace/active/{task-id}/task.md`
245
+ - [ ] 已按 `reference/context-capture.md` 写入并复核 `## 任务输入` 的来源与状态语义
242
246
  - [ ] 更新了 task.md 中的 `current_step` 为 requirement-analysis
243
247
  - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
244
248
  - [ ] 更新了 task.md 中的 `assigned_to`
245
249
  - [ ] 追加了 Activity Log 条目到 task.md
246
250
  - [ ] 已按 `.agents/rules/create-issue.md` 尝试级联创建 Issue;失败时保留 task.md 并记录原因
247
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,含自定义 TUI,不要筛选)
251
+ - [ ] 已通过统一 helper 渲染已选场景的下一步命令
248
252
  - [ ] **没有修改任何业务代码或配置文件**
249
253
 
250
254
  ## 停止
@@ -0,0 +1,29 @@
1
+ # Context Capture Protocol
2
+
3
+ ## Scope
4
+
5
+ Capture only the current natural-language request and the necessary prior discussion that is visible in the current context and directly relevant to the task. Do not read outside the available context, preserve a full transcript, perform requirements analysis, analyze code impact, or design a solution.
6
+
7
+ ## Classification
8
+
9
+ Faithfully condense existing information into task.md under `## Task Input`:
10
+
11
+ - `### Sources`: identify the current user request, an earlier user statement, user confirmation, or an agent suggestion.
12
+ - `### Confirmed Facts and Evidence`: include only user-provided or verified facts, reproduction steps, errors, and observations.
13
+ - `### Constraints`: preserve explicit user limits, security boundaries, and compatibility requirements.
14
+ - `### Confirmed Decisions`: include only directions explicitly confirmed by the user; never promote an agent suggestion to an approved decision.
15
+ - `### Candidate and Rejected Options`: label each item as a candidate, agent suggestion, tentative assumption, or rejected option and preserve its source.
16
+ - `### Acceptance Criteria`: retain user-provided observable inputs, actions, and expected results.
17
+ - `### Open Questions`: retain unanswered questions and choices that still require a decision.
18
+
19
+ Leave missing categories empty rather than inferring content. Deduplicate repeated information without losing its source or state.
20
+
21
+ ## Safety and Compression
22
+
23
+ - Exclude secrets, tokens, credentials, and unrelated personal information.
24
+ - Write a self-contained summary instead of copying the full transcript.
25
+ - Preserve commands, error text, paths, or identifiers only when necessary for reproduction or acceptance.
26
+
27
+ ## Completion Check
28
+
29
+ A reader with only the generated task.md must be able to distinguish confirmed information, candidates or assumptions, rejected content, and open questions, and understand the task goal and existing acceptance criteria.
@@ -0,0 +1,29 @@
1
+ # 上下文捕获协议
2
+
3
+ ## 范围
4
+
5
+ 只捕获当前自然语言请求及当前上下文中可见、与任务直接相关的必要前序讨论。不读取上下文之外的信息,不保存完整聊天记录,也不执行需求分析、代码影响分析或技术设计。
6
+
7
+ ## 分类
8
+
9
+ 将已有信息忠实压缩并写入 task.md 的 `## 任务输入`:
10
+
11
+ - `### 来源`:注明用户当次请求、用户前序陈述、用户确认或 Agent 建议等来源。
12
+ - `### 已确认事实与证据`:只写用户提供或已核实的事实、复现步骤、错误和观察结果。
13
+ - `### 约束`:保留用户明确限制、安全边界和兼容要求。
14
+ - `### 已确认决策`:只写用户明确确认的方向;不得把 Agent 建议升级为已批准决策。
15
+ - `### 候选与否决方案`:注明每项是候选、Agent 建议、暂定假设或已否决方案,并保留来源。
16
+ - `### 验收标准`:保存用户已给出的可观察输入、动作和预期结果。
17
+ - `### 未决事项`:保存尚未回答的问题或仍需裁定的选择。
18
+
19
+ 缺失类别保持为空,不推导补齐。相同信息去重,但不得丢失来源或状态语义。
20
+
21
+ ## 安全与压缩
22
+
23
+ - 排除密钥、Token、凭据和与任务无关的个人信息。
24
+ - 使用自足摘要,不逐字复制完整 transcript。
25
+ - 保留命令、错误文本、路径或标识符时,只保留复现和验收所必需的部分。
26
+
27
+ ## 完成检查
28
+
29
+ 仅阅读生成的 task.md 时,应能区分已确认内容、候选或假设、否决内容和未决事项,并能理解任务目标与已有验收标准。
@@ -97,7 +97,9 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
97
97
 
98
98
  > Execute this step only after the verification gate passes.
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
+
102
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}`.
101
103
 
102
104
  ```
103
105
  Code Scanning alert #{alert-number} imported.
@@ -111,9 +113,7 @@ Task information:
111
113
  - Task ID: {task-id} (short id {task-ref})
112
114
 
113
115
  Next step:
114
- - Claude Code / OpenCode: /analyze-task {task-ref}
115
- - Gemini CLI: /{{project}}:analyze-task {task-ref}
116
- - Codex CLI: $analyze-task {task-ref}
116
+ {next-step-commands}
117
117
  ```
118
118
 
119
119
 
@@ -125,7 +125,7 @@ Next step:
125
125
  - [ ] Updated `current_step` to requirement-analysis in task.md
126
126
  - [ ] Updated `updated_at` to the current time in task.md
127
127
  - [ ] Appended an Activity Log entry to task.md
128
- - [ ] Informed the user of the next step (must include all TUI command formats, including any custom TUIs; do not filter)
128
+ - [ ] Rendered the selected next-step commands through the shared helper
129
129
 
130
130
  ## Error Handling
131
131
 
@@ -97,7 +97,9 @@ agent-infra-internal task-verify {task-id} import-codescan.completed --format te
97
97
 
98
98
  > 仅在校验通过后执行本步骤。
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
+
102
+ 使用 `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
101
103
 
102
104
  ```
103
105
  Code Scanning 告警 #{alert-number} 已导入。
@@ -111,9 +113,7 @@ Code Scanning 告警 #{alert-number} 已导入。
111
113
  - 任务 ID:{task-id}(短号 {task-ref})
112
114
 
113
115
  下一步:
114
- - Claude Code / OpenCode:/analyze-task {task-ref}
115
- - Gemini CLI:/{{project}}:analyze-task {task-ref}
116
- - Codex CLI:$analyze-task {task-ref}
116
+ {next-step-commands}
117
117
  ```
118
118
 
119
119
 
@@ -125,7 +125,7 @@ Code Scanning 告警 #{alert-number} 已导入。
125
125
  - [ ] 更新了 task.md 中的 `current_step` 为 requirement-analysis
126
126
  - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
127
127
  - [ ] 追加了 Activity Log 条目到 task.md
128
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,含自定义 TUI,不要筛选)
128
+ - [ ] 已通过统一 helper 渲染已选场景的下一步命令
129
129
 
130
130
  ## 错误处理
131
131
 
@@ -100,7 +100,9 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
100
100
 
101
101
  > Execute this step only after the verification gate passes.
102
102
 
103
- > **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).
103
+ > 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}`.
104
+
105
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}`.
104
106
 
105
107
  ```
106
108
  Security alert #{alert-number} imported.
@@ -117,9 +119,7 @@ Output file:
117
119
  - Task file: .agents/workspace/active/{task-id}/task.md
118
120
 
119
121
  Next step:
120
- - Claude Code / OpenCode: /analyze-task {task-ref}
121
- - Gemini CLI: /{{project}}:analyze-task {task-ref}
122
- - Codex CLI: $analyze-task {task-ref}
122
+ {next-step-commands}
123
123
  ```
124
124
 
125
125
 
@@ -131,7 +131,7 @@ Next step:
131
131
  - [ ] Updated `current_step` to requirement-analysis in task.md
132
132
  - [ ] Updated `updated_at` to the current time in task.md
133
133
  - [ ] Appended an Activity Log entry to task.md
134
- - [ ] Informed the user of the next step (must include all TUI command formats, including any custom TUIs; do not filter)
134
+ - [ ] Rendered the selected next-step commands through the shared helper
135
135
 
136
136
  ## Error Handling
137
137
 
@@ -100,7 +100,9 @@ agent-infra-internal task-verify {task-id} import-dependabot.completed --format
100
100
 
101
101
  > 仅在校验通过后执行本步骤。
102
102
 
103
- > **重要**:以下「下一步」中列出的所有 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` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
103
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
104
+
105
+ 使用 `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
104
106
 
105
107
  ```
106
108
  安全告警 #{alert-number} 已导入。
@@ -117,9 +119,7 @@ agent-infra-internal task-verify {task-id} import-dependabot.completed --format
117
119
  - 任务文件:.agents/workspace/active/{task-id}/task.md
118
120
 
119
121
  下一步:
120
- - Claude Code / OpenCode:/analyze-task {task-ref}
121
- - Gemini CLI:/{{project}}:analyze-task {task-ref}
122
- - Codex CLI:$analyze-task {task-ref}
122
+ {next-step-commands}
123
123
  ```
124
124
 
125
125
 
@@ -131,7 +131,7 @@ agent-infra-internal task-verify {task-id} import-dependabot.completed --format
131
131
  - [ ] 更新了 task.md 中的 `current_step` 为 requirement-analysis
132
132
  - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
133
133
  - [ ] 追加了 Activity Log 条目到 task.md
134
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,含自定义 TUI,不要筛选)
134
+ - [ ] 已通过统一 helper 渲染已选场景的下一步命令
135
135
 
136
136
  ## 错误处理
137
137
 
@@ -176,7 +176,9 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
176
176
 
177
177
  > Execute this step only after the verification gate passes.
178
178
 
179
- > **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).
179
+ > 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}`.
180
+
181
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}`.
180
182
 
181
183
  ```
182
184
  Issue #{number} imported.
@@ -190,9 +192,7 @@ Output file:
190
192
  - Task file: .agents/workspace/active/{task-id}/task.md
191
193
 
192
194
  Next step - run requirements analysis:
193
- - Claude Code / OpenCode: /analyze-task {task-ref}
194
- - Gemini CLI: /{{project}}:analyze-task {task-ref}
195
- - Codex CLI: $analyze-task {task-ref}
195
+ {next-step-commands}
196
196
  ```
197
197
 
198
198
 
@@ -205,7 +205,7 @@ Next step - run requirements analysis:
205
205
  - [ ] Updated `updated_at` to the current time
206
206
  - [ ] Appended an Activity Log entry to task.md
207
207
  - [ ] Synced the task comment to the Issue, with remote content matching local task.md
208
- - [ ] Informed the user of the next step (must include all TUI command formats, including any custom TUIs; do not filter)
208
+ - [ ] Rendered the selected next-step commands through the shared helper
209
209
  - [ ] **Did not modify any business code**
210
210
 
211
211
  ## STOP
@@ -176,7 +176,9 @@ agent-infra-internal task-verify {task-id} import-issue.completed --format text
176
176
 
177
177
  > 仅在校验通过后执行本步骤。
178
178
 
179
- > **重要**:以下「下一步」中列出的所有 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` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
179
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
180
+
181
+ 使用 `agent-infra-internal agent-client next-steps --skill analyze-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
180
182
 
181
183
  ```
182
184
  Issue #{number} 已导入。
@@ -190,9 +192,7 @@ Issue #{number} 已导入。
190
192
  - 任务文件:.agents/workspace/active/{task-id}/task.md
191
193
 
192
194
  下一步 - 执行需求分析:
193
- - Claude Code / OpenCode:/analyze-task {task-ref}
194
- - Gemini CLI:/{{project}}:analyze-task {task-ref}
195
- - Codex CLI:$analyze-task {task-ref}
195
+ {next-step-commands}
196
196
  ```
197
197
 
198
198
 
@@ -205,7 +205,7 @@ Issue #{number} 已导入。
205
205
  - [ ] 更新了 `updated_at` 为当前时间
206
206
  - [ ] 追加了 Activity Log 条目到 task.md
207
207
  - [ ] 同步了 task 评论到 Issue,且远端内容与本地 task.md 一致
208
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,含自定义 TUI,不要筛选)
208
+ - [ ] 已通过统一 helper 渲染已选场景的下一步命令
209
209
  - [ ] **没有修改任何业务代码**
210
210
 
211
211
  ## 停止
@@ -87,15 +87,15 @@ Operational notes:
87
87
 
88
88
  ### 6. Inform User
89
89
 
90
- > **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).
90
+ > 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}`.
91
91
 
92
92
  After summarizing the label initialization, show:
93
93
 
94
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill init-milestones`.
95
+
94
96
  ```
95
97
  Next step - initialize milestones (optional):
96
- - Claude Code / OpenCode: /init-milestones
97
- - Gemini CLI: /{{project}}:init-milestones
98
- - Codex CLI: $init-milestones
98
+ {next-step-commands}
99
99
  ```
100
100
 
101
101
  ## Error Handling
@@ -87,15 +87,15 @@ bash .agents/skills/init-labels/scripts/init-labels.sh
87
87
 
88
88
  ### 6. 告知用户
89
89
 
90
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
90
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
91
91
 
92
92
  输出 labels 初始化摘要后,提示:
93
93
 
94
+ 使用 `agent-infra-internal agent-client next-steps --skill init-milestones` 生成本场景的 `{next-step-commands}`。
95
+
94
96
  ```
95
97
  下一步 - 初始化 Milestones(可选):
96
- - Claude Code / OpenCode:/init-milestones
97
- - Gemini CLI:/{{project}}:init-milestones
98
- - Codex CLI:$init-milestones
98
+ {next-step-commands}
99
99
  ```
100
100
 
101
101
  ## 错误处理
@@ -65,15 +65,15 @@ Operational notes:
65
65
 
66
66
  ### 5. Inform User
67
67
 
68
- > **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).
68
+ > 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}`.
69
69
 
70
70
  After summarizing the milestone initialization, show:
71
71
 
72
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill init-labels`.
73
+
72
74
  ```
73
75
  Next step - initialize labels (optional):
74
- - Claude Code / OpenCode: /init-labels
75
- - Gemini CLI: /{{project}}:init-labels
76
- - Codex CLI: $init-labels
76
+ {next-step-commands}
77
77
  ```
78
78
 
79
79
  ## Error Handling
@@ -65,15 +65,15 @@ bash .agents/skills/init-milestones/scripts/init-milestones.sh "$ARGUMENTS"
65
65
 
66
66
  ### 5. 告知用户
67
67
 
68
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
68
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
69
69
 
70
70
  输出 milestones 初始化摘要后,提示:
71
71
 
72
+ 使用 `agent-infra-internal agent-client next-steps --skill init-labels` 生成本场景的 `{next-step-commands}`。
73
+
72
74
  ```
73
75
  下一步 - 初始化 Labels(可选):
74
- - Claude Code / OpenCode:/init-labels
75
- - Gemini CLI:/{{project}}:init-labels
76
- - Codex CLI:$init-labels
76
+ {next-step-commands}
77
77
  ```
78
78
 
79
79
  ## 错误处理