@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
@@ -15,22 +15,20 @@ Rules:
15
15
  - Do not mix text from multiple scenarios
16
16
  - If `Blocker > 0`, never use an approved template
17
17
  - Never count manual-validation items as blocker / major / minor or use them to trigger Scenario B/C/D
18
- - The selected scenario must include all TUI command formats
18
+ - The selected scenario must generate `{next-step-commands}` through the shared helper
19
19
  - The count line shows 4 numbers. `Human-decision` (`{h}`) counts this stage's `needs-human-decision` rows; because those rows are unresolved, `{h} > 0` means `canAdvance=false`. Expand the "Pending human-decision pre-block" from `.agents/rules/next-step-output.md` and show revision and re-review paths only.
20
20
 
21
- For Scenarios B/C/D, follow the revision commands with re-review commands: `/review-plan {task-ref}`, `/{{project}}:review-plan {task-ref}`, and `$review-plan {task-ref}`.
22
-
23
21
  ### Scenario A: Approved with no findings
24
22
 
23
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill code-task --task-ref {task-ref}`.
24
+
25
25
  ```text
26
26
  Task {task-id} technical plan review completed. Verdict: approved.
27
27
  - Blockers: 0 | Major issues: 0 | Minor issues: 0 | Human-decision: {h}
28
28
  [- Review report: .agents/workspace/active/{task-id}/{review-artifact}]
29
29
 
30
30
  Next step - write code:
31
- - Claude Code / OpenCode: /code-task {task-ref}
32
- - Gemini CLI: /{{project}}:code-task {task-ref}
33
- - Codex CLI: $code-task {task-ref}
31
+ {next-step-commands}
34
32
 
35
33
  [When manual-validation > 0, append:]
36
34
  Reminder: manual-validation items belong in the PR description manual verification checklist and should not trigger /plan-task.
@@ -38,15 +36,15 @@ Reminder: manual-validation items belong in the PR description manual verificati
38
36
 
39
37
  ### Scenario B: Changes requested (major / minor)
40
38
 
39
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}`.
40
+
41
41
  ```text
42
42
  Task {task-id} technical plan review completed. Verdict: changes requested.
43
43
  - Blockers: 0 | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
44
44
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
45
45
 
46
46
  Next step - revise technical plan:
47
- - Claude Code / OpenCode: /plan-task {task-ref}
48
- - Gemini CLI: /{{project}}:plan-task {task-ref}
49
- - Codex CLI: $plan-task {task-ref}
47
+ {next-step-commands}
50
48
 
51
49
  [When manual-validation > 0, append:]
52
50
  Reminder: manual-validation items belong in the PR description manual verification checklist and should not trigger /plan-task.
@@ -54,15 +52,15 @@ Reminder: manual-validation items belong in the PR description manual verificati
54
52
 
55
53
  ### Scenario C: Changes requested
56
54
 
55
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}`.
56
+
57
57
  ```text
58
58
  Task {task-id} technical plan review completed. Verdict: changes requested.
59
59
  - Blockers: {n} | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
60
60
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
61
61
 
62
62
  Next step - revise technical plan:
63
- - Claude Code / OpenCode: /plan-task {task-ref}
64
- - Gemini CLI: /{{project}}:plan-task {task-ref}
65
- - Codex CLI: $plan-task {task-ref}
63
+ {next-step-commands}
66
64
 
67
65
  [When manual-validation > 0, append:]
68
66
  Reminder: manual-validation items belong in the PR description manual verification checklist and should not trigger /plan-task.
@@ -70,15 +68,15 @@ Reminder: manual-validation items belong in the PR description manual verificati
70
68
 
71
69
  ### Scenario D: Rejected
72
70
 
71
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}`.
72
+
73
73
  ```text
74
74
  Task {task-id} technical plan review completed. Verdict: rejected, redesign required.
75
75
  - Blockers: {n} | Major issues: {n} | Minor issues: {n} | Human-decision: {h}
76
76
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
77
77
 
78
78
  Next step - redesign:
79
- - Claude Code / OpenCode: /plan-task {task-ref}
80
- - Gemini CLI: /{{project}}:plan-task {task-ref}
81
- - Codex CLI: $plan-task {task-ref}
79
+ {next-step-commands}
82
80
 
83
81
  [When manual-validation > 0, append:]
84
82
  Reminder: manual-validation items belong in the PR description manual verification checklist and should not trigger /plan-task.
@@ -15,22 +15,20 @@
15
15
  - 不要混用不同场景的文案
16
16
  - 只要 `Blocker > 0`,就绝对不能输出通过模板
17
17
  - manual-validation 项绝对不能被计入 blocker / major / minor 计数,也不能用作触发场景 B/C/D 的依据
