@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
@@ -33,12 +33,13 @@ description: >
33
33
 
34
34
  如果描述不清晰,**先向用户确认**再继续。
35
35
 
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`
36
+ **类型推断**:根据任务描述的语义,从以下候选值中选择最匹配的类型:
37
+
38
+ - `feature` 新增功能、新特性
39
+ - `bugfix` 修复缺陷、错误
40
+ - `refactor` 重构、优化、改进
41
+ - `docs` 文档相关
42
+ - `chore` — 其他杂项任务
42
43
 
43
44
  **工作流映射**:
44
45
  - `feature` / `docs` / `chore` -> `feature-development`
@@ -53,7 +54,7 @@ description: >
53
54
  date +%Y%m%d-%H%M%S
54
55
  ```
55
56
 
56
- - 创建任务目录:`.agent-workspace/active/TASK-{yyyyMMdd-HHmmss}/`
57
+ - 创建任务目录:`.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
57
58
  - 使用 `.agents/templates/task.md` 模板创建任务文件:`task.md`
58
59
 
59
60
  **重要**:
@@ -84,7 +85,7 @@ assigned_to: {当前 AI 代理}
84
85
  date "+%Y-%m-%d %H:%M:%S"
85
86
  ```
86
87
 
87
- 更新 `.agent-workspace/active/{task-id}/task.md`:
88
+ 更新 `.agents/workspace/active/{task-id}/task.md`:
88
89
  - `current_step`:requirement-analysis
89
90
  - `assigned_to`:{当前 AI 代理}
90
91
  - `updated_at`:{当前时间}
@@ -108,7 +109,7 @@ date "+%Y-%m-%d %H:%M:%S"
108
109
  - 工作流:{workflow}
109
110
 
110
111
  产出文件:
111
- - 任务文件:.agent-workspace/active/{task-id}/task.md
112
+ - 任务文件:.agents/workspace/active/{task-id}/task.md
112
113
 
113
114
  下一步 - 执行需求分析:
114
115
  - Claude Code / OpenCode:/analyze-task {task-id}
@@ -118,7 +119,7 @@ date "+%Y-%m-%d %H:%M:%S"
118
119
 
119
120
  ## 完成检查清单
120
121
 
121
- - [ ] 创建了任务文件 `.agent-workspace/active/{task-id}/task.md`
122
+ - [ ] 创建了任务文件 `.agents/workspace/active/{task-id}/task.md`
122
123
  - [ ] 更新了 task.md 中的 `current_step` 为 requirement-analysis
123
124
  - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
124
125
  - [ ] 更新了 task.md 中的 `assigned_to`
@@ -21,7 +21,7 @@ description: >
21
21
  ### 1. Verify Prerequisites
22
22
 
23
23
  Check required files:
24
- - `.agent-workspace/active/{task-id}/task.md` - Task file
24
+ - `.agents/workspace/active/{task-id}/task.md` - Task file
25
25
  - At least one technical plan artifact: `plan.md` or `plan-r{N}.md`
26
26
 
27
27
  Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, e.g. `TASK-20260306-143022`
@@ -30,10 +30,10 @@ If either file is missing, prompt the user to complete the prerequisite step fir
30
30
 
31
31
  ### 2. Determine the Input Plan and Implementation Round
32
32
 
33
- Scan `.agent-workspace/active/{task-id}/` for technical plan files (`plan.md`, `plan-r{N}.md`):
33
+ Scan `.agents/workspace/active/{task-id}/` for technical plan files (`plan.md`, `plan-r{N}.md`):
34
34
  - Read the highest-round plan file and record it as `{plan-artifact}`
35
35
 
36
- Scan `.agent-workspace/active/{task-id}/` for implementation report files:
36
+ Scan `.agents/workspace/active/{task-id}/` for implementation report files:
37
37
  - If neither `implementation.md` nor `implementation-r*.md` exists -> this is Round 1 and must create `implementation.md`
38
38
  - If `implementation.md` exists and no `implementation-r*.md` exists -> this is Round 2 and must create `implementation-r2.md`
39
39
  - If `implementation-r{N}.md` exists -> this is Round N+1 and must create `implementation-r{N+1}.md`
