@fitlab-ai/agent-infra 0.9.10 → 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 (269) 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 +50 -4
  6. package/dist/lib/agent-client.js +0 -1
  7. package/dist/lib/agent-clients/adapters/opencode-sandbox.js +0 -4
  8. package/dist/lib/agent-clients/adapters/traecli.js +7 -8
  9. package/dist/lib/agent-clients/config.js +14 -99
  10. package/dist/lib/agent-clients/reconcile.js +1 -11
  11. package/dist/lib/agent-clients/schema.js +5 -4
  12. package/dist/lib/agent-clients/tokens.js +5 -15
  13. package/dist/lib/decide.js +14 -30
  14. package/dist/lib/defaults.json +4 -0
  15. package/dist/lib/init.js +2 -2
  16. package/dist/lib/internal/release-workflow.js +0 -1
  17. package/dist/lib/internal/task-finalization.js +19 -9
  18. package/dist/lib/internal/task-ledger.js +8 -2
  19. package/dist/lib/internal/task-lifecycle.js +17 -93
  20. package/dist/lib/internal/task-orchestration.js +30 -216
  21. package/dist/lib/internal/task-validate.js +2 -1
  22. package/dist/lib/merge.js +205 -103
  23. package/dist/lib/process-data/normalize.js +2 -9
  24. package/dist/lib/run/host.js +46 -16
  25. package/dist/lib/sandbox/agent-client-reconciler.js +4 -12
  26. package/dist/lib/sandbox/commands/create.js +3 -3
  27. package/dist/lib/sandbox/commands/enter.js +18 -4
  28. package/dist/lib/sandbox/config.js +3 -12
  29. package/dist/lib/sandbox/control/executor.js +131 -39
  30. package/dist/lib/sandbox/control/lifecycle.js +29 -20
  31. package/dist/lib/sandbox/control/server.js +18 -16
  32. package/dist/lib/sandbox/mounts.js +3 -2
  33. package/dist/lib/sandbox/recovery.js +123 -22
  34. package/dist/lib/sandbox/workspace-identity.js +14 -0
  35. package/dist/lib/sandbox/workspace-view.js +8 -9
  36. package/dist/lib/self-update.js +278 -0
  37. package/dist/lib/server/protocol.js +5 -5
  38. package/dist/lib/task/activity-log.js +4 -1
  39. package/dist/lib/task/artifact-lifecycle.js +4 -2
  40. package/dist/lib/task/codex-orchestration.js +1 -1
  41. package/dist/lib/task/command-options.js +1 -3
  42. package/dist/lib/task/commands/cat.js +0 -5
  43. package/dist/lib/task/commands/decisions.js +76 -92
  44. package/dist/lib/task/commands/files.js +6 -6
  45. package/dist/lib/task/commands/grep.js +25 -61
  46. package/dist/lib/task/commands/issue-body.js +6 -6
  47. package/dist/lib/task/commands/log.js +25 -10
  48. package/dist/lib/task/commands/show.js +5 -6
  49. package/dist/lib/task/commands/status.js +8 -8
  50. package/dist/lib/task/commit-operation.js +21 -25
  51. package/dist/lib/task/commit-policy.js +1 -1
  52. package/dist/lib/task/control-authority.js +431 -0
  53. package/dist/lib/task/create.js +6 -1
  54. package/dist/lib/task/current-contract.js +35 -0
  55. package/dist/lib/task/decision-details.js +263 -0
  56. package/dist/lib/task/decision-intents.js +5 -2
  57. package/dist/lib/task/events.js +11 -5
  58. package/dist/lib/task/index.js +19 -20
  59. package/dist/lib/task/ledger-intents.js +8 -9
  60. package/dist/lib/task/ledger.js +13 -6
  61. package/dist/lib/task/lifecycle.js +16 -0
  62. package/dist/lib/task/orchestration.js +50 -13
  63. package/dist/lib/task/review-artifacts.js +31 -12
  64. package/dist/lib/task/review-finalization.js +19 -6
  65. package/dist/lib/task/verification-engine.js +38 -15
  66. package/dist/lib/task/verification-review.js +1 -1
  67. package/dist/lib/task/workspace-snapshot.js +5 -11
  68. package/dist/lib/task/write.js +11 -1
  69. package/dist/lib/update.js +6 -37
  70. package/dist/lib/version.js +5 -1
  71. package/dist/lifecycle-build-manifest.json +3 -3
  72. package/lib/agent-client.ts +0 -1
  73. package/lib/agent-clients/adapters/opencode-sandbox.ts +0 -5
  74. package/lib/agent-clients/adapters/traecli.ts +7 -8
  75. package/lib/agent-clients/config.ts +14 -144
  76. package/lib/agent-clients/reconcile.ts +1 -12
  77. package/lib/agent-clients/schema.ts +5 -4
  78. package/lib/agent-clients/tokens.ts +5 -18
  79. package/lib/decide.ts +12 -22
  80. package/lib/defaults.json +4 -0
  81. package/lib/init.ts +2 -2
  82. package/lib/internal/release-workflow.ts +0 -1
  83. package/lib/internal/task-finalization.ts +27 -13
  84. package/lib/internal/task-ledger.ts +8 -2
  85. package/lib/internal/task-lifecycle.ts +33 -76
  86. package/lib/internal/task-orchestration.ts +33 -190
  87. package/lib/internal/task-validate.ts +3 -2
  88. package/lib/merge.ts +236 -120
  89. package/lib/process-data/normalize.ts +2 -8
  90. package/lib/run/host.ts +63 -14
  91. package/lib/sandbox/agent-client-reconciler.ts +5 -15
  92. package/lib/sandbox/commands/create.ts +4 -4
  93. package/lib/sandbox/commands/enter.ts +24 -4
  94. package/lib/sandbox/config.ts +2 -14
  95. package/lib/sandbox/control/container-identity.ts +2 -2
  96. package/lib/sandbox/control/executor.ts +148 -51
  97. package/lib/sandbox/control/lifecycle.ts +34 -28
  98. package/lib/sandbox/control/protocol.ts +1 -3
  99. package/lib/sandbox/control/server.ts +15 -12
  100. package/lib/sandbox/control/state.ts +7 -7
  101. package/lib/sandbox/mounts.ts +4 -3
  102. package/lib/sandbox/recovery.ts +162 -34
  103. package/lib/sandbox/tools.ts +1 -1
  104. package/lib/sandbox/workspace-identity.ts +28 -0
  105. package/lib/sandbox/workspace-view.ts +14 -10
  106. package/lib/self-update.ts +341 -0
  107. package/lib/server/protocol.ts +5 -5
  108. package/lib/task/activity-log.ts +6 -1
  109. package/lib/task/artifact-lifecycle.ts +5 -3
  110. package/lib/task/codex-orchestration.ts +2 -1
  111. package/lib/task/command-options.ts +1 -2
  112. package/lib/task/commands/cat.ts +0 -4
  113. package/lib/task/commands/decisions.ts +80 -75
  114. package/lib/task/commands/files.ts +6 -6
  115. package/lib/task/commands/grep.ts +23 -51
  116. package/lib/task/commands/issue-body.ts +6 -6
  117. package/lib/task/commands/log.ts +22 -10
  118. package/lib/task/commands/show.ts +5 -6
  119. package/lib/task/commands/status.ts +8 -8
  120. package/lib/task/commit-operation.ts +25 -30
  121. package/lib/task/commit-policy.ts +1 -2
  122. package/lib/task/control-authority.ts +563 -0
  123. package/lib/task/create.ts +6 -1
  124. package/lib/task/current-contract.ts +49 -0
  125. package/lib/task/decision-details.ts +340 -0
  126. package/lib/task/decision-intents.ts +7 -2
  127. package/lib/task/events.ts +10 -5
  128. package/lib/task/index.ts +19 -20
  129. package/lib/task/ledger-intents.ts +6 -8
  130. package/lib/task/ledger.ts +17 -7
  131. package/lib/task/lifecycle.ts +20 -0
  132. package/lib/task/orchestration.ts +40 -15
  133. package/lib/task/review-artifacts.ts +53 -15
  134. package/lib/task/review-finalization.ts +33 -7
  135. package/lib/task/verification-engine.ts +33 -18
  136. package/lib/task/verification-review.ts +1 -1
  137. package/lib/task/workspace-snapshot.ts +4 -13
  138. package/lib/task/write.ts +20 -1
  139. package/lib/update.ts +6 -40
  140. package/lib/version.ts +6 -1
  141. package/package.json +1 -1
  142. package/templates/.agents/README.en.md +5 -3
  143. package/templates/.agents/README.zh-CN.md +5 -3
  144. package/templates/.agents/rules/compatibility-policy.en.md +5 -4
  145. package/templates/.agents/rules/compatibility-policy.zh-CN.md +5 -4
  146. package/templates/.agents/rules/create-issue.github.en.md +1 -1
  147. package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
  148. package/templates/.agents/rules/human-decision-context.en.md +9 -7
  149. package/templates/.agents/rules/human-decision-context.zh-CN.md +9 -7
  150. package/templates/.agents/rules/issue-fields.github.en.md +1 -1
  151. package/templates/.agents/rules/issue-fields.github.zh-CN.md +1 -1
  152. package/templates/.agents/rules/issue-pr-commands.en.md +1 -1
  153. package/templates/.agents/rules/issue-pr-commands.github.en.md +1 -1
  154. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +1 -1
  155. package/templates/.agents/rules/issue-pr-commands.zh-CN.md +1 -1
  156. package/templates/.agents/rules/issue-sync.github.en.md +1 -1
  157. package/templates/.agents/rules/issue-sync.github.zh-CN.md +2 -2
  158. package/templates/.agents/rules/milestone-inference.github.en.md +1 -1
  159. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +1 -1
  160. package/templates/.agents/rules/next-step-output.en.md +3 -3
  161. package/templates/.agents/rules/next-step-output.zh-CN.md +3 -3
  162. package/templates/.agents/rules/no-mid-flow-questions.en.md +1 -1
  163. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +1 -1
  164. package/templates/.agents/rules/pr-sync.en.md +1 -1
  165. package/templates/.agents/rules/pr-sync.github.en.md +1 -1
  166. package/templates/.agents/rules/pr-sync.github.zh-CN.md +1 -1
  167. package/templates/.agents/rules/pr-sync.zh-CN.md +1 -1
  168. package/templates/.agents/rules/release-commands.github.en.md +6 -0
  169. package/templates/.agents/rules/release-commands.github.zh-CN.md +6 -0
  170. package/templates/.agents/rules/review-handshake.en.md +1 -1
  171. package/templates/.agents/rules/review-handshake.zh-CN.md +1 -1
  172. package/templates/.agents/rules/task-management.en.md +1 -2
  173. package/templates/.agents/rules/task-management.zh-CN.md +1 -2
  174. package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -3
  175. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
  176. package/templates/.agents/skills/block-task/SKILL.en.md +2 -2
  177. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
  178. package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
  179. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
  180. package/templates/.agents/skills/check-task/SKILL.en.md +2 -2
  181. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +2 -2
  182. package/templates/.agents/skills/close-codescan/SKILL.en.md +1 -1
  183. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +1 -1
  184. package/templates/.agents/skills/close-dependabot/SKILL.en.md +1 -1
  185. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -1
  186. package/templates/.agents/skills/code-task/SKILL.en.md +3 -3
  187. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +3 -3
  188. package/templates/.agents/skills/commit/SKILL.en.md +27 -7
  189. package/templates/.agents/skills/commit/SKILL.zh-CN.md +3 -4
  190. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +5 -5
  191. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +5 -5
  192. package/templates/.agents/skills/complete-task/SKILL.en.md +3 -3
  193. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +3 -3
  194. package/templates/.agents/skills/create-pr/SKILL.en.md +5 -7
  195. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +5 -7
  196. package/templates/.agents/skills/create-pr/reference/change-report.en.md +9 -4
  197. package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +9 -4
  198. package/templates/.agents/skills/create-pr/scripts/change-report.mjs +203 -0
  199. package/templates/.agents/skills/create-release-note/SKILL.en.md +5 -6
  200. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +5 -6
  201. package/templates/.agents/skills/create-task/SKILL.en.md +1 -1
  202. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +1 -1
  203. package/templates/.agents/skills/import-issue/SKILL.en.md +1 -1
  204. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +1 -1
  205. package/templates/.agents/skills/plan-task/SKILL.en.md +3 -3
  206. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +3 -3
  207. package/templates/.agents/skills/restore-task/SKILL.en.md +1 -1
  208. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +1 -1
  209. package/templates/.agents/skills/review-analysis/SKILL.en.md +5 -3
  210. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +5 -3
  211. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -0
  212. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -0
  213. package/templates/.agents/skills/review-code/SKILL.en.md +5 -3
  214. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +5 -3
  215. package/templates/.agents/skills/review-code/config/verify.en.json +1 -0
  216. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -0
  217. package/templates/.agents/skills/review-code/reference/migration-risks.en.md +2 -1
  218. package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +2 -1
  219. package/templates/.agents/skills/review-plan/SKILL.en.md +5 -3
  220. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +5 -3
  221. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -0
  222. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -0
  223. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +4 -0
  224. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +4 -0
  225. package/templates/.agents/skills/run-task/SKILL.en.md +4 -0
  226. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +4 -0
  227. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +2 -2
  228. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -2
  229. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +140 -109
  230. package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -2
  231. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +2 -2
  232. package/templates/.agents/templates/task.en.md +1 -1
  233. package/templates/.agents/templates/task.zh-CN.md +1 -1
  234. package/templates/.claude/commands/analyze-task.en.md +1 -1
  235. package/templates/.claude/commands/analyze-task.zh-CN.md +1 -1
  236. package/templates/.claude/commands/block-task.en.md +1 -1
  237. package/templates/.claude/commands/block-task.zh-CN.md +1 -1
  238. package/templates/.claude/commands/cancel-task.en.md +1 -1
  239. package/templates/.claude/commands/cancel-task.zh-CN.md +1 -1
  240. package/templates/.claude/commands/check-task.en.md +1 -1
  241. package/templates/.claude/commands/check-task.zh-CN.md +1 -1
  242. package/templates/.claude/commands/code-task.en.md +1 -1
  243. package/templates/.claude/commands/code-task.zh-CN.md +1 -1
  244. package/templates/.claude/commands/commit.en.md +1 -1
  245. package/templates/.claude/commands/commit.zh-CN.md +1 -1
  246. package/templates/.claude/commands/complete-manual-validation.en.md +1 -1
  247. package/templates/.claude/commands/complete-manual-validation.zh-CN.md +1 -1
  248. package/templates/.claude/commands/complete-task.en.md +1 -1
  249. package/templates/.claude/commands/complete-task.zh-CN.md +1 -1
  250. package/templates/.claude/commands/create-pr.en.md +1 -1
  251. package/templates/.claude/commands/create-pr.zh-CN.md +1 -1
  252. package/templates/.claude/commands/plan-task.en.md +1 -1
  253. package/templates/.claude/commands/plan-task.zh-CN.md +1 -1
  254. package/templates/.claude/commands/review-analysis.en.md +1 -1
  255. package/templates/.claude/commands/review-analysis.zh-CN.md +1 -1
  256. package/templates/.claude/commands/review-code.en.md +1 -1
  257. package/templates/.claude/commands/review-code.zh-CN.md +1 -1
  258. package/templates/.claude/commands/review-plan.en.md +1 -1
  259. package/templates/.claude/commands/review-plan.zh-CN.md +1 -1
  260. package/templates/.claude/commands/run-manual-validation.en.md +1 -1
  261. package/templates/.claude/commands/run-manual-validation.zh-CN.md +1 -1
  262. package/templates/.claude/commands/run-task.en.md +1 -1
  263. package/templates/.claude/commands/run-task.zh-CN.md +1 -1
  264. package/templates/.claude/commands/watch-pr.en.md +1 -1
  265. package/templates/.claude/commands/watch-pr.zh-CN.md +1 -1
  266. package/templates/{.trae/skills → .traecli/commands}/update-agent-infra.en.md +0 -1
  267. package/templates/{.trae/skills → .traecli/commands}/update-agent-infra.zh-CN.md +0 -1
  268. package/dist/lib/builtin-tuis.js +0 -40
  269. package/lib/builtin-tuis.ts +0 -56
