@fitlab-ai/agent-infra 0.7.5 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/bin/cli.ts +11 -3
  2. package/dist/bin/cli.js +10 -3
  3. package/dist/lib/sandbox/commands/create.js +26 -4
  4. package/dist/lib/sandbox/commands/ls.js +4 -33
  5. package/dist/lib/sandbox/commands/show.js +67 -0
  6. package/dist/lib/sandbox/index.js +7 -0
  7. package/dist/lib/sandbox/tools.js +20 -1
  8. package/dist/lib/task/commands/issue-body.js +94 -0
  9. package/dist/lib/task/commands/log.js +139 -6
  10. package/dist/lib/task/index.js +8 -0
  11. package/dist/lib/task/issue-form.js +66 -0
  12. package/dist/lib/task/sections.js +44 -0
  13. package/lib/sandbox/commands/create.ts +33 -4
  14. package/lib/sandbox/commands/ls.ts +4 -36
  15. package/lib/sandbox/commands/show.ts +80 -0
  16. package/lib/sandbox/index.ts +7 -0
  17. package/lib/sandbox/tools.ts +28 -1
  18. package/lib/task/commands/issue-body.ts +102 -0
  19. package/lib/task/commands/log.ts +146 -6
  20. package/lib/task/index.ts +8 -0
  21. package/lib/task/issue-form.ts +77 -0
  22. package/lib/task/sections.ts +44 -0
  23. package/package.json +3 -2
  24. package/templates/.agents/README.en.md +3 -1
  25. package/templates/.agents/README.zh-CN.md +3 -1
  26. package/templates/.agents/rules/create-issue.github.en.md +20 -29
  27. package/templates/.agents/rules/create-issue.github.zh-CN.md +20 -29
  28. package/templates/.agents/rules/issue-pr-commands.github.en.md +6 -0
  29. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +6 -0
  30. package/templates/.agents/rules/next-step-output.en.md +26 -1
  31. package/templates/.agents/rules/next-step-output.zh-CN.md +26 -1
  32. package/templates/.agents/rules/no-mid-flow-questions.en.md +11 -0
  33. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +11 -0
  34. package/templates/.agents/rules/review-handshake.en.md +15 -1
  35. package/templates/.agents/rules/review-handshake.zh-CN.md +15 -1
  36. package/templates/.agents/rules/task-management.en.md +27 -0
  37. package/templates/.agents/rules/task-management.zh-CN.md +31 -0
  38. package/templates/.agents/scripts/validate-artifact.js +11 -2
  39. package/templates/.agents/skills/analyze-task/SKILL.en.md +14 -1
  40. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +14 -1
  41. package/templates/.agents/skills/archive-tasks/SKILL.en.md +3 -1
  42. package/templates/.agents/skills/archive-tasks/SKILL.zh-CN.md +3 -1
  43. package/templates/.agents/skills/block-task/SKILL.en.md +13 -1
  44. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +13 -1
  45. package/templates/.agents/skills/cancel-task/SKILL.en.md +13 -1
  46. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +14 -2
  47. package/templates/.agents/skills/check-task/SKILL.en.md +30 -81
  48. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +30 -80
  49. package/templates/.agents/skills/close-codescan/SKILL.en.md +13 -1
  50. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +13 -1
  51. package/templates/.agents/skills/close-dependabot/SKILL.en.md +13 -1
  52. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +13 -1
  53. package/templates/.agents/skills/code-task/SKILL.en.md +14 -1
  54. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +14 -1
  55. package/templates/.agents/skills/code-task/reference/dual-mode.en.md +7 -2
  56. package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +7 -2
  57. package/templates/.agents/skills/code-task/scripts/detect-mode.js +6 -14
  58. package/templates/.agents/skills/commit/SKILL.en.md +37 -5
  59. package/templates/.agents/skills/commit/SKILL.zh-CN.md +37 -5
  60. package/templates/.agents/skills/complete-task/SKILL.en.md +13 -1
  61. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +13 -1
  62. package/templates/.agents/skills/create-pr/SKILL.en.md +23 -2
  63. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +23 -2
  64. package/templates/.agents/skills/create-release-note/SKILL.en.md +19 -2
  65. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +19 -2
  66. package/templates/.agents/skills/create-task/SKILL.en.md +14 -1
  67. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +17 -4
  68. package/templates/.agents/skills/import-codescan/SKILL.en.md +14 -1
  69. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +14 -1
  70. package/templates/.agents/skills/import-dependabot/SKILL.en.md +14 -1
  71. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +14 -1
  72. package/templates/.agents/skills/import-issue/SKILL.en.md +35 -2
  73. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +35 -2
  74. package/templates/.agents/skills/init-labels/SKILL.en.md +3 -1
  75. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +3 -1
  76. package/templates/.agents/skills/init-milestones/SKILL.en.md +3 -1
  77. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +3 -1
  78. package/templates/.agents/skills/plan-task/SKILL.en.md +15 -1
  79. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +15 -1
  80. package/templates/.agents/skills/post-release/SKILL.en.md +3 -1
  81. package/templates/.agents/skills/post-release/SKILL.zh-CN.md +3 -1
  82. package/templates/.agents/skills/refine-title/SKILL.en.md +3 -1
  83. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +3 -1
  84. package/templates/.agents/skills/release/SKILL.en.md +3 -1
  85. package/templates/.agents/skills/release/SKILL.zh-CN.md +3 -1
  86. package/templates/.agents/skills/restore-task/SKILL.en.md +13 -1
  87. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +13 -1
  88. package/templates/.agents/skills/review-analysis/SKILL.en.md +16 -2
  89. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +16 -2
  90. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +1 -1
  91. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +1 -1
  92. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +1 -1
  93. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +1 -2
  94. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +1 -0
  95. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +1 -0
  96. package/templates/.agents/skills/review-code/SKILL.en.md +15 -2
  97. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +15 -2
  98. package/templates/.agents/skills/review-code/reference/output-templates.en.md +1 -1
  99. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +1 -1
  100. package/templates/.agents/skills/review-code/reference/report-template.en.md +1 -1
  101. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +1 -2
  102. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +1 -0
  103. package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +1 -0
  104. package/templates/.agents/skills/review-plan/SKILL.en.md +16 -2
  105. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +16 -2
  106. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +1 -1
  107. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +1 -1
  108. package/templates/.agents/skills/review-plan/reference/report-template.en.md +1 -1
  109. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +1 -2
  110. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +1 -0
  111. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +1 -0
  112. package/templates/.agents/skills/test/SKILL.en.md +3 -1
  113. package/templates/.agents/skills/test/SKILL.zh-CN.md +1 -1
  114. package/templates/.agents/skills/test-integration/SKILL.en.md +3 -1
  115. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +3 -1
  116. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +3 -1
  117. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +3 -1
  118. package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +3 -1
  119. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +3 -1
  120. package/templates/.agents/skills/watch-pr/SKILL.en.md +13 -1
  121. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +13 -1
  122. package/templates/.agents/templates/task.en.md +5 -0
  123. package/templates/.agents/templates/task.zh-CN.md +5 -0
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: create-pr
3
- description: "Create a Pull Request to a target branch"
3
+ description: >
4
+ Create a Pull Request to a target branch.
5
+ Use when changes are committed and you need to open a Pull Request for review.
4
6
  ---
