@fitlab-ai/agent-infra 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/bin/cli.ts +12 -1
  2. package/dist/bin/cli.js +13 -1
  3. package/dist/lib/builtin-tuis.js +45 -0
  4. package/dist/lib/defaults.json +3 -0
  5. package/dist/lib/init.js +62 -23
  6. package/dist/lib/prompt.js +49 -1
  7. package/dist/lib/sandbox/commands/create.js +10 -2
  8. package/dist/lib/sandbox/commands/enter.js +8 -7
  9. package/dist/lib/sandbox/commands/list-running.js +62 -28
  10. package/dist/lib/sandbox/commands/ls.js +20 -22
  11. package/dist/lib/sandbox/commands/rebuild.js +3 -11
  12. package/dist/lib/sandbox/commands/rm.js +2 -0
  13. package/dist/lib/sandbox/image-prune.js +18 -0
  14. package/dist/lib/sandbox/index.js +7 -3
  15. package/dist/lib/sandbox/task-resolver.js +18 -0
  16. package/dist/lib/sandbox/tools.js +1 -1
  17. package/dist/lib/table.js +29 -0
  18. package/dist/lib/task/commands/ls.js +122 -0
  19. package/dist/lib/task/commands/show.js +135 -0
  20. package/dist/lib/task/frontmatter.js +32 -0
  21. package/dist/lib/task/index.js +41 -0
  22. package/dist/lib/task/short-id.js +80 -0
  23. package/dist/lib/update.js +59 -18
  24. package/lib/builtin-tuis.ts +55 -0
  25. package/lib/defaults.json +3 -0
  26. package/lib/init.ts +87 -35
  27. package/lib/prompt.ts +54 -1
  28. package/lib/sandbox/commands/create.ts +11 -2
  29. package/lib/sandbox/commands/enter.ts +8 -7
  30. package/lib/sandbox/commands/list-running.ts +70 -31
  31. package/lib/sandbox/commands/ls.ts +25 -25
  32. package/lib/sandbox/commands/rebuild.ts +3 -12
  33. package/lib/sandbox/commands/rm.ts +3 -0
  34. package/lib/sandbox/image-prune.ts +23 -0
  35. package/lib/sandbox/index.ts +7 -3
  36. package/lib/sandbox/task-resolver.ts +23 -1
  37. package/lib/sandbox/tools.ts +1 -1
  38. package/lib/table.ts +32 -0
  39. package/lib/task/commands/ls.ts +138 -0
  40. package/lib/task/commands/show.ts +139 -0
  41. package/lib/task/frontmatter.ts +30 -0
  42. package/lib/task/index.ts +44 -0
  43. package/lib/task/short-id.ts +97 -0
  44. package/lib/update.ts +71 -30
  45. package/package.json +1 -1
  46. package/templates/.agents/README.en.md +32 -0
  47. package/templates/.agents/README.zh-CN.md +32 -0
  48. package/templates/.agents/hooks/auto-resume.sh +87 -0
  49. package/templates/.agents/rules/create-issue.github.en.md +1 -1
  50. package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
  51. package/templates/.agents/rules/milestone-inference.github.en.md +4 -1
  52. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +4 -1
  53. package/templates/.agents/rules/next-step-output.en.md +59 -0
  54. package/templates/.agents/rules/next-step-output.zh-CN.md +59 -0
  55. package/templates/.agents/rules/task-short-id.en.md +133 -0
  56. package/templates/.agents/rules/task-short-id.zh-CN.md +105 -0
  57. package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +17 -0
  58. package/templates/.agents/scripts/task-short-id.js +556 -0
  59. package/templates/.agents/skills/analyze-task/SKILL.en.md +13 -11
  60. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +13 -12
  61. package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -1
  62. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -1
  63. package/templates/.agents/skills/block-task/SKILL.en.md +17 -5
  64. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +17 -6
  65. package/templates/.agents/skills/block-task/config/verify.json +1 -1
  66. package/templates/.agents/skills/cancel-task/SKILL.en.md +17 -5
  67. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +17 -6
  68. package/templates/.agents/skills/cancel-task/config/verify.json +1 -1
  69. package/templates/.agents/skills/check-task/SKILL.en.md +15 -9
  70. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +15 -10
  71. package/templates/.agents/skills/close-codescan/SKILL.en.md +16 -5
  72. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +16 -5
  73. package/templates/.agents/skills/close-dependabot/SKILL.en.md +16 -5
  74. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +16 -5
  75. package/templates/.agents/skills/code-task/SKILL.en.md +13 -5
  76. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +14 -6
  77. package/templates/.agents/skills/code-task/config/verify.en.json +2 -1
  78. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +2 -1
  79. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +10 -5
  80. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +10 -5
  81. package/templates/.agents/skills/code-task/reference/output-template.en.md +3 -3
  82. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +3 -3
  83. package/templates/.agents/skills/code-task/reference/report-template.en.md +8 -0
  84. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +8 -0
  85. package/templates/.agents/skills/commit/SKILL.en.md +5 -1
  86. package/templates/.agents/skills/commit/SKILL.zh-CN.md +5 -1
  87. package/templates/.agents/skills/commit/reference/task-status-update.en.md +9 -9
  88. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +9 -9
  89. package/templates/.agents/skills/complete-task/SKILL.en.md +17 -1
  90. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +17 -2
  91. package/templates/.agents/skills/complete-task/config/verify.en.json +1 -1
  92. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +1 -1
  93. package/templates/.agents/skills/create-pr/SKILL.en.md +9 -5
  94. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +9 -5
  95. package/templates/.agents/skills/create-pr/config/verify.json +2 -1
  96. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -1
  97. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -1
  98. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +3 -3
  99. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +3 -3
  100. package/templates/.agents/skills/create-task/SKILL.en.md +29 -15
  101. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +29 -16
  102. package/templates/.agents/skills/create-task/config/verify.json +1 -1
  103. package/templates/.agents/skills/import-codescan/SKILL.en.md +20 -6
  104. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +20 -6
  105. package/templates/.agents/skills/import-codescan/config/verify.json +1 -1
  106. package/templates/.agents/skills/import-dependabot/SKILL.en.md +20 -6
  107. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +20 -6
  108. package/templates/.agents/skills/import-dependabot/config/verify.json +1 -1
  109. package/templates/.agents/skills/import-issue/SKILL.en.md +19 -5
  110. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +19 -5
  111. package/templates/.agents/skills/plan-task/SKILL.en.md +13 -11
  112. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +13 -12
  113. package/templates/.agents/skills/plan-task/config/verify.en.json +1 -1
  114. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +1 -1
  115. package/templates/.agents/skills/restore-task/SKILL.en.md +12 -0
  116. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +12 -1
  117. package/templates/.agents/skills/review-analysis/SKILL.en.md +7 -1
  118. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +7 -2
  119. package/templates/.agents/skills/review-analysis/config/verify.en.json +3 -2
  120. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +3 -2
  121. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +15 -15
  122. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +15 -15
  123. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +7 -1
  124. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +7 -1
  125. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +2 -0
  126. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +2 -0
  127. package/templates/.agents/skills/review-code/SKILL.en.md +8 -1
  128. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +8 -2
  129. package/templates/.agents/skills/review-code/config/verify.en.json +3 -2
  130. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +3 -2
  131. package/templates/.agents/skills/review-code/reference/output-templates.en.md +9 -9
  132. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +9 -9
  133. package/templates/.agents/skills/review-code/reference/report-template.en.md +7 -1
  134. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +7 -1
  135. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +2 -0
  136. package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +2 -0
  137. package/templates/.agents/skills/review-plan/SKILL.en.md +7 -1
  138. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +7 -2
  139. package/templates/.agents/skills/review-plan/config/verify.en.json +3 -2
  140. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +3 -2
  141. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +15 -15
  142. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +15 -15
  143. package/templates/.agents/skills/review-plan/reference/report-template.en.md +7 -1
  144. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +7 -1
  145. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +2 -0
  146. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +2 -0
  147. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +1 -0
  148. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +1 -0
  149. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +112 -21
  150. package/templates/.agents/workflows/bug-fix.en.yaml +1 -1
  151. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +1 -1
  152. package/templates/.agents/workflows/feature-development.en.yaml +1 -1
  153. package/templates/.agents/workflows/feature-development.zh-CN.yaml +1 -1
  154. package/templates/.agents/workflows/refactoring.en.yaml +1 -1
  155. package/templates/.agents/workflows/refactoring.zh-CN.yaml +1 -1
  156. package/templates/.claude/settings.json +11 -0
