@fitlab-ai/agent-infra 0.7.5 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.ts +11 -3
- package/dist/bin/cli.js +10 -3
- package/dist/lib/sandbox/commands/create.js +26 -4
- package/dist/lib/sandbox/commands/ls.js +4 -33
- package/dist/lib/sandbox/commands/show.js +67 -0
- package/dist/lib/sandbox/index.js +7 -0
- package/dist/lib/sandbox/tools.js +20 -1
- package/dist/lib/task/commands/issue-body.js +94 -0
- package/dist/lib/task/commands/log.js +139 -6
- package/dist/lib/task/index.js +8 -0
- package/dist/lib/task/issue-form.js +66 -0
- package/dist/lib/task/sections.js +44 -0
- package/lib/sandbox/commands/create.ts +33 -4
- package/lib/sandbox/commands/ls.ts +4 -36
- package/lib/sandbox/commands/show.ts +80 -0
- package/lib/sandbox/index.ts +7 -0
- package/lib/sandbox/tools.ts +28 -1
- package/lib/task/commands/issue-body.ts +102 -0
- package/lib/task/commands/log.ts +146 -6
- package/lib/task/index.ts +8 -0
- package/lib/task/issue-form.ts +77 -0
- package/lib/task/sections.ts +44 -0
- package/package.json +3 -2
- package/templates/.agents/README.en.md +3 -1
- package/templates/.agents/README.zh-CN.md +3 -1
- package/templates/.agents/rules/create-issue.github.en.md +20 -29
- package/templates/.agents/rules/create-issue.github.zh-CN.md +20 -29
- package/templates/.agents/rules/issue-pr-commands.github.en.md +6 -0
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +6 -0
- package/templates/.agents/rules/next-step-output.en.md +26 -1
- package/templates/.agents/rules/next-step-output.zh-CN.md +26 -1
- package/templates/.agents/rules/no-mid-flow-questions.en.md +11 -0
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +11 -0
- package/templates/.agents/rules/review-handshake.en.md +15 -1
- package/templates/.agents/rules/review-handshake.zh-CN.md +15 -1
- package/templates/.agents/rules/task-management.en.md +27 -0
- package/templates/.agents/rules/task-management.zh-CN.md +31 -0
- package/templates/.agents/scripts/validate-artifact.js +11 -2
- package/templates/.agents/skills/analyze-task/SKILL.en.md +14 -1
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +14 -1
- package/templates/.agents/skills/archive-tasks/SKILL.en.md +3 -1
- package/templates/.agents/skills/archive-tasks/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/block-task/SKILL.en.md +13 -1
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +13 -1
- package/templates/.agents/skills/cancel-task/SKILL.en.md +13 -1
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +14 -2
- package/templates/.agents/skills/check-task/SKILL.en.md +30 -81
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +30 -80
- package/templates/.agents/skills/close-codescan/SKILL.en.md +13 -1
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +13 -1
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +13 -1
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +13 -1
- package/templates/.agents/skills/code-task/SKILL.en.md +14 -1
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +14 -1
- package/templates/.agents/skills/code-task/reference/dual-mode.en.md +7 -2
- package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +7 -2
- package/templates/.agents/skills/code-task/scripts/detect-mode.js +6 -14
- package/templates/.agents/skills/commit/SKILL.en.md +37 -5
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +37 -5
- package/templates/.agents/skills/complete-task/SKILL.en.md +13 -1
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +13 -1
- package/templates/.agents/skills/create-pr/SKILL.en.md +23 -2
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +23 -2
- package/templates/.agents/skills/create-release-note/SKILL.en.md +19 -2
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +19 -2
- package/templates/.agents/skills/create-task/SKILL.en.md +14 -1
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +17 -4
- package/templates/.agents/skills/import-codescan/SKILL.en.md +14 -1
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +14 -1
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +14 -1
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +14 -1
- package/templates/.agents/skills/import-issue/SKILL.en.md +35 -2
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +35 -2
- package/templates/.agents/skills/init-labels/SKILL.en.md +3 -1
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/init-milestones/SKILL.en.md +3 -1
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/plan-task/SKILL.en.md +15 -1
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +15 -1
- package/templates/.agents/skills/post-release/SKILL.en.md +3 -1
- package/templates/.agents/skills/post-release/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/refine-title/SKILL.en.md +3 -1
- package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/release/SKILL.en.md +3 -1
- package/templates/.agents/skills/release/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/restore-task/SKILL.en.md +13 -1
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +13 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +16 -2
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +16 -2
- package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +1 -1
- package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +1 -1
- package/templates/.agents/skills/review-analysis/reference/report-template.en.md +1 -1
- package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +1 -2
- package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +1 -0
- package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +1 -0
- package/templates/.agents/skills/review-code/SKILL.en.md +15 -2
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +15 -2
- package/templates/.agents/skills/review-code/reference/output-templates.en.md +1 -1
- package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +1 -1
- package/templates/.agents/skills/review-code/reference/report-template.en.md +1 -1
- package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +1 -2
- package/templates/.agents/skills/review-code/reference/review-criteria.en.md +1 -0
- package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +1 -0
- package/templates/.agents/skills/review-plan/SKILL.en.md +16 -2
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +16 -2
- package/templates/.agents/skills/review-plan/reference/output-templates.en.md +1 -1
- package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +1 -1
- package/templates/.agents/skills/review-plan/reference/report-template.en.md +1 -1
- package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +1 -2
- package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +1 -0
- package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +1 -0
- package/templates/.agents/skills/test/SKILL.en.md +3 -1
- package/templates/.agents/skills/test/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/test-integration/SKILL.en.md +3 -1
- package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/update-agent-infra/SKILL.en.md +3 -1
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +3 -1
- package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/watch-pr/SKILL.en.md +13 -1
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +13 -1
- package/templates/.agents/templates/task.en.md +5 -0
- package/templates/.agents/templates/task.zh-CN.md +5 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: restore-task
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Restore local task files from platform Issue comments.
|
|
5
|
+
Use when local task files are missing and need rebuilding from platform Issue comments.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Restore Task
|
|
@@ -20,6 +22,16 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
|
|
|
20
22
|
|
|
21
23
|
> If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
22
24
|
|
|
25
|
+
## Step Start: Write the started Marker
|
|
26
|
+
|
|
27
|
+
After prerequisites pass and before this step's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this step's done entry plus a ` [started]` suffix, note `started`):
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Restore Task [started]** by {agent} — started
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`ai task log` pairs it with the done entry written on completion onto one row (in progress → done). See the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
|
|
34
|
+
|
|
23
35
|
## Steps
|
|
24
36
|
|
|
25
37
|
### 1. Verify Input and Environment
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: restore-task
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
从平台 Issue 评论还原本地任务文件。
|
|
5
|
+
当本地任务文件缺失、需要从平台 Issue 评论还原时使用。
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# 还原任务
|
|
@@ -20,6 +22,16 @@ description: "从平台 Issue 评论还原本地任务文件"
|
|
|
20
22
|
|
|
21
23
|
> 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
22
24
|
|
|
25
|
+
## 步骤开始:写入 started 标记
|
|
26
|
+
|
|
27
|
+
确认前置条件后、本步骤第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本步骤 done 条目同基名 + ` [started]` 后缀,note 用 `started`):
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Restore Task [started]** by {agent} — started
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`ai task log` 会把它与完成时写入的 done 条目配对成一行(进行中 → 已完成)。约定见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
|
|
34
|
+
|
|
23
35
|
## 执行步骤
|
|
24
36
|
### 1. 验证输入与环境
|
|
25
37
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-analysis
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Review the requirement analysis artifact.
|
|
5
|
+
Use when a requirements analysis needs an independent review before planning.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Requirement Analysis Review
|
|
@@ -30,6 +32,16 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
30
32
|
|
|
31
33
|
> If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
32
34
|
|
|
35
|
+
## Step Start: Write the started Marker
|
|
36
|
+
|
|
37
|
+
After prerequisites pass and before this round's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this round's done entry plus a ` [started]` suffix, note `started`):
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Analysis (Round {N}) [started]** by {agent} — started
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`ai task log` pairs it with the done entry written when the review completes onto one row (in progress → done). Format and pairing rules: see the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
|
|
44
|
+
|
|
33
45
|
## Steps
|
|
34
46
|
|
|
35
47
|
### 1. Verify Prerequisites
|
|
@@ -42,7 +54,7 @@ Record `{analysis-artifact}`, `{review-round}`, and `{review-artifact}` (`review
|
|
|
42
54
|
|
|
43
55
|
### 3. Read Analysis Context
|
|
44
56
|
|
|
45
|
-
Read `{analysis-artifact}`, `task.md`, and Issue context when available.
|
|
57
|
+
Read `{analysis-artifact}`, `task.md`, and Issue context when available. After reading, record the actually reviewed highest-round analysis artifact by filename in the report's `Review Input` field; leave it blank when it cannot be reliably determined—do not fabricate.
|
|
46
58
|
|
|
47
59
|
### 4. Perform Review
|
|
48
60
|
|
|
@@ -67,6 +79,8 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
67
79
|
Set `current_step` to `requirement-analysis-review`, refresh task metadata, and append:
|
|
68
80
|
`- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Analysis (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
|
|
69
81
|
|
|
82
|
+
`env-blocked` is the data source for the `Manual-verify` count folded into review rows in `ai task log`; do not add a parallel manual-verification field.
|
|
83
|
+
|
|
70
84
|
If task.md has a valid `issue_number`, read `.agents/rules/issue-sync.md`, sync the task comment, and publish the `{review-artifact}` comment.
|
|
71
85
|
|
|
72
86
|
### 7. Run Completion Gate
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-analysis
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
审查需求分析报告。
|
|
5
|
+
当需求分析需要在进入方案前接受独立审查时使用。
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# 需求分析审查
|
|
@@ -32,6 +34,16 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
32
34
|
|
|
33
35
|
> 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
34
36
|
|
|
37
|
+
## 步骤开始:写入 started 标记
|
|
38
|
+
|
|
39
|
+
确认前置条件后、本轮第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本轮 done 条目同基名 + ` [started]` 后缀,note 用 `started`):
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Analysis (Round {N}) [started]** by {agent} — started
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`ai task log` 会把它与审查完成时写入的 done 条目配对成一行(进行中 → 已完成)。格式与配对规则见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
|
|
46
|
+
|
|
35
47
|
## 执行步骤
|
|
36
48
|
### 1. 验证前置条件
|
|
37
49
|
|
|
@@ -48,7 +60,7 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
48
60
|
|
|
49
61
|
### 3. 阅读分析上下文
|
|
50
62
|
|
|
51
|
-
读取最新 `{analysis-artifact}`、`task.md` 和关联 Issue
|
|
63
|
+
读取最新 `{analysis-artifact}`、`task.md` 和关联 Issue 上下文(如有)。读取后,把本轮实际检视的最高轮 analysis artifact 文件名回填到报告 `审查输入` 段;无法可靠取得时留空,不要伪造。
|
|
52
64
|
|
|
53
65
|
### 4. 执行审查
|
|
54
66
|
|
|
@@ -78,6 +90,8 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
78
90
|
- 追加:
|
|
79
91
|
`- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Analysis (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
|
|
80
92
|
|
|
93
|
+
`env-blocked` 是 `ai task log` 中 review 行「人工校验点」(EN `Manual-verify`)计数的数据源;不要新增并行人工验证字段。
|
|
94
|
+
|
|
81
95
|
如果 task.md 中存在有效的 `issue_number`,执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测,然后同步 task 评论并发布 `{review-artifact}` 评论。
|
|
82
96
|
|
|
83
97
|
### 7. 完成校验
|
|
@@ -16,7 +16,7 @@ Rules:
|
|
|
16
16
|
- If `Blocker > 0`, never use an approved template
|
|
17
17
|
- Never count env-blocked items as blocker / major / minor or use them to trigger Scenario B/C/D
|
|
18
18
|
- The selected scenario must include all TUI command formats
|
|
19
|
-
- The count line always shows 4 numbers: the first three (Blockers / Major / Minor) must be 0 to proceed; the fourth, `Human-decision` (`{h}`), is the number of rows in task.md `## 审查分歧账本` with `stage=analysis` and `status=needs-human-decision` — a "pending human ruling" item that need not be zero and does not participate in scenario selection
|
|
19
|
+
- The count line always shows 4 numbers: the first three (Blockers / Major / Minor) must be 0 to proceed; the fourth, `Human-decision` (`{h}`), is the number of rows in task.md `## 审查分歧账本` with `stage=analysis` and `status=needs-human-decision` — a "pending human ruling" item that need not be zero and does not participate in scenario selection. When `{h} > 0`, before the selected scenario's "Next steps" commands you must expand each pending ruling per the "Pending human-decision pre-block" in `.agents/rules/next-step-output.md` and prompt to resolve them first
|
|
20
20
|
|
|
21
21
|
### Scenario A: Approved with no findings
|
|
22
22
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
- 只要 `Blocker > 0`,就绝对不能输出通过模板
|
|
17
17
|
- env-blocked 项绝对不能被计入 blocker / major / minor 计数,也不能用作触发场景 B/C/D 的依据
|
|
18
18
|
- 所选场景中必须包含所有 TUI 命令格式
|
|
19
|
-
- 计数行固定显示 4 个数字:前三项(阻塞 / 主要 / 次要)必须为 0 才进下一步;第四项 `人工裁决`(`{h}`)= task.md `## 审查分歧账本` 中 `stage=analysis` 且 `status=needs-human-decision`
|
|
19
|
+
- 计数行固定显示 4 个数字:前三项(阻塞 / 主要 / 次要)必须为 0 才进下一步;第四项 `人工裁决`(`{h}`)= task.md `## 审查分歧账本` 中 `stage=analysis` 且 `status=needs-human-decision` 的行数,是「待人裁」项、不要求归零,也不参与场景判断。当 `{h} > 0` 时,必须在选定场景的「下一步」命令之前,按 `.agents/rules/next-step-output.md`「人工裁决待办前置块」逐项展开裁决项并提示先完成裁决
|
|
20
20
|
|
|
21
21
|
### 场景 A:通过且无问题
|
|
22
22
|
|
|
@@ -10,7 +10,7 @@ Use this template when writing `review-analysis.md` or `review-analysis-r{N}.md`
|
|
|
10
10
|
- **Review Round**: Round {review-round}
|
|
11
11
|
- **Artifact File**: `{review-artifact}`
|
|
12
12
|
- **Review Input**:
|
|
13
|
-
- `{analysis-artifact}`
|
|
13
|
+
- `{analysis-artifact}` (the highest-round requirement-analysis artifact actually reviewed, e.g. `analysis-r2.md`; leave blank if it cannot be reliably determined)
|
|
14
14
|
|
|
15
15
|
## State Check
|
|
16
16
|
|
|
@@ -13,6 +13,7 @@ Follow the `analysis-review` step in `.agents/workflows/feature-development.yaml
|
|
|
13
13
|
- [ ] Risks, edge cases, and open questions are recorded
|
|
14
14
|
- [ ] The design stage has enough input to proceed
|
|
15
15
|
- [ ] The analysis matches the original Issue or user request
|
|
16
|
+
- [ ] The reviewer checked whether the executor missed any key design decision that should be upgraded to `[needs-human-decision]`
|
|
16
17
|
- [ ] Every blocker is backed by reproducible grep/sed/nl evidence; conclusions not directly verified are declared under Self-Doubt
|
|
17
18
|
|
|
18
19
|
**Common anti-examples**:
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-code
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Review code implementation and output a code review report.
|
|
5
|
+
Use when a code implementation needs review before merging.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Code Review
|
|
@@ -41,6 +43,16 @@ Before the state check is complete, do not make external-state assertions such a
|
|
|
41
43
|
|
|
42
44
|
> If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
43
45
|
|
|
46
|
+
## Step Start: Write the started Marker
|
|
47
|
+
|
|
48
|
+
After prerequisites pass and before this round's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this round's done entry plus a ` [started]` suffix, note `started`):
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Code (Round {N}) [started]** by {agent} — started
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`ai task log` pairs it with the done entry written when the review completes onto one row (in progress → done). Format and pairing rules: see the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
|
|
55
|
+
|
|
44
56
|
## Steps
|
|
45
57
|
|
|
46
58
|
### 1. Verify Prerequisites
|
|
@@ -57,7 +69,7 @@ Scan the task directory and record:
|
|
|
57
69
|
|
|
58
70
|
### 3. Read Implementation and Refinement Context
|
|
59
71
|
|
|
60
|
-
Read the highest-round code artifact and, if present, the highest-round fix artifact.
|
|
72
|
+
Read the highest-round code artifact and, if present, the highest-round fix artifact. After reading, record the actually reviewed highest-round code artifact (and the highest-round fix artifact, if present) by filename in the report's `Review Input` field; leave it blank when it cannot be reliably determined—do not fabricate.
|
|
61
73
|
|
|
62
74
|
### 4. Perform the Review
|
|
63
75
|
|
|
@@ -87,6 +99,7 @@ Update task.md and append:
|
|
|
87
99
|
`- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Code (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {artifact-filename}`
|
|
88
100
|
|
|
89
101
|
Omit the bracketed segment when env-blocked = 0; append ` (+ {n} env-blocked)` when env-blocked > 0.
|
|
102
|
+
`env-blocked` is the data source for the `Manual-verify` count folded into review rows in `ai task log`; do not add a parallel manual-verification field.
|
|
90
103
|
|
|
91
104
|
If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
|
|
92
105
|
- Read `.agents/rules/issue-sync.md` before syncing, and complete upstream repository detection plus permission detection
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-code
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
审查代码实现并输出代码审查报告。
|
|
5
|
+
当代码实现需要在合入前接受审查时使用。
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# 代码审查
|
|
@@ -41,6 +43,16 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
41
43
|
|
|
42
44
|
> 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
43
45
|
|
|
46
|
+
## 步骤开始:写入 started 标记
|
|
47
|
+
|
|
48
|
+
确认前置条件后、本轮第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本轮 done 条目同基名 + ` [started]` 后缀,note 用 `started`):
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Code (Round {N}) [started]** by {agent} — started
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`ai task log` 会把它与审查完成时写入的 done 条目配对成一行(进行中 → 已完成)。格式与配对规则见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
|
|
55
|
+
|
|
44
56
|
## 执行步骤
|
|
45
57
|
### 1. 验证前置条件
|
|
46
58
|
|
|
@@ -56,7 +68,7 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
56
68
|
|
|
57
69
|
### 3. 阅读实现与修复上下文
|
|
58
70
|
|
|
59
|
-
|
|
71
|
+
读取最高轮次的实现产物;如存在修复产物,也读取最高轮次的修复产物。读取后,把本轮实际检视的最高轮 code artifact(及如存在的最高轮修复产物)按文件名回填到报告 `审查输入` 段;无法可靠取得时留空,不要伪造。
|
|
60
72
|
|
|
61
73
|
### 4. 执行审查
|
|
62
74
|
|
|
@@ -90,6 +102,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
90
102
|
`- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Code (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {artifact-filename}`
|
|
91
103
|
|
|
92
104
|
env-blocked = 0 时省略括号部分;env-blocked > 0 时附加 ` (+ {n} env-blocked)`。
|
|
105
|
+
`env-blocked` 是 `ai task log` 中 review 行「人工校验点」(EN `Manual-verify`)计数的数据源;不要新增并行人工验证字段。
|
|
93
106
|
|
|
94
107
|
如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
|
|
95
108
|
- 执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测
|
|
@@ -18,7 +18,7 @@ Prohibitions:
|
|
|
18
18
|
- if `Blocker > 0`, never output an approval template
|
|
19
19
|
- never count env-blocked findings as blockers / major issues / minor issues, and never use them to trigger Branch B/C/D
|
|
20
20
|
- always include every TUI command format in the selected branch
|
|
21
|
-
- the count line always shows 5 numbers: the first three (Blockers / Major / Minor) must be 0 to proceed; the last two are "pending human" items and need not be zero — `Manual-verify` (`{e}`) = this round's env-blocked count, `Human-decision` (`{h}`) = the number of rows in task.md `## 审查分歧账本` with `stage=code` and `status=needs-human-decision`; neither participates in branch selection
|
|
21
|
+
- the count line always shows 5 numbers: the first three (Blockers / Major / Minor) must be 0 to proceed; the last two are "pending human" items and need not be zero — `Manual-verify` (`{e}`) = this round's env-blocked count, `Human-decision` (`{h}`) = the number of rows in task.md `## 审查分歧账本` with `stage=code` and `status=needs-human-decision`; neither participates in branch selection. When `{h} > 0`, before the selected scenario's "Next steps" commands you must expand each pending ruling per the "Pending human-decision pre-block" in `.agents/rules/next-step-output.md` and prompt to resolve them first
|
|
22
22
|
|
|
23
23
|
### Branch A: Approved with No Findings
|
|
24
24
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
- 只要 `Blocker > 0`,就绝对不能输出通过模板
|
|
19
19
|
- env-blocked 项绝对不能被计入 blocker / major / minor 计数,也不能用作触发场景 B/C/D 的依据
|
|
20
20
|
- 所选场景中必须包含所有 TUI 命令格式
|
|
21
|
-
- 计数行固定显示 5 个数字:前三项(阻塞 / 主要 / 次要)必须为 0 才进下一步;后两项是「待人处理」项、不要求归零——`人工校验点`(`{e}`)= 本轮 env-blocked 计数,`人工裁决`(`{h}`)= task.md `## 审查分歧账本` 中 `stage=code` 且 `status=needs-human-decision`
|
|
21
|
+
- 计数行固定显示 5 个数字:前三项(阻塞 / 主要 / 次要)必须为 0 才进下一步;后两项是「待人处理」项、不要求归零——`人工校验点`(`{e}`)= 本轮 env-blocked 计数,`人工裁决`(`{h}`)= task.md `## 审查分歧账本` 中 `stage=code` 且 `status=needs-human-decision` 的行数;二者均不参与场景判断。当 `{h} > 0` 时,必须在选定场景的「下一步」命令之前,按 `.agents/rules/next-step-output.md`「人工裁决待办前置块」逐项展开裁决项并提示先完成裁决
|
|
22
22
|
|
|
23
23
|
### 场景 A:通过且无问题
|
|
24
24
|
|
|
@@ -10,7 +10,7 @@ Use this template when writing `review-code.md` or `review-code-r{N}.md`.
|
|
|
10
10
|
- **Review Round**: Round {review-round}
|
|
11
11
|
- **Artifact File**: `{review-artifact}`
|
|
12
12
|
- **Review Input**:
|
|
13
|
-
- `{code-artifact}`
|
|
13
|
+
- `{code-artifact}` (the highest-round implementation artifact actually reviewed—plus the highest-round fix artifact if present, e.g. `code-r2.md`; leave blank if it cannot be reliably determined)
|
|
14
14
|
|
|
15
15
|
## State Check
|
|
16
16
|
|
|
@@ -14,6 +14,7 @@ Follow the `code-review` step in `.agents/workflows/feature-development.yaml`.
|
|
|
14
14
|
- [ ] Performance and security risks
|
|
15
15
|
- [ ] Comments and documentation
|
|
16
16
|
- [ ] Consistency with the approved technical plan
|
|
17
|
+
- [ ] The reviewer checked whether the executor missed any key design decision that should be upgraded to `[needs-human-decision]`
|
|
17
18
|
- [ ] Every blocker is backed by reproducible grep/sed/nl evidence; conclusions not directly verified are declared under Self-Doubt
|
|
18
19
|
|
|
19
20
|
**Common anti-examples**:
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-plan
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Review the technical plan.
|
|
5
|
+
Use when a technical plan needs review before implementation.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Technical Plan Review
|
|
@@ -30,6 +32,16 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
30
32
|
|
|
31
33
|
> If `{task-id}` matches `^[#]?[0-9]+$` (bare numeric or `#`-prefixed), follow the "SKILL parameter resolver" section of `.agents/rules/task-short-id.md`; treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form for every downstream command.
|
|
32
34
|
|
|
35
|
+
## Step Start: Write the started Marker
|
|
36
|
+
|
|
37
|
+
After prerequisites pass and before this round's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this round's done entry plus a ` [started]` suffix, note `started`):
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Plan (Round {N}) [started]** by {agent} — started
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`ai task log` pairs it with the done entry written when the review completes onto one row (in progress → done). Format and pairing rules: see the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
|
|
44
|
+
|
|
33
45
|
## Steps
|
|
34
46
|
|
|
35
47
|
### 1. Verify Prerequisites
|
|
@@ -42,7 +54,7 @@ Record `{plan-artifact}`, `{review-round}`, and `{review-artifact}` (`review-pla
|
|
|
42
54
|
|
|
43
55
|
### 3. Read Plan Context
|
|
44
56
|
|
|
45
|
-
Read `{plan-artifact}`, the latest analysis artifact, `task.md`, and Issue context when available.
|
|
57
|
+
Read `{plan-artifact}`, the latest analysis artifact, `task.md`, and Issue context when available. After reading, record the actually reviewed highest-round plan artifact by filename in the report's `Review Input` field; leave it blank when it cannot be reliably determined—do not fabricate.
|
|
46
58
|
|
|
47
59
|
### 4. Perform Review
|
|
48
60
|
|
|
@@ -67,6 +79,8 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
67
79
|
Set `current_step` to `technical-design-review`, refresh task metadata, and append:
|
|
68
80
|
`- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Plan (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
|
|
69
81
|
|
|
82
|
+
`env-blocked` is the data source for the `Manual-verify` count folded into review rows in `ai task log`; do not add a parallel manual-verification field.
|
|
83
|
+
|
|
70
84
|
If task.md has a valid `issue_number`, read `.agents/rules/issue-sync.md`, sync the task comment, and publish the `{review-artifact}` comment.
|
|
71
85
|
|
|
72
86
|
### 7. Run Completion Gate
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-plan
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
审查技术方案。
|
|
5
|
+
当技术方案需要在进入实现前接受审查时使用。
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# 技术方案审查
|
|
@@ -32,6 +34,16 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
32
34
|
|
|
33
35
|
> 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
|
|
34
36
|
|
|
37
|
+
## 步骤开始:写入 started 标记
|
|
38
|
+
|
|
39
|
+
确认前置条件后、本轮第一个产出动作之前,向 task.md `## 活动日志` 追加一条 started 标记(与本轮 done 条目同基名 + ` [started]` 后缀,note 用 `started`):
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Plan (Round {N}) [started]** by {agent} — started
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`ai task log` 会把它与审查完成时写入的 done 条目配对成一行(进行中 → 已完成)。格式与配对规则见 `.agents/rules/task-management.md` 的「Activity Log started / done 双标记约定」。
|
|
46
|
+
|
|
35
47
|
## 执行步骤
|
|
36
48
|
### 1. 验证前置条件
|
|
37
49
|
|
|
@@ -48,7 +60,7 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
48
60
|
|
|
49
61
|
### 3. 阅读方案上下文
|
|
50
62
|
|
|
51
|
-
读取最新 `{plan-artifact}`、最新分析产物、`task.md` 和关联 Issue
|
|
63
|
+
读取最新 `{plan-artifact}`、最新分析产物、`task.md` 和关联 Issue 上下文(如有)。读取后,把本轮实际检视的最高轮 plan artifact 文件名回填到报告 `审查输入` 段;无法可靠取得时留空,不要伪造。
|
|
52
64
|
|
|
53
65
|
### 4. 执行审查
|
|
54
66
|
|
|
@@ -78,6 +90,8 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
78
90
|
- 追加:
|
|
79
91
|
`- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Review Plan (Round {N})** by {agent} — Verdict: {Approved/Changes Requested/Rejected}, blockers: {n}, major: {n}, minor: {n}[ (+ {n} env-blocked)] → {review-artifact}`
|
|
80
92
|
|
|
93
|
+
`env-blocked` 是 `ai task log` 中 review 行「人工校验点」(EN `Manual-verify`)计数的数据源;不要新增并行人工验证字段。
|
|
94
|
+
|
|
81
95
|
如果 task.md 中存在有效的 `issue_number`,执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测,然后同步 task 评论并发布 `{review-artifact}` 评论。
|
|
82
96
|
|
|
83
97
|
### 7. 完成校验
|
|
@@ -16,7 +16,7 @@ Rules:
|
|
|
16
16
|
- If `Blocker > 0`, never use an approved template
|
|
17
17
|
- Never count env-blocked items as blocker / major / minor or use them to trigger Scenario B/C/D
|
|
18
18
|
- The selected scenario must include all TUI command formats
|
|
19
|
-
- The count line always shows 4 numbers: the first three (Blockers / Major / Minor) must be 0 to proceed; the fourth, `Human-decision` (`{h}`), is the number of rows in task.md `## 审查分歧账本` with `stage=plan` and `status=needs-human-decision` — a "pending human ruling" item that need not be zero and does not participate in scenario selection
|
|
19
|
+
- The count line always shows 4 numbers: the first three (Blockers / Major / Minor) must be 0 to proceed; the fourth, `Human-decision` (`{h}`), is the number of rows in task.md `## 审查分歧账本` with `stage=plan` and `status=needs-human-decision` — a "pending human ruling" item that need not be zero and does not participate in scenario selection. When `{h} > 0`, before the selected scenario's "Next steps" commands you must expand each pending ruling per the "Pending human-decision pre-block" in `.agents/rules/next-step-output.md` and prompt to resolve them first
|
|
20
20
|
|
|
21
21
|
### Scenario A: Approved with no findings
|
|
22
22
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
- 只要 `Blocker > 0`,就绝对不能输出通过模板
|
|
17
17
|
- env-blocked 项绝对不能被计入 blocker / major / minor 计数,也不能用作触发场景 B/C/D 的依据
|
|
18
18
|
- 所选场景中必须包含所有 TUI 命令格式
|
|
19
|
-
- 计数行固定显示 4 个数字:前三项(阻塞 / 主要 / 次要)必须为 0 才进下一步;第四项 `人工裁决`(`{h}`)= task.md `## 审查分歧账本` 中 `stage=plan` 且 `status=needs-human-decision`
|
|
19
|
+
- 计数行固定显示 4 个数字:前三项(阻塞 / 主要 / 次要)必须为 0 才进下一步;第四项 `人工裁决`(`{h}`)= task.md `## 审查分歧账本` 中 `stage=plan` 且 `status=needs-human-decision` 的行数,是「待人裁」项、不要求归零,也不参与场景判断。当 `{h} > 0` 时,必须在选定场景的「下一步」命令之前,按 `.agents/rules/next-step-output.md`「人工裁决待办前置块」逐项展开裁决项并提示先完成裁决
|
|
20
20
|
|
|
21
21
|
### 场景 A:通过且无问题
|
|
22
22
|
|
|
@@ -10,7 +10,7 @@ Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
|
|
|
10
10
|
- **Review Round**: Round {review-round}
|
|
11
11
|
- **Artifact File**: `{review-artifact}`
|
|
12
12
|
- **Review Input**:
|
|
13
|
-
- `{plan-artifact}`
|
|
13
|
+
- `{plan-artifact}` (the highest-round technical-plan artifact actually reviewed, e.g. `plan-r2.md`; leave blank if it cannot be reliably determined)
|
|
14
14
|
|
|
15
15
|
## State Check
|
|
16
16
|
|
|
@@ -13,6 +13,7 @@ Follow the `design-review` step in `.agents/workflows/feature-development.yaml`.
|
|
|
13
13
|
- [ ] Test strategy covers critical paths, regression risks, and edge cases
|
|
14
14
|
- [ ] Risks, migration, rollback, or compatibility handling are sufficient
|
|
15
15
|
- [ ] The plan avoids over-design and unrelated scope expansion
|
|
16
|
+
- [ ] The reviewer checked whether the executor missed any key design decision that should be upgraded to `[needs-human-decision]`
|
|
16
17
|
- [ ] Every blocker is backed by reproducible grep/sed/nl evidence; conclusions not directly verified are declared under Self-Doubt
|
|
17
18
|
|
|
18
19
|
**Common anti-examples**:
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: update-agent-infra
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Update the project AI collaboration configuration.
|
|
5
|
+
Use when the project's AI collaboration configuration needs updating to the latest templates.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Update Project
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: watch-pr
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Watch a PR's required checks and self-heal on failure.
|
|
5
|
+
Use when you need to monitor a PR's required checks and auto-recover on failure.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Watch Pull Request
|
|
@@ -21,6 +23,16 @@ Version stamp rule: before creating or updating `task.md` frontmatter, read `.ag
|
|
|
21
23
|
|
|
22
24
|
> If the `{task-id}` argument matches `^[#]?[0-9]+$` (a bare number or `#`-prefixed), first read the "SKILL argument parsing" section of `.agents/rules/task-short-id.md` to resolve it; subsequent commands treat `{task-id}` as the resolved full `TASK-YYYYMMDD-HHMMSS` form.
|
|
23
25
|
|
|
26
|
+
## Step Start: Write the started Marker
|
|
27
|
+
|
|
28
|
+
After prerequisites pass and before this round's first artifact action, append a started marker to task.md `## Activity Log` (same base action as this round's done entry plus a ` [started]` suffix, note `started`):
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Watch PR (Round {N}) [started]** by {agent} — started
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`ai task log` pairs it with the done entry written on completion onto one row (in progress → done). See the "Activity Log started / done dual-marker convention" in `.agents/rules/task-management.md`.
|
|
35
|
+
|
|
24
36
|
## Steps
|
|
25
37
|
|
|
26
38
|
### 1. Resolve Arguments
|