5
7
 
6
8
  # Create Pull Request
@@ -15,6 +17,16 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
15
17
 
16
18
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
17
19
 
20
+ ## Step Start: Write the started Marker
21
+
22
+ After the pre-flight gate and prerequisites pass and before this step's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this step's done entry plus a ` [started]` suffix, note `started`). Only write it when an associated `{task-id}` / task.md exists:
23
+
24
+ ```
25
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Create PR [started]** by {agent} — started
26
+ ```
27
+
28
+ `ai task log` pairs it with the done entry written on completion onto one row (in progress → done). See the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
29
+
18
30
  ## Execution Flow
19
31
 
20
32
  ### Pre-gate: Project-level PR Flow Check
@@ -128,7 +140,16 @@ Next step - Watch PR checks (auto self-heal until required checks are green):
128
140
  - Codex CLI: $watch-pr {task-ref}
129
141
  ```
130
142
 
131
- Once green, `watch-pr` then guides toward `complete-task {task-ref}`.
143
+ Alternatively, to skip CI monitoring and archive the task right away, use `complete-task` instead:
144
+
145
+ ```
146
+ Next step (alternative) - Skip monitoring and archive the task directly:
147
+ - Claude Code / OpenCode: /complete-task {task-ref}
148
+ - Gemini CLI: /agent-infra:complete-task {task-ref}
149
+ - Codex CLI: $complete-task {task-ref}
150
+ ```
151
+
152
+ `watch-pr` is the primary path; once checks are green it guides you toward `complete-task {task-ref}`. Run the `complete-task` block above directly only when you intend to skip monitoring — the two are not equivalent.
132
153
 
133
154
  ## Notes
134
155
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: create-pr
3
- description: "创建 Pull Request 到目标分支"
3
+ description: >
4
+ 创建 Pull Request 到目标分支。
5
+ 当变更已提交、需要发起 Pull Request 评审时使用。
4
6
  ---
5
7
 
6
8
  # 创建 Pull Request
@@ -15,6 +17,16 @@ description: "创建 Pull Request 到目标分支"
15
17
 
16
18
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
17
19
 
20
+ ## 步骤开始:写入 started 标记
21
+
22
+ 通过前置门控、确认前置条件后、本步骤第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本步骤 done 条目同基名 + ` [started]` 后缀,note 用 `started`)。仅当存在关联 `{task-id}` / task.md 时写入:
23
+
24
+ ```
25
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Create PR [started]** by {agent} — started
26
+ ```
27
+
28
+ `ai task log` 会把它与完成时写入的 done 条目配对成一行(进行中 → 已完成)。约定见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
29
+
18
30
  ## 执行流程
19
31
 
20
32
  ### 前置门控:项目级 PR 流程检查
@@ -128,7 +140,16 @@ node .agents/scripts/validate-artifact.js gate create-pr .agents/workspace/activ
128
140
  - Codex CLI:$watch-pr {task-ref}
129
141
  ```
