@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
@@ -0,0 +1,91 @@
1
+ # 审查报告模板
2
+
3
+ 编写 `review-code.md` 或 `review-code-r{N}.md` 时使用本模板。
4
+
5
+ ## 输出模板
6
+
7
+ ```markdown
8
+ # 代码审查报告
9
+
10
+ - **审查轮次**:第 {review-round} 轮
11
+ - **产物文件**:`{review-artifact}`
12
+ - **审查输入**:
13
+ - `{code-artifact}`
14
+ - `{code-artifact}`(如存在)
15
+
16
+ ## 状态核对
17
+
18
+ > 粘贴状态核对命令原文;每条命令以 `$ ` 开头。
19
+
20
+ ## 审查摘要
21
+
22
+ - **审查者**:{reviewer-name}
23
+ - **审查时间**:{timestamp}
24
+ - **审查范围**:{file-count and major modules}
25
+ - **总体结论**:{通过 / 需要修改 / 拒绝}(恰取一个;禁止写组合短语,否则 verify gate 失败)
26
+ - **发现(AI 可处理)**:0 阻塞项,0 主要,0 次要 / **env-blocked**:0
27
+
28
+ ## 问题清单
29
+
30
+ ### 阻塞项(必须修复)
31
+
32
+ #### 1. {问题标题}
33
+ **文件**:`{file-path}:{line-number}`
34
+ **说明**:{details}
35
+ **修复建议**:{fix suggestion}
36
+
37
+ ### 主要问题(建议修复)
38
+
39
+ #### 1. {问题标题}
40
+ **文件**:`{file-path}:{line-number}`
41
+ **说明**:{details}
42
+ **修复建议**:{fix suggestion}
43
+
44
+ ### 次要问题(可选改进)
45
+
46
+ #### 1. {改进点}
47
+ **文件**:`{file-path}:{line-number}`
48
+ **建议**:{improvement suggestion}
49
+
50
+ ## 环境性遗留
51
+
52
+ > AI agent 在本执行环境无法闭环的项;不参与下一轮 refine。维护者在 PR description 中以「待人工验证」清单承接。
53
+
54
+ #### 1. {环境性项标题}
55
+ **文件**:`{file-path}:{line-number}`(如适用)
56
+ **说明**:{details}
57
+ **所需环境**:{e.g. Docker 沙箱 / macOS host / 特权 root / 第三方账号}
58
+ **待人工执行的验证步骤**:{steps for the human verifier}
59
+
60
+ > 如本轮无 env-blocked 项,保留段落标题并写「(无)」。
61
+
62
+
63
+ ## 证据原文
64
+
65
+ > 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。
66
+
67
+ - 断言:{verified claim}
68
+ ```text
69
+ $ {command}
70
+ {raw output}
71
+ ```
72
+
73
+ ## 亮点
74
+
75
+ - {what went well}
76
+
77
+ ## 与方案一致性
78
+
79
+ - [ ] 实现与技术方案一致
80
+ - [ ] 没有意外的范围扩张
81
+
82
+ ## 结论与建议
83
+
84
+ ### 审查决定
85
+ - [ ] 通过
86
+ - [ ] 需要修改
87
+ - [ ] 拒绝
88
+
89
+ ### 下一步
90
+ {recommended next step}
91
+ ```
@@ -0,0 +1,48 @@
1
+ # Review Criteria
2
+
3
+ Read this file before reviewing code or classifying finding severity.
4
+
5
+ ## Code Review
6
+
7
+ Follow the `code-review` step in `.agents/workflows/feature-development.yaml`.
8
+
9
+ **Required review areas**:
10
+ - [ ] Code quality and project style
11
+ - [ ] Bugs and risk identification
12
+ - [ ] Test coverage and test quality
13
+ - [ ] Error handling and edge cases
14
+ - [ ] Performance and security risks
15
+ - [ ] Comments and documentation
16
+ - [ ] Consistency with the approved technical plan
17
+
18
+ **Common anti-examples**:
19
+ - Checking only whether tests pass without reading the actual diff
20
+ - Treating wording preferences as reproducible code problems
21
+ - Misclassifying environment-limited verification gaps as blockers
22
+
23
+ ## Common Review Principles
24
+
25
+ 1. **Strict but fair**: identify issues and acknowledge solid work
26
+ 2. **Specific**: cite exact file paths and line numbers
27
+ 3. **Actionable**: suggest a concrete fix
28
+ 4. **Severity-based**: clearly distinguish blockers, major issues, and minor issues
29
+
30
+ ## Environment-Blocked Classification
31
+
32
+ Some findings cannot be closed by an AI agent in the current execution environment, for example:
33
+
34
+ - Missing Docker / sandbox access for end-to-end validation
35
+ - Missing a specific OS for macOS-only behavior
36
+ - Missing third-party accounts / OAuth
37
+ - Missing privileged operations such as root, sudo, or special network access
38
+
39
+ **Decision tree**: "Can the AI agent close this item independently without changing the environment?"
40
+ - Yes -> blocker / major / minor, based on risk
41
+ - No -> **env-blocked** (a meta-category, not part of severity ordering)
42
+
43
+ Where env-blocked items go:
44
+ - Record them in an independent review report section named "Environment-Blocked Findings"
45
+ - Include them at the end of the numeric summary, for example `(+ 1 env-blocked)`
46
+ - Do **not** include them in the code-task fix loop; maintainers carry them in the PR description under manual verification
47
+
48
+ Also inspect `git diff`, the latest code artifact, latest technical-plan review artifact, and `task.md` Activity Log so the report reflects the full change context.
@@ -13,9 +13,15 @@
13
13
  - [ ] 错误处理和边界情况
