@fitlab-ai/agent-infra 0.5.1 → 0.5.3

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 (205) hide show
  1. package/README.md +17 -3
  2. package/README.zh-CN.md +17 -3
  3. package/lib/defaults.json +3 -0
  4. package/lib/init.js +15 -5
  5. package/lib/merge.js +22 -7
  6. package/lib/render.js +77 -15
  7. package/lib/sandbox/commands/enter.js +22 -7
  8. package/lib/sandbox/commands/rm.js +1 -1
  9. package/lib/sandbox/runtimes/base.dockerfile +27 -1
  10. package/lib/update.js +19 -5
  11. package/package.json +2 -1
  12. package/templates/.agents/{README.md → README.en.md} +13 -3
  13. package/templates/.agents/README.zh-CN.md +13 -3
  14. package/templates/.agents/rules/issue-pr-commands.github.en.md +111 -0
  15. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +111 -0
  16. package/templates/.agents/rules/label-milestone-setup.github.en.md +50 -0
  17. package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +50 -0
  18. package/templates/.agents/rules/release-commands.github.en.md +30 -0
  19. package/templates/.agents/rules/release-commands.github.zh-CN.md +30 -0
  20. package/templates/.agents/rules/security-alerts.github.en.md +43 -0
  21. package/templates/.agents/rules/security-alerts.github.zh-CN.md +43 -0
  22. package/templates/.agents/scripts/validate-artifact.js +3 -5
  23. package/templates/.agents/skills/analyze-task/{SKILL.md → SKILL.en.md} +2 -2
  24. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +2 -2
  25. package/templates/.agents/skills/archive-tasks/scripts/archive-tasks.sh +1 -1
  26. package/templates/.agents/skills/block-task/{SKILL.md → SKILL.en.md} +2 -2
  27. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
  28. package/templates/.agents/skills/cancel-task/{SKILL.md → SKILL.en.md} +18 -17
  29. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +18 -17
  30. package/templates/.agents/skills/close-codescan/{SKILL.md → SKILL.en.md} +5 -13
  31. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +5 -13
  32. package/templates/.agents/skills/close-dependabot/{SKILL.md → SKILL.en.md} +7 -15
  33. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +7 -15
  34. package/templates/.agents/skills/commit/{SKILL.md → SKILL.en.md} +1 -1
  35. package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
  36. package/templates/.agents/skills/commit/reference/{task-status-update.md → task-status-update.en.md} +2 -2
  37. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +2 -2
  38. package/templates/.agents/skills/complete-task/{SKILL.md → SKILL.en.md} +11 -11
  39. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +11 -11
  40. package/templates/.agents/skills/create-issue/{SKILL.md → SKILL.en.md} +3 -6
  41. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +3 -6
  42. package/templates/.agents/skills/create-issue/reference/{label-and-type.md → label-and-type.en.md} +4 -16
  43. package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +4 -16
  44. package/templates/.agents/skills/create-pr/{SKILL.md → SKILL.en.md} +4 -5
  45. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +4 -5
  46. package/templates/.agents/skills/create-pr/reference/{pr-body-template.md → pr-body-template.en.md} +8 -13
  47. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +8 -13
  48. package/templates/.agents/skills/create-release-note/{SKILL.md → SKILL.en.md} +6 -18
  49. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +6 -18
  50. package/templates/.agents/skills/create-task/{SKILL.md → SKILL.en.md} +4 -4
  51. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +4 -4
  52. package/templates/.agents/skills/implement-task/{SKILL.md → SKILL.en.md} +2 -2
  53. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +2 -2
  54. package/templates/.agents/skills/import-codescan/{SKILL.md → SKILL.en.md} +3 -5
  55. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +3 -5
  56. package/templates/.agents/skills/import-dependabot/{SKILL.md → SKILL.en.md} +3 -5
  57. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -5
  58. package/templates/.agents/skills/import-issue/{SKILL.md → SKILL.en.md} +6 -14
  59. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +6 -14
  60. package/templates/.agents/skills/init-labels/{SKILL.md → SKILL.en.md} +9 -13
  61. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +9 -13
  62. package/templates/.agents/skills/init-milestones/{SKILL.md → SKILL.en.md} +5 -6
  63. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +5 -6
  64. package/templates/.agents/skills/plan-task/{SKILL.md → SKILL.en.md} +2 -2
  65. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +2 -2
  66. package/templates/.agents/skills/refine-task/{SKILL.md → SKILL.en.md} +2 -2
  67. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +2 -2
  68. package/templates/.agents/skills/refine-title/{SKILL.md → SKILL.en.md} +7 -17
  69. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +6 -16
  70. package/templates/.agents/skills/release/{SKILL.md → SKILL.en.md} +2 -1
  71. package/templates/.agents/skills/release/SKILL.zh-CN.md +2 -1
  72. package/templates/.agents/skills/restore-task/{SKILL.md → SKILL.en.md} +7 -13
  73. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +7 -13
  74. package/templates/.agents/skills/review-task/{SKILL.md → SKILL.en.md} +2 -2
  75. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +2 -2
  76. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +219 -59
  77. package/templates/.agents/templates/{task.md → task.en.md} +3 -3
  78. package/templates/.agents/templates/task.zh-CN.md +3 -3
  79. /package/templates/.agents/{QUICKSTART.md → QUICKSTART.en.md} +0 -0
  80. /package/templates/.agents/rules/{commit-and-pr.md → commit-and-pr.en.md} +0 -0
  81. /package/templates/.agents/rules/{issue-sync.md → issue-sync.github.en.md} +0 -0
  82. /package/templates/.agents/rules/{issue-sync.zh-CN.md → issue-sync.github.zh-CN.md} +0 -0
  83. /package/templates/.agents/rules/{milestone-inference.md → milestone-inference.github.en.md} +0 -0
  84. /package/templates/.agents/rules/{milestone-inference.zh-CN.md → milestone-inference.github.zh-CN.md} +0 -0
  85. /package/templates/.agents/rules/{pr-sync.md → pr-sync.github.en.md} +0 -0
  86. /package/templates/.agents/rules/{pr-sync.zh-CN.md → pr-sync.github.zh-CN.md} +0 -0
  87. /package/templates/.agents/rules/{task-management.md → task-management.en.md} +0 -0
  88. /package/templates/.agents/skills/archive-tasks/{SKILL.md → SKILL.en.md} +0 -0
  89. /package/templates/.agents/skills/check-task/{SKILL.md → SKILL.en.md} +0 -0
  90. /package/templates/.agents/skills/commit/reference/{commit-message.md → commit-message.en.md} +0 -0
  91. /package/templates/.agents/skills/commit/reference/{copyright-check.md → copyright-check.en.md} +0 -0
  92. /package/templates/.agents/skills/commit/reference/{pr-summary-sync.md → pr-summary-sync.en.md} +0 -0
  93. /package/templates/.agents/skills/create-issue/reference/{template-matching.md → template-matching.en.md} +0 -0
  94. /package/templates/.agents/skills/create-pr/reference/{branch-strategy.md → branch-strategy.en.md} +0 -0
  95. /package/templates/.agents/skills/create-pr/reference/{comment-publish.md → comment-publish.en.md} +0 -0
  96. /package/templates/.agents/skills/implement-task/reference/{branch-management.md → branch-management.en.md} +0 -0
  97. /package/templates/.agents/skills/implement-task/reference/{implementation-rules.md → implementation-rules.en.md} +0 -0
  98. /package/templates/.agents/skills/implement-task/reference/{output-template.md → output-template.en.md} +0 -0
  99. /package/templates/.agents/skills/implement-task/reference/{report-template.md → report-template.en.md} +0 -0
  100. /package/templates/.agents/skills/init-labels/scripts/{init-labels.sh → init-labels.github.sh} +0 -0
  101. /package/templates/.agents/skills/init-milestones/scripts/{init-milestones.sh → init-milestones.github.sh} +0 -0
  102. /package/templates/.agents/skills/refine-task/reference/{fix-workflow.md → fix-workflow.en.md} +0 -0
  103. /package/templates/.agents/skills/refine-task/reference/{report-template.md → report-template.en.md} +0 -0
  104. /package/templates/.agents/skills/release/scripts/{manage-milestones.sh → manage-milestones.github.sh} +0 -0
  105. /package/templates/.agents/skills/review-task/reference/{output-templates.md → output-templates.en.md} +0 -0
  106. /package/templates/.agents/skills/review-task/reference/{report-template.md → report-template.en.md} +0 -0
  107. /package/templates/.agents/skills/review-task/reference/{review-criteria.md → review-criteria.en.md} +0 -0
  108. /package/templates/.agents/skills/test/{SKILL.md → SKILL.en.md} +0 -0
  109. /package/templates/.agents/skills/test-integration/{SKILL.md → SKILL.en.md} +0 -0
  110. /package/templates/.agents/skills/update-agent-infra/{SKILL.md → SKILL.en.md} +0 -0
  111. /package/templates/.agents/skills/upgrade-dependency/{SKILL.md → SKILL.en.md} +0 -0
  112. /package/templates/.agents/templates/{handoff.md → handoff.en.md} +0 -0
  113. /package/templates/.agents/templates/{review-report.md → review-report.en.md} +0 -0
  114. /package/templates/.agents/workflows/{bug-fix.yaml → bug-fix.en.yaml} +0 -0
  115. /package/templates/.agents/workflows/{code-review.yaml → code-review.en.yaml} +0 -0
  116. /package/templates/.agents/workflows/{feature-development.yaml → feature-development.en.yaml} +0 -0
  117. /package/templates/.agents/workflows/{refactoring.yaml → refactoring.en.yaml} +0 -0
  118. /package/templates/.agents/workspace/{README.md → README.en.md} +0 -0
  119. /package/templates/.claude/commands/{analyze-task.md → analyze-task.en.md} +0 -0
  120. /package/templates/.claude/commands/{archive-tasks.md → archive-tasks.en.md} +0 -0
  121. /package/templates/.claude/commands/{block-task.md → block-task.en.md} +0 -0
  122. /package/templates/.claude/commands/{cancel-task.md → cancel-task.en.md} +0 -0
  123. /package/templates/.claude/commands/{check-task.md → check-task.en.md} +0 -0
  124. /package/templates/.claude/commands/{close-codescan.md → close-codescan.en.md} +0 -0
  125. /package/templates/.claude/commands/{close-dependabot.md → close-dependabot.en.md} +0 -0
  126. /package/templates/.claude/commands/{commit.md → commit.en.md} +0 -0
  127. /package/templates/.claude/commands/{complete-task.md → complete-task.en.md} +0 -0
  128. /package/templates/.claude/commands/{create-issue.md → create-issue.en.md} +0 -0
  129. /package/templates/.claude/commands/{create-pr.md → create-pr.en.md} +0 -0
  130. /package/templates/.claude/commands/{create-release-note.md → create-release-note.en.md} +0 -0
  131. /package/templates/.claude/commands/{create-task.md → create-task.en.md} +0 -0
  132. /package/templates/.claude/commands/{implement-task.md → implement-task.en.md} +0 -0
  133. /package/templates/.claude/commands/{import-codescan.md → import-codescan.en.md} +0 -0
  134. /package/templates/.claude/commands/{import-dependabot.md → import-dependabot.en.md} +0 -0
  135. /package/templates/.claude/commands/{import-issue.md → import-issue.en.md} +0 -0
  136. /package/templates/.claude/commands/{init-labels.md → init-labels.en.md} +0 -0
  137. /package/templates/.claude/commands/{init-milestones.md → init-milestones.en.md} +0 -0
  138. /package/templates/.claude/commands/{plan-task.md → plan-task.en.md} +0 -0
  139. /package/templates/.claude/commands/{refine-task.md → refine-task.en.md} +0 -0
  140. /package/templates/.claude/commands/{refine-title.md → refine-title.en.md} +0 -0
  141. /package/templates/.claude/commands/{release.md → release.en.md} +0 -0
  142. /package/templates/.claude/commands/{restore-task.md → restore-task.en.md} +0 -0
  143. /package/templates/.claude/commands/{review-task.md → review-task.en.md} +0 -0
  144. /package/templates/.claude/commands/{test-integration.md → test-integration.en.md} +0 -0
  145. /package/templates/.claude/commands/{test.md → test.en.md} +0 -0
  146. /package/templates/.claude/commands/{update-agent-infra.md → update-agent-infra.en.md} +0 -0
  147. /package/templates/.claude/commands/{upgrade-dependency.md → upgrade-dependency.en.md} +0 -0
  148. /package/templates/.gemini/commands/_project_/{analyze-task.toml → analyze-task.en.toml} +0 -0
  149. /package/templates/.gemini/commands/_project_/{archive-tasks.toml → archive-tasks.en.toml} +0 -0
  150. /package/templates/.gemini/commands/_project_/{block-task.toml → block-task.en.toml} +0 -0
  151. /package/templates/.gemini/commands/_project_/{cancel-task.toml → cancel-task.en.toml} +0 -0
  152. /package/templates/.gemini/commands/_project_/{check-task.toml → check-task.en.toml} +0 -0
  153. /package/templates/.gemini/commands/_project_/{close-codescan.toml → close-codescan.en.toml} +0 -0
  154. /package/templates/.gemini/commands/_project_/{close-dependabot.toml → close-dependabot.en.toml} +0 -0
  155. /package/templates/.gemini/commands/_project_/{commit.toml → commit.en.toml} +0 -0
  156. /package/templates/.gemini/commands/_project_/{complete-task.toml → complete-task.en.toml} +0 -0
  157. /package/templates/.gemini/commands/_project_/{create-issue.toml → create-issue.en.toml} +0 -0
  158. /package/templates/.gemini/commands/_project_/{create-pr.toml → create-pr.en.toml} +0 -0
  159. /package/templates/.gemini/commands/_project_/{create-release-note.toml → create-release-note.en.toml} +0 -0
  160. /package/templates/.gemini/commands/_project_/{create-task.toml → create-task.en.toml} +0 -0
  161. /package/templates/.gemini/commands/_project_/{implement-task.toml → implement-task.en.toml} +0 -0
  162. /package/templates/.gemini/commands/_project_/{import-codescan.toml → import-codescan.en.toml} +0 -0
  163. /package/templates/.gemini/commands/_project_/{import-dependabot.toml → import-dependabot.en.toml} +0 -0
  164. /package/templates/.gemini/commands/_project_/{import-issue.toml → import-issue.en.toml} +0 -0
  165. /package/templates/.gemini/commands/_project_/{init-labels.toml → init-labels.en.toml} +0 -0
  166. /package/templates/.gemini/commands/_project_/{init-milestones.toml → init-milestones.en.toml} +0 -0
  167. /package/templates/.gemini/commands/_project_/{plan-task.toml → plan-task.en.toml} +0 -0
  168. /package/templates/.gemini/commands/_project_/{refine-task.toml → refine-task.en.toml} +0 -0
  169. /package/templates/.gemini/commands/_project_/{refine-title.toml → refine-title.en.toml} +0 -0
  170. /package/templates/.gemini/commands/_project_/{release.toml → release.en.toml} +0 -0
  171. /package/templates/.gemini/commands/_project_/{restore-task.toml → restore-task.en.toml} +0 -0
  172. /package/templates/.gemini/commands/_project_/{review-task.toml → review-task.en.toml} +0 -0
  173. /package/templates/.gemini/commands/_project_/{test-integration.toml → test-integration.en.toml} +0 -0
  174. /package/templates/.gemini/commands/_project_/{test.toml → test.en.toml} +0 -0
  175. /package/templates/.gemini/commands/_project_/{update-agent-infra.toml → update-agent-infra.en.toml} +0 -0
  176. /package/templates/.gemini/commands/_project_/{upgrade-dependency.toml → upgrade-dependency.en.toml} +0 -0
  177. /package/templates/.opencode/commands/{analyze-task.md → analyze-task.en.md} +0 -0
  178. /package/templates/.opencode/commands/{archive-tasks.md → archive-tasks.en.md} +0 -0
  179. /package/templates/.opencode/commands/{block-task.md → block-task.en.md} +0 -0
  180. /package/templates/.opencode/commands/{cancel-task.md → cancel-task.en.md} +0 -0
  181. /package/templates/.opencode/commands/{check-task.md → check-task.en.md} +0 -0
  182. /package/templates/.opencode/commands/{close-codescan.md → close-codescan.en.md} +0 -0
  183. /package/templates/.opencode/commands/{close-dependabot.md → close-dependabot.en.md} +0 -0
  184. /package/templates/.opencode/commands/{commit.md → commit.en.md} +0 -0
  185. /package/templates/.opencode/commands/{complete-task.md → complete-task.en.md} +0 -0
  186. /package/templates/.opencode/commands/{create-issue.md → create-issue.en.md} +0 -0
  187. /package/templates/.opencode/commands/{create-pr.md → create-pr.en.md} +0 -0
  188. /package/templates/.opencode/commands/{create-release-note.md → create-release-note.en.md} +0 -0
  189. /package/templates/.opencode/commands/{create-task.md → create-task.en.md} +0 -0
  190. /package/templates/.opencode/commands/{implement-task.md → implement-task.en.md} +0 -0
  191. /package/templates/.opencode/commands/{import-codescan.md → import-codescan.en.md} +0 -0
  192. /package/templates/.opencode/commands/{import-dependabot.md → import-dependabot.en.md} +0 -0
  193. /package/templates/.opencode/commands/{import-issue.md → import-issue.en.md} +0 -0
  194. /package/templates/.opencode/commands/{init-labels.md → init-labels.en.md} +0 -0
  195. /package/templates/.opencode/commands/{init-milestones.md → init-milestones.en.md} +0 -0
  196. /package/templates/.opencode/commands/{plan-task.md → plan-task.en.md} +0 -0
  197. /package/templates/.opencode/commands/{refine-task.md → refine-task.en.md} +0 -0
  198. /package/templates/.opencode/commands/{refine-title.md → refine-title.en.md} +0 -0
  199. /package/templates/.opencode/commands/{release.md → release.en.md} +0 -0
  200. /package/templates/.opencode/commands/{restore-task.md → restore-task.en.md} +0 -0
  201. /package/templates/.opencode/commands/{review-task.md → review-task.en.md} +0 -0
  202. /package/templates/.opencode/commands/{test-integration.md → test-integration.en.md} +0 -0
  203. /package/templates/.opencode/commands/{test.md → test.en.md} +0 -0
  204. /package/templates/.opencode/commands/{update-agent-infra.md → update-agent-infra.en.md} +0 -0
  205. /package/templates/.opencode/commands/{upgrade-dependency.md → upgrade-dependency.en.md} +0 -0