130
142
 
131
- `watch-pr` 全绿后会再引导 `complete-task {task-ref}`。
143
+ 或者,若想跳过 CI 监控、直接归档任务,改用 `complete-task`:
144
+
145
+ ```
146
+ 下一步(备选)- 跳过监控、直接归档任务:
147
+ - Claude Code / OpenCode:/complete-task {task-ref}
148
+ - Gemini CLI:/agent-infra:complete-task {task-ref}
149
+ - Codex CLI:$complete-task {task-ref}
150
+ ```
151
+
152
+ `watch-pr` 为主路径,全绿后会再引导 `complete-task {task-ref}`;上面的 `complete-task` 备选块仅用于跳过 CI 监控、直接归档——两者并不等价。
132
153
 
133
154
  ## 注意事项
134
155
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: create-release-note
3
- description: "Generate release notes from PRs and commits"
3
+ description: >
4
+ Generate release notes from PRs and commits.
5
+ Use when preparing a release and you need notes compiled from PRs and commits.
4
6
  ---
5
7
 
6
8
  # Create Release Notes
@@ -160,7 +162,21 @@ Ask:
160
162
 
161
163
  ### 9. Publish the Release Notes (If Confirmed)
162
164
 
163
- Write the notes by following the "Publish the Release Notes" command in `.agents/rules/release-commands.md` (it updates the Release already created and published by the release workflow, falling back to creating it if missing).
165
+ 9.1 Write the generated notes to a temp file **outside the working tree** so no uncommitted artifact is left behind in the repo (do not write into `.agents/workspace/` or any version-controlled directory):
166
+
167
+ ```bash
168
+ NOTES_FILE="$(mktemp "${TMPDIR:-/tmp}/agent-infra-release-notes.XXXXXX")"
169
+ ```
170
+
171
+ Write the notes content to `$NOTES_FILE`.
172
+
173
+ 9.2 Publish by following the "Publish the Release Notes" command in `.agents/rules/release-commands.md` (use `$NOTES_FILE` for `{notes-file}`; it updates the Release already created and published by the release workflow, falling back to creating it if missing).
174
+
175
+ 9.3 Remove the temp file whether publishing succeeds or fails:
176
+
177
+ ```bash
178
+ rm -f "$NOTES_FILE"
179
+ ```
164
180
 
165
181
  Output:
166
182
  ```
@@ -179,6 +195,7 @@ The notes have been written to the Release. Edit further at the URL above if nee
179
195
  2. **Tags must exist**: Run the release skill first to create tags
180
196
  3. **Release auto-published**: the `v{version}` Release is created and published by the release workflow (the upload target for Homebrew bottles); this skill writes/refreshes the notes on that Release
181
197
  4. **Classification accuracy**: Auto-classification is based on title/scope/files; complex PRs may need manual adjustment
198
+ 5. **No leftover artifacts**: Always write notes to a temp file outside the working tree (`mktemp`) and delete it after publishing; never write into the repo directory
182
199
 
183
200
  ## Error Handling
184
201
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: create-release-note
3
- description: "从 PR 和 commit 生成版本发布说明"
3
+ description: >
4
+ 从 PR 和 commit 生成版本发布说明。
5
+ 当准备发版、需要从 PR 与 commit 汇总发布说明时使用。
4
6
  ---
5
7
 
6
8
  # 创建发布说明
@@ -160,7 +162,21 @@ git log v<prev-version>..v<version> \
160
162
 
161
163
  ### 9. 发布 Release notes(如确认)
162
164
 
163
- 按 `.agents/rules/release-commands.md` 的「发布 Release notes」命令执行(写入已由 release 工作流自动创建/发布的 Release;不存在时兜底创建)。
165
+ 9.1 把生成的 notes 写入**工作树之外**的临时文件,避免在仓库残留未提交产物(不要写入 `.agents/workspace/` 或任何受版本控制的目录):
166
+
167
+ ```bash
168
+ NOTES_FILE="$(mktemp "${TMPDIR:-/tmp}/agent-infra-release-notes.XXXXXX")"
169
+ ```
170
+
171
+ 把 notes 内容写入 `$NOTES_FILE`。
172
+
173
+ 9.2 按 `.agents/rules/release-commands.md` 的「发布 Release notes」命令执行(命令中的 `{notes-file}` 用 `$NOTES_FILE`;写入已由 release 工作流自动创建/发布的 Release,不存在时兜底创建)。
174
+
175
+ 9.3 无论发布成功或失败,都删除临时文件:
176
+
177
+ ```bash
178
+ rm -f "$NOTES_FILE"
179
+ ```
164
180
 
165
181
  输出:
166
182
  ```