18
- - 所选场景中必须包含所有 TUI 命令格式
18
+ - 所选场景必须通过统一 helper 生成 `{next-step-commands}`
19
19
  - 计数行固定显示 4 个数字。`人工裁决`(`{h}`)是本阶段 `needs-human-decision` 行数;它属于未闭环账本状态,因此 `{h} > 0` 时 `canAdvance=false`,必须按 `.agents/rules/next-step-output.md` 的「人工裁决待办前置块」展开详情,并只输出修订与复审路径。
20
20
 
21
- 场景 B/C/D 在修订命令后继续列出复审命令:`/review-plan {task-ref}`、`/{{project}}:review-plan {task-ref}`、`$review-plan {task-ref}`。
22
-
23
21
  ### 场景 A:通过且无问题
24
22
 
23
+ 使用 `agent-infra-internal agent-client next-steps --skill code-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
24
+
25
25
  ```text
26
26
  任务 {task-id} 技术方案审查完成。结论:通过。
27
27
  - 阻塞项:0 | 主要问题:0 | 次要问题:0 | 人工裁决:{h}
28
28
  [- 审查报告:.agents/workspace/active/{task-id}/{review-artifact}]
29
29
 
30
30
  下一步 - 编写代码:
31
- - Claude Code / OpenCode:/code-task {task-ref}
32
- - Gemini CLI:/{{project}}:code-task {task-ref}
33
- - Codex CLI:$code-task {task-ref}
31
+ {next-step-commands}
34
32
 
35
33
  [当 manual-validation > 0 时,在最后附加一行:]
36
34
  提醒:manual-validation 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。
@@ -38,15 +36,15 @@
38
36
 
39
37
  ### 场景 B:需要修改(major / minor)
40
38
 
39
+ 使用 `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
40
+
41
41
  ```text
42
42
  任务 {task-id} 技术方案审查完成。结论:需要修改。
43
43
  - 阻塞项:0 | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
44
44
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
45
45
 
46
46
  下一步 - 修订技术方案:
47
- - Claude Code / OpenCode:/plan-task {task-ref}
48
- - Gemini CLI:/{{project}}:plan-task {task-ref}
49
- - Codex CLI:$plan-task {task-ref}
47
+ {next-step-commands}
50
48
 
51
49
  [当 manual-validation > 0 时,在最后附加一行:]
52
50
  提醒:manual-validation 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。
@@ -54,15 +52,15 @@
54
52
 
55
53
  ### 场景 C:需要修改
56
54
 
55
+ 使用 `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
56
+
57
57
  ```text
58
58
  任务 {task-id} 技术方案审查完成。结论:需要修改。
59
59
  - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
60
60
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
61
61
 
62
62
  下一步 - 修订技术方案:
63
- - Claude Code / OpenCode:/plan-task {task-ref}
64
- - Gemini CLI:/{{project}}:plan-task {task-ref}
65
- - Codex CLI:$plan-task {task-ref}
63
+ {next-step-commands}
66
64
 
67
65
  [当 manual-validation > 0 时,在最后附加一行:]
68
66
  提醒:manual-validation 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。
@@ -70,15 +68,15 @@
70
68
 
71
69
  ### 场景 D:拒绝
72
70
 
71
+ 使用 `agent-infra-internal agent-client next-steps --skill plan-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
72
+
73
73
  ```text
74
74
  任务 {task-id} 技术方案审查完成。结论:拒绝,需要重新设计。
75
75
  - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n} | 人工裁决:{h}
76
76
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
77
77
 
78
78
  下一步 - 重新设计:
79
- - Claude Code / OpenCode:/plan-task {task-ref}
80
- - Gemini CLI:/{{project}}:plan-task {task-ref}
81
- - Codex CLI:$plan-task {task-ref}
79
+ {next-step-commands}
82
80
 
83
81
  [当 manual-validation > 0 时,在最后附加一行:]
84
82
  提醒:manual-validation 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。
@@ -22,7 +22,55 @@ Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
22
22
  - **Review Time**: {timestamp}
23
23
  - **Scope**: {file-count and major modules}
24
24
  - **Overall Verdict**: {Approved / Changes Requested / Rejected}