@@ -116,6 +116,10 @@ const DEFAULTS = {
116
116
  ],
117
117
  "ejected": [],
118
118
  "retiredManaged": [
119
+ {
120
+ "path": ".trae/skills/",
121
+ "templateHashes": []
122
+ },
119
123
  {
120
124
  "path": ".agents/workspace/README.md",
121
125
  "templateHashes": [
@@ -200,18 +204,17 @@ const AGENT_CLIENT_MANIFEST = [
200
204
  "displayName": "TraeCode CLI",
201
205
  "invocation": "/${skillName}",
202
206
  "ownedPathPrefixes": [
203
- ".trae/"
207
+ ".traecli/"
204
208
  ],
205
209
  "managed": [
206
- ".trae/skills/"
210
+ ".traecli/commands/"
207
211
  ],
208
212
  "merged": [],
209
213
  "ejected": [],
210
214
  "customCommand": {
211
- "target": ".trae/skills/${skillName}.md",
215
+ "target": ".traecli/commands/${skillName}.md",
212
216
  "frontmatter": {},
213
- "includeUsage": true,
214
- "inheritDisableModelInvocation": true
217
+ "argumentsToken": "$ARGUMENTS"
215
218
  }
216
219
  }
217
220
  ];
@@ -230,84 +233,19 @@ const CUSTOM_TUI_CONTRACT = {
230
233
  const KNOWN_PLATFORMS = new Set(['github', 'none']);
231
234
  const KNOWN_LANGUAGES = new Set(['en', 'zh-CN']);
232
235
 
233
- const BUILTIN_TUI_IDS = AGENT_CLIENT_MANIFEST.map((entry) => entry.id);
236
+ const AGENT_CLIENT_IDS = AGENT_CLIENT_MANIFEST.map((entry) => entry.id);
234
237
 
235
238
  function normalizeAgentClientConfig(cfg) {
236
239
  const own = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
237
- const diagnostics = [];
238
240
  const failure = (code, path) => ({
239
- source: null,
240
241
  state: null,
241
242
  canonical: null,
242
- remainingSandboxTools: undefined,
243
- removeLegacyTuis: false,
244
- changed: false,
245
- diagnostics,
246
243
  error: `${code} at ${path}`,
247
244
  errorCode: code,
248
245
  errorPath: path
249
246
  });
250
- const projectTuis = (value) => {
251
- if (!Array.isArray(value)) {
252
- return Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, true]));
253
- }
254
- const enabled = new Set();
255
- for (const [index, candidate] of value.entries()) {
256
- if (BUILTIN_TUI_IDS.includes(candidate)) enabled.add(candidate);
257
- else diagnostics.push({ code: 'LEGACY_VALUE_IGNORED', path: `tuis[${index}]` });
258
- }
259
- return Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, enabled.has(id)]));
260
- };
261
- const projectSandbox = (value) => {
262
- if (!Array.isArray(value) || value.length === 0) {
263
- return {
264
- installed: Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, true])),
265
- clientSignals: new Set(),
266
- remainingTools: Array.isArray(value) ? [] : undefined
267
- };
268
- }
269
- const installed = new Set();
270
- const remainingTools = [];
271
- for (const [index, candidate] of value.entries()) {
272
- if (BUILTIN_TUI_IDS.includes(candidate)) installed.add(candidate);
273
- else if (typeof candidate === 'string') remainingTools.push(candidate);
274
- else diagnostics.push({ code: 'LEGACY_VALUE_IGNORED', path: `sandbox.tools[${index}]` });
275
- }
276
- return {
277
- installed: Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, installed.has(id)])),
278
- clientSignals: installed,
279
- remainingTools
280
- };
281
- };
282
- const serialize = (state) => BUILTIN_TUI_IDS.map((id) => ({ id, ...state[id] }));
283
- const hasCanonical = own(cfg, 'agentClients');
284
- const hasLegacyTuis = own(cfg, 'tuis');
285
- const sandbox = cfg.sandbox && typeof cfg.sandbox === 'object' && !Array.isArray(cfg.sandbox)
286
- ? cfg.sandbox
287
- : undefined;
288
- const hasSandboxTools = sandbox !== undefined && own(sandbox, 'tools');
289
- const tuiProjection = projectTuis(cfg.tuis);
290
- const sandboxProjection = projectSandbox(sandbox?.tools);
291
-
292
- if (!hasCanonical) {
293
- const state = Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, {
294
- enabled: tuiProjection[id],
295
- installInSandbox: sandboxProjection.installed[id]
296
- }]));
297
- return {
298
- source: 'legacy',
299
- state,
300
- canonical: serialize(state),
301
- remainingSandboxTools: sandboxProjection.remainingTools,
302
- removeLegacyTuis: hasLegacyTuis,
303
- changed: true,
304
- diagnostics,
305
- error: null,
306
- errorCode: null,
307
- errorPath: null
308
- };
309
- }
310
-
247
+ const serialize = (state) => AGENT_CLIENT_IDS.map((id) => ({ id, ...state[id] }));
248
+ if (!own(cfg, 'agentClients')) return failure('MISSING_AGENT_CLIENT', 'agentClients');
311
249
  if (!Array.isArray(cfg.agentClients)) return failure('INVALID_AGENT_CLIENTS', 'agentClients');