@@ -179,6 +195,7 @@ Release notes 已更新。
179
195
  2. **标签必须存在**:先执行 release 技能创建标签
180
196
  3. **Release 已自动发布**:`v{version}` 的 Release 由 release 工作流自动创建并发布(给 Homebrew bottle 提供上传落点);本技能往该 Release 写入/刷新 notes
181
197
  4. **分类准确性**:自动分类基于标题/scope/文件;复杂的 PR 可能需要手动调整
198
+ 5. **不留残留产物**:notes 一律写入工作树之外的临时文件(`mktemp`)并在发布后删除,禁止写入仓库目录
182
199
 
183
200
  ## 错误处理
184
201
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: create-task
3
- description: "Create a task from a natural-language description"
3
+ description: >
4
+ Create a task from a natural-language description.
5
+ Use when you want to turn a free-form idea or request into a tracked task.
4
6
  ---
5
7
 
6
8
  # Create Task
@@ -26,6 +28,17 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
26
28
 
27
29
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
28
30
 
31
+ ## Step Start: Capture the Start Time
32
+
33
+ This skill **creates** task.md, so there is no file to write at the start. Capture `started_at` in memory before running (`date "+%Y-%m-%d %H:%M:%S%:z"`); when writing the Activity Log at the end, **append both lines at once** — the started line uses `started_at`, the done line uses the completion time, both sharing the base action (started line action gets a ` [started]` suffix, note `started`):
34
+
35
+ ```
36
+ - {started_at} — **Create Task [started]** by {agent} — started
37
+ - {done_at} — **Create Task** by {agent} — {completion summary}
38
+ ```
39
+
40
+ `ai task log` pairs the two by base action onto one row (in progress → done). See the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
41
+
29
42
  ## Steps
30
43
 
31
44
  ### 1. Parse the User Description
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: create-task
3
- description: "根据自然语言描述创建任务"
3
+ description: >
4
+ 根据自然语言描述创建任务。
5
+ 当想把一段自然语言的想法或需求落为受跟踪的任务时使用。
4
6
  ---
5
7
 
6
8
  # 创建任务
@@ -26,6 +28,17 @@ description: "根据自然语言描述创建任务"
26
28
 
27
29
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
28
30
 
31
+ ## 步骤开始:记录开始时间
32
+
33
+ 本技能会**创建** task.md,开始时尚无文件可写。先在内存记录开始时间 `started_at`(`date "+%Y-%m-%d %H:%M:%S%:z"`);在最后写活动日志时**一次性补两条**——started 行用 `started_at`、done 行用完成时间,二者同基名(started 行 action 加 ` [started]` 后缀、note 用 `started`):
34
+
35
+ ```
36
+ - {started_at} — **Create Task [started]** by {agent} — started
37
+ - {done_at} — **Create Task** by {agent} — {完成说明}
38
+ ```
39
+
40
+ `ai task log` 会按基名把两条配对成一行(进行中 → 已完成)。约定见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
41
+
29
42
  ## 执行步骤
30
43
  ### 1. 解析用户描述
31
44
 
@@ -172,7 +185,7 @@ node .agents/scripts/validate-artifact.js gate create-task .agents/workspace/act
172
185
 
173
186
  下一步 - 执行需求分析:
174
187
  - Claude Code / OpenCode:/analyze-task {task-ref}
175
- - Gemini CLI:/{{project}}:analyze-task {task-ref}
188
+ - Gemini CLI:/agent-infra:analyze-task {task-ref}
176
189
  - Codex CLI:$analyze-task {task-ref}
