@fitlab-ai/agent-infra 0.5.6 → 0.5.8

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 (166) hide show
  1. package/README.md +92 -4
  2. package/README.zh-CN.md +92 -4
  3. package/bin/cli.js +28 -4
  4. package/lib/defaults.json +5 -2
  5. package/lib/init.js +86 -5
  6. package/lib/prompt.js +28 -1
  7. package/lib/render.js +1 -1
  8. package/lib/sandbox/commands/rm.js +6 -4
  9. package/lib/sandbox/commands/vm.js +43 -16
  10. package/lib/sandbox/config.js +5 -0
  11. package/lib/sandbox/engine.js +144 -16
  12. package/lib/sandbox/shell.js +36 -2
  13. package/lib/sandbox/task-resolver.js +13 -6
  14. package/lib/update.js +14 -3
  15. package/package.json +5 -5
  16. package/templates/.agents/QUICKSTART.en.md +19 -2
  17. package/templates/.agents/QUICKSTART.zh-CN.md +19 -2
  18. package/templates/.agents/README.en.md +71 -2
  19. package/templates/.agents/README.zh-CN.md +71 -2
  20. package/templates/.agents/rules/issue-pr-commands.en.md +5 -0
  21. package/templates/.agents/rules/issue-pr-commands.github.en.md +60 -0
  22. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +60 -0
  23. package/templates/.agents/rules/issue-pr-commands.zh-CN.md +5 -0
  24. package/templates/.agents/rules/issue-sync.en.md +19 -0
  25. package/templates/.agents/rules/issue-sync.github.en.md +14 -0
  26. package/templates/.agents/rules/issue-sync.github.zh-CN.md +14 -0
  27. package/templates/.agents/rules/issue-sync.zh-CN.md +19 -0
  28. package/templates/.agents/rules/label-milestone-setup.en.md +5 -0
  29. package/templates/.agents/rules/label-milestone-setup.github.en.md +10 -0
  30. package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +10 -0
  31. package/templates/.agents/rules/label-milestone-setup.zh-CN.md +5 -0
  32. package/templates/.agents/rules/milestone-inference.en.md +5 -0
  33. package/templates/.agents/rules/milestone-inference.zh-CN.md +5 -0
  34. package/templates/.agents/rules/pr-sync.en.md +5 -0
  35. package/templates/.agents/rules/pr-sync.zh-CN.md +5 -0
  36. package/templates/.agents/rules/release-commands.en.md +5 -0
  37. package/templates/.agents/rules/release-commands.github.en.md +16 -0
  38. package/templates/.agents/rules/release-commands.github.zh-CN.md +16 -0
  39. package/templates/.agents/rules/release-commands.zh-CN.md +5 -0
  40. package/templates/.agents/rules/security-alerts.en.md +5 -0
  41. package/templates/.agents/rules/security-alerts.zh-CN.md +5 -0
  42. package/templates/.agents/scripts/platform-adapters/find-existing-task.github.js +272 -0
  43. package/templates/.agents/scripts/platform-adapters/find-existing-task.js +5 -0
  44. package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +88 -8
  45. package/templates/.agents/scripts/platform-adapters/platform-sync.js +13 -0
  46. package/templates/.agents/skills/analyze-task/SKILL.en.md +5 -5
  47. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +5 -5
  48. package/templates/.agents/skills/analyze-task/config/verify.json +3 -1
  49. package/templates/.agents/skills/block-task/SKILL.en.md +1 -1
  50. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +1 -1
  51. package/templates/.agents/skills/block-task/config/verify.json +2 -1
  52. package/templates/.agents/skills/cancel-task/SKILL.en.md +3 -3
  53. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +4 -4
  54. package/templates/.agents/skills/cancel-task/config/verify.json +2 -1
  55. package/templates/.agents/skills/check-task/SKILL.en.md +1 -1
  56. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +1 -1
  57. package/templates/.agents/skills/close-codescan/SKILL.en.md +3 -3
  58. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +3 -3
  59. package/templates/.agents/skills/close-dependabot/SKILL.en.md +1 -1
  60. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -1
  61. package/templates/.agents/skills/commit/SKILL.en.md +2 -2
  62. package/templates/.agents/skills/commit/SKILL.zh-CN.md +2 -2
  63. package/templates/.agents/skills/commit/config/verify.json +2 -1
  64. package/templates/.agents/skills/complete-task/SKILL.en.md +1 -1
  65. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +1 -1
  66. package/templates/.agents/skills/complete-task/config/verify.json +2 -1
  67. package/templates/.agents/skills/create-issue/SKILL.en.md +10 -10
  68. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +10 -10
  69. package/templates/.agents/skills/create-issue/config/verify.json +2 -1
  70. package/templates/.agents/skills/create-issue/reference/label-and-type.en.md +3 -3
  71. package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +3 -3
  72. package/templates/.agents/skills/create-issue/reference/template-matching.en.md +6 -34
  73. package/templates/.agents/skills/create-issue/reference/template-matching.zh-CN.md +8 -36
  74. package/templates/.agents/skills/create-pr/SKILL.en.md +3 -3
  75. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -3
  76. package/templates/.agents/skills/create-pr/config/verify.json +2 -1
  77. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +7 -17
  78. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +27 -37
  79. package/templates/.agents/skills/create-release-note/SKILL.en.md +16 -9
  80. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +16 -9
  81. package/templates/.agents/skills/create-task/SKILL.en.md +5 -5
  82. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -5
  83. package/templates/.agents/skills/implement-task/SKILL.en.md +3 -3
  84. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +3 -3
  85. package/templates/.agents/skills/implement-task/config/verify.json +3 -1
  86. package/templates/.agents/skills/import-codescan/SKILL.en.md +3 -3
  87. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +3 -3
  88. package/templates/.agents/skills/import-dependabot/SKILL.en.md +2 -2
  89. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +2 -2
  90. package/templates/.agents/skills/import-issue/SKILL.en.md +41 -11
  91. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +41 -11
  92. package/templates/.agents/skills/init-labels/SKILL.en.md +10 -10
  93. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +10 -10
  94. package/templates/.agents/skills/init-labels/scripts/init-labels.sh +6 -0
  95. package/templates/.agents/skills/init-milestones/SKILL.en.md +8 -8
  96. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +8 -8
  97. package/templates/.agents/skills/init-milestones/scripts/init-milestones.sh +6 -0
  98. package/templates/.agents/skills/plan-task/SKILL.en.md +3 -3
  99. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +3 -3
  100. package/templates/.agents/skills/plan-task/config/verify.json +3 -1
  101. package/templates/.agents/skills/post-release/SKILL.en.md +95 -0
  102. package/templates/.agents/skills/post-release/SKILL.zh-CN.md +95 -0
  103. package/templates/.agents/skills/refine-task/SKILL.en.md +2 -2
  104. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +2 -2
  105. package/templates/.agents/skills/refine-task/config/verify.json +3 -1
  106. package/templates/.agents/skills/refine-title/SKILL.en.md +1 -1
  107. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -1
  108. package/templates/.agents/skills/release/SKILL.en.md +6 -1
  109. package/templates/.agents/skills/release/SKILL.zh-CN.md +6 -1
  110. package/templates/.agents/skills/release/scripts/manage-milestones.sh +6 -0
  111. package/templates/.agents/skills/restore-task/SKILL.en.md +13 -64
  112. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +13 -64
  113. package/templates/.agents/skills/review-task/SKILL.en.md +3 -3
  114. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +3 -3
  115. package/templates/.agents/skills/review-task/config/verify.json +3 -1
  116. package/templates/.agents/skills/test/SKILL.en.md +1 -1
  117. package/templates/.agents/skills/test/SKILL.zh-CN.md +1 -1
  118. package/templates/.agents/skills/test-integration/SKILL.en.md +1 -1
  119. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +1 -1
  120. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +12 -2
  121. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +6 -2
  122. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +344 -16
  123. package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +1 -1
  124. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +1 -1
  125. package/templates/.agents/templates/task.en.md +2 -2
  126. package/templates/.agents/templates/task.zh-CN.md +2 -2
  127. package/templates/.claude/commands/create-issue.en.md +1 -1
  128. package/templates/.claude/commands/create-issue.zh-CN.md +1 -1
  129. package/templates/.claude/commands/import-issue.en.md +1 -1
  130. package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
  131. package/templates/.claude/commands/init-labels.en.md +1 -1
  132. package/templates/.claude/commands/init-labels.zh-CN.md +1 -1
  133. package/templates/.claude/commands/init-milestones.en.md +1 -1
  134. package/templates/.claude/commands/init-milestones.zh-CN.md +1 -1
  135. package/templates/.claude/commands/post-release.en.md +8 -0
  136. package/templates/.claude/commands/post-release.zh-CN.md +8 -0
  137. package/templates/.claude/commands/restore-task.en.md +1 -1
  138. package/templates/.claude/commands/restore-task.zh-CN.md +1 -1
  139. package/templates/.claude/hooks/check-version-format.sh +1 -1
  140. package/templates/.gemini/commands/_project_/create-issue.en.toml +1 -1
  141. package/templates/.gemini/commands/_project_/create-issue.zh-CN.toml +1 -1
  142. package/templates/.gemini/commands/_project_/import-issue.en.toml +1 -1
  143. package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +1 -1
  144. package/templates/.gemini/commands/_project_/init-labels.en.toml +2 -2
  145. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +2 -2
  146. package/templates/.gemini/commands/_project_/init-milestones.en.toml +2 -2
  147. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +2 -2
  148. package/templates/.gemini/commands/_project_/post-release.en.toml +6 -0
  149. package/templates/.gemini/commands/_project_/post-release.zh-CN.toml +6 -0
  150. package/templates/.gemini/commands/_project_/restore-task.en.toml +1 -1
  151. package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +1 -1
  152. package/templates/{.github/hooks → .git-hooks}/check-version-format.sh +2 -2
  153. package/templates/.github/workflows/pr-label.yml +1 -1
  154. package/templates/.opencode/commands/create-issue.en.md +1 -1
  155. package/templates/.opencode/commands/create-issue.zh-CN.md +1 -1
  156. package/templates/.opencode/commands/import-issue.en.md +1 -1
  157. package/templates/.opencode/commands/import-issue.zh-CN.md +1 -1
  158. package/templates/.opencode/commands/init-labels.en.md +1 -1
  159. package/templates/.opencode/commands/init-labels.zh-CN.md +1 -1
  160. package/templates/.opencode/commands/init-milestones.en.md +1 -1
  161. package/templates/.opencode/commands/init-milestones.zh-CN.md +1 -1
  162. package/templates/.opencode/commands/post-release.en.md +9 -0
  163. package/templates/.opencode/commands/post-release.zh-CN.md +9 -0
  164. package/templates/.opencode/commands/restore-task.en.md +1 -1
  165. package/templates/.opencode/commands/restore-task.zh-CN.md +1 -1
  166. /package/templates/{.github/hooks → .git-hooks}/pre-commit +0 -0
