@fitlab-ai/agent-infra 0.3.0

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 (285) hide show
  1. package/License.txt +21 -0
  2. package/README.md +170 -0
  3. package/README.zh-CN.md +170 -0
  4. package/bin/cli.js +65 -0
  5. package/lib/defaults.json +45 -0
  6. package/lib/init.js +203 -0
  7. package/lib/log.js +27 -0
  8. package/lib/paths.js +48 -0
  9. package/lib/prompt.js +70 -0
  10. package/lib/render.js +99 -0
  11. package/lib/update.js +161 -0
  12. package/lib/version.js +7 -0
  13. package/package.json +48 -0
  14. package/templates/.agent-workspace/README.md +26 -0
  15. package/templates/.agent-workspace/README.zh-CN.md +26 -0
  16. package/templates/.agents/QUICKSTART.md +166 -0
  17. package/templates/.agents/QUICKSTART.zh-CN.md +166 -0
  18. package/templates/.agents/README.md +134 -0
  19. package/templates/.agents/README.zh-CN.md +134 -0
  20. package/templates/.agents/skills/analyze-task/SKILL.md +169 -0
  21. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +169 -0
  22. package/templates/.agents/skills/block-task/SKILL.md +164 -0
  23. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +163 -0
  24. package/templates/.agents/skills/check-task/SKILL.md +122 -0
  25. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +122 -0
  26. package/templates/.agents/skills/close-codescan/SKILL.md +122 -0
  27. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +122 -0
  28. package/templates/.agents/skills/close-dependabot/SKILL.md +130 -0
  29. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +130 -0
  30. package/templates/.agents/skills/commit/SKILL.md +218 -0
  31. package/templates/.agents/skills/commit/SKILL.zh-CN.md +217 -0
  32. package/templates/.agents/skills/complete-task/SKILL.md +139 -0
  33. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +137 -0
  34. package/templates/.agents/skills/create-pr/SKILL.md +126 -0
  35. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +125 -0
  36. package/templates/.agents/skills/create-release-note/SKILL.md +167 -0
  37. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +166 -0
  38. package/templates/.agents/skills/create-task/SKILL.md +143 -0
  39. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +143 -0
  40. package/templates/.agents/skills/implement-task/SKILL.md +229 -0
  41. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +227 -0
  42. package/templates/.agents/skills/import-codescan/SKILL.md +103 -0
  43. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +103 -0
  44. package/templates/.agents/skills/import-dependabot/SKILL.md +107 -0
  45. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +107 -0
  46. package/templates/.agents/skills/import-issue/SKILL.md +119 -0
  47. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +119 -0
  48. package/templates/.agents/skills/init-labels/SKILL.md +74 -0
  49. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +74 -0
  50. package/templates/.agents/skills/init-labels/scripts/init-labels.sh +111 -0
  51. package/templates/.agents/skills/init-milestones/SKILL.md +74 -0
  52. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +74 -0
  53. package/templates/.agents/skills/init-milestones/scripts/init-milestones.sh +169 -0
  54. package/templates/.agents/skills/plan-task/SKILL.md +225 -0
  55. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +225 -0
  56. package/templates/.agents/skills/refine-task/SKILL.md +200 -0
  57. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +200 -0
  58. package/templates/.agents/skills/refine-title/SKILL.md +84 -0
  59. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +83 -0
  60. package/templates/.agents/skills/release/SKILL.md +142 -0
  61. package/templates/.agents/skills/release/SKILL.zh-CN.md +141 -0
  62. package/templates/.agents/skills/release/scripts/manage-milestones.sh +80 -0
  63. package/templates/.agents/skills/review-task/SKILL.md +276 -0
  64. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +276 -0
  65. package/templates/.agents/skills/sync-issue/SKILL.md +569 -0
  66. package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +569 -0
  67. package/templates/.agents/skills/sync-pr/SKILL.md +142 -0
  68. package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +142 -0
  69. package/templates/.agents/skills/test/SKILL.md +61 -0
  70. package/templates/.agents/skills/test/SKILL.zh-CN.md +61 -0
  71. package/templates/.agents/skills/test-integration/SKILL.md +70 -0
  72. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +69 -0
  73. package/templates/.agents/skills/update-agent-infra/SKILL.md +136 -0
  74. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +124 -0
  75. package/templates/.agents/skills/update-agent-infra/scripts/package.json +3 -0
  76. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +469 -0
  77. package/templates/.agents/skills/upgrade-dependency/SKILL.md +88 -0
  78. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +87 -0
  79. package/templates/.agents/templates/handoff.md +60 -0
  80. package/templates/.agents/templates/handoff.zh-CN.md +60 -0
  81. package/templates/.agents/templates/review-report.md +67 -0
  82. package/templates/.agents/templates/review-report.zh-CN.md +67 -0
  83. package/templates/.agents/templates/task.md +65 -0
  84. package/templates/.agents/templates/task.zh-CN.md +65 -0
  85. package/templates/.agents/workflows/bug-fix.yaml +149 -0
  86. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +149 -0
  87. package/templates/.agents/workflows/code-review.yaml +60 -0
  88. package/templates/.agents/workflows/code-review.zh-CN.yaml +60 -0
  89. package/templates/.agents/workflows/feature-development.yaml +150 -0
  90. package/templates/.agents/workflows/feature-development.zh-CN.yaml +150 -0
  91. package/templates/.agents/workflows/refactoring.yaml +154 -0
  92. package/templates/.agents/workflows/refactoring.zh-CN.yaml +154 -0
  93. package/templates/.claude/CLAUDE.md +163 -0
  94. package/templates/.claude/CLAUDE.zh-CN.md +163 -0
  95. package/templates/.claude/commands/analyze-task.md +8 -0
  96. package/templates/.claude/commands/analyze-task.zh-CN.md +8 -0
  97. package/templates/.claude/commands/block-task.md +8 -0
  98. package/templates/.claude/commands/block-task.zh-CN.md +8 -0
  99. package/templates/.claude/commands/check-task.md +8 -0
  100. package/templates/.claude/commands/check-task.zh-CN.md +8 -0
  101. package/templates/.claude/commands/close-codescan.md +8 -0
  102. package/templates/.claude/commands/close-codescan.zh-CN.md +8 -0
  103. package/templates/.claude/commands/close-dependabot.md +8 -0
  104. package/templates/.claude/commands/close-dependabot.zh-CN.md +8 -0
  105. package/templates/.claude/commands/commit.md +7 -0
  106. package/templates/.claude/commands/commit.zh-CN.md +7 -0
  107. package/templates/.claude/commands/complete-task.md +8 -0
  108. package/templates/.claude/commands/complete-task.zh-CN.md +8 -0
  109. package/templates/.claude/commands/create-pr.md +8 -0
  110. package/templates/.claude/commands/create-pr.zh-CN.md +8 -0
  111. package/templates/.claude/commands/create-release-note.md +8 -0
  112. package/templates/.claude/commands/create-release-note.zh-CN.md +8 -0
  113. package/templates/.claude/commands/create-task.md +8 -0
  114. package/templates/.claude/commands/create-task.zh-CN.md +8 -0
  115. package/templates/.claude/commands/implement-task.md +8 -0
  116. package/templates/.claude/commands/implement-task.zh-CN.md +8 -0
  117. package/templates/.claude/commands/import-codescan.md +8 -0
  118. package/templates/.claude/commands/import-codescan.zh-CN.md +8 -0
  119. package/templates/.claude/commands/import-dependabot.md +8 -0
  120. package/templates/.claude/commands/import-dependabot.zh-CN.md +8 -0
  121. package/templates/.claude/commands/import-issue.md +8 -0
  122. package/templates/.claude/commands/import-issue.zh-CN.md +8 -0
  123. package/templates/.claude/commands/init-labels.md +7 -0
  124. package/templates/.claude/commands/init-labels.zh-CN.md +7 -0
  125. package/templates/.claude/commands/init-milestones.md +8 -0
  126. package/templates/.claude/commands/init-milestones.zh-CN.md +8 -0
  127. package/templates/.claude/commands/plan-task.md +8 -0
  128. package/templates/.claude/commands/plan-task.zh-CN.md +8 -0
  129. package/templates/.claude/commands/refine-task.md +8 -0
  130. package/templates/.claude/commands/refine-task.zh-CN.md +8 -0
  131. package/templates/.claude/commands/refine-title.md +8 -0
  132. package/templates/.claude/commands/refine-title.zh-CN.md +8 -0
  133. package/templates/.claude/commands/release.md +8 -0
  134. package/templates/.claude/commands/release.zh-CN.md +8 -0
  135. package/templates/.claude/commands/review-task.md +8 -0
  136. package/templates/.claude/commands/review-task.zh-CN.md +8 -0
  137. package/templates/.claude/commands/sync-issue.md +8 -0
  138. package/templates/.claude/commands/sync-issue.zh-CN.md +8 -0
  139. package/templates/.claude/commands/sync-pr.md +8 -0
  140. package/templates/.claude/commands/sync-pr.zh-CN.md +8 -0
  141. package/templates/.claude/commands/test-integration.md +7 -0
  142. package/templates/.claude/commands/test-integration.zh-CN.md +7 -0
  143. package/templates/.claude/commands/test.md +7 -0
  144. package/templates/.claude/commands/test.zh-CN.md +7 -0
  145. package/templates/.claude/commands/update-agent-infra.md +7 -0
  146. package/templates/.claude/commands/update-agent-infra.zh-CN.md +7 -0
  147. package/templates/.claude/commands/upgrade-dependency.md +8 -0
  148. package/templates/.claude/commands/upgrade-dependency.zh-CN.md +8 -0
  149. package/templates/.claude/project-rules.md +65 -0
  150. package/templates/.claude/project-rules.zh-CN.md +65 -0
  151. package/templates/.claude/settings.json +20 -0
  152. package/templates/.codex/README.md +38 -0
  153. package/templates/.codex/README.zh-CN.md +37 -0
  154. package/templates/.editorconfig +15 -0
  155. package/templates/.gemini/commands/_project_/analyze-task.toml +8 -0
  156. package/templates/.gemini/commands/_project_/analyze-task.zh-CN.toml +8 -0
  157. package/templates/.gemini/commands/_project_/block-task.toml +8 -0
  158. package/templates/.gemini/commands/_project_/block-task.zh-CN.toml +8 -0
  159. package/templates/.gemini/commands/_project_/check-task.toml +8 -0
  160. package/templates/.gemini/commands/_project_/check-task.zh-CN.toml +8 -0
  161. package/templates/.gemini/commands/_project_/close-codescan.toml +8 -0
  162. package/templates/.gemini/commands/_project_/close-codescan.zh-CN.toml +8 -0
  163. package/templates/.gemini/commands/_project_/close-dependabot.toml +8 -0
  164. package/templates/.gemini/commands/_project_/close-dependabot.zh-CN.toml +8 -0
  165. package/templates/.gemini/commands/_project_/commit.toml +6 -0
  166. package/templates/.gemini/commands/_project_/commit.zh-CN.toml +6 -0
  167. package/templates/.gemini/commands/_project_/complete-task.toml +8 -0
  168. package/templates/.gemini/commands/_project_/complete-task.zh-CN.toml +8 -0
  169. package/templates/.gemini/commands/_project_/create-pr.toml +8 -0
  170. package/templates/.gemini/commands/_project_/create-pr.zh-CN.toml +8 -0
  171. package/templates/.gemini/commands/_project_/create-release-note.toml +8 -0
  172. package/templates/.gemini/commands/_project_/create-release-note.zh-CN.toml +8 -0
  173. package/templates/.gemini/commands/_project_/create-task.toml +8 -0
  174. package/templates/.gemini/commands/_project_/create-task.zh-CN.toml +8 -0
  175. package/templates/.gemini/commands/_project_/implement-task.toml +8 -0
  176. package/templates/.gemini/commands/_project_/implement-task.zh-CN.toml +8 -0
  177. package/templates/.gemini/commands/_project_/import-codescan.toml +8 -0
  178. package/templates/.gemini/commands/_project_/import-codescan.zh-CN.toml +8 -0
  179. package/templates/.gemini/commands/_project_/import-dependabot.toml +8 -0
  180. package/templates/.gemini/commands/_project_/import-dependabot.zh-CN.toml +8 -0
  181. package/templates/.gemini/commands/_project_/import-issue.toml +8 -0
  182. package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +8 -0
  183. package/templates/.gemini/commands/_project_/init-labels.toml +8 -0
  184. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +8 -0
  185. package/templates/.gemini/commands/_project_/init-milestones.toml +10 -0
  186. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +10 -0
  187. package/templates/.gemini/commands/_project_/plan-task.toml +8 -0
  188. package/templates/.gemini/commands/_project_/plan-task.zh-CN.toml +8 -0
  189. package/templates/.gemini/commands/_project_/refine-task.toml +8 -0
  190. package/templates/.gemini/commands/_project_/refine-task.zh-CN.toml +8 -0
  191. package/templates/.gemini/commands/_project_/refine-title.toml +8 -0
  192. package/templates/.gemini/commands/_project_/refine-title.zh-CN.toml +8 -0
  193. package/templates/.gemini/commands/_project_/release.toml +8 -0
  194. package/templates/.gemini/commands/_project_/release.zh-CN.toml +8 -0
  195. package/templates/.gemini/commands/_project_/review-task.toml +8 -0
  196. package/templates/.gemini/commands/_project_/review-task.zh-CN.toml +8 -0
  197. package/templates/.gemini/commands/_project_/sync-issue.toml +8 -0
  198. package/templates/.gemini/commands/_project_/sync-issue.zh-CN.toml +8 -0
  199. package/templates/.gemini/commands/_project_/sync-pr.toml +8 -0
  200. package/templates/.gemini/commands/_project_/sync-pr.zh-CN.toml +8 -0
  201. package/templates/.gemini/commands/_project_/test-integration.toml +6 -0
  202. package/templates/.gemini/commands/_project_/test-integration.zh-CN.toml +6 -0
  203. package/templates/.gemini/commands/_project_/test.toml +6 -0
  204. package/templates/.gemini/commands/_project_/test.zh-CN.toml +6 -0
  205. package/templates/.gemini/commands/_project_/update-agent-infra.toml +6 -0
  206. package/templates/.gemini/commands/_project_/update-agent-infra.zh-CN.toml +6 -0
  207. package/templates/.gemini/commands/_project_/upgrade-dependency.toml +8 -0
  208. package/templates/.gemini/commands/_project_/upgrade-dependency.zh-CN.toml +8 -0
  209. package/templates/.gemini/settings.json +3 -0
  210. package/templates/.github/ISSUE_TEMPLATE/01_bug_report.yml +149 -0
  211. package/templates/.github/ISSUE_TEMPLATE/02_question.yml +101 -0
  212. package/templates/.github/ISSUE_TEMPLATE/03_feature_request.yml +131 -0
  213. package/templates/.github/ISSUE_TEMPLATE/04_documentation.yml +165 -0
  214. package/templates/.github/ISSUE_TEMPLATE/05_other.yml +147 -0
  215. package/templates/.github/ISSUE_TEMPLATE/config.yml +11 -0
  216. package/templates/.github/PULL_REQUEST_TEMPLATE.md +123 -0
  217. package/templates/.github/dependabot.yml +17 -0
  218. package/templates/.github/hooks/check-utf8-encoding.sh +25 -0
  219. package/templates/.github/release.yml +27 -0
  220. package/templates/.github/workflows/pr-title-check.yml +42 -0
  221. package/templates/.mailmap +4 -0
  222. package/templates/.opencode/COMMAND_STYLE_GUIDE.md +232 -0
  223. package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +232 -0
  224. package/templates/.opencode/README.md +76 -0
  225. package/templates/.opencode/README.zh-CN.md +77 -0
  226. package/templates/.opencode/commands/analyze-task.md +11 -0
  227. package/templates/.opencode/commands/analyze-task.zh-CN.md +11 -0
  228. package/templates/.opencode/commands/block-task.md +11 -0
  229. package/templates/.opencode/commands/block-task.zh-CN.md +11 -0
  230. package/templates/.opencode/commands/check-task.md +11 -0
  231. package/templates/.opencode/commands/check-task.zh-CN.md +11 -0
  232. package/templates/.opencode/commands/close-codescan.md +11 -0
  233. package/templates/.opencode/commands/close-codescan.zh-CN.md +11 -0
  234. package/templates/.opencode/commands/close-dependabot.md +11 -0
  235. package/templates/.opencode/commands/close-dependabot.zh-CN.md +11 -0
  236. package/templates/.opencode/commands/commit.md +9 -0
  237. package/templates/.opencode/commands/commit.zh-CN.md +9 -0
  238. package/templates/.opencode/commands/complete-task.md +11 -0
  239. package/templates/.opencode/commands/complete-task.zh-CN.md +11 -0
  240. package/templates/.opencode/commands/create-pr.md +11 -0
  241. package/templates/.opencode/commands/create-pr.zh-CN.md +11 -0
  242. package/templates/.opencode/commands/create-release-note.md +11 -0
  243. package/templates/.opencode/commands/create-release-note.zh-CN.md +11 -0
  244. package/templates/.opencode/commands/create-task.md +11 -0
  245. package/templates/.opencode/commands/create-task.zh-CN.md +11 -0
  246. package/templates/.opencode/commands/implement-task.md +11 -0
  247. package/templates/.opencode/commands/implement-task.zh-CN.md +11 -0
  248. package/templates/.opencode/commands/import-codescan.md +11 -0
  249. package/templates/.opencode/commands/import-codescan.zh-CN.md +11 -0
  250. package/templates/.opencode/commands/import-dependabot.md +11 -0
  251. package/templates/.opencode/commands/import-dependabot.zh-CN.md +11 -0
  252. package/templates/.opencode/commands/import-issue.md +11 -0
  253. package/templates/.opencode/commands/import-issue.zh-CN.md +11 -0
  254. package/templates/.opencode/commands/init-labels.md +9 -0
  255. package/templates/.opencode/commands/init-labels.zh-CN.md +9 -0
  256. package/templates/.opencode/commands/init-milestones.md +11 -0
  257. package/templates/.opencode/commands/init-milestones.zh-CN.md +11 -0
  258. package/templates/.opencode/commands/plan-task.md +11 -0
  259. package/templates/.opencode/commands/plan-task.zh-CN.md +11 -0
  260. package/templates/.opencode/commands/refine-task.md +11 -0
  261. package/templates/.opencode/commands/refine-task.zh-CN.md +11 -0
  262. package/templates/.opencode/commands/refine-title.md +11 -0
  263. package/templates/.opencode/commands/refine-title.zh-CN.md +11 -0
  264. package/templates/.opencode/commands/release.md +11 -0
  265. package/templates/.opencode/commands/release.zh-CN.md +11 -0
  266. package/templates/.opencode/commands/review-task.md +11 -0
  267. package/templates/.opencode/commands/review-task.zh-CN.md +11 -0
  268. package/templates/.opencode/commands/sync-issue.md +11 -0
  269. package/templates/.opencode/commands/sync-issue.zh-CN.md +11 -0
  270. package/templates/.opencode/commands/sync-pr.md +11 -0
  271. package/templates/.opencode/commands/sync-pr.zh-CN.md +11 -0
  272. package/templates/.opencode/commands/test-integration.md +9 -0
  273. package/templates/.opencode/commands/test-integration.zh-CN.md +9 -0
  274. package/templates/.opencode/commands/test.md +9 -0
  275. package/templates/.opencode/commands/test.zh-CN.md +9 -0
  276. package/templates/.opencode/commands/update-agent-infra.md +9 -0
  277. package/templates/.opencode/commands/update-agent-infra.zh-CN.md +9 -0
  278. package/templates/.opencode/commands/upgrade-dependency.md +11 -0
  279. package/templates/.opencode/commands/upgrade-dependency.zh-CN.md +11 -0
  280. package/templates/AGENTS.md +91 -0
  281. package/templates/AGENTS.zh-CN.md +91 -0
  282. package/templates/CONTRIBUTING.md +126 -0
  283. package/templates/CONTRIBUTING.zh-CN.md +124 -0
  284. package/templates/SECURITY.md +131 -0
  285. package/templates/SECURITY.zh-CN.md +131 -0
