@fitlab-ai/agent-infra 0.7.2 → 0.7.4
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 +35 -787
- package/README.zh-CN.md +37 -762
- package/bin/cli.ts +1 -1
- package/dist/bin/cli.js +1 -1
- package/dist/lib/defaults.json +0 -1
- package/dist/lib/init.js +0 -3
- package/dist/lib/sandbox/commands/create.js +44 -3
- package/dist/lib/sandbox/commands/enter.js +13 -15
- package/dist/lib/sandbox/commands/list-running.js +36 -1
- package/dist/lib/sandbox/commands/ls.js +9 -4
- package/dist/lib/sandbox/commands/rm.js +99 -19
- package/dist/lib/sandbox/commands/start.js +36 -0
- package/dist/lib/sandbox/index.js +11 -1
- package/dist/lib/sandbox/readme-scaffold.js +6 -6
- package/dist/lib/table.js +11 -2
- package/dist/lib/task/artifacts.js +58 -0
- package/dist/lib/task/commands/cat.js +38 -0
- package/dist/lib/task/commands/files.js +47 -0
- package/dist/lib/task/commands/grep.js +143 -0
- package/dist/lib/task/commands/log.js +75 -0
- package/dist/lib/task/commands/ls.js +1 -1
- package/dist/lib/task/commands/show.js +5 -114
- package/dist/lib/task/commands/status.js +239 -0
- package/dist/lib/task/index.js +37 -0
- package/dist/lib/task/resolve-ref.js +150 -0
- package/dist/lib/task/short-id.js +10 -0
- package/dist/lib/update.js +25 -8
- package/lib/defaults.json +0 -1
- package/lib/init.ts +0 -10
- package/lib/sandbox/commands/create.ts +47 -4
- package/lib/sandbox/commands/enter.ts +33 -14
- package/lib/sandbox/commands/list-running.ts +43 -1
- package/lib/sandbox/commands/ls.ts +12 -4
- package/lib/sandbox/commands/rm.ts +128 -19
- package/lib/sandbox/commands/start.ts +61 -0
- package/lib/sandbox/index.ts +11 -1
- package/lib/sandbox/readme-scaffold.ts +6 -6
- package/lib/table.ts +14 -2
- package/lib/task/artifacts.ts +72 -0
- package/lib/task/commands/cat.ts +39 -0
- package/lib/task/commands/files.ts +53 -0
- package/lib/task/commands/grep.ts +147 -0
- package/lib/task/commands/log.ts +80 -0
- package/lib/task/commands/ls.ts +1 -1
- package/lib/task/commands/show.ts +5 -117
- package/lib/task/commands/status.ts +302 -0
- package/lib/task/index.ts +37 -0
- package/lib/task/resolve-ref.ts +160 -0
- package/lib/task/short-id.ts +10 -0
- package/lib/update.ts +28 -10
- package/package.json +1 -1
- package/templates/.agents/README.en.md +1 -0
- package/templates/.agents/README.zh-CN.md +1 -0
- package/templates/.agents/hooks/auto-resume.sh +21 -4
- package/templates/.agents/rules/README.en.md +41 -0
- package/templates/.agents/rules/README.zh-CN.md +40 -0
- package/templates/.agents/rules/debugging-guide.en.md +25 -0
- package/templates/.agents/rules/debugging-guide.zh-CN.md +25 -0
- package/templates/.agents/rules/next-step-output.en.md +6 -3
- package/templates/.agents/rules/next-step-output.zh-CN.md +6 -3
- package/templates/.agents/rules/pr-checks-commands.en.md +5 -0
- package/templates/.agents/rules/pr-checks-commands.github.en.md +62 -0
- package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +62 -0
- package/templates/.agents/rules/pr-checks-commands.zh-CN.md +5 -0
- package/templates/.agents/rules/pr-sync.github.en.md +7 -0
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +7 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/block-task/SKILL.en.md +8 -1
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +8 -1
- package/templates/.agents/skills/cancel-task/SKILL.en.md +8 -1
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +8 -1
- package/templates/.agents/skills/check-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/close-codescan/SKILL.en.md +8 -1
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +8 -1
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +8 -1
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +8 -1
- package/templates/.agents/skills/code-task/SKILL.en.md +3 -1
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/commit/SKILL.en.md +2 -3
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +2 -3
- package/templates/.agents/skills/commit/reference/task-status-update.en.md +31 -23
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +31 -23
- package/templates/.agents/skills/complete-task/SKILL.en.md +36 -3
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +36 -3
- package/templates/.agents/skills/create-pr/SKILL.en.md +16 -7
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +16 -7
- package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -0
- package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -0
- package/templates/.agents/skills/create-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +1 -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 +1 -1
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-issue/SKILL.en.md +1 -1
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/plan-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/review-code/SKILL.en.md +1 -1
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/review-plan/SKILL.en.md +1 -1
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +0 -1
- package/templates/.agents/skills/watch-pr/SKILL.en.md +131 -0
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +131 -0
- package/templates/.agents/skills/watch-pr/config/verify.json +22 -0
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +43 -0
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +43 -0
- package/templates/.agents/templates/task.en.md +1 -0
- package/templates/.agents/templates/task.zh-CN.md +1 -0
- package/templates/.agents/workflows/bug-fix.en.yaml +6 -4
- package/templates/.agents/workflows/bug-fix.zh-CN.yaml +5 -4
- package/templates/.agents/workflows/feature-development.en.yaml +6 -4
- package/templates/.agents/workflows/feature-development.zh-CN.yaml +5 -4
- package/templates/.agents/workflows/refactoring.en.yaml +6 -4
- package/templates/.agents/workflows/refactoring.zh-CN.yaml +5 -4
- package/templates/.claude/commands/watch-pr.en.md +8 -0
- package/templates/.claude/commands/watch-pr.zh-CN.md +8 -0
- package/templates/.gemini/commands/_project_/watch-pr.en.toml +8 -0
- package/templates/.gemini/commands/_project_/watch-pr.zh-CN.toml +8 -0
- package/templates/.opencode/commands/watch-pr.en.md +11 -0
- package/templates/.opencode/commands/watch-pr.zh-CN.md +11 -0
|
@@ -101,7 +101,9 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
101
101
|
|
|
102
102
|
### 8. 告知用户
|
|
103
103
|
|
|
104
|
-
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
|
|
104
|
+
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `#NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
|
|
105
|
+
|
|
106
|
+
> **可选沙箱清理提示(门控渲染)**:仅当同时满足 (1) `.agents/.airc.json` 存在 `sandbox` 字段、(2) 第 7 步按告警号定位到了关联任务、(3) 该关联任务 task.md 的 `branch` 字段存在且不是 `main` / `master` 时,才渲染下方输出中「注意:…」之后、「下一步」之前的「可选:清理本任务的沙箱」块;任一不满足则整段省略。`{branch}` 取第 7 步定位到的关联任务 task.md 的 `branch` 值。该块独立于「下一步」语义。
|
|
105
107
|
|
|
106
108
|
```
|
|
107
109
|
安全告警 #{alert-number} 已关闭。
|
|
@@ -115,6 +117,11 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
115
117
|
|
|
116
118
|
注意:如有需要,可在平台侧重新打开。
|
|
117
119
|
|
|
120
|
+
可选:清理本任务的沙箱
|
|
121
|
+
(关联任务的沙箱容器和 per-branch 配置目录不会自动回收。如果不再需要可执行:)
|
|
122
|
+
|
|
123
|
+
ai sandbox rm {branch}
|
|
124
|
+
|
|
118
125
|
下一步 - 完成并归档任务(如有关联任务):
|
|
119
126
|
- Claude Code / OpenCode:/complete-task {task-ref}
|
|
120
127
|
- Gemini CLI:/agent-infra:complete-task {task-ref}
|
|
@@ -88,6 +88,8 @@ Follow the plan in order.
|
|
|
88
88
|
|
|
89
89
|
Use the project test commands from the `test` skill and iterate until all required tests pass.
|
|
90
90
|
|
|
91
|
+
When triaging a test failure or unexpected behavior, first read `.agents/rules/debugging-guide.md` and locate the root cause via its four-phase flow; do not blindly patch and retry.
|
|
92
|
+
|
|
91
93
|
### 9. Write the Code Report
|
|
92
94
|
|
|
93
95
|
Create `.agents/workspace/active/{task-id}/{code-artifact}`.
|
|
@@ -122,4 +124,4 @@ node .agents/scripts/validate-artifact.js gate code-task .agents/workspace/activ
|
|
|
122
124
|
|
|
123
125
|
Use `reference/output-template.md` (or `reference/fix-mode.md` in fix mode) and show all TUI command formats.
|
|
124
126
|
|
|
125
|
-
>
|
|
127
|
+
> Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the current task's short id `#NN` (see that file for lookup and fallback), while other `{task-id}` placeholders (report titles, paths) keep the full TASK-id form; (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
|
|
@@ -130,6 +130,8 @@ echo "$result"
|
|
|
130
130
|
|
|
131
131
|
如果测试失败,先尝试修复并重新运行测试。只有在确认存在外部阻塞、环境缺失或需求不明确且超出任务范围时,才可以停止。
|
|
132
132
|
|
|
133
|
+
排查测试失败或行为不符合预期时,先读取 `.agents/rules/debugging-guide.md`,按其四阶段流程定位根因,禁止盲目改代码重试。
|
|
134
|
+
|
|
133
135
|
### 9. 编写实现报告
|
|
134
136
|
|
|
135
137
|
创建 `.agents/workspace/active/{task-id}/{code-artifact}`。
|
|
@@ -181,7 +183,7 @@ node .agents/scripts/validate-artifact.js gate code-task .agents/workspace/activ
|
|
|
181
183
|
|
|
182
184
|
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。输出格式见 `reference/output-template.md`;修复模式输出见 `reference/fix-mode.md`。
|
|
183
185
|
|
|
184
|
-
>
|
|
186
|
+
> 渲染最终输出前先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令的 `{task-ref}` 渲染为当前任务短号 `#NN`(取值与回退见该文件),其他 `{task-id}` 占位(报告标题、路径)保持完整 TASK-id 形式;(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
|
|
185
187
|
|
|
186
188
|
## 完成检查清单
|
|
187
189
|
|
|
@@ -58,13 +58,12 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
58
58
|
|
|
59
59
|
> The full four-case status matrix, prerequisite checks, and multi-TUI next-step commands live in `reference/task-status-update.md`. Read `reference/task-status-update.md` before updating task state.
|
|
60
60
|
|
|
61
|
-
> **IMPORTANT**: When showing the next step, output every TUI command format in full and directly use the standard template from `reference/task-status-update.md`. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the
|
|
61
|
+
> **IMPORTANT**: When showing the next step, output every TUI command format in full and directly use the standard template from `reference/task-status-update.md`. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the short id `#NN` (falling back to the full TASK-id when unallocated or released); (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
|
|
62
62
|
|
|
63
63
|
Append the Commit Activity Log entry and choose exactly one next-step case:
|
|
64
|
-
- final commit -> `complete-task
|
|
64
|
+
- final commit -> render the next step by `.agents/.airc.json`'s `prFlow` (`disabled` -> single option `complete-task`; `required` -> single option `create-pr`; absent -> two options `create-pr` / `complete-task`); see Case 1 in `reference/task-status-update.md`
|
|
65
65
|
- more work remains -> update task.md and stop
|
|
66
66
|
- ready for review -> `review-code {task-id}`
|
|
67
|
-
- ready for PR (only when the project enables the PR flow, i.e. `requiresPullRequest !== false`) -> `create-pr`
|
|
68
67
|
|
|
69
68
|
## 6. Sync Issue Metadata When Applicable
|
|
70
69
|
|
|
@@ -58,13 +58,12 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
58
58
|
|
|
59
59
|
> 完整的 4 种状态分支、前置条件检查和多 TUI 下一步命令见 `reference/task-status-update.md`。更新任务状态前,先读取 `reference/task-status-update.md`。
|
|
60
60
|
|
|
61
|
-
> **重要**:向用户展示下一步时,必须完整输出所有 TUI 命令格式,并直接使用 `reference/task-status-update.md` 中对应场景的标准模板。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
|
|
61
|
+
> **重要**:向用户展示下一步时,必须完整输出所有 TUI 命令格式,并直接使用 `reference/task-status-update.md` 中对应场景的标准模板。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `#NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
|
|
62
62
|
|
|
63
63
|
追加 Commit 的 Activity Log,并且只能选择一个下一步分支:
|
|
64
|
-
- 最终提交 -> `complete-task
|
|
64
|
+
- 最终提交 -> 按 `.agents/.airc.json` 的 `prFlow` 渲染下一步(`disabled` → 单选 `complete-task`;`required` → 单选 `create-pr`;缺省 → 二选一 `create-pr` / `complete-task`),详见 `reference/task-status-update.md` 场景 1
|
|
65
65
|
- 还有后续工作 -> 更新 task.md 后停止
|
|
66
66
|
- 准备审查 -> `review-code {task-id}`
|
|
67
|
-
- 准备创建 PR(仅项目启用 PR 流程,即 `requiresPullRequest !== false`)-> `create-pr`
|
|
68
67
|
|
|
69
68
|
## 6. 同步 Issue 元数据(按需)
|
|
70
69
|
|
|
@@ -23,20 +23,19 @@ Before selecting the next step, verify:
|
|
|
23
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 `
|
|
26
|
+
**Gate read (project-level PR flow policy)**: Before running this step, read `.agents/.airc.json`'s `prFlow` field (three states: field absent = recommend PR by default, skipping allowed; `"required"` = PR mandatory; `"disabled"` = no PR flow). All branches that depend on this preference follow the same three states.
|
|
27
27
|
|
|
28
28
|
Choose exactly one case:
|
|
29
29
|
|
|
30
30
|
| Decision Basis | Required Case |
|
|
31
31
|
|---|---|
|
|
32
|
-
| all workflow steps completed + latest review approved with no findings + all tests passed | Case 1: final commit |
|
|
32
|
+
| all workflow steps completed + latest review approved with no findings + all tests passed | Case 1: final commit (render next step by `prFlow`) |
|
|
33
33
|
| unfinished steps, pending fixes, or waiting on others still exist | Case 2: more work remains |
|
|
34
34
|
| this commit prepares the task for code review | Case 3: ready for review |
|
|
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 |
|
|
36
35
|
|
|
37
36
|
Never apply more than one case. Match the single next-step branch first, then update the task.
|
|
38
37
|
|
|
39
|
-
**
|
|
38
|
+
**Case 1 next-step rendering (evaluate the `prFlow` strong constraint first)**: the terminal "final commit" next step is rendered by `prFlow` -- `"disabled"` -> single option "complete directly" (`/complete-task`), never guide PR creation; `"required"` -> single option "go through the PR flow" (`/create-pr`); field absent -> two options (`/create-pr` or `/complete-task`). PR creation is carried by Case 1's "go through the PR flow" option; it is no longer a separate case.
|
|
40
39
|
|
|
41
40
|
### Case 1: Final Commit
|
|
42
41
|
|
|
@@ -44,9 +43,11 @@ Prerequisites:
|
|
|
44
43
|
- [ ] all code committed
|
|
45
44
|
- [ ] all tests passed
|
|
46
45
|
- [ ] code review approved
|
|
47
|
-
- [ ] all workflow steps completed (for the `pr_tasks` list under each yaml `commit` step, count
|
|
46
|
+
- [ ] all workflow steps completed (for the `pr_tasks` list under each yaml `commit` step, decide whether to count them by the "PR path" rule: `prFlow=required` always counts; `prFlow=disabled` never counts; when absent, exclude only if `pr_status=skipped`, otherwise count)
|
|
48
47
|
|
|
49
|
-
Required next-step commands:
|
|
48
|
+
Required next-step commands (rendered by `prFlow`):
|
|
49
|
+
|
|
50
|
+
`prFlow="disabled"` -> single option "complete directly":
|
|
50
51
|
|
|
51
52
|
```text
|
|
52
53
|
Next step - complete and archive the task:
|
|
@@ -55,6 +56,29 @@ Next step - complete and archive the task:
|
|
|
55
56
|
- Codex CLI: $complete-task {task-ref}
|
|
56
57
|
```
|
|
57
58
|
|
|
59
|
+
`prFlow="required"` -> single option "go through the PR flow":
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
Next step - create Pull Request:
|
|
63
|
+
- Claude Code / OpenCode: /create-pr {task-ref}
|
|
64
|
+
- Gemini CLI: /agent-infra:create-pr {task-ref}
|
|
65
|
+
- Codex CLI: $create-pr {task-ref}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
field absent -> two options:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
Next step - choose one:
|
|
72
|
+
- Go through the PR flow:
|
|
73
|
+
- Claude Code / OpenCode: /create-pr {task-ref}
|
|
74
|
+
- Gemini CLI: /agent-infra:create-pr {task-ref}
|
|
75
|
+
- Codex CLI: $create-pr {task-ref}
|
|
76
|
+
- Complete directly (no PR):
|
|
77
|
+
- Claude Code / OpenCode: /complete-task {task-ref}
|
|
78
|
+
- Gemini CLI: /agent-infra:complete-task {task-ref}
|
|
79
|
+
- Codex CLI: $complete-task {task-ref}
|
|
80
|
+
```
|
|
81
|
+
|
|
58
82
|
### Case 2: More Work Remains
|
|
59
83
|
|
|
60
84
|
If more work is still pending:
|
|
@@ -80,20 +104,4 @@ Next step - code review:
|
|
|
80
104
|
- Codex CLI: $review-code {task-ref}
|
|
81
105
|
```
|
|
82
106
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
If the next step is Pull Request creation:
|
|
86
|
-
- update `updated_at`
|
|
87
|
-
- update `agent_infra_version` from `.agents/rules/version-stamp.md`
|
|
88
|
-
- record the PR plan in `task.md`
|
|
89
|
-
|
|
90
|
-
Required next-step commands:
|
|
91
|
-
|
|
92
|
-
```text
|
|
93
|
-
Next step - create Pull Request:
|
|
94
|
-
- Claude Code / OpenCode: /create-pr {task-ref}
|
|
95
|
-
- Gemini CLI: /agent-infra:create-pr {task-ref}
|
|
96
|
-
- Codex CLI: $create-pr {task-ref}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
> Note: beyond the four cases, if `task.md` contains a valid `pr_number`, the commit skill must sync the PR summary via `reference/pr-summary-sync.md` before entering the verification gate.
|
|
107
|
+
> Note: beyond the cases above, if `task.md` contains a valid `pr_number`, the commit skill must sync the PR summary via `reference/pr-summary-sync.md` before entering the verification gate.
|
|
@@ -23,20 +23,19 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
23
23
|
- 最新的 `review-code.md` / `review-code-r{N}.md` 是否无问题通过
|
|
24
24
|
- 是否仍然存在待修复项、待审查工作或待创建 PR 的步骤
|
|
25
25
|
|
|
26
|
-
**门控读取(项目级 PR 流程策略)**:在执行本步骤前,读取 `.agents/.airc.json` 的 `
|
|
26
|
+
**门控读取(项目级 PR 流程策略)**:在执行本步骤前,读取 `.agents/.airc.json` 的 `prFlow` 字段(三态:字段缺省 = 默认推荐 PR、允许跳过;`"required"` = 强制 PR;`"disabled"` = 强制无 PR)。所有依赖该偏好的分支按此三态判定。
|
|
27
27
|
|
|
28
28
|
必须且只能选择一个分支:
|
|
29
29
|
|
|
30
30
|
| 判断依据 | 必选分支 |
|
|
31
31
|
|---|---|
|
|
32
|
-
| 所有工作流步骤都已完成 + 最新审查无问题通过 + 所有测试通过 | 场景 1
|
|
32
|
+
| 所有工作流步骤都已完成 + 最新审查无问题通过 + 所有测试通过 | 场景 1:最终提交(按 `prFlow` 渲染下一步) |
|
|
33
33
|
| 仍有未完成步骤、待修复项或等待他人的动作 | 场景 2:还有后续工作 |
|
|
34
34
|
| 这次提交是为了把任务交给代码审查 | 场景 3:准备进入审查 |
|
|
35
|
-
| 代码已提交、审查已完成,且**项目启用 PR 流程**,下一步是创建 PR | 场景 4:准备创建 PR |
|
|
36
35
|
|
|
37
36
|
绝对不要同时套用多个分支。先匹配唯一的下一步分支,再更新任务。
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
**场景 1 下一步渲染(先判 `prFlow` 强约束)**:终态「最终提交」的下一步命令按 `prFlow` 渲染——`"disabled"` → 单选「直接完成」(`/complete-task`),永不引导创建 PR;`"required"` → 单选「走 PR 流程」(`/create-pr`);字段缺省 → 二选一(`/create-pr` 或 `/complete-task`)。创建 PR 的动作统一由场景 1 的「走 PR 流程」选项承载,不再单列独立场景。
|
|
40
39
|
|
|
41
40
|
### 场景 1:最终提交
|
|
42
41
|
|
|
@@ -44,9 +43,11 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
44
43
|
- [ ] 所有代码都已提交
|
|
45
44
|
- [ ] 所有测试通过
|
|
46
45
|
- [ ] 代码审查已通过
|
|
47
|
-
- [ ] 所有工作流步骤已完成(对 yaml `commit` 步骤的 `pr_tasks`
|
|
46
|
+
- [ ] 所有工作流步骤已完成(对 yaml `commit` 步骤的 `pr_tasks` 列表,按「走 PR 路径」判定是否计入:`prFlow=required` 始终计入;`prFlow=disabled` 不计入;缺省下仅当 `pr_status=skipped` 时不计入,否则计入)
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
必带下一步命令(按 `prFlow` 渲染):
|
|
49
|
+
|
|
50
|
+
`prFlow="disabled"` → 单选「直接完成」:
|
|
50
51
|
|
|
51
52
|
```text
|
|
52
53
|
下一步 - 完成并归档任务:
|
|
@@ -55,6 +56,29 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
55
56
|
- Codex CLI: $complete-task {task-ref}
|
|
56
57
|
```
|
|
57
58
|
|
|
59
|
+
`prFlow="required"` → 单选「走 PR 流程」:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
下一步 - 创建 Pull Request:
|
|
63
|
+
- Claude Code / OpenCode: /create-pr {task-ref}
|
|
64
|
+
- Gemini CLI: /agent-infra:create-pr {task-ref}
|
|
65
|
+
- Codex CLI: $create-pr {task-ref}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
字段缺省 → 二选一:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
下一步 - 二选一:
|
|
72
|
+
- 走 PR 流程:
|
|
73
|
+
- Claude Code / OpenCode: /create-pr {task-ref}
|
|
74
|
+
- Gemini CLI: /agent-infra:create-pr {task-ref}
|
|
75
|
+
- Codex CLI: $create-pr {task-ref}
|
|
76
|
+
- 直接完成(无 PR):
|
|
77
|
+
- Claude Code / OpenCode: /complete-task {task-ref}
|
|
78
|
+
- Gemini CLI: /agent-infra:complete-task {task-ref}
|
|
79
|
+
- Codex CLI: $complete-task {task-ref}
|
|
80
|
+
```
|
|
81
|
+
|
|
58
82
|
### 场景 2:还有后续工作
|
|
59
83
|
|
|
60
84
|
如果仍有工作待完成:
|
|
@@ -80,20 +104,4 @@ date "+%Y-%m-%d %H:%M:%S%:z"
|
|
|
80
104
|
- Codex CLI: $review-code {task-ref}
|
|
81
105
|
```
|
|
82
106
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
如果下一步是创建 Pull Request:
|
|
86
|
-
- 更新 `updated_at`
|
|
87
|
-
- 按 `.agents/rules/version-stamp.md` 更新 `agent_infra_version`
|
|
88
|
-
- 在 `task.md` 中记录 PR 计划
|
|
89
|
-
|
|
90
|
-
必带下一步命令:
|
|
91
|
-
|
|
92
|
-
```text
|
|
93
|
-
下一步 - 创建 Pull Request:
|
|
94
|
-
- Claude Code / OpenCode: /create-pr {task-ref}
|
|
95
|
-
- Gemini CLI: /agent-infra:create-pr {task-ref}
|
|
96
|
-
- Codex CLI: $create-pr {task-ref}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
> 注意:四个场景之外,只要 `task.md` 中存在有效 `pr_number`,commit 技能必须先按 `reference/pr-summary-sync.md` 同步 PR 摘要,再进入完成校验。
|
|
107
|
+
> 注意:上述场景之外,只要 `task.md` 中存在有效 `pr_number`,commit 技能必须先按 `reference/pr-summary-sync.md` 同步 PR 摘要,再进入完成校验。
|
|
@@ -44,10 +44,36 @@ If not found in `active/`, check `blocked/` and `completed/`:
|
|
|
44
44
|
|
|
45
45
|
### 2. Verify Completion Prerequisites (Failure Must Stop)
|
|
46
46
|
|
|
47
|
-
**Gate read (project-level PR flow policy)**: Before running this step, read `.agents/.airc.json`'s `
|
|
47
|
+
**Gate read (project-level PR flow policy)**: Before running this step, read `.agents/.airc.json`'s `prFlow` field (three states: field absent = recommend PR by default, skipping allowed; `"required"` = PR mandatory; `"disabled"` = no PR flow), and `pr_status` from `task.md` frontmatter (`pending` / `created` / `skipped`).
|
|
48
|
+
|
|
49
|
+
**PR dimension decision (evaluate the `prFlow` strong constraint FIRST, then `pr_status`)**:
|
|
50
|
+
|
|
51
|
+
| `prFlow` | `pr_status` | Decision |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| `disabled` | any | No PR path -> PR dimension satisfied, continue with the other prerequisites |
|
|
54
|
+
| `required` | `created` | PR dimension satisfied, continue |
|
|
55
|
+
| `required` | `pending` / `skipped` | **Stop**: under a mandatory PR flow you must run `/create-pr` first; `--skip-pr` is NOT accepted (including a pre-existing / manually-set `skipped`) |
|
|
56
|
+
| absent | `created` / `skipped` | PR dimension satisfied, continue |
|
|
57
|
+
| absent | `pending` | **Stop by default** and print the two-option guidance below; unless the user passes `--skip-pr` (writes `pr_status: skipped`, then continues) or `--force` |
|
|
58
|
+
|
|
59
|
+
- `--skip-pr` handling: effective only when `prFlow` is not `required` -> set `pr_status` to `skipped` in `task.md`, then continue; when `prFlow=required`, ignore `--skip-pr` and stop per the table.
|
|
60
|
+
- Note: `--force` may override the other prerequisites below, but does **NOT** lift the `prFlow=required` PR constraint (the only exit from the strong constraint is creating a PR).
|
|
61
|
+
|
|
62
|
+
Two-option guidance for absent + `pending`:
|
|
63
|
+
```
|
|
64
|
+
Task {task-id} has no PR yet (pr_status: pending). Choose one:
|
|
65
|
+
- Go through the PR flow: /create-pr {task-ref}
|
|
66
|
+
- Explicitly skip and complete: /complete-task {task-ref} --skip-pr
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Stop message for `required` + `pending`/`skipped`:
|
|
70
|
+
```
|
|
71
|
+
This project enforces the PR flow (prFlow: "required") and the task has no PR yet.
|
|
72
|
+
Run /create-pr {task-ref} first, then complete; --skip-pr is not accepted under a mandatory PR flow.
|
|
73
|
+
```
|
|
48
74
|
|
|
49
75
|
Before marking complete, verify ALL of these:
|
|
50
|
-
- [ ] All workflow steps are complete (check workflow progress in task.md; **for the `pr_tasks` list under each yaml `commit` step, count
|
|
76
|
+
- [ ] All workflow steps are complete (check workflow progress in task.md; **for the `pr_tasks` list under each yaml `commit` step, decide whether to count them by the "PR path" rule: `prFlow=required` always counts; `prFlow=disabled` never counts; when absent, exclude only if `pr_status=skipped`, otherwise count**)
|
|
51
77
|
- [ ] 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)
|
|
52
78
|
- [ ] Code has been committed (no uncommitted changes related to this task)
|
|
53
79
|
- [ ] Tests are passing
|
|
@@ -146,7 +172,9 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
|
|
|
146
172
|
|
|
147
173
|
> Execute this step only after the verification gate passes.
|
|
148
174
|
|
|
149
|
-
> The completion timestamp line (the last line of the whole output) uses `date "+%Y-%m-%d %H:%M:%S"` (local timezone, no offset) and always sits at the very end of the output for at-a-glance scanning across windows. This skill renders no "Next steps" commands but still prints the line.
|
|
175
|
+
> The completion timestamp line (the last line of the whole output) uses `date "+%Y-%m-%d %H:%M:%S"` (local timezone, no offset) and always sits at the very end of the output for at-a-glance scanning across windows. This skill renders no "Next steps" commands, but it does render an **optional sandbox-cleanup hint** before the timestamp line (see the gate below), and still prints the line.
|
|
176
|
+
|
|
177
|
+
> **Optional sandbox-cleanup hint (gated)**: Render the "Optional: clean up this task's sandbox" block in the output below only when BOTH (1) `.agents/.airc.json` has a `sandbox` field and (2) task.md's `branch` field exists and is not `main` / `master`; otherwise omit the whole block. `{branch}` is the `branch` value from the task.md you already loaded (the task has moved to completed/, so read it from `.agents/workspace/completed/{task-id}/task.md`). This block is independent of "Next steps" semantics — it is not a workflow successor command.
|
|
150
178
|
|
|
151
179
|
Output format:
|
|
152
180
|
```
|
|
@@ -160,6 +188,11 @@ Task info:
|
|
|
160
188
|
Deliverables:
|
|
161
189
|
- {List of key outputs: files modified, tests added, etc.}
|
|
162
190
|
|
|
191
|
+
Optional: clean up this task's sandbox
|
|
192
|
+
(The task is archived; the sandbox container and per-branch config directory are not reclaimed automatically. Run this if you no longer need them:)
|
|
193
|
+
|
|
194
|
+
ai sandbox rm {branch}
|
|
195
|
+
|
|
163
196
|
Completed at: {completion-time}
|
|
164
197
|
```
|
|
165
198
|
|
|
@@ -43,10 +43,36 @@ tail .agents/workspace/active/{task-id}/task.md
|
|
|
43
43
|
|
|
44
44
|
### 2. 验证完成前置条件(未满足则必须停止)
|
|
45
45
|
|
|
46
|
-
**门控读取(项目级 PR 流程策略)**:在执行本步骤前,读取 `.agents/.airc.json` 的 `
|
|
46
|
+
**门控读取(项目级 PR 流程策略)**:在执行本步骤前,读取 `.agents/.airc.json` 的 `prFlow` 字段(三态:字段缺省 = 默认推荐 PR、允许跳过;`"required"` = 强制 PR;`"disabled"` = 强制无 PR),以及 `task.md` frontmatter 的 `pr_status`(`pending` / `created` / `skipped`)。
|
|
47
|
+
|
|
48
|
+
**PR 维度判定(先判 `prFlow` 强约束,后看 `pr_status`)**:
|
|
49
|
+
|
|
50
|
+
| `prFlow` | `pr_status` | 判定 |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| `disabled` | 任意 | 无 PR 路径 → PR 维度满足,继续其余前置条件 |
|
|
53
|
+
| `required` | `created` | PR 维度满足,继续 |
|
|
54
|
+
| `required` | `pending` / `skipped` | **停止**:强制 PR 下必须先 `/create-pr`;`--skip-pr` 不被接受(含既有/手动写入的 `skipped`) |
|
|
55
|
+
| 缺省 | `created` / `skipped` | PR 维度满足,继续 |
|
|
56
|
+
| 缺省 | `pending` | **默认停止**并输出下方二选一引导;除非用户提供 `--skip-pr`(写 `pr_status: skipped` 后继续)或 `--force` |
|
|
57
|
+
|
|
58
|
+
- `--skip-pr` 处理:仅在 `prFlow` 非 `required` 时生效——把 `task.md` 的 `pr_status` 写为 `skipped` 后继续;`prFlow=required` 时忽略 `--skip-pr` 并按上表停止。
|
|
59
|
+
- 注:`--force` 可越过下方其余前置条件,但**不解除 `prFlow=required` 的 PR 强约束**(强约束的唯一出口是创建 PR)。
|
|
60
|
+
|
|
61
|
+
缺省 + `pending` 的二选一引导消息:
|
|
62
|
+
```
|
|
63
|
+
任务 {task-id} 尚未创建 PR(pr_status: pending)。请二选一:
|
|
64
|
+
- 走 PR 流程:/create-pr {task-ref}
|
|
65
|
+
- 显式跳过并完成:/complete-task {task-ref} --skip-pr
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`required` + `pending`/`skipped` 的停止消息:
|
|
69
|
+
```
|
|
70
|
+
当前项目强制 PR 流程(prFlow: "required"),任务尚未创建 PR。
|
|
71
|
+
请先运行 /create-pr {task-ref} 创建 PR 后再完成;--skip-pr 在强制 PR 下不被接受。
|
|
72
|
+
```
|
|
47
73
|
|
|
48
74
|
标记完成之前,验证以下所有条件:
|
|
49
|
-
- [ ] 所有工作流步骤已完成(检查 task.md 中的工作流进度;**对 yaml 中 commit 步骤的 `pr_tasks`
|
|
75
|
+
- [ ] 所有工作流步骤已完成(检查 task.md 中的工作流进度;**对 yaml 中 commit 步骤的 `pr_tasks` 列表,按「走 PR 路径」判定是否计入未完成判定:`prFlow=required` 始终计入;`prFlow=disabled` 不计入;缺省下仅当 `pr_status=skipped` 时不计入,否则计入**)
|
|
50
76
|
- [ ] 代码已审查(`review-code.md` 或 `review-code-r{N}.md` 存在,且最新审查结论为 Approved;或已在外部完成审查)
|
|
51
77
|
- [ ] 代码已提交(没有与此任务相关的未提交变更)
|
|
52
78
|
- [ ] 测试通过
|
|
@@ -145,7 +171,9 @@ node .agents/scripts/validate-artifact.js gate complete-task .agents/workspace/c
|
|
|
145
171
|
|
|
146
172
|
> 仅在校验通过后执行本步骤。
|
|
147
173
|
|
|
148
|
-
> 完成时间收尾行(整段输出的最后一行)取值 `date "+%Y-%m-%d %H:%M:%S"`(本地时区、不带偏移),固定放在输出的绝对末尾,便于多窗口扫视。本 skill
|
|
174
|
+
> 完成时间收尾行(整段输出的最后一行)取值 `date "+%Y-%m-%d %H:%M:%S"`(本地时区、不带偏移),固定放在输出的绝对末尾,便于多窗口扫视。本 skill 不渲染「下一步」命令,但会在收尾行之前渲染一段**可选的沙箱清理提示**(见下方门控),且仍统一打印该收尾行。
|
|
175
|
+
|
|
176
|
+
> **可选沙箱清理提示(门控渲染)**:仅当同时满足 (1) `.agents/.airc.json` 存在 `sandbox` 字段、(2) task.md 的 `branch` 字段存在且不是 `main` / `master` 时,才渲染下方输出中的「可选:清理本任务的沙箱」块;任一不满足则整段省略。`{branch}` 取已读入的 task.md 的 `branch` 值(任务此时已移动到 completed/,从 `.agents/workspace/completed/{task-id}/task.md` 读取)。该块独立于「下一步」语义,不是工作流后继命令。
|
|
149
177
|
|
|
150
178
|
输出格式:
|
|
151
179
|
```
|
|
@@ -159,6 +187,11 @@ node .agents/scripts/validate-artifact.js gate complete-task .agents/workspace/c
|
|
|
159
187
|
交付物:
|
|
160
188
|
- {关键产出列表:修改的文件、添加的测试等}
|
|
161
189
|
|
|
190
|
+
可选:清理本任务的沙箱
|
|
191
|
+
(任务已归档,沙箱容器和 per-branch 配置目录不会自动回收。如果不再需要可执行:)
|
|
192
|
+
|
|
193
|
+
ai sandbox rm {branch}
|
|
194
|
+
|
|
162
195
|
Completed at: {completion-time}
|
|
163
196
|
```
|
|
164
197
|
|
|
@@ -19,14 +19,14 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
|
|
|
19
19
|
|
|
20
20
|
### Pre-gate: Project-level PR Flow Check
|
|
21
21
|
|
|
22
|
-
**Gate read (project-level PR flow policy)**: Before running any numbered step, read `.agents/.airc.json`'s `
|
|
22
|
+
**Gate read (project-level PR flow policy)**: Before running any numbered step, read `.agents/.airc.json`'s `prFlow` field (three states: field absent = recommend PR by default, skipping allowed; `"required"` = PR mandatory; `"disabled"` = no PR flow).
|
|
23
23
|
|
|
24
24
|
Branch on the result:
|
|
25
|
-
-
|
|
26
|
-
-
|
|
25
|
+
- absent / `"required"` -> continue to Step 1 below
|
|
26
|
+
- `"disabled"` -> 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` / `pr_status` in `task.md`, and do not publish a PR summary comment:
|
|
27
27
|
|
|
28
28
|
```
|
|
29
|
-
This project does not enable the PR flow (`.agents/.airc.json` sets `
|
|
29
|
+
This project does not enable the PR flow (`.agents/.airc.json` sets `prFlow: "disabled"`).
|
|
30
30
|
No Pull Request is required; run instead:
|
|
31
31
|
- Claude Code / OpenCode: /complete-task {task-ref}
|
|
32
32
|
- Gemini CLI: /agent-infra:complete-task {task-ref}
|
|
@@ -96,7 +96,7 @@ Get the current time:
|
|
|
96
96
|
date "+%Y-%m-%d %H:%M:%S%:z"
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
If `{task-id}` is available, update task.md with `pr_number`, `updated_at`, `agent_infra_version`, and append the Create PR Activity Log entry including metadata-sync and summary results.
|
|
99
|
+
If `{task-id}` is available, update task.md with `pr_number`, `pr_status` (set to `created`), `updated_at`, `agent_infra_version`, and append the Create PR Activity Log entry including metadata-sync and summary results.
|
|
100
100
|
|
|
101
101
|
### 9. Verification Gate
|
|
102
102
|
|
|
@@ -117,9 +117,18 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
|
|
|
117
117
|
|
|
118
118
|
> Execute this step only after the verification gate passes.
|
|
119
119
|
|
|
120
|
-
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the
|
|
120
|
+
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the short id `#NN` (falling back to the full TASK-id when unallocated or released); (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
|
|
121
121
|
|
|
122
|
-
Explain the created PR URL, summarize metadata sync and summary-comment results, and recommend `
|
|
122
|
+
Explain the created PR URL, summarize metadata sync and summary-comment results, and recommend watching the PR's checks next (render `{task-ref}` as the short id `#NN` per `.agents/rules/next-step-output.md`):
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
Next step - Watch PR checks (auto self-heal until required checks are green):
|
|
126
|
+
- Claude Code / OpenCode: /watch-pr {task-ref}
|
|
127
|
+
- Gemini CLI: /agent-infra:watch-pr {task-ref}
|
|
128
|
+
- Codex CLI: $watch-pr {task-ref}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Once green, `watch-pr` then guides toward `complete-task {task-ref}`.
|
|
123
132
|
|
|
124
133
|
## Notes
|
|
125
134
|
|
|
@@ -19,14 +19,14 @@ description: "创建 Pull Request 到目标分支"
|
|
|
19
19
|
|
|
20
20
|
### 前置门控:项目级 PR 流程检查
|
|
21
21
|
|
|
22
|
-
**门控读取(项目级 PR 流程策略)**:在执行编号步骤前,读取 `.agents/.airc.json` 的 `
|
|
22
|
+
**门控读取(项目级 PR 流程策略)**:在执行编号步骤前,读取 `.agents/.airc.json` 的 `prFlow` 字段(三态:字段缺省 = 默认推荐 PR、允许跳过;`"required"` = 强制 PR;`"disabled"` = 强制无 PR)。
|
|
23
23
|
|
|
24
24
|
按读取结果分支:
|
|
25
|
-
-
|
|
26
|
-
-
|
|
25
|
+
- 缺省 / `"required"` → 继续到下方第 1 步
|
|
26
|
+
- `"disabled"` → 输出以下消息后**立即停止**,不要执行任何后续编号步骤、不要触发任何 PR 创建命令、不要修改 `task.md` 的 `pr_number` / `pr_status`、不要发布 PR 摘要评论:
|
|
27
27
|
|
|
28
28
|
```
|
|
29
|
-
当前项目未启用 PR 流程(`.agents/.airc.json` 中 `
|
|
29
|
+
当前项目未启用 PR 流程(`.agents/.airc.json` 中 `prFlow: "disabled"`)。
|
|
30
30
|
无需创建 Pull Request,请直接运行:
|
|
31
31
|
- Claude Code / OpenCode:/complete-task {task-ref}
|
|
32
32
|
- Gemini CLI:/agent-infra:complete-task {task-ref}
|
|
@@ -96,7 +96,7 @@ description: "创建 Pull Request 到目标分支"
|
|
|
96
96
|
date "+%Y-%m-%d %H:%M:%S%:z"
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
如果获取到了 `{task-id}`,更新 task.md 的 `pr_number`、`updated_at`、`agent_infra_version`,并追加 Create PR 的 Activity Log,记录元数据同步和摘要发布结果。
|
|
99
|
+
如果获取到了 `{task-id}`,更新 task.md 的 `pr_number`、`pr_status`(设为 `created`)、`updated_at`、`agent_infra_version`,并追加 Create PR 的 Activity Log,记录元数据同步和摘要发布结果。
|
|
100
100
|
|
|
101
101
|
### 9. 完成校验
|
|
102
102
|
|
|
@@ -117,9 +117,18 @@ node .agents/scripts/validate-artifact.js gate create-pr .agents/workspace/activ
|
|
|
117
117
|
|
|
118
118
|
> 仅在校验通过后执行本步骤。
|
|
119
119
|
|
|
120
|
-
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
|
|
120
|
+
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `#NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
|
|
121
121
|
|
|
122
|
-
说明 PR URL
|
|
122
|
+
说明 PR URL、元数据同步结果、摘要评论结果,并推荐下一步进入 PR 监控(按 `.agents/rules/next-step-output.md` 把 `{task-ref}` 渲染为短号 `#NN`):
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
下一步 - 监控 PR 检查(required checks 全绿前自动自愈):
|
|
126
|
+
- Claude Code / OpenCode:/watch-pr {task-ref}
|
|
127
|
+
- Gemini CLI:/agent-infra:watch-pr {task-ref}
|
|
128
|
+
- Codex CLI:$watch-pr {task-ref}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
`watch-pr` 全绿后会再引导 `complete-task {task-ref}`。
|
|
123
132
|
|
|
124
133
|
## 注意事项
|
|
125
134
|
|
|
@@ -9,6 +9,7 @@ Read this file before creating or updating the single reviewer-facing PR summary
|
|
|
9
9
|
- Generate or update the `<!-- sync-pr:{task-id}:summary -->` comment with the canonical template from `.agents/rules/pr-sync.md`
|
|
10
10
|
- When a matching summary comment already exists, PATCH only when the body changed; otherwise skip the write
|
|
11
11
|
- In this skill, summary sync failures follow the existing `create-pr` error handling and must not roll back an already-created PR
|
|
12
|
+
- Populate the "Manual Verification Required" section per the aggregation rules in `.agents/rules/pr-sync.md` (sources: plan assumptions/open questions, review-code "Environment-Blocked Findings"/"Self-Doubt"); write the explicit placeholder when there are none
|
|
12
13
|
|
|
13
14
|
## Result Reporting
|
|
14
15
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
- 按 `.agents/rules/pr-sync.md` 中的唯一权威模板生成或更新 `<!-- sync-pr:{task-id}:summary -->` 评论
|
|
10
10
|
- PR 已存在同标记评论时,只在正文变化时 PATCH;否则跳过写入
|
|
11
11
|
- 本 skill 中,摘要同步失败沿用 `create-pr` 的现有错误处理,不回滚已经创建的 PR
|
|
12
|
+
- 按 `.agents/rules/pr-sync.md` 的聚合规则填充「需人工校验」段落(来源:plan 假设/未决问题、review-code 环境性遗留/自我质疑);无事项时写显式占位
|
|
12
13
|
|
|
13
14
|
## 结果回传
|
|
14
15
|
|
|
@@ -155,7 +155,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
|
|
|
155
155
|
|
|
156
156
|
> Execute this step only after the verification gate passes.
|
|
157
157
|
|
|
158
|
-
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the
|
|
158
|
+
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the short id `#NN` (falling back to the full TASK-id when unallocated or released); (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
|
|
159
159
|
|
|
160
160
|
Scenario A: when an Issue was created, output:
|
|
161
161
|
```
|
|
@@ -154,7 +154,7 @@ node .agents/scripts/validate-artifact.js gate create-task .agents/workspace/act
|
|
|
154
154
|
|
|
155
155
|
> 仅在校验通过后执行本步骤。
|
|
156
156
|
|
|
157
|
-
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
|
|
157
|
+
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `#NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
|
|
158
158
|
|
|
159
159
|
场景 A:已创建 Issue 时输出:
|
|
160
160
|
```
|
|
@@ -87,7 +87,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
|
|
|
87
87
|
|
|
88
88
|
> Execute this step only after the verification gate passes.
|
|
89
89
|
|
|
90
|
-
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the
|
|
90
|
+
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the short id `#NN` (falling back to the full TASK-id when unallocated or released); (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
|
|
91
91
|
|
|
92
92
|
```
|
|
93
93
|
Code Scanning alert #{alert-number} imported.
|
|
@@ -87,7 +87,7 @@ node .agents/scripts/validate-artifact.js gate import-codescan .agents/workspace
|
|
|
87
87
|
|
|
88
88
|
> 仅在校验通过后执行本步骤。
|
|
89
89
|
|
|
90
|
-
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
|
|
90
|
+
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `#NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
|
|
91
91
|
|
|
92
92
|
```
|
|
93
93
|
Code Scanning 告警 #{alert-number} 已导入。
|
|
@@ -88,7 +88,7 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
|
|
|
88
88
|
|
|
89
89
|
> Execute this step only after the verification gate passes.
|
|
90
90
|
|
|
91
|
-
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the
|
|
91
|
+
> **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Before rendering the final output, read `.agents/rules/next-step-output.md` and apply both of its rules: (1) render `{task-ref}` in the "Next steps" commands as the short id `#NN` (falling back to the full TASK-id when unallocated or released); (2) append the `Completed at` line as the very last line of the user-facing output (this applies to every user-facing output — success, error, and early-return paths alike, not only the success path).
|
|
92
92
|
|
|
93
93
|
```
|
|
94
94
|
Security alert #{alert-number} imported.
|
|
@@ -88,7 +88,7 @@ node .agents/scripts/validate-artifact.js gate import-dependabot .agents/workspa
|
|
|
88
88
|
|
|
89
89
|
> 仅在校验通过后执行本步骤。
|
|
90
90
|
|
|
91
|
-
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
|
|
91
|
+
> **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。 渲染最终输出前,先读取 `.agents/rules/next-step-output.md` 并落实其两类规则:(1) 「下一步」命令把 `{task-ref}` 渲染为短号 `#NN`(未分配/已释放时回退完整 TASK-id);(2) 在面向用户输出的绝对最后一行追加 `Completed at` 收尾行(成功、错误、早退等任何面向用户输出都适用,不限于校验通过的成功态)。
|
|
92
92
|
|
|
93
93
|
```
|
|
94
94
|
安全告警 #{alert-number} 已导入。
|