@fitlab-ai/agent-infra 0.9.9 → 0.9.11

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 (309) hide show
  1. package/README.md +13 -3
  2. package/README.zh-CN.md +13 -3
  3. package/bin/cli.ts +17 -4
  4. package/dist/bin/cli.js +19 -4
  5. package/dist/bin/internal-cli.js +55 -4
  6. package/dist/lib/agent-client.js +0 -1
  7. package/dist/lib/agent-clients/adapters/codex-lifecycle/build-identity.js +17 -10
  8. package/dist/lib/agent-clients/adapters/codex-lifecycle/controller-context.js +11 -31
  9. package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +15 -33
  10. package/dist/lib/agent-clients/adapters/codex-sandbox.js +72 -11
  11. package/dist/lib/agent-clients/adapters/index.js +3 -1
  12. package/dist/lib/agent-clients/adapters/opencode-sandbox.js +0 -4
  13. package/dist/lib/agent-clients/adapters/traecli.js +65 -0
  14. package/dist/lib/agent-clients/config.js +14 -99
  15. package/dist/lib/agent-clients/reconcile.js +1 -11
  16. package/dist/lib/agent-clients/schema.js +5 -4
  17. package/dist/lib/agent-clients/tokens.js +7 -17
  18. package/dist/lib/agent-clients/types.js +2 -1
  19. package/dist/lib/decide.js +14 -30
  20. package/dist/lib/defaults.json +9 -0
  21. package/dist/lib/init.js +2 -2
  22. package/dist/lib/internal/codex-lifecycle.js +2 -2
  23. package/dist/lib/internal/codex-sandbox-controller.js +4 -3
  24. package/dist/lib/internal/release-workflow.js +0 -1
  25. package/dist/lib/internal/sandbox-control.js +2 -2
  26. package/dist/lib/internal/task-finalization.js +19 -9
  27. package/dist/lib/internal/task-ledger.js +8 -2
  28. package/dist/lib/internal/task-lifecycle.js +17 -93
  29. package/dist/lib/internal/task-orchestration.js +30 -216
  30. package/dist/lib/{task/commands/validate.js → internal/task-validate.js} +77 -43
  31. package/dist/lib/merge.js +205 -103
  32. package/dist/lib/process-data/normalize.js +2 -9
  33. package/dist/lib/run/host.js +46 -16
  34. package/dist/lib/run/tui.js +5 -2
  35. package/dist/lib/sandbox/agent-client-reconciler.js +4 -12
  36. package/dist/lib/sandbox/commands/create.js +3 -3
  37. package/dist/lib/sandbox/commands/enter.js +18 -4
  38. package/dist/lib/sandbox/config.js +3 -12
  39. package/dist/lib/sandbox/control/controller-registration.js +4 -2
  40. package/dist/lib/sandbox/control/executor.js +135 -40
  41. package/dist/lib/sandbox/control/lifecycle.js +29 -20
  42. package/dist/lib/sandbox/control/server.js +18 -16
  43. package/dist/lib/sandbox/mounts.js +3 -2
  44. package/dist/lib/sandbox/recovery.js +123 -22
  45. package/dist/lib/sandbox/workspace-identity.js +14 -0
  46. package/dist/lib/sandbox/workspace-view.js +8 -9
  47. package/dist/lib/self-update.js +278 -0
  48. package/dist/lib/server/protocol.js +5 -5
  49. package/dist/lib/task/activity-log.js +4 -1
  50. package/dist/lib/task/artifact-lifecycle.js +4 -2
  51. package/dist/lib/task/codex-orchestration.js +32 -35
  52. package/dist/lib/task/command-options.js +1 -3
  53. package/dist/lib/task/commands/cat.js +0 -5
  54. package/dist/lib/task/commands/decisions.js +76 -92
  55. package/dist/lib/task/commands/files.js +6 -6
  56. package/dist/lib/task/commands/grep.js +25 -61
  57. package/dist/lib/task/commands/issue-body.js +6 -6
  58. package/dist/lib/task/commands/log.js +25 -10
  59. package/dist/lib/task/commands/show.js +5 -6
  60. package/dist/lib/task/commands/status.js +8 -8
  61. package/dist/lib/task/commit-operation.js +21 -25
  62. package/dist/lib/task/commit-policy.js +1 -1
  63. package/dist/lib/task/control-authority.js +431 -0
  64. package/dist/lib/task/create.js +6 -1
  65. package/dist/lib/task/current-contract.js +35 -0
  66. package/dist/lib/task/decision-details.js +263 -0
  67. package/dist/lib/task/decision-intents.js +5 -2
  68. package/dist/lib/task/delegation-receipts.js +8 -7
  69. package/dist/lib/task/events.js +11 -5
  70. package/dist/lib/task/finalization.js +72 -46
  71. package/dist/lib/task/index.js +19 -29
  72. package/dist/lib/task/ledger-intents.js +8 -9
  73. package/dist/lib/task/ledger.js +13 -6
  74. package/dist/lib/task/lifecycle.js +16 -0
  75. package/dist/lib/task/orchestration.js +51 -14
  76. package/dist/lib/task/review-artifacts.js +31 -12
  77. package/dist/lib/task/review-finalization.js +19 -6
  78. package/dist/lib/task/verification-engine.js +38 -18
  79. package/dist/lib/task/verification-review.js +1 -1
  80. package/dist/lib/task/workspace-snapshot.js +5 -11
  81. package/dist/lib/task/write.js +11 -1
  82. package/dist/lib/update.js +6 -37
  83. package/dist/lib/version.js +5 -1
  84. package/dist/lifecycle-build-manifest.json +3 -3
  85. package/lib/agent-client.ts +0 -1
  86. package/lib/agent-clients/adapters/codex-lifecycle/build-identity.ts +25 -10
  87. package/lib/agent-clients/adapters/codex-lifecycle/controller-context.ts +16 -33
  88. package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +16 -35
  89. package/lib/agent-clients/adapters/codex-sandbox.ts +89 -14
  90. package/lib/agent-clients/adapters/index.ts +3 -1
  91. package/lib/agent-clients/adapters/opencode-sandbox.ts +0 -5
  92. package/lib/agent-clients/adapters/traecli.ts +66 -0
  93. package/lib/agent-clients/config.ts +14 -144
  94. package/lib/agent-clients/reconcile.ts +1 -12
  95. package/lib/agent-clients/schema.ts +5 -4
  96. package/lib/agent-clients/tokens.ts +7 -20
  97. package/lib/agent-clients/types.ts +2 -1
  98. package/lib/decide.ts +12 -22
  99. package/lib/defaults.json +9 -0
  100. package/lib/init.ts +2 -2
  101. package/lib/internal/codex-lifecycle.ts +2 -2
  102. package/lib/internal/codex-sandbox-controller.ts +4 -3
  103. package/lib/internal/release-workflow.ts +0 -1
  104. package/lib/internal/sandbox-control.ts +2 -2
  105. package/lib/internal/task-finalization.ts +27 -13
  106. package/lib/internal/task-ledger.ts +8 -2
  107. package/lib/internal/task-lifecycle.ts +33 -76
  108. package/lib/internal/task-orchestration.ts +33 -190
  109. package/lib/{task/commands/validate.ts → internal/task-validate.ts} +77 -41
  110. package/lib/merge.ts +236 -120
  111. package/lib/process-data/normalize.ts +2 -8
  112. package/lib/run/host.ts +63 -14
  113. package/lib/run/tui.ts +5 -3
  114. package/lib/sandbox/agent-client-reconciler.ts +5 -15
  115. package/lib/sandbox/commands/create.ts +4 -4
  116. package/lib/sandbox/commands/enter.ts +24 -4
  117. package/lib/sandbox/config.ts +2 -14
  118. package/lib/sandbox/control/container-identity.ts +2 -2
  119. package/lib/sandbox/control/controller-registration.ts +8 -3
  120. package/lib/sandbox/control/executor.ts +156 -53
  121. package/lib/sandbox/control/lifecycle.ts +34 -28
  122. package/lib/sandbox/control/protocol.ts +1 -3
  123. package/lib/sandbox/control/server.ts +15 -12
  124. package/lib/sandbox/control/state.ts +7 -7
  125. package/lib/sandbox/mounts.ts +4 -3
  126. package/lib/sandbox/recovery.ts +162 -34
  127. package/lib/sandbox/tools.ts +1 -1
  128. package/lib/sandbox/workspace-identity.ts +28 -0
  129. package/lib/sandbox/workspace-view.ts +14 -10
  130. package/lib/self-update.ts +341 -0
  131. package/lib/server/protocol.ts +5 -5
  132. package/lib/task/activity-log.ts +6 -1
  133. package/lib/task/artifact-lifecycle.ts +5 -3
  134. package/lib/task/codex-orchestration.ts +40 -45
  135. package/lib/task/command-options.ts +1 -2
  136. package/lib/task/commands/cat.ts +0 -4
  137. package/lib/task/commands/decisions.ts +80 -75
  138. package/lib/task/commands/files.ts +6 -6
  139. package/lib/task/commands/grep.ts +23 -51
  140. package/lib/task/commands/issue-body.ts +6 -6
  141. package/lib/task/commands/log.ts +22 -10
  142. package/lib/task/commands/show.ts +5 -6
  143. package/lib/task/commands/status.ts +8 -8
  144. package/lib/task/commit-operation.ts +25 -30
  145. package/lib/task/commit-policy.ts +1 -2
  146. package/lib/task/control-authority.ts +563 -0
  147. package/lib/task/create.ts +6 -1
  148. package/lib/task/current-contract.ts +49 -0
  149. package/lib/task/decision-details.ts +340 -0
  150. package/lib/task/decision-intents.ts +7 -2
  151. package/lib/task/delegation-receipts.ts +8 -6
  152. package/lib/task/events.ts +10 -5
  153. package/lib/task/finalization.ts +84 -42
  154. package/lib/task/index.ts +19 -28
  155. package/lib/task/ledger-intents.ts +6 -8
  156. package/lib/task/ledger.ts +17 -7
  157. package/lib/task/lifecycle.ts +20 -0
  158. package/lib/task/orchestration.ts +42 -16
  159. package/lib/task/review-artifacts.ts +53 -15
  160. package/lib/task/review-finalization.ts +33 -7
  161. package/lib/task/verification-engine.ts +33 -21
  162. package/lib/task/verification-review.ts +1 -1
  163. package/lib/task/workspace-snapshot.ts +4 -13
  164. package/lib/task/write.ts +20 -1
  165. package/lib/update.ts +6 -40
  166. package/lib/version.ts +6 -1
  167. package/package.json +1 -1
  168. package/templates/.agents/QUICKSTART.en.md +2 -3
  169. package/templates/.agents/QUICKSTART.zh-CN.md +2 -3
  170. package/templates/.agents/README.en.md +5 -3
  171. package/templates/.agents/README.zh-CN.md +5 -3
  172. package/templates/.agents/rules/README.en.md +1 -0
  173. package/templates/.agents/rules/README.zh-CN.md +1 -0
  174. package/templates/.agents/rules/compatibility-policy.en.md +40 -0
  175. package/templates/.agents/rules/compatibility-policy.zh-CN.md +40 -0
  176. package/templates/.agents/rules/create-issue.github.en.md +1 -1
  177. package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
  178. package/templates/.agents/rules/human-decision-context.en.md +9 -7
  179. package/templates/.agents/rules/human-decision-context.zh-CN.md +9 -7
  180. package/templates/.agents/rules/issue-fields.github.en.md +1 -1
  181. package/templates/.agents/rules/issue-fields.github.zh-CN.md +1 -1
  182. package/templates/.agents/rules/issue-pr-commands.en.md +1 -1
  183. package/templates/.agents/rules/issue-pr-commands.github.en.md +1 -1
  184. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +1 -1
  185. package/templates/.agents/rules/issue-pr-commands.zh-CN.md +1 -1
  186. package/templates/.agents/rules/issue-sync.github.en.md +1 -1
  187. package/templates/.agents/rules/issue-sync.github.zh-CN.md +2 -2
  188. package/templates/.agents/rules/lifecycle-orchestration.en.md +4 -4
  189. package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +4 -4
  190. package/templates/.agents/rules/milestone-inference.github.en.md +1 -1
  191. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +1 -1
  192. package/templates/.agents/rules/next-step-output.en.md +3 -3
  193. package/templates/.agents/rules/next-step-output.zh-CN.md +3 -3
  194. package/templates/.agents/rules/no-mid-flow-questions.en.md +1 -1
  195. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +1 -1
  196. package/templates/.agents/rules/pr-sync.en.md +2 -2
  197. package/templates/.agents/rules/pr-sync.github.en.md +3 -2
  198. package/templates/.agents/rules/pr-sync.github.zh-CN.md +3 -1
  199. package/templates/.agents/rules/pr-sync.zh-CN.md +2 -1
  200. package/templates/.agents/rules/release-commands.github.en.md +6 -0
  201. package/templates/.agents/rules/release-commands.github.zh-CN.md +6 -0
  202. package/templates/.agents/rules/review-handshake.en.md +1 -1
  203. package/templates/.agents/rules/review-handshake.zh-CN.md +1 -1
  204. package/templates/.agents/rules/review-method.en.md +1 -0
  205. package/templates/.agents/rules/review-method.zh-CN.md +1 -0
  206. package/templates/.agents/rules/task-management.en.md +1 -2
  207. package/templates/.agents/rules/task-management.zh-CN.md +1 -2
  208. package/templates/.agents/skills/analyze-task/SKILL.en.md +4 -3
  209. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +4 -3
  210. package/templates/.agents/skills/block-task/SKILL.en.md +2 -2
  211. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
  212. package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
  213. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
  214. package/templates/.agents/skills/check-task/SKILL.en.md +2 -2
  215. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +2 -2
  216. package/templates/.agents/skills/close-codescan/SKILL.en.md +1 -1
  217. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +1 -1
  218. package/templates/.agents/skills/close-dependabot/SKILL.en.md +1 -1
  219. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -1
  220. package/templates/.agents/skills/code-task/SKILL.en.md +4 -3
  221. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +5 -3
  222. package/templates/.agents/skills/commit/SKILL.en.md +27 -7
  223. package/templates/.agents/skills/commit/SKILL.zh-CN.md +3 -4
  224. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +5 -5
  225. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +5 -5
  226. package/templates/.agents/skills/complete-task/SKILL.en.md +3 -3
  227. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +3 -3
  228. package/templates/.agents/skills/create-pr/SKILL.en.md +15 -11
  229. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +15 -11
  230. package/templates/.agents/skills/create-pr/reference/change-report.en.md +46 -0
  231. package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +46 -0
  232. package/templates/.agents/skills/create-pr/scripts/change-report.mjs +203 -0
  233. package/templates/.agents/skills/create-release-note/SKILL.en.md +5 -6
  234. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +5 -6
  235. package/templates/.agents/skills/create-task/SKILL.en.md +1 -1
  236. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +1 -1
  237. package/templates/.agents/skills/import-issue/SKILL.en.md +1 -1
  238. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +1 -1
  239. package/templates/.agents/skills/plan-task/SKILL.en.md +5 -4
  240. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +5 -4
  241. package/templates/.agents/skills/restore-task/SKILL.en.md +1 -1
  242. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +1 -1
  243. package/templates/.agents/skills/review-analysis/SKILL.en.md +5 -3
  244. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +5 -3
  245. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -0
  246. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -0
  247. package/templates/.agents/skills/review-code/SKILL.en.md +5 -3
  248. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +5 -3
  249. package/templates/.agents/skills/review-code/config/verify.en.json +1 -0
  250. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -0
  251. package/templates/.agents/skills/review-code/reference/migration-risks.en.md +9 -6
  252. package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +9 -6
  253. package/templates/.agents/skills/review-plan/SKILL.en.md +5 -3
  254. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +5 -3
  255. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -0
  256. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -0
  257. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +7 -3
  258. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +7 -3
  259. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.en.md +1 -1
  260. package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.zh-CN.md +1 -1
  261. package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +2 -2
  262. package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +2 -2
  263. package/templates/.agents/skills/run-task/SKILL.en.md +6 -2
  264. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +6 -2
  265. package/templates/.agents/skills/run-task/reference/host-validation.en.md +2 -2
  266. package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +2 -2
  267. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +2 -2
  268. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -2
  269. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +159 -104
  270. package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -2
  271. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +2 -2
  272. package/templates/.agents/templates/task.en.md +1 -1
  273. package/templates/.agents/templates/task.zh-CN.md +1 -1
  274. package/templates/.claude/commands/analyze-task.en.md +1 -1
  275. package/templates/.claude/commands/analyze-task.zh-CN.md +1 -1
  276. package/templates/.claude/commands/block-task.en.md +1 -1
  277. package/templates/.claude/commands/block-task.zh-CN.md +1 -1
  278. package/templates/.claude/commands/cancel-task.en.md +1 -1
  279. package/templates/.claude/commands/cancel-task.zh-CN.md +1 -1
  280. package/templates/.claude/commands/check-task.en.md +1 -1
  281. package/templates/.claude/commands/check-task.zh-CN.md +1 -1
  282. package/templates/.claude/commands/code-task.en.md +1 -1
  283. package/templates/.claude/commands/code-task.zh-CN.md +1 -1
  284. package/templates/.claude/commands/commit.en.md +1 -1
  285. package/templates/.claude/commands/commit.zh-CN.md +1 -1
  286. package/templates/.claude/commands/complete-manual-validation.en.md +1 -1
  287. package/templates/.claude/commands/complete-manual-validation.zh-CN.md +1 -1
  288. package/templates/.claude/commands/complete-task.en.md +1 -1
  289. package/templates/.claude/commands/complete-task.zh-CN.md +1 -1
  290. package/templates/.claude/commands/create-pr.en.md +1 -1
  291. package/templates/.claude/commands/create-pr.zh-CN.md +1 -1
  292. package/templates/.claude/commands/plan-task.en.md +1 -1
  293. package/templates/.claude/commands/plan-task.zh-CN.md +1 -1
  294. package/templates/.claude/commands/review-analysis.en.md +1 -1
  295. package/templates/.claude/commands/review-analysis.zh-CN.md +1 -1
  296. package/templates/.claude/commands/review-code.en.md +1 -1
  297. package/templates/.claude/commands/review-code.zh-CN.md +1 -1
  298. package/templates/.claude/commands/review-plan.en.md +1 -1
  299. package/templates/.claude/commands/review-plan.zh-CN.md +1 -1
  300. package/templates/.claude/commands/run-manual-validation.en.md +1 -1
  301. package/templates/.claude/commands/run-manual-validation.zh-CN.md +1 -1
  302. package/templates/.claude/commands/run-task.en.md +1 -1
  303. package/templates/.claude/commands/run-task.zh-CN.md +1 -1
  304. package/templates/.claude/commands/watch-pr.en.md +1 -1
  305. package/templates/.claude/commands/watch-pr.zh-CN.md +1 -1
  306. package/templates/.traecli/commands/update-agent-infra.en.md +7 -0
  307. package/templates/.traecli/commands/update-agent-infra.zh-CN.md +7 -0
  308. package/dist/lib/builtin-tuis.js +0 -40
  309. package/lib/builtin-tuis.ts +0 -56