177
190
  ```
178
191
 
@@ -191,7 +204,7 @@ node .agents/scripts/validate-artifact.js gate create-task .agents/workspace/act
191
204
 
192
205
  下一步 - 执行需求分析:
193
206
  - Claude Code / OpenCode:/analyze-task {task-ref}
194
- - Gemini CLI:/{{project}}:analyze-task {task-ref}
207
+ - Gemini CLI:/agent-infra:analyze-task {task-ref}
195
208
  - Codex CLI:$analyze-task {task-ref}
196
209
  ```
197
210
 
@@ -215,7 +228,7 @@ Issue 创建失败:
215
228
 
216
229
  下一步 - 执行需求分析:
217
230
  - Claude Code / OpenCode:/analyze-task {task-ref}
218
- - Gemini CLI:/{{project}}:analyze-task {task-ref}
231
+ - Gemini CLI:/agent-infra:analyze-task {task-ref}
219
232
  - Codex CLI:$analyze-task {task-ref}
220
233
 
221
234
  后续如需平台同步:修复认证/网络/模板问题后,可按 `.agents/rules/create-issue.md` 对当前任务手动执行一次 Issue 创建;或手动创建/查找 Issue,并把 `issue_number` 写入 task.md,后续技能会接管级联同步。
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: import-codescan
3
- description: "Import a Code Scanning alert and create a remediation task"
3
+ description: >
4
+ Import a Code Scanning alert and create a remediation task.
5
+ Use when a Code Scanning alert needs to become a tracked remediation task.
4
6
  ---
5
7
 
6
8
  # Import Code Scanning Alert
@@ -17,6 +19,17 @@ Import the specified Code Scanning (CodeQL) alert and create a remediation task.
17
19
 
18
20
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
19
21
 
22
+ ## Step Start: Capture the Start Time
23
+
24
+ This skill **creates** task.md, so there is no file to write at the start. Capture `started_at` in memory before running (`date "+%Y-%m-%d %H:%M:%S%:z"`); when writing the Activity Log at the end, **append both lines at once** — the started line uses `started_at`, the done line uses the completion time, both sharing the base action (started line action gets a ` [started]` suffix, note `started`):
25
+
26
+ ```
27
+ - {started_at} — **Import Codescan [started]** by {agent} — started
28
+ - {done_at} — **Import Codescan** by {agent} — {completion summary}
29
+ ```
30
+
31
+ `ai task log` pairs the two by base action onto one row (in progress → done). See the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
32
+
20
33
  ## Execution Flow
21
34
 
22
35
  ### 1. Retrieve Alert Information
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: import-codescan
3
- description: "导入 Code Scanning 告警并创建修复任务"
3
+ description: >
4
+ 导入 Code Scanning 告警并创建修复任务。
5
+ 当某条 Code Scanning 告警需要转为受跟踪的修复任务时使用。
4
6
  ---
5
7
 
6
8
  # 导入 Code Scanning 告警
@@ -17,6 +19,17 @@ description: "导入 Code Scanning 告警并创建修复任务"
17
19
 
18
20
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
19
21
 
22
+ ## 步骤开始:记录开始时间
23
+
24
+ 本技能会**创建** task.md,开始时尚无文件可写。先在内存记录开始时间 `started_at`(`date "+%Y-%m-%d %H:%M:%S%:z"`);在最后写活动日志时**一次性补两条**——started 行用 `started_at`、done 行用完成时间,二者同基名(started 行 action 加 ` [started]` 后缀、note 用 `started`):
25
+
26
+ ```
27
+ - {started_at} — **Import Codescan [started]** by {agent} — started
28
+ - {done_at} — **Import Codescan** by {agent} — {完成说明}
29
+ ```
30
+
31
+ `ai task log` 会按基名把两条配对成一行(进行中 → 已完成)。约定见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
32
+
20
33
  ## 执行流程
21
34
 
22
35
  ### 1. 获取告警信息
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: import-dependabot
3
- description: "Import a Dependabot alert and create a remediation task"
3
+ description: >
4
+ Import a Dependabot alert and create a remediation task.
5
+ Use when a Dependabot alert needs to become a tracked remediation task.
4
6
  ---
5
7
 
6
8
  # Import Dependabot Security Alert
@@ -17,6 +19,17 @@ Import the specified Dependabot security alert and create a remediation task.
17
19
 
18
20
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
19
21
 
22
+ ## Step Start: Capture the Start Time
23
+
24
+ This skill **creates** task.md, so there is no file to write at the start. Capture `started_at` in memory before running (`date "+%Y-%m-%d %H:%M:%S%:z"`); when writing the Activity Log at the end, **append both lines at once** — the started line uses `started_at`, the done line uses the completion time, both sharing the base action (started line action gets a ` [started]` suffix, note `started`):
25
+
26
+ ```
27
+ - {started_at} — **Import Dependabot [started]** by {agent} — started
28
+ - {done_at} — **Import Dependabot** by {agent} — {completion summary}
29
+ ```
30
+
31
+ `ai task log` pairs the two by base action onto one row (in progress → done). See the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
32
+
20
33
  ## Execution Flow
