@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
@@ -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
@@ -9,7 +9,7 @@ Restore local task workspace files from platform Issue comments that contain syn
9
9
 
10
10
  ## Boundary / Critical Rules
11
11
 
12
- - Restore files only from comments marked with `<!-- sync-issue:{task-id}:... -->`
12
+ - Restore files only from comments that match the marker registry in `.agents/rules/issue-sync.md`
13
13
  - Restore into `.agents/workspace/active/{task-id}/` by default
14
14
  - Stop immediately if the target directory already exists and ask the user to resolve the conflict first
15
15
  - After executing this skill, you **must** immediately update the restored `task.md`
@@ -31,16 +31,11 @@ Read all Issue comments by following the "Read Issue comments" command in `.agen
31
31
 
32
32
  ### 3. Determine the task-id and Files to Restore
33
33
 
34
- Filter comments by these hidden markers:
35
-
36
- ```html
37
- <!-- sync-issue:{task-id}:{file-stem} -->
38
- <!-- sync-issue:{task-id}:{file-stem}:{part}/{total} -->
39
- ```
34
+ Filter comments by the task, artifact, and chunked artifact markers defined in `.agents/rules/issue-sync.md`.
40
35
 
41
36
  Rules:
42
37
  - when `{task-id}` was provided, match only that task
43
- - when `{task-id}` was omitted, infer it from the `<!-- sync-issue:{task-id}:task -->` comment first
38
+ - when `{task-id}` was omitted, infer it from the task comment marker first
44
39
  - if you cannot determine a unique task-id, stop and tell the user
45
40
  - ignore `summary` marker comments because they are complete-task aggregate output rather than restorable local task files
46
41
  - map `{file-stem}` back to filenames:
@@ -58,7 +53,7 @@ Read `.agents/rules/issue-sync.md` before executing this step.
58
53
  For each file:
59
54
  - collect its single comment or chunked comments
60
55
  - for `task.md` comments, reverse the `<details>` frontmatter wrapper described in issue-sync.md before reassembling the file body
61
- - when `{part}/{total}` exists, sort by part and verify the set is complete
56
+ - when a chunk marker includes part and total indexes, sort by part and verify the set is complete
62
57
  - extract the file body by removing the hidden marker, heading, and footer
63
58
  - concatenate chunk bodies into the final file content
64
59
 
@@ -88,66 +83,20 @@ Update the restored `task.md`:
88
83
  - `status`: `active`
89
84
  - `assigned_to`: {current AI agent}
90
85
  - `updated_at`: {current time}
91
- - keep the original `current_step`
92
- - append this entry to `## Activity Log`:
93
- ```
94
- - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Restore Task** by {agent} — Restored task from Issue #{issue-number}
95
- ```
96
-
97
- ### 7. Verification Gate
98
-
99
- Run the verification gate:
100
-
101
- ```bash
102
- node .agents/scripts/validate-artifact.js gate restore-task .agents/workspace/active/{task-id} --format text
103
- ```
104
-
105
- Handle the result as follows:
106
- - exit code 0 (all checks passed) -> continue to the "Inform User" step
107
- - exit code 1 (validation failed) -> fix the reported issues and run the gate again
108
- - exit code 2 (network blocked) -> stop and tell the user that human intervention is required
109
86
 
110
- Keep the gate output in your reply as fresh evidence. Do not claim completion without output from this run.
87
+ Append an Activity Log entry indicating the task was restored from the platform Issue.
111
88
 
112
- ### 8. Inform User
89
+ ### 7. Inform User
113
90
 
114
- > Execute this step only after the verification gate passes.
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.
117
-
118
- Output format:
119
-
120
- ```text
121
- Task {task-id} was restored from Issue #{issue-number}.
122
-
123
- Summary:
124
- - Restored files: {count}
125
- - Task directory: .agents/workspace/active/{task-id}/
126
- - Current step: {current_step}
127
-
128
- Next step - check task status:
129
- - Claude Code / OpenCode: /check-task {task-id}
130
- - Gemini CLI: /{{project}}:check-task {task-id}
131
- - Codex CLI: $check-task {task-id}
132
- ```
91
+ Report the restored task id, restored file count, and the active task directory.
133
92
 
134
93
  ## Completion Checklist
135
94
 
136
- - [ ] Fetched and parsed Issue comments
137
- - [ ] Restored `task.md` and every available artifact file
138
- - [ ] Updated the restored task.md
139
- - [ ] Ran and passed the verification gate
140
- - [ ] Showed the next-step commands in every TUI format
141
-
142
- ## STOP
143
-
144
- Stop after completing the checklist. Do not continue the workflow automatically.
95
+ - [ ] Fetched Issue comments from the platform
96
+ - [ ] Restored task files locally
97
+ - [ ] Updated restored task metadata
98
+ - [ ] Reported the restored directory
145
99
 
146
- ## Error Handling
100
+ ### 8. Stop
147
101
 
