@fitlab-ai/agent-infra 0.3.2 → 0.4.1

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 (302) hide show
  1. package/README.md +18 -35
  2. package/README.zh-CN.md +18 -35
  3. package/lib/defaults.json +5 -12
  4. package/lib/init.js +9 -25
  5. package/lib/paths.js +3 -42
  6. package/lib/update.js +43 -32
  7. package/package.json +2 -1
  8. package/templates/.agents/QUICKSTART.md +17 -7
  9. package/templates/.agents/QUICKSTART.zh-CN.md +17 -7
  10. package/templates/.agents/README.md +21 -14
  11. package/templates/.agents/README.zh-CN.md +21 -14
  12. package/templates/.agents/skills/analyze-task/SKILL.md +7 -10
  13. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +7 -9
  14. package/templates/.agents/skills/block-task/SKILL.md +9 -13
  15. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +9 -12
  16. package/templates/.agents/skills/check-task/SKILL.md +4 -8
  17. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +4 -6
  18. package/templates/.agents/skills/close-codescan/SKILL.md +1 -4
  19. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +1 -3
  20. package/templates/.agents/skills/close-dependabot/SKILL.md +1 -4
  21. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -3
  22. package/templates/.agents/skills/commit/SKILL.md +26 -198
  23. package/templates/.agents/skills/commit/SKILL.zh-CN.md +26 -197
  24. package/templates/.agents/skills/commit/reference/commit-message.md +60 -0
  25. package/templates/.agents/skills/commit/reference/commit-message.zh-CN.md +60 -0
  26. package/templates/.agents/skills/commit/reference/copyright-check.md +39 -0
  27. package/templates/.agents/skills/commit/reference/copyright-check.zh-CN.md +39 -0
  28. package/templates/.agents/skills/commit/reference/task-status-update.md +88 -0
  29. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +88 -0
  30. package/templates/.agents/skills/complete-task/SKILL.md +8 -13
  31. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +8 -11
  32. package/templates/.agents/skills/create-issue/SKILL.md +32 -251
  33. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +33 -252
  34. package/templates/.agents/skills/create-issue/reference/label-and-type.md +77 -0
  35. package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +77 -0
  36. package/templates/.agents/skills/create-issue/reference/template-matching.md +45 -0
  37. package/templates/.agents/skills/create-issue/reference/template-matching.zh-CN.md +45 -0
  38. package/templates/.agents/skills/create-pr/SKILL.md +33 -224
  39. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +32 -222
  40. package/templates/.agents/skills/create-pr/reference/branch-strategy.md +29 -0
  41. package/templates/.agents/skills/create-pr/reference/branch-strategy.zh-CN.md +29 -0
  42. package/templates/.agents/skills/create-pr/reference/pr-body-template.md +86 -0
  43. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +86 -0
  44. package/templates/.agents/skills/create-release-note/SKILL.md +10 -13
  45. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +10 -12
  46. package/templates/.agents/skills/create-task/SKILL.md +5 -8
  47. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -7
  48. package/templates/.agents/skills/implement-task/SKILL.md +48 -178
  49. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +44 -172
  50. package/templates/.agents/skills/implement-task/reference/implementation-rules.md +58 -0
  51. package/templates/.agents/skills/implement-task/reference/implementation-rules.zh-CN.md +58 -0
  52. package/templates/.agents/skills/implement-task/reference/report-template.md +63 -0
  53. package/templates/.agents/skills/implement-task/reference/report-template.zh-CN.md +63 -0
  54. package/templates/.agents/skills/import-codescan/SKILL.md +2 -5
  55. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +2 -4
  56. package/templates/.agents/skills/import-dependabot/SKILL.md +4 -7
  57. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +4 -6
  58. package/templates/.agents/skills/import-issue/SKILL.md +6 -8
  59. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +6 -8
  60. package/templates/.agents/skills/init-labels/SKILL.md +1 -4
  61. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +1 -4
  62. package/templates/.agents/skills/init-milestones/SKILL.md +1 -3
  63. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +1 -3
  64. package/templates/.agents/skills/plan-task/SKILL.md +7 -11
  65. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +7 -9
  66. package/templates/.agents/skills/refine-task/SKILL.md +38 -162
  67. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +36 -158
  68. package/templates/.agents/skills/refine-task/reference/fix-workflow.md +76 -0
  69. package/templates/.agents/skills/refine-task/reference/fix-workflow.zh-CN.md +76 -0
  70. package/templates/.agents/skills/refine-task/reference/report-template.md +38 -0
  71. package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +38 -0
  72. package/templates/.agents/skills/refine-title/SKILL.md +1 -4
  73. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -3
  74. package/templates/.agents/skills/release/SKILL.md +58 -19
  75. package/templates/.agents/skills/release/SKILL.zh-CN.md +58 -18
  76. package/templates/.agents/skills/review-task/SKILL.md +37 -239
  77. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +37 -238
  78. package/templates/.agents/skills/review-task/reference/output-templates.md +72 -0
  79. package/templates/.agents/skills/review-task/reference/output-templates.zh-CN.md +72 -0
  80. package/templates/.agents/skills/review-task/reference/report-template.md +63 -0
  81. package/templates/.agents/skills/review-task/reference/report-template.zh-CN.md +63 -0
  82. package/templates/.agents/skills/review-task/reference/review-criteria.md +24 -0
  83. package/templates/.agents/skills/review-task/reference/review-criteria.zh-CN.md +24 -0
  84. package/templates/.agents/skills/sync-issue/SKILL.md +32 -490
  85. package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +33 -490
  86. package/templates/.agents/skills/sync-issue/reference/comment-publish.md +88 -0
  87. package/templates/.agents/skills/sync-issue/reference/comment-publish.zh-CN.md +88 -0
  88. package/templates/.agents/skills/sync-issue/reference/delivery-detection.md +42 -0
  89. package/templates/.agents/skills/sync-issue/reference/delivery-detection.zh-CN.md +42 -0
  90. package/templates/.agents/skills/sync-issue/reference/label-sync.md +63 -0
  91. package/templates/.agents/skills/sync-issue/reference/label-sync.zh-CN.md +63 -0
  92. package/templates/.agents/skills/sync-issue/reference/milestone-sync.md +37 -0
  93. package/templates/.agents/skills/sync-issue/reference/milestone-sync.zh-CN.md +37 -0
  94. package/templates/.agents/skills/sync-pr/SKILL.md +25 -287
  95. package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +29 -291
  96. package/templates/.agents/skills/sync-pr/reference/comment-publish.md +82 -0
  97. package/templates/.agents/skills/sync-pr/reference/comment-publish.zh-CN.md +82 -0
  98. package/templates/.agents/skills/sync-pr/reference/delivery-detection.md +54 -0
  99. package/templates/.agents/skills/sync-pr/reference/delivery-detection.zh-CN.md +54 -0
  100. package/templates/.agents/skills/test/SKILL.md +1 -3
  101. package/templates/.agents/skills/test/SKILL.zh-CN.md +1 -3
  102. package/templates/.agents/skills/test-integration/SKILL.md +1 -4
  103. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +1 -3
  104. package/templates/.agents/skills/update-agent-infra/SKILL.md +7 -11
  105. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +7 -9
  106. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +59 -118
  107. package/templates/.agents/skills/upgrade-dependency/SKILL.md +1 -4
  108. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +1 -3
  109. package/templates/.agents/templates/handoff.md +1 -1
  110. package/templates/.agents/templates/handoff.zh-CN.md +1 -1
  111. package/templates/.agents/workflows/bug-fix.yaml +71 -71
  112. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +1 -1
  113. package/templates/.agents/workflows/feature-development.yaml +71 -71
  114. package/templates/.agents/workflows/feature-development.zh-CN.yaml +1 -1
  115. package/templates/.agents/workflows/refactoring.yaml +76 -76
  116. package/templates/.agents/workflows/refactoring.zh-CN.yaml +1 -1
  117. package/templates/{.agent-workspace → .agents/workspace}/README.md +1 -1
  118. package/templates/{.agent-workspace → .agents/workspace}/README.zh-CN.md +1 -1
  119. package/templates/.claude/CLAUDE.md +14 -52
  120. package/templates/.claude/CLAUDE.zh-CN.md +14 -52
  121. package/templates/.claude/commands/analyze-task.md +1 -1
  122. package/templates/.claude/commands/analyze-task.zh-CN.md +1 -1
  123. package/templates/.claude/commands/block-task.md +2 -1
  124. package/templates/.claude/commands/block-task.zh-CN.md +2 -1
  125. package/templates/.claude/commands/check-task.md +2 -1
  126. package/templates/.claude/commands/check-task.zh-CN.md +2 -1
  127. package/templates/.claude/commands/close-codescan.md +2 -1
  128. package/templates/.claude/commands/close-codescan.zh-CN.md +2 -1
  129. package/templates/.claude/commands/close-dependabot.md +2 -1
  130. package/templates/.claude/commands/close-dependabot.zh-CN.md +2 -1
  131. package/templates/.claude/commands/commit.md +1 -1
  132. package/templates/.claude/commands/commit.zh-CN.md +1 -1
  133. package/templates/.claude/commands/complete-task.md +1 -1
  134. package/templates/.claude/commands/complete-task.zh-CN.md +1 -1
  135. package/templates/.claude/commands/create-issue.md +1 -1
  136. package/templates/.claude/commands/create-issue.zh-CN.md +1 -1
  137. package/templates/.claude/commands/create-pr.md +1 -1
  138. package/templates/.claude/commands/create-pr.zh-CN.md +1 -1
  139. package/templates/.claude/commands/create-release-note.md +2 -1
  140. package/templates/.claude/commands/create-release-note.zh-CN.md +2 -1
  141. package/templates/.claude/commands/create-task.md +1 -1
  142. package/templates/.claude/commands/create-task.zh-CN.md +1 -1
  143. package/templates/.claude/commands/implement-task.md +1 -1
  144. package/templates/.claude/commands/implement-task.zh-CN.md +1 -1
  145. package/templates/.claude/commands/import-codescan.md +1 -0
  146. package/templates/.claude/commands/import-codescan.zh-CN.md +2 -1
  147. package/templates/.claude/commands/import-dependabot.md +1 -0
  148. package/templates/.claude/commands/import-dependabot.zh-CN.md +2 -1
  149. package/templates/.claude/commands/import-issue.md +1 -1
  150. package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
  151. package/templates/.claude/commands/init-labels.md +1 -0
  152. package/templates/.claude/commands/init-labels.zh-CN.md +2 -1
  153. package/templates/.claude/commands/init-milestones.md +2 -1
  154. package/templates/.claude/commands/init-milestones.zh-CN.md +2 -1
  155. package/templates/.claude/commands/plan-task.md +1 -1
  156. package/templates/.claude/commands/plan-task.zh-CN.md +1 -1
  157. package/templates/.claude/commands/refine-task.zh-CN.md +1 -1
  158. package/templates/.claude/commands/refine-title.md +2 -1
  159. package/templates/.claude/commands/refine-title.zh-CN.md +2 -1
  160. package/templates/.claude/commands/release.md +2 -1
  161. package/templates/.claude/commands/release.zh-CN.md +2 -1
  162. package/templates/.claude/commands/review-task.md +1 -1
  163. package/templates/.claude/commands/review-task.zh-CN.md +1 -1
  164. package/templates/.claude/commands/sync-issue.md +1 -1
  165. package/templates/.claude/commands/sync-issue.zh-CN.md +1 -1
  166. package/templates/.claude/commands/sync-pr.md +1 -1
  167. package/templates/.claude/commands/sync-pr.zh-CN.md +1 -1
  168. package/templates/.claude/commands/test-integration.md +2 -1
  169. package/templates/.claude/commands/test-integration.zh-CN.md +2 -1
  170. package/templates/.claude/commands/test.md +1 -1
  171. package/templates/.claude/commands/test.zh-CN.md +1 -1
  172. package/templates/.claude/commands/update-agent-infra.md +2 -1
  173. package/templates/.claude/commands/update-agent-infra.zh-CN.md +2 -1
  174. package/templates/.claude/commands/upgrade-dependency.md +2 -1
  175. package/templates/.claude/commands/upgrade-dependency.zh-CN.md +2 -1
  176. package/templates/.claude/hooks/check-version-format.sh +44 -0
  177. package/templates/.claude/settings.json +14 -0
  178. package/templates/.gemini/commands/_project_/analyze-task.toml +1 -1
  179. package/templates/.gemini/commands/_project_/analyze-task.zh-CN.toml +1 -1
  180. package/templates/.gemini/commands/_project_/block-task.toml +1 -1
  181. package/templates/.gemini/commands/_project_/block-task.zh-CN.toml +1 -1
  182. package/templates/.gemini/commands/_project_/check-task.toml +1 -1
  183. package/templates/.gemini/commands/_project_/check-task.zh-CN.toml +1 -1
  184. package/templates/.gemini/commands/_project_/close-codescan.toml +1 -1
  185. package/templates/.gemini/commands/_project_/close-codescan.zh-CN.toml +1 -1
  186. package/templates/.gemini/commands/_project_/close-dependabot.toml +1 -1
  187. package/templates/.gemini/commands/_project_/close-dependabot.zh-CN.toml +1 -1
  188. package/templates/.gemini/commands/_project_/commit.toml +1 -1
  189. package/templates/.gemini/commands/_project_/commit.zh-CN.toml +1 -1
  190. package/templates/.gemini/commands/_project_/complete-task.toml +1 -1
  191. package/templates/.gemini/commands/_project_/complete-task.zh-CN.toml +1 -1
  192. package/templates/.gemini/commands/_project_/create-issue.zh-CN.toml +1 -1
  193. package/templates/.gemini/commands/_project_/create-pr.toml +1 -1
  194. package/templates/.gemini/commands/_project_/create-pr.zh-CN.toml +1 -1
  195. package/templates/.gemini/commands/_project_/create-release-note.toml +1 -1
  196. package/templates/.gemini/commands/_project_/create-release-note.zh-CN.toml +1 -1
  197. package/templates/.gemini/commands/_project_/create-task.toml +1 -1
  198. package/templates/.gemini/commands/_project_/create-task.zh-CN.toml +1 -1
  199. package/templates/.gemini/commands/_project_/implement-task.toml +1 -1
  200. package/templates/.gemini/commands/_project_/implement-task.zh-CN.toml +1 -1
  201. package/templates/.gemini/commands/_project_/import-codescan.zh-CN.toml +1 -1
  202. package/templates/.gemini/commands/_project_/import-dependabot.zh-CN.toml +1 -1
  203. package/templates/.gemini/commands/_project_/import-issue.toml +1 -1
  204. package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +1 -1
  205. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +1 -1
  206. package/templates/.gemini/commands/_project_/init-milestones.toml +1 -1
  207. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +1 -1
  208. package/templates/.gemini/commands/_project_/plan-task.toml +1 -1
  209. package/templates/.gemini/commands/_project_/plan-task.zh-CN.toml +1 -1
  210. package/templates/.gemini/commands/_project_/refine-task.zh-CN.toml +1 -1
  211. package/templates/.gemini/commands/_project_/refine-title.toml +1 -1
  212. package/templates/.gemini/commands/_project_/refine-title.zh-CN.toml +1 -1
  213. package/templates/.gemini/commands/_project_/release.toml +1 -1
  214. package/templates/.gemini/commands/_project_/release.zh-CN.toml +1 -1
  215. package/templates/.gemini/commands/_project_/review-task.toml +1 -1
  216. package/templates/.gemini/commands/_project_/review-task.zh-CN.toml +1 -1
  217. package/templates/.gemini/commands/_project_/sync-issue.toml +1 -1
  218. package/templates/.gemini/commands/_project_/sync-issue.zh-CN.toml +1 -1
  219. package/templates/.gemini/commands/_project_/sync-pr.toml +1 -1
  220. package/templates/.gemini/commands/_project_/sync-pr.zh-CN.toml +1 -1
  221. package/templates/.gemini/commands/_project_/test-integration.toml +1 -1
  222. package/templates/.gemini/commands/_project_/test-integration.zh-CN.toml +1 -1
  223. package/templates/.gemini/commands/_project_/test.toml +1 -1
  224. package/templates/.gemini/commands/_project_/test.zh-CN.toml +1 -1
  225. package/templates/.gemini/commands/_project_/update-agent-infra.toml +1 -1
  226. package/templates/.gemini/commands/_project_/update-agent-infra.zh-CN.toml +1 -1
  227. package/templates/.gemini/commands/_project_/upgrade-dependency.toml +1 -1
  228. package/templates/.gemini/commands/_project_/upgrade-dependency.zh-CN.toml +1 -1
  229. package/templates/.github/hooks/check-version-format.sh +29 -0
  230. package/templates/.github/hooks/pre-commit +8 -0
  231. package/templates/.opencode/COMMAND_STYLE_GUIDE.md +6 -6
  232. package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +6 -6
  233. package/templates/.opencode/commands/analyze-task.md +1 -1
  234. package/templates/.opencode/commands/analyze-task.zh-CN.md +1 -1
  235. package/templates/.opencode/commands/block-task.md +1 -1
  236. package/templates/.opencode/commands/block-task.zh-CN.md +1 -1
  237. package/templates/.opencode/commands/check-task.md +1 -1
  238. package/templates/.opencode/commands/check-task.zh-CN.md +1 -1
  239. package/templates/.opencode/commands/close-codescan.md +1 -1
  240. package/templates/.opencode/commands/close-codescan.zh-CN.md +1 -1
  241. package/templates/.opencode/commands/close-dependabot.md +1 -1
  242. package/templates/.opencode/commands/close-dependabot.zh-CN.md +1 -1
  243. package/templates/.opencode/commands/commit.md +1 -1
  244. package/templates/.opencode/commands/commit.zh-CN.md +1 -1
  245. package/templates/.opencode/commands/complete-task.md +1 -1
  246. package/templates/.opencode/commands/complete-task.zh-CN.md +1 -1
  247. package/templates/.opencode/commands/create-issue.zh-CN.md +1 -1
  248. package/templates/.opencode/commands/create-pr.md +1 -1
  249. package/templates/.opencode/commands/create-pr.zh-CN.md +1 -1
  250. package/templates/.opencode/commands/create-release-note.md +1 -1
  251. package/templates/.opencode/commands/create-release-note.zh-CN.md +1 -1
  252. package/templates/.opencode/commands/create-task.md +1 -1
  253. package/templates/.opencode/commands/create-task.zh-CN.md +1 -1
  254. package/templates/.opencode/commands/implement-task.md +1 -1
  255. package/templates/.opencode/commands/implement-task.zh-CN.md +1 -1
  256. package/templates/.opencode/commands/import-codescan.zh-CN.md +1 -1
  257. package/templates/.opencode/commands/import-dependabot.zh-CN.md +1 -1
  258. package/templates/.opencode/commands/import-issue.md +1 -1
  259. package/templates/.opencode/commands/import-issue.zh-CN.md +1 -1
  260. package/templates/.opencode/commands/init-labels.zh-CN.md +1 -1
  261. package/templates/.opencode/commands/init-milestones.md +1 -1
  262. package/templates/.opencode/commands/init-milestones.zh-CN.md +1 -1
  263. package/templates/.opencode/commands/plan-task.md +1 -1
  264. package/templates/.opencode/commands/plan-task.zh-CN.md +1 -1
  265. package/templates/.opencode/commands/refine-task.zh-CN.md +1 -1
  266. package/templates/.opencode/commands/refine-title.md +1 -1
  267. package/templates/.opencode/commands/refine-title.zh-CN.md +1 -1
  268. package/templates/.opencode/commands/release.md +1 -1
  269. package/templates/.opencode/commands/release.zh-CN.md +1 -1
  270. package/templates/.opencode/commands/review-task.md +1 -1
  271. package/templates/.opencode/commands/review-task.zh-CN.md +1 -1
  272. package/templates/.opencode/commands/sync-issue.md +1 -1
  273. package/templates/.opencode/commands/sync-issue.zh-CN.md +1 -1
  274. package/templates/.opencode/commands/sync-pr.md +1 -1
  275. package/templates/.opencode/commands/sync-pr.zh-CN.md +1 -1
  276. package/templates/.opencode/commands/test-integration.md +1 -1
  277. package/templates/.opencode/commands/test-integration.zh-CN.md +1 -1
  278. package/templates/.opencode/commands/test.md +1 -1
  279. package/templates/.opencode/commands/test.zh-CN.md +1 -1
  280. package/templates/.opencode/commands/update-agent-infra.md +1 -1
  281. package/templates/.opencode/commands/update-agent-infra.zh-CN.md +1 -1
  282. package/templates/.opencode/commands/upgrade-dependency.md +1 -1
  283. package/templates/.opencode/commands/upgrade-dependency.zh-CN.md +1 -1
  284. package/templates/AGENTS.md +11 -3
  285. package/templates/AGENTS.zh-CN.md +11 -3
  286. package/templates/.editorconfig +0 -15
  287. package/templates/.github/ISSUE_TEMPLATE/01_bug_report.yml +0 -149
  288. package/templates/.github/ISSUE_TEMPLATE/02_question.yml +0 -101
  289. package/templates/.github/ISSUE_TEMPLATE/03_feature_request.yml +0 -131
  290. package/templates/.github/ISSUE_TEMPLATE/04_documentation.yml +0 -165
  291. package/templates/.github/ISSUE_TEMPLATE/05_other.yml +0 -147
  292. package/templates/.github/ISSUE_TEMPLATE/config.yml +0 -11
  293. package/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -123
  294. package/templates/.github/dependabot.yml +0 -17
  295. package/templates/.github/hooks/check-utf8-encoding.sh +0 -25
  296. package/templates/.github/release.yml +0 -27
  297. package/templates/.github/workflows/pr-title-check.yml +0 -42
  298. package/templates/.mailmap +0 -4
  299. package/templates/CONTRIBUTING.md +0 -126
  300. package/templates/CONTRIBUTING.zh-CN.md +0 -124
  301. package/templates/SECURITY.md +0 -131
  302. package/templates/SECURITY.zh-CN.md +0 -131