25
- - **Findings (AI-actionable)**: 0 blockers, 0 majors, 0 minors / **Manual validation**: 0
25
+ - **Findings (AI-actionable)**: {unresolved-blockers} blockers, {unresolved-major} majors, {unresolved-minor} minors / **Manual validation**: 0
26
+
27
+ ## Review Coverage Declaration
28
+
29
+ | pass_id | scope | evidence | result | gaps_or_assumptions |
30
+ |---------|-------|----------|--------|---------------------|
31
+ | pass-1..5 | {scope actually reviewed} | {artifact / file:line / command} | {finding or conclusion} | {gap or assumption} |
32
+
33
+ | lens_id | trigger_evidence | loaded | result |
34
+ |---------|------------------|--------|--------|
35
+ | {registry token} | {trigger or non-trigger evidence} | {yes / no / not-applicable} | {lens result} |
36
+
37
+ ## Technical Plan Architecture Coverage
38
+
39
+ | assessment_id | classification | trigger_evidence | review_depth | result_or_gap |
40
+ |---------------|----------------|------------------|--------------|---------------|
41
+ | architecture-significance | {ordinary / architecture-significant} | {artifact / file:line / source_id} | {proportional / mini-atam} | {covered / gap} |
42
+
43
+ > Scenario A (`ordinary`): keep the table above, record `Mini-ATAM: not-applicable` with a reviewable reason, and delete the Scenario B tables.
44
+ >
45
+ > Scenario B (`architecture-significant`): keep the table above and the five tables below, and delete the Scenario A guidance.
46
+
47
+ | quality_scenario_id | source_id | business_driver | quality_attribute | priority | stimulus | context | expected_response | measure | result_or_gap |
48
+ |---------------------|-----------|-----------------|-------------------|----------|----------|---------|-------------------|---------|---------------|
49
+ | {stable identifier} | {source identifier} | {business driver} | {quality attribute} | {priority} | {stimulus} | {context} | {expected response} | {verifiable measure} | {covered / gap} |
50
+
51
+ | decision_id | selected_option | alternative_option | benefit | cost | assumption | rejection_reason | result_or_gap |
52
+ |-------------|-----------------|--------------------|---------|------|------------|------------------|---------------|
53
+ | {stable identifier} | {selected option} | {reasonable alternative} | {primary benefit} | {primary cost} | {assumption} | {rejection reason} | {covered / gap} |
54
+
55
+ | risk_id | decision_id | risk_or_sensitivity | affected_quality_attributes | tradeoff | mitigation_or_validation | result_or_gap |
56
+ |---------|-------------|---------------------|-----------------------------|----------|--------------------------|---------------|
57
+ | {stable identifier} | {decision identifier} | {risk or sensitivity point} | {affected quality attributes} | {trade-off} | {mitigation or validation} | {covered / gap} |
58
+
59
+ | decision_id | door_type | reversal_cost | migration_or_rollback | decision_status | result_or_gap |
60
+ |-------------|-----------|---------------|-----------------------|-----------------|---------------|
61
+ | {decision identifier} | {two-way / one-way} | {reversal cost} | {migration or rollback path} | {resolved / needs-human-decision} | {covered / gap} |
62
+
63
+ | evolution_id | scenario_type | source_id | confirmation_status | change_scenario | affected_scope | verification | result_or_gap |
64
+ |--------------|---------------|-----------|---------------------|-----------------|----------------|--------------|---------------|
65
+ | {stable identifier} | {evolution / migration / rollback / compatibility / operations} | {source identifier} | {confirmed / unconfirmed / not-applicable} | {change scenario} | {affected scope} | {verification and continuous-validation entry point} | {covered / gap / not-applicable} |
66
+
67
+ > An `unconfirmed` future scenario must not become a current hard requirement. Keep `not-applicable` with evidence for each inapplicable item.
68
+
69
+ ## Traceability Matrix
70
+
71
+ | source_id | upstream | reviewed_target | verification | status_or_gap |
72
+ |-----------|----------|-----------------|--------------|---------------|
73
+ | {source identifier} | {approved requirement} | {decision/step/test strategy} | {verification evidence} | {covered / gap} |
26
74
 
27
75
  ## Findings
28
76
 
@@ -30,15 +78,23 @@ Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
30
78
 
31
79
  #### 1. {Issue title}
32
80
  **File**: `{file-path}:{line-number}`
33
- **Description**: {details}
34
- **Suggested Fix**: {fix suggestion}
81
+ **Scenario**: {scenario}
82
+ **Impact**: {impact}
83
+ **Evidence**: {reproducible evidence}
84
+ **Confidence**: {high / medium / low}
85
+ **Unverified Assumptions**: {assumptions or none}
86
+ **Fix Direction**: {fix direction}
35
87
 
36
88
  ### Major Issues (should fix)
37
89
 
38
90
  #### 1. {Issue title}
39
91
  **File**: `{file-path}:{line-number}`