@@ -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`:告警编号
@@ -50,13 +48,13 @@ ghsa_id: <GHSA-ID>
50
48
  获取当前时间:
51
49
 
52
50
  ```bash
53
- date "+%Y-%m-%d %H:%M:%S"
51
+ date "+%Y-%m-%d %H:%M:%S%:z"
54
52
  ```
55
53
 
56
54
  更新 task.md:`current_step` -> `requirement-analysis`。
57
55
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
58
56
  ```
59
- - {yyyy-MM-dd HH:mm:ss} — **Import Dependabot Alert** by {agent} — Dependabot alert #{alert-number} imported
57
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Import Dependabot Alert** by {agent} — Dependabot alert #{alert-number} imported
60
58
  ```
61
59
 
62
60
  ### 4. 完成校验
@@ -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).
@@ -47,8 +45,8 @@ type: feature|bugfix|refactor|docs|chore
47
45
  branch: <project>-<type>-<slug>
48
46
  workflow: feature-development|bug-fix|refactoring
49
47
  status: active
50
- created_at: {yyyy-MM-dd HH:mm:ss}
51
- updated_at: {yyyy-MM-dd HH:mm:ss}
48
+ created_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
49
+ updated_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
52
50
  created_by: human
53
51
  current_step: requirement-analysis
54
52
  assigned_to: {current AI agent}
@@ -59,7 +57,7 @@ assigned_to: {current AI agent}
59
57
  Get the current time:
60
58
 
61
59
  ```bash
62
- date "+%Y-%m-%d %H:%M:%S"
60
+ date "+%Y-%m-%d %H:%M:%S%:z"
63
61
  ```
64
62
 
65
63
  Update `.agents/workspace/active/{task-id}/task.md`:
@@ -69,18 +67,12 @@ Update `.agents/workspace/active/{task-id}/task.md`:
69
67
  - `## Context` -> `- **Branch**:`: update it to the generated branch name
70
68
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
71
69
  ```
72
- - {yyyy-MM-dd HH:mm:ss} — **Import Issue** by {agent} — Issue #{number} imported
70
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Import Issue** by {agent} — Issue #{number} imported
73
71
  ```
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 标题的原始语言)。
@@ -47,8 +45,8 @@ type: feature|bugfix|refactor|docs|chore
47
45
  branch: <project>-<type>-<slug>
48
46
  workflow: feature-development|bug-fix|refactoring
49
47
  status: active
50
- created_at: {yyyy-MM-dd HH:mm:ss}
51
- updated_at: {yyyy-MM-dd HH:mm:ss}
48
+ created_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
49
+ updated_at: {YYYY-MM-DD HH:mm:ss±HH:MM}
52
50
  created_by: human
53
51
  current_step: requirement-analysis
54
52
  assigned_to: {当前 AI 代理}
