@fitlab-ai/agent-infra 0.6.5 → 0.7.1

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 (208) hide show
  1. package/README.md +51 -25
  2. package/README.zh-CN.md +49 -23
  3. package/bin/cli.ts +1 -1
  4. package/dist/bin/cli.js +1 -1
  5. package/dist/lib/builtin-tuis.js +45 -0
  6. package/dist/lib/defaults.json +4 -0
  7. package/dist/lib/init.js +65 -23
  8. package/dist/lib/prompt.js +49 -1
  9. package/dist/lib/sandbox/commands/create.js +4 -2
  10. package/dist/lib/sandbox/commands/enter.js +15 -4
  11. package/dist/lib/sandbox/commands/list-running.js +153 -0
  12. package/dist/lib/sandbox/commands/ls.js +24 -45
  13. package/dist/lib/sandbox/commands/rebuild.js +7 -13
  14. package/dist/lib/sandbox/commands/rm.js +2 -0
  15. package/dist/lib/sandbox/config.js +3 -0
  16. package/dist/lib/sandbox/image-prune.js +18 -0
  17. package/dist/lib/sandbox/index.js +2 -1
  18. package/dist/lib/sandbox/runtimes/ai-tools.dockerfile +10 -6
  19. package/dist/lib/sandbox/task-resolver.js +18 -0
  20. package/dist/lib/sandbox/tools.js +213 -8
  21. package/dist/lib/update.js +70 -18
  22. package/lib/builtin-tuis.ts +55 -0
  23. package/lib/defaults.json +4 -0
  24. package/lib/init.ts +97 -35
  25. package/lib/prompt.ts +54 -1
  26. package/lib/sandbox/commands/create.ts +10 -2
  27. package/lib/sandbox/commands/enter.ts +14 -4
  28. package/lib/sandbox/commands/list-running.ts +188 -0
  29. package/lib/sandbox/commands/ls.ts +28 -49
  30. package/lib/sandbox/commands/rebuild.ts +12 -14
  31. package/lib/sandbox/commands/rm.ts +3 -0
  32. package/lib/sandbox/config.ts +7 -0
  33. package/lib/sandbox/image-prune.ts +23 -0
  34. package/lib/sandbox/index.ts +2 -1
  35. package/lib/sandbox/runtimes/ai-tools.dockerfile +10 -6
  36. package/lib/sandbox/task-resolver.ts +23 -1
  37. package/lib/sandbox/tools.ts +248 -9
  38. package/lib/update.ts +85 -30
  39. package/package.json +1 -1
  40. package/templates/.agents/QUICKSTART.en.md +1 -1
  41. package/templates/.agents/QUICKSTART.zh-CN.md +1 -1
  42. package/templates/.agents/README.en.md +111 -2
  43. package/templates/.agents/README.zh-CN.md +111 -2
  44. package/templates/.agents/rules/create-issue.en.md +1 -1
  45. package/templates/.agents/rules/create-issue.github.en.md +1 -1
  46. package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
  47. package/templates/.agents/rules/create-issue.zh-CN.md +1 -1
  48. package/templates/.agents/rules/issue-sync.github.en.md +6 -5
  49. package/templates/.agents/rules/issue-sync.github.zh-CN.md +6 -5
  50. package/templates/.agents/rules/milestone-inference.github.en.md +2 -2
  51. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +2 -2
  52. package/templates/.agents/rules/no-mid-flow-questions.en.md +57 -0
  53. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +57 -0
  54. package/templates/.agents/rules/pr-sync.github.en.md +4 -5
  55. package/templates/.agents/rules/pr-sync.github.zh-CN.md +4 -5
  56. package/templates/.agents/rules/task-management.en.md +9 -6
  57. package/templates/.agents/rules/task-management.zh-CN.md +9 -6
  58. package/templates/.agents/rules/task-short-id.en.md +141 -0
  59. package/templates/.agents/rules/task-short-id.zh-CN.md +124 -0
  60. package/templates/.agents/rules/testing-discipline.en.md +2 -2
  61. package/templates/.agents/rules/testing-discipline.zh-CN.md +2 -2
  62. package/templates/.agents/scripts/task-short-id.js +713 -0
  63. package/templates/.agents/scripts/validate-artifact.js +1 -1
  64. package/templates/.agents/skills/analyze-task/SKILL.en.md +20 -4
  65. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +20 -5
  66. package/templates/.agents/skills/block-task/SKILL.en.md +12 -0
  67. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +12 -1
  68. package/templates/.agents/skills/cancel-task/SKILL.en.md +12 -0
  69. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +12 -1
  70. package/templates/.agents/skills/check-task/SKILL.en.md +47 -32
  71. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +46 -32
  72. package/templates/.agents/skills/close-codescan/SKILL.en.md +11 -0
  73. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +11 -0
  74. package/templates/.agents/skills/close-dependabot/SKILL.en.md +11 -0
  75. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +11 -0
  76. package/templates/.agents/skills/code-task/SKILL.en.md +121 -0
  77. package/templates/.agents/skills/{implement-task → code-task}/SKILL.zh-CN.md +55 -25
  78. package/templates/.agents/skills/{implement-task → code-task}/config/verify.en.json +4 -4
  79. package/templates/.agents/skills/{implement-task → code-task}/config/verify.zh-CN.json +4 -4
  80. package/templates/.agents/skills/{implement-task → code-task}/reference/branch-management.zh-CN.md +2 -2
  81. package/templates/.agents/skills/{implement-task/reference/implementation-rules.en.md → code-task/reference/code-rules.en.md} +6 -6
  82. package/templates/.agents/skills/{implement-task/reference/implementation-rules.zh-CN.md → code-task/reference/code-rules.zh-CN.md} +3 -3
  83. package/templates/.agents/skills/code-task/reference/dual-mode.en.md +69 -0
  84. package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +69 -0
  85. package/templates/.agents/skills/{refine-task/reference/fix-workflow.en.md → code-task/reference/fix-mode.en.md} +12 -12
  86. package/templates/.agents/skills/{refine-task/reference/fix-workflow.zh-CN.md → code-task/reference/fix-mode.zh-CN.md} +8 -8
  87. package/templates/.agents/skills/code-task/reference/output-template.en.md +20 -0
  88. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +20 -0
  89. package/templates/.agents/skills/{implement-task → code-task}/reference/report-template.en.md +4 -4
  90. package/templates/.agents/skills/{implement-task → code-task}/reference/report-template.zh-CN.md +3 -3
  91. package/templates/.agents/skills/code-task/scripts/detect-mode.js +370 -0
  92. package/templates/.agents/skills/commit/SKILL.en.md +6 -2
  93. package/templates/.agents/skills/commit/SKILL.zh-CN.md +6 -2
  94. package/templates/.agents/skills/commit/reference/task-status-update.en.md +10 -6
  95. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +10 -6
  96. package/templates/.agents/skills/complete-task/SKILL.en.md +17 -3
  97. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +17 -4
  98. package/templates/.agents/skills/create-pr/SKILL.en.md +21 -1
  99. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +21 -1
  100. package/templates/.agents/skills/create-task/SKILL.en.md +14 -0
  101. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +14 -1
  102. package/templates/.agents/skills/import-codescan/SKILL.en.md +15 -1
  103. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +15 -1
  104. package/templates/.agents/skills/import-dependabot/SKILL.en.md +16 -2
  105. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +16 -2
  106. package/templates/.agents/skills/import-issue/SKILL.en.md +17 -3
  107. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +17 -3
  108. package/templates/.agents/skills/plan-task/SKILL.en.md +8 -4
  109. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +8 -5
  110. package/templates/.agents/skills/restore-task/SKILL.en.md +16 -3
  111. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +16 -4
  112. package/templates/.agents/skills/review-analysis/SKILL.en.md +80 -0
  113. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +105 -0
  114. package/templates/.agents/skills/review-analysis/config/verify.en.json +51 -0
  115. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +51 -0
  116. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +87 -0
  117. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +87 -0
  118. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +90 -0
  119. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +91 -0
  120. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +47 -0
  121. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +47 -0
  122. package/templates/.agents/skills/{review-task → review-code}/SKILL.en.md +15 -9
  123. package/templates/.agents/skills/{review-task → review-code}/SKILL.zh-CN.md +19 -10
  124. package/templates/.agents/skills/{review-task → review-code}/config/verify.en.json +7 -5
  125. package/templates/.agents/skills/{review-task → review-code}/config/verify.zh-CN.json +6 -4
  126. package/templates/.agents/skills/{review-task → review-code}/reference/output-templates.en.md +21 -17
  127. package/templates/.agents/skills/{review-task → review-code}/reference/output-templates.zh-CN.md +19 -15
  128. package/templates/.agents/skills/{review-task → review-code}/reference/report-template.en.md +5 -6
  129. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +91 -0
  130. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +48 -0
  131. package/templates/.agents/skills/{review-task → review-code}/reference/review-criteria.zh-CN.md +10 -4
  132. package/templates/.agents/skills/review-plan/SKILL.en.md +80 -0
  133. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +105 -0
  134. package/templates/.agents/skills/{refine-task → review-plan}/config/verify.en.json +14 -10
  135. package/templates/.agents/skills/{refine-task → review-plan}/config/verify.zh-CN.json +14 -10
  136. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +87 -0
  137. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +87 -0
  138. package/templates/.agents/skills/review-plan/reference/report-template.en.md +90 -0
  139. package/templates/.agents/skills/{review-task → review-plan}/reference/report-template.zh-CN.md +3 -3
  140. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +47 -0
  141. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +47 -0
  142. package/templates/.agents/skills/test/SKILL.en.md +2 -2
  143. package/templates/.agents/skills/test/SKILL.zh-CN.md +13 -31
  144. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +1 -0
  145. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +1 -0
  146. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +113 -21
  147. package/templates/.agents/templates/task.en.md +4 -3
  148. package/templates/.agents/templates/task.zh-CN.md +3 -2
  149. package/templates/.agents/workflows/bug-fix.en.yaml +126 -80
  150. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +90 -44
  151. package/templates/.agents/workflows/feature-development.en.yaml +115 -70
  152. package/templates/.agents/workflows/feature-development.zh-CN.yaml +92 -47
  153. package/templates/.agents/workflows/refactoring.en.yaml +123 -78
  154. package/templates/.agents/workflows/refactoring.zh-CN.yaml +89 -44
  155. package/templates/.claude/commands/code-task.en.md +8 -0
  156. package/templates/.claude/commands/code-task.zh-CN.md +8 -0
  157. package/templates/.claude/commands/review-analysis.en.md +8 -0
  158. package/templates/.claude/commands/review-analysis.zh-CN.md +8 -0
  159. package/templates/.claude/commands/review-code.en.md +8 -0
  160. package/templates/.claude/commands/review-code.zh-CN.md +8 -0
  161. package/templates/.claude/commands/review-plan.en.md +8 -0
  162. package/templates/.claude/commands/review-plan.zh-CN.md +8 -0
  163. package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +1 -1
  164. package/templates/.gemini/commands/_project_/code-task.en.toml +8 -0
  165. package/templates/.gemini/commands/_project_/code-task.zh-CN.toml +8 -0
  166. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +1 -1
  167. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +1 -1
  168. package/templates/.gemini/commands/_project_/review-analysis.en.toml +8 -0
  169. package/templates/.gemini/commands/_project_/review-analysis.zh-CN.toml +8 -0
  170. package/templates/.gemini/commands/_project_/review-code.en.toml +8 -0
  171. package/templates/.gemini/commands/_project_/review-code.zh-CN.toml +8 -0
  172. package/templates/.gemini/commands/_project_/review-plan.en.toml +8 -0
  173. package/templates/.gemini/commands/_project_/review-plan.zh-CN.toml +8 -0
  174. package/templates/.opencode/commands/code-task.en.md +11 -0
  175. package/templates/.opencode/commands/code-task.zh-CN.md +11 -0
  176. package/templates/.opencode/commands/review-analysis.en.md +11 -0
  177. package/templates/.opencode/commands/review-analysis.zh-CN.md +11 -0
  178. package/templates/.opencode/commands/review-code.en.md +11 -0
  179. package/templates/.opencode/commands/review-code.zh-CN.md +11 -0
  180. package/templates/.opencode/commands/review-plan.en.md +11 -0
  181. package/templates/.opencode/commands/review-plan.zh-CN.md +11 -0
  182. package/templates/.agents/skills/implement-task/SKILL.en.md +0 -173
  183. package/templates/.agents/skills/implement-task/reference/output-template.en.md +0 -20
  184. package/templates/.agents/skills/implement-task/reference/output-template.zh-CN.md +0 -20
  185. package/templates/.agents/skills/refine-task/SKILL.en.md +0 -153
  186. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +0 -153
  187. package/templates/.agents/skills/refine-task/reference/report-template.en.md +0 -64
  188. package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +0 -64
  189. package/templates/.agents/skills/review-task/reference/review-criteria.en.md +0 -42
  190. package/templates/.claude/commands/implement-task.en.md +0 -8
  191. package/templates/.claude/commands/implement-task.zh-CN.md +0 -8
  192. package/templates/.claude/commands/refine-task.en.md +0 -8
  193. package/templates/.claude/commands/refine-task.zh-CN.md +0 -8
  194. package/templates/.claude/commands/review-task.en.md +0 -8
  195. package/templates/.claude/commands/review-task.zh-CN.md +0 -8
  196. package/templates/.gemini/commands/_project_/implement-task.en.toml +0 -8
  197. package/templates/.gemini/commands/_project_/implement-task.zh-CN.toml +0 -8
  198. package/templates/.gemini/commands/_project_/refine-task.en.toml +0 -8
  199. package/templates/.gemini/commands/_project_/refine-task.zh-CN.toml +0 -8
  200. package/templates/.gemini/commands/_project_/review-task.en.toml +0 -8
  201. package/templates/.gemini/commands/_project_/review-task.zh-CN.toml +0 -8
  202. package/templates/.opencode/commands/implement-task.en.md +0 -11
  203. package/templates/.opencode/commands/implement-task.zh-CN.md +0 -11
  204. package/templates/.opencode/commands/refine-task.en.md +0 -11
  205. package/templates/.opencode/commands/refine-task.zh-CN.md +0 -11
  206. package/templates/.opencode/commands/review-task.en.md +0 -11
  207. package/templates/.opencode/commands/review-task.zh-CN.md +0 -11
  208. /package/templates/.agents/skills/{implement-task → code-task}/reference/branch-management.en.md +0 -0