40
- **Description**: {details}
41
- **Suggested Fix**: {fix suggestion}
92
+ **Scenario**: {scenario}
93
+ **Impact**: {impact}
94
+ **Evidence**: {reproducible evidence}
95
+ **Confidence**: {high / medium / low}
96
+ **Unverified Assumptions**: {assumptions or none}
97
+ **Fix Direction**: {fix direction}
42
98
 
43
99
  ### Minor Issues (low impact, closure required)
44
100
 
@@ -22,7 +22,55 @@
22
22
  - **审查时间**:{timestamp}
23
23
  - **审查范围**:{file-count and major modules}
24
24
  - **总体结论**:{通过 / 需要修改 / 拒绝}
25
- - **发现(AI 可处理)**:0 阻塞项,0 主要,0 次要 / **人工校验**:0
25
+ - **发现(AI 可处理)**:{unresolved-blockers} 阻塞项,{unresolved-major} 主要,{unresolved-minor} 次要 / **人工校验**:0
26
+
27
+ ## 检视覆盖声明
28
+
29
+ | pass_id | scope | evidence | result | gaps_or_assumptions |
30
+ |---------|-------|----------|--------|---------------------|
31
+ | pass-1..5 | {本遍实际范围} | {artifact / file:line / command} | {发现或结论} | {缺口或假设} |
32
+
33
+ | lens_id | trigger_evidence | loaded | result |
34
+ |---------|------------------|--------|--------|
35
+ | {registry token} | {命中或未命中证据} | {yes / no / not-applicable} | {专项结论} |
36
+
37
+ ## 技术方案架构覆盖
38
+
39
+ | assessment_id | classification | trigger_evidence | review_depth | result_or_gap |
40
+ |---------------|----------------|------------------|--------------|---------------|
41
+ | architecture-significance | {ordinary / architecture-significant} | {artifact / file:line / source_id} | {proportional / mini-atam} | {covered / gap} |
42
+
43
+ > 场景 A(`ordinary`):保留上表,记录 `Mini-ATAM: not-applicable` 及可复核理由,并删除场景 B 的表格。
44
+ >
45
+ > 场景 B(`architecture-significant`):保留上表和以下五张表,并删除场景 A 的说明。
46
+
47
+ | quality_scenario_id | source_id | business_driver | quality_attribute | priority | stimulus | context | expected_response | measure | result_or_gap |
48
+ |---------------------|-----------|-----------------|-------------------|----------|----------|---------|-------------------|---------|---------------|
49
+ | {稳定标识} | {来源标识} | {业务驱动} | {质量属性} | {优先级} | {触发} | {上下文} | {期望响应} | {可验证度量} | {covered / gap} |
50
+
51
+ | decision_id | selected_option | alternative_option | benefit | cost | assumption | rejection_reason | result_or_gap |
52
+ |-------------|-----------------|--------------------|---------|------|------------|------------------|---------------|
53
+ | {稳定标识} | {所选方案} | {合理替代方案} | {主要收益} | {主要代价} | {假设} | {不采用原因} | {covered / gap} |
54
+
55
+ | risk_id | decision_id | risk_or_sensitivity | affected_quality_attributes | tradeoff | mitigation_or_validation | result_or_gap |
56
+ |---------|-------------|---------------------|-----------------------------|----------|--------------------------|---------------|
57
+ | {稳定标识} | {决策标识} | {风险或敏感点} | {受影响质量属性} | {权衡} | {缓解或验证} | {covered / gap} |
58
+
59
+ | decision_id | door_type | reversal_cost | migration_or_rollback | decision_status | result_or_gap |
60
+ |-------------|-----------|---------------|-----------------------|-----------------|---------------|
61
+ | {决策标识} | {two-way / one-way} | {逆转成本} | {迁移或回滚路径} | {resolved / needs-human-decision} | {covered / gap} |
62
+
63
+ | evolution_id | scenario_type | source_id | confirmation_status | change_scenario | affected_scope | verification | result_or_gap |
64
+ |--------------|---------------|-----------|---------------------|-----------------|----------------|--------------|---------------|
65
+ | {稳定标识} | {evolution / migration / rollback / compatibility / operations} | {来源标识} | {confirmed / unconfirmed / not-applicable} | {变化场景} | {影响范围} | {验证方式与持续验证入口} | {covered / gap / not-applicable} |
66
+
67
+ > `unconfirmed` 的未来场景不得升级为当前硬性需求;不适用项保留 `not-applicable` 及证据。
68
+
69
+ ## 追踪矩阵
70
+
71
+ | source_id | upstream | reviewed_target | verification | status_or_gap |
72
+ |-----------|----------|-----------------|--------------|---------------|
73
+ | {来源标识} | {已批准需求} | {设计决策/步骤/测试策略} | {验证证据} | {covered / gap} |
26
74
 
27
75
  ## 问题清单