@@ -71,7 +71,7 @@ Follow the `implementation` step in `.agents/workflows/feature-development.yaml`
71
71
  3. **Test continuously**: Run tests after completing each step
72
72
  4. **Keep it simple**: Do not over-engineer or add unplanned features
73
73
 
74
- ### 5. Run Test Verification (Failure Must Stop the Flow)
74
+ ### 5. Run Test Verification
75
75
 
76
76
  Execute the project's test command. Reference the `test` skill for the project-specific test command:
77
77
 
@@ -84,19 +84,16 @@ Execute the project's test command. Reference the `test` skill for the project-s
84
84
  # go test ./... (Go)
85
85
  ```
86
86
 
87
- > **⚠️ Failure Branch — if tests fail, you must immediately take the failure path:**
88
- >
89
- > - Output a summary of the test errors
90
- > - Ask the user whether to continue
91
- > - Stop immediately: do not create the implementation report, do not mark task.md as implementation-complete, and do not output the Step 8 "Implementation complete for task {task-id}." template
92
- >
93
- > **You may continue to Steps 6, 7, and 8 only when all tests pass.**
87
+ If tests fail:
88
+ - Analyze the failure first, and prioritize fixing problems introduced by the current implementation, plus any test or documentation updates required to match the approved plan
89
+ - Re-run the tests after each fix until they pass, or until you confirm the remaining issue is an external blocker outside the current task scope
90
+ - Only stop when the failure is blocked by external dependencies, missing environment, or unclear requirements that cannot be resolved within the task; in that case, report the blocker and do not create the implementation report, update task.md as implementation-complete, or output the Step 8 completion template
94
91
 
95
- Ensure all tests pass. Proceed to Steps 6, 7, and 8 only when the entire test suite passes.
92
+ Proceed to Steps 6, 7, and 8 only after the full test suite passes.
96
93
 
97
94
  ### 6. Output Implementation Report
98
95
 
99
- Create `.agent-workspace/active/{task-id}/{implementation-artifact}`.
96
+ Create `.agents/workspace/active/{task-id}/{implementation-artifact}`.
100
97
 
101
98
  Requirements:
102
99
  - Do not overwrite any existing implementation report
@@ -111,7 +108,7 @@ Get the current time:
111
108
  date "+%Y-%m-%d %H:%M:%S"
112
109
  ```
113
110
 
114
- Update `.agent-workspace/active/{task-id}/task.md`:
111
+ Update `.agents/workspace/active/{task-id}/task.md`:
115
112
  - `current_step`: implementation
116
113
  - `assigned_to`: {current AI agent}
117
114
  - `updated_at`: {current time}
@@ -136,7 +133,7 @@ Summary:
136
133
  - Tests passed: {count}/{total}
137
134
 
138
135
  Output file:
139
- - Implementation report: .agent-workspace/active/{task-id}/{implementation-artifact} (Round {implementation-round})
136
+ - Implementation report: .agents/workspace/active/{task-id}/{implementation-artifact} (Round {implementation-round})
140
137
 
141
138
  Next step - code review:
142
139
  - Claude Code / OpenCode: /review-task {task-id}
@@ -207,7 +204,7 @@ Next step - code review:
207
204
  ## Completion Checklist
208
205
 
209
206
  - [ ] Completed all code implementation
210
- - [ ] Created implementation report `.agent-workspace/active/{task-id}/{implementation-artifact}`
207
+ - [ ] Created implementation report `.agents/workspace/active/{task-id}/{implementation-artifact}`
211
208
  - [ ] All tests pass
212
209
  - [ ] Updated `current_step` to implementation in task.md
213
210
  - [ ] Updated `updated_at` to current time in task.md
@@ -224,7 +221,7 @@ After completing the checklist, **stop**. Do not auto-commit. Wait for code revi
224
221
 
225
222
  1. **Prerequisites**: Must have a reviewed technical plan (`plan.md` or `plan-r{N}.md` exists and is approved)
226
223
  2. **No auto-commit**: Do NOT execute `git commit` or `git add` automatically. Remind the user to commit manually