@@ -108,7 +108,7 @@
108
108
  | `status:` | Yes | — | PR 有自身状态流转(Open / Draft / Merged / Closed);Issue 使用 `status:` label 标记等待反馈、已确认等项目管理状态 |
109
109
  | `in:` | Yes | Yes | Issue 和 PR 均可按模块筛选 |
110
110
 
111
- 默认 GitHub 配置下,可使用 `/init-labels` 命令一次性创建标准 labels。
111
+ 使用 `/init-labels` 命令可通过平台适配器一次性创建标准 labels。
112
112
 
113
113
  ## 私有平台扩展
114
114
 
@@ -120,6 +120,27 @@
120
120
  4. 如果你维护的是模板源码分支或私有 fork,需要先补齐对应的 `.{platform}.` 模板变体,再把该平台标识加入模板同步逻辑。
121
121
  5. 在正式推广前,先用一个测试任务完整验证工作流和 gate 校验。
122
122
 
123
+ ## 外部模板与 Skill 源
124
+
125
+ 团队可以在 `.agents/.airc.json` 中配置外部模板源和共享 skill 源,用于接入私有平台模板、私有规则和团队维护的自定义 skill:
126
+
127
+ ```json
128
+ {
129
+ "templates": {
130
+ "sources": [
131
+ { "type": "local", "path": "~/private-templates" }
132
+ ]
133
+ },
134
+ "skills": {
135
+ "sources": [
136
+ { "type": "local", "path": "~/private-skills" }
137
+ ]
138
+ }
139
+ }
140
+ ```
141
+
142
+ 模板源优先级为内置模板优先,外部模板只做补充;多个外部模板源之间,后面的 source 覆盖前面的 source。同步报告会在 `templateSources.conflicts` 中列出被忽略的同名文件。外部模板和 skill 可能包含会被 AI 工作流执行的脚本,只配置可信路径。
143
+
123
144
  ## 自定义 Skills