@@ -26,6 +26,10 @@ tail .agents/workspace/active/{task-id}/task.md
26
26
 
27
27
  Before the state check is complete, do not make external-state assertions such as "the code is unchanged", "tests passed", or "there are no other references", including in reasoning. This gate is only a structural floor; evidence pairing and authenticity still require the report template and review discipline.
28
28
 
29
+ ## Task id short ref
30
+
31
+ > If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
32
+
29
33
  ## Steps
30
34
 
31
35
  ### 1. Verify Task Exists
@@ -40,9 +44,11 @@ If not found in `active/`, check `blocked/` and `completed/`:
40
44
 
41
45
  ### 2. Verify Completion Prerequisites (Failure Must Stop)
42
46
 
47
+ **Gate read (project-level PR flow policy)**: Before running this step, read `.agents/.airc.json`'s `requiresPullRequest` field. Treat missing or `true` as "PR flow enabled" (default); treat explicit `false` as "PR flow disabled". The completion check below is pruned accordingly.
48
+
43
49
  Before marking complete, verify ALL of these:
44
- - [ ] All workflow steps are complete (check workflow progress in task.md)
45
- - [ ] Code has been reviewed (`review.md` or `review-r{N}.md` exists, and the latest review verdict is Approved; or review was done externally)
50
+ - [ ] All workflow steps are complete (check workflow progress in task.md; **for the `pr_tasks` list under each yaml `commit` step, count those items toward the missing-work decision only when `.agents/.airc.json:requiresPullRequest !== false`**)
51
+ - [ ] Code has been reviewed (`review-code.md` or `review-code-r{N}.md` exists, and the latest review verdict is Approved; or review was done externally)
46
52
  - [ ] Code has been committed (no uncommitted changes related to this task)
