@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,126 @@
1
+ ---
2
+ name: create-pr
3
+ description: >
4
+ Create a Pull Request to the specified or auto-detected target branch.
5
+ Triggered when the user requests PR creation.
6
+ Optional argument: target branch.
7
+ ---
8
+
9
+ # Create Pull Request
10
+
11
+ Create a Pull Request. Optional argument: target branch.
12
+
13
+ ## Execution Flow
14
+
15
+ ### 1. Determine Target Branch
16
+
17
+ - If user provided an argument (e.g. `main`, `develop`, `3.6.x`), use it as target branch
18
+ - If no argument, auto-detect:
19
+ ```bash
20
+ git branch --show-current
21
+ git log --oneline --decorate --first-parent -20
22
+ ```
23
+ **Detection rules**:
24
+ - Currently on a main/trunk branch -> target is that branch
25
+ - Currently on a feature branch -> find the nearest parent branch from log decorations
26
+ - Cannot determine -> ask the user
27
+
28
+ ### 2. Read PR Template
29
+
30
+ Read `.github/PULL_REQUEST_TEMPLATE.md` from the repository.
31
+
32
+ If the template doesn't exist, use a standard format.
33
+
34
+ ### 3. Review Recent Merged PRs for Reference
35
+
36
+ ```bash
37
+ gh pr list --limit 3 --state merged --json number,title,body
38
+ ```
39
+
40
+ Use these as style and format reference.
41
+
42
+ ### 4. Analyze Current Branch Changes
43
+
44
+ ```bash
45
+ git status
46
+ git log <target-branch>..HEAD --oneline
47
+ git diff <target-branch>...HEAD --stat
48
+ git diff <target-branch>...HEAD
49
+ ```
50
+
51
+ Understand all commits and changes that will be in this PR. Look at ALL commits, not just the latest one.
52
+
53
+ ### 5. Check Remote Branch Status
54
+
55
+ ```bash
56
+ git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null
57
+ ```
58
+
59
+ ### 6. Push If Not Yet Pushed
60
+
61
+ ```bash
62
+ git push -u origin <current-branch>
63
+ ```
64
+
65
+ ### 7. Create PR
66
+
67
+ - Follow `.github/PULL_REQUEST_TEMPLATE.md` format for all sections
68
+ - Reference recent merged PRs for style
69
+ - Use HEREDOC format to pass the body
70
+ - PR must end with: `Generated with AI assistance`
71
+
72
+ ```bash
73
+ gh pr create --base <target-branch> --title "<title>" --body "$(cat <<'EOF'
74
+ <Complete PR description following template>
75
+
76
+ Generated with AI assistance
77
+ EOF
78
+ )"
79
+ ```
80
+
81
+ ### 8. Update Task Status (If Task-Related)
82
+
83
+ Get the current time:
84
+
85
+ ```bash
86
+ date "+%Y-%m-%d %H:%M:%S"
87
+ ```
88
+
89
+ If there is an active task for this work, update `.agent-workspace/active/{task-id}/task.md`:
90
+ - `pr_number`: {pr-number}
91
+ - `updated_at`: {current time}
92
+ - **Append** to `## Activity Log` (do NOT overwrite previous entries):
93
+ ```
94
+ - {yyyy-MM-dd HH:mm:ss} — **PR Created** by {agent} — PR #{pr-number} created
95
+ ```
96
+
97
+ ### 9. Output Result
98
+
99
+ > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
100
+
101
+ ```
102
+ PR created: {pr-url}
103
+
104
+ Next steps (if in task workflow):
105
+ - Sync progress:
106
+ - Claude Code / OpenCode: /sync-pr {task-id}
107
+ - Gemini CLI: /{{project}}:sync-pr {task-id}
108
+ - Codex CLI: $sync-pr {task-id}
109
+ - Complete task:
110
+ - Claude Code / OpenCode: /complete-task {task-id}
111
+ - Gemini CLI: /{{project}}:complete-task {task-id}
112
+ - Codex CLI: $complete-task {task-id}
113
+ ```
114
+
115
+ ## Notes
116
+
117
+ 1. **Follow PR template**: Fill in all required sections from the template
118
+ 2. **Reference style**: Match the format and style of recent merged PRs
119
+ 3. **Title format**: Follow Conventional Commits or project conventions
120
+ 4. **All commits matter**: Analyze ALL commits in the branch, not just the latest
121
+
122
+ ## Error Handling
123
+
124
+ - No commits to push: Prompt "No commits found between {target} and HEAD"
125
+ - Push rejected: Suggest `git pull --rebase` first
126
+ - PR already exists: Show existing PR URL
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: create-pr
3
+ description: >
4
+ 创建 Pull Request 到指定或自动推断的目标分支。
5
+ 当用户要求创建 PR 时触发。可选参数:目标分支。
6
+ ---
7
+
8
+ # 创建 Pull Request
9
+
10
+ 创建 Pull Request。可选参数:目标分支。
11
+
12
+ ## 执行流程
13
+
14
+ ### 1. 确定目标分支
15
+
16
+ - 如果用户提供了参数(例如 `main`、`develop`、`3.6.x`),使用其作为目标分支
17
+ - 如果没有参数,自动检测:
18
+ ```bash
19
+ git branch --show-current
20
+ git log --oneline --decorate --first-parent -20
21
+ ```
22
+ **检测规则**:
23
+ - 当前在 main/trunk 分支 -> 目标是该分支
24
+ - 当前在 feature 分支 -> 从日志装饰中找到最近的父分支
25
+ - 无法确定 -> 询问用户
26
+
27
+ ### 2. 读取 PR 模板
28
+
29
+ 从仓库中读取 `.github/PULL_REQUEST_TEMPLATE.md`。
30
+
31
+ 如果模板不存在,使用标准格式。
32
+
33
+ ### 3. 参考最近合并的 PR
34
+
35
+ ```bash
36
+ gh pr list --limit 3 --state merged --json number,title,body
37
+ ```
38
+
39
+ 以此作为风格和格式参考。
40
+
41
+ ### 4. 分析当前分支变更
42
+
43
+ ```bash
44
+ git status
45
+ git log <target-branch>..HEAD --oneline
46
+ git diff <target-branch>...HEAD --stat
47
+ git diff <target-branch>...HEAD
48
+ ```
49
+
50
+ 理解将包含在此 PR 中的所有提交和变更。查看**所有**提交,而不仅仅是最新的。
51
+
52
+ ### 5. 检查远程分支状态
53
+
54
+ ```bash
55
+ git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null
56
+ ```
57
+
58
+ ### 6. 如未推送则先推送
59
+
60
+ ```bash
61
+ git push -u origin <current-branch>
62
+ ```
63
+
64
+ ### 7. 创建 PR
65
+
66
+ - 遵循 `.github/PULL_REQUEST_TEMPLATE.md` 格式填写所有部分
67
+ - 参考最近合并的 PR 的风格
68
+ - 使用 HEREDOC 格式传递 body
69
+ - PR 必须以 `Generated with AI assistance` 结尾
70
+
71
+ ```bash
72
+ gh pr create --base <target-branch> --title "<title>" --body "$(cat <<'EOF'
73
+ <按模板填写的完整 PR 描述>
74
+
75
+ Generated with AI assistance
76
+ EOF
77
+ )"
78
+ ```
79
+
80
+ ### 8. 更新任务状态(如果与任务相关)
81
+
82
+ 获取当前时间:
83
+
84
+ ```bash
85
+ date "+%Y-%m-%d %H:%M:%S"
86
+ ```
87
+
88
+ 如果有关联的活跃任务,更新 `.agent-workspace/active/{task-id}/task.md`:
89
+ - `pr_number`:{pr-number}
90
+ - `updated_at`:{当前时间}
91
+ - **追加**到 `## Activity Log`(不要覆盖之前的记录):
92
+ ```
93
+ - {yyyy-MM-dd HH:mm:ss} — **PR Created** by {agent} — PR #{pr-number} created
94
+ ```
95
+
96
+ ### 9. 输出结果
97
+
98
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
99
+
100
+ ```
101
+ PR 已创建:{pr-url}
102
+
103
+ 下一步(如在任务工作流中):
104
+ - 同步进度:
105
+ - Claude Code / OpenCode:/sync-pr {task-id}
106
+ - Gemini CLI:/{{project}}:sync-pr {task-id}
107
+ - Codex CLI:$sync-pr {task-id}
108
+ - 完成任务:
109
+ - Claude Code / OpenCode:/complete-task {task-id}
110
+ - Gemini CLI:/{{project}}:complete-task {task-id}
111
+ - Codex CLI:$complete-task {task-id}
112
+ ```
113
+
114
+ ## 注意事项
115
+
116
+ 1. **遵循 PR 模板**:填写模板中所有必要部分
117
+ 2. **参考风格**:匹配最近合并的 PR 的格式和风格
118
+ 3. **标题格式**:遵循 Conventional Commits 或项目规范
119
+ 4. **所有提交都重要**:分析分支中的**所有**提交,而不仅仅是最新的
120
+
121
+ ## 错误处理
122
+
123
+ - 无提交可推送:提示 "No commits found between {target} and HEAD"
124
+ - 推送被拒绝:建议先执行 `git pull --rebase`
125
+ - PR 已存在:显示已有的 PR URL
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: create-release-note
3
+ description: >
4
+ Generate release notes from PRs and commits between two versions.
5
+ Triggered when the user requests release note generation.
6
+ Arguments: version number, optional previous version.
7
+ ---
8
+
9
+ # Create Release Notes
10
+
11
+ Generate comprehensive release notes for a version based on merged PRs and commits.
12
+
13
+ ## Execution Flow
14
+
15
+ ### Step 1: Parse Arguments
16
+
17
+ From arguments:
18
+ - `<version>`: Current release version (required), format `X.Y.Z`
19
+ - `<prev-version>`: Previous version (optional), auto-detected if not provided
20
+
21
+ ### Step 2: Determine Version Range
22
+
23
+ **Current tag**: `v<version>`
24
+
25
+ **Previous tag** (if not specified):
26
+ ```bash
27
+ git tag --sort=-v:refname
28
+ ```
29
+ Find the most recent tag before `v<version>`.
30
+
31
+ **Verify tags exist**:
32
+ ```bash
33
+ git rev-parse v<version>
34
+ git rev-parse v<prev-version>
35
+ ```
36
+
37
+ ### Step 3: Reference Historical Release Notes Format
38
+
39
+ Fetch the most recent published release notes as a format reference:
40
+
41
+ ```bash
42
+ # Get the latest non-draft release tag
43
+ gh release list --limit 5 --json tagName,isDraft,isPrerelease \
44
+ --jq '[.[] | select(.isDraft == false and .isPrerelease == false)][0].tagName'
45
+
46
+ # Get the release body
47
+ gh release view <latest-tag> --json body -q '.body'
48
+ ```
49
+
50
+ **Purpose**:
51
+ - Analyze the section structure, heading style, emoji usage, and item format of historical release notes
52
+ - When generating release notes in Step 7, **must** follow the historical format to maintain consistency across versions
53
+ - If no historical release notes exist, use the default format defined in Step 7
54
+
55
+ ### Step 4: Collect Merged PRs
56
+
57
+ Get the date range between tags, then query merged PRs:
58
+
59
+ ```bash
60
+ # Get tag dates
61
+ git log v<prev-version> --format=%aI -1
62
+ git log v<version> --format=%aI -1
63
+
64
+ # Get merged PRs in range
65
+ gh pr list --state merged --base <branch> \
66
+ --json number,title,body,author,labels,mergedAt,url \
67
+ --limit 200 --search "merged:YYYY-MM-DD..YYYY-MM-DD"
68
+ ```
69
+
70
+ Also collect direct commits without PRs:
71
+ ```bash
72
+ git log v<prev-version>..v<version> --format="%H %s" --no-merges
73
+ ```
74
+
75
+ ### Step 5: Collect Related Issues
76
+
77
+ From each PR body, extract linked Issues:
78
+ - Match patterns: `Closes #N`, `Fixes #N`, `Resolves #N` (case-insensitive)
79
+
80
+ ```bash
81
+ gh issue view <N> --json number,title,labels,url
82
+ ```
83
+
84
+ ### Step 6: Classify Changes
85
+
86
+ **By type** (from PR title conventional commit prefix):
87
+ - `feat`, `perf`, `refactor`, dependency upgrades -> Enhancement
88
+ - `fix` -> Bugfix
89
+ - `docs` -> Documentation (merge into Enhancement if fewer than 3 items)
90
+
91
+ **By module** (from PR title scope, labels, or file paths):
92
+ - Infer module from PR title brackets like `[module]` or conventional scope `feat(module):`
93
+ - Fallback: analyze changed files
94
+
95
+ ### Step 7: Generate Release Notes
96
+
97
+ **Prioritize the historical format obtained in Step 3.** If historical release notes exist, strictly follow their section structure, heading style (including emojis), item format, and bilingual layout.
98
+
99
+ If no historical release notes exist, use the following default Markdown format:
100
+
101
+ ```markdown
102
+ ## {Module/Platform Name}
103
+
104
+ ### Enhancement
105
+
106
+ - [{scope}] Description by @author in [#N](url)
107
+
108
+ ### Bugfix
109
+
110
+ - [{scope}] Description by @author in [#N](url)
111
+
112
+ ## Contributors
113
+
114
+ @contributor1, @contributor2, @contributor3
115
+ ```
116
+
117
+ **Format rules**:
118
+ 1. Item format: `- [scope] Description by @author in [#N](url)`
119
+ 2. Issue + PR: `in [#Issue](url) and [#PR](url)`
120
+ 3. Description: Use PR title, remove `type(scope):` prefix, capitalize first letter
121
+ 4. Contributors: Deduplicated, sorted by contribution count (descending)
122
+ 5. Empty sections: Omit sections with no entries
123
+
124
+ ### Step 8: Present and Confirm
125
+
126
+ Show the generated release notes to the user.
127
+
128
+ Ask:
129
+ 1. Need any adjustments?
130
+ 2. Create a GitHub Draft Release?
131
+
132
+ ### Step 9: Create Draft Release (If Confirmed)
133
+
134
+ ```bash
135
+ gh release create v<version> \
136
+ --title "v<version>" \
137
+ --notes-file /tmp/release-notes-v<version>.md \
138
+ --draft
139
+ ```
140
+
141
+ Output:
142
+ ```
143
+ Draft Release created.
144
+
145
+ - URL: {draft-release-url}
146
+ - Version: v{version}
147
+ - Status: Draft
148
+
149
+ Please review and publish on GitHub:
150
+ 1. Open the URL above
151
+ 2. Review the release notes
152
+ 3. Click "Publish release"
153
+ ```
154
+
155
+ ## Notes
156
+
157
+ 1. **Requires gh CLI**: Must have GitHub CLI installed and authenticated
158
+ 2. **Tags must exist**: Run the release skill first to create tags
159
+ 3. **Draft mode**: Creates a draft - won't auto-publish
160
+ 4. **Classification accuracy**: Auto-classification is based on title/scope/files; complex PRs may need manual adjustment
161
+
162
+ ## Error Handling
163
+
164
+ - Invalid version format: Prompt correct format
165
+ - Tag not found: Suggest running the release skill first
166
+ - gh not authenticated: Prompt to authenticate
167
+ - No merged PRs found: Prompt to check tags and branch
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: create-release-note
3
+ description: >
4
+ 从 PR 和 commit 生成版本发布说明。
5
+ 当用户要求生成发布说明时触发。参数:版本号,可选的上一版本号。
6
+ ---
7
+
8
+ # 创建发布说明
9
+
10
+ 基于已合并的 PR 和提交,为指定版本生成全面的发布说明。
11
+
12
+ ## 执行流程
13
+
14
+ ### 步骤 1:解析参数
15
+
16
+ 从参数中提取:
17
+ - `<version>`:当前发布版本(必需),格式 `X.Y.Z`
18
+ - `<prev-version>`:上一版本(可选),如未提供则自动检测
19
+
20
+ ### 步骤 2:确定版本范围
21
+
22
+ **当前标签**:`v<version>`
23
+
24
+ **上一标签**(如未指定):
25
+ ```bash
26
+ git tag --sort=-v:refname
27
+ ```
28
+ 查找 `v<version>` 之前最近的标签。
29
+
30
+ **验证标签存在**:
31
+ ```bash
32
+ git rev-parse v<version>
33
+ git rev-parse v<prev-version>
34
+ ```
35
+
36
+ ### 步骤 3:参考历史发布说明格式
37
+
38
+ 获取最近一次已发布的 Release Note 作为格式参考:
39
+
40
+ ```bash
41
+ # 获取最近的非草稿 Release 标签
42
+ gh release list --limit 5 --json tagName,isDraft,isPrerelease \
43
+ --jq '[.[] | select(.isDraft == false and .isPrerelease == false)][0].tagName'
44
+
45
+ # 获取该 Release 的 body
46
+ gh release view <latest-tag> --json body -q '.body'
47
+ ```
48
+
49
+ **用途**:
50
+ - 分析历史发布说明的章节结构、标题风格、emoji 使用、条目格式
51
+ - 后续步骤 7 生成发布说明时,**必须**优先遵循历史格式,保持版本间的一致性
52
+ - 如果没有历史发布说明,则使用步骤 7 中定义的默认格式
53
+
54
+ ### 步骤 4:收集已合并的 PR
55
+
56
+ 获取标签之间的日期范围,然后查询已合并的 PR:
57
+
58
+ ```bash
59
+ # 获取标签日期
60
+ git log v<prev-version> --format=%aI -1
61
+ git log v<version> --format=%aI -1
62
+
63
+ # 获取范围内已合并的 PR
64
+ gh pr list --state merged --base <branch> \
65
+ --json number,title,body,author,labels,mergedAt,url \
66
+ --limit 200 --search "merged:YYYY-MM-DD..YYYY-MM-DD"
67
+ ```
68
+
69
+ 同时收集没有 PR 的直接提交:
70
+ ```bash
71
+ git log v<prev-version>..v<version> --format="%H %s" --no-merges
72
+ ```
73
+
74
+ ### 步骤 5:收集关联 Issue
75
+
76
+ 从每个 PR body 中提取关联的 Issue:
77
+ - 匹配模式:`Closes #N`、`Fixes #N`、`Resolves #N`(不区分大小写)
78
+
79
+ ```bash
80
+ gh issue view <N> --json number,title,labels,url
81
+ ```
82
+
83
+ ### 步骤 6:分类变更
84
+
85
+ **按类型**(从 PR 标题的 Conventional Commit 前缀):
86
+ - `feat`、`perf`、`refactor`、依赖升级 -> Enhancement
87
+ - `fix` -> Bugfix
88
+ - `docs` -> Documentation(如少于 3 项则合并到 Enhancement)
89
+
90
+ **按模块**(从 PR 标题 scope、标签或文件路径):
91
+ - 从 PR 标题中的方括号 `[module]` 或 Conventional scope `feat(module):` 推断模块
92
+ - 兜底:分析变更的文件
93
+
94
+ ### 步骤 7:生成发布说明
95
+
96
+ **优先使用步骤 3 中获取的历史格式**。如果存在历史发布说明,严格沿用其章节结构、标题风格(含 emoji)、条目格式和双语布局。
97
+
98
+ 如果没有历史发布说明,使用以下默认格式化为 Markdown:
99
+
100
+ ```markdown
101
+ ## {模块/平台名称}
102
+
103
+ ### Enhancement
104
+
105
+ - [{scope}] Description by @author in [#N](url)
106
+
107
+ ### Bugfix
108
+
109
+ - [{scope}] Description by @author in [#N](url)
110
+
111
+ ## Contributors
112
+
113
+ @contributor1, @contributor2, @contributor3
114
+ ```
115
+
116
+ **格式规则**:
117
+ 1. 条目格式:`- [scope] Description by @author in [#N](url)`
118
+ 2. Issue + PR:`in [#Issue](url) and [#PR](url)`
119
+ 3. 描述:使用 PR 标题,移除 `type(scope):` 前缀,首字母大写
120
+ 4. 贡献者:去重,按贡献数量降序排列
121
+ 5. 空部分:省略没有条目的部分
122
+
123
+ ### 步骤 8:展示并确认
124
+
125
+ 向用户展示生成的发布说明。
126
+
127
+ 询问:
128
+ 1. 需要调整吗?
129
+ 2. 是否创建 GitHub Draft Release?
130
+
131
+ ### 步骤 9:创建 Draft Release(如确认)
132
+
133
+ ```bash
134
+ gh release create v<version> \
135
+ --title "v<version>" \
136
+ --notes-file /tmp/release-notes-v<version>.md \
137
+ --draft
138
+ ```
139
+
140
+ 输出:
141
+ ```
142
+ Draft Release created.
143
+
144
+ - URL: {draft-release-url}
145
+ - Version: v{version}
146
+ - Status: Draft
147
+
148
+ Please review and publish on GitHub:
149
+ 1. Open the URL above
150
+ 2. Review the release notes
151
+ 3. Click "Publish release"
152
+ ```
153
+
154
+ ## 注意事项
155
+
156
+ 1. **需要 gh CLI**:必须安装并认证 GitHub CLI
157
+ 2. **标签必须存在**:先执行 release 技能创建标签
158
+ 3. **草稿模式**:创建草稿 —— 不会自动发布
159
+ 4. **分类准确性**:自动分类基于标题/scope/文件;复杂的 PR 可能需要手动调整
160
+
161
+ ## 错误处理
162
+
163
+ - 版本格式无效:提示正确格式
164
+ - 标签未找到:建议先执行 release 技能
165
+ - gh 未认证:提示进行认证
166
+ - 未找到已合并的 PR:提示检查标签和分支