@fitlab-ai/agent-infra 0.5.1 → 0.5.2

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 (191) hide show
  1. package/README.md +15 -1
  2. package/README.zh-CN.md +15 -1
  3. package/lib/defaults.json +3 -0
  4. package/lib/init.js +15 -5
  5. package/lib/render.js +77 -15
  6. package/lib/sandbox/commands/enter.js +22 -7
  7. package/lib/sandbox/runtimes/base.dockerfile +10 -0
  8. package/lib/update.js +19 -5
  9. package/package.json +2 -1
  10. package/templates/.agents/{README.md → README.en.md} +13 -3
  11. package/templates/.agents/README.zh-CN.md +13 -3
  12. package/templates/.agents/rules/issue-pr-commands.github.en.md +111 -0
  13. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +111 -0
  14. package/templates/.agents/rules/label-milestone-setup.github.en.md +50 -0
  15. package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +50 -0
  16. package/templates/.agents/rules/release-commands.github.en.md +30 -0
  17. package/templates/.agents/rules/release-commands.github.zh-CN.md +30 -0
  18. package/templates/.agents/rules/security-alerts.github.en.md +43 -0
  19. package/templates/.agents/rules/security-alerts.github.zh-CN.md +43 -0
  20. package/templates/.agents/scripts/validate-artifact.js +0 -2
  21. package/templates/.agents/skills/cancel-task/{SKILL.md → SKILL.en.md} +7 -6
  22. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +7 -6
  23. package/templates/.agents/skills/close-codescan/{SKILL.md → SKILL.en.md} +3 -11
  24. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +3 -11
  25. package/templates/.agents/skills/close-dependabot/{SKILL.md → SKILL.en.md} +5 -13
  26. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +5 -13
  27. package/templates/.agents/skills/create-issue/{SKILL.md → SKILL.en.md} +2 -5
  28. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +2 -5
  29. package/templates/.agents/skills/create-issue/reference/{label-and-type.md → label-and-type.en.md} +4 -16
  30. package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +4 -16
  31. package/templates/.agents/skills/create-pr/{SKILL.md → SKILL.en.md} +3 -4
  32. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -4
  33. package/templates/.agents/skills/create-pr/reference/{pr-body-template.md → pr-body-template.en.md} +8 -13
  34. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +8 -13
  35. package/templates/.agents/skills/create-release-note/{SKILL.md → SKILL.en.md} +6 -18
  36. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +6 -18
  37. package/templates/.agents/skills/import-codescan/{SKILL.md → SKILL.en.md} +1 -3
  38. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -3
  39. package/templates/.agents/skills/import-dependabot/{SKILL.md → SKILL.en.md} +1 -3
  40. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -3
  41. package/templates/.agents/skills/import-issue/{SKILL.md → SKILL.en.md} +2 -10
  42. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +2 -10
  43. package/templates/.agents/skills/init-labels/{SKILL.md → SKILL.en.md} +9 -13
  44. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +9 -13
  45. package/templates/.agents/skills/init-milestones/{SKILL.md → SKILL.en.md} +5 -6
  46. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +5 -6
  47. package/templates/.agents/skills/refine-title/{SKILL.md → SKILL.en.md} +7 -17
  48. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +6 -16
  49. package/templates/.agents/skills/release/{SKILL.md → SKILL.en.md} +2 -1
  50. package/templates/.agents/skills/release/SKILL.zh-CN.md +2 -1
  51. package/templates/.agents/skills/restore-task/{SKILL.md → SKILL.en.md} +5 -11
  52. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +5 -11
  53. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +219 -59
  54. /package/templates/.agents/{QUICKSTART.md → QUICKSTART.en.md} +0 -0
  55. /package/templates/.agents/rules/{commit-and-pr.md → commit-and-pr.en.md} +0 -0
  56. /package/templates/.agents/rules/{issue-sync.md → issue-sync.github.en.md} +0 -0
  57. /package/templates/.agents/rules/{issue-sync.zh-CN.md → issue-sync.github.zh-CN.md} +0 -0
  58. /package/templates/.agents/rules/{milestone-inference.md → milestone-inference.github.en.md} +0 -0
  59. /package/templates/.agents/rules/{milestone-inference.zh-CN.md → milestone-inference.github.zh-CN.md} +0 -0
  60. /package/templates/.agents/rules/{pr-sync.md → pr-sync.github.en.md} +0 -0
  61. /package/templates/.agents/rules/{pr-sync.zh-CN.md → pr-sync.github.zh-CN.md} +0 -0
  62. /package/templates/.agents/rules/{task-management.md → task-management.en.md} +0 -0
  63. /package/templates/.agents/skills/analyze-task/{SKILL.md → SKILL.en.md} +0 -0
  64. /package/templates/.agents/skills/archive-tasks/{SKILL.md → SKILL.en.md} +0 -0
  65. /package/templates/.agents/skills/block-task/{SKILL.md → SKILL.en.md} +0 -0
  66. /package/templates/.agents/skills/check-task/{SKILL.md → SKILL.en.md} +0 -0
  67. /package/templates/.agents/skills/commit/{SKILL.md → SKILL.en.md} +0 -0
  68. /package/templates/.agents/skills/commit/reference/{commit-message.md → commit-message.en.md} +0 -0
  69. /package/templates/.agents/skills/commit/reference/{copyright-check.md → copyright-check.en.md} +0 -0
  70. /package/templates/.agents/skills/commit/reference/{pr-summary-sync.md → pr-summary-sync.en.md} +0 -0
  71. /package/templates/.agents/skills/commit/reference/{task-status-update.md → task-status-update.en.md} +0 -0
  72. /package/templates/.agents/skills/complete-task/{SKILL.md → SKILL.en.md} +0 -0
  73. /package/templates/.agents/skills/create-issue/reference/{template-matching.md → template-matching.en.md} +0 -0
  74. /package/templates/.agents/skills/create-pr/reference/{branch-strategy.md → branch-strategy.en.md} +0 -0
  75. /package/templates/.agents/skills/create-pr/reference/{comment-publish.md → comment-publish.en.md} +0 -0
  76. /package/templates/.agents/skills/create-task/{SKILL.md → SKILL.en.md} +0 -0
  77. /package/templates/.agents/skills/implement-task/{SKILL.md → SKILL.en.md} +0 -0
  78. /package/templates/.agents/skills/implement-task/reference/{branch-management.md → branch-management.en.md} +0 -0
  79. /package/templates/.agents/skills/implement-task/reference/{implementation-rules.md → implementation-rules.en.md} +0 -0
  80. /package/templates/.agents/skills/implement-task/reference/{output-template.md → output-template.en.md} +0 -0
  81. /package/templates/.agents/skills/implement-task/reference/{report-template.md → report-template.en.md} +0 -0
  82. /package/templates/.agents/skills/init-labels/scripts/{init-labels.sh → init-labels.github.sh} +0 -0
  83. /package/templates/.agents/skills/init-milestones/scripts/{init-milestones.sh → init-milestones.github.sh} +0 -0
  84. /package/templates/.agents/skills/plan-task/{SKILL.md → SKILL.en.md} +0 -0
  85. /package/templates/.agents/skills/refine-task/{SKILL.md → SKILL.en.md} +0 -0
  86. /package/templates/.agents/skills/refine-task/reference/{fix-workflow.md → fix-workflow.en.md} +0 -0
  87. /package/templates/.agents/skills/refine-task/reference/{report-template.md → report-template.en.md} +0 -0
  88. /package/templates/.agents/skills/release/scripts/{manage-milestones.sh → manage-milestones.github.sh} +0 -0
  89. /package/templates/.agents/skills/review-task/{SKILL.md → SKILL.en.md} +0 -0
  90. /package/templates/.agents/skills/review-task/reference/{output-templates.md → output-templates.en.md} +0 -0
  91. /package/templates/.agents/skills/review-task/reference/{report-template.md → report-template.en.md} +0 -0
  92. /package/templates/.agents/skills/review-task/reference/{review-criteria.md → review-criteria.en.md} +0 -0
  93. /package/templates/.agents/skills/test/{SKILL.md → SKILL.en.md} +0 -0
  94. /package/templates/.agents/skills/test-integration/{SKILL.md → SKILL.en.md} +0 -0
  95. /package/templates/.agents/skills/update-agent-infra/{SKILL.md → SKILL.en.md} +0 -0
  96. /package/templates/.agents/skills/upgrade-dependency/{SKILL.md → SKILL.en.md} +0 -0
  97. /package/templates/.agents/templates/{handoff.md → handoff.en.md} +0 -0
  98. /package/templates/.agents/templates/{review-report.md → review-report.en.md} +0 -0
  99. /package/templates/.agents/templates/{task.md → task.en.md} +0 -0
  100. /package/templates/.agents/workflows/{bug-fix.yaml → bug-fix.en.yaml} +0 -0
  101. /package/templates/.agents/workflows/{code-review.yaml → code-review.en.yaml} +0 -0
  102. /package/templates/.agents/workflows/{feature-development.yaml → feature-development.en.yaml} +0 -0
  103. /package/templates/.agents/workflows/{refactoring.yaml → refactoring.en.yaml} +0 -0
  104. /package/templates/.agents/workspace/{README.md → README.en.md} +0 -0
  105. /package/templates/.claude/commands/{analyze-task.md → analyze-task.en.md} +0 -0
  106. /package/templates/.claude/commands/{archive-tasks.md → archive-tasks.en.md} +0 -0
  107. /package/templates/.claude/commands/{block-task.md → block-task.en.md} +0 -0
  108. /package/templates/.claude/commands/{cancel-task.md → cancel-task.en.md} +0 -0
  109. /package/templates/.claude/commands/{check-task.md → check-task.en.md} +0 -0
  110. /package/templates/.claude/commands/{close-codescan.md → close-codescan.en.md} +0 -0
  111. /package/templates/.claude/commands/{close-dependabot.md → close-dependabot.en.md} +0 -0
  112. /package/templates/.claude/commands/{commit.md → commit.en.md} +0 -0
  113. /package/templates/.claude/commands/{complete-task.md → complete-task.en.md} +0 -0
  114. /package/templates/.claude/commands/{create-issue.md → create-issue.en.md} +0 -0
  115. /package/templates/.claude/commands/{create-pr.md → create-pr.en.md} +0 -0
  116. /package/templates/.claude/commands/{create-release-note.md → create-release-note.en.md} +0 -0
  117. /package/templates/.claude/commands/{create-task.md → create-task.en.md} +0 -0
  118. /package/templates/.claude/commands/{implement-task.md → implement-task.en.md} +0 -0
  119. /package/templates/.claude/commands/{import-codescan.md → import-codescan.en.md} +0 -0
  120. /package/templates/.claude/commands/{import-dependabot.md → import-dependabot.en.md} +0 -0
  121. /package/templates/.claude/commands/{import-issue.md → import-issue.en.md} +0 -0
  122. /package/templates/.claude/commands/{init-labels.md → init-labels.en.md} +0 -0
  123. /package/templates/.claude/commands/{init-milestones.md → init-milestones.en.md} +0 -0
  124. /package/templates/.claude/commands/{plan-task.md → plan-task.en.md} +0 -0
  125. /package/templates/.claude/commands/{refine-task.md → refine-task.en.md} +0 -0
  126. /package/templates/.claude/commands/{refine-title.md → refine-title.en.md} +0 -0
  127. /package/templates/.claude/commands/{release.md → release.en.md} +0 -0
  128. /package/templates/.claude/commands/{restore-task.md → restore-task.en.md} +0 -0
  129. /package/templates/.claude/commands/{review-task.md → review-task.en.md} +0 -0
  130. /package/templates/.claude/commands/{test-integration.md → test-integration.en.md} +0 -0
  131. /package/templates/.claude/commands/{test.md → test.en.md} +0 -0
  132. /package/templates/.claude/commands/{update-agent-infra.md → update-agent-infra.en.md} +0 -0
  133. /package/templates/.claude/commands/{upgrade-dependency.md → upgrade-dependency.en.md} +0 -0
  134. /package/templates/.gemini/commands/_project_/{analyze-task.toml → analyze-task.en.toml} +0 -0
  135. /package/templates/.gemini/commands/_project_/{archive-tasks.toml → archive-tasks.en.toml} +0 -0
  136. /package/templates/.gemini/commands/_project_/{block-task.toml → block-task.en.toml} +0 -0
  137. /package/templates/.gemini/commands/_project_/{cancel-task.toml → cancel-task.en.toml} +0 -0
  138. /package/templates/.gemini/commands/_project_/{check-task.toml → check-task.en.toml} +0 -0
  139. /package/templates/.gemini/commands/_project_/{close-codescan.toml → close-codescan.en.toml} +0 -0
  140. /package/templates/.gemini/commands/_project_/{close-dependabot.toml → close-dependabot.en.toml} +0 -0
  141. /package/templates/.gemini/commands/_project_/{commit.toml → commit.en.toml} +0 -0
  142. /package/templates/.gemini/commands/_project_/{complete-task.toml → complete-task.en.toml} +0 -0
  143. /package/templates/.gemini/commands/_project_/{create-issue.toml → create-issue.en.toml} +0 -0
  144. /package/templates/.gemini/commands/_project_/{create-pr.toml → create-pr.en.toml} +0 -0
  145. /package/templates/.gemini/commands/_project_/{create-release-note.toml → create-release-note.en.toml} +0 -0
  146. /package/templates/.gemini/commands/_project_/{create-task.toml → create-task.en.toml} +0 -0
  147. /package/templates/.gemini/commands/_project_/{implement-task.toml → implement-task.en.toml} +0 -0
  148. /package/templates/.gemini/commands/_project_/{import-codescan.toml → import-codescan.en.toml} +0 -0
  149. /package/templates/.gemini/commands/_project_/{import-dependabot.toml → import-dependabot.en.toml} +0 -0
  150. /package/templates/.gemini/commands/_project_/{import-issue.toml → import-issue.en.toml} +0 -0
  151. /package/templates/.gemini/commands/_project_/{init-labels.toml → init-labels.en.toml} +0 -0
  152. /package/templates/.gemini/commands/_project_/{init-milestones.toml → init-milestones.en.toml} +0 -0
  153. /package/templates/.gemini/commands/_project_/{plan-task.toml → plan-task.en.toml} +0 -0
  154. /package/templates/.gemini/commands/_project_/{refine-task.toml → refine-task.en.toml} +0 -0
  155. /package/templates/.gemini/commands/_project_/{refine-title.toml → refine-title.en.toml} +0 -0
  156. /package/templates/.gemini/commands/_project_/{release.toml → release.en.toml} +0 -0
  157. /package/templates/.gemini/commands/_project_/{restore-task.toml → restore-task.en.toml} +0 -0
  158. /package/templates/.gemini/commands/_project_/{review-task.toml → review-task.en.toml} +0 -0
  159. /package/templates/.gemini/commands/_project_/{test-integration.toml → test-integration.en.toml} +0 -0
  160. /package/templates/.gemini/commands/_project_/{test.toml → test.en.toml} +0 -0
  161. /package/templates/.gemini/commands/_project_/{update-agent-infra.toml → update-agent-infra.en.toml} +0 -0
  162. /package/templates/.gemini/commands/_project_/{upgrade-dependency.toml → upgrade-dependency.en.toml} +0 -0
  163. /package/templates/.opencode/commands/{analyze-task.md → analyze-task.en.md} +0 -0
  164. /package/templates/.opencode/commands/{archive-tasks.md → archive-tasks.en.md} +0 -0
  165. /package/templates/.opencode/commands/{block-task.md → block-task.en.md} +0 -0
  166. /package/templates/.opencode/commands/{cancel-task.md → cancel-task.en.md} +0 -0
  167. /package/templates/.opencode/commands/{check-task.md → check-task.en.md} +0 -0
  168. /package/templates/.opencode/commands/{close-codescan.md → close-codescan.en.md} +0 -0
  169. /package/templates/.opencode/commands/{close-dependabot.md → close-dependabot.en.md} +0 -0
  170. /package/templates/.opencode/commands/{commit.md → commit.en.md} +0 -0
  171. /package/templates/.opencode/commands/{complete-task.md → complete-task.en.md} +0 -0
  172. /package/templates/.opencode/commands/{create-issue.md → create-issue.en.md} +0 -0
  173. /package/templates/.opencode/commands/{create-pr.md → create-pr.en.md} +0 -0
  174. /package/templates/.opencode/commands/{create-release-note.md → create-release-note.en.md} +0 -0
  175. /package/templates/.opencode/commands/{create-task.md → create-task.en.md} +0 -0
  176. /package/templates/.opencode/commands/{implement-task.md → implement-task.en.md} +0 -0
  177. /package/templates/.opencode/commands/{import-codescan.md → import-codescan.en.md} +0 -0
  178. /package/templates/.opencode/commands/{import-dependabot.md → import-dependabot.en.md} +0 -0
  179. /package/templates/.opencode/commands/{import-issue.md → import-issue.en.md} +0 -0
  180. /package/templates/.opencode/commands/{init-labels.md → init-labels.en.md} +0 -0
  181. /package/templates/.opencode/commands/{init-milestones.md → init-milestones.en.md} +0 -0
  182. /package/templates/.opencode/commands/{plan-task.md → plan-task.en.md} +0 -0
  183. /package/templates/.opencode/commands/{refine-task.md → refine-task.en.md} +0 -0
  184. /package/templates/.opencode/commands/{refine-title.md → refine-title.en.md} +0 -0
  185. /package/templates/.opencode/commands/{release.md → release.en.md} +0 -0
  186. /package/templates/.opencode/commands/{restore-task.md → restore-task.en.md} +0 -0
  187. /package/templates/.opencode/commands/{review-task.md → review-task.en.md} +0 -0
  188. /package/templates/.opencode/commands/{test-integration.md → test-integration.en.md} +0 -0
  189. /package/templates/.opencode/commands/{test.md → test.en.md} +0 -0
  190. /package/templates/.opencode/commands/{update-agent-infra.md → update-agent-infra.en.md} +0 -0
  191. /package/templates/.opencode/commands/{upgrade-dependency.md → upgrade-dependency.en.md} +0 -0