21
34
 
22
35
  ### 1. Retrieve Alert Information
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: import-dependabot
3
- description: "导入 Dependabot 安全告警并创建修复任务"
3
+ description: >
4
+ 导入 Dependabot 安全告警并创建修复任务。
5
+ 当某条 Dependabot 安全告警需要转为受跟踪的修复任务时使用。
4
6
  ---
5
7
 
6
8
  # 导入 Dependabot 安全告警
@@ -17,6 +19,17 @@ description: "导入 Dependabot 安全告警并创建修复任务"
17
19
 
18
20
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
19
21
 
22
+ ## 步骤开始:记录开始时间
23
+
24
+ 本技能会**创建** task.md,开始时尚无文件可写。先在内存记录开始时间 `started_at`(`date "+%Y-%m-%d %H:%M:%S%:z"`);在最后写活动日志时**一次性补两条**——started 行用 `started_at`、done 行用完成时间,二者同基名(started 行 action 加 ` [started]` 后缀、note 用 `started`):
25
+
26
+ ```
27
+ - {started_at} — **Import Dependabot [started]** by {agent} — started
28
+ - {done_at} — **Import Dependabot** by {agent} — {完成说明}
29
+ ```
30
+
31
+ `ai task log` 会按基名把两条配对成一行(进行中 → 已完成)。约定见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
32
+
20
33
  ## 执行流程
21
34
 
22
35
  ### 1. 获取告警信息
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: import-issue
3
- description: "Import an Issue and create a task"
3
+ description: >
4
+ Import an Issue and create a task.
5
+ Use when you want to start work from an existing Issue and track it locally.
4
6
  ---
5
7
 
6
8
  # Import Issue
@@ -17,6 +19,22 @@ Import the specified Issue and create a task. Argument: issue number.
17
19
 
18
20
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
19
21
 
22
+ ## Step Start: Capture the Start Time
23
+
24
+ This skill **creates** task.md, so there is no file to write at the start. Capture `started_at` in memory before running (`date "+%Y-%m-%d %H:%M:%S%:z"`); when writing the Activity Log at the end, **append both lines at once** — the started line uses `started_at`, the done line uses the completion time, both sharing the base action (started line action gets a ` [started]` suffix, note `started`). The base action must match the actual import scenario:
25
+
26
+ ```
27
+ # Scenario B: new Issue import
28
+ - {started_at} — **Import Issue [started]** by {agent} — started
29
+ - {done_at} — **Import Issue** by {agent} — {completion summary}
30
+
31
+ # Scenario C: recovery from historical Issue comments
32
+ - {started_at} — **Import Issue (Recovered) [started]** by {agent} — started
33
+ - {done_at} — **Import Issue (Recovered)** by {agent} — {completion summary}
34
+ ```
35
+
36
+ `ai task log` pairs the two by base action onto one row (in progress → done). See the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
37
+
20
38
  ## Execution Flow
21
39
 
22
40
  ### 1. Retrieve Issue Information
@@ -24,7 +42,22 @@ Import the specified Issue and create a task. Argument: issue number.
24
42
  Read `.agents/rules/issue-pr-commands.md` first, follow its prerequisite steps to complete authentication and code-hosting platform detection, then load the Issue data with its "Read an Issue" command.
25
43
 
26
44
  Extract: issue number, title, description, and labels.
