@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
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: post-release
3
+ description: "Run post-release follow-up tasks"
4
+ ---
5
+
6
+ # Post-release Tasks
7
+
8
+ Run the standard follow-up workflow after a release tag has been pushed.
9
+
10
+ ## Execution Flow
11
+
12
+ ### 1. Detect the Latest Released Version
13
+
14
+ ```bash
15
+ git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1
16
+ ```
17
+
18
+ - Detect the latest `vX.Y.Z` tag, then strip the `v` prefix when you need the version number in later steps
19
+ - If no tag is found, error: "No released version tag found. Please create and push a release tag first."
20
+
21
+ ### 2. Verify Clean Workspace
22
+
23
+ ```bash
24
+ git status --short
25
+ ```
26
+
27
+ - If there are uncommitted changes, error: "Workspace has uncommitted changes. Please commit or stash first."
28
+
29
+ ### 3. Prepare the Next Development Version
30
+
31
+ <!-- TODO: Replace this step with your project's version bump command -->
32
+
33
+ ```bash
34
+ # TODO: Replace with your project's post-release version bump command
35
+ # npm version prerelease --preid=alpha --no-git-tag-version
36
+ ```
37
+
38
+ - Update lockfiles or generated version metadata if your project needs them
39
+ - Keep all version references in sync after the bump
40
+
41
+ ### 4. Rebuild Generated Artifacts
42
+
43
+ <!-- TODO: Replace this step with your project's rebuild command -->
44
+
45
+ ```bash
46
+ # TODO: Replace with your project's artifact rebuild command
47
+ ```
48
+
49
+ - Rebuild any generated files, embedded assets, or inline templates affected by the new version
50
+ - If your project has no generated artifacts, remove this step in the project-specific copy
51
+
52
+ ### 5. Run Other Post-release Tasks (Optional)
53
+
54
+ <!-- TODO: Add project-specific follow-up tasks such as demo capture, docs publishing, or downstream notifications -->
55
+
56
+ - Examples: record a terminal demo, refresh a docs site, notify downstream teams, update release dashboards
57
+ - If there are no extra tasks, remove this step in the project-specific copy
58
+
59
+ ### 6. Create the Follow-up Commit
60
+
61
+ ```bash
62
+ git add -A
63
+ git commit -m "chore: prepare next dev iteration after v{released-version}"
64
+ ```
65
+
66
+ ### 7. Output Summary
67
+
68
+ > **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).
69
+
70
+ ```
71
+ Post-release tasks completed.
72
+
73
+ Summary:
74
+ - Released version: {released-version}
75
+ - Next development version: {new-version}
76
+ - Extra tasks completed: {summary}
77
+
78
+ Next step (manual):
79
+ - Push branch: git push origin {current-branch}
80
+ ```
81
+
82
+ ## Notes
83
+
84
+ 1. **No arguments**: Detect the released version from the latest tag instead of asking the user to repeat it
85
+ 2. **Clean workspace required**: Avoid mixing unrelated edits into the post-release commit
86
+ 3. **Project-specific customization**: Replace the TODO steps with the commands your project actually needs
87
+ 4. **Local-only workflow**: This skill prepares local changes and does not push automatically
88
+
89
+ ## Error Handling
90
+
91
+ - No release tag found: Prompt the user to finish the release first
92
+ - Dirty workspace: Prompt the user to commit or stash changes
93
+ - Version bump failed: Display the command error and stop
94
+ - Artifact rebuild failed: Display the build error and stop
95
+ - Git commit failed: Display the error and leave the workspace intact for manual recovery
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: post-release
3
+ description: "执行版本发布后的后处理工作"
4
+ ---
5
+
6
+ # 发布后处理
7
+
8
+ 在版本标签推送完成后,执行标准化的发布后收尾流程。
9
+
10
+ ## 执行流程
11
+
12
+ ### 1. 检测最新发布版本
13
+
14
+ ```bash
15
+ git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1
16
+ ```
17
+
18
+ - 检测最新 `vX.Y.Z` 标签,并在后续步骤中去除 `v` 前缀得到版本号
19
+ - 如果没有找到标签,报错:"No released version tag found. Please create and push a release tag first."
20
+
21
+ ### 2. 验证工作区干净
22
+
23
+ ```bash
24
+ git status --short
25
+ ```
26
+
27
+ - 如果存在未提交变更,报错:"Workspace has uncommitted changes. Please commit or stash first."
28
+
29
+ ### 3. 准备下一个开发版本
30
+
31
+ <!-- TODO: 将此步骤替换为你的项目版本 bump 命令 -->
32
+
33
+ ```bash
34
+ # TODO: 替换为你的项目发布后版本 bump 命令
35
+ # npm version prerelease --preid=alpha --no-git-tag-version
36
+ ```
37
+
38
+ - 如果项目需要,记得同步锁文件或其他版本元数据
39
+ - 版本 bump 后保持所有版本引用一致
40
+
41
+ ### 4. 重新生成构建产物
42
+
43
+ <!-- TODO: 将此步骤替换为你的项目产物重建命令 -->
44
+
45
+ ```bash
46
+ # TODO: 替换为你的项目产物重建命令
47
+ ```
48
+
49
+ - 重建所有受新版本号影响的生成文件、内嵌产物或内联模板
50
+ - 如果项目没有生成产物,请在项目特化版本中删除此步骤
51
+
52
+ ### 5. 执行其他发布后任务(可选)
53
+
54
+ <!-- TODO: 添加项目特定的发布后任务,例如录制演示、发布文档站或通知下游 -->
55
+
56
+ - 示例:录制终端演示、刷新文档站、通知下游团队、更新发布面板
57
+ - 如果没有额外任务,请在项目特化版本中删除此步骤
58
+
59
+ ### 6. 创建后处理提交
60
+
61
+ ```bash
62
+ git add -A
63
+ git commit -m "chore: prepare next dev iteration after v{released-version}"
64
+ ```
65
+
66
+ ### 7. 输出摘要
67
+
68
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
69
+
70
+ ```
71
+ 发布后处理已完成。
72
+
73
+ 结果摘要:
74
+ - 已发布版本:{released-version}
75
+ - 新开发版本:{new-version}
76
+ - 额外任务完成情况:{summary}
77
+
78
+ 下一步(手动执行):
79
+ - 推送分支:git push origin {current-branch}
80
+ ```
81
+
82
+ ## 注意事项
83
+
84
+ 1. **无参数设计**:从最新标签自动检测已发布版本,不要求用户重复输入
85
+ 2. **需要干净工作区**:避免把无关改动带入发布后提交
86
+ 3. **项目定制**:将带 TODO 的步骤替换为你的项目实际命令
87
+ 4. **仅本地执行**:本技能只准备本地变更,不自动推送
88
+
89
+ ## 错误处理
90
+
91
+ - 未找到发布标签:提示用户先完成发布
92
+ - 工作区不干净:提示先提交或暂存
93
+ - 版本 bump 失败:显示命令错误并停止
94
+ - 产物重建失败:显示构建错误并停止
95
+ - Git 提交失败:显示错误并保留当前工作区供人工处理
@@ -62,8 +62,8 @@ Update task.md:
62
62
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
63
63
  - Read `.agents/rules/issue-sync.md` before syncing, and complete upstream repository detection plus permission detection