@@ -38,16 +38,15 @@ Confirm whether the current branch already has an upstream. Push with `git push
38
38
 
39
39
  Check whether the current branch already has a PR first; if one exists, show the PR URL and stop without repeating metadata sync or summary publication.
40
40
 
41
- Create the PR with `gh pr create --base <target-branch> --title "<title>" --assignee @me --body ...`.
41
+ Read `.agents/rules/issue-pr-commands.md` before this step, then create the PR with its "Create a PR" command template.
42
42
 
43
43
  If `{task-id}` is available and the related task provides `issue_number`, keep `Closes #{issue-number}` in the PR body.
44
44
 
45
45
  ### 6. Sync PR Metadata
46
46
 
47
47
  For PRs where `{task-id}` is available, sync the core metadata immediately:
48
- - run `gh label list --search "type:" --limit 1 --json name --jq 'length'`
49
- - add the mapped type label with `gh pr edit {pr-number} --add-label "{type-label}"`
50
- - add relevant `in: {module}` labels with `gh pr edit {pr-number} --add-label "in: {module}"`
48
+ - query standard labels, Issue metadata, and PR metadata via `.agents/rules/issue-pr-commands.md`
49
+ - add the mapped type label and relevant `in:` labels with the PR update command from `.agents/rules/issue-pr-commands.md`
51
50
  - sync the linked Issue `in:` labels to match by following the `in:` label sync rule in `.agents/rules/issue-sync.md`