27
- Use the Issue title as-is for the task title (preserve the Issue's original language).
45
+
46
+ Derive the task title from the Issue title by stripping an optional single leading Conventional Commits prefix, following the contract below; preserve the rest of the description verbatim and in its original language. This fenced contract is the authoritative, language-neutral rule — keep it byte-for-byte identical across every `import-issue` variant:
47
+
48
+ ```
49
+ # title-derivation-contract
50
+ strip-prefix: type(scope):
51
+ prefix-types: feat fix docs style refactor perf test build ci chore revert
52
+ single-layer-only: true
53
+ preserve-body-colon: true
54
+ keep-when-no-prefix: true
55
+ example-strip: "feat(meta): create-pr summary" => "create-pr summary"
56
+ example-keep: "修复某问题" => "修复某问题"
57
+ example-single-layer: "feat: add A: B" => "add A: B"
58
+ ```
59
+
60
+ Strip only the first layer, and only when the leading token is a `prefix-types` value optionally followed by `(scope)` and a `!`, then `:` and at least one space; a colon inside the description is never a prefix.
28
61
 
29
62
  ### 2. Check for an Existing Task
30
63
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: import-issue
3
- description: "从 Issue 导入并创建任务"
3
+ description: >
4
+ 从 Issue 导入并创建任务。
5
+ 当想从既有 Issue 开工并在本地跟踪时使用。
4
6
  ---
5
7
 
6
8
  # 导入 Issue
@@ -17,6 +19,22 @@ description: "从 Issue 导入并创建任务"
17
19
 
18
20
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
19
21
 
22
+ ## 步骤开始:记录开始时间
23
+
24
+ 本技能会**创建** task.md,开始时尚无文件可写。先在内存记录开始时间 `started_at`(`date "+%Y-%m-%d %H:%M:%S%:z"`);在最后写活动日志时**一次性补两条**——started 行用 `started_at`、done 行用完成时间,二者同基名(started 行 action 加 ` [started]` 后缀、note 用 `started`)。基名必须跟实际导入场景一致:
25
+
26
+ ```
27
+ # 场景 B:新 Issue 导入
28
+ - {started_at} — **Import Issue [started]** by {agent} — started
29
+ - {done_at} — **Import Issue** by {agent} — {完成说明}
30
+
31
+ # 场景 C:从历史 Issue 评论恢复
32
+ - {started_at} — **Import Issue (Recovered) [started]** by {agent} — started
33
+ - {done_at} — **Import Issue (Recovered)** by {agent} — {完成说明}
34
+ ```
35
+
36
+ `ai task log` 会按基名把两条配对成一行(进行中 → 已完成)。约定见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
37
+
20
38
  ## 执行流程
21
39
 
22
40
  ### 1. 获取 Issue 信息
@@ -24,7 +42,22 @@ description: "从 Issue 导入并创建任务"
24
42
  执行前先读取 `.agents/rules/issue-pr-commands.md`,并按其中的前置步骤完成认证和代码托管平台检测;随后按其中的 “读取 Issue” 命令获取 Issue 信息。
25
43
 
26
44
  提取:issue 编号、标题、描述、标签。
27
- 任务标题直接使用 Issue 的原始标题(保持 Issue 标题的原始语言)。
45
+
46
+ 从 Issue 标题派生任务标题:按下方契约剥掉可选的单层前导 Conventional Commits 前缀,其余描述原文与原始语言保持不变。下方 fenced 契约是权威的、与语言无关的规则——在所有 `import-issue` 变体中保持逐字节一致:
47
+
48
+ ```
49
+ # title-derivation-contract
50
+ strip-prefix: type(scope):
51
+ prefix-types: feat fix docs style refactor perf test build ci chore revert
52
+ single-layer-only: true
53
+ preserve-body-colon: true
54
+ keep-when-no-prefix: true
55
+ example-strip: "feat(meta): create-pr summary" => "create-pr summary"
56
+ example-keep: "修复某问题" => "修复某问题"
57
+ example-single-layer: "feat: add A: B" => "add A: B"
58
+ ```
59
+
60
+ 只剥第一层前缀,且仅当前导 token 是 `prefix-types` 之一、其后可带 `(scope)` 与 `!`,再接 `:` 和至少一个空格;描述正文中的冒号永远不算前缀。
28
61
 
29
62
  ### 2. 检查已有任务
30
63
 
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: init-labels
3
- description: "Initialize the repository's standard labels taxonomy"
3
+ description: >
4
+ Initialize the repository's standard labels taxonomy.
5
+ Use when setting up a repository and you need the standard label taxonomy created.
4
6
  ---
5
7
 
6
8
  # Initialize labels
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: init-labels
3
- description: "初始化仓库的 labels 体系"
3
+ description: >
4
+ 初始化仓库的 labels 体系。
5
+ 当初始化仓库、需要创建标准 label 体系时使用。
4
6
  ---
5
7
 
6
8
  # 初始化 labels
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: init-milestones
3
- description: "Initialize the repository's standard milestones taxonomy"
3
+ description: >
4
+ Initialize the repository's standard milestones taxonomy.
5
+ Use when setting up a repository and you need the standard milestone taxonomy created.
4
6
  ---
5
7
 
6
8
  # Initialize milestones
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: init-milestones
3
- description: "初始化仓库的 milestones 体系"
3
+ description: >
4
+ 初始化仓库的 milestones 体系。
5
+ 当初始化仓库、需要创建标准 milestone 体系时使用。
4
6
  ---
5
7
 
6
8
  # 初始化 milestones
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: plan-task
3
- description: "Design a technical plan for a task"
3
+ description: >
4
+ Design a technical plan for a task.
5
+ Use when a requirement is understood and you need a technical design before coding.
4
6
  ---
5
7
 
6
8
  # Design Technical Plan
@@ -31,6 +33,16 @@ Before the state check is complete, do not make external-state assertions such a
31
33
 
32
34
  > If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
33
35
 
36
+ ## Step Start: Write the started Marker
37
+
38
+ After prerequisites pass and before this round's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this round's done entry plus a ` [started]` suffix, note `started`):
39
+
40
+ ```
41
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Task (Round {N}) [started]** by {agent} — started
42
+ ```
43
+
44
+ `ai task log` pairs it with the done entry written on completion (step 7) onto one row (in progress → done). Format and pairing rules: see the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
45
+
34
46
  ## Steps