124
145
 
125
146
  项目可以在内置任务工作流之外增加自己的 skill。
@@ -156,7 +177,7 @@ args: "<task-id>" # 可选
156
177
  {
157
178
  "skills": {
158
179
  "sources": [
159
- { "type": "local", "path": "~/company-skills" }
180
+ { "type": "local", "path": "~/private-skills" }
160
181
  ]
161
182
  }
162
183
  }
@@ -172,6 +193,54 @@ args: "<task-id>" # 可选
172
193
  - 自定义 source 不能覆盖内置 skill;如果与内置 skill 同名,会跳过该 source skill
173
194
  - 如果项目必须接管某个内置 skill 或命令,请使用 `files.ejected`
174
195
 
196
+ ## 自定义 TUI 配置
197
+
198
+ 当团队使用的 AI TUI 不属于内置命令目标时,可以在 `.agents/.airc.json` 顶层配置 `customTUIs` 数组。该配置用于让 agent-infra 输出正确的下一步命令,并通过学习自定义 TUI 目录中的既有命令文件,为项目自定义 skill 生成同格式命令。
199
+
200
+ | 字段 | 必填 | 含义 |
201
+ |------|------|------|
202
+ | `name` | 是 | 报告和下一步提示中展示的工具名称,例如 `Acme TUI`。 |
203
+ | `dir` | 是 | 相对项目根目录的命令目录,例如 `.acme/commands`。路径必须位于项目根目录内。 |
204
+ | `invoke` | 是 | 面向用户展示的命令模板,用于生成下一步提示。 |
205
+
206
+ `invoke` 支持的占位符:
207
+
208
+ | 占位符 | 替换为 | 示例 |
209
+ |--------|--------|------|
210
+ | `${skillName}` | skill 命令名,例如 `review-task` 或 `commit`。 | `acme ${skillName}` -> `acme review-task` |
211
+ | `${projectName}` | `.airc.json` 中的 `project` 值,适用于带命名空间的命令。 | `/${projectName}:${skillName}` -> `/agent-infra:review-task` |
212
+
213
+ 不带命名空间的自定义 TUI:
214
+
215
+ ```json
216
+ {
217
+ "customTUIs": [
218
+ {
219
+ "name": "Acme TUI",
220
+ "dir": ".acme/commands",
221
+ "invoke": "acme ${skillName}"
222
+ }
223
+ ]
224
+ }
225
+ ```
226
+
227
+ 带命名空间的自定义 TUI:
228
+
229
+ ```json
230
+ {
231
+ "project": "agent-infra",
232
+ "customTUIs": [
233
+ {
234
+ "name": "Internal Gemini",
235
+ "dir": ".internal-gemini/commands",
236
+ "invoke": "/${projectName}:${skillName}"
237
+ }
238
+ ]
239
+ }
240
+ ```
241
+
242
+ `customTUIs` 每个条目对应一个自定义 TUI。若希望 `update-agent-infra` 为自定义 skill 生成命令文件,请在 `dir` 中保留至少一个引用内置 skill 路径的既有命令文件,例如 `.agents/skills/analyze-task/SKILL.md`;agent-infra 会以该文件作为格式参考。
243
+
175
244
  ## Skill 编写规范