@@ -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}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), 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
@@ -62,6 +66,8 @@ Use it to understand:
62
66
  - identified technical risks
63
67
  - effort and complexity assessment
64
68
 
69
+ **Round ≥ 2: respond to the prior review (only when a review artifact exists)**: if the task directory contains `review-plan.md` / `review-plan-r{N}.md`, read the highest-round review report; add a `## Response to Prior Review` section to this round's plan artifact, and for each finding verify it via Read/Grep before acting (holds → accept and fix; judged hallucinated/unfounded → rebut with counter-evidence rather than defaulting to compliance); record any open disagreement under `## Open Questions`. Round 1 has no review, so skip this section.
70
+
65
71
  ### 4. Understand the Problem
66
72
 
67
73
  - Read the relevant source files identified in the analysis
@@ -111,15 +117,11 @@ Update `.agents/workspace/active/{task-id}/task.md`:
111
117
  - Mark technical-design as complete in workflow progress and include the actual round when the task template supports it
112
118
  - Before appending the workflow Activity Log entry, re-estimate `effort` based on the technical plan (number of implementation steps, files touched, test matrix scope, integration surface). If the re-estimated value differs from the current value in `task.md`:
113
119
  - Overwrite the `effort` field in frontmatter with the new value
114
- - Prepend an Activity Log entry recording the transition (placed before the `Technical Design (Round N)` entry):
115
- ```
116
- - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Re-estimate** by {agent} — effort {old} → {new} (rationale: {short basis grounded in this plan})
117
- ```
118
- Both entries may share the same timestamp; ordering is conveyed by list position only.
119
- If the re-estimated value matches the current value, skip the Re-estimate entry. The Flow A sync that follows reads the possibly updated frontmatter and propagates the new value to the Issue automatically.
120
+ - Append a `## Effort Re-estimate` section to this round's plan artifact `{plan-artifact}`, recording: `effort {old} → {new} (rationale: {short basis grounded in this plan})`
121
+ If the re-estimated value matches the current value, skip it: do not write the `## Effort Re-estimate` section. The Flow A sync that follows reads the possibly updated frontmatter and propagates the new value to the Issue automatically.
120
122
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
121
123
  ```
122
- - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
124
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Task (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
123
125
  ```