28
76
 
@@ -30,15 +78,23 @@
30
78
 
31
79
  #### 1. {问题标题}
32
80
  **文件**:`{file-path}:{line-number}`
33
- **说明**:{details}
34
- **修复建议**:{fix suggestion}
81
+ **场景**:{scenario}
82
+ **影响**:{impact}
83
+ **证据**:{reproducible evidence}
84
+ **置信度**:{high / medium / low}
85
+ **未验证假设**:{assumptions or none}
86
+ **修复方向**:{fix direction}
35
87
 
36
88
  ### 主要问题(建议修复)
37
89
 
38
90
  #### 1. {问题标题}
39
91
  **文件**:`{file-path}:{line-number}`
40
- **说明**:{details}
41
- **修复建议**:{fix suggestion}
92
+ **场景**:{scenario}
93
+ **影响**:{impact}
94
+ **证据**:{reproducible evidence}
95
+ **置信度**:{high / medium / low}
96
+ **未验证假设**:{assumptions or none}
97
+ **修复方向**:{fix direction}
42
98
 
43
99
  ### 次要问题(低影响但需闭环)
44
100
 
@@ -23,35 +23,32 @@ Follow the `design-review` step in `.agents/workflows/feature-development.yaml`.
23
23
  - Introducing unnecessary abstractions, configuration, or frameworks for a single-use requirement
24
24
  - Asserting a `file:line` or behavior from memory or impression without verifying via rg/nl
25
25
 
26
- ## Common Review Principles
26
+ ## Shared Method and Classification Boundary
27
27
 
28
- 1. **Strict but fair**: identify issues and acknowledge solid work
29
- 2. **Specific**: cite exact file paths and line numbers
30
- 3. **Actionable**: suggest a concrete fix
31
- 4. **Severity-based**: clearly distinguish blockers, major issues, and minor issues
28
+ Read `.agents/rules/review-method.md` first and apply its five-pass protocol, risk lenses, and finding evidence contract. Finding, manual-validation, advisory, and `needs-human-decision` state semantics remain governed by `.agents/rules/review-handshake.md`. This file adds only plan-stage criteria.
32
29
 
33
- ## Three-category Decision Tree
34
-
35
- 1. A gap in constraints, risks, interface boundaries, validation strategy, or implementability is a formal finding. Assign blocker / major / minor by impact; severity does not control closure, so minor findings must also reach a terminal state.
36
- 2. When there is no known defect but validation requires a real environment, permission, or human operation, classify it as manual-validation.
37
- 3. Only a future optimization that does not affect the current plan's completeness, correctness, or acceptance is an advisory. Put it only in Non-blocking Advisories; do not add it to the ledger, finding counts, or verdict.
30
+ Also inspect the latest technical plan artifact, latest requirement-analysis review artifact, and `task.md` Activity Log so the report reflects the full design context.
38
31
 
39
- ## Manual Validation Classification
32
+ ## Technical Plan Architecture Coverage
40
33
 
41
- Some findings cannot be closed by an AI agent in the current execution environment, for example:
34
+ First record an `architecture-significance` classification with locatable evidence in every round. Classify the plan as `architecture-significant` when any of these areas changes materially:
42
35
 
43
- - Missing Docker / sandbox access for end-to-end validation
44
- - Missing a specific OS for macOS-only behavior
45
- - Missing third-party accounts / OAuth
46
- - Missing privileged operations such as root, sudo, or special network access
36
+ - responsibility or component boundaries;
37
+ - cross-component data or control flow;
38
+ - public or compatibility interfaces;
39
+ - data ownership or persistence;
40
+ - deployment or operations topology;
41
+ - trust boundaries;
42
+ - trade-offs between priority quality attributes;
43
+ - high-cost or irreversible decisions.
47
44
 
48
- **Decision tree**: "Can the AI agent close this item independently without changing the environment?"
49
- - Yes -> blocker / major / minor, based on risk
50
- - No -> **manual-validation** (a manual-validation meta-category, not part of severity ordering)
45
+ If none applies, classify the plan as `ordinary`, use `proportional` depth, and record only the classification evidence plus a reviewable reason why Mini-ATAM is `not-applicable`. If any applies, use `mini-atam` depth and complete this review:
51
46
 