@@ -59,7 +57,7 @@ assigned_to: {当前 AI 代理}
59
57
  获取当前时间:
60
58
 
61
59
  ```bash
62
- date "+%Y-%m-%d %H:%M:%S"
60
+ date "+%Y-%m-%d %H:%M:%S%:z"
63
61
  ```
64
62
 
65
63
  更新 `.agents/workspace/active/{task-id}/task.md`:
@@ -69,18 +67,12 @@ date "+%Y-%m-%d %H:%M:%S"
69
67
  - `## 上下文` 中的 `- **分支**:`:更新为生成的分支名
70
68
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
71
69
  ```
72
- - {yyyy-MM-dd HH:mm:ss} — **Import Issue** by {agent} — Issue #{number} imported
70
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Import Issue** by {agent} — Issue #{number} imported
73
71
  ```
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
 
@@ -81,7 +81,7 @@ Create `.agents/workspace/active/{task-id}/{plan-artifact}`.
81
81
  Get the current time:
82
82
 
83
83
  ```bash
84
- date "+%Y-%m-%d %H:%M:%S"
84
+ date "+%Y-%m-%d %H:%M:%S%:z"
85
85
  ```
86
86
 
87
87
  Update `.agents/workspace/active/{task-id}/task.md`:
@@ -93,7 +93,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
93
93
  - Mark technical-design as complete in workflow progress and include the actual round when the task template supports it
94
94
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
95
95
  ```
96
- - {yyyy-MM-dd HH:mm:ss} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
96
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
97
97
  ```
98
98
 
99
99
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
@@ -81,7 +81,7 @@ description: "为任务设计技术方案和实施计划"
81
81
  获取当前时间:
82
82
 
83
83
  ```bash
84
- date "+%Y-%m-%d %H:%M:%S"
84
+ date "+%Y-%m-%d %H:%M:%S%:z"
85
85
  ```
86
86
 
87
87
  更新 `.agents/workspace/active/{task-id}/task.md`:
@@ -93,7 +93,7 @@ date "+%Y-%m-%d %H:%M:%S"
93
93
  - 在工作流进度中标记 technical-design 为已完成,并注明实际轮次(如果任务模板支持)
94
94
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
95
95
  ```
96
- - {yyyy-MM-dd HH:mm:ss} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
96
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
97
97
  ```
98
98
 
99
99
  如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
@@ -51,13 +51,13 @@ Create `.agents/workspace/active/{task-id}/{refinement-artifact}`.
51
51
  Get the current time:
52
52
 
53
53
  ```bash
54
- date "+%Y-%m-%d %H:%M:%S"
54
+ date "+%Y-%m-%d %H:%M:%S%:z"
55
55
  ```
56
56
 
57
57
  Update task.md:
58
58
  - review the `## Requirements` section and only change items from `- [ ]` to `- [x]` when they are newly satisfied by this round's fixes and passing tests
59
59
  - append:
60
- `- {yyyy-MM-dd HH:mm:ss} — **Refinement (Round {N}, for {review-artifact})** by {agent} — Fixed {n} blockers, {n} major, {n} minor issues → {refinement-artifact}`
60
+ `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Refinement (Round {N}, for {review-artifact})** by {agent} — Fixed {n} blockers, {n} major, {n} minor issues → {refinement-artifact}`
61
61
 
62
62
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
63
63
  - Read `.agents/rules/issue-sync.md` before syncing
@@ -51,13 +51,13 @@ description: "处理代码审查反馈并修复问题"
51
51
  获取当前时间:
52
52
 
53
53
  ```bash
54
- date "+%Y-%m-%d %H:%M:%S"
54
+ date "+%Y-%m-%d %H:%M:%S%:z"
55
55
  ```
56
56
 
57
57
  更新 task.md:
58
58
  - 审查 `## 需求` 段落,仅把因本轮修复而新满足且有测试通过支撑的条目从 `- [ ]` 勾为 `- [x]`
59
59
  - 追加:
60
- `- {yyyy-MM-dd HH:mm:ss} — **Refinement (Round {N}, for {review-artifact})** by {agent} — Fixed {n} blockers, {n} major, {n} minor issues → {refinement-artifact}`
60
+ `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Refinement (Round {N}, for {review-artifact})** by {agent} — Fixed {n} blockers, {n} major, {n} minor issues → {refinement-artifact}`
61
61
 
62
62
  如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
63
63
  - 执行前先读取 `.agents/rules/issue-sync.md`
@@ -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`
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: restore-task
3
- description: "Restore local task files from GitHub Issue comments"
3
+ description: "Restore local task files from platform Issue comments"
4
4
  ---
5
5
 
6
6
  # Restore Task
7
7
 
8
- Restore local task workspace files from GitHub Issue comments that contain sync markers.
8
+ Restore local task workspace files from platform Issue comments that contain sync markers.
9
9
 
10
10
  ## Boundary / Critical Rules
11
11
 
@@ -21,19 +21,13 @@ Restore local task workspace files from GitHub Issue comments that contain sync
21
21
  Check:
22
22
  - required `{issue-number}`
23
23
  - optional `{task-id}`
24
- - `gh auth status`
24
+ - read `.agents/rules/issue-pr-commands.md` first and use its authentication commands to verify current platform access
25
25
 
26
26
  If the user provided `{task-id}`, validate the `TASK-{yyyyMMdd-HHmmss}` format.
27
27
 
28
28
  ### 2. Fetch Issue Comments
29
29
 
30
- Read all Issue comments while preserving the original order and comment IDs.
31
-
32
- Suggested command:
33
-
34
- ```bash
35
- gh api "repos/{owner}/{repo}/issues/{issue-number}/comments" --paginate
36
- ```
30
+ Read all Issue comments by following the "Read Issue comments" command in `.agents/rules/issue-pr-commands.md`, preserving the original order and comment IDs.
37
31
 
38
32
  ### 3. Determine the task-id and Files to Restore
39
33
 
@@ -87,7 +81,7 @@ Write only files that were actually recovered from Issue comments. Do not invent
87
81
  Get the current time:
88
82
 
89
83
  ```bash
90
- date "+%Y-%m-%d %H:%M:%S"
84
+ date "+%Y-%m-%d %H:%M:%S%:z"
91
85
  ```
92
86
 
93
87
  Update the restored `task.md`:
@@ -97,7 +91,7 @@ Update the restored `task.md`:
97
91
  - keep the original `current_step`
98
92
  - append this entry to `## Activity Log`:
99
93
  ```
100
- - {yyyy-MM-dd HH:mm:ss} — **Restore Task** by {agent} — Restored task from Issue #{issue-number}
94
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Restore Task** by {agent} — Restored task from Issue #{issue-number}
101
95
  ```
102
96
 
103
97
  ### 7. Verification Gate
@@ -152,7 +146,7 @@ Stop after completing the checklist. Do not continue the workflow automatically.
152
146
  ## Error Handling
153
147
 
154
148
  - Issue missing or inaccessible
155
- - `gh` unavailable or unauthenticated
149
+ - Platform CLI unavailable or unauthenticated
156
150
  - No sync-marked comments found
157
151
  - Unable to determine a unique `task-id`
158
152
  - Target directory already exists
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: restore-task
3
- description: " GitHub Issue 评论还原本地任务文件"
3
+ description: "从平台 Issue 评论还原本地任务文件"
4
4
  ---
5
5
 
6
6
  # 还原任务
7
7
 
8
- 从带有 sync 标记的 GitHub Issue 评论中恢复本地任务工作区文件。
8
+ 从带有 sync 标记的平台 Issue 评论中恢复本地任务工作区文件。
9
9
 
10
10
  ## 行为边界 / 关键规则
11
11
 
@@ -21,19 +21,13 @@ description: "从 GitHub Issue 评论还原本地任务文件"
21
21
  检查:
22
22
  - 必填参数 `{issue-number}`
23
23
  - 可选参数 `{task-id}`
24
- - `gh auth status`
24
+ - 执行前先读取 `.agents/rules/issue-pr-commands.md`,并按其中的认证命令验证当前平台访问能力
25
25
 
26
26
  如果用户传入了 `{task-id}`,校验其格式为 `TASK-{yyyyMMdd-HHmmss}`。
27
27
 
28
28
  ### 2. 获取 Issue 评论
29
29
 
30
- 读取 Issue 的全部评论,保留原始顺序和评论 ID。
31
-
32
- 建议命令:
33
-
34
- ```bash
35
- gh api "repos/{owner}/{repo}/issues/{issue-number}/comments" --paginate
36
- ```
30
+ `.agents/rules/issue-pr-commands.md` 中的 “Issue 评论读取” 命令读取 Issue 的全部评论,保留原始顺序和评论 ID。
37
31
 
38
32
  ### 3. 确定 task-id 与待恢复文件
39
33
 
@@ -87,7 +81,7 @@ gh api "repos/{owner}/{repo}/issues/{issue-number}/comments" --paginate
87
81
  获取当前时间:
88
82
 
89
83
  ```bash
90
- date "+%Y-%m-%d %H:%M:%S"
84
+ date "+%Y-%m-%d %H:%M:%S%:z"
91
85
  ```
92
86
 
93
87
  更新恢复出的 `task.md`:
@@ -97,7 +91,7 @@ date "+%Y-%m-%d %H:%M:%S"
97
91
  - 保留原 `current_step`
98
92
  - 在 `## 活动日志` 追加:
99
93
  ```
100
- - {yyyy-MM-dd HH:mm:ss} — **Restore Task** by {agent} — Restored task from Issue #{issue-number}
94
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Restore Task** by {agent} — Restored task from Issue #{issue-number}
101
95
  ```
102
96
 
103
97
  ### 7. 完成校验
@@ -152,7 +146,7 @@ node .agents/scripts/validate-artifact.js gate restore-task .agents/workspace/ac
152
146
  ## 错误处理
153
147
 
154
148
  - Issue 不存在或无权访问
155
- - `gh` 未认证
149
+ - 平台 CLI 未认证
156
150
  - 找不到带 sync 标记的评论
157
151
  - 无法唯一确定 `task-id`
158
152
  - 目标目录已存在
@@ -47,11 +47,11 @@ Create `.agents/workspace/active/{task-id}/{review-artifact}`.
47
47
  Get the current time:
48
48
 
49
49
  ```bash
50
- date "+%Y-%m-%d %H:%M:%S"
50
+ date "+%Y-%m-%d %H:%M:%S%:z"
51
51
  ```
52
52
 
53
53
  Update task.md and append:
54
- `- {yyyy-MM-dd HH:mm:ss} — **Code Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n} → {artifact-filename}`
54
+ `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Code Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n} → {artifact-filename}`
55
55
 
56
56
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
57
57
  - Read `.agents/rules/issue-sync.md` before syncing
@@ -47,11 +47,11 @@ description: "审查任务实现并输出代码审查报告"
47
47
  获取当前时间:
48
48
 
49
49
  ```bash
50
- date "+%Y-%m-%d %H:%M:%S"
50
+ date "+%Y-%m-%d %H:%M:%S%:z"
51
51
  ```
52
52
 
53
53
  更新 task.md,并追加:
54
- `- {yyyy-MM-dd HH:mm:ss} — **Code Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n} → {artifact-filename}`
54
+ `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Code Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n} → {artifact-filename}`
55
55
 
56
56
  如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
57
57
  - 执行前先读取 `.agents/rules/issue-sync.md`