@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.
- package/README.md +29 -39
- package/README.zh-CN.md +29 -39
- package/bin/cli.js +1 -1
- package/lib/defaults.json +3 -12
- package/lib/init.js +13 -24
- package/lib/paths.js +3 -42
- package/lib/update.js +98 -32
- package/lib/version.js +2 -1
- package/package.json +2 -1
- package/templates/.agents/QUICKSTART.md +7 -7
- package/templates/.agents/QUICKSTART.zh-CN.md +7 -7
- package/templates/.agents/README.md +16 -4
- package/templates/.agents/README.zh-CN.md +16 -4
- package/templates/.agents/skills/analyze-task/SKILL.md +106 -105
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/block-task/SKILL.md +8 -8
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +8 -8
- package/templates/.agents/skills/check-task/SKILL.md +3 -3
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/close-codescan/SKILL.md +64 -63
- package/templates/.agents/skills/close-dependabot/SKILL.md +71 -70
- package/templates/.agents/skills/commit/SKILL.md +1 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.md +7 -7
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +7 -7
- package/templates/.agents/skills/create-issue/SKILL.md +57 -12
- package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +57 -12
- package/templates/.agents/skills/create-pr/SKILL.md +44 -7
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +44 -7
- package/templates/.agents/skills/create-release-note/SKILL.md +18 -11
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +18 -11
- package/templates/.agents/skills/create-task/SKILL.md +80 -78
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +11 -10
- package/templates/.agents/skills/implement-task/SKILL.md +15 -18
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +15 -18
- package/templates/.agents/skills/import-codescan/SKILL.md +54 -53
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-dependabot/SKILL.md +57 -56
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/import-issue/SKILL.md +58 -58
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/init-labels/SKILL.md +8 -0
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +8 -0
- package/templates/.agents/skills/plan-task/SKILL.md +151 -149
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/refine-task/SKILL.md +3 -3
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/release/SKILL.md +55 -14
- package/templates/.agents/skills/release/SKILL.zh-CN.md +55 -14
- package/templates/.agents/skills/review-task/SKILL.md +9 -9
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +9 -9
- package/templates/.agents/skills/sync-issue/SKILL.md +258 -279
- package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +34 -56
- package/templates/.agents/skills/sync-pr/SKILL.md +8 -28
- package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +7 -27
- package/templates/.agents/skills/update-agent-infra/SKILL.md +6 -6
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +61 -116
- package/templates/.agents/templates/handoff.md +1 -1
- package/templates/.agents/templates/handoff.zh-CN.md +1 -1
- package/templates/.agents/workflows/bug-fix.yaml +71 -71
- package/templates/.agents/workflows/bug-fix.zh-CN.yaml +1 -1
- package/templates/.agents/workflows/feature-development.yaml +71 -71
- package/templates/.agents/workflows/feature-development.zh-CN.yaml +1 -1
- package/templates/.agents/workflows/refactoring.yaml +76 -76
- package/templates/.agents/workflows/refactoring.zh-CN.yaml +1 -1
- package/templates/{.agent-workspace → .agents/workspace}/README.md +1 -1
- package/templates/{.agent-workspace → .agents/workspace}/README.zh-CN.md +1 -1
- package/templates/.claude/CLAUDE.md +14 -1
- package/templates/.claude/CLAUDE.zh-CN.md +14 -1
- package/templates/.claude/hooks/check-version-format.sh +44 -0
- package/templates/.claude/settings.json +14 -0
- package/templates/.opencode/COMMAND_STYLE_GUIDE.md +6 -6
- package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +6 -6
- package/templates/AGENTS.md +14 -1
- package/templates/AGENTS.zh-CN.md +14 -1
- package/templates/.editorconfig +0 -15
- package/templates/.github/ISSUE_TEMPLATE/01_bug_report.yml +0 -149
- package/templates/.github/ISSUE_TEMPLATE/02_question.yml +0 -101
- package/templates/.github/ISSUE_TEMPLATE/03_feature_request.yml +0 -131
- package/templates/.github/ISSUE_TEMPLATE/04_documentation.yml +0 -165
- package/templates/.github/ISSUE_TEMPLATE/05_other.yml +0 -147
- package/templates/.github/ISSUE_TEMPLATE/config.yml +0 -11
- package/templates/.github/PULL_REQUEST_TEMPLATE.md +0 -123
- package/templates/.github/dependabot.yml +0 -17
- package/templates/.github/hooks/check-utf8-encoding.sh +0 -25
- package/templates/.github/release.yml +0 -27
- package/templates/.github/workflows/pr-title-check.yml +0 -42
- package/templates/.mailmap +0 -4
- package/templates/CONTRIBUTING.md +0 -126
- package/templates/CONTRIBUTING.zh-CN.md +0 -124
- package/templates/SECURITY.md +0 -131
- package/templates/SECURITY.zh-CN.md +0 -131
|
@@ -33,12 +33,13 @@ description: >
|
|
|
33
33
|
|
|
34
34
|
如果描述不清晰,**先向用户确认**再继续。
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
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
|
-
- 创建任务目录:`.
|
|
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
|
-
更新 `.
|
|
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
|
-
- 任务文件:.
|
|
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
|
-
- [ ] 创建了任务文件 `.
|
|
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
|
-
- `.
|
|
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 `.
|
|
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 `.
|
|
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
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
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 `.
|
|
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 `.
|
|
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: .
|
|
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 `.
|
|
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:
|
|
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
|
-
- `.
|
|
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
|
-
扫描 `.
|
|
31
|
+
扫描 `.agents/workspace/active/{task-id}/` 目录中的技术方案文件(`plan.md`、`plan-r{N}.md`):
|
|
32
32
|
- 读取最高轮次的方案文件,记为 `{plan-artifact}`
|
|
33
33
|
|
|
34
|
-
扫描 `.
|
|
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
|
-
|
|
90
|
+
只有全部测试通过后,才可以继续步骤 6、7 和 8。
|
|
94
91
|
|
|
95
92
|
### 6. 输出实现报告
|
|
96
93
|
|
|
97
|
-
创建 `.
|
|
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
|
-
更新 `.
|
|
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
|
-
- 实现报告:.
|
|
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
|
-
- [ ] 创建了实现报告 `.
|
|
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
|
-
-
|
|
231
|
+
- 测试失败:先尝试修复并重新运行测试;只有在存在外部阻塞、环境缺失或需求不明确时才停止,并输出阻塞原因
|
|
235
232
|
- 构建失败:输出构建错误,停止实现
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: import-codescan
|
|
3
3
|
description: >
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
#
|
|
9
|
+
# Import Code Scanning Alert
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Import the specified Code Scanning (CodeQL) alert and create a remediation task.
|
|
11
12
|
|
|
12
|
-
##
|
|
13
|
+
## Boundary / Critical Rules
|
|
13
14
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
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
|
|
29
|
-
- `rule
|
|
30
|
-
- `tool
|
|
31
|
-
- `most_recent_instance
|
|
32
|
-
- `html_url
|
|
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
|
-
|
|
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
|
-
|
|
58
|
-
-
|
|
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
|
-
>
|
|
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
|
|
69
|
+
Code Scanning alert #{alert-number} imported.
|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
71
|
+
Alert information:
|
|
72
|
+
- Severity: {severity}
|
|
73
|
+
- Rule: {rule-id}
|
|
74
|
+
- Location: {file-path}:{line-number}
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
-
|
|
76
|
+
Task information:
|
|
77
|
+
- Task ID: {task-id}
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
- Claude Code / OpenCode
|
|
80
|
-
- Gemini CLI
|
|
81
|
-
- Codex CLI
|
|
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.
|
|
87
|
-
2.
|
|
88
|
-
3.
|
|
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
|
-
- [ ]
|
|
95
|
-
- [ ]
|
|
96
|
-
- [ ]
|
|
97
|
-
- [ ]
|
|
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
|
-
-
|
|
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
|
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: import-dependabot
|
|
3
3
|
description: >
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
#
|
|
9
|
+
# Import Dependabot Security Alert
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Import the specified Dependabot security alert and create a remediation task.
|
|
11
12
|
|
|
12
|
-
##
|
|
13
|
+
## Boundary / Critical Rules
|
|
13
14
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
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
|
|
29
|
-
- `security_advisory
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
59
|
-
-
|
|
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
|
-
>
|
|
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
|
-
|
|
70
|
+
Security alert #{alert-number} imported.
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
- CVE/GHSA
|
|
74
|
-
-
|
|
72
|
+
Vulnerability information:
|
|
73
|
+
- Severity: {severity}
|
|
74
|
+
- CVE/GHSA: {cve-id} / {ghsa-id}
|
|
75
|
+
- Affected package: {package-name}
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
-
|
|
77
|
+
Task information:
|
|
78
|
+
- Task ID: {task-id}
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
-
|
|
80
|
+
Output file:
|
|
81
|
+
- Task file: .agents/workspace/active/{task-id}/task.md
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
- Claude Code / OpenCode
|
|
84
|
-
- Gemini CLI
|
|
85
|
-
- Codex CLI
|
|
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.
|
|
91
|
-
2.
|
|
92
|
-
3.
|
|
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
|
-
- [ ]
|
|
99
|
-
- [ ]
|
|
100
|
-
- [ ]
|
|
101
|
-
- [ ]
|
|
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
|
-
-
|
|
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
|
-
检查 `.
|
|
35
|
+
检查 `.agents/workspace/active/` 中是否已存在该告警的任务。
|
|
36
36
|
- 如果找到,询问用户是否重新导入
|
|
37
37
|
- 如果未找到,创建新任务
|
|
38
38
|
|
|
39
|
-
创建目录:`.
|
|
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
|
-
- 任务文件:.
|
|
80
|
+
- 任务文件:.agents/workspace/active/{task-id}/task.md
|
|
81
81
|
|
|
82
82
|
下一步:
|
|
83
83
|
- Claude Code / OpenCode:/analyze-task {task-id}
|