35
47
 
36
48
  ### 1. Verify Prerequisites
@@ -87,6 +99,8 @@ Follow the `technical-design` step in `.agents/workflows/feature-development.yam
87
99
  - [ ] Define the verification strategy (tests, manual checks)
88
100
  - [ ] Assess impact and risks
89
101
 
102
+ When this round introduces a new key design decision, record it under `## Open Questions` according to `.agents/rules/no-mid-flow-questions.md` and write the matching `HD-` ledger row.
103
+
90
104
  **Design principles**:
91
105
  1. **Architectural soundness**: choose the structurally correct approach; diff size is not the primary criterion. Do not pile changes onto an unsound structure just to keep the diff small
92
106
  2. **Simplicity**: given a sound architecture, prefer the simplest approach and avoid over-engineering
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: plan-task
3
- description: "为任务设计技术方案和实施计划"
3
+ description: >
4
+ 为任务设计技术方案和实施计划。
5
+ 当需求已明确、需要在编码前形成技术方案时使用。
4
6
  ---
5
7
 
6
8
  # 设计技术方案
@@ -31,6 +33,16 @@ tail .agents/workspace/active/{task-id}/task.md
31
33
 
32
34
  > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
33
35
 
36
+ ## 步骤开始:写入 started 标记
37
+
38
+ 确认前置条件后、本轮第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本轮 done 条目同基名 + ` [started]` 后缀,note 用 `started`):
39
+
40
+ ```
41
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Plan Task (Round {N}) [started]** by {agent} — started
42
+ ```
43
+
44
+ `ai task log` 会把它与步骤完成时(步骤 7)写入的 done 条目配对成一行(进行中 → 已完成)。格式与配对规则见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
45
+
34
46
  ## 执行步骤
35
47
  ### 1. 验证前置条件
36
48
 
@@ -86,6 +98,8 @@ tail .agents/workspace/active/{task-id}/task.md
86
98
  - [ ] 定义验证策略(测试、手动检查)
87
99
  - [ ] 评估方案的影响和风险
88
100
 
101
+ 遇到本轮新增的关键设计决策时,按 `.agents/rules/no-mid-flow-questions.md` 判据写入 `## 未决问题`,并回写 `HD-` 账本行。
102
+
89
103
  **设计原则**:
90
104
  1. **架构合理性**:选择结构正确的方案,改动大小不是首要依据。不要为了减少 diff 而在不合理的结构上叠加
91
105
  2. **简洁性**:在架构合理的前提下,优先选择最简方案,避免过度设计
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: post-release
3
- description: "Run post-release follow-up tasks"
3
+ description: >
4
+ Run post-release follow-up tasks.
5
+ Use when a release has shipped and follow-up housekeeping is needed.
4
6
  ---
5
7
 
6
8
  # Post-release Tasks
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: post-release
3
- description: "执行版本发布后的后处理工作"
3
+ description: >
4
+ 执行版本发布后的后处理工作。
5
+ 当版本已发布、需要执行发版后的收尾工作时使用。
4
6
  ---
5
7
 
6
8
  # 发布后处理
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: refine-title
3
- description: "Rewrite an Issue or PR title in Conventional Commits format"
3
+ description: >
4
+ Rewrite an Issue or PR title in Conventional Commits format.
5
+ Use when an Issue or PR title needs rewriting into Conventional Commits format.
4
6
  ---
5
7
 
6
8
  # Refine Title
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: refine-title
3
- description: "重构 Issue/PR 标题为 Conventional Commits 格式"
3
+ description: >
4
+ 重构 Issue/PR 标题为 Conventional Commits 格式。
5
+ 当某个 Issue/PR 标题需要改写为 Conventional Commits 格式时使用。
4
6
  ---
5
7
 
6
8
  # 重构标题
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: release
3
- description: "Run the version release workflow"
3
+ description: >
4
+ Run the version release workflow.
5
+ Use when you are ready to cut and publish a new version.
4
6
  ---
5
7
 
6
8
  # Version Release