@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,141 @@
1
+ ---
2
+ name: release
3
+ description: >
4
+ 执行版本发布流程。当用户要求发布版本时触发。参数:版本号(X.Y.Z)。
5
+ ---
6
+
7
+ # 版本发布
8
+
9
+ 执行指定版本的版本发布流程。
10
+
11
+ <!-- TODO: 根据你的项目发布流程调整以下步骤 -->
12
+
13
+ ## 执行流程
14
+
15
+ ### 步骤 1:解析并验证版本号
16
+
17
+ 从参数中提取版本。必须匹配 `X.Y.Z` 格式。
18
+
19
+ 解析组件:
20
+ - MAJOR = X,MINOR = Y,PATCH = Z
21
+ - 发布版本 = `X.Y.Z`
22
+
23
+ 如果格式无效,报错:"Version format incorrect, expected X.Y.Z (e.g. 1.2.3)"
24
+
25
+ ### 步骤 2:验证工作区干净
26
+
27
+ ```bash
28
+ git status --short
29
+ ```
30
+
31
+ 如果有未提交的变更,报错:"Workspace has uncommitted changes. Please commit or stash first."
32
+
33
+ ### 步骤 3:更新版本引用
34
+
35
+ <!-- TODO: 替换为你的项目版本更新步骤 -->
36
+
37
+ 搜索项目文件中的版本引用并更新:
38
+
39
+ ```bash
40
+ # 查找包含版本引用的文件
41
+ # 搜索当前版本模式
42
+ # 更新版本字符串
43
+ ```
44
+
45
+ **常见需要更新的文件**:
46
+ - `package.json`(Node.js)
47
+ - `pom.xml`(Maven)
48
+ - `setup.py` / `pyproject.toml`(Python)
49
+ - `version.go`(Go)
50
+ - `README.md`(文档)
51
+ - `SECURITY.md` / `SECURITY.zh-CN.md`(支持版本表格)
52
+
53
+ **排除以下目录的版本替换**:
54
+ - `.agents/`、`.agent-workspace/`、`.claude/`、`.codex/`、`.gemini/`、`.opencode/`(AI 工具配置)
55
+
56
+ ### 步骤 4:创建发布提交
57
+
58
+ ```bash
59
+ git add -A
60
+ git commit -m "chore: release v{version}"
61
+ ```
62
+
63
+ ### 步骤 5:创建 Git 标签
64
+
65
+ ```bash
66
+ git tag v{version}
67
+ ```
68
+
69
+ ### 步骤 6:管理里程碑
70
+
71
+ 为已发布版本关闭对应版本里程碑,并为下一轮创建缺失的规划里程碑。
72
+
73
+ 执行:
74
+
75
+ ```bash
76
+ bash .agents/skills/release/scripts/manage-milestones.sh "$MAJOR" "$MINOR" "$PATCH"
77
+ ```
78
+
79
+ 脚本负责:
80
+ - 使用 `gh api "repos/$repo/milestones"` 读取当前里程碑
81
+ - 在 `{MAJOR}.{MINOR}.{PATCH}` 存在且仍为开启状态时将其关闭
82
+ - 确保 `{MAJOR}.{MINOR}.{PATCH+1}` 与 `{MAJOR}.{MINOR}.x` 存在
83
+ - 当 `PATCH=0` 时,同时确保 `{MAJOR}.{MINOR+1}.0` 与 `{MAJOR}.{MINOR+1}.x`
84
+ - 输出包含已发布里程碑动作和新建数量的汇总
85
+
86
+ ### 步骤 7:输出摘要
87
+
88
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
89
+
90
+ ```
91
+ 版本 v{version} 已准备好发布。
92
+
93
+ 发布信息:
94
+ - 版本:{version}
95
+ - 发布提交:{commit-hash}
96
+ - 标签:v{version}
97
+
98
+ 已更新文件数:{数量}
99
+
100
+ 下一步(手动执行):
101
+
102
+ 1. 推送标签:
103
+ git push origin v{version}
104
+
105
+ 2. 推送分支:
106
+ git push origin {current-branch}
107
+
108
+ 3.(可选)生成发布说明:
109
+ - Claude Code / OpenCode:/create-release-note {version}
110
+ - Gemini CLI:/{{project}}:create-release-note {version}
111
+ - Codex CLI:$create-release-note {version}
112
+ ```
113
+
114
+ ### 回滚说明
115
+
116
+ 如果出了问题:
117
+ ```bash
118
+ # 删除标签
119
+ git tag -d v{version}
120
+
121
+ # 重置提交
122
+ git reset --soft HEAD~1
123
+
124
+ # 恢复文件
125
+ git checkout -- .
126
+ ```
127
+
128
+ ## 注意事项
129
+
130
+ 1. **需要干净的工作区**:必须没有未提交的变更
131
+ 2. **不自动推送**:所有操作仅在本地执行;用户手动推送
132
+ 3. **不验证构建**:发布前执行 test 技能进行验证
133
+ 4. **版本替换范围**:通过搜索确定需要更新哪些文件;排除 AI 工具目录
134
+ 5. **适配你的项目**:以上版本更新步骤是通用的;请根据你的项目版本方案进行定制
135
+ 6. **里程碑联动**:发布时自动创建下一轮里程碑;如果里程碑体系未初始化,建议先运行 `init-milestones`
136
+
137
+ ## 错误处理
138
+
139
+ - 版本格式无效:提示正确格式并退出
140
+ - 工作区不干净:提示提交或暂存
141
+ - Git 操作失败:显示错误并提供回滚说明
@@ -0,0 +1,80 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+
5
+ if [ "$#" -ne 3 ]; then
6
+ echo "Usage: manage-milestones.sh <major> <minor> <patch>"
7
+ exit 1
8
+ fi
9
+
10
+ if ! command -v gh >/dev/null 2>&1; then
11
+ echo "GitHub CLI (\`gh\`) is not installed"
12
+ exit 1
13
+ fi
14
+
15
+ if ! gh auth token >/dev/null 2>&1; then
16
+ echo "GitHub CLI is not authenticated"
17
+ exit 1
18
+ fi
19
+
20
+ major="$1"
21
+ minor="$2"
22
+ patch="$3"
23
+
24
+ tmpdir="$(mktemp -d)"
25
+ trap 'rm -rf "$tmpdir"' EXIT HUP INT TERM
26
+
27
+ repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"
28
+ released_version="${major}.${minor}.${patch}"
29
+ line_milestone="${major}.${minor}.x"
30
+ next_patch_version="${major}.${minor}.$((patch + 1))"
31
+ next_minor_version="${major}.$((minor + 1)).0"
32
+ next_minor_line="${major}.$((minor + 1)).x"
33
+
34
+ gh api "repos/$repo/milestones?state=all" --paginate \
35
+ --jq '.[] | [.number, .title, .state] | @tsv' > "$tmpdir/milestones.tsv"
36
+
37
+ created_count=0
38
+
39
+ ensure_milestone() {
40
+ title="$1"
41
+ description="$2"
42
+
43
+ if awk -F '\t' -v target="$title" '$2 == target { found = 1 } END { exit found ? 0 : 1 }' "$tmpdir/milestones.tsv"; then
44
+ echo "Milestone already exists: $title"
45
+ return 0
46
+ fi
47
+
48
+ gh api "repos/$repo/milestones" \
49
+ -f title="$title" \
50
+ -f description="$description" \
51
+ -f state="open" >/dev/null
52
+
53
+ printf '0\t%s\topen\n' "$title" >> "$tmpdir/milestones.tsv"
54
+ created_count=$((created_count + 1))
55
+ echo "Created milestone: $title"
56
+ }
57
+
58
+ released_number="$(awk -F '\t' -v target="$released_version" '$2 == target { print $1; exit }' "$tmpdir/milestones.tsv")"
59
+ released_state="$(awk -F '\t' -v target="$released_version" '$2 == target { print $3; exit }' "$tmpdir/milestones.tsv")"
60
+
61
+ if [ -n "$released_number" ] && [ "$released_state" = "open" ]; then
62
+ gh api "repos/$repo/milestones/$released_number" -X PATCH -f state="closed" >/dev/null
63
+ released_action="closed"
64
+ elif [ -n "$released_number" ]; then
65
+ released_action="already-closed"
66
+ else
67
+ released_action="missing"
68
+ fi
69
+
70
+ ensure_milestone "$next_patch_version" "Issues that we want to release in v$next_patch_version."
71
+ ensure_milestone "$line_milestone" "Issues that we want to resolve in $major.$minor line."
72
+
73
+ if [ "$patch" -eq 0 ]; then
74
+ ensure_milestone "$next_minor_version" "Issues that we want to release in v$next_minor_version."
75
+ ensure_milestone "$next_minor_line" "Issues that we want to resolve in $major.$((minor + 1)) line."
76
+ fi
77
+
78
+ echo "Milestone summary:"
79
+ echo "- Released milestone: $released_version ($released_action)"
80
+ echo "- New milestones created: $created_count"
@@ -0,0 +1,276 @@
1
+ ---
2
+ name: review-task
3
+ description: >
4
+ 审查任务实现代码并输出代码审查报告,按严重程度分类(Blocker / Major / Minor)。
5
+ 当用户在实现完成后要求代码审查时触发。参数:task-id。
6
+ ---
7
+
8
+ # 代码审查
9
+
10
+ ## 行为边界 / 关键规则
11
+
12
+ - 本技能仅读取代码并产出审查报告(`review.md` 或 `review-r{N}.md`)—— 不修改业务代码
13
+ - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
14
+
15
+ ## 执行步骤
16
+
17
+ ### 1. 验证前置条件
18
+
19
+ 检查必要文件:
20
+ - `.agent-workspace/active/{task-id}/task.md` - 任务文件
21
+ - 至少一个实现报告:`implementation.md` 或 `implementation-r{N}.md`
22
+
23
+ 注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
24
+
25
+ 如果任一文件缺失,提示用户先完成前置步骤。
26
+
27
+ ### 2. 确定审查轮次
28
+
29
+ 扫描 `.agent-workspace/active/{task-id}/` 目录中的审查产物文件:
30
+ - 如果不存在 `review.md` 且不存在 `review-r*.md` → 本轮为第 1 轮,产出 `review.md`
31
+ - 如果存在 `review.md` 且不存在 `review-r*.md` → 本轮为第 2 轮,产出 `review-r2.md`
32
+ - 如果存在 `review-r{N}.md` → 本轮为第 N+1 轮,产出 `review-r{N+1}.md`
33
+
34
+ 记录:
35
+ - `{review-round}`:本轮审查轮次
36
+ - `{review-artifact}`:本轮审查报告文件名
37
+
38
+ ### 3. 阅读实现与修复报告
39
+
40
+ 扫描任务目录中的实现报告文件(`implementation.md`、`implementation-r{N}.md`),读取最高轮次的文件以理解:
41
+ - 修改的文件列表
42
+ - 实现的关键功能
43
+ - 测试情况
44
+ - 实现者标记的需关注事项
45
+
46
+ 如果存在修复产物(`refinement.md`、`refinement-r{N}.md`),读取最高轮次的文件以理解:
47
+ - 已修复了哪些审查问题
48
+ - 修复对代码和测试的影响
49
+ - 当前代码状态相对上轮审查的变化
50
+
51
+ ### 4. 执行代码审查
52
+
53
+ 遵循 `.agents/workflows/feature-development.yaml` 中的 `code-review` 步骤:
54
+
55
+ **必要审查领域**:
56
+ - [ ] 代码质量和编码规范(按项目指南)
57
+ - [ ] Bug 和潜在问题检测
58
+ - [ ] 测试覆盖率和测试质量
59
+ - [ ] 错误处理和边界情况
60
+ - [ ] 性能和安全问题
61
+ - [ ] 代码注释和文档
62
+ - [ ] 与技术方案的一致性
63
+
64
+ **审查原则**:
65
+ 1. **严格但公正**:指出问题的同时也肯定做得好的地方
66
+ 2. **具体**:提供准确的文件路径和行号
67
+ 3. **提供建议**:不仅指出问题,还要提供解决方案
68
+ 4. **按严重程度分类**:区分必须修复和可优化项
69
+
70
+ 同时审查 `git diff` 以查看所有变更的上下文。
71
+
72
+ ### 5. 输出审查报告
73
+
74
+ 创建 `.agent-workspace/active/{task-id}/{review-artifact}`。
75
+
76
+ ### 6. 更新任务状态
77
+
78
+ 获取当前时间:
79
+
80
+ ```bash
81
+ date "+%Y-%m-%d %H:%M:%S"
82
+ ```
83
+
84
+ 更新 `.agent-workspace/active/{task-id}/task.md`:
85
+ - `current_step`:code-review
86
+ - `assigned_to`:{审查者}
87
+ - `updated_at`:{当前时间}
88
+ - 记录本轮审查产物:`{review-artifact}`(Round `{review-round}`)
89
+ - 在工作流进度中标记 code-review 为已完成,并注明实际轮次(如果任务模板支持)
90
+ - **追加**到 `## Activity Log`(不要覆盖之前的记录):
91
+ ```
92
+ - {yyyy-MM-dd HH:mm:ss} — **Code Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n} → {artifact-filename}
93
+ ```
94
+
95
+ ### 7. 告知用户
96
+
97
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
98
+
99
+ 根据审查结果输出:
100
+
101
+ **如果通过且无问题**(Major = 0 且 Minor = 0):
102
+ ```
103
+ 任务 {task-id} 代码审查完成。结论:通过。
104
+ - 阻塞项:0 | 主要问题:0 | 次要问题:0
105
+
106
+ 下一步 - 提交代码:
107
+ - Claude Code / OpenCode:/commit
108
+ - Gemini CLI:/agent-infra:commit
109
+ - Codex CLI:$commit
110
+ ```
111
+
112
+ **如果通过但有问题**(Major > 0 或 Minor > 0):
113
+ ```
114
+ 任务 {task-id} 代码审查完成。结论:通过。
115
+ - 阻塞项:0 | 主要问题:{n} | 次要问题:{n}
116
+ - 审查报告:.agent-workspace/active/{task-id}/{review-artifact}
117
+
118
+ 下一步 - 修复问题后提交(推荐):
119
+ - Claude Code / OpenCode:/refine-task {task-id}
120
+ - Gemini CLI:/agent-infra:refine-task {task-id}
121
+ - Codex CLI:$refine-task {task-id}
122
+
123
+ 或直接提交(跳过修复):
124
+ - Claude Code / OpenCode:/commit
125
+ - Gemini CLI:/agent-infra:commit
126
+ - Codex CLI:$commit
127
+ ```
128
+
129
+ **如果需要修改**:
130
+ ```
131
+ 任务 {task-id} 代码审查完成。结论:需要修改。
132
+ - 阻塞项:{n} | 主要问题:{n} | 次要问题:{n}
133
+ - 审查报告:.agent-workspace/active/{task-id}/{review-artifact}
134
+
135
+ 下一步 - 修复问题:
136
+ - Claude Code / OpenCode:/refine-task {task-id}
137
+ - Gemini CLI:/agent-infra:refine-task {task-id}
138
+ - Codex CLI:$refine-task {task-id}
139
+ ```
140
+
141
+ **如果拒绝**:
142
+ ```
143
+ 任务 {task-id} 代码审查完成。结论:拒绝,需要重大返工。
144
+ - 审查报告:.agent-workspace/active/{task-id}/{review-artifact}
145
+
146
+ 下一步 - 重新实现:
147
+ - Claude Code / OpenCode:/implement-task {task-id}
148
+ - Gemini CLI:/agent-infra:implement-task {task-id}
149
+ - Codex CLI:$implement-task {task-id}
150
+ ```
151
+
152
+ ## 输出模板
153
+
154
+ ```markdown
155
+ # 代码审查报告
156
+
157
+ - **审查轮次**:Round {review-round}
158
+ - **产物文件**:`{review-artifact}`
159
+ - **实现输入**:
160
+ - `{implementation-artifact}`
161
+ - `{refinement-artifact}`(如存在)
162
+
163
+ ## 审查摘要
164
+
165
+ - **审查者**:{审查者名称}
166
+ - **审查时间**:{时间戳}
167
+ - **审查范围**:{文件数量和主要模块}
168
+ - **总体结论**:{已批准 / 需要修改 / 拒绝}
169
+
170
+ ## 发现的问题
171
+
172
+ ### 阻塞项(必须修复)
173
+
174
+ #### 1. {问题标题}
175
+ **文件**:`{file-path}:{line-number}`
176
+ **描述**:{详细描述}
177
+ **建议修复**:{具体建议}
178
+ **严重程度**:高
179
+
180
+ ### 主要问题(应该修复)
181
+
182
+ #### 1. {问题标题}
183
+ **文件**:`{file-path}:{line-number}`
184
+ **描述**:{详细描述}
185
+ **建议修复**:{具体建议}
186
+ **严重程度**:中
187
+
188
+ ### 次要问题(可选优化)
189
+
190
+ #### 1. {优化点}
191
+ **文件**:`{file-path}:{line-number}`
192
+ **建议**:{优化建议}
193
+
194
+ ## 亮点
195
+
196
+ - {做得好的方面 1}
197
+ - {做得好的方面 2}
198
+
199
+ ## 规范符合度
200
+
201
+ ### 编码规范
202
+ - [ ] 命名规范
203
+ - [ ] 代码风格
204
+ - [ ] 注释规范
205
+ - [ ] 测试规范
206
+
207
+ ### 代码质量指标
208
+ - 圈复杂度:{评估}
209
+ - 代码重复:{评估}
210
+ - 测试覆盖率:{百分比或评估}
211
+
212
+ ## 测试审查
213
+
214
+ ### 测试覆盖率
215
+ - 单元测试:{评估}
216
+ - 边界情况:{是否覆盖?}
217
+ - 错误场景:{是否覆盖?}
218
+
219
+ ### 测试质量
220
+ - 测试命名:{评估}
221
+ - 断言充分性:{评估}
222
+ - 测试独立性:{评估}
223
+
224
+ ## 安全审查
225
+
226
+ - SQL 注入风险:{检查结果}
227
+ - XSS 风险:{检查结果}
228
+ - 访问控制:{检查结果}
229
+ - 敏感数据暴露:{检查结果}
230
+
231
+ ## 性能审查
232
+
233
+ - 算法复杂度:{评估}
234
+ - 资源管理:{检查结果}
235
+ - 潜在瓶颈:{评估}
236
+
237
+ ## 与方案的一致性
238
+
239
+ - [ ] 实现与技术方案一致
240
+ - [ ] 没有偏离设计意图
241
+ - [ ] 没有添加计划外的功能
242
+
243
+ ## 结论和建议
244
+
245
+ ### 审批决定
246
+ - [ ] 通过 - 无阻塞问题
247
+ - [ ] 需要修改 - 有需要解决的问题
248
+ - [ ] 拒绝 - 需要重大返工
249
+
250
+ ### 后续步骤
251
+ {基于审查结果的建议}
252
+ ```
253
+
254
+ ## 完成检查清单
255
+
256
+ - [ ] 完成了所有修改文件的代码审查
257
+ - [ ] 创建了审查报告 `.agent-workspace/active/{task-id}/{review-artifact}`
258
+ - [ ] 更新了 task.md 中的 `current_step` 为 code-review
259
+ - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
260
+ - [ ] 更新了 task.md 中的 `assigned_to` 为审查者名称
261
+ - [ ] 追加了 Activity Log 条目到 task.md
262
+ - [ ] 在工作流进度中标记了 code-review 为已完成
263
+ - [ ] 根据审查结果告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
264
+
265
+ ## 注意事项
266
+
267
+ 1. **前置条件**:必须已完成至少一轮实现(`implementation.md` 或 `implementation-r{N}.md` 存在)
268
+ 2. **客观性**:严格但公正;在指出问题的同时肯定优秀的工作
269
+ 3. **具体性**:始终引用准确的文件路径和行号
270
+ 4. **严重程度分类**:阻塞项必须修复;主要问题应该修复;次要问题为可选
271
+ 5. **版本化规则**:首轮审查使用 `review.md`;后续轮次使用 `review-r{N}.md`
272
+
273
+ ## 错误处理
274
+
275
+ - 任务未找到:提示 "Task {task-id} not found"
276
+ - 缺少实现报告:提示 "Implementation report not found, please run the implement-task skill first"