176
245
 
177
246
  编写或维护 `.agents/skills/*/SKILL.md` 及其模板时,步骤编号遵循以下规则:
@@ -0,0 +1,5 @@
1
+ # Issue and PR Commands
2
+
3
+ This code platform does not provide built-in issue or pull request commands.
4
+
5
+ Platform-specific automation is skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates. Keep local task artifacts as the source of truth, or install a platform-specific template pack before running the workflow.
@@ -22,6 +22,44 @@ Before any later `gh issue` or `gh api "repos/..."` call, follow `.agents/rules/
22
22
  - keep `gh pr *` commands on the current repository without adding `-R`
23
23
  - keep organization-scoped commands such as `gh api "orgs/{owner}/..."` unchanged
24
24
 
25
+ ## Issue Template Detection
26
+
27
+ Detect GitHub Issue Forms with:
28
+
29
+ ```bash
30
+ rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
31
+ ```
32
+
33
+ Read matching form files locally before creating the Issue. If the directory is missing or no form matches the task, use the caller's fallback body format.
34
+
35
+ Typical candidate templates:
36
+ - `bug_report.yml` for bug work
37
+ - `question.yml` for question or investigation work
38
+ - `feature_request.yml` for feature work
39
+ - `documentation.yml` for documentation work
40
+ - `other.yml` as the general fallback
41
+
42
+ For GitHub Issue Forms, inspect the matched form's:
43
+ - `name`
44
+ - `type:`
45
+ - `labels:`
46
+ - `body:`
47
+
48
+ Field handling rules:
49
+ - `textarea` and `input`: use `attributes.label` as the markdown heading and fill values from task.md
50
+ - `markdown`: skip template explanation prose
51
+ - `dropdown` and `checkboxes`: skip
52
+ - when task.md lacks a suitable value, write `N/A`
53
+
54
+ Suggested field mapping:
55
+
56
+ | Template field hint | task.md source |
57
+ |---|---|
58
+ | `summary`, `title` | task title |
59
+ | `description`, `problem`, `what happened`, `issue-description`, `current-content` | task description |
60
+ | `solution`, `requirements`, `steps`, `suggested-content`, `impact`, `context`, `alternatives`, `expected` | requirements list |
61
+ | other `textarea` / `input` fields | task description, otherwise `N/A` |
62
+
25
63
  ## Read and Create Issues
26
64
 
27
65
  Read an Issue:
@@ -82,6 +120,28 @@ Read Issue comments or search for existing hidden markers:
82
120
  gh api "repos/$upstream_repo/issues/{issue-number}/comments" --paginate
83
121
  ```
84
122
 
123
+ ## PR Template and Metadata Helpers
124
+
125
+ Read a repository PR template when present:
126
+
127
+ ```bash
128
+ cat .github/PULL_REQUEST_TEMPLATE.md
129
+ ```
130
+
131
+ Review recent merged PRs for style:
132
+
133
+ ```bash
134
+ gh pr list --limit 3 --state merged --json number,title,body
135
+ ```
136
+
137
+ Verify that standard type labels exist before PR metadata sync:
138
+
139
+ ```bash
140
+ gh label list --search "type:" --limit 1 --json name --jq 'length'
141
+ ```
142
+
143
+ If the result is `0`, run `init-labels` before retrying PR metadata sync.
144
+
85
145
  ## Read and Create PRs
86
146
 
87
147
  Read a PR:
@@ -22,6 +22,44 @@ gh repo view --json nameWithOwner
22
22
  - `gh pr *` 命令保持作用于当前仓库,不额外加 `-R`
23
23
  - `gh api "orgs/{owner}/..."` 这类 org 级命令保持不变
24
24
 
25
+ ## Issue 模板检测
26
+
27
+ 使用以下命令检测 GitHub Issue Forms:
28
+
29
+ ```bash
30
+ rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
31
+ ```
32
+
33
+ 创建 Issue 前先读取匹配的 form 文件。目录不存在或没有匹配 form 时,使用调用方定义的 fallback 正文格式。
34
+
35
+ 常见候选模板:
36
+ - `bug_report.yml`:bug 工作
37
+ - `question.yml`:问题或排查工作
38
+ - `feature_request.yml`:功能工作
39
+ - `documentation.yml`:文档工作
40
+ - `other.yml`:通用 fallback
41
+
42
+ 对 GitHub Issue Forms,检查匹配 form 的:
43
+ - `name`
44
+ - `type:`
45
+ - `labels:`
46
+ - `body:`
47
+
48
+ 字段处理规则:
49
+ - `textarea` 和 `input`:使用 `attributes.label` 作为 markdown 标题,并从 task.md 填充值
50
+ - `markdown`:跳过模板说明文案
51
+ - `dropdown` 和 `checkboxes`:跳过
52
+ - task.md 缺少合适值时,写入 `N/A`
53
+
54
+ 建议字段映射:
55
+
56
+ | 模板字段提示 | task.md 来源 |
57
+ |---|---|
58
+ | `summary`, `title` | 任务标题 |
59
+ | `description`, `problem`, `what happened`, `issue-description`, `current-content` | 任务描述 |
60
+ | `solution`, `requirements`, `steps`, `suggested-content`, `impact`, `context`, `alternatives`, `expected` | 需求列表 |
61
+ | 其他 `textarea` / `input` 字段 | 任务描述,否则 `N/A` |
62
+
25
63
  ## Issue 读取与创建
26
64
 
27
65
  读取 Issue:
@@ -82,6 +120,28 @@ gh issue close {issue-number} -R "$upstream_repo" --reason "{reason}"
82
120
  gh api "repos/$upstream_repo/issues/{issue-number}/comments" --paginate
83
121
  ```
84
122
 
123
+ ## PR 模板与元数据辅助命令
124
+
125
+ 存在仓库 PR 模板时读取:
126
+
127
+ ```bash
128
+ cat .github/PULL_REQUEST_TEMPLATE.md
129
+ ```
130
+
131
+ 参考最近合并的 PR 风格:
132
+
133
+ ```bash
134
+ gh pr list --limit 3 --state merged --json number,title,body
135
+ ```
136
+
137
+ PR 元数据同步前验证标准 type labels 是否存在:
138
+
139
+ ```bash
140
+ gh label list --search "type:" --limit 1 --json name --jq 'length'
141
+ ```
142
+
143
+ 如果结果是 `0`,先运行 `init-labels`,再重试 PR 元数据同步。
144
+
85
145
  ## PR 读取与创建
86
146
 
87
147
  读取 PR:
@@ -0,0 +1,5 @@
1
+ # Issue 和 PR 命令
2
+
3
+ 当前代码平台未内置 Issue 或 Pull Request 命令支持。
4
+
5
+ 自定义平台会跳过平台专属自动化,除非你提供匹配的 `.{platform}.zh-CN.md` 规则模板。请以本地任务产物作为事实来源,或先安装平台专属模板包再运行工作流。
@@ -0,0 +1,19 @@
1
+ # Issue Sync
2
+
3
+ ## Marker Registry
4
+
5
+ These hidden markers are the canonical registry for Issue synchronization:
6
+
7
+ | Key | Marker |
8
+ |---|---|
9
+ | `task` | `<!-- sync-issue:{task-id}:task -->` |
10
+ | `artifact` | `<!-- sync-issue:{task-id}:{artifact-stem} -->` |
11
+ | `artifactChunk` | `<!-- sync-issue:{task-id}:{artifact-stem}:{part}/{total} -->` |
12
+ | `summary` | `<!-- sync-issue:{task-id}:summary -->` |
13
+ | `cancel` | `<!-- sync-issue:{task-id}:cancel -->` |
14
+
15
+ Callers should refer to the marker key in skill prose and keep concrete marker strings in this rule or the platform adapter defaults.
16
+
17
+ This code platform does not provide built-in issue synchronization.
18
+
19
+ Issue metadata, labels, milestones, assignees, and comments are skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates and platform adapters. Continue writing local task artifacts normally.
@@ -1,5 +1,19 @@
1
1
  # Issue Sync Rules
2
2
 
3
+ ## Marker Registry
4
+
5
+ These hidden markers are the canonical registry for Issue synchronization:
6
+
7
+ | Key | Marker |
8
+ |---|---|
9
+ | `task` | `<!-- sync-issue:{task-id}:task -->` |
10
+ | `artifact` | `<!-- sync-issue:{task-id}:{artifact-stem} -->` |
11
+ | `artifactChunk` | `<!-- sync-issue:{task-id}:{artifact-stem}:{part}/{total} -->` |
12
+ | `summary` | `<!-- sync-issue:{task-id}:summary -->` |
13
+ | `cancel` | `<!-- sync-issue:{task-id}:cancel -->` |
14
+
15
+ Callers should refer to the marker key in skill prose and keep concrete marker strings in this rule or the platform adapter defaults.
16
+
3
17
  Read this file before a task skill updates a GitHub Issue.
4
18
 
5
19
  ## Upstream Repository Detection
@@ -1,5 +1,19 @@
1
1
  # Issue 同步规则
2
2
 
3
+ ## Marker 注册表
4
+
5
+ 以下隐藏标记是 Issue 同步的唯一权威注册表:
6
+
7
+ | Key | Marker |
8
+ |---|---|
9
+ | `task` | `<!-- sync-issue:{task-id}:task -->` |
10
+ | `artifact` | `<!-- sync-issue:{task-id}:{artifact-stem} -->` |
11
+ | `artifactChunk` | `<!-- sync-issue:{task-id}:{artifact-stem}:{part}/{total} -->` |
12
+ | `summary` | `<!-- sync-issue:{task-id}:summary -->` |
13
+ | `cancel` | `<!-- sync-issue:{task-id}:cancel -->` |
14
+
15
+ Skill 正文应引用 marker key,具体 marker 字符串只保留在本规则或平台适配器默认值中。
16
+
3
17
  在任务技能需要更新 GitHub Issue 时先读取本文件。
4
18
 
5
19
  ## Upstream 仓库检测
@@ -0,0 +1,19 @@
1
+ # Issue 同步
2
+
3
+ ## Marker 注册表
4
+
5
+ 以下隐藏标记是 Issue 同步的唯一权威注册表:
6
+
7
+ | Key | Marker |
8
+ |---|---|
9
+ | `task` | `<!-- sync-issue:{task-id}:task -->` |
10
+ | `artifact` | `<!-- sync-issue:{task-id}:{artifact-stem} -->` |
11
+ | `artifactChunk` | `<!-- sync-issue:{task-id}:{artifact-stem}:{part}/{total} -->` |
12
+ | `summary` | `<!-- sync-issue:{task-id}:summary -->` |
13
+ | `cancel` | `<!-- sync-issue:{task-id}:cancel -->` |
14
+
15
+ Skill 正文应引用 marker key,具体 marker 字符串只保留在本规则或平台适配器默认值中。
16
+
17
+ 当前代码平台未内置 Issue 同步支持。
18
+
19
+ 自定义平台会跳过 Issue 元数据、标签、里程碑、负责人和评论同步,除非你提供匹配的 `.{platform}.zh-CN.md` 规则模板和平台适配器。请继续正常写入本地任务产物。
@@ -0,0 +1,5 @@
1
+ # Label and Milestone Setup
2
+
3
+ This code platform does not provide built-in label or milestone setup.
4
+
5
+ Initialization of remote labels and milestones is skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates and scripts. Local task workflow files remain usable without remote metadata setup.
@@ -43,6 +43,16 @@ Update a milestone:
43
43
  gh api "repos/$repo/milestones/{number}" -X PATCH -f state="{state}" -f description="{description}"
44
44
  ```
45
45
 
46
+ ## Error Prompt Templates
47
+
48
+ Use these normalized prompts when the GitHub setup scripts fail:
49
+
50
+ | Condition | Prompt |
51
+ |---|---|
52
+ | CLI missing | GitHub CLI (`gh`) is not installed |
53
+ | Authentication failed | `GitHub CLI is not authenticated` |
54
+ | API rate limit | `GitHub API rate limit reached, please retry later` |
55
+
46
56
  ## Constraints
47
57
 
48
58
  - use label names as the idempotency key
@@ -43,6 +43,16 @@ gh api "repos/$repo/milestones" -f title="{title}" -f description="{description}
43
43
  gh api "repos/$repo/milestones/{number}" -X PATCH -f state="{state}" -f description="{description}"
44
44
  ```
45
45
 
46
+ ## 错误提示模板
47
+
48
+ GitHub 初始化脚本失败时使用以下标准提示:
49
+
50
+ | 条件 | 提示 |
51
+ |---|---|
52
+ | CLI 缺失 | GitHub CLI (`gh`) is not installed |
53
+ | 认证失败 | `GitHub CLI is not authenticated` |
54
+ | API 限流 | `GitHub API rate limit reached, please retry later` |
55
+
46
56
  ## 约束
47
57
 
48
58
  - label 以名称作为幂等键
@@ -0,0 +1,5 @@
1
+ # Label 和 Milestone 初始化
2
+
3
+ 当前代码平台未内置标签或里程碑初始化支持。
4
+
5
+ 自定义平台会跳过远端标签和里程碑初始化,除非你提供匹配的 `.{platform}.zh-CN.md` 规则模板和脚本。即使没有远端元数据初始化,本地任务工作流文件仍可使用。
@@ -0,0 +1,5 @@
1
+ # Milestone Inference
2
+
3
+ This code platform does not provide built-in milestone inference.
4
+
5
+ Milestone narrowing and reuse are skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates. Do not block task progress when no platform-specific milestone implementation is available.
@@ -0,0 +1,5 @@
1
+ # Milestone 推断
2
+
3
+ 当前代码平台未内置里程碑推断支持。
4
+
5
+ 自定义平台会跳过里程碑收窄和复用逻辑,除非你提供匹配的 `.{platform}.zh-CN.md` 规则模板。没有平台专属里程碑实现时,不要阻塞任务推进。
@@ -0,0 +1,5 @@
1
+ # PR Sync
2
+
3
+ This code platform does not provide built-in pull request synchronization.
4
+
5
+ PR creation, metadata updates, labels, milestones, assignees, and summary comments are skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates and adapters. Keep local task artifacts up to date.
@@ -0,0 +1,5 @@
1
+ # PR 同步
2
+
3
+ 当前代码平台未内置 Pull Request 同步支持。
4
+
5
+ 自定义平台会跳过 PR 创建、元数据更新、标签、里程碑、负责人和摘要评论同步,除非你提供匹配的 `.{platform}.zh-CN.md` 规则模板和适配器。请保持本地任务产物更新。
@@ -0,0 +1,5 @@
1
+ # Release Commands
2
+
3
+ This code platform does not provide built-in release commands.
4
+
5
+ Remote release automation is skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates and scripts. Continue using local release artifacts or your platform-specific release process.
@@ -21,6 +21,22 @@ When needed, read the linked Issue:
21
21
  gh issue view {issue-number} --json number,title,labels,url
22
22
  ```