47
53
  - [ ] Tests are passing
48
54
 
@@ -109,7 +115,7 @@ Check whether `task.md` includes a valid `issue_number`. If not, skip this step
109
115
  > Issue sync rules live in `.agents/rules/issue-sync.md`. Read that file before syncing, and complete upstream repository detection plus permission detection.
110
116
 
111
117
  If a valid `issue_number` exists:
112
- - First scan and backfill unpublished `task.md`, `analysis*.md`, `plan*.md`, `implementation*.md`, `review*.md`, and `refinement*.md` comments using the backfill rules in `.agents/rules/issue-sync.md` (`task.md` uses the idempotent update path)
118
+ - First scan and backfill unpublished `task.md`, `analysis*.md`, `review-analysis*.md`, `plan*.md`, `review-plan*.md`, `code*.md`, and `review-code*.md` comments using the backfill rules in `.agents/rules/issue-sync.md` (`task.md` uses the idempotent update path)
113
119
  - Backfill checked `## Requirements` items to the Issue body by following the requirements-checkbox sync steps in issue-sync.md
114
120
  - Do not set any `status:` label — status labels are automatically cleared when the Issue is closed
115
121
  - Finally create or update the summary comment marked with the summary marker defined in `.agents/rules/issue-sync.md`
@@ -117,6 +123,12 @@ If a valid `issue_number` exists:
117
123
 
118
124
  ### 7. Verification Gate
119
125
 
