@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
@@ -1,20 +1,16 @@
1
1
  # PR 正文模板规则
2
2
 
3
- 在生成 PR 标题和正文之前先读取本文件。
3
+ 生成 PR 标题和正文前先读取本文件。
4
4
 
5
5
  ## 读取 PR 模板
6
6
 
7
- 读取仓库中的 `.github/PULL_REQUEST_TEMPLATE.md`。如果不存在,则使用标准格式。
7
+ PR 模板发现属于平台相关逻辑。先读取 `.agents/rules/issue-pr-commands.md`,并按当前配置平台提供的 PR 模板章节执行。如果没有可用模板,则使用标准格式。
8
8
 
9
9
  ## 参考最近合并的 PR
10
10
 
11
- ```bash
12
- gh pr list --limit 3 --state merged --json number,title,body
13
- ```
11
+ 使用 `.agents/rules/issue-pr-commands.md` 中的最近合并 PR 查询命令,作为风格和格式参考输入。
14
12
 
15
- 把最近合并的 PR 当作风格和排版参考。
16
-
17
- ## 分析当前分支变更
13
+ ## 分析当前分支改动
18
14
 
19
15
  ```bash
20
16
  git status
@@ -25,21 +21,15 @@ git diff <target-branch>...HEAD
25
21
 
26
22
  ## 同步 PR 元数据
27
23
 
28
- 执行前先读取 `.agents/rules/issue-pr-commands.md`。
29
-
30
- 同步关联 Issue 元数据前,先按该规则完成认证和代码托管平台检测;`gh pr list` / `gh pr create` 仍保持作用于当前仓库。
24
+ 执行本步骤前先读取 `.agents/rules/issue-pr-commands.md`。
31
25
 
32
- 在同步 label 之前,先确认标准 label 体系已经存在:
33
-
34
- ```bash
35
- gh label list --search "type:" --limit 1 --json name --jq 'length'
36
- ```
26
+ 同步关联 Issue 元数据前,先按该规则完成认证和代码托管平台检测。
37
27
 
38
- 如果结果是 `0`,先执行 `init-labels`,再重试元数据同步。
28
+ 同步 label 前,按 `.agents/rules/issue-pr-commands.md` 中的 label 列表命令验证标准 label 体系。如果结果显示没有标准 type label,先运行 `init-labels` 再重试元数据同步。
39
29
 
40
- Type label 映射:
30
+ 类型 label 映射:
41
31
 
42
- | task.md type | GitHub label |
32
+ | task.md type | label |
43
33
  |---|---|
44
34
  | `bug`, `bugfix` | `type: bug` |
45
35
  | `feature` | `type: feature` |
@@ -51,34 +41,34 @@ Type label 映射:
51
41
  | 其他值 | 跳过 |
52
42
 
53
43
  元数据同步顺序:
54
- 1. `.agents/rules/issue-pr-commands.md` 的 Issue 读取命令查询关联 Issue labels 和 milestone
55
- 2. 构建 `{label-args}`:包含映射后的 type label、非 `type:`/`status:` 的 Issue labels,以及 Issue 当前的 `in:` labelscommit 阶段已完成计算,此处不重新计算也不反向更新 Issue)
56
- 3. 构建 `{milestone-arg}`:按 `.agents/rules/milestone-inference.md` 的「阶段 3:`create-pr`」直接复用 Issue milestone
57
- 4. 按 `.agents/rules/issue-pr-commands.md` 的创建 PR 命令模板与权限降级规则,将 `{label-args}` 和 `{milestone-arg}` 原子化传入 `gh pr create`
58
- 5. 确保 PR 正文包含 `Closes #{issue-number}` 或等价的 closing keyword
44
+ 1. 通过 `.agents/rules/issue-pr-commands.md` 的 Issue 读取命令查询 Issue labels 和 milestone
45
+ 2. 从映射出的 type label、非 `type:` / 非 `status:` 的 Issue labels,以及当前 Issue `in:` labels 构建 `{label-args}`(commit 已经计算过,不在此重算,也不写回 Issue)
46
+ 3. `.agents/rules/milestone-inference.md` "阶段 3:`create-pr`" 复用 Issue milestone 构建 `{milestone-arg}`
47
+ 4. 按 `.agents/rules/issue-pr-commands.md` 的创建 PR 命令模板与权限降级规则,将 `{label-args}` 和 `{milestone-arg}` 原子化传入
48
+ 5. 确保 PR 正文包含 `Closes #{issue-number}` 或等价关闭关键字
59
49
 
