@fitlab-ai/agent-infra 0.4.0 → 0.4.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 (276) hide show
  1. package/README.md +23 -15
  2. package/README.zh-CN.md +23 -15
  3. package/lib/defaults.json +5 -9
  4. package/lib/init.js +1 -6
  5. package/lib/update.js +0 -55
  6. package/package.json +1 -1
  7. package/templates/.agents/QUICKSTART.md +17 -7
  8. package/templates/.agents/QUICKSTART.zh-CN.md +23 -13
  9. package/templates/.agents/README.md +33 -27
  10. package/templates/.agents/README.zh-CN.md +35 -29
  11. package/templates/.agents/skills/analyze-task/SKILL.md +1 -4
  12. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +1 -3
  13. package/templates/.agents/skills/block-task/SKILL.md +1 -5
  14. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +1 -4
  15. package/templates/.agents/skills/check-task/SKILL.md +1 -5
  16. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +1 -3
  17. package/templates/.agents/skills/close-codescan/SKILL.md +1 -4
  18. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +1 -3
  19. package/templates/.agents/skills/close-dependabot/SKILL.md +1 -4
  20. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -3
  21. package/templates/.agents/skills/commit/SKILL.md +26 -198
  22. package/templates/.agents/skills/commit/SKILL.zh-CN.md +26 -197
  23. package/templates/.agents/skills/commit/reference/commit-message.md +60 -0
  24. package/templates/.agents/skills/commit/reference/commit-message.zh-CN.md +60 -0
  25. package/templates/.agents/skills/commit/reference/copyright-check.md +39 -0
  26. package/templates/.agents/skills/commit/reference/copyright-check.zh-CN.md +39 -0
  27. package/templates/.agents/skills/commit/reference/task-status-update.md +88 -0
  28. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +88 -0
  29. package/templates/.agents/skills/complete-task/SKILL.md +1 -6
  30. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +1 -4
  31. package/templates/.agents/skills/create-issue/SKILL.md +32 -251
  32. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +33 -252
  33. package/templates/.agents/skills/create-issue/reference/label-and-type.md +77 -0
  34. package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +77 -0
  35. package/templates/.agents/skills/create-issue/reference/template-matching.md +45 -0
  36. package/templates/.agents/skills/create-issue/reference/template-matching.zh-CN.md +45 -0
  37. package/templates/.agents/skills/create-pr/SKILL.md +39 -221
  38. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +39 -220
  39. package/templates/.agents/skills/create-pr/reference/branch-strategy.md +29 -0
  40. package/templates/.agents/skills/create-pr/reference/branch-strategy.zh-CN.md +29 -0
  41. package/templates/.agents/skills/create-pr/reference/pr-body-template.md +86 -0
  42. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +86 -0
  43. package/templates/.agents/skills/create-release-note/SKILL.md +10 -13
  44. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +10 -12
  45. package/templates/.agents/skills/create-task/SKILL.md +2 -5
  46. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +2 -4
  47. package/templates/.agents/skills/implement-task/SKILL.md +47 -176
  48. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +43 -170
  49. package/templates/.agents/skills/implement-task/reference/implementation-rules.md +58 -0
  50. package/templates/.agents/skills/implement-task/reference/implementation-rules.zh-CN.md +58 -0
  51. package/templates/.agents/skills/implement-task/reference/report-template.md +63 -0
  52. package/templates/.agents/skills/implement-task/reference/report-template.zh-CN.md +63 -0
  53. package/templates/.agents/skills/import-codescan/SKILL.md +1 -4
  54. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -3
  55. package/templates/.agents/skills/import-dependabot/SKILL.md +1 -4
  56. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -3
  57. package/templates/.agents/skills/import-issue/SKILL.md +2 -3
  58. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +2 -3
  59. package/templates/.agents/skills/init-labels/SKILL.md +1 -4
  60. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +1 -4
  61. package/templates/.agents/skills/init-milestones/SKILL.md +1 -3
  62. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +1 -3
  63. package/templates/.agents/skills/plan-task/SKILL.md +1 -5
  64. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -3
  65. package/templates/.agents/skills/refine-task/SKILL.md +40 -162
  66. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +38 -158
  67. package/templates/.agents/skills/refine-task/reference/fix-workflow.md +76 -0
  68. package/templates/.agents/skills/refine-task/reference/fix-workflow.zh-CN.md +76 -0
  69. package/templates/.agents/skills/refine-task/reference/report-template.md +38 -0
  70. package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +38 -0
  71. package/templates/.agents/skills/refine-title/SKILL.md +1 -4
  72. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -3
  73. package/templates/.agents/skills/release/SKILL.md +10 -12
  74. package/templates/.agents/skills/release/SKILL.zh-CN.md +10 -11
  75. package/templates/.agents/skills/review-task/SKILL.md +37 -239
  76. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +37 -238
  77. package/templates/.agents/skills/review-task/reference/output-templates.md +72 -0
  78. package/templates/.agents/skills/review-task/reference/output-templates.zh-CN.md +72 -0
  79. package/templates/.agents/skills/review-task/reference/report-template.md +63 -0
  80. package/templates/.agents/skills/review-task/reference/report-template.zh-CN.md +63 -0
  81. package/templates/.agents/skills/review-task/reference/review-criteria.md +24 -0
  82. package/templates/.agents/skills/review-task/reference/review-criteria.zh-CN.md +24 -0
  83. package/templates/.agents/skills/sync-issue/SKILL.md +34 -490
  84. package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +34 -489
  85. package/templates/.agents/skills/sync-issue/reference/comment-publish.md +84 -0
  86. package/templates/.agents/skills/sync-issue/reference/comment-publish.zh-CN.md +84 -0
  87. package/templates/.agents/skills/sync-issue/reference/label-sync.md +62 -0
  88. package/templates/.agents/skills/sync-issue/reference/label-sync.zh-CN.md +62 -0
  89. package/templates/.agents/skills/sync-issue/reference/milestone-sync.md +37 -0
  90. package/templates/.agents/skills/sync-issue/reference/milestone-sync.zh-CN.md +37 -0
  91. package/templates/.agents/skills/sync-pr/SKILL.md +37 -284
  92. package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +41 -288
  93. package/templates/.agents/skills/sync-pr/reference/comment-publish.md +82 -0
  94. package/templates/.agents/skills/sync-pr/reference/comment-publish.zh-CN.md +82 -0
  95. package/templates/.agents/skills/sync-pr/reference/delivery-detection.md +54 -0
  96. package/templates/.agents/skills/sync-pr/reference/delivery-detection.zh-CN.md +54 -0
  97. package/templates/.agents/skills/test/SKILL.md +1 -3
  98. package/templates/.agents/skills/test/SKILL.zh-CN.md +1 -3
  99. package/templates/.agents/skills/test-integration/SKILL.md +1 -4
  100. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +1 -3
  101. package/templates/.agents/skills/update-agent-infra/SKILL.md +2 -6
  102. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -4
  103. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +45 -55
  104. package/templates/.agents/skills/upgrade-dependency/SKILL.md +1 -4
  105. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +1 -3
  106. package/templates/.claude/commands/analyze-task.md +1 -1
  107. package/templates/.claude/commands/analyze-task.zh-CN.md +1 -1
  108. package/templates/.claude/commands/block-task.md +2 -1
  109. package/templates/.claude/commands/block-task.zh-CN.md +2 -1
  110. package/templates/.claude/commands/check-task.md +2 -1
  111. package/templates/.claude/commands/check-task.zh-CN.md +2 -1
  112. package/templates/.claude/commands/close-codescan.md +2 -1
  113. package/templates/.claude/commands/close-codescan.zh-CN.md +2 -1
  114. package/templates/.claude/commands/close-dependabot.md +2 -1
  115. package/templates/.claude/commands/close-dependabot.zh-CN.md +2 -1
  116. package/templates/.claude/commands/commit.md +1 -1
  117. package/templates/.claude/commands/commit.zh-CN.md +1 -1
  118. package/templates/.claude/commands/complete-task.md +1 -1
  119. package/templates/.claude/commands/complete-task.zh-CN.md +1 -1
  120. package/templates/.claude/commands/create-issue.md +1 -1
  121. package/templates/.claude/commands/create-issue.zh-CN.md +1 -1
  122. package/templates/.claude/commands/create-pr.md +2 -2
  123. package/templates/.claude/commands/create-pr.zh-CN.md +2 -2
  124. package/templates/.claude/commands/create-release-note.md +2 -1
  125. package/templates/.claude/commands/create-release-note.zh-CN.md +2 -1
  126. package/templates/.claude/commands/create-task.md +1 -1
  127. package/templates/.claude/commands/create-task.zh-CN.md +1 -1
  128. package/templates/.claude/commands/implement-task.md +1 -1
  129. package/templates/.claude/commands/implement-task.zh-CN.md +1 -1
  130. package/templates/.claude/commands/import-codescan.md +1 -0
  131. package/templates/.claude/commands/import-codescan.zh-CN.md +2 -1
  132. package/templates/.claude/commands/import-dependabot.md +1 -0
  133. package/templates/.claude/commands/import-dependabot.zh-CN.md +2 -1
  134. package/templates/.claude/commands/import-issue.md +1 -1
  135. package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
  136. package/templates/.claude/commands/init-labels.md +1 -0
  137. package/templates/.claude/commands/init-labels.zh-CN.md +2 -1
  138. package/templates/.claude/commands/init-milestones.md +2 -1
  139. package/templates/.claude/commands/init-milestones.zh-CN.md +2 -1
  140. package/templates/.claude/commands/plan-task.md +1 -1
  141. package/templates/.claude/commands/plan-task.zh-CN.md +1 -1
  142. package/templates/.claude/commands/refine-task.zh-CN.md +1 -1
  143. package/templates/.claude/commands/refine-title.md +2 -1
  144. package/templates/.claude/commands/refine-title.zh-CN.md +2 -1
  145. package/templates/.claude/commands/release.md +2 -1
  146. package/templates/.claude/commands/release.zh-CN.md +2 -1
  147. package/templates/.claude/commands/review-task.md +1 -1
  148. package/templates/.claude/commands/review-task.zh-CN.md +1 -1
  149. package/templates/.claude/commands/sync-issue.md +1 -1
  150. package/templates/.claude/commands/sync-issue.zh-CN.md +1 -1
  151. package/templates/.claude/commands/sync-pr.md +2 -2
  152. package/templates/.claude/commands/sync-pr.zh-CN.md +2 -2
  153. package/templates/.claude/commands/test-integration.md +2 -1
  154. package/templates/.claude/commands/test-integration.zh-CN.md +2 -1
  155. package/templates/.claude/commands/test.md +1 -1
  156. package/templates/.claude/commands/test.zh-CN.md +1 -1
  157. package/templates/.claude/commands/update-agent-infra.md +2 -1
  158. package/templates/.claude/commands/update-agent-infra.zh-CN.md +2 -1
  159. package/templates/.claude/commands/upgrade-dependency.md +2 -1
  160. package/templates/.claude/commands/upgrade-dependency.zh-CN.md +2 -1
  161. package/templates/.gemini/commands/_project_/analyze-task.toml +1 -1
  162. package/templates/.gemini/commands/_project_/analyze-task.zh-CN.toml +1 -1
  163. package/templates/.gemini/commands/_project_/block-task.toml +1 -1
  164. package/templates/.gemini/commands/_project_/block-task.zh-CN.toml +1 -1
  165. package/templates/.gemini/commands/_project_/check-task.toml +1 -1
  166. package/templates/.gemini/commands/_project_/check-task.zh-CN.toml +1 -1
  167. package/templates/.gemini/commands/_project_/close-codescan.toml +1 -1
  168. package/templates/.gemini/commands/_project_/close-codescan.zh-CN.toml +1 -1
  169. package/templates/.gemini/commands/_project_/close-dependabot.toml +1 -1
  170. package/templates/.gemini/commands/_project_/close-dependabot.zh-CN.toml +1 -1
  171. package/templates/.gemini/commands/_project_/commit.toml +1 -1
  172. package/templates/.gemini/commands/_project_/commit.zh-CN.toml +1 -1
  173. package/templates/.gemini/commands/_project_/complete-task.toml +1 -1
  174. package/templates/.gemini/commands/_project_/complete-task.zh-CN.toml +1 -1
  175. package/templates/.gemini/commands/_project_/create-issue.zh-CN.toml +1 -1
  176. package/templates/.gemini/commands/_project_/create-pr.toml +1 -1
  177. package/templates/.gemini/commands/_project_/create-pr.zh-CN.toml +1 -1
  178. package/templates/.gemini/commands/_project_/create-release-note.toml +1 -1
  179. package/templates/.gemini/commands/_project_/create-release-note.zh-CN.toml +1 -1
  180. package/templates/.gemini/commands/_project_/create-task.toml +1 -1
  181. package/templates/.gemini/commands/_project_/create-task.zh-CN.toml +1 -1
  182. package/templates/.gemini/commands/_project_/implement-task.toml +1 -1
  183. package/templates/.gemini/commands/_project_/implement-task.zh-CN.toml +1 -1
  184. package/templates/.gemini/commands/_project_/import-codescan.zh-CN.toml +1 -1
  185. package/templates/.gemini/commands/_project_/import-dependabot.zh-CN.toml +1 -1
  186. package/templates/.gemini/commands/_project_/import-issue.toml +1 -1
  187. package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +1 -1
  188. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +1 -1
  189. package/templates/.gemini/commands/_project_/init-milestones.toml +1 -1
  190. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +1 -1
  191. package/templates/.gemini/commands/_project_/plan-task.toml +1 -1
  192. package/templates/.gemini/commands/_project_/plan-task.zh-CN.toml +1 -1
  193. package/templates/.gemini/commands/_project_/refine-task.zh-CN.toml +1 -1
  194. package/templates/.gemini/commands/_project_/refine-title.toml +1 -1
  195. package/templates/.gemini/commands/_project_/refine-title.zh-CN.toml +1 -1
  196. package/templates/.gemini/commands/_project_/release.toml +1 -1
  197. package/templates/.gemini/commands/_project_/release.zh-CN.toml +1 -1
  198. package/templates/.gemini/commands/_project_/review-task.toml +1 -1
  199. package/templates/.gemini/commands/_project_/review-task.zh-CN.toml +1 -1
  200. package/templates/.gemini/commands/_project_/sync-issue.toml +1 -1
  201. package/templates/.gemini/commands/_project_/sync-issue.zh-CN.toml +1 -1
  202. package/templates/.gemini/commands/_project_/sync-pr.toml +2 -2
  203. package/templates/.gemini/commands/_project_/sync-pr.zh-CN.toml +2 -2
  204. package/templates/.gemini/commands/_project_/test-integration.toml +1 -1
  205. package/templates/.gemini/commands/_project_/test-integration.zh-CN.toml +1 -1
  206. package/templates/.gemini/commands/_project_/test.toml +1 -1
  207. package/templates/.gemini/commands/_project_/test.zh-CN.toml +1 -1
  208. package/templates/.gemini/commands/_project_/update-agent-infra.toml +1 -1
  209. package/templates/.gemini/commands/_project_/update-agent-infra.zh-CN.toml +1 -1
  210. package/templates/.gemini/commands/_project_/upgrade-dependency.toml +1 -1
  211. package/templates/.gemini/commands/_project_/upgrade-dependency.zh-CN.toml +1 -1
  212. package/templates/.github/hooks/check-version-format.sh +29 -0
  213. package/templates/.github/hooks/pre-commit +8 -0
  214. package/templates/.opencode/commands/analyze-task.md +1 -1
  215. package/templates/.opencode/commands/analyze-task.zh-CN.md +1 -1
  216. package/templates/.opencode/commands/block-task.md +1 -1
  217. package/templates/.opencode/commands/block-task.zh-CN.md +1 -1
  218. package/templates/.opencode/commands/check-task.md +1 -1
  219. package/templates/.opencode/commands/check-task.zh-CN.md +1 -1
  220. package/templates/.opencode/commands/close-codescan.md +1 -1
  221. package/templates/.opencode/commands/close-codescan.zh-CN.md +1 -1
  222. package/templates/.opencode/commands/close-dependabot.md +1 -1
  223. package/templates/.opencode/commands/close-dependabot.zh-CN.md +1 -1
  224. package/templates/.opencode/commands/commit.md +1 -1
  225. package/templates/.opencode/commands/commit.zh-CN.md +1 -1
  226. package/templates/.opencode/commands/complete-task.md +1 -1
  227. package/templates/.opencode/commands/complete-task.zh-CN.md +1 -1
  228. package/templates/.opencode/commands/create-issue.zh-CN.md +1 -1
  229. package/templates/.opencode/commands/create-pr.md +1 -1
  230. package/templates/.opencode/commands/create-pr.zh-CN.md +1 -1
  231. package/templates/.opencode/commands/create-release-note.md +1 -1
  232. package/templates/.opencode/commands/create-release-note.zh-CN.md +1 -1
  233. package/templates/.opencode/commands/create-task.md +1 -1
  234. package/templates/.opencode/commands/create-task.zh-CN.md +1 -1
  235. package/templates/.opencode/commands/implement-task.md +1 -1
  236. package/templates/.opencode/commands/implement-task.zh-CN.md +1 -1
  237. package/templates/.opencode/commands/import-codescan.zh-CN.md +1 -1
  238. package/templates/.opencode/commands/import-dependabot.zh-CN.md +1 -1
  239. package/templates/.opencode/commands/import-issue.md +1 -1
  240. package/templates/.opencode/commands/import-issue.zh-CN.md +1 -1
  241. package/templates/.opencode/commands/init-labels.zh-CN.md +1 -1
  242. package/templates/.opencode/commands/init-milestones.md +1 -1
  243. package/templates/.opencode/commands/init-milestones.zh-CN.md +1 -1
  244. package/templates/.opencode/commands/plan-task.md +1 -1
  245. package/templates/.opencode/commands/plan-task.zh-CN.md +1 -1
  246. package/templates/.opencode/commands/refine-task.zh-CN.md +1 -1
  247. package/templates/.opencode/commands/refine-title.md +1 -1
  248. package/templates/.opencode/commands/refine-title.zh-CN.md +1 -1
  249. package/templates/.opencode/commands/release.md +1 -1
  250. package/templates/.opencode/commands/release.zh-CN.md +1 -1
  251. package/templates/.opencode/commands/review-task.md +1 -1
  252. package/templates/.opencode/commands/review-task.zh-CN.md +1 -1
  253. package/templates/.opencode/commands/sync-issue.md +1 -1
  254. package/templates/.opencode/commands/sync-issue.zh-CN.md +1 -1
  255. package/templates/.opencode/commands/sync-pr.md +2 -2
  256. package/templates/.opencode/commands/sync-pr.zh-CN.md +2 -2
  257. package/templates/.opencode/commands/test-integration.md +1 -1
  258. package/templates/.opencode/commands/test-integration.zh-CN.md +1 -1
  259. package/templates/.opencode/commands/test.md +1 -1
  260. package/templates/.opencode/commands/test.zh-CN.md +1 -1
  261. package/templates/.opencode/commands/update-agent-infra.md +1 -1
  262. package/templates/.opencode/commands/update-agent-infra.zh-CN.md +1 -1
  263. package/templates/.opencode/commands/upgrade-dependency.md +1 -1
  264. package/templates/.opencode/commands/upgrade-dependency.zh-CN.md +1 -1
  265. package/templates/.claude/CLAUDE.md +0 -176
  266. package/templates/.claude/CLAUDE.zh-CN.md +0 -176
  267. package/templates/.claude/project-rules.md +0 -65
  268. package/templates/.claude/project-rules.zh-CN.md +0 -65
  269. package/templates/.codex/README.md +0 -38
  270. package/templates/.codex/README.zh-CN.md +0 -37
  271. package/templates/.opencode/COMMAND_STYLE_GUIDE.md +0 -232
  272. package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +0 -232
  273. package/templates/.opencode/README.md +0 -76
  274. package/templates/.opencode/README.zh-CN.md +0 -77
  275. package/templates/AGENTS.md +0 -104
  276. package/templates/AGENTS.zh-CN.md +0 -104