52
- Where manual-validation items go:
53
- - Record them in an independent review report section named "Manual Validation Items"
54
- - Record the done-note source field as `Manual-validation: 1`; `ai task log` normalizes it into review rows
55
- - Do **not** include them in the code-task fix loop; maintainers carry them in the PR description under manual verification
47
+ 1. Trace business drivers and sourced priority quality attributes to approved requirements and constraints.
48
+ 2. Record stimulus, context, expected response, and a verifiable measure for each quality-attribute scenario.
49
+ 3. Compare each selected architecture decision with at least one reasonable alternative across benefit, cost, assumption, and rejection reason. Architecture-style or design-pattern counts are not evidence of fitness.
50
+ 4. Identify risks, sensitivity points, and quality-attribute trade-offs, including mitigation or validation.
51
+ 5. Mark each key decision as `two-way` or `one-way`, including reversal cost and migration or rollback path.
52
+ 6. Consider `evolution`, `migration`, `rollback`, `compatibility`, and `operations` scenarios individually, mapping affected scope, verification, and the continuous-validation entry point.
56
53
 
57
- Also inspect the latest technical plan artifact, latest requirement-analysis review artifact, and `task.md` Activity Log so the report reflects the full design context.
54
+ For an inapplicable lifecycle scenario, record `not-applicable` and evidence. An `unconfirmed` future scenario must not become a current hard requirement. `one-way` describes reversibility only; upgrade a decision to `needs-human-decision` only when it also meets the existing source and impact tests.
@@ -23,35 +23,32 @@
23
23
  - 为单次需求引入不必要的新抽象、配置或框架
24
24
  - 凭印象或记忆断言 `file:line`/行为,没有用 rg/nl 复核就下结论
25
25
 
26
- ## 通用审查原则
26
+ ## 共享方法与分类边界
27
27
 
28
- 1. **严格但公正**:既要指出问题,也要承认做得好的部分
29
- 2. **具体**:引用准确的文件路径和行号
30
- 3. **可执行**:给出明确可落地的修复建议
31
- 4. **按严重程度分类**:明确区分 blocker、major 和 minor
28
+ 先读取 `.agents/rules/review-method.md`,按其五遍协议、风险镜头和 finding 证据契约执行;finding、manual-validation、advisory 与 `needs-human-decision` 的状态语义以 `.agents/rules/review-handshake.md` 为准。本文件只补充技术方案阶段的专项判断。
32
29
 
33
- ## 三类审查项决策树
34
-
35
- 1. 若问题揭示当前方案缺少约束、风险、接口边界、验证策略或可实施性,登记为正式 finding,并按影响赋予 blocker / major / minor;severity 只表示影响大小,minor 也必须闭环。
36
- 2. 若没有已知缺陷,但只能依赖真实环境、权限或人工操作完成验证,归为 manual-validation。
37
- 3. 仅当建议属于未来优化且不影响当前方案的完整性、正确性和验收时,归为 advisory。advisory 只写入「非阻塞建议」,不进入账本、问题计数或 verdict。
30
+ 同时检查最新技术方案产物、最新需求分析审查产物和 `task.md` Activity Log,确保报告反映完整的设计上下文。
38
31
 
39
- ## 人工校验项分类
32
+ ## 技术方案架构专项覆盖
40
33
 
41
- 某些发现项是 AI agent 在本执行环境**无法闭环**的,例如:
34
+ 每轮先用可定位证据记录 `architecture-significance` 分类。以下任一项发生实质变化即分类为 `architecture-significant`:
42
35
 
43
- - 缺 Docker / 沙箱而无法跑端到端验证
44
- - 缺特定 OS(macOS-only 行为)
45
- - 缺第三方账号 / OAuth
46
- - 缺特权操作(root、sudo、特殊网络)
36
+ - 职责或组件边界;
37
+ - 跨组件数据流或控制流;
38
+ - 公开接口或兼容接口;
39
+ - 数据所有权或持久化;
40
+ - 部署或运维拓扑;
41
+ - 信任边界;
42
+ - 优先质量属性之间的权衡;
43
+ - 高成本或不可逆决策。
47
44
 
48
- **分类决策树**:「AI agent 能否在不改环境的前提下独立闭环这一项?」
49
- - 是 -> blocker / major / minor 之一(按风险定档)
50
- - 否 -> **manual-validation**(人工校验元类目,不参与严重程度排序)
45
+ 未命中时分类为 `ordinary`,使用 `proportional` 深度,只记录分类证据以及 Mini-ATAM `not-applicable` 的可复核理由。命中时使用 `mini-atam` 深度并完成以下检视:
51
46
 