14
14
  - [ ] 性能与安全风险
15
15
  - [ ] 代码注释和文档
16
- - [ ] 与技术方案的一致性
16
+ - [ ] 与已批准技术方案的一致性
17
+
18
+ **常见反例**:
19
+ - 只检查测试是否通过,没有阅读实际 diff
20
+ - 用自然语言措辞偏好替代可复现的代码问题
21
+ - 把环境缺失导致无法验证的事项误归类为 blocker
22
+
23
+ ## 通用审查原则
17
24
 
18
- **审查原则**:
19
25
  1. **严格但公正**:既要指出问题,也要承认做得好的部分
20
26
  2. **具体**:引用准确的文件路径和行号
21
27
  3. **可执行**:给出明确可落地的修复建议
@@ -37,6 +43,6 @@
37
43
  env-blocked 项的去向:
38
44
  - 写入 review 报告独立段落「环境性遗留」
39
45
  - 在数字摘要末尾附带显示(如 `(+ 1 env-blocked)`)
40
- - **不**进入 refine 循环;维护者在 PR description 中以「待人工验证」清单形式承接
46
+ - **不**进入 code-task 修复循环;维护者在 PR description 中以「待人工验证」清单形式承接
41
47
 
42
- 同时检查 `git diff`,确保报告反映完整的变更上下文。
48
+ 同时检查 `git diff`、最新实现产物、最新技术方案审查产物和 `task.md` Activity Log,确保报告反映完整的变更上下文。
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: review-plan
3
+ description: "Review the technical plan"
4
+ ---
5
+
6
+ # Technical Plan Review
7
+
8
+ Review the latest plan artifact and produce `review-plan.md` or `review-plan-r{N}.md`.
9
+
10
+ ## Boundary / Critical Rules
11
+
12
+ - This skill only reviews plan artifacts and writes a report; it does not modify product code.
13
+ - After executing this skill, you **must** immediately update task.md.
14
+
15
+ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
16
+
17
+ ## Step 0: State Check (pre-execution hard gate)
18
+
19
+ After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first.
20
+
21
+ Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
22
+
23
+ ```bash
24
+ git status -s
25
+ ls -la .agents/workspace/active/{task-id}/
26
+ tail .agents/workspace/active/{task-id}/task.md
27
+ ```
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
+
33
+ ## Steps
34
+
35
+ ### 1. Verify Prerequisites
36
+
37
+ Require `task.md` and at least one plan artifact: `plan.md` or `plan-r{N}.md`.
38
+
39
+ ### 2. Determine Review Round
40
+
41
+ Record `{plan-artifact}`, `{review-round}`, and `{review-artifact}` (`review-plan.md` or `review-plan-r{N}.md`).
42
+
43
+ ### 3. Read Plan Context
44
+
45
+ Read `{plan-artifact}`, the latest analysis artifact, `task.md`, and Issue context when available.
46
+
47
+ ### 4. Perform Review
48
+
49
+ Check simplicity, executability, risk control, test strategy, file coverage, and phase boundaries.
50
+
51
+ > Read `reference/review-criteria.md` before this step.
52
+
53
+ ### 5. Write Review Report
54
+
55
+ Create `.agents/workspace/active/{task-id}/{review-artifact}`.
56
+
57
+ > Read `reference/report-template.md` before writing the report.
58
+
59
+ ### 6. Update Task Status
60
+
61
+ Get the current time:
62
+
63
+ ```bash
64
+ date "+%Y-%m-%d %H:%M:%S%:z"
65
+ ```
66
+
67
+ Set `current_step` to `technical-design-review`, refresh task metadata, and append:
68
+ `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
69
+
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.
71
+
72
+ ### 7. Run Completion Gate
73
+
74
+ ```bash
75
+ node .agents/scripts/validate-artifact.js gate review-plan .agents/workspace/active/{task-id} {review-artifact} --format text
76
+ ```
77
+
78
+ ### 8. Tell the User
79
+
80
+ Use the conclusion branch in `reference/output-templates.md` and show all TUI command formats.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: review-plan
3
+ description: "审查技术方案"
4
+ ---
5
+
6
+ # 技术方案审查
7
+
8
+ 审查最新技术方案产物,并产出 `review-plan.md` 或 `review-plan-r{N}.md`。
9
+
10
+ ## 行为边界 / 关键规则
11
+
12
+ - 本技能只审查方案产物并写报告,不修改业务代码
13
+ - 执行本技能后,你**必须**立即更新 task.md
14
+
15
+ 版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
16
+
17
+ ## 第 0 步:状态核对(执行前硬约束)
18
+
19
+ 在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
20
+
21
+ 运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
22
+
23
+ ```bash
24
+ git status -s
25
+ ls -la .agents/workspace/active/{task-id}/
26
+ tail .agents/workspace/active/{task-id}/task.md
27
+ ```
28
+
29
+ 状态核对完成前,禁止任何关于外部状态的断言。
30
+
31
+ ## 任务入参短号别名
32
+
33
+ > 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
34
+
35
+ ## 执行步骤
36
+ ### 1. 验证前置条件
37
+
38
+ 要求存在:
39
+ - `.agents/workspace/active/{task-id}/task.md`
40
+ - 至少一个方案产物:`plan.md` 或 `plan-r{N}.md`
41
+
42
+ ### 2. 确定审查轮次
43
+
44
+ 扫描任务目录并记录:
45
+ - `{plan-artifact}`:最高轮次的方案产物
46
+ - `{review-round}`
47
+ - `{review-artifact}`:`review-plan.md` 或 `review-plan-r{N}.md`
48
+
49
+ ### 3. 阅读方案上下文
50
+
51
+ 读取最新 `{plan-artifact}`、最新分析产物、`task.md` 和关联 Issue 上下文(如有)。
52
+
53
+ ### 4. 执行审查
54
+
55
+ 重点检查方案的简洁性、可执行性、风险控制、测试策略、文件清单和阶段边界。
56
+
57
+ > 详细审查标准见 `reference/review-criteria.md`。执行此步骤前先读取 `reference/review-criteria.md`。
58
+
59
+ ### 5. 编写审查报告
60
+
61
+ 创建 `.agents/workspace/active/{task-id}/{review-artifact}`。
62
+
63
+ > 报告格式见 `reference/report-template.md`。写报告前先读取 `reference/report-template.md`。
64
+
65
+ ### 6. 更新任务状态
66
+
67
+ 获取当前时间:
68
+
69
+ ```bash
70
+ date "+%Y-%m-%d %H:%M:%S%:z"
71
+ ```
72
+
73
+ 更新 task.md:
74
+ - `current_step`:technical-design-review
75
+ - `assigned_to`:{当前代理}
76
+ - `updated_at`:{当前时间}
77
+ - `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
78
+ - 追加:
79
+ `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
80
+
81
+ 如果 task.md 中存在有效的 `issue_number`,执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测,然后同步 task 评论并发布 `{review-artifact}` 评论。
82
+
83
+ ### 7. 完成校验
84
+
85
+ ```bash
86
+ node .agents/scripts/validate-artifact.js gate review-plan .agents/workspace/active/{task-id} {review-artifact} --format text
87
+ ```
88
+
89
+ 校验通过后继续告知用户;校验失败则修复报告或 task 状态后重跑。
90
+
91
+ ### 8. 告知用户
92
+
93
+ 按 `reference/output-templates.md` 的结论分支输出,并展示所有 TUI 的下一步命令。
94
+
95
+ ## 完成检查清单
96
+
97
+ - [ ] 已审查最新方案上下文
98
+ - [ ] 已创建 `{review-artifact}`
99
+ - [ ] 已更新 task.md 并追加 Activity Log
100
+ - [ ] 已展示所有 TUI 的下一步命令
101
+
102
+ ## 注意事项
103
+
104
+ - 首轮审查使用 `review-plan.md`,后续轮次使用 `review-plan-r{N}.md`
105
+ - 所有问题都要引用具体文件路径和行号;方案产物问题可引用 `{plan-artifact}` 的行号
@@ -1,5 +1,5 @@
1
1
  {
2
- "skill": "refine-task",
2
+ "skill": "review-plan",
3
3
  "checks": {
4
4
  "task-meta": {
5
5
  "required_fields": [
@@ -12,35 +12,39 @@
12
12
  "agent_infra_version",
13
13
  "current_step",
14
14
  "assigned_to"
15
- ]
15
+ ],
16
+ "expected_step": "technical-design-review"
16
17
  },
17
18
  "artifact": {
18
- "file_pattern": "refinement.md|refinement-r{N}.md",
19
+ "file_pattern": "review-plan.md|review-plan-r{N}.md",
19
20
  "required_sections": [
20
- "Review Feedback Handling",
21
- "Test Results After Refinement",
21
+ "Review Summary",
22
+ "Findings",
23
+ "Environment-Blocked Findings",
24
+ "Conclusion and Recommendations",
22
25
  "State Check",
23
26
  "Evidence"
24
27
  ],
25
- "freshness_minutes": 30,
26
28
  "required_patterns": [
29
+ "^### Approval Decision$",
27
30
  "^\\$ "
28
- ]
31
+ ],
32
+ "freshness_minutes": 30
29
33
  },
30
34
  "activity-log": {
31
- "expected_action_pattern": "Refinement \\(Round \\d+, for .+\\)",
35
+ "expected_action_pattern": "Plan Review \\(Round \\d+\\)",
32
36
  "freshness_minutes": 30
33
37
  },
34
38
  "platform-sync": {
35
39
  "when": "issue_number_exists",
36
- "expected_status_label": "status: in-progress",
40
+ "expected_status_label": "status: pending-design-work",
37
41
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
38
42
  "verify_comment_content": true,
39
43
  "verify_task_comment_content": true,
40
44
  "verify_issue_type": true,
41
45
  "verify_issue_fields": false,
42
46
  "verify_milestone": true,
43
- "expected_status_label_key": "inProgress",
47
+ "expected_status_label_key": "pendingDesignWork",
44
48
  "expected_comment_marker_key": "artifact"
45
49
  }
46
50
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "skill": "refine-task",
2
+ "skill": "review-plan",
3
3
  "checks": {
4
4
  "task-meta": {
5
5
  "required_fields": [
@@ -12,35 +12,39 @@
12
12
  "agent_infra_version",
13
13
  "current_step",
14
14
  "assigned_to"
15
- ]
15
+ ],
16
+ "expected_step": "technical-design-review"
16
17
  },
17
18
  "artifact": {
18
- "file_pattern": "refinement.md|refinement-r{N}.md",
19
+ "file_pattern": "review-plan.md|review-plan-r{N}.md",
19
20
  "required_sections": [
20
- "审查反馈处理",
21
- "修复后的测试结果",
21
+ "审查摘要",
22
+ "问题清单",
23
+ "环境性遗留",
24
+ "结论与建议",
22
25
  "状态核对",
23
26
  "证据原文"
24
27
  ],
25
- "freshness_minutes": 30,
26
28
  "required_patterns": [
29
+ "^### 审查决定$",
27
30
  "^\\$ "
28
- ]
31
+ ],
32
+ "freshness_minutes": 30
29
33
  },
30
34
  "activity-log": {
31
- "expected_action_pattern": "Refinement \\(Round \\d+, for .+\\)",
35
+ "expected_action_pattern": "Plan Review \\(Round \\d+\\)",
32
36
  "freshness_minutes": 30
33
37
  },
34
38
  "platform-sync": {
35
39
  "when": "issue_number_exists",
36
- "expected_status_label": "status: in-progress",
40
+ "expected_status_label": "status: pending-design-work",
37
41
  "expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
38
42
  "verify_comment_content": true,
39
43
  "verify_task_comment_content": true,
40
44
  "verify_issue_type": true,
41
45
  "verify_issue_fields": false,
42
46
  "verify_milestone": true,
43
- "expected_status_label_key": "inProgress",
47
+ "expected_status_label_key": "pendingDesignWork",
44
48
  "expected_comment_marker_key": "artifact"
45
49
  }
46
50
  }
@@ -0,0 +1,87 @@
1
+ # Review Output Templates
2
+
3
+ Read this file before presenting the final review result to the user.
4
+
5
+ ## Select exactly one output scenario
6
+
7
+ Evaluate in this order (**env-blocked count does not participate in selection**):
8
+ 1. If `Blocker = 0`, `Major = 0`, and `Minor = 0`, use Scenario A, regardless of env-blocked count
9
+ 2. If `Blocker = 0` and (`Major > 0` or `Minor > 0`), use Scenario B
10
+ 3. If `Blocker > 0` and the issues can be handled by one focused revision, use Scenario C
11
+ 4. If the technical plan needs major redesign, broad rewriting, or a restart, use Scenario D
12
+
13
+ Rules:
14
+ - Do not skip scenario selection
15
+ - Do not mix text from multiple scenarios
16
+ - If `Blocker > 0`, never use an approved template
17
+ - Never count env-blocked items as blocker / major / minor or use them to trigger Scenario B/C/D
18
+ - The selected scenario must include all TUI command formats
19
+
20
+ ### Scenario A: Approved with no findings
21
+
22
+ ```text
23
+ Task {task-id} technical plan review completed. Verdict: approved.
24
+ - Blockers: 0 | Major issues: 0 | Minor issues: 0[ | Environment-blocked: {n} (outside AI fix scope)]
25
+ [- Review report: .agents/workspace/active/{task-id}/{review-artifact}]
26
+
27
+ Next step - write code:
28
+ - Claude Code / OpenCode: /code-task {task-id}
29
+ - Gemini CLI: /agent-infra:code-task {task-id}
30
+ - Codex CLI: $code-task {task-id}
31
+
32
+ [When env-blocked > 0, append:]
33
+ Reminder: env-blocked items belong in the PR description manual verification checklist and should not trigger /plan-task.
34
+ ```
35
+
36
+ ### Scenario B: Approved with findings
37
+
38
+ ```text
39
+ Task {task-id} technical plan review completed. Verdict: approved.
40
+ - Blockers: 0 | Major issues: {n} | Minor issues: {n}[ | Environment-blocked: {n} (outside AI fix scope)]
41
+ - Review report: .agents/workspace/active/{task-id}/{review-artifact}
42
+
43
+ Next step - revise plan before coding (recommended):
44
+ - Claude Code / OpenCode: /plan-task {task-id}
45
+ - Gemini CLI: /agent-infra:plan-task {task-id}
46
+ - Codex CLI: $plan-task {task-id}
47
+
48
+ Or proceed directly to coding:
49
+ - Claude Code / OpenCode: /code-task {task-id}
50
+ - Gemini CLI: /agent-infra:code-task {task-id}
51
+ - Codex CLI: $code-task {task-id}
52
+
53
+ [When env-blocked > 0, append:]
54
+ Reminder: env-blocked items belong in the PR description manual verification checklist and should not trigger /plan-task.
55
+ ```
56
+
57
+ ### Scenario C: Changes requested
58
+
59
+ ```text
60
+ Task {task-id} technical plan review completed. Verdict: changes requested.
61
+ - Blockers: {n} | Major issues: {n} | Minor issues: {n}[ | Environment-blocked: {n} (outside AI fix scope)]
62
+ - Review report: .agents/workspace/active/{task-id}/{review-artifact}
63
+
64
+ Next step - revise technical plan:
65
+ - Claude Code / OpenCode: /plan-task {task-id}
66
+ - Gemini CLI: /agent-infra:plan-task {task-id}
67
+ - Codex CLI: $plan-task {task-id}
68
+
69
+ [When env-blocked > 0, append:]
70
+ Reminder: env-blocked items belong in the PR description manual verification checklist and should not trigger /plan-task.
71
+ ```
72
+
73
+ ### Scenario D: Rejected
74
+
75
+ ```text
76
+ Task {task-id} technical plan review completed. Verdict: rejected, redesign required.
77
+ - Blockers: {n} | Major issues: {n} | Minor issues: {n}[ | Environment-blocked: {n} (outside AI fix scope)]
78
+ - Review report: .agents/workspace/active/{task-id}/{review-artifact}
79
+
80
+ Next step - redesign:
81
+ - Claude Code / OpenCode: /plan-task {task-id}
82
+ - Gemini CLI: /agent-infra:plan-task {task-id}
83
+ - Codex CLI: $plan-task {task-id}
84
+
85
+ [When env-blocked > 0, append:]
86
+ Reminder: env-blocked items belong in the PR description manual verification checklist and should not trigger /plan-task.
87
+ ```
@@ -0,0 +1,87 @@
1
+ # 审查输出模板
2
+
3
+ 在向用户汇报最终审查结论之前先读取本文件。
4
+
5
+ ## 选择唯一输出场景
6
+
7
+ 按以下顺序判断(**注意:env-blocked 数量不参与判断**):
8
+ 1. 如果 `Blocker = 0` 且 `Major = 0` 且 `Minor = 0`,使用场景 A(不管 env-blocked 是否 > 0)
9
+ 2. 如果 `Blocker = 0` 且(`Major > 0` 或 `Minor > 0`),使用场景 B
10
+ 3. 如果 `Blocker > 0`,且问题可以通过一次聚焦修复解决,使用场景 C
11
+ 4. 如果技术方案需要重大重构、大范围重写或整体重来,使用场景 D
12
+
13
+ 禁止规则:
14
+ - 不要跳过场景判断步骤
15
+ - 不要混用不同场景的文案
16
+ - 只要 `Blocker > 0`,就绝对不能输出通过模板
17
+ - env-blocked 项绝对不能被计入 blocker / major / minor 计数,也不能用作触发场景 B/C/D 的依据
18
+ - 所选场景中必须包含所有 TUI 命令格式
19
+
20
+ ### 场景 A:通过且无问题
21
+
22
+ ```text
23
+ 任务 {task-id} 技术方案审查完成。结论:通过。
24
+ - 阻塞项:0 | 主要问题:0 | 次要问题:0[ | 环境性遗留:{n}(不在 AI 修复范围)]
25
+ [- 审查报告:.agents/workspace/active/{task-id}/{review-artifact}]
26
+
27
+ 下一步 - 编写代码:
28
+ - Claude Code / OpenCode:/code-task {task-id}
29
+ - Gemini CLI:/agent-infra:code-task {task-id}
30
+ - Codex CLI:$code-task {task-id}
31
+
32
+ [当 env-blocked > 0 时,在最后附加一行:]
33
+ 提醒:env-blocked 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。
34
+ ```
35
+
36
+ ### 场景 B:通过但有问题
37
+
38
+ ```text
39
+ 任务 {task-id} 技术方案审查完成。结论:通过。
40
+ - 阻塞项:0 | 主要问题:{n} | 次要问题:{n}[ | 环境性遗留:{n}(不在 AI 修复范围)]
41
+ - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
42
+
43
+ 下一步 - 修订方案后编码(推荐):
44
+ - Claude Code / OpenCode:/plan-task {task-id}
45
+ - Gemini CLI:/agent-infra:plan-task {task-id}
46
+ - Codex CLI:$plan-task {task-id}
47
+
48
+ 或直接进入编码:
49
+ - Claude Code / OpenCode:/code-task {task-id}
50
+ - Gemini CLI:/agent-infra:code-task {task-id}
51
+ - Codex CLI:$code-task {task-id}
52
+
53
+ [当 env-blocked > 0 时,在最后附加一行:]
54
+ 提醒:env-blocked 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。
55
+ ```
56
+
57
+ ### 场景 C:需要修改
58
+
59
+ ```text
60
+ 任务 {task-id} 技术方案审查完成。结论:需要修改。
61
+ - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n}[ | 环境性遗留:{n}(不在 AI 修复范围)]
62
+ - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
63
+
64
+ 下一步 - 修订技术方案:
65
+ - Claude Code / OpenCode:/plan-task {task-id}
66
+ - Gemini CLI:/agent-infra:plan-task {task-id}
67
+ - Codex CLI:$plan-task {task-id}
68
+
69
+ [当 env-blocked > 0 时,在最后附加一行:]
70
+ 提醒:env-blocked 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。
71
+ ```
72
+
73
+ ### 场景 D:拒绝
74
+
75
+ ```text
76
+ 任务 {task-id} 技术方案审查完成。结论:拒绝,需要重新设计。
77
+ - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n}[ | 环境性遗留:{n}(不在 AI 修复范围)]
78
+ - 审查报告:.agents/workspace/active/{task-id}/{review-artifact}
79
+
80
+ 下一步 - 重新设计:
81
+ - Claude Code / OpenCode:/plan-task {task-id}
82
+ - Gemini CLI:/agent-infra:plan-task {task-id}
83
+ - Codex CLI:$plan-task {task-id}
84
+
85
+ [当 env-blocked > 0 时,在最后附加一行:]
86
+ 提醒:env-blocked 项需在 PR description 的「待人工验证」清单中承接,不应触发 /plan-task。
87
+ ```