@fitlab-ai/agent-infra 0.3.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/License.txt +21 -0
- package/README.md +170 -0
- package/README.zh-CN.md +170 -0
- package/bin/cli.js +65 -0
- package/lib/defaults.json +45 -0
- package/lib/init.js +203 -0
- package/lib/log.js +27 -0
- package/lib/paths.js +48 -0
- package/lib/prompt.js +70 -0
- package/lib/render.js +99 -0
- package/lib/update.js +161 -0
- package/lib/version.js +7 -0
- package/package.json +48 -0
- package/templates/.agent-workspace/README.md +26 -0
- package/templates/.agent-workspace/README.zh-CN.md +26 -0
- package/templates/.agents/QUICKSTART.md +166 -0
- package/templates/.agents/QUICKSTART.zh-CN.md +166 -0
- package/templates/.agents/README.md +134 -0
- package/templates/.agents/README.zh-CN.md +134 -0
- package/templates/.agents/skills/analyze-task/SKILL.md +169 -0
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +169 -0
- package/templates/.agents/skills/block-task/SKILL.md +164 -0
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +163 -0
- package/templates/.agents/skills/check-task/SKILL.md +122 -0
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +122 -0
- package/templates/.agents/skills/close-codescan/SKILL.md +122 -0
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +122 -0
- package/templates/.agents/skills/close-dependabot/SKILL.md +130 -0
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +130 -0
- package/templates/.agents/skills/commit/SKILL.md +218 -0
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +217 -0
- package/templates/.agents/skills/complete-task/SKILL.md +139 -0
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +137 -0
- package/templates/.agents/skills/create-pr/SKILL.md +126 -0
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +125 -0
- package/templates/.agents/skills/create-release-note/SKILL.md +167 -0
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +166 -0
- package/templates/.agents/skills/create-task/SKILL.md +143 -0
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +143 -0
- package/templates/.agents/skills/implement-task/SKILL.md +229 -0
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +227 -0
- package/templates/.agents/skills/import-codescan/SKILL.md +103 -0
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +103 -0
- package/templates/.agents/skills/import-dependabot/SKILL.md +107 -0
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +107 -0
- package/templates/.agents/skills/import-issue/SKILL.md +119 -0
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +119 -0
- package/templates/.agents/skills/init-labels/SKILL.md +74 -0
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +74 -0
- package/templates/.agents/skills/init-labels/scripts/init-labels.sh +111 -0
- package/templates/.agents/skills/init-milestones/SKILL.md +74 -0
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +74 -0
- package/templates/.agents/skills/init-milestones/scripts/init-milestones.sh +169 -0
- package/templates/.agents/skills/plan-task/SKILL.md +225 -0
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +225 -0
- package/templates/.agents/skills/refine-task/SKILL.md +200 -0
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +200 -0
- package/templates/.agents/skills/refine-title/SKILL.md +84 -0
- package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +83 -0
- package/templates/.agents/skills/release/SKILL.md +142 -0
- package/templates/.agents/skills/release/SKILL.zh-CN.md +141 -0
- package/templates/.agents/skills/release/scripts/manage-milestones.sh +80 -0
- package/templates/.agents/skills/review-task/SKILL.md +276 -0
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +276 -0
- package/templates/.agents/skills/sync-issue/SKILL.md +569 -0
- package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +569 -0
- package/templates/.agents/skills/sync-pr/SKILL.md +142 -0
- package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +142 -0
- package/templates/.agents/skills/test/SKILL.md +61 -0
- package/templates/.agents/skills/test/SKILL.zh-CN.md +61 -0
- package/templates/.agents/skills/test-integration/SKILL.md +70 -0
- package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +69 -0
- package/templates/.agents/skills/update-agent-infra/SKILL.md +136 -0
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +124 -0
- package/templates/.agents/skills/update-agent-infra/scripts/package.json +3 -0
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +469 -0
- package/templates/.agents/skills/upgrade-dependency/SKILL.md +88 -0
- package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +87 -0
- package/templates/.agents/templates/handoff.md +60 -0
- package/templates/.agents/templates/handoff.zh-CN.md +60 -0
- package/templates/.agents/templates/review-report.md +67 -0
- package/templates/.agents/templates/review-report.zh-CN.md +67 -0
- package/templates/.agents/templates/task.md +65 -0
- package/templates/.agents/templates/task.zh-CN.md +65 -0
- package/templates/.agents/workflows/bug-fix.yaml +149 -0
- package/templates/.agents/workflows/bug-fix.zh-CN.yaml +149 -0
- package/templates/.agents/workflows/code-review.yaml +60 -0
- package/templates/.agents/workflows/code-review.zh-CN.yaml +60 -0
- package/templates/.agents/workflows/feature-development.yaml +150 -0
- package/templates/.agents/workflows/feature-development.zh-CN.yaml +150 -0
- package/templates/.agents/workflows/refactoring.yaml +154 -0
- package/templates/.agents/workflows/refactoring.zh-CN.yaml +154 -0
- package/templates/.claude/CLAUDE.md +163 -0
- package/templates/.claude/CLAUDE.zh-CN.md +163 -0
- package/templates/.claude/commands/analyze-task.md +8 -0
- package/templates/.claude/commands/analyze-task.zh-CN.md +8 -0
- package/templates/.claude/commands/block-task.md +8 -0
- package/templates/.claude/commands/block-task.zh-CN.md +8 -0
- package/templates/.claude/commands/check-task.md +8 -0
- package/templates/.claude/commands/check-task.zh-CN.md +8 -0
- package/templates/.claude/commands/close-codescan.md +8 -0
- package/templates/.claude/commands/close-codescan.zh-CN.md +8 -0
- package/templates/.claude/commands/close-dependabot.md +8 -0
- package/templates/.claude/commands/close-dependabot.zh-CN.md +8 -0
- package/templates/.claude/commands/commit.md +7 -0
- package/templates/.claude/commands/commit.zh-CN.md +7 -0
- package/templates/.claude/commands/complete-task.md +8 -0
- package/templates/.claude/commands/complete-task.zh-CN.md +8 -0
- package/templates/.claude/commands/create-pr.md +8 -0
- package/templates/.claude/commands/create-pr.zh-CN.md +8 -0
- package/templates/.claude/commands/create-release-note.md +8 -0
- package/templates/.claude/commands/create-release-note.zh-CN.md +8 -0
- package/templates/.claude/commands/create-task.md +8 -0
- package/templates/.claude/commands/create-task.zh-CN.md +8 -0
- package/templates/.claude/commands/implement-task.md +8 -0
- package/templates/.claude/commands/implement-task.zh-CN.md +8 -0
- package/templates/.claude/commands/import-codescan.md +8 -0
- package/templates/.claude/commands/import-codescan.zh-CN.md +8 -0
- package/templates/.claude/commands/import-dependabot.md +8 -0
- package/templates/.claude/commands/import-dependabot.zh-CN.md +8 -0
- package/templates/.claude/commands/import-issue.md +8 -0
- package/templates/.claude/commands/import-issue.zh-CN.md +8 -0
- package/templates/.claude/commands/init-labels.md +7 -0
- package/templates/.claude/commands/init-labels.zh-CN.md +7 -0
- package/templates/.claude/commands/init-milestones.md +8 -0
- package/templates/.claude/commands/init-milestones.zh-CN.md +8 -0
- package/templates/.claude/commands/plan-task.md +8 -0
- package/templates/.claude/commands/plan-task.zh-CN.md +8 -0
- package/templates/.claude/commands/refine-task.md +8 -0
- package/templates/.claude/commands/refine-task.zh-CN.md +8 -0
- package/templates/.claude/commands/refine-title.md +8 -0
- package/templates/.claude/commands/refine-title.zh-CN.md +8 -0
- package/templates/.claude/commands/release.md +8 -0
- package/templates/.claude/commands/release.zh-CN.md +8 -0
- package/templates/.claude/commands/review-task.md +8 -0
- package/templates/.claude/commands/review-task.zh-CN.md +8 -0
- package/templates/.claude/commands/sync-issue.md +8 -0
- package/templates/.claude/commands/sync-issue.zh-CN.md +8 -0
- package/templates/.claude/commands/sync-pr.md +8 -0
- package/templates/.claude/commands/sync-pr.zh-CN.md +8 -0
- package/templates/.claude/commands/test-integration.md +7 -0
- package/templates/.claude/commands/test-integration.zh-CN.md +7 -0
- package/templates/.claude/commands/test.md +7 -0
- package/templates/.claude/commands/test.zh-CN.md +7 -0
- package/templates/.claude/commands/update-agent-infra.md +7 -0
- package/templates/.claude/commands/update-agent-infra.zh-CN.md +7 -0
- package/templates/.claude/commands/upgrade-dependency.md +8 -0
- package/templates/.claude/commands/upgrade-dependency.zh-CN.md +8 -0
- package/templates/.claude/project-rules.md +65 -0
- package/templates/.claude/project-rules.zh-CN.md +65 -0
- package/templates/.claude/settings.json +20 -0
- package/templates/.codex/README.md +38 -0
- package/templates/.codex/README.zh-CN.md +37 -0
- package/templates/.editorconfig +15 -0
- package/templates/.gemini/commands/_project_/analyze-task.toml +8 -0
- package/templates/.gemini/commands/_project_/analyze-task.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/block-task.toml +8 -0
- package/templates/.gemini/commands/_project_/block-task.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/check-task.toml +8 -0
- package/templates/.gemini/commands/_project_/check-task.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/close-codescan.toml +8 -0
- package/templates/.gemini/commands/_project_/close-codescan.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/close-dependabot.toml +8 -0
- package/templates/.gemini/commands/_project_/close-dependabot.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/commit.toml +6 -0
- package/templates/.gemini/commands/_project_/commit.zh-CN.toml +6 -0
- package/templates/.gemini/commands/_project_/complete-task.toml +8 -0
- package/templates/.gemini/commands/_project_/complete-task.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/create-pr.toml +8 -0
- package/templates/.gemini/commands/_project_/create-pr.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/create-release-note.toml +8 -0
- package/templates/.gemini/commands/_project_/create-release-note.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/create-task.toml +8 -0
- package/templates/.gemini/commands/_project_/create-task.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/implement-task.toml +8 -0
- package/templates/.gemini/commands/_project_/implement-task.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/import-codescan.toml +8 -0
- package/templates/.gemini/commands/_project_/import-codescan.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/import-dependabot.toml +8 -0
- package/templates/.gemini/commands/_project_/import-dependabot.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/import-issue.toml +8 -0
- package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/init-labels.toml +8 -0
- package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/init-milestones.toml +10 -0
- package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +10 -0
- package/templates/.gemini/commands/_project_/plan-task.toml +8 -0
- package/templates/.gemini/commands/_project_/plan-task.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/refine-task.toml +8 -0
- package/templates/.gemini/commands/_project_/refine-task.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/refine-title.toml +8 -0
- package/templates/.gemini/commands/_project_/refine-title.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/release.toml +8 -0
- package/templates/.gemini/commands/_project_/release.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/review-task.toml +8 -0
- package/templates/.gemini/commands/_project_/review-task.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/sync-issue.toml +8 -0
- package/templates/.gemini/commands/_project_/sync-issue.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/sync-pr.toml +8 -0
- package/templates/.gemini/commands/_project_/sync-pr.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/test-integration.toml +6 -0
- package/templates/.gemini/commands/_project_/test-integration.zh-CN.toml +6 -0
- package/templates/.gemini/commands/_project_/test.toml +6 -0
- package/templates/.gemini/commands/_project_/test.zh-CN.toml +6 -0
- package/templates/.gemini/commands/_project_/update-agent-infra.toml +6 -0
- package/templates/.gemini/commands/_project_/update-agent-infra.zh-CN.toml +6 -0
- package/templates/.gemini/commands/_project_/upgrade-dependency.toml +8 -0
- package/templates/.gemini/commands/_project_/upgrade-dependency.zh-CN.toml +8 -0
- package/templates/.gemini/settings.json +3 -0
- package/templates/.github/ISSUE_TEMPLATE/01_bug_report.yml +149 -0
- package/templates/.github/ISSUE_TEMPLATE/02_question.yml +101 -0
- package/templates/.github/ISSUE_TEMPLATE/03_feature_request.yml +131 -0
- package/templates/.github/ISSUE_TEMPLATE/04_documentation.yml +165 -0
- package/templates/.github/ISSUE_TEMPLATE/05_other.yml +147 -0
- package/templates/.github/ISSUE_TEMPLATE/config.yml +11 -0
- package/templates/.github/PULL_REQUEST_TEMPLATE.md +123 -0
- package/templates/.github/dependabot.yml +17 -0
- package/templates/.github/hooks/check-utf8-encoding.sh +25 -0
- package/templates/.github/release.yml +27 -0
- package/templates/.github/workflows/pr-title-check.yml +42 -0
- package/templates/.mailmap +4 -0
- package/templates/.opencode/COMMAND_STYLE_GUIDE.md +232 -0
- package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +232 -0
- package/templates/.opencode/README.md +76 -0
- package/templates/.opencode/README.zh-CN.md +77 -0
- package/templates/.opencode/commands/analyze-task.md +11 -0
- package/templates/.opencode/commands/analyze-task.zh-CN.md +11 -0
- package/templates/.opencode/commands/block-task.md +11 -0
- package/templates/.opencode/commands/block-task.zh-CN.md +11 -0
- package/templates/.opencode/commands/check-task.md +11 -0
- package/templates/.opencode/commands/check-task.zh-CN.md +11 -0
- package/templates/.opencode/commands/close-codescan.md +11 -0
- package/templates/.opencode/commands/close-codescan.zh-CN.md +11 -0
- package/templates/.opencode/commands/close-dependabot.md +11 -0
- package/templates/.opencode/commands/close-dependabot.zh-CN.md +11 -0
- package/templates/.opencode/commands/commit.md +9 -0
- package/templates/.opencode/commands/commit.zh-CN.md +9 -0
- package/templates/.opencode/commands/complete-task.md +11 -0
- package/templates/.opencode/commands/complete-task.zh-CN.md +11 -0
- package/templates/.opencode/commands/create-pr.md +11 -0
- package/templates/.opencode/commands/create-pr.zh-CN.md +11 -0
- package/templates/.opencode/commands/create-release-note.md +11 -0
- package/templates/.opencode/commands/create-release-note.zh-CN.md +11 -0
- package/templates/.opencode/commands/create-task.md +11 -0
- package/templates/.opencode/commands/create-task.zh-CN.md +11 -0
- package/templates/.opencode/commands/implement-task.md +11 -0
- package/templates/.opencode/commands/implement-task.zh-CN.md +11 -0
- package/templates/.opencode/commands/import-codescan.md +11 -0
- package/templates/.opencode/commands/import-codescan.zh-CN.md +11 -0
- package/templates/.opencode/commands/import-dependabot.md +11 -0
- package/templates/.opencode/commands/import-dependabot.zh-CN.md +11 -0
- package/templates/.opencode/commands/import-issue.md +11 -0
- package/templates/.opencode/commands/import-issue.zh-CN.md +11 -0
- package/templates/.opencode/commands/init-labels.md +9 -0
- package/templates/.opencode/commands/init-labels.zh-CN.md +9 -0
- package/templates/.opencode/commands/init-milestones.md +11 -0
- package/templates/.opencode/commands/init-milestones.zh-CN.md +11 -0
- package/templates/.opencode/commands/plan-task.md +11 -0
- package/templates/.opencode/commands/plan-task.zh-CN.md +11 -0
- package/templates/.opencode/commands/refine-task.md +11 -0
- package/templates/.opencode/commands/refine-task.zh-CN.md +11 -0
- package/templates/.opencode/commands/refine-title.md +11 -0
- package/templates/.opencode/commands/refine-title.zh-CN.md +11 -0
- package/templates/.opencode/commands/release.md +11 -0
- package/templates/.opencode/commands/release.zh-CN.md +11 -0
- package/templates/.opencode/commands/review-task.md +11 -0
- package/templates/.opencode/commands/review-task.zh-CN.md +11 -0
- package/templates/.opencode/commands/sync-issue.md +11 -0
- package/templates/.opencode/commands/sync-issue.zh-CN.md +11 -0
- package/templates/.opencode/commands/sync-pr.md +11 -0
- package/templates/.opencode/commands/sync-pr.zh-CN.md +11 -0
- package/templates/.opencode/commands/test-integration.md +9 -0
- package/templates/.opencode/commands/test-integration.zh-CN.md +9 -0
- package/templates/.opencode/commands/test.md +9 -0
- package/templates/.opencode/commands/test.zh-CN.md +9 -0
- package/templates/.opencode/commands/update-agent-infra.md +9 -0
- package/templates/.opencode/commands/update-agent-infra.zh-CN.md +9 -0
- package/templates/.opencode/commands/upgrade-dependency.md +11 -0
- package/templates/.opencode/commands/upgrade-dependency.zh-CN.md +11 -0
- package/templates/AGENTS.md +91 -0
- package/templates/AGENTS.zh-CN.md +91 -0
- package/templates/CONTRIBUTING.md +126 -0
- package/templates/CONTRIBUTING.zh-CN.md +124 -0
- package/templates/SECURITY.md +131 -0
- package/templates/SECURITY.zh-CN.md +131 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-task
|
|
3
|
+
description: >
|
|
4
|
+
审查任务实现代码并输出代码审查报告,按严重程度分类(Blocker / Major / Minor)。
|
|
5
|
+
当用户在实现完成后要求代码审查时触发。参数:task-id。
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# 代码审查
|
|
9
|
+
|
|
10
|
+
## 行为边界 / 关键规则
|
|
11
|
+
|
|
12
|
+
- 本技能仅读取代码并产出审查报告(`review.md` 或 `review-r{N}.md`)—— 不修改业务代码
|
|
13
|
+
- 执行本技能后,你**必须**立即更新 task.md 中的任务状态
|
|
14
|
+
|
|
15
|
+
## 执行步骤
|
|
16
|
+
|
|
17
|
+
### 1. 验证前置条件
|
|
18
|
+
|
|
19
|
+
检查必要文件:
|
|
20
|
+
- `.agent-workspace/active/{task-id}/task.md` - 任务文件
|
|
21
|
+
- 至少一个实现报告:`implementation.md` 或 `implementation-r{N}.md`
|
|
22
|
+
|
|
23
|
+
注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
|
|
24
|
+
|
|
25
|
+
如果任一文件缺失,提示用户先完成前置步骤。
|
|
26
|
+
|
|
27
|
+
### 2. 确定审查轮次
|
|
28
|
+
|
|
29
|
+
扫描 `.agent-workspace/active/{task-id}/` 目录中的审查产物文件:
|
|
30
|
+
- 如果不存在 `review.md` 且不存在 `review-r*.md` → 本轮为第 1 轮,产出 `review.md`
|
|
31
|
+
- 如果存在 `review.md` 且不存在 `review-r*.md` → 本轮为第 2 轮,产出 `review-r2.md`
|
|
32
|
+
- 如果存在 `review-r{N}.md` → 本轮为第 N+1 轮,产出 `review-r{N+1}.md`
|
|
33
|
+
|
|
34
|
+
记录:
|
|
35
|
+
- `{review-round}`:本轮审查轮次
|
|
36
|
+
- `{review-artifact}`:本轮审查报告文件名
|
|
37
|
+
|
|
38
|
+
### 3. 阅读实现与修复报告
|
|
39
|
+
|
|
40
|
+
扫描任务目录中的实现报告文件(`implementation.md`、`implementation-r{N}.md`),读取最高轮次的文件以理解:
|
|
41
|
+
- 修改的文件列表
|
|
42
|
+
- 实现的关键功能
|
|
43
|
+
- 测试情况
|
|
44
|
+
- 实现者标记的需关注事项
|
|
45
|
+
|
|
46
|
+
如果存在修复产物(`refinement.md`、`refinement-r{N}.md`),读取最高轮次的文件以理解:
|
|
47
|
+
- 已修复了哪些审查问题
|
|
48
|
+
- 修复对代码和测试的影响
|
|
49
|
+
- 当前代码状态相对上轮审查的变化
|
|
50
|
+
|
|
51
|
+
### 4. 执行代码审查
|
|
52
|
+
|
|
53
|
+
遵循 `.agents/workflows/feature-development.yaml` 中的 `code-review` 步骤:
|
|
54
|
+
|
|
55
|
+
**必要审查领域**:
|
|
56
|
+
- [ ] 代码质量和编码规范(按项目指南)
|
|
57
|
+
- [ ] Bug 和潜在问题检测
|
|
58
|
+
- [ ] 测试覆盖率和测试质量
|
|
59
|
+
- [ ] 错误处理和边界情况
|
|
60
|
+
- [ ] 性能和安全问题
|
|
61
|
+
- [ ] 代码注释和文档
|
|
62
|
+
- [ ] 与技术方案的一致性
|
|
63
|
+
|
|
64
|
+
**审查原则**:
|
|
65
|
+
1. **严格但公正**:指出问题的同时也肯定做得好的地方
|
|
66
|
+
2. **具体**:提供准确的文件路径和行号
|
|
67
|
+
3. **提供建议**:不仅指出问题,还要提供解决方案
|
|
68
|
+
4. **按严重程度分类**:区分必须修复和可优化项
|
|
69
|
+
|
|
70
|
+
同时审查 `git diff` 以查看所有变更的上下文。
|
|
71
|
+
|
|
72
|
+
### 5. 输出审查报告
|
|
73
|
+
|
|
74
|
+
创建 `.agent-workspace/active/{task-id}/{review-artifact}`。
|
|
75
|
+
|
|
76
|
+
### 6. 更新任务状态
|
|
77
|
+
|
|
78
|
+
获取当前时间:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
date "+%Y-%m-%d %H:%M:%S"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
更新 `.agent-workspace/active/{task-id}/task.md`:
|
|
85
|
+
- `current_step`:code-review
|
|
86
|
+
- `assigned_to`:{审查者}
|
|
87
|
+
- `updated_at`:{当前时间}
|
|
88
|
+
- 记录本轮审查产物:`{review-artifact}`(Round `{review-round}`)
|
|
89
|
+
- 在工作流进度中标记 code-review 为已完成,并注明实际轮次(如果任务模板支持)
|
|
90
|
+
- **追加**到 `## Activity Log`(不要覆盖之前的记录):
|
|
91
|
+
```
|
|
92
|
+
- {yyyy-MM-dd HH:mm:ss} — **Code Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n} → {artifact-filename}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 7. 告知用户
|
|
96
|
+
|
|
97
|
+
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
|
|
98
|
+
|
|
99
|
+
根据审查结果输出:
|
|
100
|
+
|
|
101
|
+
**如果通过且无问题**(Major = 0 且 Minor = 0):
|
|
102
|
+
```
|
|
103
|
+
任务 {task-id} 代码审查完成。结论:通过。
|
|
104
|
+
- 阻塞项:0 | 主要问题:0 | 次要问题:0
|
|
105
|
+
|
|
106
|
+
下一步 - 提交代码:
|
|
107
|
+
- Claude Code / OpenCode:/commit
|
|
108
|
+
- Gemini CLI:/agent-infra:commit
|
|
109
|
+
- Codex CLI:$commit
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**如果通过但有问题**(Major > 0 或 Minor > 0):
|
|
113
|
+
```
|
|
114
|
+
任务 {task-id} 代码审查完成。结论:通过。
|
|
115
|
+
- 阻塞项:0 | 主要问题:{n} | 次要问题:{n}
|
|
116
|
+
- 审查报告:.agent-workspace/active/{task-id}/{review-artifact}
|
|
117
|
+
|
|
118
|
+
下一步 - 修复问题后提交(推荐):
|
|
119
|
+
- Claude Code / OpenCode:/refine-task {task-id}
|
|
120
|
+
- Gemini CLI:/agent-infra:refine-task {task-id}
|
|
121
|
+
- Codex CLI:$refine-task {task-id}
|
|
122
|
+
|
|
123
|
+
或直接提交(跳过修复):
|
|
124
|
+
- Claude Code / OpenCode:/commit
|
|
125
|
+
- Gemini CLI:/agent-infra:commit
|
|
126
|
+
- Codex CLI:$commit
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**如果需要修改**:
|
|
130
|
+
```
|
|
131
|
+
任务 {task-id} 代码审查完成。结论:需要修改。
|
|
132
|
+
- 阻塞项:{n} | 主要问题:{n} | 次要问题:{n}
|
|
133
|
+
- 审查报告:.agent-workspace/active/{task-id}/{review-artifact}
|
|
134
|
+
|
|
135
|
+
下一步 - 修复问题:
|
|
136
|
+
- Claude Code / OpenCode:/refine-task {task-id}
|
|
137
|
+
- Gemini CLI:/agent-infra:refine-task {task-id}
|
|
138
|
+
- Codex CLI:$refine-task {task-id}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**如果拒绝**:
|
|
142
|
+
```
|
|
143
|
+
任务 {task-id} 代码审查完成。结论:拒绝,需要重大返工。
|
|
144
|
+
- 审查报告:.agent-workspace/active/{task-id}/{review-artifact}
|
|
145
|
+
|
|
146
|
+
下一步 - 重新实现:
|
|
147
|
+
- Claude Code / OpenCode:/implement-task {task-id}
|
|
148
|
+
- Gemini CLI:/agent-infra:implement-task {task-id}
|
|
149
|
+
- Codex CLI:$implement-task {task-id}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## 输出模板
|
|
153
|
+
|
|
154
|
+
```markdown
|
|
155
|
+
# 代码审查报告
|
|
156
|
+
|
|
157
|
+
- **审查轮次**:Round {review-round}
|
|
158
|
+
- **产物文件**:`{review-artifact}`
|
|
159
|
+
- **实现输入**:
|
|
160
|
+
- `{implementation-artifact}`
|
|
161
|
+
- `{refinement-artifact}`(如存在)
|
|
162
|
+
|
|
163
|
+
## 审查摘要
|
|
164
|
+
|
|
165
|
+
- **审查者**:{审查者名称}
|
|
166
|
+
- **审查时间**:{时间戳}
|
|
167
|
+
- **审查范围**:{文件数量和主要模块}
|
|
168
|
+
- **总体结论**:{已批准 / 需要修改 / 拒绝}
|
|
169
|
+
|
|
170
|
+
## 发现的问题
|
|
171
|
+
|
|
172
|
+
### 阻塞项(必须修复)
|
|
173
|
+
|
|
174
|
+
#### 1. {问题标题}
|
|
175
|
+
**文件**:`{file-path}:{line-number}`
|
|
176
|
+
**描述**:{详细描述}
|
|
177
|
+
**建议修复**:{具体建议}
|
|
178
|
+
**严重程度**:高
|
|
179
|
+
|
|
180
|
+
### 主要问题(应该修复)
|
|
181
|
+
|
|
182
|
+
#### 1. {问题标题}
|
|
183
|
+
**文件**:`{file-path}:{line-number}`
|
|
184
|
+
**描述**:{详细描述}
|
|
185
|
+
**建议修复**:{具体建议}
|
|
186
|
+
**严重程度**:中
|
|
187
|
+
|
|
188
|
+
### 次要问题(可选优化)
|
|
189
|
+
|
|
190
|
+
#### 1. {优化点}
|
|
191
|
+
**文件**:`{file-path}:{line-number}`
|
|
192
|
+
**建议**:{优化建议}
|
|
193
|
+
|
|
194
|
+
## 亮点
|
|
195
|
+
|
|
196
|
+
- {做得好的方面 1}
|
|
197
|
+
- {做得好的方面 2}
|
|
198
|
+
|
|
199
|
+
## 规范符合度
|
|
200
|
+
|
|
201
|
+
### 编码规范
|
|
202
|
+
- [ ] 命名规范
|
|
203
|
+
- [ ] 代码风格
|
|
204
|
+
- [ ] 注释规范
|
|
205
|
+
- [ ] 测试规范
|
|
206
|
+
|
|
207
|
+
### 代码质量指标
|
|
208
|
+
- 圈复杂度:{评估}
|
|
209
|
+
- 代码重复:{评估}
|
|
210
|
+
- 测试覆盖率:{百分比或评估}
|
|
211
|
+
|
|
212
|
+
## 测试审查
|
|
213
|
+
|
|
214
|
+
### 测试覆盖率
|
|
215
|
+
- 单元测试:{评估}
|
|
216
|
+
- 边界情况:{是否覆盖?}
|
|
217
|
+
- 错误场景:{是否覆盖?}
|
|
218
|
+
|
|
219
|
+
### 测试质量
|
|
220
|
+
- 测试命名:{评估}
|
|
221
|
+
- 断言充分性:{评估}
|
|
222
|
+
- 测试独立性:{评估}
|
|
223
|
+
|
|
224
|
+
## 安全审查
|
|
225
|
+
|
|
226
|
+
- SQL 注入风险:{检查结果}
|
|
227
|
+
- XSS 风险:{检查结果}
|
|
228
|
+
- 访问控制:{检查结果}
|
|
229
|
+
- 敏感数据暴露:{检查结果}
|
|
230
|
+
|
|
231
|
+
## 性能审查
|
|
232
|
+
|
|
233
|
+
- 算法复杂度:{评估}
|
|
234
|
+
- 资源管理:{检查结果}
|
|
235
|
+
- 潜在瓶颈:{评估}
|
|
236
|
+
|
|
237
|
+
## 与方案的一致性
|
|
238
|
+
|
|
239
|
+
- [ ] 实现与技术方案一致
|
|
240
|
+
- [ ] 没有偏离设计意图
|
|
241
|
+
- [ ] 没有添加计划外的功能
|
|
242
|
+
|
|
243
|
+
## 结论和建议
|
|
244
|
+
|
|
245
|
+
### 审批决定
|
|
246
|
+
- [ ] 通过 - 无阻塞问题
|
|
247
|
+
- [ ] 需要修改 - 有需要解决的问题
|
|
248
|
+
- [ ] 拒绝 - 需要重大返工
|
|
249
|
+
|
|
250
|
+
### 后续步骤
|
|
251
|
+
{基于审查结果的建议}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## 完成检查清单
|
|
255
|
+
|
|
256
|
+
- [ ] 完成了所有修改文件的代码审查
|
|
257
|
+
- [ ] 创建了审查报告 `.agent-workspace/active/{task-id}/{review-artifact}`
|
|
258
|
+
- [ ] 更新了 task.md 中的 `current_step` 为 code-review
|
|
259
|
+
- [ ] 更新了 task.md 中的 `updated_at` 为当前时间
|
|
260
|
+
- [ ] 更新了 task.md 中的 `assigned_to` 为审查者名称
|
|
261
|
+
- [ ] 追加了 Activity Log 条目到 task.md
|
|
262
|
+
- [ ] 在工作流进度中标记了 code-review 为已完成
|
|
263
|
+
- [ ] 根据审查结果告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
|
|
264
|
+
|
|
265
|
+
## 注意事项
|
|
266
|
+
|
|
267
|
+
1. **前置条件**:必须已完成至少一轮实现(`implementation.md` 或 `implementation-r{N}.md` 存在)
|
|
268
|
+
2. **客观性**:严格但公正;在指出问题的同时肯定优秀的工作
|
|
269
|
+
3. **具体性**:始终引用准确的文件路径和行号
|
|
270
|
+
4. **严重程度分类**:阻塞项必须修复;主要问题应该修复;次要问题为可选
|
|
271
|
+
5. **版本化规则**:首轮审查使用 `review.md`;后续轮次使用 `review-r{N}.md`
|
|
272
|
+
|
|
273
|
+
## 错误处理
|
|
274
|
+
|
|
275
|
+
- 任务未找到:提示 "Task {task-id} not found"
|
|
276
|
+
- 缺少实现报告:提示 "Implementation report not found, please run the implement-task skill first"
|