52
51
  - reuse the Issue milestone by following "Phase 3: `create-pr`" in `.agents/rules/milestone-inference.md`
53
52
  - keep Development linking in the PR body with `Closes #{issue-number}` when applicable
@@ -38,16 +38,15 @@ description: "创建 Pull Request 到目标分支"
38
38
 
39
39
  先检查当前分支是否已经存在 PR;如果已存在,直接告知用户 PR URL 并结束,不要重复执行元数据同步或摘要发布。
40
40
 
41
- 使用 `gh pr create --base <target-branch> --title "<title>" --assignee @me --body ...` 创建 PR。
41
+ 执行前先读取 `.agents/rules/issue-pr-commands.md`,并按其中的 “创建 PR” 命令创建 PR。
42
42
 
43
43
  如果获取到 `{task-id}` 且对应任务提供了 `issue_number`,必须在 PR 正文中保留 `Closes #{issue-number}`。
44
44
 
45
45
  ### 6. 同步 PR 元数据
46
46
 
47
47
  对获取到 `{task-id}` 的 PR,立即同步这些核心元数据:
48
- - 执行 `gh label list --search "type:" --limit 1 --json name --jq 'length'`
49
- - 使用 `gh pr edit {pr-number} --add-label "{type-label}"` 添加 type label
50
- - 使用 `gh pr edit {pr-number} --add-label "in: {module}"` 添加相关 `in:` labels
48
+ - `.agents/rules/issue-pr-commands.md` 查询标准 label / Issue / PR 元数据
49
+ - `.agents/rules/issue-pr-commands.md` PR 更新命令添加 type label 与相关 `in:` labels
51
50
  - 按 `.agents/rules/issue-sync.md` 的 `in:` label 同步规则,同步更新关联 Issue 的 `in:` label 保持一致