@@ -1,94 +1,52 @@
1
1
  ---
2
2
  name: refine-task
3
- description: >
4
- Process code review feedback and fix the issues found in review. Fix items by
5
- priority (Blocker -> Major -> Minor). Only handle issues explicitly marked in
6
- the review; do not add unrelated changes. Triggered when the user asks to fix
7
- review findings. Argument: task-id.
3
+ description: "Handle code review feedback and fix issues"
8
4
  ---
9
5
 
10
- # Refine Review Findings
6
+ # Refine Task
7
+
8
+ Fix review findings and produce `refinement.md` or `refinement-r{N}.md`.
11
9
 
12
10
  ## Boundary / Critical Rules
13
11
 
14
- - Only fix issues that were explicitly identified in review -- do not add unrelated changes or extra "improvements"
15
- - Do NOT auto-commit. Never execute `git commit` or `git add`
16
- - After executing this skill, you **must** immediately update task status in task.md
12
+ - Fix only the issues documented in review artifacts
13
+ - Never auto-run `git add` or `git commit`
14
+ - After executing this skill, you **must** immediately update task.md
17
15
 
18
16
  ## Steps
19
17
 
20
18
  ### 1. Verify Prerequisites
21
19
 
22
- Check required files:
23
- - `.agents/workspace/active/{task-id}/task.md` - Task file
24
- - At least one review artifact: `review.md` or `review-r{N}.md`
25
-
26
- Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, for example `TASK-20260306-143022`
27
-
28
- If `task.md` is missing or there is no review artifact, prompt the user to complete the prerequisite step first.
20
+ Require:
21
+ - `.agents/workspace/active/{task-id}/task.md`
22
+ - at least one review artifact: `review.md` or `review-r{N}.md`
29
23
 