60
- 如果上述规则判定应跳过直接元数据参数写入,则只保留 PR 正文中的关联信息与后续评论同步。
50
+ 如果规则要求跳过上述直接元数据参数,则只保留 PR 正文关联和后续评论同步。
61
51
 
62
52
  Milestone 规则:
63
- - 按 `.agents/rules/milestone-inference.md` 的「阶段 3:`create-pr`」处理
64
- - PR 直接复用 Issue milestone,不再独立推断
53
+ - 按 `.agents/rules/milestone-inference.md` "阶段 3:`create-pr`" 执行
54
+ - 直接复用关联 Issue milestone,不为 PR 重新推断
65
55
 
66
56
  ## 创建 PR
67
57
 
68
- - 当当前工作属于活动任务时,从 task.md 中提取 `issue_number`
69
- - 如果存在 `issue_number`,先完成前置步骤中的代码托管平台检测,再按 `.agents/rules/issue-pr-commands.md` Issue 读取命令查询对应 Issue
70
- - 在调用 PR 创建命令前,先检查当前分支是否已经存在 PR;如果已存在,直接告知用户 PR URL 和状态并结束,不要重复同步元数据或摘要
71
- - 使用 HEREDOC 传递 PR 正文
72
- - 如果模板中存在 `{$IssueNumber}`,替换它
73
- - PR 正文结尾必须带上 `Generated with AI assistance`
58
+ - 当前工作属于 active task 时,从 task.md 提取 `issue_number`
59
+ - 如果存在 `issue_number`,先完成代码托管平台检测,再通过 `.agents/rules/issue-pr-commands.md` 查询 Issue
60
+ - 调用 PR 创建命令前,先检查当前分支是否已有 PR;若已有,报告 PR URL 和状态后停止,不重复执行元数据同步或 summary 发布
61
+ - 使用 HEREDOC 传入 PR 正文
62
+ - 模板中存在 `{$IssueNumber}` 时进行替换
63
+ - PR 正文以 `Generated with AI assistance` 结尾
74
64
 
75
- 创建 PR 时,使用 `.agents/rules/issue-pr-commands.md` 中的 “创建 PR” 命令模板。
65
+ 使用 `.agents/rules/issue-pr-commands.md` 中的创建 PR 命令模板创建 PR
76
66
 
77
- 最终用户输出必须按顺序包含以下后续动作:
67
+ 最终用户输出应包含以下后续路径:
78
68
 
79
69
  ```text
80
- 下一步:
81
- - 工作流真正结束后完成任务:
70
+ Next steps:
71
+ - complete the task after the workflow truly finishes:
82
72
  - Claude Code / OpenCode: /complete-task {task-id}
83
73
  - Gemini CLI: /agent-infra:complete-task {task-id}
84
74
  - Codex CLI: $complete-task {task-id}
@@ -119,7 +119,7 @@ If no historical release notes exist, use the following default Markdown format:
119
119
 
120
120
  ## Contributors
121
121
 
122
- @contributor1, @contributor2, @contributor3
122
+ @contributor1, @contributor2, @contributor3, @reporter1 (reported #N)
123
123
  ```
124
124
 
125
125
  **Format rules**:
@@ -128,19 +128,26 @@ If no historical release notes exist, use the following default Markdown format:
128
128
  3. Description: Use PR title, remove `type(scope):` prefix, capitalize first letter
129
129
  4. **Contributor collection**:
130
130
  - **Data sources**:
131
- - PR authors from Step 4 `gh pr list --json author`
131
+ - PR authors returned by the merged-PR query rule in `.agents/rules/release-commands.md`
132
132
  - Commit co-authors from Step 4 `git log ... --format='%(trailers:key=Co-authored-by,valueonly,unfold)'`
133
+ - Issue reporters from linked Issues collected in Step 5 (author login returned by `.agents/rules/release-commands.md`)
133
134
  - **Contribution count**: `PR count + co-authored commit count` for the same identity, merged across both sources
134
135
  - **Name -> `@login` mapping**:
135
- - Raw `Co-authored-by` values are `Name <email>` and must be mapped to a GitHub `@login`
136
- - Prefer email extraction: if it matches `(\d+\+)?(\S+?)@users\.noreply\.github\.com`, use the second capture group lowercased; this regex covers both `{id}+{login}@users.noreply.github.com` and `{login}@users.noreply.github.com`
136
+ - Raw `Co-authored-by` values are `Name <email>` and must be mapped to a platform `@login`
137
+ - Prefer email extraction: if it matches the platform no-reply email rule in `.agents/rules/release-commands.md`, use that rule to derive the lowercased login
137
138
  - Otherwise use a Name heuristic: take the first token before a space and lowercase it, for example `Claude Opus 4.6 (1M context)` -> `@claude`, `Codex` -> `@codex`, `Gemini` -> `@gemini`