52
51
  - 按 `.agents/rules/milestone-inference.md` 的「阶段 3:`create-pr`」复用 Issue milestone
53
52
  - 通过 `Closes #{issue-number}` 保持 Development 关联
@@ -25,6 +25,8 @@ git diff <target-branch>...HEAD
25
25
 
26
26
  ## Sync PR Metadata
27
27
 
28
+ Read `.agents/rules/issue-pr-commands.md` before this step.
29
+
28
30
  Before syncing labels, verify the standard label system:
29
31
 
30
32
  ```bash
@@ -47,9 +49,9 @@ Type label mapping:
47
49
  | other values | skip |
48
50
 
49
51
  Metadata sync order:
50
- 1. query Issue labels and milestone best-effort with `gh issue view {issue-number} --json labels,milestone`
51
- 2. add the mapped type label with `gh pr edit {pr-number} --add-label "{type-label}"`
52
- 3. inherit non-`type:` and non-`status:` Issue labels with repeated `gh pr edit ... --add-label`
52
+ 1. query Issue labels and milestone via the Issue read command in `.agents/rules/issue-pr-commands.md`
53
+ 2. add the mapped type label via the PR update command in `.agents/rules/issue-pr-commands.md`
54
+ 3. inherit non-`type:` and non-`status:` Issue labels via repeated PR update commands from the same rule
53
55
  4. refine the PR `in:` labels by following `.agents/rules/issue-sync.md`, and keep the linked Issue `in:` labels in sync with the same result
54
56
  5. handle the milestone by following "Phase 3: `create-pr`" in `.agents/rules/milestone-inference.md`, reusing the Issue milestone directly
55
57
  6. ensure the PR body contains `Closes #{issue-number}` or an equivalent closing keyword
@@ -61,20 +63,13 @@ Milestone rule:
61
63
  ## Create the PR
62
64
 
63
65
  - Extract `issue_number` from task.md when this work belongs to an active task
64
- - If `issue_number` exists, query the Issue best-effort with `gh issue view {issue-number} --json number,title --jq '.number'`
65
- - Before calling `gh pr create`, check whether the current branch already has a PR. If it does, report the PR URL and state, then stop without repeating metadata sync or summary publication
66
+ - If `issue_number` exists, query the Issue via `.agents/rules/issue-pr-commands.md`
67
+ - Before calling the PR creation command, check whether the current branch already has a PR. If it does, report the PR URL and state, then stop without repeating metadata sync or summary publication
66
68
  - Use HEREDOC to pass the PR body
67
69
  - Replace `{$IssueNumber}` in the template when present
68
70
  - End the PR body with `Generated with AI assistance`
69
71
 
70
- ```bash
71
- gh pr create --base <target-branch> --title "<title>" --assignee @me --body "$(cat <<'EOF'
72
- <Complete PR description following template>
73
-
74
- Generated with AI assistance
75
- EOF
76
- )"
77
- ```
72
+ Create the PR with the "Create a PR" command template in `.agents/rules/issue-pr-commands.md`.
78
73
 
79
74
  Final user output should include this follow-up path:
80
75
 
@@ -25,6 +25,8 @@ git diff <target-branch>...HEAD
25
25
 
26
26
  ## 同步 PR 元数据
27
27
 
28
+ 执行前先读取 `.agents/rules/issue-pr-commands.md`。
29
+
28
30
  在同步 label 之前,先确认标准 label 体系已经存在:
29
31
 
30
32
  ```bash
@@ -47,9 +49,9 @@ Type label 映射:
47
49
  | 其他值 | 跳过 |
48
50
 
49
51
  元数据同步顺序:
50
- 1. `gh issue view {issue-number} --json labels,milestone` 尽力查询 Issue 的 labels 和 milestone
51
- 2. `gh pr edit {pr-number} --add-label "{type-label}"` 添加映射后的 type label
52
- 3. 用重复的 `gh pr edit ... --add-label` 继承非 `type:`、非 `status:` 的 Issue labels
52
+ 1. `.agents/rules/issue-pr-commands.md` Issue 读取命令查询关联 Issue 的 labels 和 milestone
53
+ 2. `.agents/rules/issue-pr-commands.md` PR 更新命令添加映射后的 type label
54
+ 3. 按同一规则的 PR 更新命令继承非 `type:`、非 `status:` 的 Issue labels
53
55
  4. 按 `.agents/rules/issue-sync.md` 的 `in:` label 同步规则精修 PR 的 `in:` label,同时同步更新关联 Issue 的 `in:` label 保持一致
54
56
  5. 按 `.agents/rules/milestone-inference.md` 的「阶段 3:`create-pr`」处理 milestone,直接复用 Issue milestone
55
57
  6. 确保 PR 正文包含 `Closes #{issue-number}` 或等价的 closing keyword