30
- Then perform this discovery and validation:
31
- 1. Scan review artifact files in the task directory (`review.md`, `review-r{N}.md`)
32
- 2. Use the highest-round review artifact as the input for this refinement round and record it as `{review-artifact}`
33
- 3. Scan refinement artifact files (`refinement.md`, `refinement-r{N}.md`) and determine the current refinement artifact:
34
- - If neither `refinement.md` nor `refinement-r*.md` exists -> this is Round 1 and must create `refinement.md`
35
- - If `refinement.md` exists and no `refinement-r*.md` exists -> this is Round 2 and must create `refinement-r2.md`
36
- - If `refinement-r{N}.md` exists -> this is Round N+1 and must create `refinement-r{N+1}.md`
37
- - Record `{refinement-round}` and `{refinement-artifact}`
38
- 4. Scan implementation report files (`implementation.md`, `implementation-r{N}.md`) and use the highest-round artifact as the implementation context `{implementation-artifact}`
39
- - Record `{implementation-artifact}`
40
- 5. **Consistency check**: verify that the most recent Code Review entry in `task.md` `## Activity Log` matches the round number and filename of the latest review artifact found in Step 2
24
+ During prerequisite discovery, record `{review-artifact}`, `{refinement-round}`, `{refinement-artifact}`, and Record `{implementation-artifact}` from the latest implementation report.
41
25
 