227
- 3. **Test requirement**: All new code must have unit tests; test coverage must not decrease
224
+ 3. **Test requirement**: All new code must have unit tests; test coverage must not decrease. When removing a feature, delete the test fixtures and assertions that existed solely for that feature — do not mechanically flip assertions; every assertion must verify meaningful business logic, not merely confirm that data passes through unchanged
228
225
  4. **Code quality**: Follow project coding standards
229
226
  5. **Plan deviation**: If you need to deviate from the plan, document the reason in the implementation report
230
227
  6. **Versioning rule**: First-round implementation uses `implementation.md`; later re-implementations use `implementation-r{N}.md`
@@ -233,5 +230,5 @@ After completing the checklist, **stop**. Do not auto-commit. Wait for code revi
233
230
 
234
231
  - Task not found: Prompt "Task {task-id} not found"
235
232
  - Missing plan: Prompt "Technical plan not found, please run the plan-task skill first"
236
- - Test failure: Output test errors, ask user whether to continue, and stop immediately without creating the implementation report or outputting "Implementation complete for task {task-id}."
233
+ - Test failure: Attempt to fix the issue and re-run tests first; stop only when an external blocker, missing environment, or unclear requirement prevents completion, and report that blocker
237
234
  - Build failure: Output build errors, stop implementation
@@ -19,7 +19,7 @@ description: >
19
19
  ### 1. 验证前置条件
20
20
 
21
21
  检查必要文件:
22
- - `.agent-workspace/active/{task-id}/task.md` - 任务文件
22
+ - `.agents/workspace/active/{task-id}/task.md` - 任务文件
23
23
  - 至少一个技术方案产物:`plan.md` 或 `plan-r{N}.md`
24
24
 
25
25
  注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
@@ -28,10 +28,10 @@ description: >
28
28
 
29
29
  ### 2. 确定输入方案与实现轮次
30
30
 
31
- 扫描 `.agent-workspace/active/{task-id}/` 目录中的技术方案文件(`plan.md`、`plan-r{N}.md`):
31
+ 扫描 `.agents/workspace/active/{task-id}/` 目录中的技术方案文件(`plan.md`、`plan-r{N}.md`):
32
32
  - 读取最高轮次的方案文件,记为 `{plan-artifact}`
33
33
 
34
- 扫描 `.agent-workspace/active/{task-id}/` 目录中的实现报告文件:
34
+ 扫描 `.agents/workspace/active/{task-id}/` 目录中的实现报告文件:
35
35
  - 如果不存在 `implementation.md` 且不存在 `implementation-r*.md` → 本轮为第 1 轮,产出 `implementation.md`
36
36
  - 如果存在 `implementation.md` 且不存在 `implementation-r*.md` → 本轮为第 2 轮,产出 `implementation-r2.md`
37
37
  - 如果存在 `implementation-r{N}.md` → 本轮为第 N+1 轮,产出 `implementation-r{N+1}.md`
@@ -69,7 +69,7 @@ description: >
69
69
  3. **持续测试**:每完成一个步骤后运行测试
70
70
  4. **保持简单**:不过度设计,不添加计划外的功能
71
71
 
72
- ### 5. 运行测试验证(失败时必须停止)
72
+ ### 5. 运行测试验证
73
73
 
74
74
  执行项目的测试命令。参考 `test` 技能获取项目特定的测试命令:
75
75
 
@@ -82,19 +82,16 @@ description: >
82
82
  # go test ./... (Go)