64
64
  - Set `status: in-progress` by following issue-sync.md
65
- - Publish the `{refinement-artifact}` comment
66
65
  - Create or update the `<!-- sync-issue:{task-id}:task -->` comment (follow the task.md comment sync rule in issue-sync.md)
66
+ - Publish the `{refinement-artifact}` comment
67
67
 
68
68
  ### 7. Verification Gate
69
69
 
@@ -84,7 +84,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
84
84
 
85
85
  > Execute this step only after the verification gate passes.
86
86
 
87
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
87
+ > **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).
88
88
 
89
89
  After summarizing the fixes, present the next step:
90
90
 
@@ -62,8 +62,8 @@ date "+%Y-%m-%d %H:%M:%S%:z"
62
62
  如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
63
63
  - 执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测
64
64
  - 按 issue-sync.md 设置 `status: in-progress`
65
- - 发布 `{refinement-artifact}` 评论
66
65
  - 创建或更新 `<!-- sync-issue:{task-id}:task -->` 评论(按 issue-sync.md 的 task.md 评论同步规则)
66
+ - 发布 `{refinement-artifact}` 评论
67
67
 
68
68
  ### 7. 完成校验
69
69
 
@@ -84,7 +84,7 @@ node .agents/scripts/validate-artifact.js gate refine-task .agents/workspace/act
84
84
 
85
85
  > 仅在校验通过后执行本步骤。
86
86
 
87
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
87
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
88
88
 