@@ -0,0 +1,200 @@
1
+ ---
2
+ name: refine-task
3
+ description: >
4
+ 处理代码审查反馈并修复审查中发现的问题。按优先级(Blocker -> Major -> Minor)修复。
5
+ 仅处理审查中标记的问题,不添加额外变更。当用户要求修复审查问题时触发。参数:task-id。
6
+ ---
7
+
8
+ # 修复审查问题
9
+
10
+ ## 行为边界 / 关键规则
11
+
12
+ - 仅修复审查中标记的问题 —— 不要添加无关变更或额外的"改进"
13
+ - 不要自动提交。绝不自动执行 `git commit` 或 `git add`
14
+ - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
15
+
16
+ ## 执行步骤
17
+
18
+ ### 1. 验证前置条件
19
+
20
+ 检查必要文件:
21
+ - `.agent-workspace/active/{task-id}/task.md` - 任务文件
22
+ - 至少一个审查产物:`review.md` 或 `review-r{N}.md`
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 扫描到的最新审查产物匹配
39
+
40
+ 若 Activity Log 记录与实际文件不匹配,立即停止并提示:
41
+ `Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists.`
42
+
43
+ ### 2. 阅读审查与实现上下文
44
+
45
+ 仔细阅读步骤 1 中确定的最新审查产物 `{review-artifact}` 和实现产物 `{implementation-artifact}` 以理解:
46
+ - 所有阻塞项(必须修复)
47
+ - 所有主要问题(应该修复)
48
+ - 次要问题(可选优化)
49
+ - 审查者的建议和推荐
50
+ - 当前实现和之前修复的上下文
51
+
52
+ ### 3. 规划修复
53
+
54
+ 分类并确定优先级:
55
+ 1. **阻塞项优先**:必须解决所有阻塞项
56
+ 2. **然后是主要问题**:处理所有主要问题
57
+ 3. **最后是次要问题**:如有时间则处理(可选)
58
+
59
+ 对于每个问题,确定:
60
+ - 需要修改哪些文件
61
+ - 具体要做哪些修改
62
+ - 如何验证修复
63
+
64
+ ### 4. 执行代码修复
65
+
66
+ 按优先级顺序修复问题:
67
+
68
+ **对于每个修复**:
69
+ 1. 读取受影响的文件
70
+ 2. 应用修复
71
+ 3. 验证修复是否解决了审查意见
72
+ 4. 运行相关测试
73
+
74
+ **修复原则**:
75
+ - 仅修复标记的问题 —— 不要添加无关变更
76
+ - 不要添加超出要求的额外"改进"
77
+ - 保持变更最小化和聚焦
78
+
79
+ ### 5. 运行测试验证
80
+
81
+ 执行项目的测试命令。参考 `test` 技能获取项目特定的测试命令。
82
+
83
+ 确保修复后所有测试仍然通过。
84
+
85
+ ### 6. 创建修复报告
86
+
87
+ 创建 `.agent-workspace/active/{task-id}/{refinement-artifact}`。
88
+
89
+ ### 7. 更新任务状态
90
+
91
+ 获取当前时间:
92
+
93
+ ```bash
94
+ date "+%Y-%m-%d %H:%M:%S"
95
+ ```
96
+
97
+ 更新 `.agent-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
+ 任务 {task-id} 修复完成。
114
+
115
+ 修复情况:
116
+ - 阻塞项修复:{数量}/{总数}
117
+ - 主要问题修复:{数量}/{总数}
118
+ - 次要问题修复:{数量}/{总数}
119
+ - 所有测试通过:{是/否}
120
+ - 审查输入:{review-artifact}
121
+ - 修复产物:{refinement-artifact}
122
+
123
+ 下一步 - 重新审查或提交:
124
+ - 重新审查:
125
+ - Claude Code / OpenCode:/review-task {task-id}
126
+ - Gemini CLI:/agent-infra:review-task {task-id}
127
+ - Codex CLI:$review-task {task-id}
128
+ - 直接提交:
129
+ - Claude Code / OpenCode:/commit
130
+ - Gemini CLI:/agent-infra:commit
131
+ - Codex CLI:$commit
132
+ ```
133
+
134
+ ## 输出模板
135
+
136
+ ```markdown
137
+ # 修复报告
138
+
139
+ - **修复轮次**:Round {refinement-round}
140
+ - **产物文件**:`{refinement-artifact}`
141
+ - **审查输入**:`{review-artifact}`
142
+ - **实现上下文**:`{implementation-artifact}`
143
+
144
+ ### 审查反馈处理
145
+
146
+ #### 阻塞项修复
147
+ 1. **{问题标题}**(来自 {review-artifact})
148
+ - **修复**:{做了什么修改}
149
+ - **文件**:`{file-path}:{line-number}`
150
+ - **验证**:{如何验证}
151
+
152
+ #### 主要问题修复
153
+ 1. **{问题标题}**(来自 {review-artifact})
154
+ - **修复**:{做了什么修改}
155
+ - **文件**:`{file-path}:{line-number}`
156
+
157
+ #### 次要问题处理
158
+ 1. **{问题标题}**(来自 {review-artifact})
159
+ - **修复**:{做了什么修改}
160
+
161
+ #### 未处理的问题
162
+ - {问题}:{未处理的原因,例如不同意审查建议}
163
+
164
+ ### 修复后的测试结果
165
+ - 所有测试通过:{是/否}
166
+ - 测试输出:{摘要}
167
+ ```
168
+
169
+ ## 完成检查清单
170
+
171
+ - [ ] 阅读并理解了所有审查发现
172
+ - [ ] 修复了所有阻塞项
173
+ - [ ] 修复了所有主要问题
174
+ - [ ] 在适当情况下处理了次要问题
175
+ - [ ] 修复后所有测试通过
176
+ - [ ] 创建了 `{refinement-artifact}` 修复报告
177
+ - [ ] 更新了 task.md 中的任务状态
178
+ - [ ] 追加了 Activity Log 条目到 task.md
179
+ - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
180
+
181
+ ## 注意事项
182
+
183
+ 1. **前置条件**:必须有审查报告(`review.md` 或 `review-r{N}.md` 存在)
184
+ 2. **禁止自动提交**:不要自动执行 `git commit`。提醒用户手动提交
185
+ 3. **范围纪律**:仅修复审查中标记的问题 —— 不添加额外变更
186
+ 4. **不同意见**:如果不同意某个审查意见,在"未处理的问题"部分记录你的理由
187
+ 5. **重新审查**:修复阻塞项后,建议重新运行 review-task 技能进行验证
188
+ 6. **一致性要求**:最新审查产物、Activity Log 记录和修复报告标题必须引用同一轮次文件
189
+ 7. **版本化规则**:首轮修复使用 `refinement.md`;后续轮次使用 `refinement-r{N}.md`
190
+
191
+ ## 停止
192
+
193
+ 完成检查清单后,**立即停止**。等待用户审查修复结果并决定重新审查还是提交。
194
+
195
+ ## 错误处理
196
+
197
+ - 任务未找到:提示 "Task {task-id} not found"
198
+ - 缺少审查报告:提示 "Review report not found, please run the review-task skill first"
199
+ - 审查产物不一致:提示 "Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists."
200
+ - 修复后测试失败:输出测试错误,询问用户如何处理
@@ -0,0 +1,200 @@
1
+ ---
2
+ name: refine-task
3
+ description: >
4
+ 处理代码审查反馈并修复审查中发现的问题。按优先级(Blocker -> Major -> Minor)修复。
5
+ 仅处理审查中标记的问题,不添加额外变更。当用户要求修复审查问题时触发。参数:task-id。
6
+ ---
7
+
8
+ # 修复审查问题
9
+
10
+ ## 行为边界 / 关键规则
11
+
12
+ - 仅修复审查中标记的问题 —— 不要添加无关变更或额外的"改进"
13
+ - 不要自动提交。绝不自动执行 `git commit` 或 `git add`
14
+ - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
15
+
16
+ ## 执行步骤
17
+
18
+ ### 1. 验证前置条件
19
+
20
+ 检查必要文件:
21
+ - `.agent-workspace/active/{task-id}/task.md` - 任务文件
22
+ - 至少一个审查产物:`review.md` 或 `review-r{N}.md`
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 扫描到的最新审查产物匹配
39
+
40
+ 若 Activity Log 记录与实际文件不匹配,立即停止并提示:
41
+ `Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists.`
42
+
43
+ ### 2. 阅读审查与实现上下文
44
+
45
+ 仔细阅读步骤 1 中确定的最新审查产物 `{review-artifact}` 和实现产物 `{implementation-artifact}` 以理解:
46
+ - 所有阻塞项(必须修复)
47
+ - 所有主要问题(应该修复)
48
+ - 次要问题(可选优化)
49
+ - 审查者的建议和推荐
50
+ - 当前实现和之前修复的上下文
51
+
52
+ ### 3. 规划修复
53
+
54
+ 分类并确定优先级:
55
+ 1. **阻塞项优先**:必须解决所有阻塞项
56
+ 2. **然后是主要问题**:处理所有主要问题
57
+ 3. **最后是次要问题**:如有时间则处理(可选)
58
+
59
+ 对于每个问题,确定:
60
+ - 需要修改哪些文件
61
+ - 具体要做哪些修改
62
+ - 如何验证修复
63
+
64
+ ### 4. 执行代码修复
65
+
66
+ 按优先级顺序修复问题:
67
+
68
+ **对于每个修复**:
69
+ 1. 读取受影响的文件
70
+ 2. 应用修复
71
+ 3. 验证修复是否解决了审查意见
72
+ 4. 运行相关测试
73
+
74
+ **修复原则**:
75
+ - 仅修复标记的问题 —— 不要添加无关变更
76
+ - 不要添加超出要求的额外"改进"
77
+ - 保持变更最小化和聚焦
78
+
79
+ ### 5. 运行测试验证
80
+
81
+ 执行项目的测试命令。参考 `test` 技能获取项目特定的测试命令。
82
+
83
+ 确保修复后所有测试仍然通过。
84
+
85
+ ### 6. 创建修复报告
86
+
87
+ 创建 `.agent-workspace/active/{task-id}/{refinement-artifact}`。
88
+
89
+ ### 7. 更新任务状态
90
+
91
+ 获取当前时间:
92
+
93
+ ```bash
94
+ date "+%Y-%m-%d %H:%M:%S"
95
+ ```
96
+
97
+ 更新 `.agent-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
+ 任务 {task-id} 修复完成。
114
+
115
+ 修复情况:
116
+ - 阻塞项修复:{数量}/{总数}
117
+ - 主要问题修复:{数量}/{总数}
118
+ - 次要问题修复:{数量}/{总数}
119
+ - 所有测试通过:{是/否}
120
+ - 审查输入:{review-artifact}
121
+ - 修复产物:{refinement-artifact}
122
+
123
+ 下一步 - 重新审查或提交:
124
+ - 重新审查:
125
+ - Claude Code / OpenCode:/review-task {task-id}
126
+ - Gemini CLI:/agent-infra:review-task {task-id}
127
+ - Codex CLI:$review-task {task-id}
128
+ - 直接提交:
129
+ - Claude Code / OpenCode:/commit
130
+ - Gemini CLI:/agent-infra:commit
131
+ - Codex CLI:$commit
132
+ ```
133
+
134
+ ## 输出模板
135
+
136
+ ```markdown
137
+ # 修复报告
138
+
139
+ - **修复轮次**:Round {refinement-round}
140
+ - **产物文件**:`{refinement-artifact}`
141
+ - **审查输入**:`{review-artifact}`
142
+ - **实现上下文**:`{implementation-artifact}`
143
+
144
+ ### 审查反馈处理
145
+
146
+ #### 阻塞项修复
147
+ 1. **{问题标题}**(来自 {review-artifact})
148
+ - **修复**:{做了什么修改}
149
+ - **文件**:`{file-path}:{line-number}`
150
+ - **验证**:{如何验证}
151
+
152
+ #### 主要问题修复
153
+ 1. **{问题标题}**(来自 {review-artifact})
154
+ - **修复**:{做了什么修改}
155
+ - **文件**:`{file-path}:{line-number}`
156
+
157
+ #### 次要问题处理
158
+ 1. **{问题标题}**(来自 {review-artifact})
159
+ - **修复**:{做了什么修改}
160
+
161
+ #### 未处理的问题
162
+ - {问题}:{未处理的原因,例如不同意审查建议}
163
+
164
+ ### 修复后的测试结果
165
+ - 所有测试通过:{是/否}
166
+ - 测试输出:{摘要}
167
+ ```
168
+
169
+ ## 完成检查清单
170
+
171
+ - [ ] 阅读并理解了所有审查发现
172
+ - [ ] 修复了所有阻塞项
173
+ - [ ] 修复了所有主要问题
174
+ - [ ] 在适当情况下处理了次要问题
175
+ - [ ] 修复后所有测试通过
176
+ - [ ] 创建了 `{refinement-artifact}` 修复报告
177
+ - [ ] 更新了 task.md 中的任务状态
178
+ - [ ] 追加了 Activity Log 条目到 task.md
179
+ - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
180
+
181
+ ## 注意事项
182
+
183
+ 1. **前置条件**:必须有审查报告(`review.md` 或 `review-r{N}.md` 存在)
184
+ 2. **禁止自动提交**:不要自动执行 `git commit`。提醒用户手动提交
185
+ 3. **范围纪律**:仅修复审查中标记的问题 —— 不添加额外变更
186
+ 4. **不同意见**:如果不同意某个审查意见,在"未处理的问题"部分记录你的理由
187
+ 5. **重新审查**:修复阻塞项后,建议重新运行 review-task 技能进行验证
188
+ 6. **一致性要求**:最新审查产物、Activity Log 记录和修复报告标题必须引用同一轮次文件
189
+ 7. **版本化规则**:首轮修复使用 `refinement.md`;后续轮次使用 `refinement-r{N}.md`
190
+
191
+ ## 停止
192
+
193
+ 完成检查清单后,**立即停止**。等待用户审查修复结果并决定重新审查还是提交。
194
+
195
+ ## 错误处理
196
+
197
+ - 任务未找到:提示 "Task {task-id} not found"
198
+ - 缺少审查报告:提示 "Review report not found, please run the review-task skill first"
199
+ - 审查产物不一致:提示 "Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists."
200
+ - 修复后测试失败:输出测试错误,询问用户如何处理
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: refine-title
3
+ description: >
4
+ Deeply analyze Issue or PR content and reformat the title to
5
+ Conventional Commits format. Triggered when the user requests
6
+ title optimization. Argument: issue or PR number.
7
+ ---
8
+
9
+ # Refine Title
10
+
11
+ Reformat the title of the specified Issue or PR to Conventional Commits format based on deep content analysis.
12
+
13
+ ## Execution Flow
14
+
15
+ ### 1. Identify Target and Fetch Information
16
+
17
+ Try to determine if the ID is an Issue or PR:
18
+
19
+ ```bash
20
+ # Try Issue first
21
+ gh issue view <id> --json number,title,body,labels,state
22
+
23
+ # If not found or is a PR
24
+ gh pr view <id> --json number,title,body,labels,state,files
25
+ ```
26
+
27
+ ### 2. Analyze Content
28
+
29
+ Based on the fetched data:
30
+
31
+ **Determine Type**:
32
+ - Read body for change type indicators
33
+ - Check labels (e.g. `type: bug` -> `fix`, `type: feature` -> `feat`)
34
+ - If PR, analyze files (only docs changed -> `docs`, only tests -> `test`)
35
+
36
+ **Determine Scope**:
37
+ - Read body for module mentions
38
+ - Check labels for module indicators
39
+ - If PR, analyze file paths to infer affected module
40
+
41
+ **Generate Subject**:
42
+ - **Ignore the original title** (avoid bias) - extract core intent from body
43
+ - Keep concise (under 50 characters), English imperative mood, no trailing period
44
+
45
+ ### 3. Present Suggestion
46
+
47
+ ```
48
+ Analysis for Issue/PR #{id}:
49
+
50
+ Current title: {original title}
51
+ --------------------------------------------------
52
+ Analysis:
53
+ - Intent: {one-line summary from body}
54
+ - Type: {type} (basis: {evidence})
55
+ - Scope: {scope} (basis: {evidence})
56
+ --------------------------------------------------
57
+ Suggested title: {type}({scope}): {subject}
58
+ ```
59
+
60
+ Ask user: "Apply this title? (y/n)"
61
+
62
+ ### 4. Apply Change
63
+
64
+ If user confirms:
65
+
66
+ ```bash
67
+ # For Issue
68
+ gh issue edit <id> --title "<new-title>"
69
+
70
+ # For PR
71
+ gh pr edit <id> --title "<new-title>"
72
+ ```
73
+
74
+ ## Advantages
75
+
76
+ This skill:
77
+ 1. **Fixes misleading titles**: Even if the original title is "Help me", it reads the body and generates a proper title like `fix(core): resolve startup error`
78
+ 2. **Accurate scope**: By analyzing PR file changes, it can automatically infer the correct scope without manual specification
79
+
80
+ ## Notes
81
+
82
+ - The subject should be extracted from the body content, not reformatted from the original title
83
+ - If the body is empty or insufficient, ask the user for clarification
84
+ - Follow project conventions for scope naming
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: refine-title
3
+ description: >
4
+ 深度分析 Issue 或 PR 内容,并将其标题重构为 Conventional Commits 格式。
5
+ 当用户要求优化标题时触发。参数:issue 或 PR 编号。
6
+ ---
7
+
8
+ # 重构标题
9
+
10
+ 基于深度内容分析,将指定 Issue 或 PR 的标题重构为 Conventional Commits 格式。
11
+
12
+ ## 执行流程
13
+
14
+ ### 1. 识别目标并获取信息
15
+
16
+ 尝试判断 ID 是 Issue 还是 PR:
17
+
18
+ ```bash
19
+ # 先尝试 Issue
20
+ gh issue view <id> --json number,title,body,labels,state
21
+
22
+ # 如果未找到或是 PR
23
+ gh pr view <id> --json number,title,body,labels,state,files
24
+ ```
25
+
26
+ ### 2. 分析内容
27
+
28
+ 基于获取的数据:
29
+
30
+ **确定 Type**:
31
+ - 阅读 body 以寻找变更类型指示
32
+ - 检查标签(例如 `type: bug` -> `fix`,`type: feature` -> `feat`)
33
+ - 如果是 PR,分析文件(仅文档变更 -> `docs`,仅测试 -> `test`)
34
+
35
+ **确定 Scope**:
36
+ - 阅读 body 以寻找模块提及
37
+ - 检查标签中的模块指示
38
+ - 如果是 PR,分析文件路径以推断受影响的模块
39
+
40
+ **生成 Subject**:
41
+ - **忽略原始标题**(避免偏见)- 从 body 中提取核心意图
42
+ - 保持简洁(不超过 50 字符),英文祈使语气,末尾无句号
43
+
44
+ ### 3. 展示建议
45
+
46
+ ```
47
+ Issue/PR #{id} 分析结果:
48
+
49
+ 当前标题:{原始标题}
50
+ --------------------------------------------------
51
+ 分析:
52
+ - 意图:{从 body 提取的一行摘要}
53
+ - 类型:{type}(依据:{依据})
54
+ - 范围:{scope}(依据:{依据})
55
+ --------------------------------------------------
56
+ 建议标题:{type}({scope}): {subject}
57
+ ```
58
+
59
+ 询问用户:"是否应用此标题?(y/n)"
60
+
61
+ ### 4. 应用修改
62
+
63
+ 如果用户确认:
64
+
65
+ ```bash
66
+ # 对于 Issue
67
+ gh issue edit <id> --title "<new-title>"
68
+
69
+ # 对于 PR
70
+ gh pr edit <id> --title "<new-title>"
71
+ ```
72
+
73
+ ## 优势
74
+
75
+ 本技能的优势:
76
+ 1. **修复误导性标题**:即使原始标题是"Help me",也能读取 body 并生成合适的标题,如 `fix(core): resolve startup error`
77
+ 2. **精确 scope**:通过分析 PR 文件变更,可以自动推断正确的 scope,无需手动指定
78
+
79
+ ## 注意事项
80
+
81
+ - subject 应从 body 内容提取,而不是从原始标题重新格式化
82
+ - 如果 body 为空或信息不足,向用户询问澄清
83
+ - 遵循项目对 scope 命名的约定
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: release
3
+ description: >
4
+ Execute the version release workflow. Triggered when the user
5
+ requests a version release. Argument: version number (X.Y.Z).
6
+ ---
7
+
8
+ # Version Release
9
+
10
+ Execute the version release workflow for the specified version.
11
+
12
+ <!-- TODO: Adapt the steps below to your project's release process -->
13
+
14
+ ## Execution Flow
15
+
16
+ ### Step 1: Parse and Validate Version
17
+
18
+ Extract version from arguments. Must match `X.Y.Z` format.
19
+
20
+ Parse components:
21
+ - MAJOR = X, MINOR = Y, PATCH = Z
22
+ - Release version = `X.Y.Z`
23
+
24
+ If format is invalid, error: "Version format incorrect, expected X.Y.Z (e.g. 1.2.3)"
25
+
26
+ ### Step 2: Verify Clean Workspace
27
+
28
+ ```bash
29
+ git status --short
30
+ ```
31
+
32
+ If there are uncommitted changes, error: "Workspace has uncommitted changes. Please commit or stash first."
33
+
34
+ ### Step 3: Update Version References
35
+
36
+ <!-- TODO: Replace with your project's version update steps -->
37
+
38
+ Search for version references in project files and update them:
39
+
40
+ ```bash
41
+ # Find files with version references
42
+ # Search for current version pattern
43
+ # Update version strings
44
+ ```
45
+
46
+ **Common files to update**:
47
+ - `package.json` (Node.js)
48
+ - `pom.xml` (Maven)
49
+ - `setup.py` / `pyproject.toml` (Python)
50
+ - `version.go` (Go)
51
+ - `README.md` (documentation)
52
+ - `SECURITY.md` / `SECURITY.zh-CN.md` (supported version table)
53
+
54
+ **Exclude from version replacement**:
55
+ - `.agents/`, `.agent-workspace/`, `.claude/`, `.codex/`, `.gemini/`, `.opencode/` (AI tool configs)
56
+
57
+ ### Step 4: Create Release Commit
58
+
59
+ ```bash
60
+ git add -A
61
+ git commit -m "chore: release v{version}"
62
+ ```
63
+
64
+ ### Step 5: Create Git Tag
65
+
66
+ ```bash
67
+ git tag v{version}
68
+ ```
69
+
70
+ ### Step 6: Manage Milestones
71
+
72
+ Close the milestone for the released version when it exists, and create the missing planning milestones for the next cycle.
73
+
74
+ Run:
75
+
76
+ ```bash
77
+ bash .agents/skills/release/scripts/manage-milestones.sh "$MAJOR" "$MINOR" "$PATCH"
78
+ ```
79
+
80
+ The script is responsible for:
81
+ - Loading the current milestone list with `gh api "repos/$repo/milestones"`
82
+ - Closing `{MAJOR}.{MINOR}.{PATCH}` when it exists and is still open
83
+ - Ensuring `{MAJOR}.{MINOR}.{PATCH+1}` and `{MAJOR}.{MINOR}.x` exist
84
+ - When `PATCH=0`, also ensuring `{MAJOR}.{MINOR+1}.0` and `{MAJOR}.{MINOR+1}.x`
85
+ - Printing a milestone summary with the released milestone action and new milestone count
86
+
87
+ ### Step 7: Output Summary
88
+
89
+ > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
90
+
91
+ ```
92
+ Release v{version} prepared.
93
+
94
+ Release info:
95
+ - Version: {version}
96
+ - Release commit: {commit-hash}
97
+ - Tag: v{version}
98
+
99
+ Files updated: {count}
100
+
101
+ Next steps (manual):
102
+
103
+ 1. Push tag:
104
+ git push origin v{version}
105
+
106
+ 2. Push branch:
107
+ git push origin {current-branch}
108
+
109
+ 3. (Optional) Generate release notes:
110
+ - Claude Code / OpenCode: /create-release-note {version}
111
+ - Gemini CLI: /{{project}}:create-release-note {version}
112
+ - Codex CLI: $create-release-note {version}
113
+ ```
114
+
115
+ ### Rollback Instructions
116
+
117
+ If something went wrong:
118
+ ```bash
119
+ # Delete tag
120
+ git tag -d v{version}
121
+
122
+ # Reset commit
123
+ git reset --soft HEAD~1
124
+
125
+ # Restore files
126
+ git checkout -- .
127
+ ```
128
+
129
+ ## Notes
130
+
131
+ 1. **Clean workspace required**: Must have no uncommitted changes
132
+ 2. **No auto-push**: All operations are local only; user pushes manually
133
+ 3. **No build verification**: Run the test skill before releasing to verify
134
+ 4. **Version replacement scope**: Search determines which files to update; exclude AI tool directories
135
+ 5. **Adapt to your project**: The version update steps above are generic; customize for your project's versioning scheme
136
+ 6. **Milestone coordination**: Releases should create the next planning milestones automatically; initialize the taxonomy first with `init-milestones` when needed
137
+
138
+ ## Error Handling
139
+
140
+ - Invalid version format: Prompt correct format and exit
141
+ - Dirty workspace: Prompt to commit or stash
142
+ - Git operation failure: Display error and provide rollback instructions