@fitlab-ai/agent-infra 0.6.4 → 0.7.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 +63 -27
- package/README.zh-CN.md +61 -25
- package/bin/cli.ts +18 -6
- package/dist/bin/cli.js +20 -6
- package/dist/lib/cp.js +127 -0
- package/dist/lib/defaults.json +1 -0
- package/dist/lib/init.js +3 -0
- package/dist/lib/sandbox/clipboard/bridge.js +23 -4
- package/dist/lib/sandbox/clipboard/index.js +12 -3
- package/dist/lib/sandbox/commands/create.js +11 -2
- package/dist/lib/sandbox/commands/enter.js +29 -6
- package/dist/lib/sandbox/commands/list-running.js +108 -0
- package/dist/lib/sandbox/commands/ls.js +24 -45
- package/dist/lib/sandbox/commands/rebuild.js +15 -7
- package/dist/lib/sandbox/config.js +3 -0
- package/dist/lib/sandbox/index.js +6 -4
- package/dist/lib/sandbox/readme-scaffold.js +148 -0
- package/dist/lib/sandbox/runtimes/ai-tools.dockerfile +12 -6
- package/dist/lib/sandbox/runtimes/base.dockerfile +3 -3
- package/dist/lib/sandbox/tools.js +213 -8
- package/dist/lib/update.js +12 -1
- package/lib/cp.ts +177 -0
- package/lib/defaults.json +1 -0
- package/lib/init.ts +10 -0
- package/lib/sandbox/clipboard/bridge.ts +23 -4
- package/lib/sandbox/clipboard/index.ts +12 -3
- package/lib/sandbox/commands/create.ts +18 -2
- package/lib/sandbox/commands/enter.ts +48 -6
- package/lib/sandbox/commands/list-running.ts +135 -0
- package/lib/sandbox/commands/ls.ts +28 -49
- package/lib/sandbox/commands/rebuild.ts +24 -7
- package/lib/sandbox/config.ts +7 -0
- package/lib/sandbox/index.ts +6 -4
- package/lib/sandbox/readme-scaffold.ts +177 -0
- package/lib/sandbox/runtimes/ai-tools.dockerfile +12 -6
- package/lib/sandbox/runtimes/base.dockerfile +3 -3
- package/lib/sandbox/tools.ts +248 -9
- package/lib/update.ts +15 -1
- package/package.json +1 -1
- package/templates/.agents/QUICKSTART.en.md +1 -1
- package/templates/.agents/QUICKSTART.zh-CN.md +1 -1
- package/templates/.agents/README.en.md +79 -2
- package/templates/.agents/README.zh-CN.md +79 -2
- package/templates/.agents/rules/create-issue.en.md +1 -1
- package/templates/.agents/rules/create-issue.github.en.md +1 -1
- package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
- package/templates/.agents/rules/create-issue.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-sync.github.en.md +6 -5
- package/templates/.agents/rules/issue-sync.github.zh-CN.md +6 -5
- package/templates/.agents/rules/milestone-inference.github.en.md +2 -2
- package/templates/.agents/rules/milestone-inference.github.zh-CN.md +2 -2
- package/templates/.agents/rules/no-mid-flow-questions.en.md +57 -0
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +57 -0
- package/templates/.agents/rules/pr-sync.github.en.md +4 -5
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +4 -5
- package/templates/.agents/rules/task-management.en.md +9 -6
- package/templates/.agents/rules/task-management.zh-CN.md +9 -6
- package/templates/.agents/rules/testing-discipline.en.md +2 -2
- package/templates/.agents/rules/testing-discipline.zh-CN.md +2 -2
- package/templates/.agents/scripts/validate-artifact.js +1 -1
- package/templates/.agents/skills/analyze-task/SKILL.en.md +16 -4
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +16 -4
- package/templates/.agents/skills/check-task/SKILL.en.md +43 -32
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +42 -31
- package/templates/.agents/skills/code-task/SKILL.en.md +117 -0
- package/templates/.agents/skills/{implement-task → code-task}/SKILL.zh-CN.md +51 -24
- package/templates/.agents/skills/{implement-task → code-task}/config/verify.en.json +4 -4
- package/templates/.agents/skills/{implement-task → code-task}/config/verify.zh-CN.json +4 -4
- package/templates/.agents/skills/{implement-task → code-task}/reference/branch-management.zh-CN.md +2 -2
- package/templates/.agents/skills/{implement-task/reference/implementation-rules.en.md → code-task/reference/code-rules.en.md} +6 -6
- package/templates/.agents/skills/{implement-task/reference/implementation-rules.zh-CN.md → code-task/reference/code-rules.zh-CN.md} +3 -3
- package/templates/.agents/skills/code-task/reference/dual-mode.en.md +69 -0
- package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +69 -0
- package/templates/.agents/skills/{refine-task/reference/fix-workflow.en.md → code-task/reference/fix-mode.en.md} +12 -12
- package/templates/.agents/skills/{refine-task/reference/fix-workflow.zh-CN.md → code-task/reference/fix-mode.zh-CN.md} +8 -8
- package/templates/.agents/skills/code-task/reference/output-template.en.md +20 -0
- package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +20 -0
- package/templates/.agents/skills/{implement-task → code-task}/reference/report-template.en.md +4 -4
- package/templates/.agents/skills/{implement-task → code-task}/reference/report-template.zh-CN.md +3 -3
- package/templates/.agents/skills/code-task/scripts/detect-mode.js +370 -0
- package/templates/.agents/skills/commit/SKILL.en.md +2 -2
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/commit/reference/task-status-update.en.md +10 -6
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +10 -6
- package/templates/.agents/skills/complete-task/SKILL.en.md +5 -3
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/create-pr/SKILL.en.md +17 -1
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +17 -1
- package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +2 -2
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/import-issue/SKILL.en.md +3 -3
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/plan-task/SKILL.en.md +4 -4
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/restore-task/SKILL.en.md +4 -3
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +4 -3
- package/templates/.agents/skills/review-analysis/SKILL.en.md +76 -0
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +102 -0
- package/templates/.agents/skills/review-analysis/config/verify.en.json +51 -0
- package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +51 -0
- package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +87 -0
- package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +87 -0
- package/templates/.agents/skills/review-analysis/reference/report-template.en.md +90 -0
- package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +91 -0
- package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +47 -0
- package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +47 -0
- package/templates/.agents/skills/{review-task → review-code}/SKILL.en.md +11 -9
- package/templates/.agents/skills/{review-task → review-code}/SKILL.zh-CN.md +15 -9
- package/templates/.agents/skills/{review-task → review-code}/config/verify.en.json +7 -5
- package/templates/.agents/skills/{review-task → review-code}/config/verify.zh-CN.json +6 -4
- package/templates/.agents/skills/{review-task → review-code}/reference/output-templates.en.md +21 -17
- package/templates/.agents/skills/{review-task → review-code}/reference/output-templates.zh-CN.md +19 -15
- package/templates/.agents/skills/{review-task → review-code}/reference/report-template.en.md +5 -6
- package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +91 -0
- package/templates/.agents/skills/review-code/reference/review-criteria.en.md +48 -0
- package/templates/.agents/skills/{review-task → review-code}/reference/review-criteria.zh-CN.md +10 -4
- package/templates/.agents/skills/review-plan/SKILL.en.md +76 -0
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +102 -0
- package/templates/.agents/skills/{refine-task → review-plan}/config/verify.en.json +14 -10
- package/templates/.agents/skills/{refine-task → review-plan}/config/verify.zh-CN.json +14 -10
- package/templates/.agents/skills/review-plan/reference/output-templates.en.md +87 -0
- package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +87 -0
- package/templates/.agents/skills/review-plan/reference/report-template.en.md +90 -0
- package/templates/.agents/skills/{review-task → review-plan}/reference/report-template.zh-CN.md +3 -3
- package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +47 -0
- package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +47 -0
- package/templates/.agents/skills/test/SKILL.en.md +2 -2
- package/templates/.agents/skills/test/SKILL.zh-CN.md +13 -31
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +1 -0
- package/templates/.agents/templates/task.en.md +3 -3
- package/templates/.agents/templates/task.zh-CN.md +2 -2
- package/templates/.agents/workflows/bug-fix.en.yaml +126 -80
- package/templates/.agents/workflows/bug-fix.zh-CN.yaml +90 -44
- package/templates/.agents/workflows/feature-development.en.yaml +115 -70
- package/templates/.agents/workflows/feature-development.zh-CN.yaml +92 -47
- package/templates/.agents/workflows/refactoring.en.yaml +123 -78
- package/templates/.agents/workflows/refactoring.zh-CN.yaml +89 -44
- package/templates/.claude/commands/code-task.en.md +8 -0
- package/templates/.claude/commands/code-task.zh-CN.md +8 -0
- package/templates/.claude/commands/review-analysis.en.md +8 -0
- package/templates/.claude/commands/review-analysis.zh-CN.md +8 -0
- package/templates/.claude/commands/review-code.en.md +8 -0
- package/templates/.claude/commands/review-code.zh-CN.md +8 -0
- package/templates/.claude/commands/review-plan.en.md +8 -0
- package/templates/.claude/commands/review-plan.zh-CN.md +8 -0
- package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/code-task.en.toml +8 -0
- package/templates/.gemini/commands/_project_/code-task.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/review-analysis.en.toml +8 -0
- package/templates/.gemini/commands/_project_/review-analysis.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/review-code.en.toml +8 -0
- package/templates/.gemini/commands/_project_/review-code.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/review-plan.en.toml +8 -0
- package/templates/.gemini/commands/_project_/review-plan.zh-CN.toml +8 -0
- package/templates/.opencode/commands/code-task.en.md +11 -0
- package/templates/.opencode/commands/code-task.zh-CN.md +11 -0
- package/templates/.opencode/commands/review-analysis.en.md +11 -0
- package/templates/.opencode/commands/review-analysis.zh-CN.md +11 -0
- package/templates/.opencode/commands/review-code.en.md +11 -0
- package/templates/.opencode/commands/review-code.zh-CN.md +11 -0
- package/templates/.opencode/commands/review-plan.en.md +11 -0
- package/templates/.opencode/commands/review-plan.zh-CN.md +11 -0
- package/templates/.agents/skills/implement-task/SKILL.en.md +0 -173
- package/templates/.agents/skills/implement-task/reference/output-template.en.md +0 -20
- package/templates/.agents/skills/implement-task/reference/output-template.zh-CN.md +0 -20
- package/templates/.agents/skills/refine-task/SKILL.en.md +0 -153
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +0 -153
- package/templates/.agents/skills/refine-task/reference/report-template.en.md +0 -64
- package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +0 -64
- package/templates/.agents/skills/review-task/reference/review-criteria.en.md +0 -42
- package/templates/.claude/commands/implement-task.en.md +0 -8
- package/templates/.claude/commands/implement-task.zh-CN.md +0 -8
- package/templates/.claude/commands/refine-task.en.md +0 -8
- package/templates/.claude/commands/refine-task.zh-CN.md +0 -8
- package/templates/.claude/commands/review-task.en.md +0 -8
- package/templates/.claude/commands/review-task.zh-CN.md +0 -8
- package/templates/.gemini/commands/_project_/implement-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/implement-task.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/refine-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/refine-task.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/review-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/review-task.zh-CN.toml +0 -8
- package/templates/.opencode/commands/implement-task.en.md +0 -11
- package/templates/.opencode/commands/implement-task.zh-CN.md +0 -11
- package/templates/.opencode/commands/refine-task.en.md +0 -11
- package/templates/.opencode/commands/refine-task.zh-CN.md +0 -11
- package/templates/.opencode/commands/review-task.en.md +0 -11
- package/templates/.opencode/commands/review-task.zh-CN.md +0 -11
- /package/templates/.agents/skills/{implement-task → code-task}/reference/branch-management.en.md +0 -0
|
@@ -20,9 +20,11 @@ For every task-related commit, append this Activity Log entry in `task.md`:
|
|
|
20
20
|
|
|
21
21
|
Before selecting the next step, verify:
|
|
22
22
|
- `current_step` and the latest workflow progress in `task.md`
|
|
23
|
-
- whether the latest `review.md` / `review-r{N}.md` passed without findings
|
|
23
|
+
- whether the latest `review-code.md` / `review-code-r{N}.md` passed without findings
|
|
24
24
|
- whether there are still pending fixes, review work, or PR creation steps
|
|
25
25
|
|
|
26
|
+
**Gate read (project-level PR flow policy)**: Before running this step, read `.agents/.airc.json`'s `requiresPullRequest` field. Treat missing or `true` as "PR flow enabled" (default); treat explicit `false` as "PR flow disabled". All branches that depend on this field follow the same rule.
|
|
27
|
+
|
|
26
28
|
Choose exactly one case:
|
|
27
29
|
|
|
28
30
|
| Decision Basis | Required Case |
|
|
@@ -30,17 +32,19 @@ Choose exactly one case:
|
|
|
30
32
|
| all workflow steps completed + latest review approved with no findings + all tests passed | Case 1: final commit |
|
|
31
33
|
| unfinished steps, pending fixes, or waiting on others still exist | Case 2: more work remains |
|
|
32
34
|
| this commit prepares the task for code review | Case 3: ready for review |
|
|
33
|
-
| code is committed, review is done, and the
|
|
35
|
+
| code is committed, review is done, **and the project enables the PR flow**, with PR creation as the next step | Case 4: ready for PR |
|
|
34
36
|
|
|
35
37
|
Never apply more than one case. Match the single next-step branch first, then update the task.
|
|
36
38
|
|
|
39
|
+
**Gate downgrade**: When `requiresPullRequest === false`, Case 4 must never be entered; commits that would otherwise fall into Case 4 collapse into Case 1 (final commit -> `/complete-task`).
|
|
40
|
+
|
|
37
41
|
### Case 1: Final Commit
|
|
38
42
|
|
|
39
43
|
Prerequisites:
|
|
40
44
|
- [ ] all code committed
|
|
41
45
|
- [ ] all tests passed
|
|
42
46
|
- [ ] code review approved
|
|
43
|
-
- [ ] all workflow steps completed
|
|
47
|
+
- [ ] all workflow steps completed (for the `pr_tasks` list under each yaml `commit` step, count those items toward completion only when `requiresPullRequest !== false`)
|
|
44
48
|
|
|
45
49
|
Required next-step commands:
|
|
46
50
|
|
|
@@ -71,9 +75,9 @@ Required next-step commands:
|
|
|
71
75
|
|
|
72
76
|
```text
|
|
73
77
|
Next step - code review:
|
|
74
|
-
- Claude Code / OpenCode: /review-
|
|
75
|
-
- Gemini CLI: /agent-infra:review-
|
|
76
|
-
- Codex CLI: $review-
|
|
78
|
+
- Claude Code / OpenCode: /review-code {task-id}
|
|
79
|
+
- Gemini CLI: /agent-infra:review-code {task-id}
|
|
80
|
+
- Codex CLI: $review-code {task-id}
|
|
77
81
|
```
|
|
78
82
|
|
|
79
83
|
### Case 4: Ready for PR
|
|
@@ -20,9 +20,11 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
20
20
|
|
|
21
21
|
在决定下一步之前,先确认:
|
|
22
22
|
- `task.md` 中的 `current_step` 和最新工作流进度
|
|
23
|
-
- 最新的 `review.md` / `review-r{N}.md` 是否无问题通过
|
|
23
|
+
- 最新的 `review-code.md` / `review-code-r{N}.md` 是否无问题通过
|
|
24
24
|
- 是否仍然存在待修复项、待审查工作或待创建 PR 的步骤
|
|
25
25
|
|
|
26
|
+
**门控读取(项目级 PR 流程策略)**:在执行本步骤前,读取 `.agents/.airc.json` 的 `requiresPullRequest` 字段;当字段缺失或为 `true` 时视为「启用 PR 流程」(默认),仅当显式为 `false` 时视为「关闭 PR 流程」。所有依赖该字段的分支按此规则判定。
|
|
27
|
+
|
|
26
28
|
必须且只能选择一个分支:
|
|
27
29
|
|
|
28
30
|
| 判断依据 | 必选分支 |
|
|
@@ -30,17 +32,19 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
30
32
|
| 所有工作流步骤都已完成 + 最新审查无问题通过 + 所有测试通过 | 场景 1:最终提交 |
|
|
31
33
|
| 仍有未完成步骤、待修复项或等待他人的动作 | 场景 2:还有后续工作 |
|
|
32
34
|
| 这次提交是为了把任务交给代码审查 | 场景 3:准备进入审查 |
|
|
33
|
-
|
|
|
35
|
+
| 代码已提交、审查已完成,且**项目启用 PR 流程**,下一步是创建 PR | 场景 4:准备创建 PR |
|
|
34
36
|
|
|
35
37
|
绝对不要同时套用多个分支。先匹配唯一的下一步分支,再更新任务。
|
|
36
38
|
|
|
39
|
+
**门控降级**:当 `requiresPullRequest === false` 时,场景 4 永远不被进入;原本会落入场景 4 的提交统一收敛到场景 1(最终提交 → `/complete-task`)。
|
|
40
|
+
|
|
37
41
|
### 场景 1:最终提交
|
|
38
42
|
|
|
39
43
|
前置条件:
|
|
40
44
|
- [ ] 所有代码都已提交
|
|
41
45
|
- [ ] 所有测试通过
|
|
42
46
|
- [ ] 代码审查已通过
|
|
43
|
-
- [ ]
|
|
47
|
+
- [ ] 所有工作流步骤已完成(对 yaml `commit` 步骤的 `pr_tasks` 列表,仅在 `requiresPullRequest !== false` 时计入)
|
|
44
48
|
|
|
45
49
|
必带下一步命令:
|
|
46
50
|
|
|
@@ -71,9 +75,9 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
71
75
|
|
|
72
76
|
```text
|
|
73
77
|
下一步 - 代码审查:
|
|
74
|
-
- Claude Code / OpenCode: /review-
|
|
75
|
-
- Gemini CLI: /agent-infra:review-
|
|
76
|
-
- Codex CLI: $review-
|
|
78
|
+
- Claude Code / OpenCode: /review-code {task-id}
|
|
79
|
+
- Gemini CLI: /agent-infra:review-code {task-id}
|
|
80
|
+
- Codex CLI: $review-code {task-id}
|
|
77
81
|
```
|
|
78
82
|
|
|
79
83
|
### 场景 4:准备创建 PR
|
|
@@ -40,9 +40,11 @@ If not found in `active/`, check `blocked/` and `completed/`:
|
|
|
40
40
|
|
|
41
41
|
### 2. Verify Completion Prerequisites (Failure Must Stop)
|
|
42
42
|
|
|
43
|
+
**Gate read (project-level PR flow policy)**: Before running this step, read `.agents/.airc.json`'s `requiresPullRequest` field. Treat missing or `true` as "PR flow enabled" (default); treat explicit `false` as "PR flow disabled". The completion check below is pruned accordingly.
|
|
44
|
+
|
|
43
45
|
Before marking complete, verify ALL of these:
|
|
44
|
-
- [ ] All workflow steps are complete (check workflow progress in task.md)
|
|
45
|
-
- [ ] Code has been reviewed (`review.md` or `review-r{N}.md` exists, and the latest review verdict is Approved; or review was done externally)
|
|
46
|
+
- [ ] All workflow steps are complete (check workflow progress in task.md; **for the `pr_tasks` list under each yaml `commit` step, count those items toward the missing-work decision only when `.agents/.airc.json:requiresPullRequest !== false`**)
|
|
47
|
+
- [ ] Code has been reviewed (`review-code.md` or `review-code-r{N}.md` exists, and the latest review verdict is Approved; or review was done externally)
|
|
46
48
|
- [ ] Code has been committed (no uncommitted changes related to this task)
|
|
47
49
|
- [ ] Tests are passing
|
|
48
50
|
|
|
@@ -109,7 +111,7 @@ Check whether `task.md` includes a valid `issue_number`. If not, skip this step
|
|
|
109
111
|
> Issue sync rules live in `.agents/rules/issue-sync.md`. Read that file before syncing, and complete upstream repository detection plus permission detection.
|
|
110
112
|
|
|
111
113
|
If a valid `issue_number` exists:
|
|
112
|
-
- First scan and backfill unpublished `task.md`, `analysis*.md`, `
|
|
114
|
+
- First scan and backfill unpublished `task.md`, `analysis*.md`, `review-analysis*.md`, `plan*.md`, `review-plan*.md`, `code*.md`, and `review-code*.md` comments using the backfill rules in `.agents/rules/issue-sync.md` (`task.md` uses the idempotent update path)
|
|
113
115
|
- Backfill checked `## Requirements` items to the Issue body by following the requirements-checkbox sync steps in issue-sync.md
|
|
114
116
|
- Do not set any `status:` label — status labels are automatically cleared when the Issue is closed
|
|
115
117
|
- Finally create or update the summary comment marked with the summary marker defined in `.agents/rules/issue-sync.md`
|
|
@@ -40,9 +40,11 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
40
40
|
|
|
41
41
|
### 2. 验证完成前置条件(未满足则必须停止)
|
|
42
42
|
|
|
43
|
+
**门控读取(项目级 PR 流程策略)**:在执行本步骤前,读取 `.agents/.airc.json` 的 `requiresPullRequest` 字段;当字段缺失或为 `true` 时视为「启用 PR 流程」(默认),仅当显式为 `false` 时视为「关闭 PR 流程」。下面的工作流步骤完成判定按此规则裁剪。
|
|
44
|
+
|
|
43
45
|
标记完成之前,验证以下所有条件:
|
|
44
|
-
- [ ] 所有工作流步骤已完成(检查 task.md
|
|
45
|
-
- [ ] 代码已审查(`review.md` 或 `review-r{N}.md` 存在,且最新审查结论为 Approved;或已在外部完成审查)
|
|
46
|
+
- [ ] 所有工作流步骤已完成(检查 task.md 中的工作流进度;**对 yaml 中 commit 步骤的 `pr_tasks` 列表,仅在 `.agents/.airc.json:requiresPullRequest !== false` 时计入未完成判定**)
|
|
47
|
+
- [ ] 代码已审查(`review-code.md` 或 `review-code-r{N}.md` 存在,且最新审查结论为 Approved;或已在外部完成审查)
|
|
46
48
|
- [ ] 代码已提交(没有与此任务相关的未提交变更)
|
|
47
49
|
- [ ] 测试通过
|
|
48
50
|
|
|
@@ -109,7 +111,7 @@ ls .agents/workspace/completed/{task-id}/task.md
|
|
|
109
111
|
> Issue 同步规则见 `.agents/rules/issue-sync.md`。执行同步前先读取该文件,完成 upstream 仓库检测和权限检测。
|
|
110
112
|
|
|
111
113
|
如果存在有效的 `issue_number`:
|
|
112
|
-
- 先按 `.agents/rules/issue-sync.md` 的补发规则扫描并补发未发布的 `task.md`、`analysis*.md`、`
|
|
114
|
+
- 先按 `.agents/rules/issue-sync.md` 的补发规则扫描并补发未发布的 `task.md`、`analysis*.md`、`review-analysis*.md`、`plan*.md`、`review-plan*.md`、`code*.md`、`review-code*.md` 评论(`task.md` 走幂等更新路径)
|
|
113
115
|
- 按 issue-sync.md 的需求复选框同步步骤,兜底同步 `## 需求` 中已勾选的条目到 Issue body
|
|
114
116
|
- 不要设置 `status:` label — Issue 关闭后 status label 会被自动清除
|
|
115
117
|
- 最后创建或更新 `.agents/rules/issue-sync.md` 中定义的 summary 评论标记对应的 summary 评论
|
|
@@ -13,6 +13,22 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
|
|
|
13
13
|
|
|
14
14
|
## Execution Flow
|
|
15
15
|
|
|
16
|
+
### Pre-gate: Project-level PR Flow Check
|
|
17
|
+
|
|
18
|
+
**Gate read (project-level PR flow policy)**: Before running any numbered step, read `.agents/.airc.json`'s `requiresPullRequest` field. Treat missing or `true` as "PR flow enabled" (default); treat explicit `false` as "PR flow disabled".
|
|
19
|
+
|
|
20
|
+
Branch on the result:
|
|
21
|
+
- missing / `true` -> continue to Step 1 below
|
|
22
|
+
- explicit `false` -> output the message below and **stop immediately**. Do not run any subsequent numbered step, do not trigger any PR-creation command, do not modify `pr_number` in `task.md`, and do not publish a PR summary comment:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
This project does not enable the PR flow (`.agents/.airc.json` sets `requiresPullRequest: false`).
|
|
26
|
+
No Pull Request is required; run instead:
|
|
27
|
+
- Claude Code / OpenCode: /complete-task {task-id}
|
|
28
|
+
- Gemini CLI: /agent-infra:complete-task {task-id}
|
|
29
|
+
- Codex CLI: $complete-task {task-id}
|
|
30
|
+
```
|
|
31
|
+
|
|
16
32
|
### 1. Parse Command Arguments
|
|
17
33
|
|
|
18
34
|
Identify arguments from the command input:
|
|
@@ -57,7 +73,7 @@ For PRs where `{task-id}` is available, sync the core metadata immediately:
|
|
|
57
73
|
|
|
58
74
|
### 7. Publish the Review Summary
|
|
59
75
|
|
|
60
|
-
Read the latest context artifacts when they exist: `plan.md` / `plan-r{N}.md`, `
|
|
76
|
+
Read the latest context artifacts when they exist: `plan.md` / `plan-r{N}.md`, `review-plan.md` / `review-plan-r{N}.md`, `code.md` / `code-r{N}.md`, and `review-code.md` / `review-code-r{N}.md`.
|
|
61
77
|
|
|
62
78
|
Aggregate a reviewer-facing summary from those artifacts and maintain a single idempotent summary comment via the hidden marker.
|
|
63
79
|
|
|
@@ -13,6 +13,22 @@ description: "创建 Pull Request 到目标分支"
|
|
|
13
13
|
|
|
14
14
|
## 执行流程
|
|
15
15
|
|
|
16
|
+
### 前置门控:项目级 PR 流程检查
|
|
17
|
+
|
|
18
|
+
**门控读取(项目级 PR 流程策略)**:在执行编号步骤前,读取 `.agents/.airc.json` 的 `requiresPullRequest` 字段;当字段缺失或为 `true` 时视为「启用 PR 流程」(默认),仅当显式为 `false` 时视为「关闭 PR 流程」。
|
|
19
|
+
|
|
20
|
+
按读取结果分支:
|
|
21
|
+
- 缺失 / `true` → 继续到下方第 1 步
|
|
22
|
+
- 显式 `false` → 输出以下消息后**立即停止**,不要执行任何后续编号步骤、不要触发任何 PR 创建命令、不要修改 `task.md` 的 `pr_number`、不要发布 PR 摘要评论:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
当前项目未启用 PR 流程(`.agents/.airc.json` 中 `requiresPullRequest: false`)。
|
|
26
|
+
无需创建 Pull Request,请直接运行:
|
|
27
|
+
- Claude Code / OpenCode:/complete-task {task-id}
|
|
28
|
+
- Gemini CLI:/agent-infra:complete-task {task-id}
|
|
29
|
+
- Codex CLI:$complete-task {task-id}
|
|
30
|
+
```
|
|
31
|
+
|
|
16
32
|
### 1. 解析命令参数
|
|
17
33
|
|
|
18
34
|
从命令参数中识别:
|
|
@@ -57,7 +73,7 @@ description: "创建 Pull Request 到目标分支"
|
|
|
57
73
|
|
|
58
74
|
### 7. 发布审查摘要
|
|
59
75
|
|
|
60
|
-
读取最新的上下文产物:`plan.md` / `plan-r{N}.md`、`
|
|
76
|
+
读取最新的上下文产物:`plan.md` / `plan-r{N}.md`、`review-plan.md` / `review-plan-r{N}.md`、`code.md` / `code-r{N}.md`、`review-code.md` / `review-code-r{N}.md`(存在时)。
|
|
61
77
|
|
|
62
78
|
基于这些产物聚合 reviewer 摘要,并使用隐藏标记维护唯一且幂等的摘要评论。
|
|
63
79
|
|
|
@@ -106,5 +106,5 @@ Next step:
|
|
|
106
106
|
## Error Handling
|
|
107
107
|
|
|
108
108
|
- Alert not found: output "Code Scanning alert #{number} not found"
|
|
109
|
-
- Alert already closed:
|
|
109
|
+
- Alert already closed: **proceed with task creation/reuse by default** and surface the alert's current state (dismissed/fixed) in the final notice; the user may archive the task manually if desired
|
|
110
110
|
- Network/permission error: output the corresponding error information
|
|
@@ -29,7 +29,7 @@ Extract key information:
|
|
|
29
29
|
### 2. Create the Task Directory and File
|
|
30
30
|
|
|
31
31
|
Check whether `.agents/workspace/active/` already has a task for this alert.
|
|
32
|
-
- If found, ask the user
|
|
32
|
+
- If found, **reuse the existing task by default**; do not ask the user. State clearly in the final notice: "Reused existing task `{task-id}`; not re-imported." If the user wants to re-import, they must first archive or delete the existing task
|
|
33
33
|
- If not found, create a new task
|
|
34
34
|
|
|
35
35
|
Create directory: `.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
|
|
@@ -110,5 +110,5 @@ Next step:
|
|
|
110
110
|
## Error Handling
|
|
111
111
|
|
|
112
112
|
- Alert not found: output "Security alert #{number} not found"
|
|
113
|
-
- Alert already closed:
|
|
113
|
+
- Alert already closed: **proceed with task creation/reuse by default** and surface the alert's current state (dismissed/fixed) in the final notice; the user may archive the task manually if desired
|
|
114
114
|
- Network/permission error: output the corresponding error information
|
|
@@ -29,7 +29,7 @@ description: "导入 Dependabot 安全告警并创建修复任务"
|
|
|
29
29
|
### 2. 创建任务目录和文件
|
|
30
30
|
|
|
31
31
|
检查 `.agents/workspace/active/` 中是否已存在该告警的任务。
|
|
32
|
-
-
|
|
32
|
+
- 如果找到,**默认复用现有任务**,不询问用户;在最终告知中明确「已复用现有任务 `{task-id}`,未重新导入」。如需重新导入,需先归档/删除已有任务
|
|
33
33
|
- 如果未找到,创建新任务
|
|
34
34
|
|
|
35
35
|
创建目录:`.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/`
|
|
@@ -110,5 +110,5 @@ node .agents/scripts/validate-artifact.js gate import-dependabot .agents/workspa
|
|
|
110
110
|
## 错误处理
|
|
111
111
|
|
|
112
112
|
- 告警未找到:提示 "Security alert #{number} not found"
|
|
113
|
-
-
|
|
113
|
+
- 告警已关闭:**默认仍继续创建/复用任务**,并在告知用户中明确该告警当前状态(dismissed/fixed);用户可视情况手动归档任务
|
|
114
114
|
- 网络/权限错误:提示相应信息
|
|
@@ -25,7 +25,7 @@ Use the Issue title as-is for the task title (preserve the Issue's original lang
|
|
|
25
25
|
### 2. Check for an Existing Task
|
|
26
26
|
|
|
27
27
|
2.1 Search `.agents/workspace/active/` for an existing task linked to this Issue.
|
|
28
|
-
- If found, ask the user
|
|
28
|
+
- If found, **reuse the existing task by default** (Scenario A); do not ask the user. State clearly in the final notice: "Reused existing task `{task-id}`; not re-imported." If the user wants to re-import, they must first archive or delete the existing task and run this skill again
|
|
29
29
|
- If not found, continue to 2.2
|
|
30
30
|
|
|
31
31
|
2.2 Use the "historical task comment scan" command in `.agents/rules/issue-pr-commands.md` to scan Issue comments for sync markers and look for a recoverable historical task ID.
|
|
@@ -44,7 +44,7 @@ Exit code handling for the whole pipeline:
|
|
|
44
44
|
|
|
45
45
|
| Scenario | Trigger | task ID source | created_at source | User confirmation |
|
|
46
46
|
|---|---|---|---|---|
|
|
47
|
-
| Scenario A | 2.1 finds a local task | Reuse local ID | Preserve local value |
|
|
47
|
+
| Scenario A | 2.1 finds a local task | Reuse local ID | Preserve local value | Reuse by default; do not ask; inform the user reuse happened |
|
|
48
48
|
| Scenario B | 2.1 no match + 2.2 no candidate | Create with `date +%Y%m%d-%H%M%S` | Current time | Not required |
|
|
49
49
|
| Scenario C | 2.1 no match + 2.2 any candidate | Automatically reuse the earliest candidate ID | Prefer remote frontmatter `created_at`; use current time if missing | Inform only |
|
|
50
50
|
|
|
@@ -175,7 +175,7 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
|
|
|
175
175
|
## Notes
|
|
176
176
|
|
|
177
177
|
1. **Issue validation**: verify that the Issue exists before continuing
|
|
178
|
-
2. **Duplicate task**: if this Issue already has a linked task,
|
|
178
|
+
2. **Duplicate task**: if this Issue already has a linked task, **reuse it by default** instead of creating a new one (do not ask the user)
|
|
179
179
|
3. **Next step**: after import, run `analyze-task` before `plan-task`
|
|
180
180
|
|
|
181
181
|
## Error Handling
|
|
@@ -25,7 +25,7 @@ description: "从 Issue 导入并创建任务"
|
|
|
25
25
|
### 2. 检查已有任务
|
|
26
26
|
|
|
27
27
|
2.1 搜索 `.agents/workspace/active/` 中是否已有链接到此 Issue 的任务。
|
|
28
|
-
-
|
|
28
|
+
- 如果找到,**默认复用现有任务**(场景 A),不询问用户;在最终告知中明确「已复用现有任务 `{task-id}`,未重新导入」。若用户希望重新导入,需要先手动归档/删除已有任务再次执行本技能
|
|
29
29
|
- 如果未找到,继续执行 2.2
|
|
30
30
|
|
|
31
31
|
2.2 按 `.agents/rules/issue-pr-commands.md` 的“历史任务评论扫描”命令扫描 Issue 评论中的同步标记,查找可恢复的历史任务 ID。
|
|
@@ -44,7 +44,7 @@ description: "从 Issue 导入并创建任务"
|
|
|
44
44
|
|
|
45
45
|
| 场景 | 触发条件 | task ID 来源 | created_at 来源 | 用户确认 |
|
|
46
46
|
|---|---|---|---|---|
|
|
47
|
-
| 场景 A | 2.1 命中本地任务 | 复用本地 ID | 本地保留 |
|
|
47
|
+
| 场景 A | 2.1 命中本地任务 | 复用本地 ID | 本地保留 | 默认复用,不询问;告知用户已复用 |
|
|
48
48
|
| 场景 B | 2.1 无命中 + 2.2 无候选 | `date +%Y%m%d-%H%M%S` 新建 | 当前时间 | 不需要 |
|
|
49
49
|
| 场景 C | 2.1 无命中 + 2.2 有候选 | 自动复用最早候选 ID | 优先用远端 frontmatter 的 `created_at`,缺失时用当前时间 | 告知即可 |
|
|
50
50
|
|
|
@@ -175,7 +175,7 @@ Issue #{number} 已导入。
|
|
|
175
175
|
## 注意事项
|
|
176
176
|
|
|
177
177
|
1. **Issue 验证**:在继续之前检查 Issue 是否存在
|
|
178
|
-
2. **重复任务**:如果此 Issue
|
|
178
|
+
2. **重复任务**:如果此 Issue 已有关联任务,**默认复用**而非创建新任务(不询问用户)
|
|
179
179
|
3. **下一步**:导入完成后,先执行 `analyze-task`,再进入 `plan-task`
|
|
180
180
|
|
|
181
181
|
## 错误处理
|
|
@@ -167,10 +167,10 @@ Output file:
|
|
|
167
167
|
Important: human review checkpoint.
|
|
168
168
|
Please review the technical plan before continuing to implementation.
|
|
169
169
|
|
|
170
|
-
Next step -
|
|
171
|
-
- Claude Code / OpenCode: /
|
|
172
|
-
- Gemini CLI: /{{project}}:
|
|
173
|
-
- Codex CLI: $
|
|
170
|
+
Next step - review the technical plan:
|
|
171
|
+
- Claude Code / OpenCode: /review-plan {task-id}
|
|
172
|
+
- Gemini CLI: /{{project}}:review-plan {task-id}
|
|
173
|
+
- Codex CLI: $review-plan {task-id}
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
## Completion Checklist
|
|
@@ -167,10 +167,10 @@ node .agents/scripts/validate-artifact.js gate plan-task .agents/workspace/activ
|
|
|
167
167
|
重要:人工审查检查点。
|
|
168
168
|
请在继续实现之前审查技术方案。
|
|
169
169
|
|
|
170
|
-
下一步 -
|
|
171
|
-
- Claude Code / OpenCode:/
|
|
172
|
-
- Gemini CLI:/
|
|
173
|
-
- Codex CLI:$
|
|
170
|
+
下一步 - 审查技术方案:
|
|
171
|
+
- Claude Code / OpenCode:/review-plan {task-id}
|
|
172
|
+
- Gemini CLI:/{{project}}:review-plan {task-id}
|
|
173
|
+
- Codex CLI:$review-plan {task-id}
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
## 完成检查清单
|
|
@@ -43,10 +43,11 @@ Rules:
|
|
|
43
43
|
- map `{file-stem}` back to filenames:
|
|
44
44
|
- `task` -> `task.md`
|
|
45
45
|
- `analysis` / `analysis-r{N}` -> matching `.md`
|
|
46
|
+
- `review-analysis` / `review-analysis-r{N}` -> matching `.md`
|
|
46
47
|
- `plan` / `plan-r{N}` -> matching `.md`
|
|
47
|
-
- `
|
|
48
|
-
- `
|
|
49
|
-
- `
|
|
48
|
+
- `review-plan` / `review-plan-r{N}` -> matching `.md`
|
|
49
|
+
- `code` / `code-r{N}` -> matching `.md`
|
|
50
|
+
- `review-code` / `review-code-r{N}` -> matching `.md`
|
|
50
51
|
|
|
51
52
|
### 4. Process Chunks and Check the Local Directory
|
|
52
53
|
|
|
@@ -43,10 +43,11 @@ description: "从平台 Issue 评论还原本地任务文件"
|
|
|
43
43
|
- 将 `{file-stem}` 映射回文件名:
|
|
44
44
|
- `task` -> `task.md`
|
|
45
45
|
- `analysis` / `analysis-r{N}` -> 对应 `.md`
|
|
46
|
+
- `review-analysis` / `review-analysis-r{N}` -> 对应 `.md`
|
|
46
47
|
- `plan` / `plan-r{N}` -> 对应 `.md`
|
|
47
|
-
- `
|
|
48
|
-
- `
|
|
49
|
-
- `
|
|
48
|
+
- `review-plan` / `review-plan-r{N}` -> 对应 `.md`
|
|
49
|
+
- `code` / `code-r{N}` -> 对应 `.md`
|
|
50
|
+
- `review-code` / `review-code-r{N}` -> 对应 `.md`
|
|
50
51
|
|
|
51
52
|
### 4. 处理分片并检查本地目录
|
|
52
53
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-analysis
|
|
3
|
+
description: "Review the requirement analysis artifact"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Requirement Analysis Review
|
|
7
|
+
|
|
8
|
+
Review the latest analysis artifact and produce `review-analysis.md` or `review-analysis-r{N}.md`.
|
|
9
|
+
|
|
10
|
+
## Boundary / Critical Rules
|
|
11
|
+
|
|
12
|
+
- This skill only reviews analysis artifacts and writes a report; it does not modify product code.
|
|
13
|
+
- After executing this skill, you **must** immediately update task.md.
|
|
14
|
+
|
|
15
|
+
Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
|
|
16
|
+
|
|
17
|
+
## Step 0: State Check (pre-execution hard gate)
|
|
18
|
+
|
|
19
|
+
After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first.
|
|
20
|
+
|
|
21
|
+
Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git status -s
|
|
25
|
+
ls -la .agents/workspace/active/{task-id}/
|
|
26
|
+
tail .agents/workspace/active/{task-id}/task.md
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Steps
|
|
30
|
+
|
|
31
|
+
### 1. Verify Prerequisites
|
|
32
|
+
|
|
33
|
+
Require `task.md` and at least one analysis artifact: `analysis.md` or `analysis-r{N}.md`.
|
|
34
|
+
|
|
35
|
+
### 2. Determine Review Round
|
|
36
|
+
|
|
37
|
+
Record `{analysis-artifact}`, `{review-round}`, and `{review-artifact}` (`review-analysis.md` or `review-analysis-r{N}.md`).
|
|
38
|
+
|
|
39
|
+
### 3. Read Analysis Context
|
|
40
|
+
|
|
41
|
+
Read `{analysis-artifact}`, `task.md`, and Issue context when available.
|
|
42
|
+
|
|
43
|
+
### 4. Perform Review
|
|
44
|
+
|
|
45
|
+
Check requirement completeness, risks, affected scope, open questions, and effort estimates.
|
|
46
|
+
|
|
47
|
+
> Read `reference/review-criteria.md` before this step.
|
|
48
|
+
|
|
49
|
+
### 5. Write Review Report
|
|
50
|
+
|
|
51
|
+
Create `.agents/workspace/active/{task-id}/{review-artifact}`.
|
|
52
|
+
|
|
53
|
+
> Read `reference/report-template.md` before writing the report.
|
|
54
|
+
|
|
55
|
+
### 6. Update Task Status
|
|
56
|
+
|
|
57
|
+
Get the current time:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
date "+%Y-%m-%d %H:%M:%S%:z"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Set `current_step` to `requirement-analysis-review`, refresh task metadata, and append:
|
|
64
|
+
`- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Analysis Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
|
|
65
|
+
|
|
66
|
+
If task.md has a valid `issue_number`, read `.agents/rules/issue-sync.md`, sync the task comment, and publish the `{review-artifact}` comment.
|
|
67
|
+
|
|
68
|
+
### 7. Run Completion Gate
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
node .agents/scripts/validate-artifact.js gate review-analysis .agents/workspace/active/{task-id} {review-artifact} --format text
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 8. Tell the User
|
|
75
|
+
|
|
76
|
+
Use the conclusion branch in `reference/output-templates.md` and show all TUI command formats.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-analysis
|
|
3
|
+
description: "审查需求分析报告"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 需求分析审查
|
|
7
|
+
|
|
8
|
+
审查最新需求分析产物,并产出 `review-analysis.md` 或 `review-analysis-r{N}.md`。
|
|
9
|
+
|
|
10
|
+
## 行为边界 / 关键规则
|
|
11
|
+
|
|
12
|
+
- 本技能只审查分析产物并写报告,不修改业务代码
|
|
13
|
+
- 执行本技能后,你**必须**立即更新 task.md
|
|
14
|
+
|
|
15
|
+
版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
|
|
16
|
+
|
|
17
|
+
## 第 0 步:状态核对(执行前硬约束)
|
|
18
|
+
|
|
19
|
+
在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
|
|
20
|
+
|
|
21
|
+
运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git status -s
|
|
25
|
+
ls -la .agents/workspace/active/{task-id}/
|
|
26
|
+
tail .agents/workspace/active/{task-id}/task.md
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
状态核对完成前,禁止任何关于外部状态的断言。
|
|
30
|
+
|
|
31
|
+
## 执行步骤
|
|
32
|
+
|
|
33
|
+
### 1. 验证前置条件
|
|
34
|
+
|
|
35
|
+
要求存在:
|
|
36
|
+
- `.agents/workspace/active/{task-id}/task.md`
|
|
37
|
+
- 至少一个分析产物:`analysis.md` 或 `analysis-r{N}.md`
|
|
38
|
+
|
|
39
|
+
### 2. 确定审查轮次
|
|
40
|
+
|
|
41
|
+
扫描任务目录并记录:
|
|
42
|
+
- `{analysis-artifact}`:最高轮次的分析产物
|
|
43
|
+
- `{review-round}`
|
|
44
|
+
- `{review-artifact}`:`review-analysis.md` 或 `review-analysis-r{N}.md`
|
|
45
|
+
|
|
46
|
+
### 3. 阅读分析上下文
|
|
47
|
+
|
|
48
|
+
读取最新 `{analysis-artifact}`、`task.md` 和关联 Issue 上下文(如有)。
|
|
49
|
+
|
|
50
|
+
### 4. 执行审查
|
|
51
|
+
|
|
52
|
+
重点检查需求完整性、风险识别、影响范围、开放问题和工作量评估。
|
|
53
|
+
|
|
54
|
+
> 详细审查标准见 `reference/review-criteria.md`。执行此步骤前先读取 `reference/review-criteria.md`。
|
|
55
|
+
|
|
56
|
+
### 5. 编写审查报告
|
|
57
|
+
|
|
58
|
+
创建 `.agents/workspace/active/{task-id}/{review-artifact}`。
|
|
59
|
+
|
|
60
|
+
> 报告格式见 `reference/report-template.md`。写报告前先读取 `reference/report-template.md`。
|
|
61
|
+
|
|
62
|
+
### 6. 更新任务状态
|
|
63
|
+
|
|
64
|
+
获取当前时间:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
date "+%Y-%m-%d %H:%M:%S%:z"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
更新 task.md:
|
|
71
|
+
- `current_step`:requirement-analysis-review
|
|
72
|
+
- `assigned_to`:{当前代理}
|
|
73
|
+
- `updated_at`:{当前时间}
|
|
74
|
+
- `agent_infra_version`:按 `.agents/rules/version-stamp.md` 取值
|
|
75
|
+
- 追加:
|
|
76
|
+
`- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Analysis Review (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
|
|
77
|
+
|
|
78
|
+
如果 task.md 中存在有效的 `issue_number`,执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测,然后同步 task 评论并发布 `{review-artifact}` 评论。
|
|
79
|
+
|
|
80
|
+
### 7. 完成校验
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
node .agents/scripts/validate-artifact.js gate review-analysis .agents/workspace/active/{task-id} {review-artifact} --format text
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
校验通过后继续告知用户;校验失败则修复报告或 task 状态后重跑。
|
|
87
|
+
|
|
88
|
+
### 8. 告知用户
|
|
89
|
+
|
|
90
|
+
按 `reference/output-templates.md` 的结论分支输出,并展示所有 TUI 的下一步命令。
|
|
91
|
+
|
|
92
|
+
## 完成检查清单
|
|
93
|
+
|
|
94
|
+
- [ ] 已审查最新分析上下文
|
|
95
|
+
- [ ] 已创建 `{review-artifact}`
|
|
96
|
+
- [ ] 已更新 task.md 并追加 Activity Log
|
|
97
|
+
- [ ] 已展示所有 TUI 的下一步命令
|
|
98
|
+
|
|
99
|
+
## 注意事项
|
|
100
|
+
|
|
101
|
+
- 首轮审查使用 `review-analysis.md`,后续轮次使用 `review-analysis-r{N}.md`
|
|
102
|
+
- 所有问题都要引用具体文件路径和行号;分析产物问题可引用 `{analysis-artifact}` 的行号
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "review-analysis",
|
|
3
|
+
"checks": {
|
|
4
|
+
"task-meta": {
|
|
5
|
+
"required_fields": [
|
|
6
|
+
"id",
|
|
7
|
+
"type",
|
|
8
|
+
"workflow",
|
|
9
|
+
"status",
|
|
10
|
+
"created_at",
|
|
11
|
+
"updated_at",
|
|
12
|
+
"agent_infra_version",
|
|
13
|
+
"current_step",
|
|
14
|
+
"assigned_to"
|
|
15
|
+
],
|
|
16
|
+
"expected_step": "requirement-analysis-review"
|
|
17
|
+
},
|
|
18
|
+
"artifact": {
|
|
19
|
+
"file_pattern": "review-analysis.md|review-analysis-r{N}.md",
|
|
20
|
+
"required_sections": [
|
|
21
|
+
"Review Summary",
|
|
22
|
+
"Findings",
|
|
23
|
+
"Environment-Blocked Findings",
|
|
24
|
+
"Conclusion and Recommendations",
|
|
25
|
+
"State Check",
|
|
26
|
+
"Evidence"
|
|
27
|
+
],
|
|
28
|
+
"required_patterns": [
|
|
29
|
+
"^### Approval Decision$",
|
|
30
|
+
"^\\$ "
|
|
31
|
+
],
|
|
32
|
+
"freshness_minutes": 30
|
|
33
|
+
},
|
|
34
|
+
"activity-log": {
|
|
35
|
+
"expected_action_pattern": "Analysis Review \\(Round \\d+\\)",
|
|
36
|
+
"freshness_minutes": 30
|
|
37
|
+
},
|
|
38
|
+
"platform-sync": {
|
|
39
|
+
"when": "issue_number_exists",
|
|
40
|
+
"expected_status_label": "status: pending-design-work",
|
|
41
|
+
"expected_comment_marker": "<!-- sync-issue:{task-id}:{artifact-stem} -->",
|
|
42
|
+
"verify_comment_content": true,
|
|
43
|
+
"verify_task_comment_content": true,
|
|
44
|
+
"verify_issue_type": true,
|
|
45
|
+
"verify_issue_fields": false,
|
|
46
|
+
"verify_milestone": true,
|
|
47
|
+
"expected_status_label_key": "pendingDesignWork",
|
|
48
|
+
"expected_comment_marker_key": "artifact"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|