@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,119 @@
1
+ ---
2
+ name: import-issue
3
+ description: >
4
+ 从 GitHub Issue 导入并创建任务文件。
5
+ 当用户要求导入某个 Issue 时触发。参数:issue 编号。
6
+ ---
7
+
8
+ # 导入 Issue
9
+
10
+ 导入指定的 GitHub Issue 并创建任务。参数:issue 编号。
11
+
12
+ ## 行为边界 / 关键规则
13
+
14
+ - 本技能的唯一产出是 `task.md`
15
+ - 不要编写或修改业务代码。仅做导入
16
+ - 执行本技能后,你**必须**立即更新任务状态
17
+
18
+ ## 执行流程
19
+
20
+ ### 1. 获取 Issue 信息
21
+
22
+ ```bash
23
+ gh issue view <issue-number> --json number,title,body,labels
24
+ ```
25
+
26
+ 提取:issue 编号、标题、描述、标签。
27
+
28
+ ### 2. 检查已有任务
29
+
30
+ 搜索 `.agent-workspace/active/` 中是否已有链接到此 Issue 的任务。
31
+ - 如果找到,询问用户是重新导入还是继续使用现有任务
32
+ - 如果未找到,创建新任务
33
+
34
+ ### 3. 创建任务目录和文件
35
+
36
+ ```bash
37
+ date +%Y%m%d-%H%M%S
38
+ ```
39
+
40
+ - 创建目录:`.agent-workspace/active/TASK-{yyyyMMdd-HHmmss}/`
41
+ - 使用 `.agents/templates/task.md` 模板创建 `task.md`
42
+
43
+ 任务元数据:
44
+ ```yaml
45
+ id: TASK-{yyyyMMdd-HHmmss}
46
+ issue_number: <issue-number>
47
+ type: feature|bugfix|refactor|docs|chore
48
+ workflow: feature-development|bug-fix|refactoring
49
+ status: active
50
+ created_at: {yyyy-MM-dd HH:mm:ss}
51
+ updated_at: {yyyy-MM-dd HH:mm:ss}
52
+ created_by: human
53
+ current_step: requirement-analysis
54
+ assigned_to: {当前 AI 代理}
55
+ ```
56
+
57
+ ### 4. 更新任务状态
58
+
59
+ 获取当前时间:
60
+
61
+ ```bash
62
+ date "+%Y-%m-%d %H:%M:%S"
63
+ ```
64
+
65
+ 更新 `.agent-workspace/active/{task-id}/task.md`:
66
+ - `current_step`:requirement-analysis
67
+ - `assigned_to`:{当前 AI 代理}
68
+ - `updated_at`:{当前时间}
69
+ - **追加**到 `## Activity Log`(不要覆盖之前的记录):
70
+ ```
71
+ - {yyyy-MM-dd HH:mm:ss} — **Import Issue** by {agent} — Issue #{number} imported
72
+ ```
73
+
74
+ ### 5. 告知用户
75
+
76
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
77
+
78
+ ```
79
+ Issue #{number} 已导入。
80
+
81
+ 任务信息:
82
+ - 任务 ID:{task-id}
83
+ - 标题:{title}
84
+ - 工作流:{workflow}
85
+
86
+ 产出文件:
87
+ - 任务文件:.agent-workspace/active/{task-id}/task.md
88
+
89
+ 下一步 - 执行需求分析:
90
+ - Claude Code / OpenCode:/analyze-task {task-id}
91
+ - Gemini CLI:/agent-infra:analyze-task {task-id}
92
+ - Codex CLI:$analyze-task {task-id}
93
+ ```
94
+
95
+ ## 完成检查清单
96
+
97
+ - [ ] 创建了任务文件 `.agent-workspace/active/{task-id}/task.md`
98
+ - [ ] 在 task.md 中记录了 issue_number
99
+ - [ ] 更新了 `current_step` 为 requirement-analysis
100
+ - [ ] 更新了 `updated_at` 为当前时间
101
+ - [ ] 追加了 Activity Log 条目到 task.md
102
+ - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
103
+ - [ ] **没有修改任何业务代码**
104
+
105
+ ## 停止
106
+
107
+ 完成检查清单后,**立即停止**。不要继续执行后续步骤。
108
+
109
+ ## 注意事项
110
+
111
+ 1. **Issue 验证**:在继续之前检查 Issue 是否存在
112
+ 2. **重复任务**:如果此 Issue 已有关联任务,在创建新任务前询问用户
113
+ 3. **下一步**:导入完成后,先执行 `analyze-task`,再进入 `plan-task`
114
+
115
+ ## 错误处理
116
+
117
+ - Issue 未找到:提示 "Issue #{number} not found, please check the issue number"
118
+ - 网络错误:提示 "Cannot connect to GitHub, please check network"
119
+ - 权限错误:提示 "No access to this repository"
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: import-issue
3
+ description: >
4
+ 从 GitHub Issue 导入并创建任务文件。
5
+ 当用户要求导入某个 Issue 时触发。参数:issue 编号。
6
+ ---
7
+
8
+ # 导入 Issue
9
+
10
+ 导入指定的 GitHub Issue 并创建任务。参数:issue 编号。
11
+
12
+ ## 行为边界 / 关键规则
13
+
14
+ - 本技能的唯一产出是 `task.md`
15
+ - 不要编写或修改业务代码。仅做导入
16
+ - 执行本技能后,你**必须**立即更新任务状态
17
+
18
+ ## 执行流程
19
+
20
+ ### 1. 获取 Issue 信息
21
+
22
+ ```bash
23
+ gh issue view <issue-number> --json number,title,body,labels
24
+ ```
25
+
26
+ 提取:issue 编号、标题、描述、标签。
27
+
28
+ ### 2. 检查已有任务
29
+
30
+ 搜索 `.agent-workspace/active/` 中是否已有链接到此 Issue 的任务。
31
+ - 如果找到,询问用户是重新导入还是继续使用现有任务
32
+ - 如果未找到,创建新任务
33
+
34
+ ### 3. 创建任务目录和文件
35
+
36
+ ```bash
37
+ date +%Y%m%d-%H%M%S
38
+ ```
39
+
40
+ - 创建目录:`.agent-workspace/active/TASK-{yyyyMMdd-HHmmss}/`
41
+ - 使用 `.agents/templates/task.md` 模板创建 `task.md`
42
+
43
+ 任务元数据:
44
+ ```yaml
45
+ id: TASK-{yyyyMMdd-HHmmss}
46
+ issue_number: <issue-number>
47
+ type: feature|bugfix|refactor|docs|chore
48
+ workflow: feature-development|bug-fix|refactoring
49
+ status: active
50
+ created_at: {yyyy-MM-dd HH:mm:ss}
51
+ updated_at: {yyyy-MM-dd HH:mm:ss}
52
+ created_by: human
53
+ current_step: requirement-analysis
54
+ assigned_to: {当前 AI 代理}
55
+ ```
56
+
57
+ ### 4. 更新任务状态
58
+
59
+ 获取当前时间:
60
+
61
+ ```bash
62
+ date "+%Y-%m-%d %H:%M:%S"
63
+ ```
64
+
65
+ 更新 `.agent-workspace/active/{task-id}/task.md`:
66
+ - `current_step`:requirement-analysis
67
+ - `assigned_to`:{当前 AI 代理}
68
+ - `updated_at`:{当前时间}
69
+ - **追加**到 `## Activity Log`(不要覆盖之前的记录):
70
+ ```
71
+ - {yyyy-MM-dd HH:mm:ss} — **Import Issue** by {agent} — Issue #{number} imported
72
+ ```
73
+
74
+ ### 5. 告知用户
75
+
76
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
77
+
78
+ ```
79
+ Issue #{number} 已导入。
80
+
81
+ 任务信息:
82
+ - 任务 ID:{task-id}
83
+ - 标题:{title}
84
+ - 工作流:{workflow}
85
+
86
+ 产出文件:
87
+ - 任务文件:.agent-workspace/active/{task-id}/task.md
88
+
89
+ 下一步 - 执行需求分析:
90
+ - Claude Code / OpenCode:/analyze-task {task-id}
91
+ - Gemini CLI:/agent-infra:analyze-task {task-id}
92
+ - Codex CLI:$analyze-task {task-id}
93
+ ```
94
+
95
+ ## 完成检查清单
96
+
97
+ - [ ] 创建了任务文件 `.agent-workspace/active/{task-id}/task.md`
98
+ - [ ] 在 task.md 中记录了 issue_number
99
+ - [ ] 更新了 `current_step` 为 requirement-analysis
100
+ - [ ] 更新了 `updated_at` 为当前时间
101
+ - [ ] 追加了 Activity Log 条目到 task.md
102
+ - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
103
+ - [ ] **没有修改任何业务代码**
104
+
105
+ ## 停止
106
+
107
+ 完成检查清单后,**立即停止**。不要继续执行后续步骤。
108
+
109
+ ## 注意事项
110
+
111
+ 1. **Issue 验证**:在继续之前检查 Issue 是否存在
112
+ 2. **重复任务**:如果此 Issue 已有关联任务,在创建新任务前询问用户
113
+ 3. **下一步**:导入完成后,先执行 `analyze-task`,再进入 `plan-task`
114
+
115
+ ## 错误处理
116
+
117
+ - Issue 未找到:提示 "Issue #{number} not found, please check the issue number"
118
+ - 网络错误:提示 "Cannot connect to GitHub, please check network"
119
+ - 权限错误:提示 "No access to this repository"
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: init-labels
3
+ description: >
4
+ Initialize the repository's standard GitHub Labels taxonomy in one pass.
5
+ Create the common labels, auto-detect `in:` labels from the project structure,
6
+ do not create `theme:` labels, overwrite exact-match GitHub defaults, and report unmatched defaults.
7
+ ---
8
+
9
+ # Initialize GitHub Labels
10
+
11
+ Initialize the repository's standard GitHub Labels taxonomy.
12
+
13
+ ## Execution Flow
14
+
15
+ ### 1. Verify prerequisites
16
+
17
+ Confirm that:
18
+ - `gh` is installed
19
+ - `gh auth token` succeeds
20
+ - `gh repo view --json nameWithOwner` can access the current repository
21
+
22
+ If any prerequisite fails, stop and report the matching error.
23
+
24
+ ### 2. Run the bootstrap script
25
+
26
+ Execute the complete label initialization flow with:
27
+
28
+ ```bash
29
+ bash .agents/skills/init-labels/scripts/init-labels.sh
30
+ ```
31
+
32
+ The script is responsible for:
33
+ - Capturing the current label snapshot before making changes
34
+ - Creating or updating the standard label set with `gh label create --force`
35
+ - Auto-detecting top-level directories and creating one `in:` label per valid directory
36
+ - Falling back to `in: core` when no eligible directory is detected
37
+ - Reporting unmatched GitHub default labels such as `question` and `wontfix`
38
+ - Printing the final execution summary
39
+
40
+ ### 3. Standard taxonomy
41
+
42
+ The script manages these common label families:
43
+ - `type:` labels such as `type: bug`, `type: enhancement`, `type: feature`, `type: documentation`, `type: dependency-upgrade`, and `type: task`
44
+ - `status:` labels such as `status: waiting-for-triage`, `status: in-progress`, and `status: waiting-for-internal-feedback`
45
+ - GitHub-default-name labels intentionally overwritten in place: `good first issue` and `help wanted`
46
+ - Additional shared labels such as `dependencies`
47
+
48
+ ### 4. Scope discovery rules
49
+
50
+ Directory-derived labels follow these rules:
51
+ - Detect top-level project directories only
52
+ - Skip hidden directories and common generated folders
53
+ - Create `in: core` only when no valid directory remains
54
+ - Do not create any `theme:` labels in this skill
55
+
56
+ ### 5. Output and behavior guarantees
57
+
58
+ The summary must include:
59
+ - Number of common labels created or updated
60
+ - Number of `in:` labels created or updated
61
+ - Confirmation that exact-match GitHub defaults were overwritten
62
+ - Any unmatched GitHub default labels still present
63
+
64
+ Operational notes:
65
+ - The operation is idempotent because every label uses `gh label create --force`.
66
+ - If the detected `in:` labels need refinement, adjust them manually after initialization.
67
+
68
+ ## Error Handling
69
+
70
+ - `gh` not found: prompt "GitHub CLI (`gh`) is not installed"
71
+ - Authentication failed: prompt "GitHub CLI is not authenticated"
72
+ - Repository access failed: prompt "Unable to access the current repository with gh"
73
+ - Permission error: prompt "No permission to manage labels in this repository"
74
+ - API rate limit: prompt "GitHub API rate limit reached, please retry later"
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: init-labels
3
+ description: >
4
+ 一次性初始化仓库的标准 GitHub Labels 体系。
5
+ 创建通用 labels、基于项目目录结构自动探测 `in:` labels、
6
+ 不创建 `theme:` labels、覆盖名称完全匹配的 GitHub 默认 labels,并提示未覆盖的默认 labels。
7
+ ---
8
+
9
+ # 初始化 GitHub Labels
10
+
11
+ 一次性初始化仓库的标准 GitHub Labels 体系。
12
+
13
+ ## 执行流程
14
+
15
+ ### 1. 验证前置条件
16
+
17
+ 确认以下条件成立:
18
+ - 已安装 `gh`
19
+ - `gh auth token` 执行成功
20
+ - `gh repo view --json nameWithOwner` 可以访问当前仓库
21
+
22
+ 如果任一条件失败,停止并输出对应错误。
23
+
24
+ ### 2. 运行初始化脚本
25
+
26
+ 执行以下命令,完成整套 label 初始化流程:
27
+
28
+ ```bash
29
+ bash .agents/skills/init-labels/scripts/init-labels.sh
30
+ ```
31
+
32
+ 脚本负责:
33
+ - 在修改前保存当前 label 快照
34
+ - 使用 `gh label create --force` 创建或更新标准 label 集合
35
+ - 自动探测顶层目录,并为有效目录创建对应的 `in:` label
36
+ - 在没有可用目录时回退到 `in: core`
37
+ - 提示仍然存在的 GitHub 默认 labels,例如 `question` 和 `wontfix`
38
+ - 输出最终执行摘要
39
+
40
+ ### 3. 标准分类体系
41
+
42
+ 脚本管理以下通用 label 族:
43
+ - `type:` labels,例如 `type: bug`、`type: enhancement`、`type: feature`、`type: documentation`、`type: dependency-upgrade`、`type: task`
44
+ - `status:` labels,例如 `status: waiting-for-triage`、`status: in-progress`、`status: waiting-for-internal-feedback`
45
+ - 明确覆盖的 GitHub 默认同名 labels:`good first issue` 和 `help wanted`
46
+ - 额外通用 labels,例如 `dependencies`
47
+
48
+ ### 4. 范围探测规则
49
+
50
+ 目录派生 label 遵循以下规则:
51
+ - 只探测项目顶层目录
52
+ - 排除隐藏目录和常见构建/缓存目录
53
+ - 仅当没有有效目录时才创建 `in: core`
54
+ - 本技能不创建任何 `theme:` labels
55
+
56
+ ### 5. 输出与行为保证
57
+
58
+ 摘要必须包含:
59
+ - 创建或更新的通用 labels 数量
60
+ - 创建或更新的 `in:` labels 数量
61
+ - 名称完全匹配的 GitHub 默认 labels 已被覆盖的说明
62
+ - 仍然存在的未匹配 GitHub 默认 labels
63
+
64
+ 执行说明:
65
+ - 整个操作具备幂等性,因为每个 label 都使用 `gh label create --force`。
66
+ - 如果自动探测出的 `in:` labels 需要细化,请在初始化后手动调整。
67
+
68
+ ## 错误处理
69
+
70
+ - 未找到 `gh`:提示 "GitHub CLI (`gh`) is not installed"
71
+ - 认证失败:提示 "GitHub CLI is not authenticated"
72
+ - 仓库访问失败:提示 "Unable to access the current repository with gh"
73
+ - 权限不足:提示 "No permission to manage labels in this repository"
74
+ - API 限流:提示 "GitHub API rate limit reached, please retry later"
@@ -0,0 +1,111 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+
5
+ if ! command -v gh >/dev/null 2>&1; then
6
+ echo "GitHub CLI (\`gh\`) is not installed"
7
+ exit 1
8
+ fi
9
+
10
+ if ! gh auth token >/dev/null 2>&1; then
11
+ echo "GitHub CLI is not authenticated"
12
+ exit 1
13
+ fi
14
+
15
+ if ! gh repo view --json nameWithOwner >/dev/null 2>&1; then
16
+ echo "Unable to access the current repository with gh"
17
+ exit 1
18
+ fi
19
+
20
+ tmpdir="$(mktemp -d)"
21
+ trap 'rm -rf "$tmpdir"' EXIT HUP INT TERM
22
+
23
+ gh label list --limit 200 --json name --jq '.[].name' > "$tmpdir/existing-names.txt"
24
+ cp "$tmpdir/existing-names.txt" "$tmpdir/existing.txt"
25
+ echo "Existing labels:"
26
+ cat "$tmpdir/existing-names.txt"
27
+
28
+ cat <<'EOF' > "$tmpdir/common.tsv"
29
+ type: bug DED6F9 A general bug
30
+ type: enhancement DED6F9 A general enhancement
31
+ type: feature DED6F9 A general feature
32
+ type: documentation DED6F9 A documentation task
33
+ type: dependency-upgrade DED6F9 A dependency upgrade
34
+ type: task DED6F9 A general task
35
+ status: waiting-for-triage FCF1C4 An issue we've not yet triaged or decided on
36
+ status: waiting-for-feedback FCF1C4 We need additional information before we can continue
37
+ status: feedback-provided FCF1C4 Feedback has been provided
38
+ status: feedback-reminder FCF1C4 We've sent a reminder that we need additional information before we can continue
39
+ status: pending-design-work FCF1C4 Needs design work before any code can be developed
40
+ status: in-progress FCF1C4 Work is actively being developed
41
+ status: on-hold FCF1C4 We can't start working on this issue yet
42
+ status: blocked FCF1C4 An issue that's blocked on an external project change
43
+ status: declined FCF1C4 A suggestion or change that we don't feel we should currently apply
44
+ status: duplicate FCF1C4 A duplicate of another issue
45
+ status: invalid FCF1C4 An issue that we don't feel is valid
46
+ status: superseded FCF1C4 An issue that has been superseded by another
47
+ status: bulk-closed FCF1C4 An outdated, unresolved issue that's closed in bulk as part of a cleaning process
48
+ status: ideal-for-contribution FCF1C4 An issue that a contributor can help us with
49
+ status: backported FCF1C4 An issue that has been backported to maintenance branches
50
+ status: waiting-for-internal-feedback FCF1C4 An issue that needs input from a member or another team
51
+ good first issue F9D9E6 Good for newcomers
52
+ help wanted 008672 Extra attention is needed
53
+ dependencies 0366d6 Pull requests that update a dependency file
54
+ EOF
55
+
56
+ while IFS="$(printf '\t')" read -r name color description; do
57
+ [ -n "$name" ] || continue
58
+ gh label create "$name" --color "$color" --description "$description" --force
59
+ done < "$tmpdir/common.tsv"
60
+
61
+ project_dirs=$(
62
+ find . -mindepth 1 -maxdepth 1 -type d ! -name '.*' |
63
+ sed 's#^\./##' |
64
+ grep -Ev '^(node_modules|vendor|dist|build|out|target|tmp|temp|log|logs|coverage|__pycache__)$' |
65
+ sort -u
66
+ )
67
+
68
+ if [ -z "$project_dirs" ]; then
69
+ project_dirs="core"
70
+ fi
71
+
72
+ printf '%s\n' "$project_dirs" | while IFS= read -r dir; do
73
+ [ -n "$dir" ] || continue
74
+ gh label create "in: $dir" \
75
+ --color EBF8DF \
76
+ --description "Issues in $dir" \
77
+ --force
78
+ done
79
+
80
+ gh label list --limit 200 --json name --jq '.[].name' > "$tmpdir/final-names.txt"
81
+ cp "$tmpdir/final-names.txt" "$tmpdir/final.txt"
82
+
83
+ : > "$tmpdir/unmatched-defaults.txt"
84
+ for label in bug documentation duplicate enhancement invalid question wontfix; do
85
+ if grep -Fqx "$label" "$tmpdir/final-names.txt"; then
86
+ printf '%s\n' "$label" >> "$tmpdir/unmatched-defaults.txt"
87
+ fi
88
+ done
89
+
90
+ common_count="$(wc -l < "$tmpdir/common.tsv" | tr -d ' ')"
91
+ in_count="$(printf '%s\n' "$project_dirs" | sed '/^$/d' | wc -l | tr -d ' ')"
92
+
93
+ echo "GitHub Labels initialized."
94
+ echo
95
+ echo "Summary:"
96
+ echo "- Common labels created or updated: $common_count"
97
+ echo "- in: labels created or updated: $in_count"
98
+ echo "- Exact-match GitHub defaults overwritten: good first issue, help wanted"
99
+
100
+ if [ -s "$tmpdir/unmatched-defaults.txt" ]; then
101
+ echo "- Unmatched GitHub defaults still present:"
102
+ sed 's/^/ - /' "$tmpdir/unmatched-defaults.txt"
103
+ else
104
+ echo "- Unmatched GitHub defaults still present: none"
105
+ fi
106
+
107
+ echo
108
+ echo "Notes:"
109
+ echo "- theme: labels were intentionally not created."
110
+ echo "- The operation is idempotent because every label uses gh label create --force."
111
+ echo "- If the detected in: labels need refinement, adjust them manually after initialization."
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: init-milestones
3
+ description: >
4
+ Initialize the repository's standard GitHub Milestones taxonomy in one pass.
5
+ Create General Backlog, the initial milestones derived from the current version baseline, and optionally backfill historical milestones.
6
+ ---
7
+
8
+ # Initialize GitHub Milestones
9
+
10
+ Initialize the repository's standard GitHub Milestones taxonomy.
11
+
12
+ ## Execution Flow
13
+
14
+ ### 1. Verify prerequisites
15
+
16
+ Confirm that:
17
+ - `gh` is installed
18
+ - `gh auth token` succeeds
19
+ - `gh repo view --json nameWithOwner` can access the current repository
20
+
21
+ If any prerequisite fails, stop and report the matching error.
22
+
23
+ ### 2. Run the bootstrap script
24
+
25
+ Execute the complete milestone initialization flow with:
26
+
27
+ ```bash
28
+ bash .agents/skills/init-milestones/scripts/init-milestones.sh "$ARGUMENTS"
29
+ ```
30
+
31
+ The script is responsible for:
32
+ - Creating and cleaning up a temporary workspace
33
+ - Detecting whether `--history` was requested
34
+ - Resolving the version baseline from the latest `v*` Git tag, then `package.json`, then defaulting to `0.1.0`
35
+ - Listing current milestones with `gh api "repos/$repo/milestones"`
36
+ - Building the desired milestone set and creating only the missing titles
37
+ - Printing the final execution summary
38
+
39
+ ### 3. Standard milestone definitions
40
+
41
+ Create the following milestones with fixed descriptions:
42
+ - `General Backlog`: `All unsorted backlogged tasks may be completed in a future version.` (state=`open`)
43
+ - `{major}.{minor}.x`: `Issues that we want to resolve in {major}.{minor} line.` (state=`open`)
44
+ - `{major}.{minor}.{patch+1}`: `Issues that we want to release in v{major}.{minor}.{patch+1}.` (state=`open`)
45
+
46
+ When `--history` is present, each historical `vX.Y.Z` tag additionally contributes:
47
+ - `X.Y.x` as an open line milestone
48
+ - `X.Y.Z` as a closed release milestone (`state=closed`)
49
+
50
+ ### 4. Output and behavior guarantees
51
+
52
+ The summary must include:
53
+ - Version baseline
54
+ - Whether `--history` was enabled
55
+ - Created and skipped milestone counts
56
+ - Newly created milestone titles
57
+ - Already present milestone titles
58
+
59
+ Operational notes:
60
+ - Milestone titles are treated as the idempotency key.
61
+ - General Backlog is the fallback milestone for unsorted work.
62
+ - Without `--history`, version milestones are created only for the next patch release.
63
+ - Historical `X.Y.Z` tags create `X.Y.x` milestones as open and `X.Y.Z` milestones as closed.
64
+ - Repositories with many tags may hit the GitHub API rate limit.
65
+
66
+ ## Error Handling
67
+
68
+ - `gh` not found: prompt "GitHub CLI (`gh`) is not installed"
69
+ - Authentication failed: prompt "GitHub CLI is not authenticated"
70
+ - Repository access failed: prompt "Unable to access the current repository with gh"
71
+ - Version detection failed: prompt "Unable to determine current version baseline"
72
+ - No `v*` tags found in `--history` mode: prompt "No history tags found matching v*; only standard milestones will be created"
73
+ - Permission error: prompt "No permission to manage milestones in this repository"
74
+ - API rate limit: prompt "GitHub API rate limit reached, please retry later"
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: init-milestones
3
+ description: >
4
+ 一次性初始化仓库的标准 GitHub Milestones 体系。
5
+ 创建 General Backlog、基于当前版本的初始里程碑,并可选补齐历史版本里程碑。
6
+ ---
7
+
8
+ # 初始化 GitHub Milestones
9
+
10
+ 一次性初始化仓库的标准 GitHub Milestones 体系。
11
+
12
+ ## 执行流程
13
+
14
+ ### 1. 验证前置条件
15
+
16
+ 确认以下条件成立:
17
+ - 已安装 `gh`
18
+ - `gh auth token` 执行成功
19
+ - `gh repo view --json nameWithOwner` 可以访问当前仓库
20
+
21
+ 如果任一条件失败,停止并输出对应错误。
22
+
23
+ ### 2. 运行初始化脚本
24
+
25
+ 执行以下命令,完成整套里程碑初始化流程:
26
+
27
+ ```bash
28
+ bash .agents/skills/init-milestones/scripts/init-milestones.sh "$ARGUMENTS"
29
+ ```
30
+
31
+ 脚本负责:
32
+ - 创建并清理临时工作目录
33
+ - 检测是否传入 `--history`
34
+ - 按“最新 `v*` Git tag → `package.json` → 默认 `0.1.0`”解析版本基线
35
+ - 使用 `gh api "repos/$repo/milestones"` 读取当前里程碑
36
+ - 构建目标里程碑集合,并且只创建缺失标题
37
+ - 输出最终执行摘要
38
+
39
+ ### 3. 标准里程碑定义
40
+
41
+ 按固定描述创建以下里程碑:
42
+ - `General Backlog`:`All unsorted backlogged tasks may be completed in a future version.`(state=`open`)
43
+ - `{major}.{minor}.x`:`Issues that we want to resolve in {major}.{minor} line.`(state=`open`)
44
+ - `{major}.{minor}.{patch+1}`:`Issues that we want to release in v{major}.{minor}.{patch+1}.`(state=`open`)
45
+
46
+ 当传入 `--history` 时,每个历史 `vX.Y.Z` tag 还会额外贡献:
47
+ - `X.Y.x` 作为开启状态的线里程碑
48
+ - `X.Y.Z` 作为关闭状态的版本里程碑(`state=closed`)
49
+
50
+ ### 4. 输出与行为保证
51
+
52
+ 摘要必须包含:
53
+ - 版本基线
54
+ - 是否启用 `--history`
55
+ - 创建与跳过的里程碑数量
56
+ - 新创建的里程碑标题
57
+ - 已存在的里程碑标题
58
+
59
+ 执行说明:
60
+ - Milestone titles are treated as the idempotency key.
61
+ - General Backlog 是未分类工作的兜底里程碑。
62
+ - 不带 `--history` 时,只为下一次 patch 发布创建版本里程碑。
63
+ - 历史 `X.Y.Z` tag 会生成开启状态的 `X.Y.x` 和关闭状态的 `X.Y.Z`。
64
+ - 标签较多的仓库可能触发 GitHub API rate limit。
65
+
66
+ ## 错误处理
67
+
68
+ - 未找到 `gh`:提示 "GitHub CLI (`gh`) is not installed"
69
+ - 认证失败:提示 "GitHub CLI is not authenticated"
70
+ - 仓库访问失败:提示 "Unable to access the current repository with gh"
71
+ - 版本解析失败:提示 "Unable to determine current version baseline"
72
+ - `--history` 模式下未找到任何 `v*` git tags:提示 "No history tags found matching v*; only standard milestones will be created"
73
+ - 权限不足:提示 "No permission to manage milestones in this repository"
74
+ - API 限流:提示 "GitHub API rate limit reached, please retry later"