312
250
  const entries = new Map();
313
251
  for (const [index, candidate] of cfg.agentClients.entries()) {
@@ -325,7 +263,7 @@ function normalizeAgentClientConfig(cfg) {
325
263
  ) {
326
264
  return failure('INVALID_AGENT_CLIENTS', entryPath);
327
265
  }
328
- if (!BUILTIN_TUI_IDS.includes(candidate.id)) {
266
+ if (!AGENT_CLIENT_IDS.includes(candidate.id)) {
329
267
  return failure('UNKNOWN_AGENT_CLIENT', `${entryPath}.id`);
330
268
  }
331
269
  if (entries.has(candidate.id)) return failure('DUPLICATE_AGENT_CLIENT', `${entryPath}.id`);
@@ -335,24 +273,44 @@ function normalizeAgentClientConfig(cfg) {
335
273
  let orchestration;
336
274
  if (own(candidate, 'orchestration')) {
337
275
  const policy = candidate.orchestration;
338
- const exact = (value) => typeof value === 'string' && value.length > 0 && value.trim() === value;
339
- const validRole = (role) => role
340
- && typeof role === 'object'
341
- && !Array.isArray(role)
342
- && Object.keys(role).length === 2
343
- && exact(role.model)
344
- && exact(role.reasoningEffort);
345
276
  if (
346
277
  !policy
347
278
  || typeof policy !== 'object'
348
279
  || Array.isArray(policy)
349
280
  || Object.keys(policy).length !== 2
350
- || !validRole(policy.executor)
351
- || !validRole(policy.reviewer)
281
+ || !own(policy, 'executor')
282
+ || !own(policy, 'reviewer')
352
283
  ) {
353
284
  return failure('INVALID_AGENT_CLIENTS', `${entryPath}.orchestration`);
354
285
  }
355
- 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 };
356
314
  }
357
315
  entries.set(candidate.id, {
358
316
  enabled: candidate.enabled,
@@ -360,25 +318,29 @@ function normalizeAgentClientConfig(cfg) {
360
318
  ...(orchestration ? { orchestration } : {})
361
319
  });
362
320
  }
363
- if (BUILTIN_TUI_IDS.some((id) => !entries.has(id))) {
321
+ if (AGENT_CLIENT_IDS.some((id) => !entries.has(id))) {
364
322
  return failure('MISSING_AGENT_CLIENT', 'agentClients');
365
323
  }
366
- const state = Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, entries.get(id)]));
367
- if (hasLegacyTuis && BUILTIN_TUI_IDS.some((id) => state[id].enabled !== tuiProjection[id])) {
368
- 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
+ }
369
328
  }