52
- manual-validation 项的去向:
53
- - 写入 review 报告独立段落「人工校验项」
54
- - 在 done note 中写入源字段 `Manual-validation: 1`;`ai task log` 归一化展示到 review 行
55
- - **不**进入 code-task 修复循环;维护者在 PR description 中以「待人工验证」清单形式承接
47
+ 1. 从已批准需求和约束追踪业务驱动及有来源的优先质量属性。
48
+ 2. 为质量属性场景记录 stimulus、context、expected response 和可验证 measure。
49
+ 3. 对所选架构决策与至少一个合理替代方案比较 benefit、cost、assumption 和 rejection reason;不得以架构风格或设计模式数量代替适配性判断。
50
+ 4. 识别风险、敏感点及质量属性间的 trade-off,并记录缓解或验证方式。
51
+ 5. 将关键决策标记为 `two-way` 或 `one-way`,记录逆转成本以及迁移或回滚路径。
52
+ 6. 逐项考虑 `evolution`、`migration`、`rollback`、`compatibility`、`operations` 场景,并映射影响范围、验证方式和持续验证入口。
56
53
 
57
- 同时检查最新技术方案产物、最新需求分析审查产物和 `task.md` Activity Log,确保报告反映完整的设计上下文。
54
+ 不适用的生命周期场景必须写 `not-applicable` 及证据。`unconfirmed` 的未来场景不得升级为当前硬性需求。`one-way` 只描述可逆性;只有同时满足既有来源测试和影响测试时,才升级为 `needs-human-decision`。
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: run-task
3
+ description: >
4
+ Orchestrate lifecycle stages from the task's current state with fresh executors/reviewers and one-use provenance receipts.
5
+ Use when one entry should advance an existing task until a safe commit or stable pause.
6
+ ---
7
+
8
+ # Run Task Lifecycle
9
+
10
+ The orchestrator delegates only and never executes a stage skill itself. First read `.agents/rules/no-mid-flow-questions.md` and `.agents/rules/lifecycle-orchestration.md`.
11
+
12
+ 1. Resolve the task and run `agent-infra-internal task-snapshot {task-id} --format text`.
13
+ 2. Run `agent-infra-internal task-orchestration {task-id} begin-or-resume`; stop on structured paused/completed results.
14
+ 3. Run `route` and use its single action, role, round, and artifact. Never infer routing from review prose.
15
+ 4. Run `agent-infra-internal task-orchestration {task-id} prepare --client {client}` so core records the workspace baseline, then start the specified executor/reviewer with the current client's fresh native subagent mechanism. Pass only the short task reference, skill name, and minimal handoff; never pass receipt identity or inherit orchestrator history.
16
+ 5. Native start/stop hooks correlate the unique pending delegation and let core compute workspace changes and seal the receipt. After the child returns, run `advance`. Repeat step 3 only for `running`; stop immediately for `paused` or `completed`.
17
+ 6. Create a new child every round and never follow up with an old reviewer. Capability, hook, identity, model fallback, ledger, or fingerprint failures must call `pause` and fail closed.
18
+ 7. On pause or completion, run the matching typed verification and report the structured run summary, pause reason, or commit endpoint.
19
+
20
+ ## Stop
21
+
22
+ The first release ends after a safe `commit`; do not create a PR, monitor checks, or complete the task.
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: run-task
3
+ description: >
4
+ 从任务当前状态持续编排生命周期阶段,并用 fresh executor/reviewer 与一次性 receipt 验证隔离来源。
5
+ 当用户希望通过单一入口推进已有任务直到安全提交或稳定暂停时使用。
6
+ ---
7
+
8
+ # 运行任务生命周期
9
+
10
+ 总控只编排,不直接执行任何阶段技能。执行前先读取 `.agents/rules/no-mid-flow-questions.md` 与 `.agents/rules/lifecycle-orchestration.md`。
11
+
12
+ 1. 解析任务引用并执行 `agent-infra-internal task-snapshot {task-id} --format text`。
13
+ 2. 调用 `agent-infra-internal task-orchestration {task-id} begin-or-resume`;若为 paused/completed,按结构化结果停止。
14
+ 3. 调用 `route` 并读取唯一 action、role、round 和 artifact;不得从审查文案自行推断。
15
+ 4. 调用 `agent-infra-internal task-orchestration {task-id} prepare --client {client}`;核心自动记录工作区基线。成功后用当前客户端的 fresh 原生子 Agent 启动指定 executor/reviewer,只传短任务引用、skill 名和最小交接摘要,不传 receipt identity,不继承总控历史。
16
+ 5. 原生 start/stop hook 通过唯一 pending delegation 自动关联任务,并由核心计算工作区变化、封存 receipt;子 Agent 返回后调用 `advance`。只有 `running` 才重复步骤 3;`paused` 或 `completed` 立即停止。
17
+ 6. 每轮创建新 child;禁止 follow-up 复用 reviewer。任何 capability、hook、身份、模型降级、账本或 fingerprint 异常都调用 `pause` 并失败关闭。
18
+ 7. 完成或暂停后运行对应 typed verification,并把结构化 run 摘要、暂停原因或 commit 终点告知用户。
19
+
20
+ ## 停止
21
+
22
+ 首版在安全 `commit` 后结束;不要继续创建 PR、监控 checks 或完成任务。
@@ -0,0 +1,9 @@
1
+ {
2
+ "skill": "run-task",
3
+ "checks": {
4
+ "task-meta": {
5
+ "required_fields": ["id", "status", "updated_at", "agent_infra_version", "current_step", "assigned_to"]
6
+ },
7
+ "orchestration-state": {}
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "skill": "run-task",
3
+ "checks": {
4
+ "task-meta": {
5
+ "required_fields": ["id", "status", "updated_at", "agent_infra_version", "current_step", "assigned_to"]
6
+ },
7
+ "orchestration-state": {}
8
+ }
9
+ }
@@ -90,11 +90,11 @@ If tests fail:
90
90
 
91
91
  After tests pass, suggest committing the changes:
92
92
 
93
- > **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).
93
+ > 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}`.
94
+
95
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill commit`.
94
96
 