148
- - Issue missing or inaccessible
149
- - Platform CLI unavailable or unauthenticated
150
- - No sync-marked comments found
151
- - Unable to determine a unique `task-id`
152
- - Target directory already exists
153
- - Missing chunks or incomplete chunk ordering
102
+ Stop after the completion checklist. Do not commit automatically.
@@ -9,7 +9,7 @@ description: "从平台 Issue 评论还原本地任务文件"
9
9
 
10
10
  ## 行为边界 / 关键规则
11
11
 
12
- - 只从带 `<!-- sync-issue:{task-id}:... -->` 标记的评论恢复文件
12
+ - 只从匹配 `.agents/rules/issue-sync.md` 标记注册表的评论恢复文件
13
13
  - 默认恢复到 `.agents/workspace/active/{task-id}/`
14
14
  - 如果目标目录已存在,立即停止并提示用户先处理目录冲突
15
15
  - 执行本技能后,你**必须**立即更新恢复出的 `task.md`
@@ -31,16 +31,11 @@ description: "从平台 Issue 评论还原本地任务文件"
31
31
 
32
32
  ### 3. 确定 task-id 与待恢复文件
33
33
 
34
- 从评论中筛选隐藏标记:
35
-
36
- ```html
37
- <!-- sync-issue:{task-id}:{file-stem} -->
38
- <!-- sync-issue:{task-id}:{file-stem}:{part}/{total} -->
39
- ```
34
+ 按 `.agents/rules/issue-sync.md` 中定义的 task、artifact 和分片 artifact 标记筛选评论。
40
35
 
41
36
  处理规则:
42
37
  - 用户提供了 `{task-id}` 时,仅匹配该任务
43
- - 未提供时,优先从 `<!-- sync-issue:{task-id}:task -->` 评论推断
38
+ - 未提供时,优先从 task 评论标记推断
44
39
  - 若找不到唯一 task-id,立即停止并告知用户
45
40
  - 忽略 `summary` 标记评论;它是 complete-task 的聚合产物,不对应本地任务文件
46
41
  - 将 `{file-stem}` 映射回文件名:
@@ -58,7 +53,7 @@ description: "从平台 Issue 评论还原本地任务文件"
58
53
  对每个文件执行:
59
54
  - 收集单条评论或分片评论
60
55
  - 对 `task.md` 评论按 issue-sync.md 中的 `<details>` frontmatter 格式反向拆解,提取 frontmatter 后再与正文拼合
61
- - 如存在 `{part}/{total}`,按 part 升序排序并校验分片完整
56
+ - 如分片标记中存在 parttotal 序号,按 part 升序排序并校验分片完整
62
57
  - 从评论正文中提取文件内容,去掉隐藏标记、标题和页脚
63
58
  - 拼接得到最终文件内容
64
59
 
@@ -88,66 +83,20 @@ date "+%Y-%m-%d %H:%M:%S%:z"
88
83
  - `status`:`active`
89
84
  - `assigned_to`:{当前 AI 代理}
90
85
  - `updated_at`:{当前时间}
91
- - 保留原 `current_step`
92
- - 在 `## 活动日志` 追加:
93
- ```
94
- - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Restore Task** by {agent} — Restored task from Issue #{issue-number}
95
- ```
96
-
97
- ### 7. 完成校验
98
-
99
- 运行完成校验:
100
-
101
- ```bash
102
- node .agents/scripts/validate-artifact.js gate restore-task .agents/workspace/active/{task-id} --format text
103
- ```
104
-
105
- 处理结果:
106
- - 退出码 0(全部通过)-> 继续到「告知用户」步骤
107
- - 退出码 1(校验失败)-> 根据输出修复问题后重新运行校验
108
- - 退出码 2(网络中断)-> 停止执行并告知用户需要人工介入
109
86
 
110
- 将校验输出保留在回复中作为当次验证输出。没有当次校验输出,不得声明完成。
87
+ 追加 Activity Log,说明任务已从平台 Issue 还原。
111
88
 
112
- ### 8. 告知用户
89
+ ### 7. 告知用户
113
90
 
114
- > 仅在校验通过后执行本步骤。
115
-
116
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
117
-
118
- 输出格式:
119
-
120
- ```text
121
- 任务 {task-id} 已从 Issue #{issue-number} 还原。
122
-
123
- 摘要:
124
- - 恢复文件:{数量}
125
- - 任务目录:.agents/workspace/active/{task-id}/
126
- - 当前步骤:{current_step}
127
-
128
- 下一步 - 查看任务状态:
129
- - Claude Code / OpenCode:/check-task {task-id}
130
- - Gemini CLI:/{{project}}:check-task {task-id}
131
- - Codex CLI:$check-task {task-id}
132
- ```
91
+ 报告已恢复的 task id、恢复文件数量和 active task 目录。
133
92
 
134
93
  ## 完成检查清单