@@ -61,20 +63,13 @@ Milestone 规则:
61
63
  ## 创建 PR
62
64
 
63
65
  - 当当前工作属于活动任务时,从 task.md 中提取 `issue_number`
64
- - 如果存在 `issue_number`,用 `gh issue view {issue-number} --json number,title --jq '.number'` 尽力查询对应 Issue
65
- - 在调用 `gh pr create` 前,先检查当前分支是否已经存在 PR;如果已存在,直接告知用户 PR URL 和状态并结束,不要重复同步元数据或摘要
66
+ - 如果存在 `issue_number`,按 `.agents/rules/issue-pr-commands.md` Issue 读取命令查询对应 Issue
67
+ - 在调用 PR 创建命令前,先检查当前分支是否已经存在 PR;如果已存在,直接告知用户 PR URL 和状态并结束,不要重复同步元数据或摘要
66
68
  - 使用 HEREDOC 传递 PR 正文
67
69
  - 如果模板中存在 `{$IssueNumber}`,替换它
68
70
  - PR 正文结尾必须带上 `Generated with AI assistance`
69
71
 
70
- ```bash
71
- gh pr create --base <target-branch> --title "<title>" --assignee @me --body "$(cat <<'EOF'
72
- <Complete PR description following template>
73
-
74
- Generated with AI assistance
75
- EOF
76
- )"
77
- ```
72
+ 创建 PR 时,使用 `.agents/rules/issue-pr-commands.md` 中的 “创建 PR” 命令模板。
78
73
 
79
74
  最终用户输出必须按顺序包含以下后续动作:
80
75
 
@@ -35,12 +35,10 @@ git rev-parse v<prev-version>
35
35
 
36
36
  Fetch multiple published release notes as format references, then use a predefined complete category list:
37
37
 
38
+ Read `.agents/rules/release-commands.md` before this step.
39
+
38
40
  ```bash
39
- # Part A: Fetch the body for each of the 3 releases
40
- for tag in $(gh release list --limit 10 --json tagName,isDraft,isPrerelease \
41
- --jq '[.[] | select(.isDraft == false and .isPrerelease == false)] | .[0:3] | .[].tagName'); do
42
- gh release view "$tag" --json body -q '.body'
43
- done
41
+ # Part A: fetch the latest 3 published release bodies by following the release query commands in `.agents/rules/release-commands.md`
44
42
  ```
45
43
 
46
44
  **Part B: Complete Category List**
@@ -65,10 +63,7 @@ Get the date range between tags, then query merged PRs:
65
63
  git log v<prev-version> --format=%aI -1
66
64
  git log v<version> --format=%aI -1
67
65
 
68
- # Get merged PRs in range
69
- gh pr list --state merged --base <branch> \
70
- --json number,title,body,author,labels,mergedAt,url \
71
- --limit 200 --search "merged:YYYY-MM-DD..YYYY-MM-DD"
66
+ # Get merged PRs in range by following the merged-PR query command in `.agents/rules/release-commands.md`
72
67
  ```
73
68
 
74
69
  Also collect direct commits without PRs:
@@ -81,9 +76,7 @@ git log v<prev-version>..v<version> --format="%H %s" --no-merges
81
76
  From each PR body, extract linked Issues:
82
77
  - Match patterns: `Closes #N`, `Fixes #N`, `Resolves #N` (case-insensitive)
83
78
 
84
- ```bash
85
- gh issue view <N> --json number,title,labels,url
86
- ```
79
+ Read linked Issues by following `.agents/rules/release-commands.md`.
87
80
 
88
81
  ### 6. Classify Changes
89
82
 
@@ -135,12 +128,7 @@ Ask:
135
128
 
136
129
  ### 9. Create Draft Release (If Confirmed)
137
130
 
138
- ```bash
139
- gh release create v<version> \
140
- --title "v<version>" \
141
- --notes-file /tmp/release-notes-v<version>.md \
142
- --draft
143
- ```
131
+ Create the draft release by following `.agents/rules/release-commands.md`.
144
132
 
145
133
  Output:
146
134
  ```
@@ -35,12 +35,10 @@ git rev-parse v<prev-version>
35
35
 
36
36
  获取最近多条已发布的 Release Note 作为格式参考,并参考预定义的完整分类清单:
37
37
 
38
+ 执行前先读取 `.agents/rules/release-commands.md`。
39
+
38
40
  ```bash
39
- # Part A: 逐条获取这 3 条 Release 的 body
40
- for tag in $(gh release list --limit 10 --json tagName,isDraft,isPrerelease \
41
- --jq '[.[] | select(.isDraft == false and .isPrerelease == false)] | .[0:3] | .[].tagName'); do
42
- gh release view "$tag" --json body -q '.body'
43
- done
41
+ # Part A:按 `.agents/rules/release-commands.md` 的 release 查询命令逐条获取最近 3 条 Release 的 body
44
42
  ```
45
43
 
46
44
  **Part B:完整分类清单**
@@ -65,10 +63,7 @@ done
65
63
  git log v<prev-version> --format=%aI -1
66
64
  git log v<version> --format=%aI -1
67
65
 
68
- # 获取范围内已合并的 PR
69
- gh pr list --state merged --base <branch> \
70
- --json number,title,body,author,labels,mergedAt,url \
71
- --limit 200 --search "merged:YYYY-MM-DD..YYYY-MM-DD"
66
+ # 获取范围内已合并的 PR(按 `.agents/rules/release-commands.md` 的 merged PR 查询命令执行)
72
67
  ```
73
68
 
74
69
  同时收集没有 PR 的直接提交:
@@ -81,9 +76,7 @@ git log v<prev-version>..v<version> --format="%H %s" --no-merges
81
76
  从每个 PR body 中提取关联的 Issue:
82
77
  - 匹配模式:`Closes #N`、`Fixes #N`、`Resolves #N`(不区分大小写)
83
78
 
84
- ```bash
85
- gh issue view <N> --json number,title,labels,url
86
- ```
79
+ 按 `.agents/rules/release-commands.md` 的关联 Issue 查询命令读取。
87
80
 
88
81
  ### 6. 分类变更
89
82
 
@@ -135,12 +128,7 @@ gh issue view <N> --json number,title,labels,url
135
128
 
136
129
  ### 9. 创建 Draft Release(如确认)
137
130
 
138
- ```bash
139
- gh release create v<version> \
140
- --title "v<version>" \
141
- --notes-file /tmp/release-notes-v<version>.md \
142
- --draft
143
- ```
131
+ 按 `.agents/rules/release-commands.md` 的 Draft Release 创建命令执行。
144
132
 