124
126
 
125
127
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
@@ -148,7 +150,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
148
150
 
149
151
  > Execute this step only after the verification gate passes.
150
152
 
151
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name).
153
+ > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the "Next steps" commands, read `.agents/rules/next-step-output.md` and use its short-id snippet to render `{task-ref}` in the commands as the short id `#NN` (falling back to the full TASK-id when unallocated or released).
152
154
 
153
155
  Output format:
154
156
  ```
@@ -168,9 +170,9 @@ Important: human review checkpoint.
168
170
  Please review the technical plan before continuing to implementation.
169
171
 
170
172
  Next step - review the technical plan:
171
- - Claude Code / OpenCode: /review-plan {task-id}
172
- - Gemini CLI: /{{project}}:review-plan {task-id}
173
- - Codex CLI: $review-plan {task-id}
173
+ - Claude Code / OpenCode: /review-plan {task-ref}
174
+ - Gemini CLI: /{{project}}:review-plan {task-ref}
175
+ - Codex CLI: $review-plan {task-ref}
174
176
  ```
175
177
 
176
178
  ## 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}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
31
33
 
34
+ ## 执行步骤
32
35
  ### 1. 验证前置条件
33
36
 
34
37
  检查必要文件:
@@ -62,6 +65,8 @@ tail .agents/workspace/active/{task-id}/task.md
62
65
  - 已识别的技术风险
63
66
  - 工作量和复杂度评估
64
67
 
68
+ **Round ≥ 2:响应上一轮审查(仅当存在审查产物时)**:若任务目录存在 `review-plan.md` / `review-plan-r{N}.md`,读取最高轮次的审查报告;在本轮方案产物中新增 `## 对上一轮审查的响应` 段,对每条发现先 Read/Grep 核实再处置(成立 → 接受并修正;判定为幻觉/不成立 → 附反证反驳,不默认顺从),未决分歧写入 `## 未决问题`。Round 1 无审查,跳过本段。
69
+
65
70
  ### 4. 理解问题
66
71
 
67
72
  - 阅读分析中识别的相关源码文件
@@ -111,15 +116,11 @@ date "+%Y-%m-%d %H:%M:%S%:z"
111
116
  - 在工作流进度中标记 technical-design 为已完成,并注明实际轮次(如果任务模板支持)
112
117
  - 在追加工作流 Activity Log 条目之前,基于技术方案(实施步骤数、涉及文件、测试矩阵范围、集成面)重估 `effort`。若重估值与 `task.md` 当前值不一致:
113
118
  - 用新值覆盖 frontmatter 的 `effort` 字段
114
- - `Technical Design (Round N)` 条目之前追加一条转移记录:
115
- ```
116
- - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Re-estimate** by {agent} — effort {old} → {new} (rationale: {基于本轮方案的简短依据})
117
- ```
118
- 两条条目可共用同一时间戳,顺序仅通过列表位置表达。
119
- 若重估值与当前值一致,跳过 Re-estimate 条目。后续 Flow A 同步会读取可能更新过的 frontmatter,并自动把新值同步到 Issue。
119
+ - 在本轮方案产物 `{plan-artifact}` 中追加 `## 工作量重估` 段,记录一条:`effort {old} → {new} (rationale: {基于本轮方案的简短依据})`
120
+ 若重估值与当前值一致,跳过:不写入 `## 工作量重估` 段。后续 Flow A 同步会读取可能更新过的 frontmatter,并自动把新值同步到 Issue。
120
121
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
121
122
  ```
122
- - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
123
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Task (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
123
124
  ```
124
125
 
125
126
  如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
@@ -148,7 +149,7 @@ node .agents/scripts/validate-artifact.js gate plan-task .agents/workspace/activ
148
149
 
149
150
  > 仅在校验通过后执行本步骤。
150
151
 
151
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
152
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染「下一步」命令前,先读取 `.agents/rules/next-step-output.md`,按其取短号片段把命令中的 `{task-ref}` 渲染为短号 `#NN`(未分配/已释放时回退完整 TASK-id)。
152
153
 
153
154
  输出格式:
