@fitlab-ai/agent-infra 0.5.5 → 0.5.7

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 (110) hide show
  1. package/README.md +182 -1
  2. package/README.zh-CN.md +182 -1
  3. package/bin/cli.js +28 -4
  4. package/lib/defaults.json +1 -0
  5. package/lib/init.js +68 -4
  6. package/lib/prompt.js +28 -1
  7. package/lib/render.js +1 -1
  8. package/lib/sandbox/commands/create.js +7 -3
  9. package/lib/sandbox/commands/rm.js +6 -4
  10. package/lib/sandbox/commands/vm.js +43 -16
  11. package/lib/sandbox/config.js +5 -0
  12. package/lib/sandbox/engine.js +125 -16
  13. package/lib/sandbox/shell.js +47 -7
  14. package/lib/sandbox/task-resolver.js +13 -6
  15. package/lib/sandbox/tools.js +18 -14
  16. package/package.json +2 -2
  17. package/templates/.agents/QUICKSTART.en.md +17 -0
  18. package/templates/.agents/QUICKSTART.zh-CN.md +17 -0
  19. package/templates/.agents/README.en.md +121 -0
  20. package/templates/.agents/README.zh-CN.md +121 -0
  21. package/templates/.agents/rules/issue-pr-commands.en.md +5 -0
  22. package/templates/.agents/rules/issue-pr-commands.zh-CN.md +5 -0
  23. package/templates/.agents/rules/issue-sync.en.md +5 -0
  24. package/templates/.agents/rules/issue-sync.zh-CN.md +5 -0
  25. package/templates/.agents/rules/label-milestone-setup.en.md +5 -0
  26. package/templates/.agents/rules/label-milestone-setup.zh-CN.md +5 -0
  27. package/templates/.agents/rules/milestone-inference.en.md +5 -0
  28. package/templates/.agents/rules/milestone-inference.github.en.md +6 -5
  29. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +6 -5
  30. package/templates/.agents/rules/milestone-inference.zh-CN.md +5 -0
  31. package/templates/.agents/rules/pr-sync.en.md +5 -0
  32. package/templates/.agents/rules/pr-sync.zh-CN.md +5 -0
  33. package/templates/.agents/rules/release-commands.en.md +5 -0
  34. package/templates/.agents/rules/release-commands.zh-CN.md +5 -0
  35. package/templates/.agents/rules/security-alerts.en.md +5 -0
  36. package/templates/.agents/rules/security-alerts.zh-CN.md +5 -0
  37. package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +47 -12
  38. package/templates/.agents/scripts/platform-adapters/platform-sync.js +6 -0
  39. package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -3
  40. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
  41. package/templates/.agents/skills/block-task/SKILL.en.md +1 -1
  42. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +1 -1
  43. package/templates/.agents/skills/cancel-task/SKILL.en.md +1 -1
  44. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
  45. package/templates/.agents/skills/check-task/SKILL.en.md +1 -1
  46. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +1 -1
  47. package/templates/.agents/skills/close-codescan/SKILL.en.md +1 -1
  48. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +1 -1
  49. package/templates/.agents/skills/close-dependabot/SKILL.en.md +1 -1
  50. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -1
  51. package/templates/.agents/skills/commit/SKILL.en.md +1 -1
  52. package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
  53. package/templates/.agents/skills/create-issue/SKILL.en.md +2 -2
  54. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +2 -2
  55. package/templates/.agents/skills/create-pr/SKILL.en.md +1 -1
  56. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +1 -1
  57. package/templates/.agents/skills/create-release-note/SKILL.en.md +8 -1
  58. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +8 -1
  59. package/templates/.agents/skills/create-task/SKILL.en.md +2 -2
  60. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +2 -2
  61. package/templates/.agents/skills/implement-task/SKILL.en.md +3 -3
  62. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +3 -3
  63. package/templates/.agents/skills/import-codescan/SKILL.en.md +2 -2
  64. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +2 -2
  65. package/templates/.agents/skills/import-dependabot/SKILL.en.md +2 -2
  66. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +2 -2
  67. package/templates/.agents/skills/import-issue/SKILL.en.md +12 -4
  68. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +12 -4
  69. package/templates/.agents/skills/import-issue/config/verify.json +2 -1
  70. package/templates/.agents/skills/init-labels/SKILL.en.md +1 -1
  71. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +1 -1
  72. package/templates/.agents/skills/init-labels/scripts/init-labels.sh +6 -0
  73. package/templates/.agents/skills/init-milestones/SKILL.en.md +1 -1
  74. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +1 -1
  75. package/templates/.agents/skills/init-milestones/scripts/init-milestones.sh +6 -0
  76. package/templates/.agents/skills/plan-task/SKILL.en.md +3 -3
  77. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +3 -3
  78. package/templates/.agents/skills/post-release/SKILL.en.md +95 -0
  79. package/templates/.agents/skills/post-release/SKILL.zh-CN.md +95 -0
  80. package/templates/.agents/skills/refine-task/SKILL.en.md +2 -2
  81. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +2 -2
  82. package/templates/.agents/skills/refine-title/SKILL.en.md +1 -1
  83. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -1
  84. package/templates/.agents/skills/release/SKILL.en.md +6 -1
  85. package/templates/.agents/skills/release/SKILL.zh-CN.md +6 -1
  86. package/templates/.agents/skills/release/scripts/manage-milestones.sh +6 -0
  87. package/templates/.agents/skills/restore-task/SKILL.en.md +2 -2
  88. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +2 -2
  89. package/templates/.agents/skills/review-task/SKILL.en.md +3 -3
  90. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +3 -3
  91. package/templates/.agents/skills/test/SKILL.en.md +1 -1
  92. package/templates/.agents/skills/test/SKILL.zh-CN.md +1 -1
  93. package/templates/.agents/skills/test-integration/SKILL.en.md +1 -1
  94. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +1 -1
  95. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +10 -2
  96. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +4 -2
  97. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +598 -7
  98. package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +1 -1
  99. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +1 -1
  100. package/templates/.agents/templates/task.en.md +2 -2
  101. package/templates/.agents/templates/task.zh-CN.md +2 -2
  102. package/templates/.claude/commands/post-release.en.md +8 -0
  103. package/templates/.claude/commands/post-release.zh-CN.md +8 -0
  104. package/templates/.gemini/commands/_project_/post-release.en.toml +6 -0
  105. package/templates/.gemini/commands/_project_/post-release.zh-CN.toml +6 -0
  106. package/templates/.github/workflows/metadata-sync.yml +1 -1
  107. package/templates/.github/workflows/pr-label.yml +1 -1
  108. package/templates/.github/workflows/status-label.yml +1 -1
  109. package/templates/.opencode/commands/post-release.en.md +9 -0
  110. package/templates/.opencode/commands/post-release.zh-CN.md +9 -0
@@ -120,6 +120,127 @@ To adapt agent-infra to a private code-hosting platform:
120
120
  4. If you maintain a fork of the template source, add matching `.{platform}.` template variants before adding that platform identifier to the sync logic.
121
121
  5. Validate the customized workflow on a test task before rolling it out broadly.
122
122
 
123
+ ## External Template And Skill Sources
124
+
125
+ Teams can configure external template sources and shared skill sources in `.agents/.airc.json` for private platform templates, private rules, and shared custom skills:
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
+ Built-in templates take priority, and external templates are supplemental. Between multiple external template sources, later sources override earlier sources. The sync report lists ignored same-path files in `templateSources.conflicts`. External templates and skills may contain scripts executed by AI workflows, so only configure trusted local paths.
143
+
144
+ ## Custom Skills
145
+
146
+ Projects can add their own skills alongside the built-in task workflow.
147
+
148
+ ### Local project skills
149
+
150
+ Create a directory under `.agents/skills/<name>/` and add a `SKILL.md` file:
151
+
152
+ ```text
153
+ .agents/skills/
154
+ enforce-style/
155
+ SKILL.md
156
+ reference/
157
+ style-guide.md
158
+ ```
159
+
160
+ Recommended frontmatter:
161
+
162
+ ```yaml
163
+ ---
164
+ name: enforce-style
165
+ description: "Apply the team style guide before code review"
166
+ args: "<task-id>" # optional
167
+ ---
168
+ ```
169
+
170
+ After adding or updating a custom skill, run `update-agent-infra` again. The sync step detects non-built-in skills and generates matching commands for Claude Code, Gemini CLI, and OpenCode automatically.
171
+
172
+ ### Shared skill sources
173
+
174
+ To reuse centralized team skills, configure `.agents/.airc.json`:
175
+
176
+ ```json
177
+ {
178
+ "skills": {
179
+ "sources": [
180
+ { "type": "local", "path": "~/private-skills" }
181
+ ]
182
+ }
183
+ }
184
+ ```
185
+
186
+ Each source should mirror the `.agents/skills/` layout and include `SKILL.md` at the root of every skill directory.
187
+
188
+ ### Sync behavior
189
+
190
+ - Custom project skills in `.agents/skills/` are protected from managed-file cleanup
191
+ - Source entries are applied in order; later custom sources overwrite earlier custom sources
192
+ - Files deleted from an existing configured source are removed locally on the next sync for that sourced skill
193
+ - Built-in skills are not overridable by custom sources; if a source skill name conflicts with a built-in skill, the source copy is skipped
194
+ - Use `files.ejected` if the project must take ownership of a built-in skill or command
195
+
196
+ ## Custom TUI Configuration
197
+
198
+ Use the top-level `.agents/.airc.json` `customTUIs` array when your team uses an AI TUI that is not one of the built-in command targets. This config lets agent-infra show the correct next-step commands and generate command files for project custom skills by learning from an existing command in the custom TUI directory.
199
+
200
+ | Field | Required | Meaning |
201
+ |-------|----------|---------|
202
+ | `name` | Yes | Display name shown in reports and next-step guidance, for example `Acme TUI`. |
203
+ | `dir` | Yes | Command directory relative to the project root, for example `.acme/commands`. The path must stay inside the project root. |
204
+ | `invoke` | Yes | User-facing command template used in next-step guidance. |
205
+
206
+ Supported `invoke` placeholders:
207
+
208
+ | Placeholder | Replaced with | Example |
209
+ |-------------|---------------|---------|
210
+ | `${skillName}` | The skill command name, such as `review-task` or `commit`. | `acme ${skillName}` -> `acme review-task` |
211
+ | `${projectName}` | The `.airc.json` `project` value. Use this for namespaced commands. | `/${projectName}:${skillName}` -> `/agent-infra:review-task` |
212
+
213
+ Non-namespaced custom 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
+ Namespaced custom 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` should contain one entry per custom TUI. To let `update-agent-infra` generate command files for custom skills, keep at least one existing command file in `dir` that references a built-in skill path such as `.agents/skills/analyze-task/SKILL.md`; agent-infra uses that file as the format reference.
243
+
123
244
  ## Skill Authoring Conventions
124
245
 
125
246
  When writing or updating `.agents/skills/*/SKILL.md` files and their templates, keep step numbering consistent:
@@ -120,6 +120,127 @@
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
+
144
+ ## 自定义 Skills
145
+
146
+ 项目可以在内置任务工作流之外增加自己的 skill。
147
+
148
+ ### 项目内本地 skill
149
+
150
+ 在 `.agents/skills/<name>/` 下创建目录,并添加 `SKILL.md`:
151
+
152
+ ```text
153
+ .agents/skills/
154
+ enforce-style/
155
+ SKILL.md
156
+ reference/
157
+ style-guide.md
158
+ ```
159
+
160
+ 推荐 frontmatter:
161
+
162
+ ```yaml
163
+ ---
164
+ name: enforce-style
165
+ description: "在代码审查前应用团队风格规范"
166
+ args: "<task-id>" # 可选
167
+ ---
168
+ ```
169
+
170
+ 新增或修改自定义 skill 后,再执行一次 `update-agent-infra`。同步过程会自动检测非内置 skill,并为 Claude Code、Gemini CLI、OpenCode 生成对应命令。
171
+
172
+ ### 共享 skill 源
173
+
174
+ 如需复用团队集中维护的 skill,可在 `.agents/.airc.json` 中配置:
175
+
176
+ ```json
177
+ {
178
+ "skills": {
179
+ "sources": [
180
+ { "type": "local", "path": "~/private-skills" }
181
+ ]
182
+ }
183
+ }
184
+ ```
185
+
186
+ 每个 source 都应镜像 `.agents/skills/` 的目录结构,并在每个 skill 目录根部提供 `SKILL.md`。
187
+
188
+ ### 同步行为
189
+
190
+ - `.agents/skills/` 中手动创建的项目自定义 skill 不会被 managed 文件清理删除
191
+ - 多个 source 按声明顺序应用;后面的自定义 source 会覆盖前面的自定义 source 文件
192
+ - 对于仍存在于配置 source 中的 skill,如果源里删掉文件,下次同步时会删除本地对应残留文件
193
+ - 自定义 source 不能覆盖内置 skill;如果与内置 skill 同名,会跳过该 source skill
194
+ - 如果项目必须接管某个内置 skill 或命令,请使用 `files.ejected`
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
+
123
244
  ## Skill 编写规范
124
245
 
125
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.
@@ -0,0 +1,5 @@
1
+ # Issue 和 PR 命令
2
+
3
+ 当前代码平台未内置 Issue 或 Pull Request 命令支持。
4
+
5
+ 自定义平台会跳过平台专属自动化,除非你提供匹配的 `.{platform}.zh-CN.md` 规则模板。请以本地任务产物作为事实来源,或先安装平台专属模板包再运行工作流。
@@ -0,0 +1,5 @@
1
+ # Issue Sync
2
+
3
+ This code platform does not provide built-in issue synchronization.
4
+
5
+ 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.
@@ -0,0 +1,5 @@
1
+ # Issue 同步
2
+
3
+ 当前代码平台未内置 Issue 同步支持。
4
+
5
+ 自定义平台会跳过 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.
@@ -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.
@@ -50,17 +50,18 @@ Goal: narrow the Issue milestone from a release line to a concrete version when
50
50
 
51
51
  Preconditions:
52
52
  - task.md contains a valid `issue_number`
53
- - the current Issue milestone matches the release-line format `X.Y.x`
53
+ - the current Issue milestone matches the release-line format `X.Y.x` or is `General Backlog`
54
54
 
55
55
  Sequence:
56
56
  1. Query the current Issue milestone
57
- 2. If it is not in `X.Y.x` format, treat it as already specific enough and keep it unchanged
58
- 3. If it is in `X.Y.x` format, narrow it according to branch mode:
57
+ 2. If it is `General Backlog`, re-infer the release line using Phase 1, then try to narrow it to a concrete version; if inference fails, keep `General Backlog` unchanged
58
+ 3. If it is not in `X.Y.x` format, treat it as already specific enough and keep it unchanged
59
+ 4. If it is in `X.Y.x` format, narrow it according to branch mode:
59
60
  - Trunk mode: query open concrete-version milestones on that release line (for example `0.4.4`) and choose the latest one
60
61
  - Multi-version branch mode:
61
62
  - If the task branch was created from `origin/X.Y.x`, choose the latest concrete version on that line
62
63
  - If the task branch was created from `main`, find the highest release line and choose the latest concrete version on that line
63
- 4. When a target concrete version is found, run:
64
+ 5. When a target concrete version is found, run:
64
65
 
65
66
  ```bash
66
67
  if [ "$has_triage" = "true" ]; then
@@ -68,7 +69,7 @@ if [ "$has_triage" = "true" ]; then
68
69
  fi
69
70
  ```
70
71
 
71
- 5. If `has_triage=false`, the target milestone does not exist, or the branch ancestry cannot be determined reliably, keep the original milestone unchanged
72
+ 6. If `has_triage=false`, the target milestone does not exist, or the branch ancestry cannot be determined reliably, keep the original milestone unchanged
72
73
 
73
74
  Suggested concrete-version query:
74
75
 
@@ -50,17 +50,18 @@ Milestone 设置属于 `has_triage` 权限范围;如果调用方检测到 `has
50
50
 
51
51
  前置条件:
52
52
  - `task.md` 存在有效 `issue_number`
53
- - 当前 Issue milestone 为版本线格式 `X.Y.x`
53
+ - 当前 Issue milestone 为版本线格式 `X.Y.x` 或 `General Backlog`
54
54
 
55
55
  执行顺序:
56
56
  1. 查询 Issue 当前 milestone
57
- 2. 如果 milestone 不是 `X.Y.x` 格式 -> 视为已足够具体,保持不变
58
- 3. 如果 milestone `X.Y.x` -> 按分支模式收窄:
57
+ 2. 如果 milestone `General Backlog` -> 按阶段 1 规则重新推断版本线,再尝试收窄到具体版本;如果推断失败则保持 `General Backlog` 不变
58
+ 3. 如果 milestone 不是 `X.Y.x` 格式 -> 视为已足够具体,保持不变
59
+ 4. 如果 milestone 是 `X.Y.x` -> 按分支模式收窄:
59
60
  - 主干模式:查询该版本线下 open 的具体版本 milestone(如 `0.4.4`),取最新版本
60
61
  - 多版本分支模式:
61
62
  - 当前任务分支来自 `origin/X.Y.x` release line -> 在该版本线下取最新具体版本
62
63
  - 当前任务分支来自 `main` -> 找最高版本线,再取该版本线下的最新具体版本
63
- 4. 找到目标具体版本后,执行:
64
+ 5. 找到目标具体版本后,执行:
64
65
 
65
66
  ```bash
66
67
  if [ "$has_triage" = "true" ]; then
@@ -68,7 +69,7 @@ if [ "$has_triage" = "true" ]; then
68
69
  fi
69
70
  ```
70
71
 
71
- 5. 如果 `has_triage=false`、目标 milestone 不存在,或无法可靠判断 -> 保持原 milestone 不变
72
+ 6. 如果 `has_triage=false`、目标 milestone 不存在,或无法可靠判断 -> 保持原 milestone 不变
72
73
 
73
74
  具体版本查询建议:
74
75
 
@@ -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.
@@ -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` 规则模板和适配器。请通过本地任务产物或平台专属集成跟踪安全工作。
@@ -935,22 +935,22 @@ function resolveUpstreamRepo(taskDir) {
935
935
  return ownerRepo;
936
936
  }
937
937
 
938
- const upstreamResult = ghText([
938
+ const repoResult = ghJson([
939
939
  "api",
940
- `repos/${ownerRepo.value}`,
941
- "--jq",
942
- "if .fork then .parent.full_name else .full_name end"
940
+ `repos/${ownerRepo.value}`
943
941
  ], taskDir);
944
942
 
945
- if (!upstreamResult.ok) {
946
- return upstreamResult;
943
+ if (!repoResult.ok) {
944
+ return repoResult;
947
945
  }
948
946
 
949
- if (isBlank(upstreamResult.value)) {
947
+ const repo = repoResult.value && typeof repoResult.value === "object" ? repoResult.value : {};
948
+ const upstreamRepo = repo.fork ? repo.parent?.full_name : repo.full_name;
949
+ if (isBlank(upstreamRepo)) {
950
950
  return { ok: false, message: "Unable to resolve upstream repository" };
951
951
  }
952
952
 
953
- return { ok: true, value: upstreamResult.value };
953
+ return { ok: true, value: upstreamRepo };
954
954
  }
955
955
 
956
956
  function resolveOwnerRepo(taskDir) {
@@ -1017,11 +1017,12 @@ function ghText(args, cwd) {
1017
1017
  }
1018
1018
 
1019
1019
  function ghCommand(args, cwd) {
1020
- const result = spawnSync("gh", args, {
1020
+ const command = resolveCommand("gh");
1021
+ const result = spawnSync(command, args, commandOptions(command, {
1021
1022
  cwd,
1022
1023
  encoding: "utf8",
1023
1024
  env: process.env
1024
- });
1025
+ }));
1025
1026
 
1026
1027
  if (result.status !== 0) {
1027
1028
  const stderr = `${result.stderr || ""}${result.stdout || ""}`.trim();
@@ -1037,11 +1038,12 @@ function ghPaginatedJson(args, cwd) {
1037
1038
  }
1038
1039
 
1039
1040
  function gitText(args, cwd) {
1040
- const result = spawnSync("git", args, {
1041
+ const command = resolveCommand("git");
1042
+ const result = spawnSync(command, args, commandOptions(command, {
1041
1043
  cwd,
1042
1044
  encoding: "utf8",
1043
1045
  env: process.env
1044
- });
1046
+ }));
1045
1047
 
1046
1048
  if (result.status !== 0) {
1047
1049
  const stderr = `${result.stderr || ""}${result.stdout || ""}`.trim();
@@ -1110,6 +1112,39 @@ function sleep(delayMs) {
1110
1112
  Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, delayMs);
1111
1113
  }
1112
1114
 
1115
+ function resolveCommand(cmd) {
1116
+ if (process.platform !== "win32" || path.extname(cmd)) {
1117
+ return cmd;
1118
+ }
1119
+
1120
+ const pathValue = process.env.Path || process.env.PATH || "";
1121
+ const extensions = (process.env.PATHEXT || ".COM;.EXE;.BAT;.CMD")
1122
+ .split(";")
1123
+ .filter(Boolean);
1124
+
1125
+ for (const dir of pathValue.split(path.delimiter).filter(Boolean)) {
1126
+ for (const extension of extensions) {
1127
+ const lowerCandidate = path.join(dir, `${cmd}${extension.toLowerCase()}`);
1128
+ if (fs.existsSync(lowerCandidate)) {
1129
+ return lowerCandidate;
1130
+ }
1131
+ const upperCandidate = path.join(dir, `${cmd}${extension.toUpperCase()}`);
1132
+ if (fs.existsSync(upperCandidate)) {
1133
+ return upperCandidate;
1134
+ }
1135
+ }
1136
+ }
1137
+
1138
+ return cmd;
1139
+ }
1140
+
1141
+ function commandOptions(cmd, options) {
1142
+ if (process.platform === "win32" && /\.(?:bat|cmd)$/i.test(cmd)) {
1143
+ return { ...options, shell: true };
1144
+ }
1145
+ return options;
1146
+ }
1147
+
1113
1148
  function interpolate(template, taskDir, artifactFile) {
1114
1149
  const artifactStem = artifactFile ? path.basename(artifactFile, path.extname(artifactFile)) : "";
1115
1150
  return template
@@ -0,0 +1,6 @@
1
+ export function check(_context, shared) {
2
+ return shared.passResult(
3
+ "platform-sync",
4
+ "Skipped: this code platform does not provide a built-in platform-sync adapter"
5
+ );
6
+ }
@@ -121,8 +121,8 @@ Update `.agents/workspace/active/{task-id}/task.md`:
121
121
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
122
122
  - Read `.agents/rules/issue-sync.md` before syncing, and complete upstream repository detection plus permission detection
123
123
  - Set `status: pending-design-work` by following issue-sync.md
124
- - Publish the `{analysis-artifact}` comment
125
124
  - Create or update the `<!-- sync-issue:{task-id}:task -->` comment (follow the task.md comment sync rule in issue-sync.md)
125
+ - Publish the `{analysis-artifact}` comment
126
126
 
127
127
  ### 7. Verification Gate
128
128
 
@@ -143,7 +143,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
143
143
 
144
144
  > Execute this step only after the verification gate passes.
145
145
 
146
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
146
+ > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name).
147
147
 
148
148
  Output format:
149
149
  ```
@@ -172,7 +172,7 @@ Next step - create technical plan:
172
172
  - [ ] Updated `assigned_to` in task.md
173
173
  - [ ] Appended an Activity Log entry to task.md
174
174
  - [ ] Marked requirement-analysis as complete in workflow progress
175
- - [ ] Informed the user of the next step (must include all TUI command formats; do not filter)
175
+ - [ ] Informed the user of the next step (must include all TUI command formats, including any custom TUIs; do not filter)
176
176
  - [ ] **Did not modify any business code**
177
177
 
178
178
  ## STOP
@@ -121,8 +121,8 @@ date "+%Y-%m-%d %H:%M:%S%:z"
121
121
  如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
122
122
  - 执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测
123
123
  - 按 issue-sync.md 设置 `status: pending-design-work`
124
- - 发布 `{analysis-artifact}` 评论
125
124
  - 创建或更新 `<!-- sync-issue:{task-id}:task -->` 评论(按 issue-sync.md 的 task.md 评论同步规则)
125
+ - 发布 `{analysis-artifact}` 评论
126
126
 
127
127
  ### 7. 完成校验
128
128
 
@@ -143,7 +143,7 @@ node .agents/scripts/validate-artifact.js gate analyze-task .agents/workspace/ac
143
143
 
144
144
  > 仅在校验通过后执行本步骤。
145
145
 
146
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
146
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
147
147
 
148
148
  输出格式:
149
149
  ```
@@ -172,7 +172,7 @@ node .agents/scripts/validate-artifact.js gate analyze-task .agents/workspace/ac
172
172
  - [ ] 更新了 task.md 中的 `assigned_to`
173
173
  - [ ] 追加了 Activity Log 条目到 task.md
174
174
  - [ ] 在工作流进度中标记了 requirement-analysis 为已完成
175
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
175
+ - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,含自定义 TUI,不要筛选)
176
176
  - [ ] **没有修改任何业务代码**
177
177
 
178
178
  ## 停止
@@ -93,7 +93,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
93
93
 
94
94
  > Execute this step only after the verification gate passes.
95
95
 
96
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
96
+ > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name).
97
97
 
98
98
  Output format:
99
99
  ```
@@ -93,7 +93,7 @@ node .agents/scripts/validate-artifact.js gate block-task .agents/workspace/bloc
93
93
 
94
94
  > 仅在校验通过后执行本步骤。
95
95
 
96
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
96
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
97
97
 
98
98
  输出格式:
99
99
  ```
@@ -106,7 +106,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
106
106
 
107
107
  > Execute this step only after the verification gate passes.
108
108
 
109
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
109
+ > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name).
110
110
 
111
111
  Output format:
112
112
  ```
@@ -106,7 +106,7 @@ node .agents/scripts/validate-artifact.js gate cancel-task .agents/workspace/com
106
106
 
107
107
  > 仅在校验通过后执行本步骤。
108
108
 
109
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
109
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
110
110
 
111
111
  输出格式:
112
112
  ```
@@ -128,7 +128,7 @@ node .agents/scripts/validate-artifact.js gate cancel-task .agents/workspace/com
128
128
  - [ ] 已将任务目录移动到 `.agents/workspace/completed/`
129
129
  - [ ] 已在存在 Issue 时完成 Issue 同步
130
130
  - [ ] 已运行 gate 校验并通过
131
- - [ ] 已向用户展示完整的下一步命令
131
+ - [ ] 已向用户展示完整的下一步命令(含自定义 TUI)
132
132
 
133
133
  ## 注意事项
134
134
 
@@ -100,7 +100,7 @@ Next step:
100
100
 
101
101
  ### 5. Recommend Next Action
102
102
 
103
- Recommend the appropriate next skill based on the current workflow state. You must show command formats for all TUI columns in the table below, not just the current AI agent.
103
+ Recommend the appropriate next skill based on the current workflow state. You must show command formats for all TUI columns in the table below, not just the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name).
104
104
 
105
105
  > **⚠️ CONDITION CHECK — you must choose the single matching row in the table below based on `status`, `current_step`, the latest artifacts, and the latest review result:**
106
106
  >