145
133
  输出:
146
134
  ```
@@ -17,9 +17,7 @@ Import the specified Code Scanning (CodeQL) alert and create a remediation task.
17
17
 
18
18
  ### 1. Retrieve Alert Information
19
19
 
20
- ```bash
21
- gh api repos/{owner}/{repo}/code-scanning/alerts/<alert-number>
22
- ```
20
+ Read `.agents/rules/security-alerts.md` before this step, then use its Code Scanning alert read command to fetch the alert details.
23
21
 
24
22
  Extract key information:
25
23
  - `number`: alert number
@@ -17,9 +17,7 @@ description: "导入 Code Scanning 告警并创建修复任务"
17
17
 
18
18
  ### 1. 获取告警信息
19
19
 
20
- ```bash
21
- gh api repos/{owner}/{repo}/code-scanning/alerts/<alert-number>
22
- ```
20
+ 执行前先读取 `.agents/rules/security-alerts.md`,并按其中的 Code Scanning 告警读取命令获取告警详情。
23
21
 
24
22
  提取关键信息:
25
23
  - `number`:告警编号
@@ -17,9 +17,7 @@ Import the specified Dependabot security alert and create a remediation task.
17
17
 
18
18
  ### 1. Retrieve Alert Information
19
19
 
20
- ```bash
21
- gh api repos/{owner}/{repo}/dependabot/alerts/<alert-number>
22
- ```
20
+ Read `.agents/rules/security-alerts.md` before this step, then use its Dependabot alert read command to fetch the alert details.
23
21
 
24
22
  Extract key information:
25
23
  - `number`: alert number
@@ -17,9 +17,7 @@ description: "导入 Dependabot 安全告警并创建修复任务"
17
17
 
18
18
  ### 1. 获取告警信息
19
19
 
20
- ```bash
21
- gh api repos/{owner}/{repo}/dependabot/alerts/<alert-number>
22
- ```
20
+ 执行前先读取 `.agents/rules/security-alerts.md`,并按其中的 Dependabot 告警读取命令获取告警详情。
23
21
 
24
22
  提取关键信息:
25
23
  - `number`:告警编号
@@ -17,9 +17,7 @@ Import the specified GitHub Issue and create a task. Argument: issue number.
17
17
 
18
18
  ### 1. Retrieve Issue Information
19
19
 
20
- ```bash
21
- gh issue view <issue-number> --json number,title,body,labels
22
- ```
20
+ Read `.agents/rules/issue-pr-commands.md` first, then use its "Read an Issue" command to load the Issue data.
23
21
 
24
22
  Extract: issue number, title, description, and labels.
25
23
  Use the Issue title as-is for the task title (preserve the Issue's original language).
@@ -74,13 +72,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
74
72
 
75
73
  ### 5. Assign the Issue Assignee
76
74
 
77
- If task.md contains a valid `issue_number`, assign the Issue to the current executor:
78
-
79
- ```bash
80
- gh issue edit {issue-number} --add-assignee @me 2>/dev/null || true
81
- ```
82
-
83
- See the Assignee Sync rules in `.agents/rules/issue-sync.md`.
75
+ If task.md contains a valid `issue_number`, use the Issue update command from `.agents/rules/issue-pr-commands.md` to add the current executor as an assignee. The behavioral boundary still follows `.agents/rules/issue-sync.md`.
84
76
 
85
77
  ### 6. Verification Gate
86
78
 
@@ -17,9 +17,7 @@ description: "从 GitHub Issue 导入并创建任务"
17
17
 
18
18
  ### 1. 获取 Issue 信息
19
19
 
20
- ```bash
21
- gh issue view <issue-number> --json number,title,body,labels
22
- ```
20
+ 执行前先读取 `.agents/rules/issue-pr-commands.md`,并按其中的 “读取 Issue” 命令获取 Issue 信息。
23
21
 
24
22
  提取:issue 编号、标题、描述、标签。
25
23
  任务标题直接使用 Issue 的原始标题(保持 Issue 标题的原始语言)。
@@ -74,13 +72,7 @@ date "+%Y-%m-%d %H:%M:%S"
74
72
 
75
73
  ### 5. 分配 Issue Assignee
76
74
 
77
- 如果 task.md 中存在有效的 `issue_number`,将 Issue 分配给当前执行者:
78
-
79
- ```bash
80
- gh issue edit {issue-number} --add-assignee @me 2>/dev/null || true
81
- ```
82
-
83
- 参见 `.agents/rules/issue-sync.md` 的 Assignee 同步规则。
75
+ 如果 task.md 中存在有效的 `issue_number`,按 `.agents/rules/issue-pr-commands.md` 的 Issue 更新命令为当前执行者添加 assignee;Assignee 同步的边界仍遵循 `.agents/rules/issue-sync.md`。
84
76
 
85
77
  ### 6. 完成校验
86
78
 
@@ -12,9 +12,8 @@ Initialize the repository's standard GitHub Labels taxonomy.
12
12
  ### 1. Verify prerequisites
13
13
 
14
14
  Confirm that:
15
- - `gh` is installed
16
- - `gh auth token` succeeds
17
- - `gh repo view --json nameWithOwner` can access the current repository
15
+ - read `.agents/rules/label-milestone-setup.md` first
16
+ - use its authentication commands to verify platform access
18
17
 
19
18
  If any prerequisite fails, stop and report the matching error.
20
19
 
@@ -26,10 +25,10 @@ Execute the complete label initialization flow with:
26
25
  bash .agents/skills/init-labels/scripts/init-labels.sh
27
26
  ```
28
27
 
29
- The script is responsible for:
28
+ The script and `.agents/rules/label-milestone-setup.md` are responsible for:
30
29
  - Capturing the current label snapshot before making changes
31
- - Creating or updating the standard label set with `gh label create --force`
32
- - Reporting unmatched GitHub default labels such as `question` and `wontfix`
30
+ - Creating or updating the standard label set with the platform-specific label command
31
+ - Reporting unmatched platform-default labels such as `question` and `wontfix`
33
32
  - Printing the final execution summary
34
33
 
35
34
  ### 3. Standard taxonomy
@@ -68,10 +67,7 @@ Show the current mapping and ask whether it should be updated.
68
67
  #### 4.3 Write the mapping and create labels
69
68
 
70
69
  1. Write the final mapping to `.agents/.airc.json` under `labels.in`.
71
- 2. Create one `in: {key}` label for each mapping key:
72
- ```bash
73
- gh label create "in: {key}" --color EBF8DF --description "Module: {key}" --force
74
- ```
70
+ 2. Create one `in: {key}` label for each mapping key by following the label-create command in `.agents/rules/label-milestone-setup.md`.
75
71
  3. After user confirmation, delete stale `in:` labels that are no longer present in the final mapping.