@@ -0,0 +1,77 @@
1
+ # Labels, Issue Type, and Milestone Rules
2
+
3
+ Read this file before applying labels, Issue Type, milestone, or `in:` labels.
4
+
5
+ ## Default Body Format (Fallback)
6
+
7
+ Recommended fallback:
8
+
9
+ ```markdown
10
+ ## Description
11
+
12
+ {task-description}
13
+
14
+ ## Requirements
15
+
16
+ - [ ] {requirement-1}
17
+ - [ ] {requirement-2}
18
+ ```
19
+
20
+ Map task types to GitHub labels and Issue Types, but keep only labels that actually exist.
21
+
22
+ Fallback label mapping:
23
+
24
+ | task.md type | GitHub label |
25
+ |---|---|
26
+ | `bug`, `bugfix` | `type: bug` |
27
+ | `feature` | `type: feature` |
28
+ | `enhancement` | `type: enhancement` |
29
+ | `docs`, `documentation` | `type: documentation` |
30
+ | `dependency-upgrade` | `type: dependency-upgrade` |
31
+ | `task`, `chore`, `refactor`, `refactoring` | `type: task` |
32
+ | other values | skip |
33
+
34
+ Issue Type fallback mapping:
35
+
36
+ | task.md type | GitHub Issue Type |
37
+ |---|---|
38
+ | `bug`, `bugfix` | `Bug` |
39
+ | `feature`, `enhancement` | `Feature` |
40
+ | `task`, `documentation`, `dependency-upgrade`, `chore`, `docs`, `refactor`, `refactoring`, and all other values | `Task` |
41
+
42
+ ## Create the Issue
43
+
44
+ Use:
45
+
46
+ ```bash
47
+ gh issue create --title "{title}" --body "{body}" --label "{label-1}" --label "{label-2}" --milestone "{milestone}"
48
+ ```
49
+
50
+ If no valid labels remain, omit `--label`. If `milestone` is empty, fall back to `General Backlog`.
51
+
52
+ Issue Type setup:
53
+
54
+ ```bash
55
+ gh api "orgs/$owner/issue-types" --jq '.[].name'
56
+ gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent
57
+ ```
58
+
59
+ `in:` labels:
60
+
61
+ ```bash
62
+ gh label list --search "in:" --limit 50 --json name --jq '.[].name'
63
+ gh issue edit {issue-number} --add-label "in: {module}"
64
+ ```
65
+
66
+ Only add relevant `in:` labels. Do not remove existing `in:` labels, and do not fail Issue creation when `in:` labels are unavailable or irrelevant.
67
+
68
+ Skip unavailable labels, Issue Types, or milestones without failing the Issue creation flow.
69
+
70
+ Final user output must include every TUI `sync-issue` command format:
71
+
72
+ ```text
73
+ Next step - sync progress to the Issue:
74
+ - Claude Code / OpenCode: /sync-issue {task-id}
75
+ - Gemini CLI: /agent-infra:sync-issue {task-id}
76
+ - Codex CLI: $sync-issue {task-id}
77
+ ```
@@ -0,0 +1,77 @@
1
+ # Label、Issue Type 和 Milestone 规则
2
+
3
+ 在应用 label、Issue Type、milestone 或 `in:` label 之前先读取本文件。
4
+
5
+ ## 默认正文格式(Fallback)
6
+
7
+ 推荐 fallback:
8
+
9
+ ```markdown
10
+ ## Description
11
+
12
+ {task-description}
13
+
14
+ ## Requirements
15
+
16
+ - [ ] {requirement-1}
17
+ - [ ] {requirement-2}
18
+ ```
19
+
20
+ 将任务类型映射到 GitHub label 和 Issue Type,但只保留仓库里实际存在的 label。
21
+
22
+ Fallback label 映射:
23
+
24
+ | task.md type | GitHub label |
25
+ |---|---|
26
+ | `bug`, `bugfix` | `type: bug` |
27
+ | `feature` | `type: feature` |
28
+ | `enhancement` | `type: enhancement` |
29
+ | `docs`, `documentation` | `type: documentation` |
30
+ | `dependency-upgrade` | `type: dependency-upgrade` |
31
+ | `task`, `chore`, `refactor`, `refactoring` | `type: task` |
32
+ | 其他值 | 跳过 |
33
+
34
+ Issue Type fallback 映射:
35
+
36
+ | task.md type | GitHub Issue Type |
37
+ |---|---|
38
+ | `bug`, `bugfix` | `Bug` |
39
+ | `feature`, `enhancement` | `Feature` |
40
+ | `task`, `documentation`, `dependency-upgrade`, `chore`, `docs`, `refactor`, `refactoring` 以及其他所有值 | `Task` |
41
+
42
+ ## 创建 Issue
43
+
44
+ 使用:
45
+
46
+ ```bash
47
+ gh issue create --title "{title}" --body "{body}" --label "{label-1}" --label "{label-2}" --milestone "{milestone}"
48
+ ```
49
+
50
+ 如果最终没有有效 label,就省略 `--label`。如果 `milestone` 为空,则回退到 `General Backlog`。
51
+
52
+ Issue Type 设置:
53
+
54
+ ```bash
55
+ gh api "orgs/$owner/issue-types" --jq '.[].name'
56
+ gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent
57
+ ```
58
+
59
+ `in:` label:
60
+
61
+ ```bash
62
+ gh label list --search "in:" --limit 50 --json name --jq '.[].name'
63
+ gh issue edit {issue-number} --add-label "in: {module}"
64
+ ```
65
+
66
+ 只添加相关的 `in:` label。不要移除已有的 `in:` label,并且当 `in:` label 不可用或不相关时,不要让创建 Issue 流程失败。
67
+
68
+ 当 label、Issue Type 或 milestone 不可用时,应跳过并继续,不要让 Issue 创建失败。
69
+
70
+ 最终给用户的输出必须包含所有 TUI 的 `sync-issue` 命令格式:
71
+
72
+ ```text
73
+ 下一步 - 同步进度到 Issue:
74
+ - Claude Code / OpenCode: /sync-issue {task-id}
75
+ - Gemini CLI: /agent-infra:sync-issue {task-id}
76
+ - Codex CLI: $sync-issue {task-id}
77
+ ```
@@ -0,0 +1,45 @@
1
+ # Issue Template Matching
2
+
3
+ Read this file before deciding how to build the Issue body from `.github/ISSUE_TEMPLATE`.
4
+
5
+ ## Detect Issue Templates
6
+
7
+ Search project templates with:
8
+
9
+ ```bash
10
+ rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
11
+ ```
12
+
13
+ If templates exist, inspect their top-level `name:` fields and choose the best match for the task title and description.
14
+
15
+ Typical candidate templates:
16
+ - `bug_report.yml` for bug work
17
+ - `question.yml` for question or investigation work
18
+ - `feature_request.yml` for feature work
19
+ - `documentation.yml` for documentation work
20
+ - `other.yml` as the general fallback
21
+
22
+ If no template matches clearly, choose the nearest candidate. If templates are missing, unreadable, or parsing fails, fall back to the default body path.
23
+
24
+ ## Build the Body from the Matched Template
25
+
26
+ Read the matched template's:
27
+ - `name`
28
+ - `type:`
29
+ - `labels:`
30
+ - `body:`
31
+
32
+ Field handling rules:
33
+ - `textarea` and `input`: use `attributes.label` as the markdown heading and fill values from task.md
34
+ - `markdown`: skip template explanation prose
35
+ - `dropdown` and `checkboxes`: skip
36
+ - when task.md lacks a suitable value, write `N/A`
37
+
38
+ Suggested field mapping:
39
+
40
+ | Template field hint | task.md source |
41
+ |---|---|
42
+ | `summary`, `title` | task title |
43
+ | `description`, `problem`, `what happened`, `issue-description`, `current-content` | task description |
44
+ | `solution`, `requirements`, `steps`, `suggested-content`, `impact`, `context`, `alternatives`, `expected` | requirements list |
45
+ | other `textarea` / `input` fields | task description, otherwise `N/A` |
@@ -0,0 +1,45 @@
1
+ # Issue 模板匹配
2
+
3
+ 在决定如何从 `.github/ISSUE_TEMPLATE` 构建 Issue 正文之前先读取本文件。
4
+
5
+ ## 探测 Issue 模板
6
+
7
+ 用下面的命令搜索项目模板:
8
+
9
+ ```bash
10
+ rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
11
+ ```
12
+
13
+ 如果模板存在,检查其顶层 `name:` 字段,并为当前任务标题和描述选择最匹配的模板。
14
+
15
+ 常见候选模板:
16
+ - `bug_report.yml`:用于 bug 类工作
17
+ - `question.yml`:用于问题排查或调研类工作
18
+ - `feature_request.yml`:用于功能类工作
19
+ - `documentation.yml`:用于文档类工作
20
+ - `other.yml`:通用 fallback
21
+
22
+ 如果没有明显匹配的模板,选择最接近的候选项。如果模板缺失、不可读取或解析失败,就回退到默认正文路径。
23
+
24
+ ## 使用匹配到的模板构建正文
25
+
26
+ 读取匹配模板中的:
27
+ - `name`
28
+ - `type:`
29
+ - `labels:`
30
+ - `body:`
31
+
32
+ 字段处理规则:
33
+ - `textarea` 和 `input`:使用 `attributes.label` 作为 Markdown 标题,并从 task.md 填充值
34
+ - `markdown`:跳过模板解释性文字
35
+ - `dropdown` 和 `checkboxes`:跳过
36
+ - 当 task.md 没有合适值时,写入 `N/A`
37
+
38
+ 建议字段映射:
39
+
40
+ | 模板字段提示 | task.md 来源 |
41
+ |---|---|
42
+ | `summary`, `title` | 任务标题 |
43
+ | `description`, `problem`, `what happened`, `issue-description`, `current-content` | 任务描述 |
44
+ | `solution`, `requirements`, `steps`, `suggested-content`, `impact`, `context`, `alternatives`, `expected` | 需求列表 |
45
+ | 其他 `textarea` / `input` 字段 | 优先使用任务描述,否则写 `N/A` |
@@ -1,202 +1,46 @@
1
1
  ---
2
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.
3
+ description: "Create a Pull Request to a target branch"
7
4
  ---
8
5
 
9
6
  # Create Pull Request
10
7
 
11
- Create a Pull Request. Optional argument: target branch.
8
+ Create a Pull Request and, when task-related, sync the essential metadata immediately.
12
9
 
13
10
  ## Execution Flow
14
11
 
15
- ### 1. Determine Target Branch
12
+ ### 1. Determine the Target Branch
16
13
 
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
14
+ Use the explicit argument when provided. Otherwise infer the target branch from Git history and branch topology.
27
15
 
28
- ### 2. Read PR Template
16
+ > Detailed branch detection rules live in `reference/branch-strategy.md`. Read `reference/branch-strategy.md` before auto-detecting the base branch.
29
17
 
30
- Read `.github/PULL_REQUEST_TEMPLATE.md` from the repository.
18
+ ### 2. Prepare the PR Body
31
19
 
32
- If the template doesn't exist, use a standard format.
20
+ Read `.github/PULL_REQUEST_TEMPLATE.md` when it exists, review recent merged PRs for style, and gather all commits between `<target-branch>` and `HEAD`.
33
21
 
34
- ### 3. Review Recent Merged PRs for Reference
22
+ > Template handling, HEREDOC body generation, and `Generated with AI assistance` requirements live in `reference/pr-body-template.md`. Read `reference/pr-body-template.md` before writing the PR body.
35
23
 
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.
24
+ ### 3. Check Remote Branch State
52
25
 
53
- ### 5. Check Remote Branch Status
26
+ Confirm whether the current branch already has an upstream. Push with `git push -u origin <current-branch>` when required.
54
27
 
55
- ```bash
56
- git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null
57
- ```
28
+ ### 4. Create the PR
58
29
 
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
- - If this work is associated with an active task, extract `issue_number` from task.md
68
- - If `issue_number` exists, query Issue information on a best-effort basis and skip on failure:
69
- ```bash
70
- gh issue view {issue-number} --json number,title --jq '.number' 2>/dev/null
71
- ```
72
- - Follow `.github/PULL_REQUEST_TEMPLATE.md` format for all sections
73
- - Reference recent merged PRs for style
74
- - Use HEREDOC format to pass the body
75
- - If `issue_number` exists:
76
- - replace `{$IssueNumber}` in the template with the actual Issue number
77
- - use `Closes #{issue_number}` in the `Related Issue` section
78
- - If `issue_number` does not exist, keep the current behavior
79
- - PR must end with: `Generated with AI assistance`
80
-
81
- ```bash
82
- gh pr create --base <target-branch> --title "<title>" --assignee @me --body "$(cat <<'EOF'
83
- <Complete PR description following template>
84
-
85
- Generated with AI assistance
86
- EOF
87
- )"
88
- ```
30
+ Create the PR with `gh pr create --base <target-branch> --title "<title>" --assignee @me --body ...`.
89
31
 