370
- if ([...sandboxProjection.clientSignals].some((id) => !state[id].installInSandbox)) {
371
- 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
+ }
372
339
  }
373
- 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)]));
374
341
  return {
375
- source: 'canonical',
376
342
  state,
377
343
  canonical: serialize(state),
378
- remainingSandboxTools: hasSandboxTools ? sandboxProjection.remainingTools : undefined,
379
- removeLegacyTuis: hasLegacyTuis,
380
- changed: hasLegacyTuis || sandboxProjection.clientSignals.size > 0 || !sameOrder,
381
- diagnostics,
382
344
  error: null,
383
345
  errorCode: null,
384
346
  errorPath: null
@@ -387,16 +349,6 @@ function normalizeAgentClientConfig(cfg) {
387
349
 
388
350
  function materializeAgentClientConfig(cfg, normalized) {
389
351
  cfg.agentClients = normalized.canonical;
390
- delete cfg.tuis;
391
- if (normalized.remainingSandboxTools !== undefined) {
392
- cfg.sandbox = {
393
- ...(cfg.sandbox || {}),
394
- tools: [
395
- 'agent-infra',
396
- ...normalized.remainingSandboxTools.filter((tool) => tool !== 'agent-infra')
397
- ]
398
- };
399
- }
400
352
  }
401
353
 
402
354
  function assetMatches(entry, target) {
@@ -483,6 +435,17 @@ function isInsideProject(projectRoot, relativePath) {
483
435
  return rel !== '' && !rel.startsWith('..') && !path.isAbsolute(rel);
484
436
  }
485
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
+
486
449
  function isPathOwnedByOtherPlatform(relativePath, platformType) {
487
450
  const normalized = norm(relativePath).replace(/^\.\//, '');
488
451
  const top = normalized.split('/')[0];
@@ -1310,7 +1273,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
1310
1273
  return { error: enabledResolution.error };
1311
1274
  }
1312
1275
  const enabledTUIs = new Set(
1313
- BUILTIN_TUI_IDS.filter((id) => enabledResolution.state[id].enabled)
1276
+ AGENT_CLIENT_IDS.filter((id) => enabledResolution.state[id].enabled)
1314
1277
  );
1315
1278
  materializeAgentClientConfig(cfg, enabledResolution);
1316
1279
  const customTUIsConfig = Array.isArray(cfg.customTUIs) ? cfg.customTUIs : [];
@@ -1330,6 +1293,10 @@ function syncTemplates(projectRoot, templateRootOverride) {
1330
1293
  (descriptor.templateHashes || []).map(trustedBaseline).filter(Boolean)
1331
1294
  )];
1332
1295
  }));