154
155
  ```
@@ -168,9 +169,9 @@ node .agents/scripts/validate-artifact.js gate plan-task .agents/workspace/activ
168
169
  请在继续实现之前审查技术方案。
169
170
 
170
171
  下一步 - 审查技术方案:
171
- - Claude Code / OpenCode:/review-plan {task-id}
172
- - Gemini CLI:/{{project}}:review-plan {task-id}
173
- - Codex CLI:$review-plan {task-id}
172
+ - Claude Code / OpenCode:/review-plan {task-ref}
173
+ - Gemini CLI:/agent-infra:review-plan {task-ref}
174
+ - Codex CLI:$review-plan {task-ref}
174
175
  ```
175
176
 
176
177
  ## 完成检查清单
@@ -33,7 +33,7 @@
33
33
  ]
34
34
  },
35
35
  "activity-log": {
36
- "expected_action_pattern": "Technical Design \\(Round \\d+\\)",
36
+ "expected_action_pattern": "(Plan Task|Technical Design) \\(Round \\d+\\)",
37
37
  "freshness_minutes": 30
38
38
  },
39
39
  "platform-sync": {
@@ -33,7 +33,7 @@
33
33
  ]
34
34
  },
35
35
  "activity-log": {
36
- "expected_action_pattern": "Technical Design \\(Round \\d+\\)",
36
+ "expected_action_pattern": "(Plan Task|Technical Design) \\(Round \\d+\\)",
37
37
  "freshness_minutes": 30
38
38
  },
39
39
  "platform-sync": {
@@ -16,6 +16,10 @@ Restore local task workspace files from platform Issue comments that contain syn
16
16
 
17
17
  Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
18
18
 
19
+ ## Task id short ref
20
+
21
+ > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), 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.
22
+
19
23
  ## Steps
20
24
 
21
25
  ### 1. Verify Input and Environment
@@ -90,10 +94,18 @@ Update the restored `task.md`:
90
94
 
91
95
  Append an Activity Log entry indicating the task was restored from the platform Issue.
92
96
 
97
+ **Re-allocate short id** (the task directory is back under `active/`; alloc a new `#N`, which may differ from the pre-archival value):
98
+
99
+ ```bash
100
+ node .agents/scripts/task-short-id.js alloc "$task_id"
101
+ ```
102
+
93
103
  ### 7. Inform User
94
104
 
95
105
  Report the restored task id, restored file count, and the active task directory.
96
106
 
107
+
108
+
97
109
  ## Completion Checklist
98
110
 
99
111
  - [ ] Fetched Issue comments from the platform
@@ -16,8 +16,11 @@ description: "从平台 Issue 评论还原本地任务文件"
16
16
 
17
17
  版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
18
18
 
19
- ## 执行步骤
19
+ ## 任务入参短号别名
20
+
21
+ > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
20
22
 
23
+ ## 执行步骤
21
24
  ### 1. 验证输入与环境
22
25
 
23
26
  检查:
@@ -90,10 +93,18 @@ date "+%Y-%m-%d %H:%M:%S%:z"
90
93
 
91
94
  追加 Activity Log,说明任务已从平台 Issue 还原。
92
95
 
96
+ **重新分配短号**(已把任务目录写回 `active/`,需要在锁内重新 alloc;新短号可能与归档前不同):
97
+
98
+ ```bash
99
+ node .agents/scripts/task-short-id.js alloc "$task_id"
100
+ ```
101
+
93
102
  ### 7. 告知用户
94
103
 
95
104
  报告已恢复的 task id、恢复文件数量和 active task 目录。
96
105
 
106
+
107
+
97
108
  ## 完成检查清单
98
109
 
99
110
  - [ ] 已从平台获取 Issue 评论
@@ -26,6 +26,10 @@ ls -la .agents/workspace/active/{task-id}/
26
26
  tail .agents/workspace/active/{task-id}/task.md
27
27
  ```
28
28
 
29
+ ## Task id short ref
30
+
31
+ > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), 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 Prerequisites
@@ -61,7 +65,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
61
65
  ```
62
66
 
63
67
  Set `current_step` to `requirement-analysis-review`, refresh task metadata, and append:
64
- `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Analysis Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
68
+ `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Analysis (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
65
69
 
66
70
  If task.md has a valid `issue_number`, read `.agents/rules/issue-sync.md`, sync the task comment, and publish the `{review-artifact}` comment.
67
71
 
@@ -74,3 +78,5 @@ node .agents/scripts/validate-artifact.js gate review-analysis .agents/workspace
74
78
  ### 8. Tell the User
75
79
 
76
80
  Use the conclusion branch in `reference/output-templates.md` and show all TUI command formats.
81
+
82
+ > When rendering "Next steps" commands, `{task-ref}` is the current task's short id `#NN` (see `.agents/rules/next-step-output.md` for lookup and fallback; read it before rendering). Other `{task-id}` placeholders (report titles, paths) keep the full TASK-id form.
@@ -28,8 +28,11 @@ tail .agents/workspace/active/{task-id}/task.md
28
28
 
29
29
  状态核对完成前,禁止任何关于外部状态的断言。
30
30
 
31
- ## 执行步骤
31
+ ## 任务入参短号别名
32
+
33
+ > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
32
34
 
35
+ ## 执行步骤
33
36
  ### 1. 验证前置条件
34
37
 
35
38
  要求存在:
@@ -73,7 +76,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
73
76
  - `updated_at`:{当前时间}
74
77
  - `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
75
78
  - 追加:
76
- `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Analysis Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
79
+ `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Analysis (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
77
80
 
78
81
  如果 task.md 中存在有效的 `issue_number`,执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测,然后同步 task 评论并发布 `{review-artifact}` 评论。
79
82
 
@@ -89,6 +92,8 @@ node .agents/scripts/validate-artifact.js gate review-analysis .agents/workspace
89
92
 
90
93
  按 `reference/output-templates.md` 的结论分支输出,并展示所有 TUI 的下一步命令。
91
94
 
95
+ > 渲染「下一步」命令时,`{task-ref}` 为当前任务短号 `#NN`(取值与回退见 `.agents/rules/next-step-output.md`,渲染前先读取)。其他 `{task-id}` 占位(报告标题、路径)保持完整 TASK-id 形式。
96
+
92
97
  ## 完成检查清单
93
98
 
94
99
  - [ ] 已审查最新分析上下文
@@ -23,7 +23,8 @@
23
23
  "Environment-Blocked Findings",
24
24
  "Conclusion and Recommendations",
25
25
  "State Check",
26
- "Evidence"
26
+ "Evidence",
27
+ "Self-Doubt"
27
28
  ],
28
29
  "required_patterns": [
29
30
  "^### Approval Decision$",
@@ -32,7 +33,7 @@
32
33
  "freshness_minutes": 30
33
34
  },
34
35
  "activity-log": {
35
- "expected_action_pattern": "Analysis Review \\(Round \\d+\\)",
36
+ "expected_action_pattern": "(Review Analysis|Analysis Review) \\(Round \\d+\\)",
36
37
  "freshness_minutes": 30
37
38
  },
38
39
  "platform-sync": {
@@ -23,7 +23,8 @@
23
23
  "环境性遗留",
24
24
  "结论与建议",
25
25
  "状态核对",
26
- "证据原文"
26
+ "证据原文",
27
+ "自我质疑"
27
28
  ],
28
29
  "required_patterns": [
29
30
  "^### 审查决定$",
@@ -32,7 +33,7 @@
32
33
  "freshness_minutes": 30
33
34
  },
34
35
  "activity-log": {
35
- "expected_action_pattern": "Analysis Review \\(Round \\d+\\)",
36
+ "expected_action_pattern": "(Review Analysis|Analysis Review) \\(Round \\d+\\)",
36
37
  "freshness_minutes": 30
37
38
  },
38
39
  "platform-sync": {
@@ -25,9 +25,9 @@ Task {task-id} requirement analysis review completed. Verdict: approved.
25
25
  [- Review report: .agents/workspace/active/{task-id}/{review-artifact}]
26
26
 
27
27
  Next step - write the technical plan:
28
- - Claude Code / OpenCode: /plan-task {task-id}
29
- - Gemini CLI: /agent-infra:plan-task {task-id}
30
- - Codex CLI: $plan-task {task-id}
28
+ - Claude Code / OpenCode: /plan-task {task-ref}
29
+ - Gemini CLI: /agent-infra:plan-task {task-ref}
30
+ - Codex CLI: $plan-task {task-ref}
31
31
 
32
32
  [When env-blocked > 0, append:]
33
33
  Reminder: env-blocked items belong in the PR description manual verification checklist and should not trigger /analyze-task.
@@ -41,14 +41,14 @@ Task {task-id} requirement analysis review completed. Verdict: approved.
41
41
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
42
42
 
43
43
  Next step - revise analysis before continuing (recommended):
44
- - Claude Code / OpenCode: /analyze-task {task-id}
45
- - Gemini CLI: /agent-infra:analyze-task {task-id}
46
- - Codex CLI: $analyze-task {task-id}
44
+ - Claude Code / OpenCode: /analyze-task {task-ref}
45
+ - Gemini CLI: /agent-infra:analyze-task {task-ref}
46
+ - Codex CLI: $analyze-task {task-ref}
47
47
 
48
48
  Or proceed directly to planning:
49
- - Claude Code / OpenCode: /plan-task {task-id}
50
- - Gemini CLI: /agent-infra:plan-task {task-id}
51
- - Codex CLI: $plan-task {task-id}
49
+ - Claude Code / OpenCode: /plan-task {task-ref}
50
+ - Gemini CLI: /agent-infra:plan-task {task-ref}
51
+ - Codex CLI: $plan-task {task-ref}
52
52
 
53
53
  [When env-blocked > 0, append:]
54
54
  Reminder: env-blocked items belong in the PR description manual verification checklist and should not trigger /analyze-task.
@@ -62,9 +62,9 @@ Task {task-id} requirement analysis review completed. Verdict: changes requested
62
62
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
63
63
 
64
64
  Next step - revise requirement analysis:
65
- - Claude Code / OpenCode: /analyze-task {task-id}
66
- - Gemini CLI: /agent-infra:analyze-task {task-id}
67
- - Codex CLI: $analyze-task {task-id}
65
+ - Claude Code / OpenCode: /analyze-task {task-ref}
66
+ - Gemini CLI: /agent-infra:analyze-task {task-ref}
67
+ - Codex CLI: $analyze-task {task-ref}
68
68
 
69
69
  [When env-blocked > 0, append:]
70
70
  Reminder: env-blocked items belong in the PR description manual verification checklist and should not trigger /analyze-task.
@@ -78,9 +78,9 @@ Task {task-id} requirement analysis review completed. Verdict: rejected, fresh a
78
78
  - Review report: .agents/workspace/active/{task-id}/{review-artifact}
79
79
 
80
80
  Next step - re-analyze:
81
- - Claude Code / OpenCode: /analyze-task {task-id}
82
- - Gemini CLI: /agent-infra:analyze-task {task-id}
83
- - Codex CLI: $analyze-task {task-id}
81
+ - Claude Code / OpenCode: /analyze-task {task-ref}
82
+ - Gemini CLI: /agent-infra:analyze-task {task-ref}
83
+ - Codex CLI: $analyze-task {task-ref}
84
84
 
85
85
  [When env-blocked > 0, append:]
86
86
  Reminder: env-blocked items belong in the PR description manual verification checklist and should not trigger /analyze-task.
@@ -25,9 +25,9 @@
25
25
  [- 审查报告:.agents/workspace/active/{task-id}/{review-artifact}]
26
26
 
27
27
  下一步 - 编写技术方案:
28
- - Claude Code / OpenCode:/plan-task {task-id}
29
- - Gemini CLI:/agent-infra:plan-task {task-id}
30
- - Codex CLI:$plan-task {task-id}
28
+ - Claude Code / OpenCode:/plan-task {task-ref}
29
+ - Gemini CLI:/agent-infra:plan-task {task-ref}
30
+ - Codex CLI:$plan-task {task-ref}
31
31
 
32
32
  [当 env-blocked > 0 时,在最后附加一行:]
33
33
  提醒:env-blocked 项需在 PR description 的「待人工验证」清单中承接,不应触发 /analyze-task。
@@ -41,14 +41,14 @@
41
41
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
42
42
 
43
43
  下一步 - 修订分析后继续(推荐):
44
- - Claude Code / OpenCode:/analyze-task {task-id}
45
- - Gemini CLI:/agent-infra:analyze-task {task-id}
46
- - Codex CLI:$analyze-task {task-id}
44
+ - Claude Code / OpenCode:/analyze-task {task-ref}
45
+ - Gemini CLI:/agent-infra:analyze-task {task-ref}
46
+ - Codex CLI:$analyze-task {task-ref}
47
47
 
48
48
  或直接进入方案设计:
49
- - Claude Code / OpenCode:/plan-task {task-id}
50
- - Gemini CLI:/agent-infra:plan-task {task-id}
51
- - Codex CLI:$plan-task {task-id}
49
+ - Claude Code / OpenCode:/plan-task {task-ref}
50
+ - Gemini CLI:/agent-infra:plan-task {task-ref}
51
+ - Codex CLI:$plan-task {task-ref}
52
52
 
53
53
  [当 env-blocked > 0 时,在最后附加一行:]
54
54
  提醒:env-blocked 项需在 PR description 的「待人工验证」清单中承接,不应触发 /analyze-task。
@@ -62,9 +62,9 @@
62
62
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
63
63
 
64
64
  下一步 - 修订需求分析:
65
- - Claude Code / OpenCode:/analyze-task {task-id}
66
- - Gemini CLI:/agent-infra:analyze-task {task-id}
67
- - Codex CLI:$analyze-task {task-id}
65
+ - Claude Code / OpenCode:/analyze-task {task-ref}
66
+ - Gemini CLI:/agent-infra:analyze-task {task-ref}
67
+ - Codex CLI:$analyze-task {task-ref}
68
68
 
69
69
  [当 env-blocked > 0 时,在最后附加一行:]
70
70
  提醒:env-blocked 项需在 PR description 的「待人工验证」清单中承接,不应触发 /analyze-task。
@@ -78,9 +78,9 @@
78
78
  - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
79
79
 
80
80
  下一步 - 重新分析:
81
- - Claude Code / OpenCode:/analyze-task {task-id}
82
- - Gemini CLI:/agent-infra:analyze-task {task-id}
83
- - Codex CLI:$analyze-task {task-id}
81
+ - Claude Code / OpenCode:/analyze-task {task-ref}
82
+ - Gemini CLI:/agent-infra:analyze-task {task-ref}
83
+ - Codex CLI:$analyze-task {task-ref}
84
84
 
85
85
  [当 env-blocked > 0 时,在最后附加一行:]
86
86
  提醒:env-blocked 项需在 PR description 的「待人工验证」清单中承接,不应触发 /analyze-task。
@@ -61,7 +61,7 @@ Use this template when writing `review-analysis.md` or `review-analysis-r{N}.md`
61
61
 
62
62
  ## Evidence
63
63
 
64
- > Pair each "I verified X" claim with the corresponding raw tool output; the gate only checks that this section exists and at least one `$ ` line is present.
64
+ > Pair each "I verified X" claim with the corresponding raw tool output; the gate only checks that this section exists and at least one `$ ` line is present. Every Blocker must be backed by a reproducible command (rg/grep/sed/nl) and its raw output; a judgment that cannot be reproduced must be downgraded or moved to Self-Doubt.
65
65
 
66
66
  - Claim: {verified claim}
67
67
  ```text
@@ -69,6 +69,12 @@ $ {command}
69
69
  {raw output}
70
70
  ```
71
71
 
72
+ ## Self-Doubt
73
+
74
+ > Explicitly declare conclusions, inferences, and assumptions in this review that were **not directly verified**; downstream can rebut them on this basis. Write "None" if there are none.
75
+
76
+ - {an unverified conclusion or inference; note why it was not verified and the impact if it is overturned}
77
+
72
78
  ## Highlights
73
79
 
74
80
  - {what went well}
@@ -62,7 +62,7 @@
62
62
 
63
63
  ## 证据原文
64
64
 
65
- > 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。
65
+ > 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。每条 Blocker 必须配可复现命令(rg/grep/sed/nl)及其原文;无法复现的判断须降级或移入「自我质疑」。
66
66
 
67
67
  - 断言:{verified claim}
68
68
  ```text
@@ -70,6 +70,12 @@ $ {command}
70
70
  {raw output}
71
71
  ```
72
72
 
73
+ ## 自我质疑
74
+
75
+ > 显式声明本轮审查中**未直接验证**的结论、推断项与所作假设;下游据此可反驳。无则写「(无)」。
76
+
77
+ - {未直接验证的结论或推断;说明为何未验证、若被推翻的影响}
78
+
73
79
  ## 亮点
74
80
 
75
81
  - {what went well}
@@ -13,11 +13,13 @@ Follow the `analysis-review` step in `.agents/workflows/feature-development.yaml
13
13
  - [ ] Risks, edge cases, and open questions are recorded
14
14
  - [ ] The design stage has enough input to proceed
15
15
  - [ ] The analysis matches the original Issue or user request
16
+ - [ ] Every blocker is backed by reproducible grep/sed/nl evidence; conclusions not directly verified are declared under Self-Doubt
16
17
 
17
18
  **Common anti-examples**:
18
19
  - Treating implementation design as requirement analysis and locking in technical details too early
19
20
  - Restating the Issue without adding impact scope, risks, or acceptance criteria
20
21
  - Presenting uncertain information as fact without marking assumptions or open questions
22
+ - Asserting a `file:line` or behavior from memory or impression without verifying via rg/nl
21
23
 
22
24
  ## Common Review Principles
23
25
 
@@ -13,11 +13,13 @@
13
13
  - [ ] 风险、边界情况和开放问题是否记录
14
14
  - [ ] 后续设计阶段是否有足够输入
15
15
  - [ ] 与原始 Issue / 用户需求是否一致
16
+ - [ ] 每条 blocker 都配可复现的 grep/sed/nl 证据,未直接验证的结论已在「自我质疑」声明
16
17
 
17
18
  **常见反例**:
18
19
  - 把实现方案当作需求分析,提前锁定技术细节
19
20
  - 只复述 Issue 文案,没有补充影响范围、风险和验收标准
20
21
  - 对无法确认的信息直接下结论,没有标记假设或开放问题
22
+ - 凭印象或记忆断言 `file:line`/行为,没有用 rg/nl 复核就下结论
21
23
 
22
24
  ## 通用审查原则
23
25
 
@@ -21,6 +21,7 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
21
21
  | "It was only one line, so it cannot affect behavior." | Line count is not impact; read the full `git diff` and trace the downstream effect of each change. |
22
22
  | "It looks mostly fine, so approve it." | The verdict must be backed by blocker/major/minor counts, and every finding must cite file:line; do not approve from impression. |
23
23
  | "The test change looks reasonable, so I can skim it." | Before reviewing test changes, check `.agents/rules/testing-discipline.md` item by item (see the step 4 gate). |
24
+ | "I'm sure it's that line, no need to check." | Line numbers drift; verify `file:line` via rg/nl before concluding, and do not file a blocker you cannot reproduce. |
24
25
 
25
26
  ## Step 0: State Check (pre-execution hard gate)
26
27
 
@@ -36,6 +37,10 @@ tail .agents/workspace/active/{task-id}/task.md
36
37
 
37
38
  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.
38
39
 
40
+ ## Task id short ref
41
+
42
+ > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), 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.
43
+
39
44
  ## Steps
40
45
 
41
46
  ### 1. Verify Prerequisites
@@ -76,7 +81,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
76
81
  ```
77
82
 
78
83
  Update task.md and append:
79
- `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Code Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {artifact-filename}`
84
+ `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Code (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {artifact-filename}`
80
85
 
81
86
  Omit the bracketed segment when env-blocked = 0; append ` (+ {n} env-blocked)` when env-blocked > 0.
82
87
 
@@ -117,6 +122,8 @@ env-blocked counts do not influence branch selection; they are appended to the s
117
122
 
118
123
  > The full four-branch output templates, selection rules, and prohibition clauses live in `reference/output-templates.md`. Read `reference/output-templates.md` before reporting the review result.
119
124
 
125
+ > When rendering "Next steps" commands, `{task-ref}` is the current task's short id `#NN` (see `.agents/rules/next-step-output.md` for lookup and fallback; read it before rendering). Other `{task-id}` placeholders (report titles, paths) keep the full TASK-id form.
126
+
120
127
  Include all TUI command formats in the next-step output. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name).