42
- If the Activity Log entry does not match the actual file, stop immediately and prompt:
26
+ Also validate the latest Code Review entry in Activity Log. If it points to a missing file, stop with:
43
27
  `Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists.`
44
28
 
45
29
  ### 2. Read Review and Implementation Context
46
30
 
47
- Carefully read the latest review artifact `{review-artifact}` and implementation artifact `{implementation-artifact}` identified in Step 1 to understand:
48
- - All blockers (must fix)
49
- - All major issues (should fix)
50
- - Minor issues (optional improvements)
51
- - Reviewer recommendations and suggestions
52
- - The context of the current implementation and previous refinements
53
-
54
- ### 3. Plan the Fixes
55
-
56
- Classify and prioritize:
57
- 1. **Blockers first**: all blockers must be resolved
58
- 2. **Then major issues**: handle all major issues
59
- 3. **Finally minor issues**: fix if appropriate (optional)
31
+ Read the latest `{review-artifact}` and `{implementation-artifact}` before editing any code.
60
32
 
61
- For each issue, determine:
62
- - Which files need to be modified
63
- - What exact change is required
64
- - How to verify the fix
33
+ ### 3. Plan and Apply the Fixes
65
34
 
66
- ### 4. Execute the Fixes
35
+ Prioritize Blocker -> Major -> Minor and keep changes tightly scoped.
67
36
 
68
- Fix issues in priority order:
37
+ > The detailed fix workflow, repair order, and verification loop live in `reference/fix-workflow.md`. Read `reference/fix-workflow.md` before making changes.
69
38
 
70
- **For each fix**:
71
- 1. Read the affected file
72
- 2. Apply the fix
73
- 3. Verify that the change resolves the review finding
74
- 4. Run relevant tests
39
+ ### 4. Run Test Verification
75
40
 
76
- **Refinement principles**:
77
- - Only fix marked review issues -- do not add unrelated changes
78
- - Do not add extra "improvements" beyond the scope of the review
79
- - Keep the changes minimal and focused
41
+ Run the project test command after the fixes and keep the repair cycle focused on the documented findings.
80
42
 
81
- ### 5. Run Test Verification
82
-
83
- Execute the project's test command. Reference the `test` skill for the project-specific test command.
84
-
85
- Ensure all tests still pass after the fixes.
86
-
87
- ### 6. Create Refinement Report
43
+ ### 5. Write the Refinement Report
88
44
 
89
45
  Create `.agents/workspace/active/{task-id}/{refinement-artifact}`.
90
46
 
91
- ### 7. Update Task Status
47
+ > The report structure and example sections live in `reference/report-template.md`. Read `reference/report-template.md` before writing the report.
48
+
49
+ ### 6. Update Task Status
92
50
 
93
51
  Get the current time:
94
52
 
@@ -96,115 +54,35 @@ Get the current time:
96
54
  date "+%Y-%m-%d %H:%M:%S"