95
97
  ```
96
98
  Next step - commit changes:
97
- - Claude Code / OpenCode: /commit
98
- - Gemini CLI: /{{project}}:commit
99
- - Codex CLI: $commit
99
+ {next-step-commands}
100
100
  ```
@@ -88,11 +88,11 @@ description: >
88
88
 
89
89
  测试通过后,建议提交变更:
90
90
 
91
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
91
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
92
+
93
+ 使用 `agent-infra-internal agent-client next-steps --skill commit` 生成本场景的 `{next-step-commands}`。
92
94
 
93
95
  ```
94
96
  下一步 - 提交代码:
95
- - Claude Code / OpenCode:/commit
96
- - Gemini CLI:/{{project}}:commit
97
- - Codex CLI:$commit
97
+ {next-step-commands}
98
98
  ```
@@ -52,13 +52,13 @@ If tests fail:
52
52
 
53
53
  After tests pass, suggest committing the changes:
54
54
 
55
- > **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).
55
+ > 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}`.
56
+
57
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill commit`.
56
58
 
57
59
  ```
58
60
  Next step - commit changes:
59
- - Claude Code / OpenCode: /commit
60
- - Gemini CLI: /{{project}}:commit
61
- - Codex CLI: $commit
61
+ {next-step-commands}
62
62
  ```
63
63
 
64
64
  ## Notes
@@ -52,13 +52,13 @@ description: >
52
52
 
53
53
  测试通过后,建议提交变更:
54
54
 
55
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
55
+ > 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
56
+
57
+ 使用 `agent-infra-internal agent-client next-steps --skill commit` 生成本场景的 `{next-step-commands}`。
56
58
 
57
59
  ```
58
60
  下一步 - 提交代码:
59
- - Claude Code / OpenCode:/commit
60
- - Gemini CLI:/{{project}}:commit
61
- - Codex CLI:$commit
61
+ {next-step-commands}
62
62
  ```
63
63
 
64
64
  ## 注意事项
@@ -51,7 +51,7 @@ The script outputs JSON to stdout. Parse and record the report.
51
51
  - `managed.conflicts`: guarded managed files with unknown origin, two-sided changes, or ownership that cannot be proven during a platform switch; list each target, reason, and three-way hash
52
52
  - `managed.removed`: deleted managed files (including old paths removed during template migrations)
53
53
  - `managed.skippedPlatform`: managed / merged entries skipped because they belong to a different platform
54
- - `managed.skippedTUI`: managed / merged entries skipped because they are owned by a built-in TUI that is disabled in `tuis` (customTUI command files under the same path prefix are preserved)
54
+ - `managed.skippedTUI`: managed / merged entries skipped because they are owned by a built-in Agent Client whose `agentClients[].enabled` is `false` (legacy `tuis` is migration-only; customTUI command files under the same path prefix are preserved)
55
55
  - `merged.pending`: list of merged files for AI to process
56
56
  - Each item has `target` (project-relative path) and `template` (template-root-relative path)
57
57
  - `registryAdded`: newly added file registry entries
@@ -147,13 +147,13 @@ Based on the script report and merged results, output a complete update report i
147
147
 
148
148
  If there are changes to submit, add:
149
149
 
150
- > **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).
150
+ > 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}`.
151
+
152
+ Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill commit`.
151
153
 
152
154
  ```
153
155
  Next step - commit changes:
154
- - Claude Code / OpenCode: /commit
155
- - Gemini CLI: /{{project}}:commit
156
- - Codex CLI: $commit
156
+ {next-step-commands}
157
157
  ```
158
158
 
159
159
  Output the report, then **STOP** — do not make other changes to the project.