1296
+ const retiredManagedForTarget = (target) => [...retiredManaged.entries()].find(
1297
+ ([entry]) => assetMatches(entry, target)
1298
+ && (!entry.endsWith('/') || isInsideProjectDirectory(projectRoot, entry, target))
1299
+ );
1333
1300
  const planningRegistry = {
1334
1301
  ...currentRegistry,
1335
1302
  managed: currentRegistry.managed.filter((entry) => !retiredManaged.has(norm(entry)))
@@ -1358,7 +1325,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
1358
1325
  for (const target of Object.keys(managedBaselines)) {
1359
1326
  if (
1360
1327
  !guardedManaged.has(norm(target))
1361
- && !retiredManaged.has(norm(target))
1328
+ && !retiredManagedForTarget(target)
1362
1329
  && !allClientManaged.some((entry) => assetMatches(entry, target))
1363
1330
  ) {
1364
1331
  delete managedBaselines[target];
@@ -1434,8 +1401,72 @@ function syncTemplates(projectRoot, templateRootOverride) {
1434
1401
  );
1435
1402
 
1436
1403
  for (const [entry, historicalTemplateHashes] of retiredManaged) {
1437
- const target = path.join(projectRoot, entry);
1404
+ const target = path.join(projectRoot, entry.endsWith('/') ? entry.slice(0, -1) : entry);
1438
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
+ }
1439
1470
  if (!fs.existsSync(target)) continue;
1440
1471
  const stat = fs.lstatSync(target);
1441
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`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "为任务设计技术方案和实施计划"
3
- usage: "/plan-task [task-ref | --task <ref>]"
3
+ usage: "/plan-task [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  读取并执行 `.agents/skills/plan-task/SKILL.md` 中的 plan-task 技能。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Review a requirement analysis report"
3
- usage: "/review-analysis [task-ref | --task <ref>]"
3
+ usage: "/review-analysis [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  Read and execute the review-analysis skill from `.agents/skills/review-analysis/SKILL.md`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "审查需求分析报告"
3
- usage: "/review-analysis [task-ref | --task <ref>]"
3
+ usage: "/review-analysis [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  读取并执行 `.agents/skills/review-analysis/SKILL.md` 中的 review-analysis 技能。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Review code implementation and output a code review report"
3
- usage: "/review-code [task-ref | --task <ref>]"
3
+ usage: "/review-code [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  Read and execute the review-code skill from `.agents/skills/review-code/SKILL.md`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "审查代码实现并输出代码审查报告"
3
- usage: "/review-code [task-ref | --task <ref>]"
3
+ usage: "/review-code [--task <ref> | -t <ref>]"
4
4
  ---
5
5
 
6
6
  读取并执行 `.agents/skills/review-code/SKILL.md` 中的 review-code 技能。