97
55
  ```
98
56
 
99
- Update `.agents/workspace/active/{task-id}/task.md`:
100
- - `current_step`: refinement
101
- - `assigned_to`: {current AI agent}
102
- - `updated_at`: {current time}
103
- - Record the refinement artifact for this round: `{refinement-artifact}` (Round `{refinement-round}`)
104
- - **Append** to `## Activity Log` (do NOT overwrite previous entries):
105
- ```
106
- - {yyyy-MM-dd HH:mm:ss} — **Refinement (Round {N}, for {review-artifact})** by {agent} — Fixed {n} blockers, {n} major, {n} minor issues → {refinement-artifact}
107
- ```
108
-
109
- ### 8. Inform User
110
-
111
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
112
-
113
- > **⚠️ CONDITION CHECK — before showing the two next steps below, you must judge the result of this refinement round first:**
114
- >
115
- > - If this round fixed any `Blocker` or `Major` issue, or the changes touched core logic or test scope broadly, **default recommendation** is "Run review again"
116
- > - If this round fixed only `Minor` issues and the change scope is small and low-risk, "Commit directly" may be offered as an option
117
- > - If any `Blocker` or `Major` issue remains unresolved, **do not** imply that direct commit is acceptable; explicitly tell the user to continue fixing or re-run review
118
- >
119
- > **Do not present "Commit directly" as the default path unless you are sure no high-risk issue remains.**
120
-
121
- Output format:
122
- ```
123
- Refinement complete for task {task-id}.
124
-
125
- Fix summary:
126
- - Blockers fixed: {count}/{total}
127
- - Major issues fixed: {count}/{total}
128
- - Minor issues fixed: {count}/{total}
129
- - All tests passing: {yes/no}
130
- - Review input: {review-artifact}
131
- - Refinement artifact: {refinement-artifact}
132
-
133
- Next step - re-review or commit:
134
- - Run review again (default recommendation; prioritize this after Blocker/Major fixes):
135
- - Claude Code / OpenCode: /review-task {task-id}
136
- - Gemini CLI: /{{project}}:review-task {task-id}
137
- - Codex CLI: $review-task {task-id}
138
- - Commit directly (only when only Minor issues were fixed and risk is low):
139
- - Claude Code / OpenCode: /commit
140
- - Gemini CLI: /{{project}}:commit
141
- - Codex CLI: $commit
142
- ```
143
-
144
- ## Output Template
145
-
146
- ```markdown
147
- # Refinement Report
148
-
149
- - **Refinement round**: Round {refinement-round}
150
- - **Artifact file**: `{refinement-artifact}`
151
- - **Review input**: `{review-artifact}`
152
- - **Implementation context**: `{implementation-artifact}`
153
-
154
- ### Review Feedback Handling
57
+ Update task.md:
58
+ - review the `## Requirements` section and only change items from `- [ ]` to `- [x]` when they are newly satisfied by this round's fixes and passing tests
59
+ - append:
60
+ `- {yyyy-MM-dd HH:mm:ss} — **Refinement (Round {N}, for {review-artifact})** by {agent} — Fixed {n} blockers, {n} major, {n} minor issues → {refinement-artifact}`
155
61
 
156
- #### Blocker Fixes
157
- 1. **{Issue title}** (from {review-artifact})
158
- - **Fix**: {What changed}
159
- - **File**: `{file-path}:{line-number}`
160
- - **Validation**: {How it was verified}
62
+ ### 7. Inform User
161
63
 
162
- #### Major Issue Fixes
163
- 1. **{Issue title}** (from {review-artifact})
164
- - **Fix**: {What changed}
165
- - **File**: `{file-path}:{line-number}`
166
-
167
- #### Minor Issue Handling
168
- 1. **{Issue title}** (from {review-artifact})
169
- - **Fix**: {What changed}
170
-
171
- #### Unresolved Issues
172
- - {Issue}: {Reason it was not handled, for example disagreement with the review suggestion}
173
-
174
- ### Test Results After Refinement
175
- - All tests passing: {yes/no}
176
- - Test output: {Summary}
177
- ```
64
+ Recommend re-review by default when Blocker or Major issues were fixed. Only present direct commit as a low-risk option when the changes are truly minor.
178
65
 
179
66
  ## Completion Checklist
180
67
 
181
- - [ ] Read and understood all review findings
182
- - [ ] Fixed all blockers
183
- - [ ] Fixed all major issues
184
- - [ ] Addressed minor issues when appropriate
185
- - [ ] All tests pass after the fixes
186
- - [ ] Created refinement report `{refinement-artifact}`
187
- - [ ] Updated task status in task.md
188
- - [ ] Appended an Activity Log entry to task.md
189
- - [ ] Informed the user of the next step (must include all TUI command formats without filtering)
68
+ - [ ] Read the latest review and implementation context
69
+ - [ ] Fixed all required Blocker and Major findings
70
+ - [ ] Wrote `{refinement-artifact}`
71
+ - [ ] Updated task.md and appended the Activity Log entry
72
+ - [ ] Recommended the correct next step based on residual risk
190
73
 
191
74
  ## Notes
192
75
 
193
- 1. **Prerequisite**: A review report must exist (`review.md` or `review-r{N}.md`)
194
- 2. **No auto-commit**: Do NOT execute `git commit`. Remind the user to commit manually
195
- 3. **Scope discipline**: Only fix issues marked in review -- do not add extra changes
196
- 4. **Disagreement**: If you disagree with a review finding, record your reasoning in "Unresolved Issues"
197
- 5. **Re-review**: After fixing blockers, re-run `review-task` to validate the result
198
- 6. **Consistency requirement**: The latest review artifact, Activity Log entry, and refinement report title must all reference the same review round
199
- 7. **Versioning rule**: First refinement uses `refinement.md`; later rounds use `refinement-r{N}.md`
76
+ - Round 1 uses `refinement.md`; later rounds use `refinement-r{N}.md`
77
+ - Record any disagreement with a review comment under unresolved issues in the report
78
+ - Do not expand scope beyond the review findings
200
79
 
201
80
  ## STOP
202
81
 
203
- After completing the checklist, **stop immediately**. Wait for the user to review the fixes and decide whether to run review again or commit.
82
+ Stop after the checklist is complete.
204
83
 
205
84
  ## Error Handling
206
85
 
207
- - Task not found: Prompt "Task {task-id} not found"
208
- - Missing review report: Prompt "Review report not found, please run the review-task skill first"
209
- - Review artifact mismatch: Prompt "Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists."
210
- - Test failure after fixes: Output the test errors and ask the user how to proceed
86
+ - Task not found: `Task {task-id} not found`
87
+ - Missing review report: `Review report not found, please run the review-task skill first`
88
+ - Review artifact mismatch: `Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists.`
@@ -1,92 +1,52 @@
1
1
  ---
2
2
  name: refine-task
3
- description: >
4
- 处理代码审查反馈并修复审查中发现的问题。按优先级(Blocker -> Major -> Minor)修复。
5
- 仅处理审查中标记的问题,不添加额外变更。当用户要求修复审查问题时触发。参数:task-id。
3
+ description: "处理代码审查反馈并修复问题"
6
4
  ---
7
5
 
8
6
  # 修复审查问题
9
7
 
8
+ 修复审查发现的问题,并产出 `refinement.md` 或 `refinement-r{N}.md`。
9
+
10
10
  ## 行为边界 / 关键规则
11
11
 
12
- - 仅修复审查中标记的问题 —— 不要添加无关变更或额外的"改进"
13
- - 不要自动提交。绝不自动执行 `git commit` 或 `git add`
14
- - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
12
+ - 只修复审查产物中记录的问题
13
+ - 绝不自动执行 `git add` 或 `git commit`
14
+ - 执行本技能后,你**必须**立即更新 task.md
15
15
 
16
16
  ## 执行步骤
17
17
 
18
18
  ### 1. 验证前置条件
19
19
 
20
- 检查必要文件:
21
- - `.agents/workspace/active/{task-id}/task.md` - 任务文件
20
+ 要求存在:
21
+ - `.agents/workspace/active/{task-id}/task.md`
22
22
  - 至少一个审查产物:`review.md` 或 `review-r{N}.md`
23
23
 
24
- 注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
25
-
26
- 如果缺少 `task.md` 或没有任何审查产物,提示用户先完成前置步骤。
27
-
28
- 随后执行以下发现与校验:
29
- 1. 扫描任务目录中的审查产物文件(`review.md`、`review-r{N}.md`)
30
- 2. 取最高轮次的审查产物作为本次修复输入,记为 `{review-artifact}`
31
- 3. 扫描修复产物文件(`refinement.md`、`refinement-r{N}.md`)并确定本轮修复产物:
32
- - 如果不存在 `refinement.md` 且不存在 `refinement-r*.md` → 本轮为第 1 轮,产出 `refinement.md`
33
- - 如果存在 `refinement.md` 且不存在 `refinement-r*.md` → 本轮为第 2 轮,产出 `refinement-r2.md`
34
- - 如果存在 `refinement-r{N}.md` → 本轮为第 N+1 轮,产出 `refinement-r{N+1}.md`
35
- - 记录 `{refinement-round}` 和 `{refinement-artifact}`
36
- 4. 扫描实现报告文件(`implementation.md`、`implementation-r{N}.md`),取最高轮次作为修复上下文的 `{implementation-artifact}`
37
- - 记录 `{implementation-artifact}`
38
- 5. **一致性校验**:检查 `task.md` 的 `## 活动日志` 中最近一条 Code Review 记录的轮次号和文件名,是否与步骤 2 扫描到的最新审查产物匹配
24
+ 在前置检查阶段必须记录 `{review-artifact}`、`{refinement-round}`、`{refinement-artifact}`,并从最新实现报告中记录 `{implementation-artifact}`。
39
25
 