89
89
  输出修复摘要后,展示下一步:
90
90
 
@@ -62,7 +62,7 @@ Title changes require write permission. Follow the permission-degradation rules
62
62
 
63
63
  ### 5. Inform User
64
64
 
65
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
65
+ > **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).
66
66
 
67
67
  If the skill updated an Issue title, explain that no extra sync command is required; continue with the workflow skill that matches the task's current stage.
68
68
 
@@ -62,7 +62,7 @@ Issue/PR #{id} 分析结果:
62
62
 
63
63
  ### 5. 告知用户
64
64
 
65
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
65
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
66
66
 
67
67
  如果修改了 Issue 标题,提示无需额外同步命令;后续按任务当前阶段继续执行对应工作流技能。
68
68
 
@@ -122,7 +122,7 @@ The script is responsible for:
122
122
 
123
123
  ### 9. Output Summary
124
124
 
125
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
125
+ > **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).
126
126
 
127
127
  ```
128
128
  Release v{version} prepared.
@@ -146,6 +146,11 @@ Next steps (manual):
146
146
  - Claude Code / OpenCode: /create-release-note {version}
147
147
  - Gemini CLI: /{{project}}:create-release-note {version}
148
148
  - Codex CLI: $create-release-note {version}
149
+
150
+ 4. (Optional) Run post-release follow-up tasks:
151
+ - Claude Code / OpenCode: /post-release
152
+ - Gemini CLI: /{{project}}:post-release
153
+ - Codex CLI: $post-release
149
154
  ```
150
155
 
151
156
  ### Rollback Instructions
@@ -122,7 +122,7 @@ bash .agents/skills/release/scripts/manage-milestones.sh "$MAJOR" "$MINOR" "$PAT
122
122
 
123
123
  ### 9. 输出摘要
124
124
 
125
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
125
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
126
126
 
127
127
  ```
128
128
  版本 v{version} 已准备好发布。
@@ -146,6 +146,11 @@ bash .agents/skills/release/scripts/manage-milestones.sh "$MAJOR" "$MINOR" "$PAT
146
146
  - Claude Code / OpenCode:/create-release-note {version}
147
147
  - Gemini CLI:/{{project}}:create-release-note {version}
148
148
  - Codex CLI:$create-release-note {version}
149
+
150
+ 4.(可选)执行发布后处理:
151
+ - Claude Code / OpenCode:/post-release
152
+ - Gemini CLI:/{{project}}:post-release
153
+ - Codex CLI:$post-release
149
154
  ```
150
155
 
151
156
  ### 回滚说明
@@ -0,0 +1,6 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+
5
+ echo "Release milestone management skipped: this code platform does not provide a built-in milestone adapter." >&2
6
+ exit 0
@@ -113,7 +113,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
113
113
 
114
114
  > Execute this step only after the verification gate passes.
115
115
 
116
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
116
+ > **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).
117
117
 
118
118
  Output format:
119
119
 
@@ -137,7 +137,7 @@ Next step - check task status:
137
137
  - [ ] Restored `task.md` and every available artifact file
138
138
  - [ ] Updated the restored task.md
139
139
  - [ ] Ran and passed the verification gate
140
- - [ ] Showed the next-step commands in every TUI format
140
+ - [ ] Showed the next-step commands in every TUI format, including any custom TUIs
141
141
 
142
142
  ## STOP
143
143
 
@@ -113,7 +113,7 @@ node .agents/scripts/validate-artifact.js gate restore-task .agents/workspace/ac
113
113
 
114
114
  > 仅在校验通过后执行本步骤。
115
115
 
116
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
116
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
117
117
 
118
118
  输出格式:
119
119
 
@@ -137,7 +137,7 @@ node .agents/scripts/validate-artifact.js gate restore-task .agents/workspace/ac
137
137
  - [ ] 已还原 `task.md` 和所有可用产物文件
138
138
  - [ ] 已更新恢复后的 task.md
139
139
  - [ ] 已运行并通过完成校验
140
- - [ ] 已向用户展示所有 TUI 格式的下一步命令
140
+ - [ ] 已向用户展示所有 TUI 格式的下一步命令(含自定义 TUI)
141
141
 
142
142
  ## 停止
143
143
 
@@ -56,8 +56,8 @@ Update task.md and append:
56
56
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
57
57
  - Read `.agents/rules/issue-sync.md` before syncing, and complete upstream repository detection plus permission detection