83
83
  ```
84
84
 
85
- > **⚠️ 失败分支 — 如果测试失败,你必须立即走失败分支:**
86
- >
87
- > - 输出测试错误摘要
88
- > - 询问用户是否继续处理
89
- > - 立即停止,不创建实现报告,不更新 task.md 为实现完成,也不要输出步骤 8 的「任务 {task-id} 实现完成。」模板
90
- >
91
- > **只有测试全部通过时,才可以继续步骤 6、7 和 8。**
85
+ 如果测试失败:
86
+ - 先分析失败原因,优先修复由本次实现引入的问题,以及为匹配已批准方案而需要同步调整的测试或文档
87
+ - 修复后重新运行测试,直到测试通过,或明确确认存在超出当前任务范围的外部阻塞
88
+ - 仅当问题属于外部阻塞、环境缺失或需求不明确且无法在当前任务内解决时,才向用户报告阻塞并停止;此时不要创建实现报告,不要更新 task.md 为实现完成,也不要输出步骤 8 的完成模板
92
89
 
93
- 确保所有测试通过。只有全部通过时,才可以继续步骤 6、7 和 8。
90
+ 只有全部测试通过后,才可以继续步骤 6、7 和 8。
94
91
 
95
92
  ### 6. 输出实现报告
96
93
 
97
- 创建 `.agent-workspace/active/{task-id}/{implementation-artifact}`。
94
+ 创建 `.agents/workspace/active/{task-id}/{implementation-artifact}`。
98
95
 
99
96
  要求:
100
97
  - 不要覆盖已有的实现报告
@@ -109,7 +106,7 @@ description: >
109
106
  date "+%Y-%m-%d %H:%M:%S"
110
107
  ```
111
108
 
112
- 更新 `.agent-workspace/active/{task-id}/task.md`:
109
+ 更新 `.agents/workspace/active/{task-id}/task.md`:
113
110
  - `current_step`:implementation
114
111
  - `assigned_to`:{当前 AI 代理}
115
112
  - `updated_at`:{当前时间}
@@ -134,7 +131,7 @@ date "+%Y-%m-%d %H:%M:%S"
134
131
  - 测试通过:{数量}/{总数}
135
132
 
136
133
  产出文件:
137
- - 实现报告:.agent-workspace/active/{task-id}/{implementation-artifact}(Round {implementation-round})
134
+ - 实现报告:.agents/workspace/active/{task-id}/{implementation-artifact}(Round {implementation-round})
138
135
 
139
136
  下一步 - 代码审查:
140
137
  - Claude Code / OpenCode:/review-task {task-id}
@@ -205,7 +202,7 @@ date "+%Y-%m-%d %H:%M:%S"
205
202
  ## 完成检查清单
206
203
 
207
204
  - [ ] 完成了所有代码实现
208
- - [ ] 创建了实现报告 `.agent-workspace/active/{task-id}/{implementation-artifact}`
205
+ - [ ] 创建了实现报告 `.agents/workspace/active/{task-id}/{implementation-artifact}`
209
206
  - [ ] 所有测试通过
210
207
  - [ ] 更新了 task.md 中的 `current_step` 为 implementation
211
208
  - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
@@ -222,7 +219,7 @@ date "+%Y-%m-%d %H:%M:%S"
222
219
 
223
220
  1. **前置条件**:必须有已审查的技术方案(`plan.md` 或 `plan-r{N}.md` 存在且已获批准)
224
221
  2. **禁止自动提交**:不要自动执行 `git commit` 或 `git add`。提醒用户手动提交
225
- 3. **测试要求**:所有新代码必须有单元测试;测试覆盖率不得下降
222
+ 3. **测试要求**:所有新代码必须有单元测试;测试覆盖率不得下降。删除功能时,必须同时删除为该功能而存在的测试 fixture 和断言,不要机械地翻转断言方向;每条断言都应验证有意义的业务逻辑,仅确认数据原样通过的断言不构成有效测试
226
223
  4. **代码质量**:遵循项目编码规范
227
224
  5. **计划偏离**:如果需要偏离计划,在实现报告中记录原因
228
225
  6. **版本化规则**:首轮实现使用 `implementation.md`;后续重实现使用 `implementation-r{N}.md`
@@ -231,5 +228,5 @@ date "+%Y-%m-%d %H:%M:%S"
231
228
 
232
229
  - 任务未找到:提示 "Task {task-id} not found"
233
230
  - 缺少计划:提示 "Technical plan not found, please run the plan-task skill first"
234
- - 测试失败:输出测试错误,询问用户是否继续;立即停止,不要创建实现报告,也不要输出 "任务 {task-id} 实现完成。"
231
+ - 测试失败:先尝试修复并重新运行测试;只有在存在外部阻塞、环境缺失或需求不明确时才停止,并输出阻塞原因
235
232
  - 构建失败:输出构建错误,停止实现
@@ -1,43 +1,44 @@
1
1
  ---
2
2
  name: import-codescan
3
3
  description: >