40
- Activity Log 记录与实际文件不匹配,立即停止并提示:
26
+ 同时校验 Activity Log 中最近一条 Code Review 记录;如果引用了不存在的文件,立即停止并输出:
41
27
  `Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists.`
42
28
 
43
29
  ### 2. 阅读审查与实现上下文
44
30
 
45
- 仔细阅读步骤 1 中确定的最新审查产物 `{review-artifact}` 和实现产物 `{implementation-artifact}` 以理解:
46
- - 所有阻塞项(必须修复)
47
- - 所有主要问题(应该修复)
48
- - 次要问题(可选优化)
49
- - 审查者的建议和推荐
50
- - 当前实现和之前修复的上下文
51
-
52
- ### 3. 规划修复
53
-
54
- 分类并确定优先级:
55
- 1. **阻塞项优先**:必须解决所有阻塞项
56
- 2. **然后是主要问题**:处理所有主要问题
57
- 3. **最后是次要问题**:如有时间则处理(可选)
31
+ 在修改代码前先读取最新的 `{review-artifact}` `{implementation-artifact}`。
58
32
 
59
- 对于每个问题,确定:
60
- - 需要修改哪些文件
61
- - 具体要做哪些修改
62
- - 如何验证修复
33
+ ### 3. 规划并执行修复
63
34
 
64
- ### 4. 执行代码修复
35
+ Blocker -> Major -> Minor 的顺序处理,始终保持改动聚焦。
65
36
 
66
- 按优先级顺序修复问题:
37
+ > 详细修复流程、优先级和验证循环见 `reference/fix-workflow.md`。执行此步骤前先读取 `reference/fix-workflow.md`。
67
38
 
68
- **对于每个修复**:
69
- 1. 读取受影响的文件
70
- 2. 应用修复
71
- 3. 验证修复是否解决了审查意见
72
- 4. 运行相关测试
39
+ ### 4. 运行测试验证
73
40
 
74
- **修复原则**:
75
- - 仅修复标记的问题 —— 不要添加无关变更
76
- - 不要添加超出要求的额外"改进"
77
- - 保持变更最小化和聚焦
41
+ 修复后运行项目测试命令,并把修复范围限制在审查结论内。
78
42
 
79
- ### 5. 运行测试验证
80
-
81
- 执行项目的测试命令。参考 `test` 技能获取项目特定的测试命令。
82
-
83
- 确保修复后所有测试仍然通过。
84
-
85
- ### 6. 创建修复报告
43
+ ### 5. 编写修复报告
86
44
 
87
45
  创建 `.agents/workspace/active/{task-id}/{refinement-artifact}`。
88
46
 
89
- ### 7. 更新任务状态
47
+ > 报告结构和示例章节见 `reference/report-template.md`。写报告前先读取 `reference/report-template.md`。
48
+
49
+ ### 6. 更新任务状态
90
50
 
91
51
  获取当前时间:
92
52
 
@@ -94,115 +54,35 @@ description: >
94
54
  date "+%Y-%m-%d %H:%M:%S"