138
139
  - If the login already appears in the PR author list, merge counts into that login so `Claude` and `@claude` do not become separate entries
139
140
  - Merge all Name variants that map to the same login before counting and sorting; for example, `Claude` and `Claude Opus 4.6 (1M context)` should both collapse into `@claude`
140
141
  - Preserve bot identities as-is, for example `dependabot[bot]`
141
- - If the login still cannot be determined reliably, output `@{lowercased first Name token}` and append `<!-- TODO(reviewer): confirm GitHub login for {original Name <email>} -->` below the `Contributors` section
142
+ - If the login still cannot be determined reliably, output `@{lowercased first Name token}` and append `<!-- TODO(reviewer): confirm platform login for {original Name <email>} -->` below the `Contributors` section
142
143
  - **Sorting**: descending by contribution count, then lexicographically by login for ties
143
144
  - **Deduplication**: use the final mapped `@login` as the key
145
+ - **Issue reporter rules**:
146
+ - Extract `author.login` from each linked Issue collected in Step 5
147
+ - If the login already exists in the final mapped PR author or co-author list, skip it (code contribution already covers this user)
148
+ - Reporter-only contributors use the format `@login (reported #N)`; if the same reporter reported multiple Issues, use `@login (reported #N1, #N2)`
149
+ - Reporters are appended after code contributors in the Contributors section, separated by commas
150
+ - Sort reporters by reported Issue count descending, then lexicographically by login for ties
144
151
  5. Empty sections: Omit sections with no entries
145
152
 
146
153
  ### 8. Present and Confirm
@@ -149,7 +156,7 @@ Show the generated release notes to the user.
149
156
 
150
157
  Ask:
151
158
  1. Need any adjustments?
152
- 2. Create a GitHub Draft Release?
159
+ 2. Create a draft release?
153
160
 
154
161
  ### 9. Create Draft Release (If Confirmed)
155
162
 
@@ -163,7 +170,7 @@ Draft Release created.
163
170
  - Version: v{version}
164
171
  - Status: Draft
165
172
 
166
- Please review and publish on GitHub:
173
+ Please review and publish on the platform:
167
174
  1. Open the URL above
168
175
  2. Review the release notes
169
176
  3. Click "Publish release"
@@ -171,7 +178,7 @@ Please review and publish on GitHub:
171
178
 
172
179
  ## Notes
173
180
 
174
- 1. **Requires gh CLI**: Must have GitHub CLI installed and authenticated
181
+ 1. **Requires the platform CLI**: Must have the platform CLI installed and authenticated
175
182
  2. **Tags must exist**: Run the release skill first to create tags
176
183
  3. **Draft mode**: Creates a draft - won't auto-publish
177
184
  4. **Classification accuracy**: Auto-classification is based on title/scope/files; complex PRs may need manual adjustment
@@ -180,5 +187,5 @@ Please review and publish on GitHub:
180
187
 
181
188
  - Invalid version format: Prompt correct format
182
189
  - Tag not found: Suggest running the release skill first
183
- - gh not authenticated: Prompt to authenticate
190
+ - The platform CLI is not authenticated: Prompt to authenticate
184
191
  - No merged PRs found: Prompt to check tags and branch
@@ -119,7 +119,7 @@ git log v<prev-version>..v<version> \
119
119
 
120
120
  ## Contributors
121
121
 
122
- @contributor1, @contributor2, @contributor3
122
+ @contributor1, @contributor2, @contributor3, @reporter1 (reported #N)
123
123
  ```
124
124
 
125
125
  **格式规则**:
@@ -128,19 +128,26 @@ git log v<prev-version>..v<version> \
128
128
  3. 描述:使用 PR 标题,移除 `type(scope):` 前缀,首字母大写
129
129
  4. **贡献者搜集**:
130
130
  - **数据源**:
131
- - PR author:来自步骤 4 的 `gh pr list --json author`
131
+ - PR author:来自 `.agents/rules/release-commands.md` 中已合并 PR 查询规则
132
132
  - Commit co-authors:来自步骤 4 的 `git log ... --format='%(trailers:key=Co-authored-by,valueonly,unfold)'`
133
+ - Issue reporters:来自步骤 5 收集的关联 Issue author(由 `.agents/rules/release-commands.md` 返回)
133
134
  - **贡献数定义**:`该人的 PR 数 + 该人作为 co-author 的 commit 数`(同一身份跨来源合并计数)
134
135
  - **Name → `@login` 映射**:
135
- - `Co-authored-by` 原始格式为 `Name <email>`,需要推断对应的 GitHub `@login`
136
- - 优先从 email 提取:匹配 `(\d+\+)?(\S+?)@users\.noreply\.github\.com` 时,取第二个捕获组并转为小写;该正则同时覆盖 `{id}+{login}@users.noreply.github.com` `{login}@users.noreply.github.com`
136
+ - `Co-authored-by` 原始格式为 `Name <email>`,需要推断对应的 platform `@login`
137
+ - 优先从 email 提取:匹配 `.agents/rules/release-commands.md` 中的平台 no-reply 邮箱规则时,按该规则推导小写 login
137
138
  - 否则按 Name 启发式:取首个空格前的 token 并转为小写(例如 `Claude Opus 4.6 (1M context)` → `@claude`、`Codex` → `@codex`、`Gemini` → `@gemini`)
138
139
  - 已出现在 PR author 列表中的 login,必须按该 login 合并计数,避免把 `Claude` 和 `@claude` 拆成两个条目
139
140
  - 同一 login 的所有 Name 变体都必须归并后再计数与排序;例如 `Claude` 与 `Claude Opus 4.6 (1M context)` 都映射到 `@claude` 时,应先合并为同一个贡献者
140
141
  - Bot 身份保留原样(如 `dependabot[bot]`)
141
- - 若仍无法可靠确定 login,则输出 `@{Name 首 token 小写}`,并在 `Contributors` 段落下追加 `<!-- TODO(reviewer): 确认 {原始 Name <email>} 的 GitHub login -->`
142
+ - 若仍无法可靠确定 login,则输出 `@{Name 首 token 小写}`,并在 `Contributors` 段落下追加 `<!-- TODO(reviewer): 确认 {原始 Name <email>} 的 platform login -->`
142
143
  - **排序**:按贡献数降序;贡献数相同时按 login 字典序
143
144
  - **去重**:以最终映射后的 `@login` 为键
145
+ - **Issue reporter 规则**:
146
+ - 从步骤 5 收集到的每个关联 Issue 中提取 `author.login`
147
+ - 如果该 login 已存在于 PR author 或 co-author 的最终映射列表中,跳过(代码贡献已包含该用户)
148
+ - 仅报告贡献的用户以 `@login (reported #N)` 格式展示;同一 reporter 报告多个 Issue 时使用 `@login (reported #N1, #N2)`
149
+ - Reporter 在 Contributors 段落中排在代码贡献者之后,以逗号分隔追加
150
+ - Reporter 之间按报告的 Issue 数量降序排列,数量相同时按 login 字典序
144
151
  5. 空部分:省略没有条目的部分
145
152
 
146
153
  ### 8. 展示并确认
@@ -149,7 +156,7 @@ git log v<prev-version>..v<version> \
149
156
 
150
157
  询问:
151
158
  1. 需要调整吗?
152
- 2. 是否创建 GitHub Draft Release
159
+ 2. 是否创建 draft release
153
160
 
154
161
  ### 9. 创建 Draft Release(如确认)
155
162
 
@@ -163,7 +170,7 @@ Draft Release created.
163
170
  - Version: v{version}
164
171
  - Status: Draft
165
172
 
166
- Please review and publish on GitHub:
173
+ Please review and publish on the platform:
167
174
  1. Open the URL above
168
175
  2. Review the release notes
169
176
  3. Click "Publish release"
@@ -171,7 +178,7 @@ Please review and publish on GitHub:
171
178
 
172
179
  ## 注意事项
173
180
 
174
- 1. **需要 gh CLI**:必须安装并认证 GitHub CLI
181
+ 1. **需要 the platform CLI**:必须安装并认证 the platform CLI
175
182
  2. **标签必须存在**:先执行 release 技能创建标签
176
183
  3. **草稿模式**:创建草稿 —— 不会自动发布
177
184
  4. **分类准确性**:自动分类基于标题/scope/文件;复杂的 PR 可能需要手动调整
@@ -180,5 +187,5 @@ Please review and publish on GitHub:
180
187
 
181
188
  - 版本格式无效:提示正确格式
182
189
  - 标签未找到:建议先执行 release 技能
183
- - gh 未认证:提示进行认证
190
+ - 平台 CLI 未认证:提示用户认证
184
191
  - 未找到已合并的 PR:提示检查标签和分支
@@ -117,7 +117,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
117
117
 
118
118
  > Execute this step only after the verification gate passes.
119
119
 
120
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
120
+ > **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).
121
121
 
122
122
  Output format:
123
123
  ```
@@ -137,7 +137,7 @@ Next step - run requirements analysis:
137
137
  - Gemini CLI: /{{project}}:analyze-task {task-id}
138
138
  - Codex CLI: $analyze-task {task-id}
139
139
 
140
- Or create a GitHub Issue first:
140
+ Or create an Issue first:
141
141
  - Claude Code / OpenCode: /create-issue {task-id}
142
142
  - Gemini CLI: /{{project}}:create-issue {task-id}
143
143
  - Codex CLI: $create-issue {task-id}
@@ -150,7 +150,7 @@ Or create a GitHub Issue first:
150
150
  - [ ] Updated `updated_at` to the current time in task.md
151
151
  - [ ] Updated `assigned_to` in task.md
152
152
  - [ ] Appended an Activity Log entry to task.md
153
- - [ ] Informed the user of the next step (must include all TUI command formats; do not filter)
153
+ - [ ] Informed the user of the next step (must include all TUI command formats, including any custom TUIs; do not filter)
154
154
  - [ ] **Did not modify any business code or configuration files** (only task.md)
155
155
 
156
156
  ## STOP
@@ -161,8 +161,8 @@ Wait for the user to run the `analyze-task` skill.
161
161
  ## Notes
162
162
 
163
163
  1. **Clarity**: if the user description is vague or missing key information, ask for clarification first
164
- 2. **Difference from `import-issue`**: `import-issue` imports from a GitHub Issue; `create-task` creates from a free-form description
165
- 3. **Workflow order**: after creating a task, typically run `analyze-task` before `plan-task`; if you need GitHub tracking first, you may run `create-issue` first
164
+ 2. **Difference from `import-issue`**: `import-issue` imports from an Issue; `create-task` creates from a free-form description
165
+ 3. **Workflow order**: after creating a task, typically run `analyze-task` before `plan-task`; if you need platform tracking first, you may run `create-issue` first
166
166
 
167
167
  ## Error Handling
168
168
 
@@ -117,7 +117,7 @@ node .agents/scripts/validate-artifact.js gate create-task .agents/workspace/act
117
117
 
118
118
  > 仅在校验通过后执行本步骤。
119
119
 
120
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
120
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
121
121
 
122
122
  输出格式:
123
123
  ```
@@ -137,7 +137,7 @@ node .agents/scripts/validate-artifact.js gate create-task .agents/workspace/act
137
137
  - Gemini CLI:/agent-infra:analyze-task {task-id}
138
138
  - Codex CLI:$analyze-task {task-id}
139
139
 
140
- 或先创建 GitHub Issue:
140
+ 或先创建 Issue:
141
141
  - Claude Code / OpenCode:/create-issue {task-id}
142
142
  - Gemini CLI:/agent-infra:create-issue {task-id}
143
143
  - Codex CLI:$create-issue {task-id}
@@ -150,7 +150,7 @@ node .agents/scripts/validate-artifact.js gate create-task .agents/workspace/act
150
150
  - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
151
151
  - [ ] 更新了 task.md 中的 `assigned_to`
152
152
  - [ ] 追加了 Activity Log 条目到 task.md
153
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
153
+ - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,含自定义 TUI,不要筛选)
154
154
  - [ ] **没有修改任何业务代码或配置文件**(仅 task.md)
155
155
 
156
156
  ## 停止
@@ -161,8 +161,8 @@ node .agents/scripts/validate-artifact.js gate create-task .agents/workspace/act
161
161
  ## 注意事项
162
162
 
163
163
  1. **清晰度**:如果用户描述模糊或缺少关键信息,先要求澄清
164
- 2. **与 import-issue 的区别**:`import-issue` 从 GitHub Issue 导入任务;`create-task` 从自由描述创建
165
- 3. **工作流顺序**:创建任务后,通常先执行 `analyze-task` 再进入 `plan-task`;如需先建立 GitHub 跟踪,也可先执行 `create-issue`
164
+ 2. **与 import-issue 的区别**:`import-issue` 从 Issue 导入任务;`create-task` 从自由描述创建
165
+ 3. **工作流顺序**:创建任务后,通常先执行 `analyze-task` 再进入 `plan-task`;如需先建立 平台跟踪,也可先执行 `create-issue`
166
166
 
167
167
  ## 错误处理
168
168
 
@@ -95,7 +95,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
95
95
 
96
96
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure; read `.agents/rules/issue-sync.md` first and complete upstream repository detection plus permission detection):
97
97
  - Set `status: in-progress` by following issue-sync.md
98
- - Create or update the `<!-- sync-issue:{task-id}:task -->` comment (follow the task.md comment sync rule in issue-sync.md)
98
+ - 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)
99
99
  - Publish the `{implementation-artifact}` comment
100
100
 
101
101
  ### 10. Verification Gate
@@ -117,7 +117,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
117
117
 
118
118
  > Execute this step only after the verification gate passes.
119
119
 
120
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. Use the output template in `reference/output-template.md`.
120
+ > **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). Use the output template in `reference/output-template.md`.
121
121
 
122
122
  ## Completion Checklist
123
123
 
@@ -125,7 +125,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
125
125
  - [ ] Created `{implementation-artifact}`
126
126
  - [ ] All required tests passed
127
127
  - [ ] Updated task.md and appended the Activity Log entry
128
- - [ ] Included every TUI command format in the user-facing next step
128
+ - [ ] Included every TUI command format, including any custom TUIs, in the user-facing next step
129
129
 
130
130
  ## STOP
131
131
 
@@ -95,7 +95,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
95
95
 
96
96
  如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续;执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测):
97
97
  - 按 issue-sync.md 设置 `status: in-progress`
98
- - 创建或更新 `<!-- sync-issue:{task-id}:task -->` 评论(按 issue-sync.md 的 task.md 评论同步规则)
98
+ - 创建或更新 `.agents/rules/issue-sync.md` 中定义的 task 评论标记(按 issue-sync.md 的 task.md 评论同步规则)
99
99
  - 发布 `{implementation-artifact}` 评论
100
100
 
101
101
  ### 10. 完成校验
@@ -117,7 +117,7 @@ node .agents/scripts/validate-artifact.js gate implement-task .agents/workspace/
117
117
 
118
118
  > 仅在校验通过后执行本步骤。
119
119
 
120
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。输出格式见 `reference/output-template.md`。
120
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。输出格式见 `reference/output-template.md`。
121
121
 
122
122
  ## 完成检查清单
123
123
 
@@ -125,7 +125,7 @@ node .agents/scripts/validate-artifact.js gate implement-task .agents/workspace/
125
125
  - [ ] 已创建 `{implementation-artifact}`
126
126
  - [ ] 所有必需测试通过
127
127
  - [ ] 已更新 task.md 并追加 Activity Log
128
- - [ ] 已向用户展示所有 TUI 格式的下一步命令
128
+ - [ ] 已向用户展示所有 TUI 格式的下一步命令(含自定义 TUI)
129
129
 
130
130
  ## 停止
131
131
 
@@ -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
  }
@@ -25,7 +25,7 @@ Extract key information:
25
25
  - `rule`: rule information (`id`, `severity`, `description`, `security_severity_level`)
26
26
  - `tool`: scanning tool information (`name`, `version`)
27
27
  - `most_recent_instance`: location (`path`, `start_line`, `end_line`) and message
28
- - `html_url`: GitHub alert link
28
+ - `html_url`: alert link in the platform
29
29
 
30
30
  ### 2. Create the Task Directory and File
31
31
 
@@ -75,7 +75,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
75
75
 
76
76
  > Execute this step only after the verification gate passes.
77
77
 
78
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
78
+ > **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).
79
79
 
80
80
  ```
81
81
  Code Scanning alert #{alert-number} imported.
@@ -101,7 +101,7 @@ Next step:
101
101
  - [ ] Updated `current_step` to requirement-analysis in task.md
102
102
  - [ ] Updated `updated_at` to the current time in task.md
103
103
  - [ ] Appended an Activity Log entry to task.md
104
- - [ ] Informed the user of the next step (must include all TUI command formats; do not filter)
104
+ - [ ] Informed the user of the next step (must include all TUI command formats, including any custom TUIs; do not filter)
105
105
 
106
106
  ## Error Handling
107
107
 
@@ -25,7 +25,7 @@ description: "导入 Code Scanning 告警并创建修复任务"
25
25
  - `rule`:规则信息(id、severity、description、security_severity_level)
26
26
  - `tool`:扫描工具信息(name、version)
27
27
  - `most_recent_instance`:位置(path、start_line、end_line)、消息
28
- - `html_url`:GitHub 告警链接
28
+ - `html_url`:平台告警链接
29
29
 
30
30
  ### 2. 创建任务目录和文件
31
31
 
@@ -75,7 +75,7 @@ node .agents/scripts/validate-artifact.js gate import-codescan .agents/workspace
75
75
 
76
76
  > 仅在校验通过后执行本步骤。
77
77
 
78
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
78
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
79
79
 
80
80
  ```
81
81
  Code Scanning 告警 #{alert-number} 已导入。
@@ -101,7 +101,7 @@ Code Scanning 告警 #{alert-number} 已导入。
101
101
  - [ ] 更新了 task.md 中的 `current_step` 为 requirement-analysis
102
102
  - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
103
103
  - [ ] 追加了 Activity Log 条目到 task.md
104
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
104
+ - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,含自定义 TUI,不要筛选)
105
105
 
106
106
  ## 错误处理
107
107
 
@@ -76,7 +76,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
76
76
 
77
77
  > Execute this step only after the verification gate passes.
78
78
 
79
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
79
+ > **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).
80
80
 
81
81
  ```
82
82
  Security alert #{alert-number} imported.
@@ -105,7 +105,7 @@ Next step:
105
105
  - [ ] Updated `current_step` to requirement-analysis in task.md
106
106
  - [ ] Updated `updated_at` to the current time in task.md
107
107
  - [ ] Appended an Activity Log entry to task.md
108
- - [ ] Informed the user of the next step (must include all TUI command formats; do not filter)
108
+ - [ ] Informed the user of the next step (must include all TUI command formats, including any custom TUIs; do not filter)
109
109
 
110
110
  ## Error Handling
111
111
 
@@ -76,7 +76,7 @@ node .agents/scripts/validate-artifact.js gate import-dependabot .agents/workspa
76
76
 
77
77
  > 仅在校验通过后执行本步骤。
78
78
 
79
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
79
+ > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
80
80
 
81
81
  ```
82
82
  安全告警 #{alert-number} 已导入。
@@ -105,7 +105,7 @@ node .agents/scripts/validate-artifact.js gate import-dependabot .agents/workspa
105
105
  - [ ] 更新了 task.md 中的 `current_step` 为 requirement-analysis
106
106
  - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
107
107
  - [ ] 追加了 Activity Log 条目到 task.md
108
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
108
+ - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,含自定义 TUI,不要筛选)
109
109
 
110
110
  ## 错误处理
111
111
 
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: import-issue
3
- description: "Import a GitHub Issue and create a task"
3
+ description: "Import an Issue and create a task"
4
4
  ---
5
5
 
6
6
  # Import Issue
7
7
 
8
- Import the specified GitHub Issue and create a task. Argument: issue number.
8
+ Import the specified Issue and create a task. Argument: issue number.
9
9
 
10
10
  ## Boundary / Critical Rules
11
11
 