76
72
 
77
73
  ### 5. Output and behavior guarantees
@@ -80,11 +76,11 @@ The summary must include:
80
76
  - Number of common labels created or updated
81
77
  - The written `labels.in` mapping
82
78
  - The number of `in:` labels derived from the mapping keys
83
- - Confirmation that exact-match GitHub defaults were overwritten
84
- - Any unmatched GitHub default labels still present
79
+ - Confirmation that exact-match platform defaults were overwritten
80
+ - Any unmatched platform-default labels still present
85
81
 
86
82
  Operational notes:
87
- - The operation is idempotent because every label uses `gh label create --force`.
83
+ - The operation is idempotent because the rule-file command updates or overwrites existing labels in place.
88
84
  - `in:` labels are managed by the AI-guided step together with the `.airc.json` mapping.
89
85
 
90
86
  ### 6. Inform User
@@ -12,9 +12,8 @@ description: "初始化仓库的 GitHub Labels 体系"
12
12
  ### 1. 验证前置条件
13
13
 
14
14
  确认以下条件成立:
15
- - 已安装 `gh`
16
- - `gh auth token` 执行成功
17
- - `gh repo view --json nameWithOwner` 可以访问当前仓库
15
+ - 执行前先读取 `.agents/rules/label-milestone-setup.md`
16
+ - 按其中的认证命令验证平台访问能力
18
17
 
19
18
  如果任一条件失败,停止并输出对应错误。
20
19
 
@@ -26,10 +25,10 @@ description: "初始化仓库的 GitHub Labels 体系"
26
25
  bash .agents/skills/init-labels/scripts/init-labels.sh
27
26
  ```
28
27
 
29
- 脚本负责:
28
+ 脚本与 `.agents/rules/label-milestone-setup.md` 共同负责:
30
29
  - 在修改前保存当前 label 快照
31
- - 使用 `gh label create --force` 创建或更新标准 label 集合
32
- - 提示仍然存在的 GitHub 默认 labels,例如 `question` 和 `wontfix`
30
+ - 使用平台对应的 label 创建或更新命令维护标准 label 集合
31
+ - 提示仍然存在的平台预置 labels,例如 `question` 和 `wontfix`
33
32
  - 输出最终执行摘要
34
33
 
35
34
  ### 3. 标准分类体系
@@ -68,10 +67,7 @@ bash .agents/skills/init-labels/scripts/init-labels.sh
68
67
  #### 4.3 写入配置并创建 label
69
68
 
70
69
  1. 将最终映射写入 `.agents/.airc.json` 的 `labels.in` 字段。
71
- 2. 为每个映射 key 创建 `in: {key}` label
72
- ```bash
73
- gh label create "in: {key}" --color EBF8DF --description "Module: {key}" --force
74
- ```
70
+ 2. 为每个映射 key `.agents/rules/label-milestone-setup.md` 的 label 创建命令创建 `in: {key}` label
75
71
  3. 询问用户确认后,清理不在最终映射中的旧 `in:` label。
76
72
 
77
73
  ### 5. 输出与行为保证
@@ -80,11 +76,11 @@ bash .agents/skills/init-labels/scripts/init-labels.sh
80
76
  - 创建或更新的通用 labels 数量
81
77
  - 写入的 `labels.in` 映射结果
82
78
  - 按映射 key 计算的 `in:` labels 数量
83
- - 名称完全匹配的 GitHub 默认 labels 已被覆盖的说明
84
- - 仍然存在的未匹配 GitHub 默认 labels
79
+ - 名称完全匹配的平台预置 labels 已被覆盖的说明
80
+ - 仍然存在的未匹配平台预置 labels
85
81
 
86
82
  执行说明:
87
- - 整个操作具备幂等性,因为每个 label 都使用 `gh label create --force`。
83
+ - 整个操作具备幂等性,因为规则文件中的 label 创建命令按覆盖或更新方式执行。
88
84
  - `in:` labels 由 AI 引导步骤和 `.airc.json` 映射统一管理。
89
85
 
90
86
  ### 6. 告知用户
@@ -12,9 +12,8 @@ Initialize the repository's standard GitHub Milestones taxonomy.
12
12
  ### 1. Verify prerequisites
13
13
 
14
14
  Confirm that:
15
- - `gh` is installed
16
- - `gh auth token` succeeds
17
- - `gh repo view --json nameWithOwner` can access the current repository
15
+ - read `.agents/rules/label-milestone-setup.md` first
16
+ - use its authentication commands to verify platform access
18
17
 
19
18
  If any prerequisite fails, stop and report the matching error.
20
19
 
@@ -26,11 +25,11 @@ Execute the complete milestone initialization flow with:
26
25
  bash .agents/skills/init-milestones/scripts/init-milestones.sh "$ARGUMENTS"
27
26
  ```
28
27
 
29
- The script is responsible for:
28
+ The script and `.agents/rules/label-milestone-setup.md` are responsible for:
30
29
  - Creating and cleaning up a temporary workspace
31
30
  - Detecting whether `--history` was requested
32
31
  - Resolving the version baseline from the latest `v*` Git tag, then `package.json`, then defaulting to `0.1.0`
33
- - Listing current milestones with `gh api "repos/$repo/milestones"`
32
+ - Listing current milestones with the platform-specific milestone query command
34
33
  - Building the desired milestone set and creating only the missing titles
35
34
  - Printing the final execution summary
36
35
 
@@ -59,7 +58,7 @@ Operational notes:
59
58
  - General Backlog is the fallback milestone for unsorted work.
60
59
  - Without `--history`, version milestones are created only for the next patch release.
61
60
  - Historical `X.Y.Z` tags create `X.Y.x` milestones as open and `X.Y.Z` milestones as closed.
62
- - Repositories with many tags may hit the GitHub API rate limit.
61
+ - Repositories with many tags may hit the platform API rate limit.
63
62
 
64
63
  ### 5. Inform User
65
64
 
@@ -12,9 +12,8 @@ description: "初始化仓库的 GitHub Milestones 体系"
12
12
  ### 1. 验证前置条件
13
13
 
14
14
  确认以下条件成立:
15
- - 已安装 `gh`
16
- - `gh auth token` 执行成功
17
- - `gh repo view --json nameWithOwner` 可以访问当前仓库
15
+ - 执行前先读取 `.agents/rules/label-milestone-setup.md`
16
+ - 按其中的认证命令验证平台访问能力
18
17
 
19
18
  如果任一条件失败,停止并输出对应错误。
20
19
 
@@ -26,11 +25,11 @@ description: "初始化仓库的 GitHub Milestones 体系"
26
25
  bash .agents/skills/init-milestones/scripts/init-milestones.sh "$ARGUMENTS"
27
26
  ```
28
27
 
29
- 脚本负责:
28
+ 脚本与 `.agents/rules/label-milestone-setup.md` 共同负责:
30
29
  - 创建并清理临时工作目录
31
30
  - 检测是否传入 `--history`
32
31
  - 按“最新 `v*` Git tag → `package.json` → 默认 `0.1.0`”解析版本基线
33
- - 使用 `gh api "repos/$repo/milestones"` 读取当前里程碑
32
+ - 使用平台对应的 milestones 查询命令读取当前里程碑
34
33
  - 构建目标里程碑集合,并且只创建缺失标题
35
34
  - 输出最终执行摘要
36
35
 
@@ -59,7 +58,7 @@ bash .agents/skills/init-milestones/scripts/init-milestones.sh "$ARGUMENTS"
59
58
  - General Backlog 是未分类工作的兜底里程碑。
60
59
  - 不带 `--history` 时,只为下一次 patch 发布创建版本里程碑。
61
60
  - 历史 `X.Y.Z` tag 会生成开启状态的 `X.Y.x` 和关闭状态的 `X.Y.Z`。
62
- - 标签较多的仓库可能触发 GitHub API rate limit。
61
+ - 标签较多的仓库可能触发平台 API rate limit。
63
62
 
64
63
  ### 5. 告知用户
65
64
 
@@ -11,15 +11,11 @@ Reformat the title of the specified Issue or PR to Conventional Commits format b
11
11
 
12
12
  ### 1. Identify Target and Fetch Information
13
13
 
14
- Try to determine if the ID is an Issue or PR:
15
-
16
- ```bash
17
- # Try Issue first
18
- gh issue view <id> --json number,title,body,labels,state
14
+ Read `.agents/rules/issue-pr-commands.md` before this step.
19
15
 
20
- # If not found or is a PR
21
- gh pr view <id> --json number,title,body,labels,state,files
22
- ```
16
+ Try to determine if the ID is an Issue or PR:
17
+ - first fetch Issue data by following the "Read an Issue" command in the rule file
18
+ - if the target is not an Issue or is actually a PR, fetch PR data by following the "Read a PR" command
23
19
 
24
20
  ### 2. Analyze Content
25
21
 
@@ -58,15 +54,9 @@ Ask user: "Apply this title? (y/n)"
58
54
 
59
55
  ### 4. Apply Change
60
56
 
61
- If user confirms:
62
-
63
- ```bash
64
- # For Issue
65
- gh issue edit <id> --title "<new-title>"
66
-
67
- # For PR
68
- gh pr edit <id> --title "<new-title>"
69
- ```
57
+ If the user confirms:
58
+ - for an Issue, update the title by following the "Update Issues" command in `.agents/rules/issue-pr-commands.md`
59
+ - for a PR, update the title by following the "Update PRs" command in `.agents/rules/issue-pr-commands.md`
70
60
 
71
61
  ### 5. Inform User
72
62
 
@@ -11,15 +11,11 @@ description: "重构 Issue/PR 标题为 Conventional Commits 格式"
11
11
 
12
12
  ### 1. 识别目标并获取信息
13
13
 
14
- 尝试判断 ID 是 Issue 还是 PR:
15
-
16
- ```bash
17
- # 先尝试 Issue
18
- gh issue view <id> --json number,title,body,labels,state
14
+ 执行前先读取 `.agents/rules/issue-pr-commands.md`。
19
15
 
20
- # 如果未找到或是 PR
21
- gh pr view <id> --json number,title,body,labels,state,files
22
- ```
16
+ 尝试判断 ID 是 Issue 还是 PR
17
+ - 先按规则文件中的“读取 Issue”命令获取 Issue 信息
18
+ - 如果未找到或目标实际为 PR,再按规则文件中的“读取 PR”命令获取 PR 信息
23
19
 
24
20
  ### 2. 分析内容
25
21
 
@@ -59,14 +55,8 @@ Issue/PR #{id} 分析结果:
59
55
  ### 4. 应用修改
60
56
 
61
57
  如果用户确认:
62
-
63
- ```bash
64
- # 对于 Issue
65
- gh issue edit <id> --title "<new-title>"
66
-
67
- # 对于 PR
68
- gh pr edit <id> --title "<new-title>"
69
- ```
58
+ - 对于 Issue:按 `.agents/rules/issue-pr-commands.md` 中的 “Issue 更新” 命令设置标题
59
+ - 对于 PR:按 `.agents/rules/issue-pr-commands.md` 中的 “PR 更新” 命令设置标题
70
60
 
71
61
  ### 5. 告知用户
72
62
 
@@ -113,7 +113,8 @@ bash .agents/skills/release/scripts/manage-milestones.sh "$MAJOR" "$MINOR" "$PAT
113
113
  ```
114
114
 
115
115
  The script is responsible for:
116
- - Loading the current milestone list with `gh api "repos/$repo/milestones"`
116
+ - Read `.agents/rules/label-milestone-setup.md` before this step
117
+ - Use its milestone list and update commands to load and adjust current milestones
117
118
  - Closing `{MAJOR}.{MINOR}.{PATCH}` when it exists and is still open
118
119
  - Ensuring `{MAJOR}.{MINOR}.{PATCH+1}` and `{MAJOR}.{MINOR}.x` exist
119
120
  - When `PATCH=0`, also ensuring `{MAJOR}.{MINOR+1}.0` and `{MAJOR}.{MINOR+1}.x`
@@ -113,7 +113,8 @@ bash .agents/skills/release/scripts/manage-milestones.sh "$MAJOR" "$MINOR" "$PAT
113
113
  ```
114
114
 
115
115
  脚本负责:
116
- - 使用 `gh api "repos/$repo/milestones"` 读取当前里程碑
116
+ - 执行前先读取 `.agents/rules/label-milestone-setup.md`
117
+ - 使用其中的 milestone 查询与更新命令读取和调整当前里程碑
117
118
  - 在 `{MAJOR}.{MINOR}.{PATCH}` 存在且仍为开启状态时将其关闭
118
119
  - 确保 `{MAJOR}.{MINOR}.{PATCH+1}` 与 `{MAJOR}.{MINOR}.x` 存在
119
120
  - 当 `PATCH=0` 时,同时确保 `{MAJOR}.{MINOR+1}.0` 与 `{MAJOR}.{MINOR+1}.x`