58
58
  - Set `status: in-progress` by following issue-sync.md
59
- - Publish the `{review-artifact}` comment
60
59
  - Create or update the `<!-- sync-issue:{task-id}:task -->` comment (follow the task.md comment sync rule in issue-sync.md)
60
+ - Publish the `{review-artifact}` comment
61
61
 
62
62
  ### 7. Verification Gate
63
63
 
@@ -86,7 +86,7 @@ Choose exactly one branch based on the findings:
86
86
 
87
87
  > The full four-branch output templates, selection rules, and prohibition clauses live in `reference/output-templates.md`. Read `reference/output-templates.md` before reporting the review result.
88
88
 
89
- Include all TUI command formats in the next-step output.
89
+ Include all TUI command formats in the next-step output. 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).
90
90
 
91
91
  ## Completion Checklist
92
92
 
@@ -94,7 +94,7 @@ Include all TUI command formats in the next-step output.
94
94
  - [ ] Created `{review-artifact}`
95
95
  - [ ] Updated task.md and appended the Activity Log entry
96
96
  - [ ] Chose exactly one verdict branch in the user output
97
- - [ ] Informed the user of the next step (must include all TUI command formats; do not filter)
97
+ - [ ] Informed the user of the next step (must include all TUI command formats, including any custom TUIs; do not filter)
98
98
 
99
99
  ## Notes
100
100
 
@@ -56,8 +56,8 @@ date "+%Y-%m-%d %H:%M:%S%:z"
56
56
  如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
57
57
  - 执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测
58
58
  - 按 issue-sync.md 设置 `status: in-progress`
59
- - 发布 `{review-artifact}` 评论
60
59
  - 创建或更新 `<!-- sync-issue:{task-id}:task -->` 评论(按 issue-sync.md 的 task.md 评论同步规则)
60
+ - 发布 `{review-artifact}` 评论
61
61
 
62
62
  ### 7. 完成校验
63
63
 
@@ -86,7 +86,7 @@ node .agents/scripts/validate-artifact.js gate review-task .agents/workspace/act
86
86
 
87
87
  > 完整的 4 分支输出模板、判断规则和禁止条款见 `reference/output-templates.md`。向用户汇报审查结论前先读取 `reference/output-templates.md`。
88
88
 
89
- 向用户展示下一步时,必须包含所有 TUI 命令格式。
89
+ 向用户展示下一步时,必须包含所有 TUI 命令格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
90
90
 
91
91
  ## 完成检查清单
92
92
 
@@ -94,7 +94,7 @@ node .agents/scripts/validate-artifact.js gate review-task .agents/workspace/act
94
94
  - [ ] 已创建 `{review-artifact}`
95
95
  - [ ] 已更新 task.md 并追加 Activity Log
96
96
  - [ ] 用户输出中只选择了一个审查结论分支
97
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
97
+ - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,含自定义 TUI,不要筛选)
98
98
 
99
99
  ## 注意事项
100
100
 
@@ -49,7 +49,7 @@ If tests fail:
49
49
 
50
50
  After tests pass, suggest committing the changes:
51
51
 
52
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
52
+ > **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).
53
53
 
54
54
  ```
55
55
  Next step - commit changes:
@@ -49,7 +49,7 @@ description: "执行项目完整测试流程"
49
49
 
50
50
  测试通过后,建议提交变更:
51
51
 
52
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
52
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
53
53
 
54
54
  ```
55
55
  下一步 - 提交代码:
@@ -50,7 +50,7 @@ If tests fail:
50
50
 
51
51
  After tests pass, suggest committing the changes:
52
52
 
53
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
53
+ > **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).
54
54
 
55
55
  ```
56
56
  Next step - commit changes:
@@ -50,7 +50,7 @@ description: "执行项目集成测试流程"
50
50
 
51
51
  测试通过后,建议提交变更:
52
52
 
53
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
53
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
54
54
 
55
55
  ```
56
56
  下一步 - 提交代码:
@@ -24,7 +24,11 @@ Execute the following command to handle all deterministic steps at once:
24
24
  node .agents/skills/update-agent-infra/scripts/sync-templates.js