121
128
 
122
129
  ## Completion Checklist
@@ -21,6 +21,7 @@ description: "审查代码实现并输出代码审查报告"
21
21
  | 「只改了一行,不影响功能」 | 行数不等于影响面;必须读完整 `git diff` 并定位每处改动的下游效果。 |
22
22
  | 「大体没问题,给个 Approved」 | 结论必须由 blocker/major/minor 计数支撑,每个问题引用文件:行号,不能凭印象放行。 |
23
23
  | 「测试改动看着合理,跳过细看」 | 审查测试变更前必须逐条核对 `.agents/rules/testing-discipline.md`(见步骤 4 门禁)。 |
24
+ | 「记得就是这一行,不用查」 | 行号会漂移;下结论前必须用 rg/nl 复核 `file:line`,不能复现的判断不要写成 blocker。 |
24
25
 
25
26
  ## 第 0 步:状态核对(执行前硬约束)
26
27
 
@@ -36,8 +37,11 @@ tail .agents/workspace/active/{task-id}/task.md
36
37
 
37
38
  状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
38
39
 
39
- ## 执行步骤
40
+ ## 任务入参短号别名
41
+
42
+ > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
40
43
 
44
+ ## 执行步骤
41
45
  ### 1. 验证前置条件
42
46
 
43
47
  要求存在:
@@ -80,7 +84,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
80
84
  - `updated_at`:{当前时间}
81
85
  - `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
82
86
  - 追加:
83
- `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Code Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {artifact-filename}`
87
+ `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Code (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {artifact-filename}`
84
88
 
85
89
  env-blocked = 0 时省略括号部分;env-blocked > 0 时附加 ` (+ {n} env-blocked)`。
86
90
 
@@ -121,6 +125,8 @@ env-blocked 的数量不参与分支选择,仅在数字摘要末尾附带显
121
125
 
122
126
  > 完整的 4 分支输出模板、判断规则和禁止条款见 `reference/output-templates.md`。向用户汇报审查结论前先读取 `reference/output-templates.md`。
123
127
 
128
+ > 渲染「下一步」命令时,`{task-ref}` 为当前任务短号 `#NN`(取值与回退见 `.agents/rules/next-step-output.md`,渲染前先读取)。其他 `{task-id}` 占位(报告标题、路径)保持完整 TASK-id 形式。
129
+
124
130
  向用户展示下一步时,必须包含所有 TUI 命令格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
125
131
 
126
132
  ## 完成检查清单
@@ -23,7 +23,8 @@
23
23
  "Environment-Blocked Findings",
24
24
  "Conclusion and Recommendations",
25
25
  "State Check",
26
- "Evidence"
26
+ "Evidence",
27
+ "Self-Doubt"
27
28
  ],
28
29
  "required_patterns": [
29
30
  "^### Approval Decision$",
@@ -33,7 +34,7 @@
33
34
  "freshness_minutes": 30
34
35
  },
35
36
  "activity-log": {
36
- "expected_action_pattern": "Code Review \\(Round \\d+\\)",
37
+ "expected_action_pattern": "(Review Code|Code Review) \\(Round \\d+\\)",
37
38
  "freshness_minutes": 30
38
39
  },
39
40
  "platform-sync": {
@@ -23,7 +23,8 @@
23
23
  "环境性遗留",
24
24
  "结论与建议",
25
25
  "状态核对",
26
- "证据原文"
26
+ "证据原文",
27
+ "自我质疑"
27
28
  ],
28
29
  "required_patterns": [
29
30
  "^### 审查决定$",
@@ -33,7 +34,7 @@
33
34
  "freshness_minutes": 30
34
35
  },
35
36
  "activity-log": {
36
- "expected_action_pattern": "Code Review \\(Round \\d+\\)",
37
+ "expected_action_pattern": "(Review Code|Code Review) \\(Round \\d+\\)",
37
38
  "freshness_minutes": 30
38
39
  },
39
40
  "platform-sync": {