95
55
  ```
96
56
 
97
- 更新 `.agents/workspace/active/{task-id}/task.md`:
98
- - `current_step`:refinement
99
- - `assigned_to`:{当前 AI 代理}
100
- - `updated_at`:{当前时间}
101
- - 记录本轮修复产物:`{refinement-artifact}`(Round `{refinement-round}`)
102
- - **追加**到 `## Activity Log`(不要覆盖之前的记录):
103
- ```
104
- - {yyyy-MM-dd HH:mm:ss} — **Refinement (Round {N}, for {review-artifact})** by {agent} — Fixed {n} blockers, {n} major, {n} minor issues → {refinement-artifact}
105
- ```
106
-
107
- ### 8. 告知用户
108
-
109
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
110
-
111
- > **⚠️ 条件判断 — 在展示下面两个下一步之前,你必须先判断修复结果:**
112
- >
113
- > - 如果本轮修复了任何 `Blocker` 或 `Major` 问题,或改动影响核心逻辑/测试范围较广,**默认推荐**先执行「重新审查」
114
- > - 如果仅修复 `Minor` 问题,且变更范围很小、风险可控,才可以把「直接提交」作为可选项
115
- > - 如果仍有未修复的 `Blocker` 或 `Major`,**不要**暗示可以直接提交;应明确提示继续修复或重新审查
116
- >
117
- > **禁止把「直接提交」写成默认路径,除非你确认没有剩余高风险问题。**
118
-
119
- 输出格式:
120
- ```
121
- 任务 {task-id} 修复完成。
122
-
123
- 修复情况:
124
- - 阻塞项修复:{数量}/{总数}
125
- - 主要问题修复:{数量}/{总数}
126
- - 次要问题修复:{数量}/{总数}
127
- - 所有测试通过:{是/否}
128
- - 审查输入:{review-artifact}
129
- - 修复产物:{refinement-artifact}
130
-
131
- 下一步 - 重新审查或提交:
132
- - 重新审查(默认推荐;修复了 Blocker/Major 时优先):
133
- - Claude Code / OpenCode:/review-task {task-id}
134
- - Gemini CLI:/agent-infra:review-task {task-id}
135
- - Codex CLI:$review-task {task-id}
136
- - 直接提交(仅限只修复 Minor 且风险可控):
137
- - Claude Code / OpenCode:/commit
138
- - Gemini CLI:/agent-infra:commit
139
- - Codex CLI:$commit
140
- ```
141
-
142
- ## 输出模板
143
-
144
- ```markdown
145
- # 修复报告
146
-
147
- - **修复轮次**:Round {refinement-round}
148
- - **产物文件**:`{refinement-artifact}`
149
- - **审查输入**:`{review-artifact}`
150
- - **实现上下文**:`{implementation-artifact}`
151
-
152
- ### 审查反馈处理
57
+ 更新 task.md
58
+ - 审查 `## 需求` 段落,仅把因本轮修复而新满足且有测试通过支撑的条目从 `- [ ]` 勾为 `- [x]`
59
+ - 追加:
60
+ `- {yyyy-MM-dd HH:mm:ss} — **Refinement (Round {N}, for {review-artifact})** by {agent} — Fixed {n} blockers, {n} major, {n} minor issues → {refinement-artifact}`
153
61
 
154
- #### 阻塞项修复
155
- 1. **{问题标题}**(来自 {review-artifact})
156
- - **修复**:{做了什么修改}
157
- - **文件**:`{file-path}:{line-number}`
158
- - **验证**:{如何验证}
62
+ ### 7. 告知用户
159
63
 