25
25
  ```
26
26
 
27
- The script reads `.agents/.airc.json`, automatically locates the installed `@fitlab-ai/agent-infra/templates/` directory via npm, and performs:
27
+ The script reads `.agents/.airc.json` and automatically locates the installed
28
+ `@fitlab-ai/agent-infra/templates/` directory via npm. Before syncing, it merges
29
+ external template sources from `templates.sources`; built-in templates win over
30
+ same-path external files, and later external sources win over earlier external
31
+ sources. Conflicts are recorded in the report. The script then performs:
28
32
  - detect the template source version
29
33
  - File registry sync (`defaults.json` → `.agents/.airc.json`)
30
34
  - All managed files (language selection → exclude merged/ejected → placeholder rendering → overwrite)
@@ -37,6 +41,9 @@ The script outputs JSON to stdout. Parse and record the report.
37
41
  - `error`: error message (if non-empty, stop and report)
38
42
  - `templateVersion`: current template source version
39
43
  - `templateRoot`: absolute path to the template file root directory
44
+ - `templateSources.conflicts`: external template source conflicts; explicitly
45
+ list these in the report so users know which files were ignored because a
46
+ built-in template or later external source won
40
47
  - `managed.written` / `managed.created`: updated / newly created managed files
41
48
  - `merged.pending`: list of merged files for AI to process
42
49
  - Each item has `target` (project-relative path) and `template` (template-root-relative path)
@@ -124,6 +131,7 @@ warning to the end of the report:
124
131
  Based on the script report and merged results, output a complete update report including:
125
132
  - Template version change
126
133
  - File registry additions
134
+ - External template source conflicts, when `templateSources.conflicts` is non-empty
127
135
  - Managed file change details (updated, created, skipped merged files)
128
136
  - Merged file results (conflicts, remaining TODOs)
129
137
  - Ejected file processing
@@ -131,7 +139,7 @@ Based on the script report and merged results, output a complete update report i
131
139
 
132
140
  If there are changes to submit, add:
133
141
 
134
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
142
+ > **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).
135
143
 
136
144
  ```
137
145
  Next step - commit changes:
@@ -22,7 +22,7 @@ description: "更新项目 AI 协作配置"
22
22
  node .agents/skills/update-agent-infra/scripts/sync-templates.js
23
23
  ```
24
24
 
25
- 脚本读取 `.agents/.airc.json`,并通过 npm 自动定位已安装的 `@fitlab-ai/agent-infra/templates/` 目录,然后自动完成:
25
+ 脚本读取 `.agents/.airc.json`,并通过 npm 自动定位已安装的 `@fitlab-ai/agent-infra/templates/` 目录。同步前会合并 `templates.sources` 中配置的外部模板源;相同文件以内置模板为准,多个外部源之间后者覆盖前者,冲突会写入报告。然后自动完成:
26
26
  - 检测模板源版本
27
27
  - 同步文件注册表(`defaults.json` → `.agents/.airc.json`)
28
28
  - 处理所有 managed 文件(语言选择 → 排除 merged/ejected → 占位符渲染 → 覆盖写入)
@@ -35,6 +35,7 @@ node .agents/skills/update-agent-infra/scripts/sync-templates.js
35
35
  - `error`:错误信息(如非空则停止并报告)
36
36
  - `templateVersion`:模板源当前版本
37
37
  - `templateRoot`:模板文件根目录绝对路径
38
+ - `templateSources.conflicts`:外部模板源冲突列表;报告中必须显式展示,说明哪些文件因内置模板或后续外部源获胜而被忽略
38
39
  - `managed.written` / `managed.created`:已更新/新建的 managed 文件
39
40
  - `merged.pending`:需要 AI 处理的 merged 文件列表
40
41
  - 每项包含 `target`(项目中的目标路径)和 `template`(模板根目录下的相对路径)
@@ -114,6 +115,7 @@ node .agents/skills/update-agent-infra/scripts/sync-templates.js
114
115
  基于脚本报告和 merged 合并结果,输出完整的更新报告,包括:
115
116
  - 模板版本变更
116
117
  - 文件注册表新增条目
118
+ - 外部模板源冲突(如 `templateSources.conflicts` 非空,必须逐项列出)
117
119
  - managed 文件变更明细(已更新、新建、跳过的 merged 文件)
118
120
  - merged 文件合并结果(冲突、残余 TODO)
119
121
  - ejected 文件处理
@@ -121,7 +123,7 @@ node .agents/skills/update-agent-infra/scripts/sync-templates.js
121
123
 
122
124
  如有变更需要提交,追加:
123
125
 
124
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
126
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
125
127
 
126
128
  ```
127
129
  下一步 - 提交代码: