@fitlab-ai/agent-infra 0.3.1 → 0.4.0

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 (93) hide show
  1. package/README.md +29 -39
  2. package/README.zh-CN.md +29 -39
  3. package/bin/cli.js +1 -1
  4. package/lib/defaults.json +3 -12
  5. package/lib/init.js +13 -24
  6. package/lib/paths.js +3 -42
  7. package/lib/update.js +98 -32
  8. package/lib/version.js +2 -1
  9. package/package.json +2 -1
  10. package/templates/.agents/QUICKSTART.md +7 -7
  11. package/templates/.agents/QUICKSTART.zh-CN.md +7 -7
  12. package/templates/.agents/README.md +16 -4
  13. package/templates/.agents/README.zh-CN.md +16 -4
  14. package/templates/.agents/skills/analyze-task/SKILL.md +106 -105
  15. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
  16. package/templates/.agents/skills/block-task/SKILL.md +8 -8
  17. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +8 -8
  18. package/templates/.agents/skills/check-task/SKILL.md +3 -3
  19. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +3 -3
  20. package/templates/.agents/skills/close-codescan/SKILL.md +64 -63
  21. package/templates/.agents/skills/close-dependabot/SKILL.md +71 -70
  22. package/templates/.agents/skills/commit/SKILL.md +1 -1
  23. package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
  24. package/templates/.agents/skills/complete-task/SKILL.md +7 -7
  25. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +7 -7
  26. package/templates/.agents/skills/create-issue/SKILL.md +57 -12
  27. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +57 -12
  28. package/templates/.agents/skills/create-pr/SKILL.md +44 -7
  29. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +44 -7
  30. package/templates/.agents/skills/create-release-note/SKILL.md +18 -11
  31. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +18 -11
  32. package/templates/.agents/skills/create-task/SKILL.md +80 -78
  33. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +11 -10
  34. package/templates/.agents/skills/implement-task/SKILL.md +15 -18
  35. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +15 -18
  36. package/templates/.agents/skills/import-codescan/SKILL.md +54 -53
  37. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  38. package/templates/.agents/skills/import-dependabot/SKILL.md +57 -56
  39. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -3
  40. package/templates/.agents/skills/import-issue/SKILL.md +58 -58
  41. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
  42. package/templates/.agents/skills/init-labels/SKILL.md +8 -0
  43. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +8 -0
  44. package/templates/.agents/skills/plan-task/SKILL.md +151 -149
  45. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +6 -6
  46. package/templates/.agents/skills/refine-task/SKILL.md +3 -3
  47. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +3 -3
  48. package/templates/.agents/skills/release/SKILL.md +55 -14
  49. package/templates/.agents/skills/release/SKILL.zh-CN.md +55 -14
  50. package/templates/.agents/skills/review-task/SKILL.md +9 -9
  51. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +9 -9
  52. package/templates/.agents/skills/sync-issue/SKILL.md +258 -279
  53. package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +34 -56
  54. package/templates/.agents/skills/sync-pr/SKILL.md +8 -28
  55. package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +7 -27
  56. package/templates/.agents/skills/update-agent-infra/SKILL.md +6 -6
  57. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +6 -6
  58. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +61 -116
  59. package/templates/.agents/templates/handoff.md +1 -1
  60. package/templates/.agents/templates/handoff.zh-CN.md +1 -1
  61. package/templates/.agents/workflows/bug-fix.yaml +71 -71
  62. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +1 -1
  63. package/templates/.agents/workflows/feature-development.yaml +71 -71
  64. package/templates/.agents/workflows/feature-development.zh-CN.yaml +1 -1
  65. package/templates/.agents/workflows/refactoring.yaml +76 -76
  66. package/templates/.agents/workflows/refactoring.zh-CN.yaml +1 -1
  67. package/templates/{.agent-workspace → .agents/workspace}/README.md +1 -1
  68. package/templates/{.agent-workspace → .agents/workspace}/README.zh-CN.md +1 -1
  69. package/templates/.claude/CLAUDE.md +14 -1
  70. package/templates/.claude/CLAUDE.zh-CN.md +14 -1
  71. package/templates/.claude/hooks/check-version-format.sh +44 -0
  72. package/templates/.claude/settings.json +14 -0
  73. package/templates/.opencode/COMMAND_STYLE_GUIDE.md +6 -6
  74. package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +6 -6
  75. package/templates/AGENTS.md +14 -1
  76. package/templates/AGENTS.zh-CN.md +14 -1
  77. package/templates/.editorconfig +0 -15
  78. package/templates/.github/ISSUE_TEMPLATE/01_bug_report.yml +0 -149
  79. package/templates/.github/ISSUE_TEMPLATE/02_question.yml +0 -101
  80. package/templates/.github/ISSUE_TEMPLATE/03_feature_request.yml +0 -131
  81. package/templates/.github/ISSUE_TEMPLATE/04_documentation.yml +0 -165
  82. package/templates/.github/ISSUE_TEMPLATE/05_other.yml +0 -147
  83. package/templates/.github/ISSUE_TEMPLATE/config.yml +0 -11
  84. package/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -123
  85. package/templates/.github/dependabot.yml +0 -17
  86. package/templates/.github/hooks/check-utf8-encoding.sh +0 -25
  87. package/templates/.github/release.yml +0 -27
  88. package/templates/.github/workflows/pr-title-check.yml +0 -42
  89. package/templates/.mailmap +0 -4
  90. package/templates/CONTRIBUTING.md +0 -126
  91. package/templates/CONTRIBUTING.zh-CN.md +0 -124
  92. package/templates/SECURITY.md +0 -131
  93. package/templates/SECURITY.zh-CN.md +0 -131
@@ -20,7 +20,7 @@ description: >
20
20
  ### 1. 验证前置条件
21
21
 
22
22
  检查必要文件:
23
- - `.agent-workspace/active/{task-id}/task.md` - 任务文件
23
+ - `.agents/workspace/active/{task-id}/task.md` - 任务文件
24
24
 
25
25
  检查 GitHub CLI 可用且已认证:
26
26
 
@@ -62,15 +62,18 @@ Issue 内容规则:
62
62
  rg --files .github/ISSUE_TEMPLATE -g '*.yml' -g '!config.yml'
63
63
  ```
64
64
 
65
- 如果存在模板文件,按任务类型优先在模板文件名或顶层 `name:` 字段中搜索以下关键词:
65
+ 如果存在模板文件,读取每个模板的顶层 `name:` 字段,构建候选列表。结合任务标题和描述,从候选列表中选择最匹配的模板。
66
66
 
67
- | task.md type | 匹配关键词 |
68
- |---|---|
69
- | `bug`、`bugfix` | `bug` |
70
- | `feature` | `feature` |
71
- | `enhancement` | `feature`、`enhancement` |
72
- | `docs`、`documentation` | `documentation`、`doc` |
73
- | 其他 | `other` |
67
+ 示例候选列表:
68
+ - `bug_report.yml` — Bug 类模板
69
+ - `question.yml` 问题咨询类模板
70
+ - `feature_request.yml` 功能请求类模板
71
+ - `documentation.yml` 文档问题类模板
72
+ - `other.yml` 通用兜底模板
73
+
74
+ 如果没有明确匹配的模板,选择最接近的一个。
75
+
76
+ 以上文件名仅为示例,应以目标项目实际存在的模板为准。
74
77
 
75
78
  如果没有模板、没有匹配到合适模板,或模板 YAML 解析失败,则直接进入 **3c fallback / 兜底路径**。
76
79
 
@@ -172,16 +175,55 @@ issue_number="${issue_url##*/}"
172
175
 
173
176
  如果已经确定了 `{issue-type}`,在创建后以 best-effort 方式设置 Issue Type:
174
177
 
178
+ 先获取仓库信息,后续 `in:` label 步骤也会复用:
179
+
175
180
  ```bash
176
181
  repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"
177
182
  owner="${repo%%/*}"
183
+ ```
184
+
185
+ 查询组织可用的 Issue Types:
186
+
187
+ ```bash
178
188
  gh api "orgs/$owner/issue-types" --jq '.[].name'
179
- gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}"
180
189
  ```
181
190
 
191
+ 如果查询成功且 `{issue-type}` 在返回列表中,执行设置:
192
+
193
+ ```bash
194
+ gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}" --silent
195
+ ```
196
+
197
+ 验证设置结果:
198
+
199
+ ```bash
200
+ gh api "repos/$repo/issues/{issue-number}" --jq '.type.name // empty'
201
+ ```
202
+
203
+ 如果验证返回的名称与 `{issue-type}` 一致,记录 `Issue Type: {issue-type}`;否则记录 `Issue Type: failed to set`。
204
+
205
+ #### 添加 `in:` labels
206
+
207
+ 获取仓库中所有 `in:` 前缀的 labels:
208
+
209
+ ```bash
210
+ gh label list --search "in:" --limit 50 --json name --jq '.[].name'
211
+ ```
212
+
213
+ 如果没有 `in:` labels,跳过此步骤。
214
+
215
+ 如果存在 `in:` labels,结合任务上下文(标题、描述、受影响文件列表)判断每个 `in:` label 是否与当前任务相关。对判断为相关的 label,执行:
216
+
217
+ ```bash
218
+ gh issue edit {issue-number} --add-label "in: {module}"
219
+ ```
220
+
221
+ 记录所有成功添加的 `in:` labels。如果没有判断为相关的 label,记录 `in: labels: skipped (no relevant labels)`。
222
+
182
223
  容错要求:
183
224
  - 如果 `orgs/$owner/issue-types` 返回 `404`、仓库 owner 不是组织,或仓库未启用 Issue Types,则跳过,不要让创建失败
184
225
  - 如果目标 `{issue-type}` 不在可用列表中,则跳过
226
+ - `in:` label 添加失败时,跳过并记录,不阻止 Issue 创建流程
185
227
  - Milestone 不存在或名称无效时,也应提示并跳过,而不是中断整个 Issue 创建流程
186
228
 
187
229
  ### 5. 更新任务状态
@@ -192,7 +234,7 @@ gh api "repos/$repo/issues/{issue-number}" -X PATCH -f type="{issue-type}"
192
234
  date "+%Y-%m-%d %H:%M:%S"
193
235
  ```
194
236
 
195
- 更新 `.agent-workspace/active/{task-id}/task.md`:
237
+ 更新 `.agents/workspace/active/{task-id}/task.md`:
196
238
  - 添加或更新 `issue_number`:`{issue-number}`
197
239
  - `updated_at`:{当前时间}
198
240
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
@@ -212,7 +254,8 @@ Issue 信息:
212
254
  - 编号:#{issue-number}
213
255
  - URL:{issue-url}
214
256
  - Labels:{applied-labels 或 skipped}
215
- - Issue Type:{issue-type 或 skipped}
257
+ - in: Labels:{applied-in-labels 或 skipped}
258
+ - Issue Type:{issue-type | failed to set | skipped}
216
259
  - Milestone:{milestone 或 skipped}
217
260
 
218
261
  产出:
@@ -231,6 +274,7 @@ Issue 信息:
231
274
  - [ ] 有模板时按模板结构生成正文;无模板时走 fallback / 兜底格式
232
275
  - [ ] Issue 标题和正文仅来自 task.md
233
276
  - [ ] 如可用,处理了 `type:` / Issue Type 和 `milestone`
277
+ - [ ] 处理了 `in:` labels(LLM 判断关联性)
234
278
  - [ ] 在 task.md 中记录了 `issue_number`
235
279
  - [ ] 更新了 task.md 中的 `updated_at`
236
280
  - [ ] 追加了 Activity Log 条目到 task.md
@@ -248,6 +292,7 @@ Issue 信息:
248
292
  3. **Label 容错**:标准 label 未初始化时,可以跳过 label,但不要阻止 Issue 创建
249
293
  4. **模板容错**:模板缺失、匹配失败或 YAML 异常时,退回 fallback / 兜底正文,不要让整个创建失败
250
294
  5. **Issue Type / Milestone 容错**:Issue Type 未启用、类型不存在或 milestone 不可用时,跳过该项并继续创建
295
+ 6. **in: Label 容错**:`in:` label 添加失败时跳过,不阻止 Issue 创建
251
296
 
252
297
  ## 错误处理
253
298
 
@@ -64,13 +64,22 @@ git push -u origin <current-branch>
64
64
 
65
65
  ### 7. Create PR
66
66
 
67
+ - If this work is associated with an active task, extract `issue_number` from task.md
68
+ - If `issue_number` exists, query Issue information on a best-effort basis and skip on failure:
69
+ ```bash
70
+ gh issue view {issue-number} --json number,title --jq '.number' 2>/dev/null
71
+ ```
67
72
  - Follow `.github/PULL_REQUEST_TEMPLATE.md` format for all sections
68
73
  - Reference recent merged PRs for style
69
74
  - Use HEREDOC format to pass the body
75
+ - If `issue_number` exists:
76
+ - replace `{$IssueNumber}` in the template with the actual Issue number
77
+ - use `Closes #{issue_number}` in the `Related Issue` section
78
+ - If `issue_number` does not exist, keep the current behavior
70
79
  - PR must end with: `Generated with AI assistance`
71
80
 
72
81
  ```bash
73
- gh pr create --base <target-branch> --title "<title>" --body "$(cat <<'EOF'
82
+ gh pr create --base <target-branch> --title "<title>" --assignee @me --body "$(cat <<'EOF'
74
83
  <Complete PR description following template>
75
84
 
76
85
  Generated with AI assistance
@@ -93,7 +102,21 @@ gh label list --search "type:" --limit 1 --json name --jq 'length'
93
102
  - returns `0` -> run the `init-labels` skill first, then retry this step
94
103
  - returns non-zero -> continue
95
104
 
96
- **b) Sync the type label**
105
+ **b) Query Issue metadata**
106
+
107
+ If task.md contains `issue_number`, query the Issue labels and milestone on a best-effort basis:
108
+
109
+ ```bash
110
+ gh issue view {issue-number} --json labels,milestone 2>/dev/null
111
+ ```
112
+
113
+ If the query fails (Issue not found, permission denied, etc.), skip Issue metadata inheritance and continue with only the static mappings from task.md.
114
+
115
+ Record the results for later substeps:
116
+ - `{issue-labels}`: list of labels currently on the Issue
117
+ - `{issue-milestone}`: title of the Issue milestone, if present
118
+
119
+ **c) Sync the type label**
97
120
 
98
121
  Map task.md `type` using this table:
99
122
 
@@ -114,7 +137,17 @@ If task.md `type` maps to a standard type label, run:
114
137
  gh pr edit {pr-number} --add-label "{type-label}"
115
138
  ```
116
139
 
117
- **c) Sync `in:` labels**
140
+ **d) Inherit Issue labels**
141
+
142
+ If `{issue-labels}` is not empty, filter labels that do not start with `type:` or `status:` and run the following for each label on a best-effort basis:
143
+
144
+ ```bash
145
+ gh pr edit {pr-number} --add-label "{label-name}"
146
+ ```
147
+
148
+ Only add labels; do not remove any existing PR labels.
149
+
150
+ **e) Sync `in:` labels**
118
151
 
119
152
  Extract affected modules from implementation reports or analysis, verify that the label exists, then run:
120
153
 
@@ -124,11 +157,12 @@ gh pr edit {pr-number} --add-label "in: {module}"
124
157
 
125
158
  Only add labels; do not remove existing `in:` labels.
126
159
 
127
- **d) Sync the milestone**
160
+ **f) Sync the milestone**
128
161
 
129
- Reuse the same milestone inference strategy as `sync-pr`:
162
+ Extend the `sync-pr` milestone inference strategy with Issue milestone priority:
130
163
  - preserve an existing PR milestone
131
164
  - otherwise respect explicit `milestone` from task.md
165
+ - otherwise use the Issue milestone when available (`{issue-milestone}`)
132
166
  - otherwise infer from the current branch, release branches, or the latest tag
133
167
  - finally fall back to `General Backlog`
134
168
 
@@ -138,7 +172,7 @@ Once the target is resolved, run:
138
172
  gh pr edit {pr-number} --milestone "{milestone-title}"
139
173
  ```
140
174
 
141
- **e) Sync development linking**
175
+ **g) Sync development linking**
142
176
 
143
177
  If task.md contains `issue_number`, read the PR body:
144
178
 
@@ -170,7 +204,7 @@ Get the current time:
170
204
  date "+%Y-%m-%d %H:%M:%S"
171
205
  ```
172
206
 
173
- If there is an active task for this work, update `.agent-workspace/active/{task-id}/task.md`:
207
+ If there is an active task for this work, update `.agents/workspace/active/{task-id}/task.md`:
174
208
  - `pr_number`: {pr-number}
175
209
  - `updated_at`: {current time}
176
210
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
@@ -222,3 +256,6 @@ Next steps (if in task workflow):
222
256
  - No commits to push: Prompt "No commits found between {target} and HEAD"
223
257
  - Push rejected: Suggest `git pull --rebase` first
224
258
  - PR already exists: Show existing PR URL
259
+ - Issue not accessible or missing: Skip Issue metadata inheritance and record "Issue #{number} not accessible, skipping metadata inheritance"
260
+ - Issue label unavailable: Skip that label and record "Label '{name}' not found, skipping"
261
+ - Issue milestone unavailable: Fall back to branch-based milestone inference
@@ -63,13 +63,22 @@ git push -u origin <current-branch>
63
63
 
64
64
  ### 7. 创建 PR
65
65
 
66
+ - 如果存在关联的活跃任务,从 task.md 提取 `issue_number`
67
+ - 如果 `issue_number` 存在,查询 Issue 信息(容错,失败时跳过):
68
+ ```bash
69
+ gh issue view {issue-number} --json number,title --jq '.number' 2>/dev/null
70
+ ```
66
71
  - 遵循 `.github/PULL_REQUEST_TEMPLATE.md` 格式填写所有部分
67
72
  - 参考最近合并的 PR 的风格
68
73
  - 使用 HEREDOC 格式传递 body
74
+ - 如果 `issue_number` 存在:
75
+ - 将模板中的 `{$IssueNumber}` 替换为实际 Issue 编号
76
+ - 在 `Related Issue` 部分使用 `Closes #{issue_number}`
77
+ - 如果 `issue_number` 不存在,保持原有行为
69
78
  - PR 必须以 `Generated with AI assistance` 结尾
70
79
 
71
80
  ```bash
72
- gh pr create --base <target-branch> --title "<title>" --body "$(cat <<'EOF'
81
+ gh pr create --base <target-branch> --title "<title>" --assignee @me --body "$(cat <<'EOF'
73
82
  <按模板填写的完整 PR 描述>
74
83
 
75
84
  Generated with AI assistance
@@ -92,7 +101,21 @@ gh label list --search "type:" --limit 1 --json name --jq 'length'
92
101
  - 返回 `0` -> 先执行 `init-labels` 技能,然后重新执行本步骤
93
102
  - 返回非 `0` -> 继续
94
103
 
95
- **b) 同步 type label**
104
+ **b) 查询 Issue 元数据**
105
+
106
+ 如果 task.md 包含 `issue_number`,查询 Issue 的 Labels 和 Milestone(容错):
107
+
108
+ ```bash
109
+ gh issue view {issue-number} --json labels,milestone 2>/dev/null
110
+ ```
111
+
112
+ 如果查询失败(Issue 不存在、权限不足等),跳过 Issue 元数据继承,后续步骤仅使用 task.md 静态映射。
113
+
114
+ 记录查询结果供后续子步骤使用:
115
+ - `{issue-labels}` — Issue 上的 Labels 列表
116
+ - `{issue-milestone}` — Issue 上的 Milestone 标题(如有)
117
+
118
+ **c) 同步 type label**
96
119
 
97
120
  根据 task.md 的 `type` 字段按下表映射:
98
121
 
@@ -113,7 +136,17 @@ gh label list --search "type:" --limit 1 --json name --jq 'length'
113
136
  gh pr edit {pr-number} --add-label "{type-label}"
114
137
  ```
115
138
 
116
- **c) 同步 in: label**
139
+ **d) 继承 Issue Labels**
140
+
141
+ 如果 `{issue-labels}` 非空,筛选出不以 `type:` 或 `status:` 开头的 labels,对每个 label 执行(容错,label 不存在时跳过):
142
+
143
+ ```bash
144
+ gh pr edit {pr-number} --add-label "{label-name}"
145
+ ```
146
+
147
+ 只添加,不移除 PR 上现有的 labels。
148
+
149
+ **e) 同步 in: label**
117
150
 
118
151
  从实现报告或分析报告提取受影响模块,确认对应 label 存在后执行:
119
152
 
@@ -123,11 +156,12 @@ gh pr edit {pr-number} --add-label "in: {module}"
123
156
 
124
157
  只添加,不移除现有的 `in:` labels。
125
158
 
126
- **d) 同步 Milestone**
159
+ **f) 同步 Milestone**
127
160
 
128
- 复用 `sync-pr` 的里程碑推断策略:
161
+ 基于 `sync-pr` 的里程碑推断策略,并扩展 Issue Milestone 优先级:
129
162
  - 先检查 PR 是否已有 milestone
130
163
  - 再检查 task.md 是否显式指定 `milestone`
164
+ - 再检查 Issue 是否已有 milestone(使用 `{issue-milestone}`)
131
165
  - 否则基于当前分支、版本分支或最新 tag 推断
132
166
  - 最终回退到 `General Backlog`
133
167
 
@@ -137,7 +171,7 @@ gh pr edit {pr-number} --add-label "in: {module}"
137
171
  gh pr edit {pr-number} --milestone "{milestone-title}"
138
172
  ```
139
173
 
140
- **e) 同步 Development 关联**
174
+ **g) 同步 Development 关联**
141
175
 
142
176
  如果 task.md 包含 `issue_number`,读取 PR body:
143
177
 
@@ -169,7 +203,7 @@ EOF
169
203
  date "+%Y-%m-%d %H:%M:%S"
170
204
  ```
171
205
 
172
- 如果有关联的活跃任务,更新 `.agent-workspace/active/{task-id}/task.md`:
206
+ 如果有关联的活跃任务,更新 `.agents/workspace/active/{task-id}/task.md`:
173
207
  - `pr_number`:{pr-number}
174
208
  - `updated_at`:{当前时间}
175
209
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
@@ -221,3 +255,6 @@ PR 已创建:{pr-url}
221
255
  - 无提交可推送:提示 "No commits found between {target} and HEAD"
222
256
  - 推送被拒绝:建议先执行 `git pull --rebase`
223
257
  - PR 已存在:显示已有的 PR URL
258
+ - Issue 不存在或无权限:跳过 Issue 元数据继承,记录 "Issue #{number} not accessible, skipping metadata inheritance"
259
+ - Issue Label 不可用:跳过对应 label,记录 "Label '{name}' not found, skipping"
260
+ - Issue Milestone 不可用:回退到分支推断策略
@@ -34,22 +34,29 @@ git rev-parse v<version>
34
34
  git rev-parse v<prev-version>
35
35
  ```
36
36
 
37
- ### Step 3: Reference Historical Release Notes Format
37
+ ### Step 3: Reference Historical Release Notes Format and Categories
38
38
 
39
- Fetch the most recent published release notes as a format reference:
39
+ Fetch multiple published release notes as format references, then use a predefined complete category list:
40
40
 
41
41
  ```bash
42
- # Get the latest non-draft release tag
43
- gh release list --limit 5 --json tagName,isDraft,isPrerelease \
44
- --jq '[.[] | select(.isDraft == false and .isPrerelease == false)][0].tagName'
45
-
46
- # Get the release body
47
- gh release view <latest-tag> --json body -q '.body'
42
+ # Part A: Fetch the body for each of the 3 releases
43
+ for tag in $(gh release list --limit 10 --json tagName,isDraft,isPrerelease \
44
+ --jq '[.[] | select(.isDraft == false and .isPrerelease == false)] | .[0:3] | .[].tagName'); do
45
+ gh release view "$tag" --json body -q '.body'
46
+ done
48
47
  ```
49
48
 
49
+ **Part B: Complete Category List**
50
+ - `🆕 Feature`
51
+ - `✨ Enhancement`
52
+ - `✅ Bugfix`
53
+ - `📚 Documentation`
54
+
50
55
  **Purpose**:
51
- - Analyze the section structure, heading style, emoji usage, and item format of historical release notes
52
- - When generating release notes in Step 7, **must** follow the historical format to maintain consistency across versions
56
+ - Part A: Analyze the section structure, heading style, emoji usage, and item format from the latest 3 historical release notes
57
+ - Part B: Provide a static complete category list so no existing category is omitted
58
+ - This static list ensures existing category names are not missed during classification; if the current release has no entries for a category, Step 7 still omits the empty section
59
+ - When generating release notes in Step 7, **must** follow both the historical format style and the full category list gathered in Step 3
53
60
  - If no historical release notes exist, use the default format defined in Step 7
54
61
 
55
62
  ### Step 4: Collect Merged PRs
@@ -94,7 +101,7 @@ gh issue view <N> --json number,title,labels,url
94
101
 
95
102
  ### Step 7: Generate Release Notes
96
103
 
97
- **Prioritize the historical format obtained in Step 3.** If historical release notes exist, strictly follow their section structure, heading style (including emojis), item format, and bilingual layout.
104
+ **Prioritize the historical format style obtained in Step 3 and ensure all categories listed in Step 3 are covered.** If historical release notes exist, strictly follow their section structure, heading style (including emojis), item format, and bilingual layout.
98
105
 
99
106
  If no historical release notes exist, use the following default Markdown format:
100
107
 
@@ -33,22 +33,29 @@ git rev-parse v<version>
33
33
  git rev-parse v<prev-version>
34
34
  ```
35
35
 
36
- ### 步骤 3:参考历史发布说明格式
36
+ ### 步骤 3:参考历史发布说明格式与分类
37
37
 
38
- 获取最近一次已发布的 Release Note 作为格式参考:
38
+ 获取最近多条已发布的 Release Note 作为格式参考,并参考预定义的完整分类清单:
39
39
 
40
40
  ```bash
41
- # 获取最近的非草稿 Release 标签
42
- gh release list --limit 5 --json tagName,isDraft,isPrerelease \
43
- --jq '[.[] | select(.isDraft == false and .isPrerelease == false)][0].tagName'
44
-
45
- # 获取该 Release 的 body
46
- gh release view <latest-tag> --json body -q '.body'
41
+ # Part A: 逐条获取这 3 条 Release 的 body
42
+ for tag in $(gh release list --limit 10 --json tagName,isDraft,isPrerelease \
43
+ --jq '[.[] | select(.isDraft == false and .isPrerelease == false)] | .[0:3] | .[].tagName'); do
44
+ gh release view "$tag" --json body -q '.body'
45
+ done
47
46
  ```
48
47
 
48
+ **Part B:完整分类清单**
49
+ - `🆕 Feature`
50
+ - `✨ Enhancement`
51
+ - `✅ Bugfix`
52
+ - `📚 Documentation`
53
+
49
54
  **用途**:
50
- - 分析历史发布说明的章节结构、标题风格、emoji 使用、条目格式
51
- - 后续步骤 7 生成发布说明时,**必须**优先遵循历史格式,保持版本间的一致性
55
+ - Part A:分析最近 3 条历史发布说明的章节结构、标题风格、emoji 使用、条目格式
56
+ - Part B:提供静态完整分类清单,确保后续生成时不遗漏已有分类
57
+ - 该静态清单用于确保变更分类时不遗漏已有类别名称;若当前版本无该类变更,仍按步骤 7 的格式规则省略空分类
58
+ - 后续步骤 7 生成发布说明时,**必须**同时参考步骤 3 的历史格式风格和完整分类清单,保持版本间的一致性
52
59
  - 如果没有历史发布说明,则使用步骤 7 中定义的默认格式
53
60
 
54
61
  ### 步骤 4:收集已合并的 PR
@@ -93,7 +100,7 @@ gh issue view <N> --json number,title,labels,url
93
100
 
94
101
  ### 步骤 7:生成发布说明
95
102
 
96
- **优先使用步骤 3 中获取的历史格式**。如果存在历史发布说明,严格沿用其章节结构、标题风格(含 emoji)、条目格式和双语布局。
103
+ **优先使用步骤 3 中获取的历史格式风格,并确保覆盖步骤 3 列出的所有分类。** 如果存在历史发布说明,严格沿用其章节结构、标题风格(含 emoji)、条目格式和双语布局。
97
104
 
98
105
  如果没有历史发布说明,使用以下默认格式化为 Markdown:
99
106
 
@@ -1,67 +1,69 @@
1
1
  ---
2
2
  name: create-task
3
3
  description: >
4
- 根据用户的自然语言描述创建任务骨架。当用户描述一个新功能、Bug 或改进需求时触发。
5
- 唯一的产出是 task.md —— 不编写任何业务代码。参数:任务描述文本。
4
+ Create a task skeleton from the user's natural-language description.
5
+ Triggered when the user describes a new feature, bug, or improvement request.
6
+ The only output is task.md; do not write any business code. Argument: task description text.
6
7
  ---
7
8
 
8
- # 创建任务
9
+ # Create Task
9
10
 
10
- ## 行为边界 / 关键规则
11
+ ## Boundary / Critical Rules
11
12
 
12
- **本技能的唯一产出是 `task.md`。**
13
+ **The only output of this skill is `task.md`.**
13
14
 
14
- - 不要编写、修改或创建任何业务代码或配置文件
15
- - 不要执行需求分析;分析由 `analyze-task` 独立完成
16
- - 不要直接实现所描述的功能
17
- - 不要跳过工作流直接进入计划/实现阶段
18
- - 仅执行:解析描述 -> 创建任务文件 -> 更新任务状态 -> 告知用户下一步
15
+ - Do not write, modify, or create any business code or configuration files
16
+ - Do not perform requirements analysis; analysis is handled separately by `analyze-task`
17
+ - Do not directly implement the requested functionality
18
+ - Do not skip the workflow and jump directly to planning or implementation
19
+ - Only do this: parse the description -> create the task file -> update task status -> inform the user of the next step
19
20
 
20
- 用户的描述是一个**待办事项**,而不是**立即执行的指令**。
21
+ The user's description is a **work item**, not an **instruction to execute immediately**.
21
22
 
22
- 执行本技能后,你**必须**立即更新 task.md 中的任务状态。
23
+ After executing this skill, you **must** immediately update task status in task.md.
23
24
 
24
- ## 执行步骤
25
+ ## Steps
25
26
 
26
- ### 1. 解析用户描述
27
+ ### 1. Parse the User Description
27
28
 
28
- 从自然语言描述中提取:
29
- - **任务标题**:简洁标题(最多 50 个字符)
30
- - **任务类型**:`feature` | `bugfix` | `refactor` | `docs` | `chore`(从描述推断)
31
- - **工作流**:`feature-development` | `bug-fix` | `refactoring`(从类型推断)
32
- - **详细描述**:整理后的用户原始描述
29
+ Extract from the natural-language description:
30
+ - **Task title**: a concise title (maximum 50 characters)
31
+ - **Task type**: `feature` | `bugfix` | `refactor` | `docs` | `chore` (infer from the description)
32
+ - **Workflow**: `feature-development` | `bug-fix` | `refactoring` (infer from the type)
33
+ - **Detailed description**: the cleaned-up original user request
33
34
 
34
- 如果描述不清晰,**先向用户确认**再继续。
35
+ If the description is unclear, **ask the user to clarify first**.
35
36
 
36
- **类型推断规则**:
37
- - 包含 "add"、"new"、"support"、"implement" -> `feature`
38
- - 包含 "fix"、"resolve"、"bug"、"error" -> `bugfix`
39
- - 包含 "refactor"、"optimize"、"improve"、"clean up" -> `refactor`
40
- - 包含 "document"、"javadoc"、"comment"、"readme" -> `docs`
41
- - 其他 -> `chore`
37
+ **Type inference**: choose the best matching type from the following candidates based on the semantics of the task description:
42
38
 
43
- **工作流映射**:
39
+ - `feature` - new functionality or capability
40
+ - `bugfix` - defect or error fix
41
+ - `refactor` - refactoring, optimization, or code improvement
42
+ - `docs` - documentation-related work
43
+ - `chore` - other miscellaneous work
44
+
45
+ **Workflow mapping**:
44
46
  - `feature` / `docs` / `chore` -> `feature-development`
45
47
  - `bugfix` -> `bug-fix`
46
48
  - `refactor` -> `refactoring`
47
49
 
48
- ### 2. 创建任务目录和文件
50
+ ### 2. Create the Task Directory and File
49
51
 
50
- 获取当前时间戳:
52
+ Get the current timestamp:
51
53
 
52
54
  ```bash
53
55
  date +%Y%m%d-%H%M%S
54
56
  ```
55
57
 
56
- - 创建任务目录:`.agent-workspace/active/TASK-{yyyyMMdd-HHmmss}/`
57
- - 使用 `.agents/templates/task.md` 模板创建任务文件:`task.md`
58
+ - Create the task directory: `.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
59
+ - Use the `.agents/templates/task.md` template to create the task file: `task.md`
58
60
 
59
- **重要**:
60
- - 目录命名:`TASK-{yyyyMMdd-HHmmss}`(**必须**包含 `TASK-` 前缀)
61
- - 示例:`TASK-20260306-143022`
62
- - 任务 ID = 目录名
61
+ **Important**:
62
+ - Directory naming: `TASK-{yyyyMMdd-HHmmss}` (**must** include the `TASK-` prefix)
63
+ - Example: `TASK-20260306-143022`
64
+ - Task ID = directory name
63
65
 
64
- 任务元数据(task.md YAML front matter):
66
+ Task metadata (`task.md` YAML front matter):
65
67
  ```yaml
66
68
  id: TASK-{yyyyMMdd-HHmmss}
67
69
  type: feature|bugfix|refactor|docs|chore
@@ -71,73 +73,73 @@ created_at: {yyyy-MM-dd HH:mm:ss}
71
73
  updated_at: {yyyy-MM-dd HH:mm:ss}
72
74
  created_by: human
73
75
  current_step: requirement-analysis
74
- assigned_to: {当前 AI 代理}
76
+ assigned_to: {current AI agent}
75
77
  ```
76
78
 
77
- 注意:`created_by` `human`,因为任务来源于用户的描述。
79
+ Note: `created_by` is `human` because the task comes from the user's description.
78
80
 
79
- ### 3. 更新任务状态
81
+ ### 3. Update Task Status
80
82
 
81
- 获取当前时间:
83
+ Get the current time:
82
84
 
83
85
  ```bash
84
86
  date "+%Y-%m-%d %H:%M:%S"
85
87
  ```
86
88
 
87
- 更新 `.agent-workspace/active/{task-id}/task.md`:
88
- - `current_step`:requirement-analysis
89
- - `assigned_to`:{当前 AI 代理}
90
- - `updated_at`:{当前时间}
91
- - **追加**到 `## Activity Log`(不要覆盖之前的记录):
89
+ Update `.agents/workspace/active/{task-id}/task.md`:
90
+ - `current_step`: requirement-analysis
91
+ - `assigned_to`: {current AI agent}
92
+ - `updated_at`: {current time}
93
+ - **Append** to `## Activity Log` (do NOT overwrite previous entries):
92
94
  ```
93
95
  - {yyyy-MM-dd HH:mm:ss} — **Task Created** by {agent} — Task created from description
94
96
  ```
95
97
 
96
- ### 4. 告知用户
98
+ ### 4. Inform User
97
99
 
98
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
100
+ > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
99
101
 
100
- 输出格式:
102
+ Output format:
101
103
  ```
102
- 任务已创建。
104
+ Task created.
103
105
 
104
- 任务信息:
105
- - 任务 ID{task-id}
106
- - 标题:{title}
107
- - 类型:{type}
108
- - 工作流:{workflow}
106
+ Task information:
107
+ - Task ID: {task-id}
108
+ - Title: {title}
109
+ - Type: {type}
110
+ - Workflow: {workflow}
109
111
 
110
- 产出文件:
111
- - 任务文件:.agent-workspace/active/{task-id}/task.md
112
+ Output file:
113
+ - Task file: .agents/workspace/active/{task-id}/task.md
112
114
 
113
- 下一步 - 执行需求分析:
114
- - Claude Code / OpenCode:/analyze-task {task-id}
115
- - Gemini CLI:/agent-infra:analyze-task {task-id}
116
- - Codex CLI:$analyze-task {task-id}
115
+ Next step - run requirements analysis:
116
+ - Claude Code / OpenCode: /analyze-task {task-id}
117
+ - Gemini CLI: /{{project}}:analyze-task {task-id}
118
+ - Codex CLI: $analyze-task {task-id}
117
119
  ```
118
120
 
119
- ## 完成检查清单
121
+ ## Completion Checklist
120
122
 
121
- - [ ] 创建了任务文件 `.agent-workspace/active/{task-id}/task.md`
122
- - [ ] 更新了 task.md 中的 `current_step` requirement-analysis
123
- - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
124
- - [ ] 更新了 task.md 中的 `assigned_to`
125
- - [ ] 追加了 Activity Log 条目到 task.md
126
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
127
- - [ ] **没有修改任何业务代码或配置文件**(仅 task.md
123
+ - [ ] Created the task file `.agents/workspace/active/{task-id}/task.md`
124
+ - [ ] Updated `current_step` to requirement-analysis in task.md
125
+ - [ ] Updated `updated_at` to the current time in task.md
126
+ - [ ] Updated `assigned_to` in task.md
127
+ - [ ] Appended an Activity Log entry to task.md
128
+ - [ ] Informed the user of the next step (must include all TUI command formats; do not filter)
129
+ - [ ] **Did not modify any business code or configuration files** (only task.md)
128
130
 
129
- ## 停止
131
+ ## STOP
130
132
 
131
- 完成检查清单后,**立即停止**。不要继续执行计划、实现或任何后续步骤。
132
- 等待用户执行 `analyze-task` 技能。
133
+ After completing the checklist, **stop immediately**. Do not continue to planning, implementation, or any follow-up step.
134
+ Wait for the user to run the `analyze-task` skill.
133
135
 
134
- ## 注意事项
136
+ ## Notes
135
137
 
136
- 1. **清晰度**:如果用户描述模糊或缺少关键信息,先要求澄清
137
- 2. **与 import-issue 的区别**:`import-issue` GitHub Issue 导入任务;`create-task` 从自由描述创建
138
- 3. **工作流顺序**:创建任务后,必须先执行 `analyze-task`,再进入 `plan-task`
138
+ 1. **Clarity**: if the user description is vague or missing key information, ask for clarification first
139
+ 2. **Difference from `import-issue`**: `import-issue` imports from a GitHub Issue; `create-task` creates from a free-form description
140
+ 3. **Workflow order**: after creating a task, `analyze-task` must run before `plan-task`
139
141
 
140
- ## 错误处理
142
+ ## Error Handling
141
143
 
142
- - 空描述:提示 "Please provide a task description"
143
- - 描述过于模糊:在创建任务之前提出澄清问题
144
+ - Empty description: output "Please provide a task description"
145
+ - Description too vague: ask clarification questions before creating the task