@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,88 @@
1
+ # 评论发布规则
2
+
3
+ 在创建或更新 Issue 评论之前先读取本文件。
4
+
5
+ ## 拉取已有评论并构建已发布产物集合
6
+
7
+ 使用如下隐藏标记:
8
+
9
+ ```html
10
+ <!-- sync-issue:{task-id}:{file-stem} -->
11
+ ```
12
+
13
+ 产物提取规则:
14
+ - 用 `/→\s+(\S+\.md)\s*$/` 从 Activity Log 中提取产物文件名
15
+ - 去掉 `.md` 后缀得到 `{file-stem}`
16
+ - 按 Activity Log 顺序构建产物时间线
17
+ - 固定把 `summary` 追加到最后
18
+
19
+ 产物时间线必须按 Activity Log 顺序构建。只包含任务目录中仍然存在的产物文件。
20
+ 常见产物文件名包括 `implementation-r*.md` 和 `review-r*.md`。
21
+
22
+ 已发布集合检测:
23
+
24
+ ```bash
25
+ grep -qF "<!-- sync-issue:{task-id}:{file-stem} -->" "$comments_jsonl"
26
+ ```
27
+
28
+ 含义:
29
+ - 找到匹配 -> 该产物已经发布过
30
+ - 没有匹配 -> 该产物本轮可以创建
31
+
32
+ 在开始发布评论前,先定义 `has_unpublished_artifacts`:即时间线中是否还存在任何未发布的非 `summary` 产物。该标志在本轮同步过程中保持不变。
33
+
34
+ 推荐标题映射:
35
+
36
+ | file-stem | title |
37
+ |---|---|
38
+ | `analysis` | `需求分析` |
39
+ | `analysis-r{N}` | `需求分析(Round {N})` |
40
+ | `plan` | `技术方案` |
41
+ | `plan-r{N}` | `技术方案(Round {N})` |
42
+ | `implementation` | `实现报告(Round 1)` |
43
+ | `implementation-r{N}` | `实现报告(Round {N})` |
44
+ | `refinement` | `修复报告(Round 1)` |
45
+ | `refinement-r{N}` | `修复报告(Round {N})` |
46
+ | `review` | `审查报告(Round 1)` |
47
+ | `review-r{N}` | `审查报告(Round {N})` |
48
+ | `summary` | `交付摘要` |
49
+
50
+ ## 按时间线顺序逐个发布上下文产物
51
+
52
+ 始终把 `summary` 放在最后。不要把多个轮次折叠成一条评论。
53
+
54
+ 统一评论格式:
55
+
56
+ ```markdown
57
+ <!-- sync-issue:{task-id}:{file-stem} -->
58
+ ## {artifact-title}
59
+
60
+ {artifact original body or summary body}
61
+
62
+ ---
63
+ *由 AI 自动生成 · 内部追踪:{task-id}*
64
+ ```
65
+
66
+ `summary` 处理规则:
67
+ - 如果 `summary` 不存在,就创建它
68
+ - 如果 `summary` 已存在且 `has_unpublished_artifacts=true`,删除旧的 `summary`,并在最后重新创建
69
+ - 如果 `summary` 已存在、`has_unpublished_artifacts=false`,且内容发生变化,则原地 patch 该评论
70
+ - 如果 `summary` 已存在、`has_unpublished_artifacts=false`,且内容没有变化,则不做任何操作
71
+
72
+ 零操作规则:
73
+ - 如果所有产物都已同步,且 `summary` 内容未变化,则不要发布任何内容,并报告 `所有产物已同步,无新内容`
74
+
75
+ 更新已有 `summary` 评论时,使用:
76
+
77
+ ```bash
78
+ gh api "repos/$repo/issues/comments/{summary_comment_id}" -X PATCH -f body="$(cat <<'EOF'
79
+ {comment-body}
80
+ EOF
81
+ )"
82
+ ```
83
+
84
+ 必须使用以下绝对链接格式:
85
+ - `https://github.com/{owner}/{repo}/commit/{commit-hash}`
86
+ - `https://github.com/{owner}/{repo}/pull/{pr-number}`
87
+
88
+ 不要回退到固定的 `analysis -> plan -> implementation -> review -> summary` 顺序。
@@ -0,0 +1,42 @@
1
+ # Delivery Detection
2
+
3
+ Read this file before deciding whether the task is completed, in PR stage, or still in development.
4
+
5
+ ## Detect Delivery Status
6
+
7
+ Resolve repository coordinates first:
8
+
9
+ ```bash
10
+ repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"
11
+ owner="${repo%%/*}"
12
+ repo_url="https://github.com/$repo"
13
+ ```
14
+
15
+ Delivery checks:
16
+ - extract the last commit hash from `**Commit** by` in Activity Log
17
+ - inspect protected branches with `git branch -a --contains {commit-hash} 2>/dev/null`
18
+ - inspect PR state with `gh pr view {pr-number} --json state,mergedAt`
19
+
20
+ Protected branch matching rules:
21
+ - output contains `main` or `master` -> treat as protected mainline
22
+ - output matches `{major}.{minor}.x` -> treat as a protected release line
23
+ - otherwise -> not on a protected branch
24
+
25
+ Scenario decision matrix:
26
+
27
+ | Condition | Scenario |
28
+ |---|---|
29
+ | commit is already on a protected branch | Scenario A: Completed |
30
+ | PR exists and its state is `OPEN` or `MERGED` | Scenario B: PR stage |
31
+ | all other cases | Scenario C: In development |
32
+
33
+ Scenario priority:
34
+ - Scenario A: Completed
35
+ - Scenario B: PR stage
36
+ - Scenario C: In development
37
+
38
+ Priority rule: `Scenario A > Scenario B > Scenario C`. Even if a PR exists, once the commit is on `main`, `master`, or `{major}.{minor}.x`, report the task as completed.
39
+
40
+ Absolute links must use:
41
+ - `https://github.com/{owner}/{repo}/commit/{commit-hash}`
42
+ - `https://github.com/{owner}/{repo}/pull/{pr-number}`
@@ -0,0 +1,42 @@
1
+ # 交付状态探测
2
+
3
+ 在判断任务是已完成、处于 PR 阶段还是仍在开发中之前先读取本文件。
4
+
5
+ ## 探测交付状态
6
+
7
+ 先解析仓库坐标:
8
+
9
+ ```bash
10
+ repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"
11
+ owner="${repo%%/*}"
12
+ repo_url="https://github.com/$repo"
13
+ ```
14
+
15
+ 交付状态检查:
16
+ - 从 Activity Log 中的 `**Commit** by` 提取最后一个 commit hash
17
+ - 用 `git branch -a --contains {commit-hash} 2>/dev/null` 检查受保护分支
18
+ - 用 `gh pr view {pr-number} --json state,mergedAt` 检查 PR 状态
19
+
20
+ 受保护分支匹配规则:
21
+ - 输出包含 `main` 或 `master` -> 视为受保护主线分支
22
+ - 输出匹配 `{major}.{minor}.x` -> 视为受保护版本线分支
23
+ - 其他情况 -> 不在受保护分支上
24
+
25
+ 场景判断矩阵:
26
+
27
+ | 条件 | 场景 |
28
+ |---|---|
29
+ | commit 已经位于受保护分支上 | 场景 A:已完成 |
30
+ | 存在 PR,且其状态为 `OPEN` 或 `MERGED` | 场景 B:PR 阶段 |
31
+ | 其他所有情况 | 场景 C:开发中 |
32
+
33
+ 场景优先级:
34
+ - 场景 A:已完成
35
+ - 场景 B:PR 阶段
36
+ - 场景 C:开发中
37
+
38
+ 优先级规则:`场景 A > 场景 B > 场景 C`。即使存在 PR,只要 commit 已经位于 `main`、`master` 或 `{major}.{minor}.x` 上,就应将任务报告为已完成。
39
+
40
+ 绝对链接必须使用:
41
+ - `https://github.com/{owner}/{repo}/commit/{commit-hash}`
42
+ - `https://github.com/{owner}/{repo}/pull/{pr-number}`
@@ -0,0 +1,63 @@
1
+ # Label and Issue Type Sync
2
+
3
+ Read this file before editing `status:`, `in:`, or Issue Type metadata.
4
+
5
+ ## Sync Labels and Issue Type
6
+
7
+ Initialize labels when needed:
8
+
9
+ ```bash
10
+ gh label list --search "type:" --limit 1 --json name --jq 'length'
11
+ ```
12
+
13
+ If the result is `0`, run `init-labels` and retry this step.
14
+
15
+ Status label workflow:
16
+
17
+ ```bash
18
+ gh issue view {issue-number} --json labels --jq '.labels[].name | select(startswith("status:"))'
19
+ gh issue edit {issue-number} --remove-label "{status-label}"
20
+ gh issue edit {issue-number} --add-label "{status-label}"
21
+ ```
22
+
23
+ Status decision table:
24
+
25
+ | Condition | Action |
26
+ |---|---|
27
+ | task lives under `blocked/` | add `status: blocked` |
28
+ | Scenario A: completed | add no new `status:` label |
29
+ | Scenario B: PR is `MERGED` | add no new `status:` label |
30
+ | Scenario B: PR is `OPEN` | add `status: in-progress` |
31
+ | Scenario C + `current_step` ∈ {`requirement-analysis`, `technical-design`} | add `status: pending-design-work` |
32
+ | Scenario C + `current_step` ∈ {`implementation`, `code-review`, `refinement`} | add `status: in-progress` |
33
+
34
+ `in:` label workflow:
35
+
36
+ ```bash
37
+ gh label list --search "in: {module}" --limit 10 --json name --jq '.[].name'
38
+ gh issue edit {issue-number} --add-label "in: {module}"
39
+ ```
40
+
41
+ `in:` label flow:
42
+ 1. extract changed file paths from implementation artifacts first; fall back to analysis artifacts only when implementation artifacts do not exist
43
+ 2. take the first path segment as `{module}`
44
+ 3. de-duplicate all inferred modules
45
+ 4. check whether each exact `in: {module}` label exists before adding it
46
+ 5. add matching labels only; never remove existing `in:` labels
47
+
48
+ Issue Type workflow:
49
+
50
+ ```bash
51
+ gh api "orgs/$owner/issue-types" --jq '.[].name'
52
+ gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{name}"
53
+ ```
54
+
55
+ Issue Type mapping:
56
+
57
+ | task.md type | GitHub Issue Type |
58
+ |---|---|
59
+ | `bug`, `bugfix` | `Bug` |
60
+ | `feature`, `enhancement` | `Feature` |
61
+ | `task`, `documentation`, `dependency-upgrade`, `chore`, `docs`, `refactor`, `refactoring`, and all other values | `Task` |
62
+
63
+ If Issue Types are unavailable, record `Issue Type: skipped (not enabled)` and continue.
@@ -0,0 +1,63 @@
1
+ # Label 和 Issue 类型同步
2
+
3
+ 在编辑 `status:`、`in:` 或 Issue 类型元数据之前先读取本文件。
4
+
5
+ ## 同步 Label 和 Issue 类型
6
+
7
+ 必要时先初始化 label:
8
+
9
+ ```bash
10
+ gh label list --search "type:" --limit 1 --json name --jq 'length'
11
+ ```
12
+
13
+ 如果结果是 `0`,先执行 `init-labels`,然后重新执行本步骤。
14
+
15
+ `status:` label 工作流:
16
+
17
+ ```bash
18
+ gh issue view {issue-number} --json labels --jq '.labels[].name | select(startswith("status:"))'
19
+ gh issue edit {issue-number} --remove-label "{status-label}"
20
+ gh issue edit {issue-number} --add-label "{status-label}"
21
+ ```
22
+
23
+ `status:` 判断表:
24
+
25
+ | 条件 | 操作 |
26
+ |---|---|
27
+ | 任务位于 `blocked/` 目录下 | 添加 `status: blocked` |
28
+ | 场景 A:已完成 | 不新增 `status:` label |
29
+ | 场景 B:PR 状态为 `MERGED` | 不新增 `status:` label |
30
+ | 场景 B:PR 状态为 `OPEN` | 添加 `status: in-progress` |
31
+ | 场景 C + `current_step` ∈ {`requirement-analysis`, `technical-design`} | 添加 `status: pending-design-work` |
32
+ | 场景 C + `current_step` ∈ {`implementation`, `code-review`, `refinement`} | 添加 `status: in-progress` |
33
+
34
+ `in:` label 工作流:
35
+
36
+ ```bash
37
+ gh label list --search "in: {module}" --limit 10 --json name --jq '.[].name'
38
+ gh issue edit {issue-number} --add-label "in: {module}"
39
+ ```
40
+
41
+ `in:` label 流程:
42
+ 1. 优先从实现产物中提取改动文件路径;只有在不存在实现产物时,才回退到分析产物
43
+ 2. 取路径的第一级目录作为 `{module}`
44
+ 3. 对推断出的所有模块去重
45
+ 4. 仅在对应的精确 `in: {module}` label 存在时才添加
46
+ 5. 只添加匹配的 label;绝不移除已有的 `in:` label
47
+
48
+ Issue 类型工作流:
49
+
50
+ ```bash
51
+ gh api "orgs/$owner/issue-types" --jq '.[].name'
52
+ gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{name}"
53
+ ```
54
+
55
+ Issue 类型映射:
56
+
57
+ | task.md 类型 | GitHub Issue 类型 |
58
+ |---|---|
59
+ | `bug`, `bugfix` | `Bug` |
60
+ | `feature`, `enhancement` | `Feature` |
61
+ | `task`, `documentation`, `dependency-upgrade`, `chore`, `docs`, `refactor`, `refactoring` 以及其他所有值 | `Task` |
62
+
63
+ 如果 Issue 类型不可用,记录 `Issue Type: skipped (not enabled)`,然后继续执行。
@@ -0,0 +1,37 @@
1
+ # Milestone Sync
2
+
3
+ Read this file before selecting or editing the Issue milestone.
4
+
5
+ ## Sync the Milestone
6
+
7
+ Milestone priority:
8
+ 1. existing Issue milestone
9
+ 2. explicit `milestone` field in task.md
10
+ 3. inferred version line from the current branch
11
+ 4. `General Backlog`
12
+
13
+ Inference scenarios when `task.md` does not set `milestone` explicitly:
14
+ 1. detect the current branch with `git branch --show-current`
15
+ 2. Scenario A: if the current branch matches `{major}.{minor}.x`, use that exact line milestone
16
+ 3. Scenario B: if the current branch is `main` or `master`, inspect existing `{major}.{minor}.x` branches
17
+ 4. Scenario B result: when a highest existing line `X.Y.x` exists, target `(X+1).0.x`
18
+ 5. Scenario C: if no branch rule yields a version line, inspect the latest `vX.Y.Z` tag and fall back to `X.Y.x`
19
+ 6. Scenario C fallback: if no branch or tag rule yields a version line, fall back to `General Backlog`
20
+
21
+ Fallback and assignment logic:
22
+ 1. preserve an existing Issue milestone when one is already set
23
+ 2. otherwise prefer an explicit `milestone` field from `task.md`
24
+ 3. otherwise apply the branch/tag scenario inference above
25
+ 4. if the inferred target milestone does not exist, downgrade to `General Backlog`
26
+ 5. if `General Backlog` also does not exist, record `Milestone: skipped (not found)` and stop milestone sync
27
+ 6. once a milestone title is resolved, assign it and record either `{target} (assigned)` or `General Backlog (fallback)`
28
+
29
+ Useful commands:
30
+
31
+ ```bash
32
+ gh issue view {issue-number} --json milestone
33
+ git branch --show-current
34
+ git branch -a | grep -oE '[0-9]+\.[0-9]+\.x'
35
+ git tag --list 'v*' --sort=-v:refname | head -1
36
+ gh issue edit {issue-number} --milestone "{milestone-title}"
37
+ ```
@@ -0,0 +1,37 @@
1
+ # 里程碑同步
2
+
3
+ 在选择或编辑 Issue 里程碑之前先读取本文件。
4
+
5
+ ## 同步里程碑
6
+
7
+ 里程碑优先级:
8
+ 1. Issue 当前已有的里程碑
9
+ 2. task.md 中显式设置的 `milestone` 字段
10
+ 3. 从当前分支推断出的版本线里程碑
11
+ 4. `General Backlog`
12
+
13
+ 当 task.md 没有显式设置 `milestone` 时,按以下场景推断:
14
+ 1. 用 `git branch --show-current` 检测当前分支
15
+ 2. 场景 A:如果当前分支匹配 `{major}.{minor}.x`,直接使用该版本线里程碑
16
+ 3. 场景 B:如果当前分支是 `main` 或 `master`,检查现有的 `{major}.{minor}.x` 分支
17
+ 4. 场景 B 结果:当存在最高版本线 `X.Y.x` 时,目标使用 `(X+1).0.x`
18
+ 5. 场景 C:如果分支规则无法得出版本线,则检查最新的 `vX.Y.Z` tag,并回退到 `X.Y.x`
19
+ 6. 场景 C 回退:如果分支和 tag 规则都无法得出版本线,则回退到 `General Backlog`
20
+
21
+ 回退与赋值逻辑:
22
+ 1. 如果 Issue 已经有里程碑,优先保留
23
+ 2. 否则优先使用 task.md 中显式设置的 `milestone`
24
+ 3. 否则应用上面的分支 / tag 场景推断规则
25
+ 4. 如果推断出的目标里程碑不存在,则降级为 `General Backlog`
26
+ 5. 如果 `General Backlog` 也不存在,则记录 `Milestone: skipped (not found)`,并停止 milestone 同步
27
+ 6. 一旦解析出里程碑标题,就执行赋值,并记录 `{target} (assigned)` 或 `General Backlog (fallback)`
28
+
29
+ 常用命令:
30
+
31
+ ```bash
32
+ gh issue view {issue-number} --json milestone
33
+ git branch --show-current
34
+ git branch -a | grep -oE '[0-9]+\.[0-9]+\.x'
35
+ git tag --list 'v*' --sort=-v:refname | head -1
36
+ gh issue edit {issue-number} --milestone "{milestone-title}"
37
+ ```