@@ -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 Agent Client whose `agentClients[].enabled` is `false` (legacy `tuis` is migration-only; 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` (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
@@ -131,7 +131,7 @@ warning to the end of the report:
131
131
  > **Rationale**: The current execution used the old skill logic; the new version
132
132
  > may contain additional processing steps. Running again ensures the new logic
133
133
  > is fully applied.
134
- > Alternatively, users can run `ai update` before executing the skill to
134
+ > Alternatively, users can run `ai sync` before executing the skill to
135
135
  > pre-update the seed files and avoid the need for a second run.
136
136
 
137
137
  ### Output report
@@ -43,7 +43,7 @@ node .agents/skills/update-agent-infra/scripts/sync-templates.js
43
43
  - `managed.conflicts`:来源未知、双边修改或平台切换时无法证明官方所有权的 guarded managed 冲突;必须逐项展示 target、reason 与三方哈希
44
44
  - `managed.removed`:被删除的 managed 文件(包括模板迁移时移除的旧路径)
45
45
  - `managed.skippedPlatform`:因归属其他平台而被跳过的 managed / merged 条目
46
- - `managed.skippedTUI`:因对应内建 Agent Client 的 `agentClients[].enabled` 为 `false` 而被跳过的 managed / merged 条目(旧 `tuis` 仅用于迁移;落在同一路径前缀下的 customTUI 命令文件会被保留)
46
+ - `managed.skippedTUI`:因对应内建 Agent Client 的 `agentClients[].enabled` 为 `false` 而被跳过的 managed / merged 条目(落在同一路径前缀下的 customTUI 命令文件会被保留)
47
47
  - `merged.pending`:需要 AI 处理的 merged 文件列表
48
48
  - 每项包含 `target`(项目中的目标路径)和 `template`(模板根目录下的相对路径)
49
49
  - `registryAdded`:新增的文件注册条目
@@ -116,7 +116,7 @@ node .agents/skills/update-agent-infra/scripts/sync-templates.js
116
116
 
117
117
  > **原因**:本次执行使用的是旧版技能逻辑,新版技能可能包含额外的处理步骤。
118
118
  > 再次执行可确保新逻辑完整应用。
119
- > 用户也可以在执行前先运行 `ai update` 来预先更新技能文件,避免需要两次执行。
119
+ > 用户也可以在执行前先运行 `ai sync` 来预先更新技能文件,避免需要两次执行。
120
120
 
121
121
  ### 输出报告
122
122
 
@@ -48,6 +48,11 @@ const DEFAULTS = {
48
48
  "id": "opencode",
49
49
  "enabled": true,
50
50
  "installInSandbox": true
51
+ },
52
+ {
53
+ "id": "traecli",
54
+ "enabled": true,
55
+ "installInSandbox": true
51
56
  }
52
57
  ],
53
58
  "sandbox": {
@@ -111,6 +116,10 @@ const DEFAULTS = {
111
116
  ],
112
117
  "ejected": [],
113
118
  "retiredManaged": [
119
+ {
120
+ "path": ".trae/skills/",
121
+ "templateHashes": []
122
+ },
114
123
  {
115
124
  "path": ".agents/workspace/README.md",
116
125
  "templateHashes": [
@@ -189,6 +198,24 @@ const AGENT_CLIENT_MANIFEST = [
189
198
  },
190
199
  "argumentsToken": "$ARGUMENTS"
191
200
  }
201
+ },
202
+ {
203
+ "id": "traecli",
204
+ "displayName": "TraeCode CLI",
205
+ "invocation": "/${skillName}",
206
+ "ownedPathPrefixes": [
207
+ ".traecli/"
208
+ ],
209
+ "managed": [
210
+ ".traecli/commands/"
211
+ ],
212
+ "merged": [],
213
+ "ejected": [],
214
+ "customCommand": {
215
+ "target": ".traecli/commands/${skillName}.md",
216
+ "frontmatter": {},
217
+ "argumentsToken": "$ARGUMENTS"
218
+ }
192
219
  }
193
220
  ];
194
221
  const CUSTOM_TUI_CONTRACT = {
@@ -206,84 +233,19 @@ const CUSTOM_TUI_CONTRACT = {
206
233
  const KNOWN_PLATFORMS = new Set(['github', 'none']);
207
234
  const KNOWN_LANGUAGES = new Set(['en', 'zh-CN']);
208
235
 
209
- const BUILTIN_TUI_IDS = AGENT_CLIENT_MANIFEST.map((entry) => entry.id);
236
+ const AGENT_CLIENT_IDS = AGENT_CLIENT_MANIFEST.map((entry) => entry.id);
210
237
 
211
238
  function normalizeAgentClientConfig(cfg) {
212
239
  const own = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
213
- const diagnostics = [];
214
240
  const failure = (code, path) => ({
215
- source: null,
216
241
  state: null,
217
242
  canonical: null,
218
- remainingSandboxTools: undefined,
219
- removeLegacyTuis: false,
220
- changed: false,
221
- diagnostics,
222
243
  error: `${code} at ${path}`,
223
244
  errorCode: code,
224
245
  errorPath: path
225
246
  });
226
- const projectTuis = (value) => {
227
- if (!Array.isArray(value)) {
228
- return Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, true]));
229
- }
230
- const enabled = new Set();
231
- for (const [index, candidate] of value.entries()) {
232
- if (BUILTIN_TUI_IDS.includes(candidate)) enabled.add(candidate);
233
- else diagnostics.push({ code: 'LEGACY_VALUE_IGNORED', path: `tuis[${index}]` });
234
- }
235
- return Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, enabled.has(id)]));
236
- };
237
- const projectSandbox = (value) => {
238
- if (!Array.isArray(value) || value.length === 0) {
239
- return {
240
- installed: Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, true])),
241
- clientSignals: new Set(),
242
- remainingTools: Array.isArray(value) ? [] : undefined
243
- };
244
- }
245
- const installed = new Set();
246
- const remainingTools = [];
247
- for (const [index, candidate] of value.entries()) {
248
- if (BUILTIN_TUI_IDS.includes(candidate)) installed.add(candidate);
249
- else if (typeof candidate === 'string') remainingTools.push(candidate);
250
- else diagnostics.push({ code: 'LEGACY_VALUE_IGNORED', path: `sandbox.tools[${index}]` });
251
- }
252
- return {
253
- installed: Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, installed.has(id)])),
254
- clientSignals: installed,
255
- remainingTools
256
- };
257
- };
258
- const serialize = (state) => BUILTIN_TUI_IDS.map((id) => ({ id, ...state[id] }));
259
- const hasCanonical = own(cfg, 'agentClients');
260
- const hasLegacyTuis = own(cfg, 'tuis');
261
- const sandbox = cfg.sandbox && typeof cfg.sandbox === 'object' && !Array.isArray(cfg.sandbox)
262
- ? cfg.sandbox
263
- : undefined;
264
- const hasSandboxTools = sandbox !== undefined && own(sandbox, 'tools');
265
- const tuiProjection = projectTuis(cfg.tuis);
266
- const sandboxProjection = projectSandbox(sandbox?.tools);
267
-
268
- if (!hasCanonical) {
269
- const state = Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, {
270
- enabled: tuiProjection[id],
271
- installInSandbox: sandboxProjection.installed[id]
272
- }]));
273
- return {
274
- source: 'legacy',
275
- state,
276
- canonical: serialize(state),
277
- remainingSandboxTools: sandboxProjection.remainingTools,
278
- removeLegacyTuis: hasLegacyTuis,
279
- changed: true,
280
- diagnostics,
281
- error: null,
282
- errorCode: null,
283
- errorPath: null
284
- };
285
- }
286
-
247
+ const serialize = (state) => AGENT_CLIENT_IDS.map((id) => ({ id, ...state[id] }));
248
+ if (!own(cfg, 'agentClients')) return failure('MISSING_AGENT_CLIENT', 'agentClients');
287
249
  if (!Array.isArray(cfg.agentClients)) return failure('INVALID_AGENT_CLIENTS', 'agentClients');
288
250
  const entries = new Map();
289
251
  for (const [index, candidate] of cfg.agentClients.entries()) {
@@ -301,7 +263,7 @@ function normalizeAgentClientConfig(cfg) {
301
263
  ) {
302
264
  return failure('INVALID_AGENT_CLIENTS', entryPath);
303
265
  }
304
- if (!BUILTIN_TUI_IDS.includes(candidate.id)) {
266
+ if (!AGENT_CLIENT_IDS.includes(candidate.id)) {
305
267
  return failure('UNKNOWN_AGENT_CLIENT', `${entryPath}.id`);
306
268
  }
307
269
  if (entries.has(candidate.id)) return failure('DUPLICATE_AGENT_CLIENT', `${entryPath}.id`);
@@ -311,24 +273,44 @@ function normalizeAgentClientConfig(cfg) {
311
273
  let orchestration;
312
274
  if (own(candidate, 'orchestration')) {
313
275
  const policy = candidate.orchestration;
314
- const exact = (value) => typeof value === 'string' && value.length > 0 && value.trim() === value;
315
- const validRole = (role) => role
316
- && typeof role === 'object'
317
- && !Array.isArray(role)
318
- && Object.keys(role).length === 2
319
- && exact(role.model)
320
- && exact(role.reasoningEffort);
321
276
  if (
322
277
  !policy
323
278
  || typeof policy !== 'object'
324
279
  || Array.isArray(policy)
325
280
  || Object.keys(policy).length !== 2
326
- || !validRole(policy.executor)
327
- || !validRole(policy.reviewer)
281
+ || !own(policy, 'executor')
282
+ || !own(policy, 'reviewer')
328
283
  ) {
329
284
  return failure('INVALID_AGENT_CLIENTS', `${entryPath}.orchestration`);
330
285
  }
331
- orchestration = structuredClone(policy);
286
+ const parseExact = (value, path) => {
287
+ if (typeof value !== 'string' || value.length === 0 || value.trim() !== value) {
288
+ return failure('INVALID_AGENT_CLIENTS', path);
289
+ }
290
+ return value;
291
+ };
292
+ const parseRole = (role, rolePath) => {
293
+ if (
294
+ !role
295
+ || typeof role !== 'object'
296
+ || Array.isArray(role)
297
+ || Object.keys(role).length !== 2
298
+ || !own(role, 'model')
299
+ || !own(role, 'reasoningEffort')
300
+ ) {
301
+ return failure('INVALID_AGENT_CLIENTS', rolePath);
302
+ }
303
+ const model = parseExact(role.model, `${rolePath}.model`);
304
+ if (typeof model !== 'string') return model;
305
+ const reasoningEffort = parseExact(role.reasoningEffort, `${rolePath}.reasoningEffort`);
306
+ if (typeof reasoningEffort !== 'string') return reasoningEffort;
307
+ return { model, reasoningEffort };
308
+ };
309
+ const executor = parseRole(policy.executor, `${entryPath}.orchestration.executor`);
310
+ if (executor.errorCode) return executor;
311
+ const reviewer = parseRole(policy.reviewer, `${entryPath}.orchestration.reviewer`);
312
+ if (reviewer.errorCode) return reviewer;
313
+ orchestration = { executor, reviewer };
332
314
  }
333
315
  entries.set(candidate.id, {
334
316
  enabled: candidate.enabled,
@@ -336,25 +318,29 @@ function normalizeAgentClientConfig(cfg) {
336
318
  ...(orchestration ? { orchestration } : {})
337
319
  });
338
320
  }
339
- if (BUILTIN_TUI_IDS.some((id) => !entries.has(id))) {
321
+ if (AGENT_CLIENT_IDS.some((id) => !entries.has(id))) {
340
322
  return failure('MISSING_AGENT_CLIENT', 'agentClients');
341
323
  }
342
- const state = Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, entries.get(id)]));
343
- if (hasLegacyTuis && BUILTIN_TUI_IDS.some((id) => state[id].enabled !== tuiProjection[id])) {
344
- return failure('LEGACY_CONFLICT', 'tuis');
324
+ for (const [index, id] of AGENT_CLIENT_IDS.entries()) {
325
+ if (cfg.agentClients[index]?.id !== id) {
326
+ return failure('INVALID_AGENT_CLIENTS', `agentClients[${index}].id`);
327
+ }
345
328
  }
346
- if ([...sandboxProjection.clientSignals].some((id) => !state[id].installInSandbox)) {
347
- return failure('LEGACY_CONFLICT', 'sandbox.tools');
329
+ if (own(cfg, 'tuis')) return failure('INVALID_AGENT_CLIENTS', 'tuis');
330
+ const sandbox = cfg.sandbox && typeof cfg.sandbox === 'object' && !Array.isArray(cfg.sandbox)
331
+ ? cfg.sandbox
332
+ : undefined;
333
+ if (Array.isArray(sandbox?.tools)) {
334
+ for (const [index, tool] of sandbox.tools.entries()) {
335
+ if (AGENT_CLIENT_IDS.includes(tool)) {
336
+ return failure('INVALID_AGENT_CLIENTS', `sandbox.tools[${index}]`);
337
+ }
338
+ }
348
339
  }
349
- const sameOrder = cfg.agentClients.every((entry, index) => entry.id === BUILTIN_TUI_IDS[index]);
340
+ const state = Object.fromEntries(AGENT_CLIENT_IDS.map((id) => [id, entries.get(id)]));
350
341
  return {
351
- source: 'canonical',
352
342
  state,
353
343
  canonical: serialize(state),
354
- remainingSandboxTools: hasSandboxTools ? sandboxProjection.remainingTools : undefined,
355
- removeLegacyTuis: hasLegacyTuis,
356
- changed: hasLegacyTuis || sandboxProjection.clientSignals.size > 0 || !sameOrder,
357
- diagnostics,
358
344
  error: null,
359
345
  errorCode: null,
360
346
  errorPath: null
@@ -363,16 +349,6 @@ function normalizeAgentClientConfig(cfg) {
363
349
 
364
350
  function materializeAgentClientConfig(cfg, normalized) {
365
351
  cfg.agentClients = normalized.canonical;
366
- delete cfg.tuis;
367
- if (normalized.remainingSandboxTools !== undefined) {
368
- cfg.sandbox = {
369
- ...(cfg.sandbox || {}),
370
- tools: [
371
- 'agent-infra',
372
- ...normalized.remainingSandboxTools.filter((tool) => tool !== 'agent-infra')
373
- ]
374
- };
375
- }
376
352
  }
377
353
 
378
354
  function assetMatches(entry, target) {
@@ -459,6 +435,17 @@ function isInsideProject(projectRoot, relativePath) {
459
435
  return rel !== '' && !rel.startsWith('..') && !path.isAbsolute(rel);
460
436
  }
461
437
 
438
+ function isInsideProjectDirectory(projectRoot, directory, relativePath) {
439
+ if (!isInsideProject(projectRoot, directory) || !isInsideProject(projectRoot, relativePath)) {
440
+ return false;
441
+ }
442
+
443
+ const root = path.resolve(projectRoot, directory);
444
+ const resolved = path.resolve(projectRoot, relativePath);
445
+ const rel = path.relative(root, resolved);
446
+ return rel !== '' && !rel.startsWith('..') && !path.isAbsolute(rel);
447
+ }
448
+
462
449
  function isPathOwnedByOtherPlatform(relativePath, platformType) {
463
450
  const normalized = norm(relativePath).replace(/^\.\//, '');
464
451
  const top = normalized.split('/')[0];
@@ -1286,7 +1273,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
1286
1273
  return { error: enabledResolution.error };
1287
1274
  }
1288
1275
  const enabledTUIs = new Set(
1289
- BUILTIN_TUI_IDS.filter((id) => enabledResolution.state[id].enabled)
1276
+ AGENT_CLIENT_IDS.filter((id) => enabledResolution.state[id].enabled)
1290
1277
  );
1291
1278
  materializeAgentClientConfig(cfg, enabledResolution);
1292
1279
  const customTUIsConfig = Array.isArray(cfg.customTUIs) ? cfg.customTUIs : [];
@@ -1306,6 +1293,10 @@ function syncTemplates(projectRoot, templateRootOverride) {
1306
1293
  (descriptor.templateHashes || []).map(trustedBaseline).filter(Boolean)
1307
1294
  )];
1308
1295
  }));
1296
+ const retiredManagedForTarget = (target) => [...retiredManaged.entries()].find(
1297
+ ([entry]) => assetMatches(entry, target)
1298
+ && (!entry.endsWith('/') || isInsideProjectDirectory(projectRoot, entry, target))
1299
+ );
1309
1300
  const planningRegistry = {
1310
1301
  ...currentRegistry,
1311
1302
  managed: currentRegistry.managed.filter((entry) => !retiredManaged.has(norm(entry)))
@@ -1334,7 +1325,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
1334
1325
  for (const target of Object.keys(managedBaselines)) {
1335
1326
  if (
1336
1327
  !guardedManaged.has(norm(target))
1337
- && !retiredManaged.has(norm(target))
1328
+ && !retiredManagedForTarget(target)
1338
1329
  && !allClientManaged.some((entry) => assetMatches(entry, target))
1339
1330
  ) {
1340
1331
  delete managedBaselines[target];
@@ -1410,8 +1401,72 @@ function syncTemplates(projectRoot, templateRootOverride) {
1410
1401
  );
1411
1402
 
1412
1403
  for (const [entry, historicalTemplateHashes] of retiredManaged) {
1413
- const target = path.join(projectRoot, entry);
1404
+ const target = path.join(projectRoot, entry.endsWith('/') ? entry.slice(0, -1) : entry);
1414
1405
  const owned = currentRegistry.managed.some((candidate) => norm(candidate) === entry);
1406
+ if (entry.endsWith('/')) {
1407
+ if (fs.existsSync(target)) {
1408
+ const targetStat = fs.lstatSync(target);
1409
+ if (!targetStat.isDirectory() || targetStat.isSymbolicLink()) {
1410
+ report.managed.protected.push({
1411
+ target: entry,
1412
+ reason: 'invalid-type',
1413
+ baseline: null,
1414
+ local: null,
1415
+ template: null
1416
+ });
1417
+ continue;
1418
+ }
1419
+ }
1420
+ const candidates = new Set(
1421
+ Object.keys(managedBaselines).filter((candidate) =>
1422
+ assetMatches(entry, candidate)
1423
+ && isInsideProjectDirectory(projectRoot, entry, candidate)
1424
+ )
1425
+ );
1426
+ if (owned && fs.existsSync(target)) {
1427
+ for (const filePath of walkDir(target)) {
1428
+ candidates.add(norm(path.relative(projectRoot, filePath)));
1429
+ }
1430
+ }
1431
+
1432
+ for (const candidate of candidates) {
1433
+ const candidatePath = path.join(projectRoot, candidate);
1434
+ const baseline = trustedBaseline(managedBaselines[candidate]);
1435
+ if (!fs.existsSync(candidatePath)) {
1436
+ if (Object.prototype.hasOwnProperty.call(managedBaselines, candidate)) {
1437
+ delete managedBaselines[candidate];
1438
+ baselinesChanged = true;
1439
+ }
1440
+ continue;
1441
+ }
1442
+ const stat = fs.lstatSync(candidatePath);
1443
+ const localHash = stat.isFile() && !stat.isSymbolicLink()
1444
+ ? sha256(fs.readFileSync(candidatePath))
1445
+ : null;
1446
+ const safeToRemove = localHash !== null
1447
+ && (localHash === baseline || historicalTemplateHashes.has(localHash));
1448
+ if (safeToRemove) {
1449
+ fs.unlinkSync(candidatePath);
1450
+ report.managed.removed.push(candidate);
1451
+ } else {
1452
+ report.managed.protected.push({
1453
+ target: candidate,
1454
+ reason: localHash === null
1455
+ ? 'invalid-type'
1456
+ : (baseline !== null ? 'user-modified' : 'unknown-origin'),
1457
+ baseline,
1458
+ local: localHash,
1459
+ template: null
1460
+ });
1461
+ }
1462
+ if (Object.prototype.hasOwnProperty.call(managedBaselines, candidate)) {
1463
+ delete managedBaselines[candidate];
1464
+ baselinesChanged = true;
1465
+ }
1466
+ }
1467
+ removeEmptyDirs(target);
1468
+ continue;
1469
+ }
1415
1470
  if (!fs.existsSync(target)) continue;
1416
1471
  const stat = fs.lstatSync(target);
1417
1472
  const baseline = trustedBaseline(managedBaselines[entry]);
@@ -21,7 +21,7 @@ Version stamp rule: before creating or updating `task.md` frontmatter, read `.ag
21
21
 
22
22
  ## Task Context Resolution
23
23
 
24
- > Keep `--pr <number>` and PR URLs on the existing PR-anchored path. Otherwise, the task path may omit the task ref and also accepts a legacy positional ref or `--task <ref>` / `-t <ref>`. Separate task scope from the full arguments, then call `agent-infra-internal task-context resolve {task-scope}` and bind `{task-id}` to the returned full `taskId`. A PR anchor and task scope are mutually exclusive.
24
+ > Keep `--pr <number>` and PR URLs on the existing PR-anchored path. Otherwise, the task path may omit the task ref; explicit task scope accepts only `--task <ref>` or `-t <ref>`, and positional task refs are not interpreted. Separate task scope from the full arguments, then call `agent-infra-internal task-context resolve {task-scope}` and bind `{task-id}` to the returned full `taskId`. A PR anchor and task scope are mutually exclusive.
25
25
 
26
26
  ## Step Start: Write the started Marker
27
27
 
@@ -40,7 +40,7 @@ After prerequisites pass and before this round's first artifact action, append a
40
40
  Resolve the target PR number `{pr#}` and an optional `{task-id}` via these deterministic branches:
41
41
 
42
42
  - Scenario A (argument omitted): reverse-lookup the active task from the current branch, then read its `pr_number`.
43
- - Scenario B (omitted task ref, positional task ref, or `--task/-t`, **task-anchored primary path**): resolve the full `{task-id}` via "Task Context Resolution" and read `.agents/workspace/active/{task-id}/task.md` for `pr_number` as `{pr#}`; if `pr_number` is empty, follow "Error Handling" to prompt running `create-pr` first, then stop.
43
+ - Scenario B (omitted task ref or `--task/-t`, **task-anchored primary path**): resolve the full `{task-id}` via "Task Context Resolution" and read `.agents/workspace/active/{task-id}/task.md` for `pr_number` as `{pr#}`; if `pr_number` is empty, follow "Error Handling" to prompt running `create-pr` first, then stop.
44
44
  - Scenario C (`--pr <number>` or a PR URL): use that PR number directly as `{pr#}`; then determine `{task-id}` via "Reverse-lookup task".
45
45
  - Reverse-lookup task (scenarios A / C): use task context/query capabilities to find the unique active task bound to `{pr#}`. If none exists, stop and request binding first; the typed checks intent does not create a second taskless state machine.
46
46
 
@@ -21,7 +21,7 @@ description: >
21
21
 
22
22
  ## 任务上下文解析
23
23
 
24
- > 入口允许省略 task ref,也接受旧位置 task ref 或 `--task <ref>` / `-t <ref>`。先从完整参数中分离 task scope 并原样保留其他业务操作数,再调用 `agent-infra-internal task-context resolve {task-scope}`;`{task-scope}` 为空、位置 ref 或 task flag 之一。只读取结构化结果的 `taskId`,后续把 `{task-id}` 绑定为该完整 `TASK-YYYYMMDD-HHMMSS`。解析失败时透传非零退出码,不自行扫描任务。
24
+ > 入口允许省略 task ref,也接受 `--task <ref>` / `-t <ref>`。先从完整参数中分离 task scope 并原样保留其他业务操作数,再调用 `agent-infra-internal task-context resolve {task-scope}`;`{task-scope}` 为空或 task flag 之一。只读取结构化结果的 `taskId`,后续把 `{task-id}` 绑定为该完整 `TASK-YYYYMMDD-HHMMSS`。解析失败时透传非零退出码,不自行扫描任务。
25
25
 
26
26
  ## 步骤开始:写入 started 标记
27
27
 
@@ -40,7 +40,7 @@ description: >
40
40
  按以下确定性分支解析出目标 PR 号 `{pr#}` 与可选 `{task-id}`:
41
41
 
42
42
  - 场景 A(省略入参):从当前分支反查 active task;定位后读取其 `pr_number`。
43
- - 场景 B(省略 task ref、旧位置 task ref 或 `--task/-t`,**任务锚定主路径**):按「任务上下文解析」取得完整 `{task-id}`。读 `.agents/workspace/active/{task-id}/task.md` 取 `pr_number` 作为 `{pr#}`;`pr_number` 为空时按「错误处理」提示先 `create-pr`,停止。
43
+ - 场景 B(省略 task ref 或 `--task/-t`,**任务锚定主路径**):按「任务上下文解析」取得完整 `{task-id}`。读 `.agents/workspace/active/{task-id}/task.md` 取 `pr_number` 作为 `{pr#}`;`pr_number` 为空时按「错误处理」提示先 `create-pr`,停止。
44
44
  - 场景 C(`--pr <number>` 或 PR URL):直接取该 PR 号为 `{pr#}`;随后按「反查任务」确定 `{task-id}`。
45
45
  - 反查任务(场景 A / C):通过任务上下文/任务查询取得与 `{pr#}` 唯一绑定的 active task。未命中时停止并提示先绑定 PR;typed checks intent 不建立第二套无任务状态机。
46
46
 
@@ -80,7 +80,7 @@ pr_status: pending # PR status: pending (default) | created (PR crea
80
80
 
81
81
  ## Human Rulings
82
82
 
83
- <!-- Use ai decide <task-ref> <ordinal|ledger-id> [--needs-implementation true|false] <decision> for needs-human-decision rulings; upstream AI predeclares implementation intent for new code decisions, while the explicit option remains for legacy tasks or consistency checks. -->
83
+ <!-- Use ai decide [--task <ref> | -t <ref>] (--item <ordinal|ledger-id> | -i <ordinal|ledger-id>) [--needs-implementation true|false] <decision> for needs-human-decision rulings; upstream AI predeclares implementation intent for new code decisions, while the explicit option remains for legacy tasks or consistency checks. -->
84
84
 
85
85
  ## Implementation Inputs
86
86
 
@@ -80,7 +80,7 @@ pr_status: pending # PR 状态:pending(默认)| created(已
80
80
 
81
81
  ## 人工裁决
82
82
 
83
- <!-- 使用 ai decide <task-ref> <序号|账本ID> [--needs-implementation true|false] <裁决内容> 写入 needs-human-decision 裁定;新建 code 裁决的实现意图由上游 AI 预先声明,显式参数仅用于历史任务兼容或一致性复核。 -->
83
+ <!-- 使用 ai decide [--task <ref> | -t <ref>] (--item <序号|账本ID> | -i <序号|账本ID>) [--needs-implementation true|false] <裁决内容> 写入 needs-human-decision 裁定;新建 code 裁决的实现意图由上游 AI 预先声明,显式参数仅用于历史任务兼容或一致性复核。 -->
84
84
 
85
85
  ## 实现输入
86
86
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Analyze a task and produce a requirements document"
3
- usage: "/analyze-task [task-ref | --task <ref>]"
3
+ usage: "/analyze-task [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  Read and execute the analyze-task skill from `.agents/skills/analyze-task/SKILL.md`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "分析任务并输出需求分析文档"
3
- usage: "/analyze-task [task-ref | --task <ref>]"
3
+ usage: "/analyze-task [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  读取并执行 `.agents/skills/analyze-task/SKILL.md` 中的 analyze-task 技能。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Mark a task as blocked and record the reason"
3
- usage: "/block-task [task-ref | --task <ref>] [reason]"
3
+ usage: "/block-task [--task <ref> | -t <ref>] [reason]"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "标记任务为阻塞状态并记录原因"
3
- usage: "/block-task [task-ref | --task <ref>] [reason]"
3
+ usage: "/block-task [--task <ref> | -t <ref>] [reason]"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Cancel a task and archive it"
3
- usage: "/cancel-task [task-ref | --task <ref>] <reason>"
3
+ usage: "/cancel-task [--task <ref> | -t <ref>] <reason>"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "取消任务并归档"
3
- usage: "/cancel-task [task-ref | --task <ref>] <reason>"
3
+ usage: "/cancel-task [--task <ref> | -t <ref>] <reason>"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Check a task's current status and progress"
3
- usage: "/check-task [task-ref | --task <ref>]"
3
+ usage: "/check-task [--task <ref> | -t <ref>]"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "查看任务的当前状态和进度"
3
- usage: "/check-task [task-ref | --task <ref>]"
3
+ usage: "/check-task [--task <ref> | -t <ref>]"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Code a task from its technical plan and output a report"
3
- usage: "/code-task [task-ref | --task <ref>]"
3
+ usage: "/code-task [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  Read and execute the code-task skill from `.agents/skills/code-task/SKILL.md`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "根据技术方案编码任务并输出报告"
3
- usage: "/code-task [task-ref | --task <ref>]"
3
+ usage: "/code-task [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  读取并执行 `.agents/skills/code-task/SKILL.md` 中的 code-task 技能。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Commit the current changes to Git"
3
- usage: "/commit [task-ref | --task <ref>]"
3
+ usage: "/commit [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  Read and execute the commit skill from `.agents/skills/commit/SKILL.md`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "提交当前变更到 Git"
3
- usage: "/commit [task-ref | --task <ref>]"
3
+ usage: "/commit [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  读取并执行 `.agents/skills/commit/SKILL.md` 中的 commit 技能。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Mark PR manual validation as completed and update the summary comment"
3
- usage: "/complete-manual-validation [task-ref | --task <ref>] [pr-ref] <verification-summary>"
3
+ usage: "/complete-manual-validation [--task <ref> | -t <ref>] [pr-ref] <verification-summary>"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "标记 PR 人工验证已完成并更新摘要评论"
3
- usage: "/complete-manual-validation [task-ref | --task <ref>] [pr-ref] <verification-summary>"
3
+ usage: "/complete-manual-validation [--task <ref> | -t <ref>] [pr-ref] <verification-summary>"
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Mark a task as completed and archive it"
3
- usage: "/complete-task [task-ref | --task <ref>]"
3
+ usage: "/complete-task [--task <ref> | -t <ref>] [--skip-pr] [--force]"
4
4
  ---
5
5
 
6
6
  Read and execute the complete-task skill from `.agents/skills/complete-task/SKILL.md`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "标记任务完成并归档"
3
- usage: "/complete-task [task-ref | --task <ref>]"
3
+ usage: "/complete-task [--task <ref> | -t <ref>] [--skip-pr] [--force]"
4
4
  ---
5
5
 
6
6
  读取并执行 `.agents/skills/complete-task/SKILL.md` 中的 complete-task 技能。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Create a Pull Request to a target branch"
3
- usage: "/create-pr [task-ref | --task <ref>] [target-branch]"
3
+ usage: "/create-pr [--task <ref> | -t <ref>] [target-branch]"
4
4
  ---
5
5
 
6
6
  Read and execute the create-pr skill from `.agents/skills/create-pr/SKILL.md`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "创建 Pull Request 到目标分支"
3
- usage: "/create-pr [task-ref | --task <ref>] [target-branch]"
3
+ usage: "/create-pr [--task <ref> | -t <ref>] [target-branch]"
4
4
  ---
5
5
 
6
6
  读取并执行 `.agents/skills/create-pr/SKILL.md` 中的 create-pr 技能。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Design a technical plan for a task"
3
- usage: "/plan-task [task-ref | --task <ref>]"
3
+ usage: "/plan-task [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  Read and execute the plan-task skill from `.agents/skills/plan-task/SKILL.md`.