@@ -24,22 +24,46 @@ Use the Issue title as-is for the task title (preserve the Issue's original lang
24
24
 
25
25
  ### 2. Check for an Existing Task
26
26
 
27
- Search `.agents/workspace/active/` for an existing task linked to this Issue.
27
+ 2.1 Search `.agents/workspace/active/` for an existing task linked to this Issue.
28
28
  - If found, ask the user whether to re-import or continue with the existing task
29
- - If not found, create a new task
29
+ - If not found, continue to 2.2
30
+
31
+ 2.2 Scan Issue comments for sync markers and look for a recoverable historical task ID:
32
+
33
+ If `$upstream_repo` was not set in step 1, omit `--repo`; the script will infer it using the issue-sync.md detection rule.
34
+
35
+ ```bash
36
+ node .agents/scripts/platform-adapters/find-existing-task.js --issue <issue-number> --repo "$upstream_repo" --format json
37
+ ```
38
+
39
+ - Script outputs `found=false`: create a new task through the normal import flow
40
+ - Script outputs `found=true`: reuse `task_id`
41
+ - Script exits 2: treat it as network, authentication, or platform API degradation; show the failure reason from script stderr to the user, then continue with the new-task import flow without blocking
30
42
 
31
43
  ### 3. Create the Task Directory and File
32
44
 
45
+ 3.1 Decide the task ID and `created_at`.
46
+
47
+ | Scenario | Trigger | task ID source | created_at source | User confirmation |
48
+ |---|---|---|---|---|
49
+ | Scenario A | 2.1 finds a local task | Reuse local ID | Preserve local value | Must ask whether to re-import or continue using the existing task |
50
+ | Scenario B | 2.1 no match + 2.2 no candidate | Create with `date +%Y%m%d-%H%M%S` | Current time | Not required |
51
+ | Scenario C | 2.1 no match + 2.2 any candidate | Automatically reuse the earliest candidate ID | Prefer remote frontmatter `created_at`; use current time if missing | Inform only |
52
+
33
53
  ```bash
34
54
  date +%Y%m%d-%H%M%S
35
55
  ```
36
56
 
37
- - Create the directory: `.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
57
+ 3.2 Write the task directory and `task.md`.
58
+
59
+ - Create the directory: `.agents/workspace/active/{task-id}/`
38
60
  - Use the `.agents/templates/task.md` template to create `task.md`
61
+ - For Scenario C, prefer `type`, `workflow`, `branch`, `created_by`, and `milestone` from the remote frontmatter; infer missing or damaged fields from Issue labels and current rules
62
+ - Always write `current_step` as `requirement-analysis`; do not restore the remote original `current_step`
39
63
 
40
64
  Task metadata:
41
65
  ```yaml
42
- id: TASK-{yyyyMMdd-HHmmss}
66
+ id: {task-id}
43
67
  issue_number: <issue-number>
44
68
  type: feature|bugfix|refactor|docs|chore
45
69
  branch: <project>-<type>-<slug>
@@ -52,6 +76,11 @@ current_step: requirement-analysis
52
76
  assigned_to: {current AI agent}
53
77
  ```
54
78
 
79
+ 3.3 Append Activity Log entries.
80
+
81
+ - Scenario B: append `Import Issue`
82
+ - Scenario C: append `Import Issue (Recovered)` and include the recovered task ID, any recoverable original `current_step`, original `assigned_to`, and that `current_step` was reset to `requirement-analysis`; if some frontmatter fields are missing or damaged, mention the fallback in the same entry
83
+
55
84
  ### 4. Update Task Status
56
85
 
57
86
  Get the current time:
@@ -69,6 +98,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
69
98
  ```
70
99
  - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Import Issue** by {agent} — Issue #{number} imported
71
100
  ```
101
+ If step 3.3 already appended recovery Activity Log entries, do not append a duplicate equivalent entry.
72
102
 
73
103
  ### 5. Assign the Issue Assignee
74
104
 
@@ -79,7 +109,7 @@ If task.md contains a valid `issue_number`, use the Issue update command from `.
79
109
  If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
80
110
  - Read `.agents/rules/issue-sync.md` before syncing, and complete upstream repository detection plus permission detection
81
111
  - Check the Issue's current milestone; if it is unset, read `.agents/rules/milestone-inference.md` and infer plus set the milestone using "Stage 1: `create-issue`". If `has_triage=false` or the inference is uncertain, skip and continue
82
- - Create or update the `<!-- sync-issue:{task-id}:task -->` comment (follow the task.md comment sync rule in issue-sync.md)
112
+ - After every scenario, task comment sync is mandatory: create or update the task comment marker defined in `.agents/rules/issue-sync.md` so the remote `:task` comment exists and matches the local `task.md` content (follow the task.md comment sync rule in issue-sync.md)
83
113
 
84
114
  ### 7. Verification Gate
85
115
 
@@ -100,7 +130,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
100
130
 
101
131
  > Execute this step only after the verification gate passes.
102
132
 
103
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
133
+ > **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).
104
134
 
105
135
  ```
106
136
  Issue #{number} imported.
@@ -126,8 +156,8 @@ Next step - run requirements analysis:
126
156
  - [ ] Updated `current_step` to requirement-analysis
127
157
  - [ ] Updated `updated_at` to the current time
128
158
  - [ ] Appended an Activity Log entry to task.md
129
- - [ ] Synced the task comment to the Issue
130
- - [ ] Informed the user of the next step (must include all TUI command formats; do not filter)
159
+ - [ ] Synced the task comment to the Issue, with remote content matching local task.md
160
+ - [ ] Informed the user of the next step (must include all TUI command formats, including any custom TUIs; do not filter)
131
161
  - [ ] **Did not modify any business code**
132
162
 
133
163
  ## STOP
@@ -143,5 +173,5 @@ After completing the checklist, **stop immediately**. Do not continue to later s
143
173
  ## Error Handling
144
174
 
145
175
  - Issue not found: output "Issue #{number} not found, please check the issue number"
146
- - Network error: output "Cannot connect to GitHub, please check network"
176
+ - Network error: output "Cannot connect to the platform, please check network"
147
177
  - Permission error: output "No access to this repository"