23
23
 
24
+ ## Contributor Mapping Helpers
25
+
26
+ Merged PR queries used for release notes should include authors when contributors are needed:
27
+
28
+ ```bash
29
+ gh pr list --state merged --base "{branch}" --json number,title,mergedAt,labels,author
30
+ ```
31
+
32
+ Linked Issue queries used for reporter attribution should include the author:
33
+
34
+ ```bash
35
+ gh issue view {issue-number} --json number,title,labels,url,author
36
+ ```
37
+
38
+ Map GitHub no-reply emails with this rule: if `Name <email>` contains an email matching `(\d+\+)?(\S+?)@users\.noreply\.github\.com`, use the second capture group lowercased as the login. This covers both `{id}+{login}@users.noreply.github.com` and `{login}@users.noreply.github.com`.
39
+
24
40
  ## Create a Draft Release
25
41
 
26
42
  ```bash
@@ -21,6 +21,22 @@ gh pr list --state merged --base "{branch}" --json number,title,mergedAt,labels
21
21
  gh issue view {issue-number} --json number,title,labels,url
22
22
  ```
23
23
 
24
+ ## Contributor 映射辅助规则
25
+
26
+ release notes 需要 contributors 时,已合并 PR 查询应包含 author:
27
+
28
+ ```bash
29
+ gh pr list --state merged --base "{branch}" --json number,title,mergedAt,labels,author
30
+ ```
31
+
32
+ 关联 Issue 用于 reporter 归因时,查询应包含 author:
33
+
34
+ ```bash
35
+ gh issue view {issue-number} --json number,title,labels,url,author
36
+ ```
37
+
38
+ GitHub no-reply 邮箱映射规则:如果 `Name <email>` 中的 email 匹配 `(\d+\+)?(\S+?)@users\.noreply\.github\.com`,使用第二个捕获组的小写形式作为 login。该规则同时覆盖 `{id}+{login}@users.noreply.github.com` 和 `{login}@users.noreply.github.com`。
39
+
24
40
  ## 创建 Draft Release
25
41
 
26
42
  ```bash
@@ -0,0 +1,5 @@
1
+ # Release 命令
2
+
3
+ 当前代码平台未内置发布命令支持。
4
+
5
+ 自定义平台会跳过远端发布自动化,除非你提供匹配的 `.{platform}.zh-CN.md` 规则模板和脚本。请继续使用本地发布产物或你的平台专属发布流程。
@@ -0,0 +1,5 @@
1
+ # Security Alerts
2
+
3
+ This code platform does not provide built-in security alert integration.
4
+
5
+ Code scanning and dependency alert import or close actions are skipped for custom platforms unless you provide matching `.{platform}.en.md` rule templates and adapters. Track security work through local task artifacts or a platform-specific integration.
@@ -0,0 +1,5 @@
1
+ # 安全告警
2
+
3
+ 当前代码平台未内置安全告警集成。
4
+
5
+ 自定义平台会跳过代码扫描和依赖告警的导入或关闭操作,除非你提供匹配的 `.{platform}.zh-CN.md` 规则模板和适配器。请通过本地任务产物或平台专属集成跟踪安全工作。