126
+ **Release short id** (after the directory has already been moved; the script is idempotent and returns 0 even if the task isn't registered):
127
+
128
+ ```bash
129
+ node .agents/scripts/task-short-id.js release "$task_id" || true
130
+ ```
131
+
120
132
  Run the verification gate to confirm the task artifact and sync state are valid:
121
133
 
122
134
  ```bash
@@ -147,6 +159,8 @@ Deliverables:
147
159
  - {List of key outputs: files modified, tests added, etc.}
148
160
  ```
149
161
 
162
+
163
+
150
164
  ## Completion Checklist
151
165
 
152
166
  - [ ] Verified all workflow steps are complete
@@ -26,8 +26,11 @@ tail .agents/workspace/active/{task-id}/task.md
26
26
 
27
27
  状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
28
28
 
29
- ## 执行步骤
29
+ ## 任务入参短号别名
30
+
31
+ > 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
30
32
 
33
+ ## 执行步骤
31
34
  ### 1. 验证任务存在
32
35
 
33
36
  检查任务是否存在于 `.agents/workspace/active/{task-id}/`。
@@ -40,9 +43,11 @@ tail .agents/workspace/active/{task-id}/task.md
40
43
 
41
44
  ### 2. 验证完成前置条件(未满足则必须停止)
42
45
 
46
+ **门控读取(项目级 PR 流程策略)**:在执行本步骤前,读取 `.agents/.airc.json` 的 `requiresPullRequest` 字段;当字段缺失或为 `true` 时视为「启用 PR 流程」(默认),仅当显式为 `false` 时视为「关闭 PR 流程」。下面的工作流步骤完成判定按此规则裁剪。
47
+
43
48
  标记完成之前,验证以下所有条件:
44
- - [ ] 所有工作流步骤已完成(检查 task.md 中的工作流进度)
45
- - [ ] 代码已审查(`review.md` 或 `review-r{N}.md` 存在,且最新审查结论为 Approved;或已在外部完成审查)
49
+ - [ ] 所有工作流步骤已完成(检查 task.md 中的工作流进度;**对 yaml 中 commit 步骤的 `pr_tasks` 列表,仅在 `.agents/.airc.json:requiresPullRequest !== false` 时计入未完成判定**)
50
+ - [ ] 代码已审查(`review-code.md` 或 `review-code-r{N}.md` 存在,且最新审查结论为 Approved;或已在外部完成审查)
46
51
  - [ ] 代码已提交(没有与此任务相关的未提交变更)
47
52
  - [ ] 测试通过
48
53
 
@@ -109,7 +114,7 @@ ls .agents/workspace/completed/{task-id}/task.md
109
114
  > Issue 同步规则见 `.agents/rules/issue-sync.md`。执行同步前先读取该文件,完成 upstream 仓库检测和权限检测。
110
115
 
111
116
  如果存在有效的 `issue_number`:
112
- - 先按 `.agents/rules/issue-sync.md` 的补发规则扫描并补发未发布的 `task.md`、`analysis*.md`、`plan*.md`、`implementation*.md`、`review*.md`、`refinement*.md` 评论(`task.md` 走幂等更新路径)
117
+ - 先按 `.agents/rules/issue-sync.md` 的补发规则扫描并补发未发布的 `task.md`、`analysis*.md`、`review-analysis*.md`、`plan*.md`、`review-plan*.md`、`code*.md`、`review-code*.md` 评论(`task.md` 走幂等更新路径)
113
118
  - 按 issue-sync.md 的需求复选框同步步骤,兜底同步 `## 需求` 中已勾选的条目到 Issue body
114
119
  - 不要设置 `status:` label — Issue 关闭后 status label 会被自动清除
115
120
  - 最后创建或更新 `.agents/rules/issue-sync.md` 中定义的 summary 评论标记对应的 summary 评论
@@ -117,6 +122,12 @@ ls .agents/workspace/completed/{task-id}/task.md
117
122
 
118
123
  ### 7. 完成校验
119
124
 
125
+ **释放短号**(先 `mv` 目录已成功,再 release;脚本幂等,未在注册表也返回 0):
126
+
127
+ ```bash
128
+ node .agents/scripts/task-short-id.js release "$task_id" || true
129
+ ```
130
+
120
131
  运行完成校验,确认任务产物和同步状态符合规范:
121
132
 
122
133
  ```bash
@@ -147,6 +158,8 @@ node .agents/scripts/validate-artifact.js gate complete-task .agents/workspace/c
147
158
  - {关键产出列表:修改的文件、添加的测试等}
148
159
  ```
149
160
 
161
+
162
+
150
163
  ## 完成检查清单
151
164
 
152
165
  - [ ] 验证了所有工作流步骤已完成
@@ -11,8 +11,28 @@ Create a Pull Request and, when task-related, sync the essential metadata and re
11
11
 
12
12
  Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
13
13
 
14
+ ## Task id short ref
15
+
16
+ > If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
17
+
14
18
  ## Execution Flow
15
19
 
20
+ ### Pre-gate: Project-level PR Flow Check
21
+
22
+ **Gate read (project-level PR flow policy)**: Before running any numbered step, read `.agents/.airc.json`'s `requiresPullRequest` field. Treat missing or `true` as "PR flow enabled" (default); treat explicit `false` as "PR flow disabled".
23
+
24
+ Branch on the result:
25
+ - missing / `true` -> continue to Step 1 below
26
+ - explicit `false` -> output the message below and **stop immediately**. Do not run any subsequent numbered step, do not trigger any PR-creation command, do not modify `pr_number` in `task.md`, and do not publish a PR summary comment:
27
+
28
+ ```
29
+ This project does not enable the PR flow (`.agents/.airc.json` sets `requiresPullRequest: false`).
30
+ No Pull Request is required; run instead:
31
+ - Claude Code / OpenCode: /complete-task {task-id}
32
+ - Gemini CLI: /agent-infra:complete-task {task-id}
33
+ - Codex CLI: $complete-task {task-id}
34
+ ```
35
+
16
36
  ### 1. Parse Command Arguments
17
37
 
18
38
  Identify arguments from the command input:
@@ -57,7 +77,7 @@ For PRs where `{task-id}` is available, sync the core metadata immediately:
57
77
 
58
78
  ### 7. Publish the Review Summary
59
79
 
60
- Read the latest context artifacts when they exist: `plan.md` / `plan-r{N}.md`, `implementation.md` / `implementation-r{N}.md`, `review.md` / `review-r{N}.md`, and `refinement.md` / `refinement-r{N}.md`.
80
+ Read the latest context artifacts when they exist: `plan.md` / `plan-r{N}.md`, `review-plan.md` / `review-plan-r{N}.md`, `code.md` / `code-r{N}.md`, and `review-code.md` / `review-code-r{N}.md`.
61
81
 
62
82
  Aggregate a reviewer-facing summary from those artifacts and maintain a single idempotent summary comment via the hidden marker.
63
83
 
@@ -11,8 +11,28 @@ description: "创建 Pull Request 到目标分支"
11
11
 
12
12
  版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
13
13
 
14
+ ## 任务入参短号别名
15
+
16
+ > 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
17
+
14
18
  ## 执行流程
15
19
 
20
+ ### 前置门控:项目级 PR 流程检查
21
+
22
+ **门控读取(项目级 PR 流程策略)**:在执行编号步骤前,读取 `.agents/.airc.json` 的 `requiresPullRequest` 字段;当字段缺失或为 `true` 时视为「启用 PR 流程」(默认),仅当显式为 `false` 时视为「关闭 PR 流程」。
23
+
24
+ 按读取结果分支:
25
+ - 缺失 / `true` → 继续到下方第 1 步
26
+ - 显式 `false` → 输出以下消息后**立即停止**,不要执行任何后续编号步骤、不要触发任何 PR 创建命令、不要修改 `task.md` 的 `pr_number`、不要发布 PR 摘要评论:
27
+
28
+ ```
29
+ 当前项目未启用 PR 流程(`.agents/.airc.json` 中 `requiresPullRequest: false`)。
30
+ 无需创建 Pull Request,请直接运行:
31
+ - Claude Code / OpenCode:/complete-task {task-id}
32
+ - Gemini CLI:/agent-infra:complete-task {task-id}
33
+ - Codex CLI:$complete-task {task-id}
34
+ ```
35
+
16
36
  ### 1. 解析命令参数
17
37
 
18
38
  从命令参数中识别:
@@ -57,7 +77,7 @@ description: "创建 Pull Request 到目标分支"
57
77
 
58
78
  ### 7. 发布审查摘要
59
79
 
60
- 读取最新的上下文产物:`plan.md` / `plan-r{N}.md`、`implementation.md` / `implementation-r{N}.md`、`review.md` / `review-r{N}.md`、`refinement.md` / `refinement-r{N}.md`(存在时)。
80
+ 读取最新的上下文产物:`plan.md` / `plan-r{N}.md`、`review-plan.md` / `review-plan-r{N}.md`、`code.md` / `code-r{N}.md`、`review-code.md` / `review-code-r{N}.md`(存在时)。
61
81
 
62
82
  基于这些产物聚合 reviewer 摘要,并使用隐藏标记维护唯一且幂等的摘要评论。
63
83
 
@@ -22,6 +22,10 @@ After executing this skill, you **must** immediately update task status in task.
22
22
 
23
23
  Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
24
24
 
25
+ ## Task id short ref
26
+
27
+ > If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
28
+
25
29
  ## Steps
26
30
 
27
31
  ### 1. Parse the User Description
@@ -126,6 +130,14 @@ Handle the result:
126
130
 
127
131
  ### 5. Verification Gate
128
132
 
133
+ **Allocate short id first** (writes `short_id` back to task.md and the registry entry; the validation gate will read it):
134
+
135
+ ```bash
136
+ node .agents/scripts/task-short-id.js alloc "$task_id"
137
+ ```
138
+
139
+ If this fails (non-zero exit), follow the message — archive some active tasks or raise `task.shortIdLength` — and do NOT continue.
140
+
129
141
  Run the verification gate to confirm the task artifact and sync state are valid:
130
142
 
131
143
  ```bash
@@ -210,6 +222,8 @@ Next step - run requirements analysis:
210
222
  For later platform sync: after fixing auth / network / template issues, manually run the Issue creation flow in `.agents/rules/create-issue.md` for this task; or manually create/find an Issue and write `issue_number` into task.md so later skills can take over cascade sync.
211
223
  ```
212
224
 
225
+
226
+
213
227
  ## Completion Checklist
214
228
 
215
229
  - [ ] Created the task file `.agents/workspace/active/{task-id}/task.md`
@@ -22,8 +22,11 @@ description: "根据自然语言描述创建任务"
22
22
 
23
23
  版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
24
24
 
25
- ## 执行步骤
25
+ ## 任务入参短号别名
26
+
27
+ > 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
26
28
 
29
+ ## 执行步骤
27
30
  ### 1. 解析用户描述
28
31
 
29
32
  从自然语言描述中提取:
@@ -126,6 +129,14 @@ date "+%Y-%m-%d %H:%M:%S%:z"
126
129
 
127
130
  ### 5. 完成校验
128
131
 
132
+ **先调用短号分配**(保证 `short_id` 写回 task.md + 注册表 entry 已在;完成校验阶段会读取):
133
+
134
+ ```bash
135
+ node .agents/scripts/task-short-id.js alloc "$task_id"
136
+ ```
137
+
138
+ 如失败(退出码非 0),按提示「归档若干任务」或「调高 task.shortIdLength」处理;不要继续执行后续步骤。
139
+
129
140
  运行完成校验,确认任务产物和同步状态符合规范:
130
141
 
131
142
  ```bash
@@ -210,6 +221,8 @@ Issue 创建失败:
210
221
  后续如需平台同步:修复认证/网络/模板问题后,可按 `.agents/rules/create-issue.md` 对当前任务手动执行一次 Issue 创建;或手动创建/查找 Issue,并把 `issue_number` 写入 task.md,后续技能会接管级联同步。
211
222
  ```
212
223
 
224
+
225
+
213
226
  ## 完成检查清单
214
227
 
215
228
  - [ ] 创建了任务文件 `.agents/workspace/active/{task-id}/task.md`
@@ -13,6 +13,10 @@ Import the specified Code Scanning (CodeQL) alert and create a remediation task.
13
13
  - Do NOT auto-commit. Never execute `git commit` or `git add` automatically
14
14
  - After executing this skill, you **must** immediately update task status in task.md
15
15
 
16
+ ## Task id short ref
17
+
18
+ > If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
19
+
16
20
  ## Execution Flow
17
21
 
18
22
  ### 1. Retrieve Alert Information
@@ -58,6 +62,14 @@ Update task.md: `current_step` -> `requirement-analysis`.
58
62
 
59
63
  ### 4. Verification Gate
60
64
 
65
+ **Allocate short id first** (writes `short_id` back to task.md and the registry entry; the validation gate will read it):
66
+
67
+ ```bash
68
+ node .agents/scripts/task-short-id.js alloc "$task_id"
69
+ ```
70
+
71
+ If this fails (non-zero exit), follow the message — archive some active tasks or raise `task.shortIdLength` — and do NOT continue.
72
+
61
73
  Run the verification gate to confirm the task artifact and sync state are valid:
62
74
 
63
75
  ```bash
@@ -94,6 +106,8 @@ Next step:
94
106
  - Codex CLI: $analyze-task {task-id}
95
107
  ```
96
108
 
109
+
110
+
97
111
  ## Completion Checklist
98
112
 
99
113
  - [ ] Retrieved and recorded the key alert information
@@ -106,5 +120,5 @@ Next step:
106
120
  ## Error Handling
107
121
 
108
122
  - Alert not found: output "Code Scanning alert #{number} not found"
109
- - Alert already closed: ask the user whether to continue with analysis
123
+ - Alert already closed: **proceed with task creation/reuse by default** and surface the alert's current state (dismissed/fixed) in the final notice; the user may archive the task manually if desired
110
124
  - Network/permission error: output the corresponding error information
@@ -13,6 +13,10 @@ description: "导入 Code Scanning 告警并创建修复任务"
13
13
  - 不要自动提交。绝不自动执行 `git commit` 或 `git add`
14
14
  - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
15
15
 
16
+ ## 任务入参短号别名
17
+
18
+ > 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
19
+
16
20
  ## 执行流程
17
21
 
18
22
  ### 1. 获取告警信息
@@ -58,6 +62,14 @@ date "+%Y-%m-%d %H:%M:%S%:z"
58
62
 
59
63
  ### 4. 完成校验
60
64
 
65
+ **先调用短号分配**(保证 `short_id` 写回 task.md + 注册表 entry 已在;完成校验阶段会读取):
66
+
67
+ ```bash
68
+ node .agents/scripts/task-short-id.js alloc "$task_id"
69
+ ```
70
+
71
+ 如失败(退出码非 0),按提示「归档若干任务」或「调高 task.shortIdLength」处理;不要继续执行后续步骤。
72
+
61
73
  运行完成校验,确认任务产物和同步状态符合规范:
62
74
 
63
75
  ```bash
@@ -94,6 +106,8 @@ Code Scanning 告警 #{alert-number} 已导入。
94
106
  - Codex CLI:$analyze-task {task-id}
95
107
  ```
96
108
 
109
+
110
+
97
111
  ## 完成检查清单
98
112
 
99
113
  - [ ] 获取并记录了告警关键信息
@@ -106,5 +120,5 @@ Code Scanning 告警 #{alert-number} 已导入。
106
120
  ## 错误处理
107
121
 
108
122
  - 告警未找到:提示 "Code Scanning alert #{number} not found"
109
- - 告警已关闭:询问用户是否继续分析
123
+ - 告警已关闭:**默认仍继续创建/复用任务**,并在告知用户中明确该告警当前状态(dismissed/fixed);用户可视情况手动归档任务
110
124
  - 网络/权限错误:提示相应信息
@@ -13,6 +13,10 @@ Import the specified Dependabot security alert and create a remediation task.
13
13
  - Do NOT auto-commit. Never execute `git commit` or `git add` automatically
14
14
  - After executing this skill, you **must** immediately update task status in task.md
15
15
 
16
+ ## Task id short ref
17
+
18
+ > If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
19
+
16
20
  ## Execution Flow
17
21
 
18
22
  ### 1. Retrieve Alert Information
@@ -29,7 +33,7 @@ Extract key information:
29
33
  ### 2. Create the Task Directory and File
30
34
 
31
35
  Check whether `.agents/workspace/active/` already has a task for this alert.
32
- - If found, ask the user whether to re-import
36
+ - If found, **reuse the existing task by default**; do not ask the user. State clearly in the final notice: "Reused existing task `{task-id}`; not re-imported." If the user wants to re-import, they must first archive or delete the existing task
33
37
  - If not found, create a new task
34
38
 
35
39
  Create directory: `.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
@@ -59,6 +63,14 @@ Update task.md: `current_step` -> `requirement-analysis`.
59
63
 
60
64
  ### 4. Verification Gate
61
65
 
66
+ **Allocate short id first** (writes `short_id` back to task.md and the registry entry; the validation gate will read it):
67
+
68
+ ```bash
69
+ node .agents/scripts/task-short-id.js alloc "$task_id"
70
+ ```
71
+
72
+ If this fails (non-zero exit), follow the message — archive some active tasks or raise `task.shortIdLength` — and do NOT continue.
73
+
62
74
  Run the verification gate to confirm the task artifact and sync state are valid:
63
75
 
64
76
  ```bash
@@ -98,6 +110,8 @@ Next step:
98
110
  - Codex CLI: $analyze-task {task-id}
99
111
  ```
100
112
 
113
+
114
+
101
115
  ## Completion Checklist
102
116
 
103
117
  - [ ] Retrieved and recorded the key alert information
@@ -110,5 +124,5 @@ Next step:
110
124
  ## Error Handling
111
125
 
112
126
  - Alert not found: output "Security alert #{number} not found"
113
- - Alert already closed: ask the user whether to continue with analysis
127
+ - Alert already closed: **proceed with task creation/reuse by default** and surface the alert's current state (dismissed/fixed) in the final notice; the user may archive the task manually if desired
114
128
  - Network/permission error: output the corresponding error information
@@ -13,6 +13,10 @@ description: "导入 Dependabot 安全告警并创建修复任务"
13
13
  - 不要自动提交。绝不自动执行 `git commit` 或 `git add`
14
14
  - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
15
15
 
16
+ ## 任务入参短号别名
17
+
18
+ > 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
19
+
16
20
  ## 执行流程
17
21
 
18
22
  ### 1. 获取告警信息
@@ -29,7 +33,7 @@ description: "导入 Dependabot 安全告警并创建修复任务"
29
33
  ### 2. 创建任务目录和文件
30
34
 
31
35
  检查 `.agents/workspace/active/` 中是否已存在该告警的任务。
32
- - 如果找到,询问用户是否重新导入
36
+ - 如果找到,**默认复用现有任务**,不询问用户;在最终告知中明确「已复用现有任务 `{task-id}`,未重新导入」。如需重新导入,需先归档/删除已有任务
33
37
  - 如果未找到,创建新任务
34
38
 
35
39
  创建目录:`.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
@@ -59,6 +63,14 @@ date "+%Y-%m-%d %H:%M:%S%:z"
59
63
 
60
64
  ### 4. 完成校验
61
65
 
66
+ **先调用短号分配**(保证 `short_id` 写回 task.md + 注册表 entry 已在;完成校验阶段会读取):
67
+
68
+ ```bash
69
+ node .agents/scripts/task-short-id.js alloc "$task_id"
70
+ ```
71
+
72
+ 如失败(退出码非 0),按提示「归档若干任务」或「调高 task.shortIdLength」处理;不要继续执行后续步骤。
73
+
62
74
  运行完成校验,确认任务产物和同步状态符合规范:
63
75
 
64
76
  ```bash
@@ -98,6 +110,8 @@ node .agents/scripts/validate-artifact.js gate import-dependabot .agents/workspa
98
110
  - Codex CLI:$analyze-task {task-id}
99
111
  ```
100
112
 
113
+
114
+
101
115
  ## 完成检查清单
102
116
 
103
117
  - [ ] 获取并记录了告警关键信息
@@ -110,5 +124,5 @@ node .agents/scripts/validate-artifact.js gate import-dependabot .agents/workspa
110
124
  ## 错误处理
111
125
 
112
126
  - 告警未找到:提示 "Security alert #{number} not found"
113
- - 告警已关闭:询问用户是否继续分析
127
+ - 告警已关闭:**默认仍继续创建/复用任务**,并在告知用户中明确该告警当前状态(dismissed/fixed);用户可视情况手动归档任务
114
128
  - 网络/权限错误:提示相应信息
@@ -13,6 +13,10 @@ Import the specified Issue and create a task. Argument: issue number.
13
13
  - Do not write or modify business code; import only
14
14
  - After executing this skill, you **must** immediately update task status
15
15
 
16
+ ## Task id short ref
17
+
18
+ > If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
19
+
16
20
  ## Execution Flow
17
21
 
18
22
  ### 1. Retrieve Issue Information
@@ -25,7 +29,7 @@ Use the Issue title as-is for the task title (preserve the Issue's original lang
25
29
  ### 2. Check for an Existing Task
26
30
 
27
31
  2.1 Search `.agents/workspace/active/` for an existing task linked to this Issue.
28
- - If found, ask the user whether to re-import or continue with the existing task
32
+ - If found, **reuse the existing task by default** (Scenario A); do not ask the user. State clearly in the final notice: "Reused existing task `{task-id}`; not re-imported." If the user wants to re-import, they must first archive or delete the existing task and run this skill again
29
33
  - If not found, continue to 2.2
30
34
 
31
35
  2.2 Use the "historical task comment scan" command in `.agents/rules/issue-pr-commands.md` to scan Issue comments for sync markers and look for a recoverable historical task ID.
@@ -44,7 +48,7 @@ Exit code handling for the whole pipeline:
44
48
 
45
49
  | Scenario | Trigger | task ID source | created_at source | User confirmation |
46
50
  |---|---|---|---|---|
47
- | Scenario A | 2.1 finds a local task | Reuse local ID | Preserve local value | Must ask whether to re-import or continue using the existing task |
51
+ | Scenario A | 2.1 finds a local task | Reuse local ID | Preserve local value | Reuse by default; do not ask; inform the user reuse happened |
48
52
  | Scenario B | 2.1 no match + 2.2 no candidate | Create with `date +%Y%m%d-%H%M%S` | Current time | Not required |
49
53
  | Scenario C | 2.1 no match + 2.2 any candidate | Automatically reuse the earliest candidate ID | Prefer remote frontmatter `created_at`; use current time if missing | Inform only |
50
54
 
@@ -119,6 +123,14 @@ If task.md contains a valid `issue_number`, perform these sync actions (skip and
119
123
 
120
124
  ### 7. Verification Gate
121
125
 
126
+ **Allocate short id first** (writes `short_id` back to task.md and the registry entry; the validation gate will read it):
127
+
128
+ ```bash
129
+ node .agents/scripts/task-short-id.js alloc "$task_id"
130
+ ```
131
+
132
+ If this fails (non-zero exit), follow the message — archive some active tasks or raise `task.shortIdLength` — and do NOT continue.
133
+
122
134
  Run the verification gate to confirm the task artifact and sync state are valid:
123
135
 
124
136
  ```bash
@@ -155,6 +167,8 @@ Next step - run requirements analysis:
155
167
  - Codex CLI: $analyze-task {task-id}
156
168
  ```
157
169
 
170
+
171
+
158
172
  ## Completion Checklist
159
173
 
160
174
  - [ ] Created the task file `.agents/workspace/active/{task-id}/task.md`
@@ -175,7 +189,7 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
175
189
  ## Notes
176
190
 
177
191
  1. **Issue validation**: verify that the Issue exists before continuing
178
- 2. **Duplicate task**: if this Issue already has a linked task, ask the user before creating a new one
192
+ 2. **Duplicate task**: if this Issue already has a linked task, **reuse it by default** instead of creating a new one (do not ask the user)
179
193
  3. **Next step**: after import, run `analyze-task` before `plan-task`
180
194
 
181
195
  ## Error Handling
@@ -13,6 +13,10 @@ description: "从 Issue 导入并创建任务"
13
13
  - 不要编写或修改业务代码。仅做导入
14
14
  - 执行本技能后,你**必须**立即更新任务状态
15
15
 
16
+ ## 任务入参短号别名
17
+
18
+ > 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
19
+
16
20
  ## 执行流程
17
21
 
18
22
  ### 1. 获取 Issue 信息
@@ -25,7 +29,7 @@ description: "从 Issue 导入并创建任务"
25
29
  ### 2. 检查已有任务
26
30
 
27
31
  2.1 搜索 `.agents/workspace/active/` 中是否已有链接到此 Issue 的任务。
28
- - 如果找到,询问用户是重新导入还是继续使用现有任务
32
+ - 如果找到,**默认复用现有任务**(场景 A),不询问用户;在最终告知中明确「已复用现有任务 `{task-id}`,未重新导入」。若用户希望重新导入,需要先手动归档/删除已有任务再次执行本技能
29
33
  - 如果未找到,继续执行 2.2
30
34
 
31
35
  2.2 按 `.agents/rules/issue-pr-commands.md` 的“历史任务评论扫描”命令扫描 Issue 评论中的同步标记,查找可恢复的历史任务 ID。
@@ -44,7 +48,7 @@ description: "从 Issue 导入并创建任务"
44
48
 
45
49
  | 场景 | 触发条件 | task ID 来源 | created_at 来源 | 用户确认 |
46
50
  |---|---|---|---|---|
47
- | 场景 A | 2.1 命中本地任务 | 复用本地 ID | 本地保留 | 必须询问"重新导入还是继续使用现有任务" |
51
+ | 场景 A | 2.1 命中本地任务 | 复用本地 ID | 本地保留 | 默认复用,不询问;告知用户已复用 |
48
52
  | 场景 B | 2.1 无命中 + 2.2 无候选 | `date +%Y%m%d-%H%M%S` 新建 | 当前时间 | 不需要 |
49
53
  | 场景 C | 2.1 无命中 + 2.2 有候选 | 自动复用最早候选 ID | 优先用远端 frontmatter 的 `created_at`,缺失时用当前时间 | 告知即可 |
50
54
 
@@ -119,6 +123,14 @@ date "+%Y-%m-%d %H:%M:%S%:z"
119
123
 
120
124
  ### 7. 完成校验
121
125
 
126
+ **先调用短号分配**(保证 `short_id` 写回 task.md + 注册表 entry 已在;完成校验阶段会读取):
127
+
128
+ ```bash
129
+ node .agents/scripts/task-short-id.js alloc "$task_id"
130
+ ```
131
+
132
+ 如失败(退出码非 0),按提示「归档若干任务」或「调高 task.shortIdLength」处理;不要继续执行后续步骤。
133
+
122
134
  运行完成校验,确认任务产物和同步状态符合规范:
123
135
 
124
136
  ```bash
@@ -155,6 +167,8 @@ Issue #{number} 已导入。
155
167
  - Codex CLI:$analyze-task {task-id}
156
168
  ```
157
169
 
170
+
171
+
158
172
  ## 完成检查清单
159
173
 
160
174
  - [ ] 创建了任务文件 `.agents/workspace/active/{task-id}/task.md`
@@ -175,7 +189,7 @@ Issue #{number} 已导入。
175
189
  ## 注意事项
176
190
 
177
191
  1. **Issue 验证**:在继续之前检查 Issue 是否存在
178
- 2. **重复任务**:如果此 Issue 已有关联任务,在创建新任务前询问用户
192
+ 2. **重复任务**:如果此 Issue 已有关联任务,**默认复用**而非创建新任务(不询问用户)
179
193
  3. **下一步**:导入完成后,先执行 `analyze-task`,再进入 `plan-task`
180
194
 
181
195
  ## 错误处理
@@ -27,6 +27,10 @@ tail .agents/workspace/active/{task-id}/task.md
27
27
 
28
28
  Before the state check is complete, do not make external-state assertions such as "the code is unchanged", "tests passed", or "there are no other references", including in reasoning. This gate is only a structural floor; evidence pairing and authenticity still require the report template and review discipline.
29
29
 
30
+ ## Task id short ref
31
+
32
+ > If `{task-id}` begins with `#`, follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
33
+
30
34
  ## Steps
31
35
 
32
36
  ### 1. Verify Prerequisites
@@ -167,10 +171,10 @@ Output file:
167
171
  Important: human review checkpoint.
168
172
  Please review the technical plan before continuing to implementation.
169
173
 
170
- Next step - implement the task:
171
- - Claude Code / OpenCode: /implement-task {task-id}
172
- - Gemini CLI: /{{project}}:implement-task {task-id}
173
- - Codex CLI: $implement-task {task-id}
174
+ Next step - review the technical plan:
175
+ - Claude Code / OpenCode: /review-plan {task-id}
176
+ - Gemini CLI: /{{project}}:review-plan {task-id}
177
+ - Codex CLI: $review-plan {task-id}
174
178
  ```
175
179
 
176
180
  ## Completion Checklist
@@ -27,8 +27,11 @@ tail .agents/workspace/active/{task-id}/task.md
27
27
 
28
28
  状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
29
29
 
30
- ## 执行步骤
30
+ ## 任务入参短号别名
31
+
32
+ > 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
31
33
 
34
+ ## 执行步骤
32
35
  ### 1. 验证前置条件
33
36
 
34
37
  检查必要文件:
@@ -167,10 +170,10 @@ node .agents/scripts/validate-artifact.js gate plan-task .agents/workspace/activ
167
170
  重要:人工审查检查点。
168
171
  请在继续实现之前审查技术方案。
169
172
 
170
- 下一步 - 实施任务:
171
- - Claude Code / OpenCode:/implement-task {task-id}
172
- - Gemini CLI:/agent-infra:implement-task {task-id}
173
- - Codex CLI:$implement-task {task-id}
173
+ 下一步 - 审查技术方案:
174
+ - Claude Code / OpenCode:/review-plan {task-id}
175
+ - Gemini CLI:/{{project}}:review-plan {task-id}
176
+ - Codex CLI:$review-plan {task-id}
174
177
  ```
175
178
 
176
179
  ## 完成检查清单