@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
@@ -0,0 +1,111 @@
1
+ # Issue / PR Platform Commands
2
+
3
+ Read this file before verifying platform authentication, reading Issues / PRs, or creating and updating Issues / PRs.
4
+
5
+ ## Authentication and Repository Info
6
+
7
+ Verify that GitHub CLI is available and authenticated:
8
+
9
+ ```bash
10
+ gh auth status
11
+ gh repo view --json nameWithOwner
12
+ ```
13
+
14
+ If either command fails, stop or degrade according to the calling skill.
15
+
16
+ ## Read and Create Issues
17
+
18
+ Read an Issue:
19
+
20
+ ```bash
21
+ gh issue view {issue-number} --json number,title,body,labels,state,milestone,url
22
+ ```
23
+
24
+ Create an Issue:
25
+
26
+ ```bash
27
+ gh issue create --title "{title}" --body "{body}" --assignee @me {label-args} {milestone-arg}
28
+ ```
29
+
30
+ - expand `{label-args}` into repeated `--label` flags from the validated label list
31
+ - omit all `--label` flags when nothing valid remains
32
+ - omit `{milestone-arg}` entirely when no milestone should be set
33
+
34
+ Set the Issue Type:
35
+
36
+ ```bash
37
+ gh api "orgs/{owner}/issue-types" --jq '.[].name'
38
+ gh api "repos/{owner}/{repo}/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent
39
+ ```
40
+
41
+ ## Update Issues
42
+
43
+ Use this shape when updating titles, labels, assignees, or milestones:
44
+
45
+ ```bash
46
+ gh issue edit {issue-number} {edit-args}
47
+ ```
48
+
49
+ Common arguments:
50
+ - `--title "{title}"`
51
+ - `--add-label "{label}"`
52
+ - `--remove-label "{label}"`
53
+ - `--add-assignee @me`
54
+ - `--milestone "{milestone}"`
55
+
56
+ Close an Issue:
57
+
58
+ ```bash
59
+ gh issue close {issue-number} --reason "{reason}"
60
+ ```
61
+
62
+ ## Read Issue Comments
63
+
64
+ Read Issue comments or search for existing hidden markers:
65
+
66
+ ```bash
67
+ gh api "repos/{owner}/{repo}/issues/{issue-number}/comments" --paginate
68
+ ```
69
+
70
+ ## Read and Create PRs
71
+
72
+ Read a PR:
73
+
74
+ ```bash
75
+ gh pr view {pr-number} --json number,title,body,labels,state,milestone,url,files
76
+ ```
77
+
78
+ List PRs:
79
+
80
+ ```bash
81
+ gh pr list --state {state} --base {base-branch} --json number,title,url,headRefName,baseRefName
82
+ ```
83
+
84
+ Create a PR:
85
+
86
+ ```bash
87
+ gh pr create --base "{target-branch}" --title "{title}" --assignee @me --body "$(cat <<'EOF'
88
+ {pr-body}
89
+ EOF
90
+ )"
91
+ ```
92
+
93
+ ## Update PRs
94
+
95
+ Update PR titles, labels, or milestones with:
96
+
97
+ ```bash
98
+ gh pr edit {pr-number} {edit-args}
99
+ ```
100
+
101
+ Common arguments:
102
+ - `--title "{title}"`
103
+ - `--add-label "{label}"`
104
+ - `--remove-label "{label}"`
105
+ - `--milestone "{milestone}"`
106
+
107
+ ## Error Handling
108
+
109
+ - read failures: stop or skip based on the calling skill
110
+ - update failures: warn and continue when the caller marks the action as best-effort
111
+ - `@me` is resolved by `gh` CLI to the authenticated user
@@ -0,0 +1,111 @@
1
+ # Issue / PR 平台命令
2
+
3
+ 在需要验证平台认证、读取 Issue / PR,或执行 Issue / PR 创建与更新前先读取本文件。
4
+
5
+ ## 认证与仓库信息
6
+
7
+ 先验证 GitHub CLI 可用且已认证:
8
+
9
+ ```bash
10
+ gh auth status
11
+ gh repo view --json nameWithOwner
12
+ ```
13
+
14
+ 如果任一命令失败,按调用该规则的 skill 约定停止或降级。
15
+
16
+ ## Issue 读取与创建
17
+
18
+ 读取 Issue:
19
+
20
+ ```bash
21
+ gh issue view {issue-number} --json number,title,body,labels,state,milestone,url
22
+ ```
23
+
24
+ 创建 Issue:
25
+
26
+ ```bash
27
+ gh issue create --title "{title}" --body "{body}" --assignee @me {label-args} {milestone-arg}
28
+ ```
29
+
30
+ - `{label-args}` 由调用方按有效 label 列表展开为多个 `--label`
31
+ - 没有有效 label 时省略全部 `--label`
32
+ - `{milestone-arg}` 为空时整体省略
33
+
34
+ 设置 Issue Type:
35
+
36
+ ```bash
37
+ gh api "orgs/{owner}/issue-types" --jq '.[].name'
38
+ gh api "repos/{owner}/{repo}/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent
39
+ ```
40
+
41
+ ## Issue 更新
42
+
43
+ 更新标题、label、assignee 或 milestone 时使用:
44
+
45
+ ```bash
46
+ gh issue edit {issue-number} {edit-args}
47
+ ```
48
+
49
+ 常见参数:
50
+ - `--title "{title}"`
51
+ - `--add-label "{label}"`
52
+ - `--remove-label "{label}"`
53
+ - `--add-assignee @me`
54
+ - `--milestone "{milestone}"`
55
+
56
+ 关闭 Issue:
57
+
58
+ ```bash
59
+ gh issue close {issue-number} --reason "{reason}"
60
+ ```
61
+
62
+ ## Issue 评论读取
63
+
64
+ 读取 Issue 评论或按隐藏标记查找已有评论:
65
+
66
+ ```bash
67
+ gh api "repos/{owner}/{repo}/issues/{issue-number}/comments" --paginate
68
+ ```
69
+
70
+ ## PR 读取与创建
71
+
72
+ 读取 PR:
73
+
74
+ ```bash
75
+ gh pr view {pr-number} --json number,title,body,labels,state,milestone,url,files
76
+ ```
77
+
78
+ 列出 PR:
79
+
80
+ ```bash
81
+ gh pr list --state {state} --base {base-branch} --json number,title,url,headRefName,baseRefName
82
+ ```
83
+
84
+ 创建 PR:
85
+
86
+ ```bash
87
+ gh pr create --base "{target-branch}" --title "{title}" --assignee @me --body "$(cat <<'EOF'
88
+ {pr-body}
89
+ EOF
90
+ )"
91
+ ```
92
+
93
+ ## PR 更新
94
+
95
+ 更新 PR 标题、label 或 milestone:
96
+
97
+ ```bash
98
+ gh pr edit {pr-number} {edit-args}
99
+ ```
100
+
101
+ 常见参数:
102
+ - `--title "{title}"`
103
+ - `--add-label "{label}"`
104
+ - `--remove-label "{label}"`
105
+ - `--milestone "{milestone}"`
106
+
107
+ ## 错误处理
108
+
109
+ - 读取失败:按调用方规则决定停止还是跳过
110
+ - 更新失败:如果调用方标记为 best-effort,输出警告并继续
111
+ - `@me` 由 `gh` CLI 解析为当前认证用户
@@ -0,0 +1,50 @@
1
+ # Label / Milestone Platform Commands
2
+
3
+ Read this file before initializing labels, initializing milestones, or adjusting milestones during release work.
4
+
5
+ ## Authentication and Repository Info
6
+
7
+ ```bash
8
+ gh auth token
9
+ gh repo view --json nameWithOwner --jq '.nameWithOwner'
10
+ ```
11
+
12
+ ## Label Operations
13
+
14
+ List existing labels:
15
+
16
+ ```bash
17
+ gh label list --limit 200 --json name --jq '.[].name'
18
+ ```
19
+
20
+ Create or update a label:
21
+
22
+ ```bash
23
+ gh label create "{name}" --color "{color}" --description "{description}" --force
24
+ ```
25
+
26
+ ## Milestone Operations
27
+
28
+ List milestones:
29
+
30
+ ```bash
31
+ gh api "repos/$repo/milestones?state=all" --paginate
32
+ ```
33
+
34
+ Create a milestone:
35
+
36
+ ```bash
37
+ gh api "repos/$repo/milestones" -f title="{title}" -f description="{description}" -f state="{state}"
38
+ ```
39
+
40
+ Update a milestone:
41
+
42
+ ```bash
43
+ gh api "repos/$repo/milestones/{number}" -X PATCH -f state="{state}" -f description="{description}"
44
+ ```
45
+
46
+ ## Constraints
47
+
48
+ - use label names as the idempotency key
49
+ - use milestone titles as the idempotency key, then milestone numbers when patching state
50
+ - stop or skip according to the calling skill when commands fail
@@ -0,0 +1,50 @@
1
+ # Label / Milestone 平台命令
2
+
3
+ 在初始化 label、初始化 milestone,或发布流程需要调整 milestone 前先读取本文件。
4
+
5
+ ## 认证与仓库信息
6
+
7
+ ```bash
8
+ gh auth token
9
+ gh repo view --json nameWithOwner --jq '.nameWithOwner'
10
+ ```
11
+
12
+ ## Label 操作
13
+
14
+ 列出现有 label:
15
+
16
+ ```bash
17
+ gh label list --limit 200 --json name --jq '.[].name'
18
+ ```
19
+
20
+ 创建或更新 label:
21
+
22
+ ```bash
23
+ gh label create "{name}" --color "{color}" --description "{description}" --force
24
+ ```
25
+
26
+ ## Milestone 操作
27
+
28
+ 列出 milestone:
29
+
30
+ ```bash
31
+ gh api "repos/$repo/milestones?state=all" --paginate
32
+ ```
33
+
34
+ 创建 milestone:
35
+
36
+ ```bash
37
+ gh api "repos/$repo/milestones" -f title="{title}" -f description="{description}" -f state="{state}"
38
+ ```
39
+
40
+ 更新 milestone:
41
+
42
+ ```bash
43
+ gh api "repos/$repo/milestones/{number}" -X PATCH -f state="{state}" -f description="{description}"
44
+ ```
45
+
46
+ ## 约束
47
+
48
+ - label 以名称作为幂等键
49
+ - milestone 以标题作为幂等键,必要时再结合编号更新状态
50
+ - 失败时按调用方规则决定停止或跳过
@@ -0,0 +1,30 @@
1
+ # Release Platform Commands
2
+
3
+ Read this file before loading release history, querying merged PRs, or creating a draft release.
4
+
5
+ ## Query Releases
6
+
7
+ ```bash
8
+ gh release list --limit {limit} --json tagName,isDraft,isPrerelease
9
+ gh release view "{tag}" --json body,url
10
+ ```
11
+
12
+ ## Query Merged PRs
13
+
14
+ ```bash
15
+ gh pr list --state merged --base "{branch}" --json number,title,mergedAt,labels
16
+ ```
17
+
18
+ When needed, read the linked Issue:
19
+
20
+ ```bash
21
+ gh issue view {issue-number} --json number,title,labels,url
22
+ ```
23
+
24
+ ## Create a Draft Release
25
+
26
+ ```bash
27
+ gh release create "v{version}" --draft --title "v{version}" --notes-file "{notes-file}"
28
+ ```
29
+
30
+ If commands fail, stop or escalate according to the calling skill.
@@ -0,0 +1,30 @@
1
+ # Release 平台命令
2
+
3
+ 在读取历史 release、查询已合并 PR,或创建 draft release 前先读取本文件。
4
+
5
+ ## Release 查询
6
+
7
+ ```bash
8
+ gh release list --limit {limit} --json tagName,isDraft,isPrerelease
9
+ gh release view "{tag}" --json body,url
10
+ ```
11
+
12
+ ## 已合并 PR 查询
13
+
14
+ ```bash
15
+ gh pr list --state merged --base "{branch}" --json number,title,mergedAt,labels
16
+ ```
17
+
18
+ 必要时读取关联 Issue:
19
+
20
+ ```bash
21
+ gh issue view {issue-number} --json number,title,labels,url
22
+ ```
23
+
24
+ ## 创建 Draft Release
25
+
26
+ ```bash
27
+ gh release create "v{version}" --draft --title "v{version}" --notes-file "{notes-file}"
28
+ ```
29
+
30
+ 失败时按调用方规则停止或提示人工介入。
@@ -0,0 +1,43 @@
1
+ # Security Alert Platform Commands
2
+
3
+ Read this file before importing or dismissing Dependabot or Code Scanning alerts.
4
+
5
+ ## Dependabot Alerts
6
+
7
+ Read an alert:
8
+
9
+ ```bash
10
+ gh api "repos/{owner}/{repo}/dependabot/alerts/{number}"
11
+ ```
12
+
13
+ Dismiss an alert:
14
+
15
+ ```bash
16
+ gh api --method PATCH "repos/{owner}/{repo}/dependabot/alerts/{number}" \
17
+ -f state="dismissed" \
18
+ -f dismissed_reason="{reason}" \
19
+ -f dismissed_comment="{comment}"
20
+ ```
21
+
22
+ ## Code Scanning Alerts
23
+
24
+ Read an alert:
25
+
26
+ ```bash
27
+ gh api "repos/{owner}/{repo}/code-scanning/alerts/{number}"
28
+ ```
29
+
30
+ Dismiss an alert:
31
+
32
+ ```bash
33
+ gh api --method PATCH "repos/{owner}/{repo}/code-scanning/alerts/{number}" \
34
+ -f state="dismissed" \
35
+ -f dismissed_reason="{reason}" \
36
+ -f dismissed_comment="{comment}"
37
+ ```
38
+
39
+ ## Constraints
40
+
41
+ - read the current alert state before deciding whether to continue
42
+ - validate dismissal reasons in the calling skill before sending them
43
+ - stop or escalate according to the calling skill when API calls fail
@@ -0,0 +1,43 @@
1
+ # 安全告警平台命令
2
+
3
+ 在导入或关闭 Dependabot / Code Scanning 告警前先读取本文件。
4
+
5
+ ## Dependabot 告警
6
+
7
+ 读取告警:
8
+
9
+ ```bash
10
+ gh api "repos/{owner}/{repo}/dependabot/alerts/{number}"
11
+ ```
12
+
13
+ 关闭告警:
14
+
15
+ ```bash
16
+ gh api --method PATCH "repos/{owner}/{repo}/dependabot/alerts/{number}" \
17
+ -f state="dismissed" \
18
+ -f dismissed_reason="{reason}" \
19
+ -f dismissed_comment="{comment}"
20
+ ```
21
+
22
+ ## Code Scanning 告警
23
+
24
+ 读取告警:
25
+
26
+ ```bash
27
+ gh api "repos/{owner}/{repo}/code-scanning/alerts/{number}"
28
+ ```
29
+
30
+ 关闭告警:
31
+
32
+ ```bash
33
+ gh api --method PATCH "repos/{owner}/{repo}/code-scanning/alerts/{number}" \
34
+ -f state="dismissed" \
35
+ -f dismissed_reason="{reason}" \
36
+ -f dismissed_comment="{comment}"
37
+ ```
38
+
39
+ ## 约束
40
+
41
+ - 先读取当前告警状态,再决定是否继续
42
+ - 关闭理由必须由调用方校验后再传入
43
+ - API 失败时按调用方规则停止或提示人工介入
@@ -1,5 +1,3 @@
1
- #!/usr/bin/env node
2
-
3
1
  import fs from "node:fs";
4
2
  import path from "node:path";
5
3
  import process from "node:process";
@@ -31,8 +29,8 @@ const DEFAULT_REQUIRED_FIELDS = [
31
29
 
32
30
  const DEFAULT_RETRY_DELAYS_MS = [3000, 10000];
33
31
  const DEFAULT_FRESHNESS_MINUTES = 30;
34
- const DATE_TIME_PATTERN = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
35
- const ACTIVITY_LOG_PATTERN = /^- (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) — \*\*(.+?)\*\* by (.+?) — (.+)$/;
32
+ const DATE_TIME_PATTERN = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:[+-]\d{2}:\d{2})?$/;
33
+ const ACTIVITY_LOG_PATTERN = /^- (\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:[+-]\d{2}:\d{2})?) — \*\*(.+?)\*\* by (.+?) — (.+)$/;
36
34
  const BRANCH_SLUG_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
37
35
 
38
36
  const scriptPath = fileURLToPath(import.meta.url);
@@ -1353,7 +1351,7 @@ function sleep(delayMs) {
1353
1351
  // === Utilities ===
1354
1352
 
1355
1353
  function minutesSinceTimestamp(timestamp) {
1356
- const normalized = timestamp.replace(" ", "T");
1354
+ const normalized = timestamp.includes("T") ? timestamp : timestamp.replace(" ", "T");
1357
1355
  const parsed = Date.parse(normalized);
1358
1356
  if (Number.isNaN(parsed)) {
1359
1357
  return Number.POSITIVE_INFINITY;
@@ -103,7 +103,7 @@ Create `.agents/workspace/active/{task-id}/{analysis-artifact}`.
103
103
  Get the current time:
104
104
 
105
105
  ```bash
106
- date "+%Y-%m-%d %H:%M:%S"
106
+ date "+%Y-%m-%d %H:%M:%S%:z"
107
107
  ```
108
108
 
109
109
  Update `.agents/workspace/active/{task-id}/task.md`:
@@ -115,7 +115,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
115
115
  - Mark requirement-analysis as complete in workflow progress and include the actual round when the task template supports it
116
116
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
117
117
  ```
118
- - {yyyy-MM-dd HH:mm:ss} — **Requirement Analysis (Round {N})** by {agent} — Analysis completed → {analysis-artifact}
118
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Requirement Analysis (Round {N})** by {agent} — Analysis completed → {analysis-artifact}
119
119
  ```
120
120
 
121
121
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
@@ -103,7 +103,7 @@ description: "分析任务并输出需求分析文档"
103
103
  获取当前时间:
104
104
 
105
105
  ```bash
106
- date "+%Y-%m-%d %H:%M:%S"
106
+ date "+%Y-%m-%d %H:%M:%S%:z"
107
107
  ```
108
108
 
109
109
  更新 `.agents/workspace/active/{task-id}/task.md`:
@@ -115,7 +115,7 @@ date "+%Y-%m-%d %H:%M:%S"
115
115
  - 在工作流进度中标记 requirement-analysis 为已完成,并注明实际轮次(如果任务模板支持)
116
116
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
117
117
  ```
118
- - {yyyy-MM-dd HH:mm:ss} — **Requirement Analysis (Round {N})** by {agent} — Analysis completed → {analysis-artifact}
118
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Requirement Analysis (Round {N})** by {agent} — Analysis completed → {analysis-artifact}
119
119
  ```
120
120
 
121
121
  如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
@@ -210,7 +210,7 @@ rebuild_manifest() {
210
210
  entries_file="$tmpdir/manifest.tsv"
211
211
  month_keys_file="$tmpdir/manifest-months.tsv"
212
212
  year_keys_file="$tmpdir/manifest-years.tsv"
213
- generated_at=$(date "+%Y-%m-%d %H:%M:%S")
213
+ generated_at=$(date "+%Y-%m-%d %H:%M:%S%:z")
214
214
 
215
215
  mkdir -p "$ARCHIVE_DIR"
216
216
  : > "$entries_file"
@@ -40,7 +40,7 @@ Before blocking, thoroughly analyze:
40
40
  Get the current time:
41
41
 
42
42
  ```bash
43
- date "+%Y-%m-%d %H:%M:%S"
43
+ date "+%Y-%m-%d %H:%M:%S%:z"
44
44
  ```
45
45
 
46
46
  Update `.agents/workspace/active/{task-id}/task.md`:
@@ -49,7 +49,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
49
49
  - `updated_at`: {current timestamp}
50
50
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
51
51
  ```
52
- - {yyyy-MM-dd HH:mm:ss} — **Blocked** by {agent} — {one-line reason}
52
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Blocked** by {agent} — {one-line reason}
53
53
  ```
54
54
 
55
55
  Add a blocking information section to task.md.
@@ -40,7 +40,7 @@ description: "标记任务为阻塞状态并记录原因"
40
40
  获取当前时间:
41
41
 
42
42
  ```bash
43
- date "+%Y-%m-%d %H:%M:%S"
43
+ date "+%Y-%m-%d %H:%M:%S%:z"
44
44
  ```
45
45
 
46
46
  更新 `.agents/workspace/active/{task-id}/task.md`:
@@ -49,7 +49,7 @@ date "+%Y-%m-%d %H:%M:%S"
49
49
  - `updated_at`:{当前时间戳}
50
50
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
51
51
  ```
52
- - {yyyy-MM-dd HH:mm:ss} — **Blocked** by {agent} — {一行原因}
52
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Blocked** by {agent} — {一行原因}
53
53
  ```
54
54
 
55
55
  在 task.md 中添加阻塞信息部分。