160
- #### 主要问题修复
161
- 1. **{问题标题}**(来自 {review-artifact})
162
- - **修复**:{做了什么修改}
163
- - **文件**:`{file-path}:{line-number}`
164
-
165
- #### 次要问题处理
166
- 1. **{问题标题}**(来自 {review-artifact})
167
- - **修复**:{做了什么修改}
168
-
169
- #### 未处理的问题
170
- - {问题}:{未处理的原因,例如不同意审查建议}
171
-
172
- ### 修复后的测试结果
173
- - 所有测试通过:{是/否}
174
- - 测试输出:{摘要}
175
- ```
64
+ 如果本轮修复了 Blocker 或 Major,默认推荐重新审查。只有在风险确实很低且只修复 Minor 时,才可把直接提交作为备选项。
176
65
 
177
66
  ## 完成检查清单
178
67
 
179
- - [ ] 阅读并理解了所有审查发现
180
- - [ ] 修复了所有阻塞项
181
- - [ ] 修复了所有主要问题
182
- - [ ] 在适当情况下处理了次要问题
183
- - [ ] 修复后所有测试通过
184
- - [ ] 创建了 `{refinement-artifact}` 修复报告
185
- - [ ] 更新了 task.md 中的任务状态
186
- - [ ] 追加了 Activity Log 条目到 task.md
187
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
68
+ - [ ] 已读取最新审查与实现上下文
69
+ - [ ] 已修复所有必需的 Blocker 和 Major 问题
70
+ - [ ] 已写出 `{refinement-artifact}`
71
+ - [ ] 已更新 task.md 并追加 Activity Log
72
+ - [ ] 已根据剩余风险推荐正确的下一步
188
73
 
189
74
  ## 注意事项
190
75
 
191
- 1. **前置条件**:必须有审查报告(`review.md` `review-r{N}.md` 存在)
192
- 2. **禁止自动提交**:不要自动执行 `git commit`。提醒用户手动提交
193
- 3. **范围纪律**:仅修复审查中标记的问题 —— 不添加额外变更
194
- 4. **不同意见**:如果不同意某个审查意见,在"未处理的问题"部分记录你的理由
195
- 5. **重新审查**:修复阻塞项后,建议重新运行 review-task 技能进行验证
196
- 6. **一致性要求**:最新审查产物、Activity Log 记录和修复报告标题必须引用同一轮次文件
197
- 7. **版本化规则**:首轮修复使用 `refinement.md`;后续轮次使用 `refinement-r{N}.md`
76
+ - 首轮修复使用 `refinement.md`,后续轮次使用 `refinement-r{N}.md`
77
+ - 若不同意审查意见,要在报告的未解决问题中记录理由
78
+ - 不要把范围扩展到审查项之外
198
79
 
199
80
  ## 停止
200
81
 
201
- 完成检查清单后,**立即停止**。等待用户审查修复结果并决定重新审查还是提交。
82
+ 完成检查清单后立即停止。
202
83
 
203
84
  ## 错误处理
204
85
 
205
- - 任务未找到:提示 "Task {task-id} not found"
206
- - 缺少审查报告:提示 "Review report not found, please run the review-task skill first"
207
- - 审查产物不一致:提示 "Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists."
208
- - 修复后测试失败:输出测试错误,询问用户如何处理
86
+ - 任务未找到:`Task {task-id} not found`
87
+ - 缺少审查报告:`Review report not found, please run the review-task skill first`
88
+ - 审查产物不一致:`Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists.`
@@ -0,0 +1,76 @@
1
+ # Fix Workflow
2
+
3
+ Read this file before changing code during refinement.
4
+
5
+ ## Plan the Fixes
6
+
7
+ Classify and prioritize work:
8
+ 1. **Blockers first**
9
+ 2. **Then major issues**
10
+ 3. **Finally minor issues**
11
+
12
+ For each finding, determine:
13
+ - which files must change
14
+ - what specific fix is required
15
+ - how the fix will be verified
16
+
17
+ Detailed priority rules:
18
+ - Blockers must all be fixed before anything else
19
+ - Major issues should all be fixed in the same pass unless a blocker prevents progress
20
+ - Minor issues are optional only after Blockers and Majors are resolved
21
+ - If you disagree with a finding, record that disagreement under unresolved issues instead of silently skipping it
22
+
23
+ ## Execute the Fixes
24
+
25
+ For each fix:
26
+ 1. read the affected files
27
+ 2. apply the smallest necessary change
28
+ 3. verify the change addresses the review feedback
29
+ 4. run the relevant tests
30
+
31
+ ## Run Test Verification
32
+
33
+ Run the project test command from the `test` skill and confirm that all required tests still pass.
34
+
35
+ ## Choose the Next-Step Branch
36
+
37
+ Decision rules:
38
+ 1. if this round fixed any `Blocker` or `Major`, recommend re-review by default
39
+ 2. only when this round fixed Minor issues only and the change is clearly low risk may direct commit be offered as an option
40
+ 3. if any `Blocker` or `Major` remains unresolved, do not suggest direct commit
41
+
42
+ Prohibition:
43
+ - never present direct commit as the only next step unless no high-risk issue remains
44
+
45
+ Required output template:
46
+
47
+ ```text
48
+ Task {task-id} refinement completed.
49
+
50
+ Refinement status:
51
+ - Blockers fixed: {fixed-blockers}/{total-blockers}
52
+ - Major issues fixed: {fixed-majors}/{total-majors}
53
+ - Minor issues fixed: {fixed-minors}/{total-minors}
54
+ - All tests passing: {yes/no}
55
+ - Review input: {review-artifact}
56
+ - Refinement artifact: {refinement-artifact}
57
+
58
+ Next step - re-review or commit:
59
+ - Re-review (recommended by default when Blocker/Major issues were fixed):
60
+ - Claude Code / OpenCode: /review-task {task-id}
61
+ - Gemini CLI: /agent-infra:review-task {task-id}
62
+ - Codex CLI: $review-task {task-id}
63
+ - Commit directly (Minor-only, low-risk changes only):
64
+ - Claude Code / OpenCode: /commit
65
+ - Gemini CLI: /agent-infra:commit
66
+ - Codex CLI: $commit
67
+ ```
68
+
69
+ ## Notes
70
+
71
+ 1. **Prerequisite**: a review artifact must exist (`review.md` or `review-r{N}.md`)
72
+ 2. **No auto-commit**: do not run `git commit`
73
+ 3. **Scope discipline**: only fix reviewed issues
74
+ 4. **Disagreement handling**: record any disagreement in the report
75
+ 5. **Re-review**: after fixing Blockers or Major issues, recommend `review-task`
76
+ 6. **Consistency**: the latest review artifact, Activity Log entry, and refinement report must reference the same round
@@ -0,0 +1,76 @@
1
+ # 修复工作流
2
+
3
+ 在修复阶段修改代码之前先读取本文件。
4
+
5
+ ## 规划修复
6
+
7
+ 按以下顺序分类并确定优先级:
8
+ 1. **先处理 Blocker**
9
+ 2. **再处理 Major**
10
+ 3. **最后处理 Minor**
11
+
12
+ 对每一个问题,都要明确:
13
+ - 哪些文件必须修改
14
+ - 具体需要怎样修复
15
+ - 如何验证修复已经生效
16
+
17
+ 详细优先级规则:
18
+ - 所有 Blocker 都必须最先修完
19
+ - 只要没有被 Blocker 阻塞,所有 Major 都应在同一轮一并修复
20
+ - 只有在 Blocker 和 Major 都解决后,Minor 才是可选项
21
+ - 如果你不同意某条审查意见,不要静默跳过,而是把分歧记录到 unresolved issues
22
+
23
+ ## 执行修复
24
+
25
+ 对每一项修复:
26
+ 1. 读取受影响文件
27
+ 2. 施加最小必要改动
28
+ 3. 验证改动确实解决了审查反馈
29
+ 4. 运行相关测试
30
+
31
+ ## 运行测试验证
32
+
33
+ 运行项目测试命令。项目测试命令以 `test` skill 为准,并确认所有必需测试仍然通过。
34
+
35
+ ## 选择下一步分支
36
+
37
+ 判断规则:
38
+ 1. 如果本轮修复了任何 `Blocker` 或 `Major`,默认推荐重新审查
39
+ 2. 只有当本轮只修复了 Minor,且改动明显低风险时,才可以把直接提交作为一个可选项
40
+ 3. 如果仍有任何 `Blocker` 或 `Major` 未解决,就不要建议直接提交
41
+
42
+ 禁止规则:
43
+ - 只要还存在高风险问题,绝对不要把直接提交写成唯一下一步
44
+
45
+ 必用输出模板:
46
+
47
+ ```text
48
+ 任务 {task-id} 修复完成。
49
+
50
+ 修复情况:
51
+ - 阻塞项修复:{数量}/{总数}
52
+ - 主要问题修复:{数量}/{总数}
53
+ - 次要问题修复:{数量}/{总数}
54
+ - 所有测试通过:{是/否}
55
+ - 审查输入:{review-artifact}
56
+ - 修复产物:{refinement-artifact}
57
+
58
+ 下一步 - 重新审查或提交:
59
+ - 重新审查(默认推荐;修复了 Blocker/Major 时优先):
60
+ - Claude Code / OpenCode:/review-task {task-id}
61
+ - Gemini CLI:/agent-infra:review-task {task-id}
62
+ - Codex CLI:$review-task {task-id}
63
+ - 直接提交(仅限只修复 Minor 且风险可控):
64
+ - Claude Code / OpenCode:/commit
65
+ - Gemini CLI:/agent-infra:commit
66
+ - Codex CLI:$commit
67
+ ```
68
+
69
+ ## 注意事项
70
+
71
+ 1. **前置条件**:必须存在审查产物(`review.md` 或 `review-r{N}.md`)
72
+ 2. **禁止自动提交**:不要执行 `git commit`
73
+ 3. **范围约束**:只修复审查中列出的问题
74
+ 4. **分歧处理**:如果不同意审查意见,要在报告里明确记录
75
+ 5. **重新审查**:修复了 Blocker 或 Major 后,推荐执行 `review-task`
76
+ 6. **一致性**:最新审查产物、Activity Log 记录和修复报告必须引用同一轮次