90
- ### 8. Sync PR Metadata (If Task-Related)
32
+ If a related task provides `issue_number`, keep `Closes #{issue-number}` in the PR body.
91
33
 
92
- If this work is associated with an active task, sync the following metadata immediately after creating the PR.
34
+ ### 5. Sync PR Metadata
93
35
 
94
- **a) Check whether the label system has been initialized**
36
+ For task-related PRs, sync the core metadata immediately:
37
+ - run `gh label list --search "type:" --limit 1 --json name --jq 'length'`
38
+ - add the mapped type label with `gh pr edit {pr-number} --add-label "{type-label}"`
39
+ - add relevant `in: {module}` labels with `gh pr edit {pr-number} --add-label "in: {module}"`
40
+ - set the milestone with `gh pr edit {pr-number} --milestone "{milestone-title}"`
41
+ - keep Development linking in the PR body with `Closes #{issue-number}` when applicable
95
42
 
96
- Run:
97
-
98
- ```bash
99
- gh label list --search "type:" --limit 1 --json name --jq 'length'
100
- ```
101
-
102
- - returns `0` -> run the `init-labels` skill first, then retry this step
103
- - returns non-zero -> continue
104
-
105
- **b) Query Issue metadata**
106
-
107
- If task.md contains `issue_number`, query the Issue labels and milestone on a best-effort basis:
108
-
109
- ```bash
110
- gh issue view {issue-number} --json labels,milestone 2>/dev/null
111
- ```
112
-
113
- If the query fails (Issue not found, permission denied, etc.), skip Issue metadata inheritance and continue with only the static mappings from task.md.
114
-
115
- Record the results for later substeps:
116
- - `{issue-labels}`: list of labels currently on the Issue
117
- - `{issue-milestone}`: title of the Issue milestone, if present
118
-
119
- **c) Sync the type label**
120
-
121
- Map task.md `type` using this table:
122
-
123
- | task.md type | GitHub label |
124
- |---|---|
125
- | bug, bugfix | `type: bug` |
126
- | feature | `type: feature` |
127
- | enhancement | `type: enhancement` |
128
- | refactor, refactoring | `type: enhancement` |
129
- | documentation | `type: documentation` |
130
- | dependency-upgrade | `type: dependency-upgrade` |
131
- | task | `type: task` |
132
- | anything else | skip |
133
-
134
- If task.md `type` maps to a standard type label, run:
135
-
136
- ```bash
137
- gh pr edit {pr-number} --add-label "{type-label}"
138
- ```
139
-
140
- **d) Inherit Issue labels**
141
-
142
- If `{issue-labels}` is not empty, filter labels that do not start with `type:` or `status:` and run the following for each label on a best-effort basis:
143
-
144
- ```bash
145
- gh pr edit {pr-number} --add-label "{label-name}"
146
- ```
147
-
148
- Only add labels; do not remove any existing PR labels.
149
-
150
- **e) Sync `in:` labels**
151
-
152
- Extract affected modules from implementation reports or analysis, verify that the label exists, then run:
153
-
154
- ```bash
155
- gh pr edit {pr-number} --add-label "in: {module}"
156
- ```
157
-
158
- Only add labels; do not remove existing `in:` labels.
159
-
160
- **f) Sync the milestone**
161
-
162
- Extend the `sync-pr` milestone inference strategy with Issue milestone priority:
163
- - preserve an existing PR milestone
164
- - otherwise respect explicit `milestone` from task.md
165
- - otherwise use the Issue milestone when available (`{issue-milestone}`)
166
- - otherwise infer from the current branch, release branches, or the latest tag
167
- - finally fall back to `General Backlog`
168
-
169
- Once the target is resolved, run:
170
-
171
- ```bash
172
- gh pr edit {pr-number} --milestone "{milestone-title}"
173
- ```
174
-
175
- **g) Sync development linking**
176
-
177
- If task.md contains `issue_number`, read the PR body:
178
-
179
- ```bash
180
- gh pr view {pr-number} --json body --jq '.body // ""'
181
- ```
182
-
183
- If the body does not contain any of:
184
- - `Closes #{issue-number}`
185
- - `Fixes #{issue-number}`
186
- - `Resolves #{issue-number}`
187
-
188
- append:
189
-
190
- ```bash
191
- gh pr edit {pr-number} --body "$(cat <<'EOF'
192
- {existing-body}
193
-
194
- Closes #{issue-number}
195
- EOF
196
- )"
197
- ```
198
-
199
- ### 9. Update Task Status (If Task-Related)
43
+ ### 6. Update Task Status
200
44
 
201
45
  Get the current time:
202
46
 
@@ -204,58 +48,23 @@ Get the current time:
204
48
  date "+%Y-%m-%d %H:%M:%S"
205
49
  ```
206
50
 
207
- If there is an active task for this work, update `.agent-workspace/active/{task-id}/task.md`:
208
- - `pr_number`: {pr-number}
209
- - `updated_at`: {current time}
210
- - **Append** to `## Activity Log` (do NOT overwrite previous entries):
211
- ```
212
- - {yyyy-MM-dd HH:mm:ss} — **PR Created** by {agent} — PR #{pr-number} created
213
- ```
214
-
215
- ### 10. Output Result
216
-
217
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
51
+ If this PR is task-related, update task.md with `pr_number`, `updated_at`, and append the PR Created Activity Log entry.
218
52
 
219
- > **⚠️ Next-Step Check — you must determine the real next action after PR creation before showing the commands below:**
220
- >
221
- > - If `task.md` has a valid `issue_number` and the PR status or review summary should be synced back into task context, prioritize "Publish review summary (optional)"
222
- > - If all workflow steps are complete, or the next action after PR creation is task archival, include "Complete task"
223
- > - If both apply, make the order explicit: **sync PR progress first, then complete the task**
224
- >
225
- > **Do not present "Complete task" as the only next step when PR progress or context still needs to be synced.**
53
+ ### 7. Inform the User
226
54
 
227
- ```
228
- PR created: {pr-url}
229
-
230
- Metadata sync:
231
- - Labels: {type-label-result}, {in-label-result}
232
- - Milestone: {milestone-result}
233
- - Development: {development-result}
234
-
235
- Next steps (if in task workflow):
236
- - Publish review summary (optional; recommended first when task/PR status still needs syncing):
237
- - Claude Code / OpenCode: /sync-pr {task-id}
238
- - Gemini CLI: /{{project}}:sync-pr {task-id}
239
- - Codex CLI: $sync-pr {task-id}
240
- - Complete task (after all workflow steps are complete):
241
- - Claude Code / OpenCode: /complete-task {task-id}
242
- - Gemini CLI: /{{project}}:complete-task {task-id}
243
- - Codex CLI: $complete-task {task-id}
244
- ```
55
+ Explain the created PR URL, summarize metadata sync results, and present both follow-up commands in order:
56
+ - optional `sync-pr {task-id}` to publish reviewer-facing context
57
+ - `complete-task {task-id}` once the workflow is truly done
245
58
 
246
59
  ## Notes
247
60
 
248
- 1. **Follow PR template**: Fill in all required sections from the template
249
- 2. **Reference style**: Match the format and style of recent merged PRs
250
- 3. **Title format**: Follow Conventional Commits or project conventions
251
- 4. **All commits matter**: Analyze ALL commits in the branch, not just the latest
252
- 5. **Sync metadata automatically**: When task-related, create-pr must immediately fill labels, milestone, and development linking after PR creation
61
+ - Review every commit in the branch, not only the latest one
62
+ - `create-pr` must not defer type-label mapping to `sync-pr`; inline the mapping here
63
+ - When metadata inheritance from the Issue fails, continue with task.md and branch-based fallbacks
253
64
 
254
65
  ## Error Handling
255
66
 
256
- - No commits to push: Prompt "No commits found between {target} and HEAD"
257
- - Push rejected: Suggest `git pull --rebase` first
258
- - PR already exists: Show existing PR URL
259
- - Issue not accessible or missing: Skip Issue metadata inheritance and record "Issue #{number} not accessible, skipping metadata inheritance"
260
- - Issue label unavailable: Skip that label and record "Label '{name}' not found, skipping"
261
- - Issue milestone unavailable: Fall back to branch-based milestone inference
67
+ - No commits found between `{target}` and `HEAD`
68
+ - Push rejected: suggest `git pull --rebase`
69
+ - Existing PR found: show the current PR URL
70
+ - Inaccessible Issue metadata: skip inheritance and continue