4
- 导入 Code ScanningCodeQL)告警并创建修复任务。
5
- 当用户要求导入 Code Scanning 告警时触发。参数:告警编号。
4
+ Import a Code Scanning (CodeQL) alert and create a remediation task.
5
+ Triggered when the user asks to import a Code Scanning alert.
6
+ Argument: alert number.
6
7
  ---
7
8
 
8
- # 导入 Code Scanning 告警
9
+ # Import Code Scanning Alert
9
10
 
10
- 导入指定的 Code ScanningCodeQL)告警并创建修复任务。
11
+ Import the specified Code Scanning (CodeQL) alert and create a remediation task.
11
12
 
12
- ## 行为边界 / 关键规则
13
+ ## Boundary / Critical Rules
13
14
 
14
- - 本技能仅负责导入告警并创建任务骨架 —— 不直接修改业务代码或关闭告警
15
- - 不要自动提交。绝不自动执行 `git commit` `git add`
16
- - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
15
+ - This skill only imports the alert and creates a task skeleton; it does not directly modify business code or dismiss the alert
16
+ - Do NOT auto-commit. Never execute `git commit` or `git add` automatically
17
+ - After executing this skill, you **must** immediately update task status in task.md
17
18
 
18
- ## 执行流程
19
+ ## Execution Flow
19
20
 
20
- ### 1. 获取告警信息
21
+ ### 1. Retrieve Alert Information
21
22
 
22
23
  ```bash
23
24
  gh api repos/{owner}/{repo}/code-scanning/alerts/<alert-number>
24
25
  ```
25
26
 
26
- 提取关键信息:
27
- - `number`:告警编号
28
- - `state`:状态(open/dismissed/fixed
29
- - `rule`:规则信息(idseveritydescriptionsecurity_severity_level
30
- - `tool`:扫描工具信息(nameversion
31
- - `most_recent_instance`:位置(pathstart_lineend_line)、消息
32
- - `html_url`:GitHub 告警链接
27
+ Extract key information:
28
+ - `number`: alert number
29
+ - `state`: state (`open` / `dismissed` / `fixed`)
30
+ - `rule`: rule information (`id`, `severity`, `description`, `security_severity_level`)
31
+ - `tool`: scanning tool information (`name`, `version`)
32
+ - `most_recent_instance`: location (`path`, `start_line`, `end_line`) and message
33
+ - `html_url`: GitHub alert link
33
34
 
34
- ### 2. 创建任务目录和文件
35
+ ### 2. Create the Task Directory and File
35
36
 
36
- 检查是否已存在该告警的任务。如果不存在,创建:
37
+ Check whether a task for this alert already exists. If not, create one:
37
38
 
38
- 目录:`.agent-workspace/active/TASK-{yyyyMMdd-HHmmss}/`
39
+ Directory: `.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
39
40
 
40
- 任务元数据:
41
+ Task metadata:
41
42
  ```yaml
42
43
  id: TASK-{yyyyMMdd-HHmmss}
43
44
  codescan_alert_number: <alert-number>
@@ -46,58 +47,58 @@ rule_id: <rule-id>
46
47
  tool: <tool-name>
47
48
  ```
48
49
 
49
- ### 3. 更新任务状态
50
+ ### 3. Update Task Status
50
51
 
51
- 获取当前时间:
52
+ Get the current time:
52
53
 
53
54
  ```bash
54
55
  date "+%Y-%m-%d %H:%M:%S"
55
56
  ```
56
57
 
57
- 更新 task.md:`current_step` -> `requirement-analysis`。
58
- - **追加**到 `## Activity Log`(不要覆盖之前的记录):
58
+ Update task.md: `current_step` -> `requirement-analysis`.
59
+ - **Append** to `## Activity Log` (do NOT overwrite previous entries):
59
60
  ```
60
61
  - {yyyy-MM-dd HH:mm:ss} — **Import Code Scanning Alert** by {agent} — Code Scanning alert #{alert-number} imported
61
62
  ```
62
63
 
63
- ### 4. 告知用户
64
+ ### 4. Inform User
64
65
 
65
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
66
+ > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
66
67
 
67
68
  ```
68
- Code Scanning 告警 #{alert-number} 已导入。
69
+ Code Scanning alert #{alert-number} imported.
69
70
 
70
- 告警信息:
71
- - 严重程度:{severity}
72
- - 规则:{rule-id}
73
- - 位置:{file-path}:{line-number}
71
+ Alert information:
72
+ - Severity: {severity}
73
+ - Rule: {rule-id}
74
+ - Location: {file-path}:{line-number}
74
75
 
75
- 任务信息:
76
- - 任务 ID{task-id}
76
+ Task information:
77
+ - Task ID: {task-id}
77
78
 
78
- 下一步:
79
- - Claude Code / OpenCode:/analyze-task {task-id}
80
- - Gemini CLI:/agent-infra:analyze-task {task-id}
81
- - Codex CLI:$analyze-task {task-id}
79
+ Next step:
80
+ - Claude Code / OpenCode: /analyze-task {task-id}
81
+ - Gemini CLI: /{{project}}:analyze-task {task-id}
82
+ - Codex CLI: $analyze-task {task-id}
82
83
  ```
83
84
 
84
- ## 注意事项
85
+ ## Notes
85
86
 
86
- 1. **严重程度优先级**:Critical/High -> 立即处理。Medium -> 计划处理。Low -> 可延后。
87
- 2. **范围**:本技能仅负责导入告警并创建任务;风险评估由 `analyze-task` 负责。
88
- 3. **后续动作**:导入后先执行 `analyze-task`,分析完成后再决定修复或关闭。
87
+ 1. **Severity priority**: Critical/High -> handle immediately. Medium -> schedule handling. Low -> can be deferred.
88
+ 2. **Scope**: this skill only imports the alert and creates the task; risk assessment is handled by `analyze-task`.
89
+ 3. **Follow-up**: after import, run `analyze-task` first, then decide whether to fix or dismiss.
89
90
 
90
- ## 完成检查清单
91
+ ## Completion Checklist
91
92
 
92
- - [ ] 获取并记录了告警关键信息
93
- - [ ] 创建或确认了对应的任务目录与任务文件
94
- - [ ] 更新了 task.md 中的 `current_step` requirement-analysis
95
- - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
96
- - [ ] 追加了 Activity Log 条目到 task.md
97
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
93
+ - [ ] Retrieved and recorded the key alert information
94
+ - [ ] Created or confirmed the corresponding task directory and task file
95
+ - [ ] Updated `current_step` to requirement-analysis in task.md
96
+ - [ ] Updated `updated_at` to the current time in task.md
97
+ - [ ] Appended an Activity Log entry to task.md
98
+ - [ ] Informed the user of the next step (must include all TUI command formats; do not filter)
98
99
 
99
- ## 错误处理
100
+ ## Error Handling
100
101
 
101
- - 告警未找到:提示 "Code Scanning alert #{number} not found"
102
- - 告警已关闭:询问用户是否继续分析
103
- - 网络/权限错误:提示相应信息
102
+ - Alert not found: output "Code Scanning alert #{number} not found"
103
+ - Alert already closed: ask the user whether to continue with analysis
104
+ - Network/permission error: output the corresponding error information
@@ -35,7 +35,7 @@ gh api repos/{owner}/{repo}/code-scanning/alerts/<alert-number>
35
35
 
36
36
  检查是否已存在该告警的任务。如果不存在,创建:
37
37
 
38
- 目录:`.agent-workspace/active/TASK-{yyyyMMdd-HHmmss}/`
38
+ 目录:`.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
39
39
 
40
40
  任务元数据:
41
41
  ```yaml
@@ -1,44 +1,45 @@
1
1
  ---
2
2
  name: import-dependabot
3
3
  description: >
4
- 导入 Dependabot 安全告警并创建修复任务。
5
- 当用户要求导入 Dependabot 告警时触发。参数:告警编号。
4
+ Import a Dependabot security alert and create a remediation task.
5
+ Triggered when the user asks to import a Dependabot alert.
6
+ Argument: alert number.
6
7
  ---
7
8
 
8
- # 导入 Dependabot 安全告警
9
+ # Import Dependabot Security Alert
9
10
 
10
- 导入指定的 Dependabot 安全告警并创建修复任务。
11
+ Import the specified Dependabot security alert and create a remediation task.
11
12
 
12
- ## 行为边界 / 关键规则
13
+ ## Boundary / Critical Rules
13
14
 
14
- - 本技能仅负责导入告警并创建任务骨架 —— 不直接修改业务代码或关闭告警
15
- - 不要自动提交。绝不自动执行 `git commit` `git add`
16
- - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
15
+ - This skill only imports the alert and creates a task skeleton; it does not directly modify business code or dismiss the alert
16
+ - Do NOT auto-commit. Never execute `git commit` or `git add` automatically
17
+ - After executing this skill, you **must** immediately update task status in task.md
17
18
 
18
- ## 执行流程
19
+ ## Execution Flow
19
20
 
20
- ### 1. 获取告警信息
21
+ ### 1. Retrieve Alert Information
21
22
 
22
23
  ```bash
23
24
  gh api repos/{owner}/{repo}/dependabot/alerts/<alert-number>
24
25
  ```
25
26
 
26
- 提取关键信息:
27
- - `number`:告警编号
28
- - `state`:状态(open/dismissed/fixed
29
- - `security_advisory`:安全公告详情(ghsa_idcve_idseveritysummarydescription
30
- - `dependency`:受影响的依赖(包名、生态系统、清单路径)
31
- - `security_vulnerability`:受影响版本范围、首个修复版本
27
+ Extract key information:
28
+ - `number`: alert number
29
+ - `state`: state (`open` / `dismissed` / `fixed`)
30
+ - `security_advisory`: advisory details (`ghsa_id`, `cve_id`, `severity`, `summary`, `description`)
31
+ - `dependency`: affected dependency (package name, ecosystem, manifest path)
32
+ - `security_vulnerability`: affected version range and first patched version
32
33
 
33
- ### 2. 创建任务目录和文件
34
+ ### 2. Create the Task Directory and File
34
35
 
35
- 检查 `.agent-workspace/active/` 中是否已存在该告警的任务。
36
- - 如果找到,询问用户是否重新导入
37
- - 如果未找到,创建新任务
36
+ Check whether `.agents/workspace/active/` already has a task for this alert.
37
+ - If found, ask the user whether to re-import
38
+ - If not found, create a new task
38
39
 
39
- 创建目录:`.agent-workspace/active/TASK-{yyyyMMdd-HHmmss}/`
40
+ Create directory: `.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
40
41
 
41
- 任务元数据需包含:
42
+ Task metadata must include:
42
43
  ```yaml
43
44
  id: TASK-{yyyyMMdd-HHmmss}
44
45
  security_alert_number: <alert-number>
@@ -47,61 +48,61 @@ cve_id: <CVE-ID>
47
48
  ghsa_id: <GHSA-ID>
48
49
  ```
49
50
 
50
- ### 3. 更新任务状态
51
+ ### 3. Update Task Status
51
52
 
52
- 获取当前时间:
53
+ Get the current time:
53
54
 
54
55
  ```bash
55
56
  date "+%Y-%m-%d %H:%M:%S"
56
57
  ```
57
58
 
58
- 更新 task.md:`current_step` -> `requirement-analysis`。
59
- - **追加**到 `## Activity Log`(不要覆盖之前的记录):
59
+ Update task.md: `current_step` -> `requirement-analysis`.
60
+ - **Append** to `## Activity Log` (do NOT overwrite previous entries):
60
61
  ```
61
62
  - {yyyy-MM-dd HH:mm:ss} — **Import Dependabot Alert** by {agent} — Dependabot alert #{alert-number} imported
62
63
  ```
63
64
 
64
- ### 4. 告知用户
65
+ ### 4. Inform User
65
66
 
66
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
67
+ > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
67
68
 
68
69
  ```
69
- 安全告警 #{alert-number} 已导入。
70
+ Security alert #{alert-number} imported.
70
71
 
71
- 漏洞信息:
72
- - 严重程度:{severity}
73
- - CVE/GHSA{cve-id} / {ghsa-id}
74
- - 受影响包:{package-name}
72
+ Vulnerability information:
73
+ - Severity: {severity}
74
+ - CVE/GHSA: {cve-id} / {ghsa-id}
75
+ - Affected package: {package-name}
75
76
 
76
- 任务信息:
77
- - 任务 ID{task-id}
77
+ Task information:
78
+ - Task ID: {task-id}
78
79
 
79
- 产出文件:
80
- - 任务文件:.agent-workspace/active/{task-id}/task.md
80
+ Output file:
81
+ - Task file: .agents/workspace/active/{task-id}/task.md
81
82
 
82
- 下一步:
83
- - Claude Code / OpenCode:/analyze-task {task-id}
84
- - Gemini CLI:/agent-infra:analyze-task {task-id}
85
- - Codex CLI:$analyze-task {task-id}
83
+ Next step:
84
+ - Claude Code / OpenCode: /analyze-task {task-id}
85
+ - Gemini CLI: /{{project}}:analyze-task {task-id}
86
+ - Codex CLI: $analyze-task {task-id}
86
87
  ```
87
88
 
88
- ## 注意事项
89
+ ## Notes
89
90
 
90
- 1. **严重程度优先级**:Critical/High -> 立即处理。Medium -> 计划处理。Low -> 可延后。
91
- 2. **范围**:本技能仅负责导入告警并创建任务;风险评估由 `analyze-task` 负责。
92
- 3. **后续动作**:导入后先执行 `analyze-task`,分析完成后再决定修复或关闭。
91
+ 1. **Severity priority**: Critical/High -> handle immediately. Medium -> schedule handling. Low -> can be deferred.
92
+ 2. **Scope**: this skill only imports the alert and creates the task; risk assessment is handled by `analyze-task`.
93
+ 3. **Follow-up**: after import, run `analyze-task` first, then decide whether to fix or dismiss.
93
94
 
94
- ## 完成检查清单
95
+ ## Completion Checklist
95
96
 
96
- - [ ] 获取并记录了告警关键信息
97
- - [ ] 创建或确认了对应的任务目录与任务文件
98
- - [ ] 更新了 task.md 中的 `current_step` requirement-analysis
99
- - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
100
- - [ ] 追加了 Activity Log 条目到 task.md
101
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
97
+ - [ ] Retrieved and recorded the key alert information
98
+ - [ ] Created or confirmed the corresponding task directory and task file
99
+ - [ ] Updated `current_step` to requirement-analysis in task.md
100
+ - [ ] Updated `updated_at` to the current time in task.md
101
+ - [ ] Appended an Activity Log entry to task.md
102
+ - [ ] Informed the user of the next step (must include all TUI command formats; do not filter)
102
103
 
103
- ## 错误处理
104
+ ## Error Handling
104
105
 
105
- - 告警未找到:提示 "Security alert #{number} not found"
106
- - 告警已关闭:询问用户是否继续分析
107
- - 网络/权限错误:提示相应信息
106
+ - Alert not found: output "Security alert #{number} not found"
107
+ - Alert already closed: ask the user whether to continue with analysis
108
+ - Network/permission error: output the corresponding error information
@@ -32,11 +32,11 @@ gh api repos/{owner}/{repo}/dependabot/alerts/<alert-number>
32
32
 
33
33
  ### 2. 创建任务目录和文件
34
34
 
35
- 检查 `.agent-workspace/active/` 中是否已存在该告警的任务。
35
+ 检查 `.agents/workspace/active/` 中是否已存在该告警的任务。
36
36
  - 如果找到,询问用户是否重新导入
37
37
  - 如果未找到,创建新任务
38
38
 
39
- 创建目录:`.agent-workspace/active/TASK-{yyyyMMdd-HHmmss}/`
39
+ 创建目录:`.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
40
40
 
41
41
  任务元数据需包含:
42
42
  ```yaml
@@ -77,7 +77,7 @@ date "+%Y-%m-%d %H:%M:%S"
77
77
  - 任务 ID:{task-id}
78
78
 
79
79
  产出文件:
80
- - 任务文件:.agent-workspace/active/{task-id}/task.md
80
+ - 任务文件:.agents/workspace/active/{task-id}/task.md
81
81
 
82
82
  下一步:
83
83
  - Claude Code / OpenCode:/analyze-task {task-id}