135
94
 
136
- - [ ] 已获取并解析 Issue 评论
137
- - [ ] 已还原 `task.md` 和所有可用产物文件
138
- - [ ] 已更新恢复后的 task.md
139
- - [ ] 已运行并通过完成校验
140
- - [ ] 已向用户展示所有 TUI 格式的下一步命令
141
-
142
- ## 停止
143
-
144
- 完成检查清单后立即停止。不要自动继续执行工作流。
95
+ - [ ] 已从平台获取 Issue 评论
96
+ - [ ] 已恢复本地任务文件
97
+ - [ ] 已更新恢复出的任务元数据
98
+ - [ ] 已报告恢复目录
145
99
 
146
- ## 错误处理
100
+ ### 8. 停止
147
101
 
148
- - Issue 不存在或无权访问
149
- - 平台 CLI 未认证
150
- - 找不到带 sync 标记的评论
151
- - 无法唯一确定 `task-id`
152
- - 目标目录已存在
153
- - 分片缺失或顺序不完整
102
+ 完成检查清单后立即停止。不要自动提交。
@@ -56,7 +56,7 @@ 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
- - Create or update the `<!-- sync-issue:{task-id}:task -->` comment (follow the task.md comment sync rule in issue-sync.md)
59
+ - Create or update the task comment marker defined in `.agents/rules/issue-sync.md` (follow the task.md comment sync rule in issue-sync.md)
60
60
  - Publish the `{review-artifact}` comment
61
61
 
62
62
  ### 7. Verification Gate
@@ -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,7 +56,7 @@ 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
- - 创建或更新 `<!-- sync-issue:{task-id}:task -->` 评论(按 issue-sync.md 的 task.md 评论同步规则)
59
+ - 创建或更新 `.agents/rules/issue-sync.md` 中定义的 task 评论标记(按 issue-sync.md 的 task.md 评论同步规则)
60
60
  - 发布 `{review-artifact}` 评论
61
61
 
62
62
  ### 7. 完成校验
@@ -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
 
@@ -36,7 +36,9 @@
36
36
  "verify_comment_content": true,
37
37
  "verify_task_comment_content": true,
38
38
  "verify_issue_type": true,
39
- "verify_milestone": true
39
+ "verify_milestone": true,
40
+ "expected_status_label_key": "inProgress",
41
+ "expected_comment_marker_key": "artifact"
40
42
  }
41
43
  }
42
44
  }
@@ -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,7 +41,12 @@ 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
48
+ - `managed.removed`: deleted managed files (including old paths removed during template migrations)
49
+ - `managed.skippedPlatform`: managed / merged entries skipped because they belong to a different platform
41
50
  - `merged.pending`: list of merged files for AI to process
42
51
  - Each item has `target` (project-relative path) and `template` (template-root-relative path)
43
52
  - `registryAdded`: newly added file registry entries
@@ -124,6 +133,7 @@ warning to the end of the report:
124
133
  Based on the script report and merged results, output a complete update report including:
125
134
  - Template version change
126
135
  - File registry additions
136
+ - External template source conflicts, when `templateSources.conflicts` is non-empty
127
137
  - Managed file change details (updated, created, skipped merged files)
128
138
  - Merged file results (conflicts, remaining TODOs)
129
139
  - Ejected file processing
@@ -131,7 +141,7 @@ Based on the script report and merged results, output a complete update report i
131
141
 
132
142
  If there are changes to submit, add:
133
143
 
134
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
144
+ > **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
145
 
136
146
  ```
137
147
  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,7 +35,10 @@ 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 文件
40
+ - `managed.removed`:被删除的 managed 文件(包括模板迁移时移除的旧路径)
41
+ - `managed.skippedPlatform`:因归属其他平台而被跳过的 managed / merged 条目
39
42
  - `merged.pending`:需要 AI 处理的 merged 文件列表
40
43
  - 每项包含 `target`(项目中的目标路径)和 `template`(模板根目录下的相对路径)
41
44
  - `registryAdded`:新增的文件注册条目
@@ -114,6 +117,7 @@ node .agents/skills/update-agent-infra/scripts/sync-templates.js
114
117
  基于脚本报告和 merged 合并结果,输出完整的更新报告,包括:
115
118
  - 模板版本变更
116
119
  - 文件注册表新增条目
120
+ - 外部模板源冲突(如 `templateSources.conflicts` 非空,必须逐项列出)
117
121
  - managed 文件变更明细(已更新、新建、跳过的 merged 文件)
118
122
  - merged 文件合并结果(冲突、残余 TODO)
119
123
  - ejected 文件处理
@@ -121,7 +125,7 @@ node .agents/skills/update-agent-infra/scripts/sync-templates.js
121
125
 
122
126
  如有变更需要提交,追加:
123
127
 
124
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
128
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
125
129
 
126
130
  ```
127
131
  下一步 - 提交代码: