@fitlab-ai/agent-infra 0.7.1 → 0.7.3

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.
Files changed (165) hide show
  1. package/README.md +7 -1
  2. package/README.zh-CN.md +9 -3
  3. package/bin/cli.ts +11 -0
  4. package/dist/bin/cli.js +12 -0
  5. package/dist/lib/defaults.json +0 -1
  6. package/dist/lib/init.js +0 -3
  7. package/dist/lib/sandbox/commands/create.js +10 -2
  8. package/dist/lib/sandbox/commands/enter.js +17 -18
  9. package/dist/lib/sandbox/commands/list-running.js +56 -32
  10. package/dist/lib/sandbox/commands/ls.js +27 -24
  11. package/dist/lib/sandbox/commands/start.js +36 -0
  12. package/dist/lib/sandbox/index.js +15 -3
  13. package/dist/lib/sandbox/task-resolver.js +1 -1
  14. package/dist/lib/sandbox/tools.js +1 -1
  15. package/dist/lib/table.js +38 -0
  16. package/dist/lib/task/commands/ls.js +122 -0
  17. package/dist/lib/task/commands/show.js +135 -0
  18. package/dist/lib/task/frontmatter.js +32 -0
  19. package/dist/lib/task/index.js +41 -0
  20. package/dist/lib/task/short-id.js +90 -0
  21. package/dist/lib/update.js +25 -8
  22. package/lib/defaults.json +0 -1
  23. package/lib/init.ts +0 -10
  24. package/lib/sandbox/commands/create.ts +11 -2
  25. package/lib/sandbox/commands/enter.ts +40 -20
  26. package/lib/sandbox/commands/list-running.ts +65 -37
  27. package/lib/sandbox/commands/ls.ts +35 -27
  28. package/lib/sandbox/commands/start.ts +61 -0
  29. package/lib/sandbox/index.ts +15 -3
  30. package/lib/sandbox/task-resolver.ts +1 -1
  31. package/lib/sandbox/tools.ts +1 -1
  32. package/lib/table.ts +44 -0
  33. package/lib/task/commands/ls.ts +138 -0
  34. package/lib/task/commands/show.ts +139 -0
  35. package/lib/task/frontmatter.ts +30 -0
  36. package/lib/task/index.ts +44 -0
  37. package/lib/task/short-id.ts +107 -0
  38. package/lib/update.ts +28 -10
  39. package/package.json +1 -1
  40. package/templates/.agents/hooks/auto-resume.sh +104 -0
  41. package/templates/.agents/rules/create-issue.github.en.md +1 -1
  42. package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
  43. package/templates/.agents/rules/milestone-inference.github.en.md +4 -1
  44. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +4 -1
  45. package/templates/.agents/rules/next-step-output.en.md +62 -0
  46. package/templates/.agents/rules/next-step-output.zh-CN.md +62 -0
  47. package/templates/.agents/rules/pr-checks-commands.en.md +5 -0
  48. package/templates/.agents/rules/pr-checks-commands.github.en.md +62 -0
  49. package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +62 -0
  50. package/templates/.agents/rules/pr-checks-commands.zh-CN.md +5 -0
  51. package/templates/.agents/rules/pr-sync.github.en.md +7 -0
  52. package/templates/.agents/rules/pr-sync.github.zh-CN.md +7 -0
  53. package/templates/.agents/rules/task-short-id.en.md +54 -62
  54. package/templates/.agents/rules/task-short-id.zh-CN.md +35 -54
  55. package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +17 -0
  56. package/templates/.agents/scripts/task-short-id.js +32 -189
  57. package/templates/.agents/skills/analyze-task/SKILL.en.md +10 -12
  58. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +10 -12
  59. package/templates/.agents/skills/analyze-task/config/verify.en.json +1 -1
  60. package/templates/.agents/skills/analyze-task/config/verify.zh-CN.json +1 -1
  61. package/templates/.agents/skills/block-task/SKILL.en.md +13 -6
  62. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +13 -6
  63. package/templates/.agents/skills/block-task/config/verify.json +1 -1
  64. package/templates/.agents/skills/cancel-task/SKILL.en.md +13 -6
  65. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +13 -6
  66. package/templates/.agents/skills/cancel-task/config/verify.json +1 -1
  67. package/templates/.agents/skills/check-task/SKILL.en.md +12 -10
  68. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +12 -10
  69. package/templates/.agents/skills/close-codescan/SKILL.en.md +13 -6
  70. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +13 -6
  71. package/templates/.agents/skills/close-dependabot/SKILL.en.md +13 -6
  72. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +13 -6
  73. package/templates/.agents/skills/code-task/SKILL.en.md +10 -6
  74. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +11 -6
  75. package/templates/.agents/skills/code-task/config/verify.en.json +2 -1
  76. package/templates/.agents/skills/code-task/config/verify.zh-CN.json +2 -1
  77. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +10 -5
  78. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +10 -5
  79. package/templates/.agents/skills/code-task/reference/output-template.en.md +3 -3
  80. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +3 -3
  81. package/templates/.agents/skills/code-task/reference/report-template.en.md +8 -0
  82. package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +8 -0
  83. package/templates/.agents/skills/commit/SKILL.en.md +3 -4
  84. package/templates/.agents/skills/commit/SKILL.zh-CN.md +3 -4
  85. package/templates/.agents/skills/commit/reference/task-status-update.en.md +37 -29
  86. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +37 -29
  87. package/templates/.agents/skills/complete-task/SKILL.en.md +41 -4
  88. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +41 -4
  89. package/templates/.agents/skills/complete-task/config/verify.en.json +1 -1
  90. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +1 -1
  91. package/templates/.agents/skills/create-pr/SKILL.en.md +20 -11
  92. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +20 -11
  93. package/templates/.agents/skills/create-pr/config/verify.json +2 -1
  94. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +2 -1
  95. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +2 -1
  96. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +3 -3
  97. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +3 -3
  98. package/templates/.agents/skills/create-task/SKILL.en.md +17 -17
  99. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +17 -17
  100. package/templates/.agents/skills/create-task/config/verify.json +1 -1
  101. package/templates/.agents/skills/import-codescan/SKILL.en.md +8 -8
  102. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +8 -8
  103. package/templates/.agents/skills/import-codescan/config/verify.json +1 -1
  104. package/templates/.agents/skills/import-dependabot/SKILL.en.md +8 -8
  105. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +8 -8
  106. package/templates/.agents/skills/import-dependabot/config/verify.json +1 -1
  107. package/templates/.agents/skills/import-issue/SKILL.en.md +7 -7
  108. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +7 -7
  109. package/templates/.agents/skills/plan-task/SKILL.en.md +10 -12
  110. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +10 -12
  111. package/templates/.agents/skills/plan-task/config/verify.en.json +1 -1
  112. package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +1 -1
  113. package/templates/.agents/skills/restore-task/SKILL.en.md +1 -1
  114. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +1 -1
  115. package/templates/.agents/skills/review-analysis/SKILL.en.md +4 -2
  116. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +4 -2
  117. package/templates/.agents/skills/review-analysis/config/verify.en.json +3 -2
  118. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +3 -2
  119. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +15 -15
  120. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +15 -15
  121. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +7 -1
  122. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +7 -1
  123. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +2 -0
  124. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +2 -0
  125. package/templates/.agents/skills/review-code/SKILL.en.md +5 -2
  126. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +5 -2
  127. package/templates/.agents/skills/review-code/config/verify.en.json +3 -2
  128. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +3 -2
  129. package/templates/.agents/skills/review-code/reference/output-templates.en.md +9 -9
  130. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +9 -9
  131. package/templates/.agents/skills/review-code/reference/report-template.en.md +7 -1
  132. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +7 -1
  133. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +2 -0
  134. package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +2 -0
  135. package/templates/.agents/skills/review-plan/SKILL.en.md +4 -2
  136. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +4 -2
  137. package/templates/.agents/skills/review-plan/config/verify.en.json +3 -2
  138. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +3 -2
  139. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +15 -15
  140. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +15 -15
  141. package/templates/.agents/skills/review-plan/reference/report-template.en.md +7 -1
  142. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +7 -1
  143. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +2 -0
  144. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +2 -0
  145. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +0 -1
  146. package/templates/.agents/skills/watch-pr/SKILL.en.md +131 -0
  147. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +131 -0
  148. package/templates/.agents/skills/watch-pr/config/verify.json +22 -0
  149. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +43 -0
  150. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +43 -0
  151. package/templates/.agents/templates/task.en.md +1 -1
  152. package/templates/.agents/templates/task.zh-CN.md +1 -1
  153. package/templates/.agents/workflows/bug-fix.en.yaml +7 -5
  154. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +6 -5
  155. package/templates/.agents/workflows/feature-development.en.yaml +7 -5
  156. package/templates/.agents/workflows/feature-development.zh-CN.yaml +6 -5
  157. package/templates/.agents/workflows/refactoring.en.yaml +7 -5
  158. package/templates/.agents/workflows/refactoring.zh-CN.yaml +6 -5
  159. package/templates/.claude/commands/watch-pr.en.md +8 -0
  160. package/templates/.claude/commands/watch-pr.zh-CN.md +8 -0
  161. package/templates/.claude/settings.json +11 -0
  162. package/templates/.gemini/commands/_project_/watch-pr.en.toml +8 -0
  163. package/templates/.gemini/commands/_project_/watch-pr.zh-CN.toml +8 -0
  164. package/templates/.opencode/commands/watch-pr.en.md +11 -0
  165. package/templates/.opencode/commands/watch-pr.zh-CN.md +11 -0
@@ -62,6 +62,14 @@ $ {command}
62
62
 
63
63
  {describe any deviation from the approved plan}
64
64
 
65
+ ## Per-Finding Verification
66
+
67
+ > Fix mode only; for an initial implementation write "(initial implementation this round, no review findings)". Read/Grep-verify each finding of the previous `review-code` before acting on it.
68
+
69
+ | Finding | Reproduced? | Disposition (fix / rebut) |
70
+ |------|----------|----------------------|
71
+ | {finding} | {yes/no, with file:line or command} | {fix note, or counter-argument + recorded under unresolved} |
72
+
65
73
  ## Items for Review
66
74
 
67
75
  **Focus areas for reviewers**:
@@ -62,6 +62,14 @@ $ {command}
62
62
 
63
63
  {describe any deviation from the approved plan}
64
64
 
65
+ ## 对审查发现的逐条核实
66
+
67
+ > 仅修复模式填写;初次实现写「(本轮为初次实现,无审查发现)」。对上一轮 `review-code` 的每条发现先 Read/Grep 核实再处置。
68
+
69
+ | 发现 | 是否复现 | 处置(修复 / 反驳) |
70
+ |------|----------|----------------------|
71
+ | {finding} | {是/否,附 file:line 或命令} | {修复说明,或反证 + 记入 unresolved} |
72
+
65
73
  ## 供审查关注的内容
66
74
 
67
75
  **建议审查者重点关注**:
@@ -19,7 +19,7 @@ When updating related `task.md` frontmatter, read `.agents/rules/version-stamp.m
19
19
 
20
20
  ## Task id short ref
21
21
 
22
- > If `{task-id}` begins with `#`, 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
+ > 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.
23
23
 
24
24
  ## 1. Check Local Modifications (CRITICAL)
25
25
 
@@ -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).
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 {task-id}`
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
 
@@ -19,7 +19,7 @@ description: "提交当前变更到 Git"
19
19
 
20
20
  ## 任务入参短号别名
21
21
 
22
- > 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
22
+ > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
23
23
 
24
24
  ## 1. 检查本地修改(关键)
25
25
 
@@ -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 {task-id}`
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 `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.
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
- **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`).
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,15 +43,40 @@ 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 those items toward completion only when `requiresPullRequest !== false`)
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:
53
- - Claude Code / OpenCode: /complete-task {task-id}
54
- - Gemini CLI: /agent-infra:complete-task {task-id}
55
- - Codex CLI: $complete-task {task-id}
54
+ - Claude Code / OpenCode: /complete-task {task-ref}
55
+ - Gemini CLI: /agent-infra:complete-task {task-ref}
56
+ - Codex CLI: $complete-task {task-ref}
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}
56
80
  ```
57
81
 
58
82
  ### Case 2: More Work Remains
@@ -75,25 +99,9 @@ Required next-step commands:
75
99
 
76
100
  ```text
77
101
  Next step - code 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}
81
- ```
82
-
83
- ### Case 4: Ready for PR
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-id}
95
- - Gemini CLI: /agent-infra:create-pr {task-id}
96
- - Codex CLI: $create-pr {task-id}
102
+ - Claude Code / OpenCode: /review-code {task-ref}
103
+ - Gemini CLI: /agent-infra:review-code {task-ref}
104
+ - Codex CLI: $review-code {task-ref}
97
105
  ```
98
106
 
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` 的 `requiresPullRequest` 字段;当字段缺失或为 `true` 时视为「启用 PR 流程」(默认),仅当显式为 `false` 时视为「关闭 PR 流程」。所有依赖该字段的分支按此规则判定。
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
- **门控降级**:当 `requiresPullRequest === false` 时,场景 4 永远不被进入;原本会落入场景 4 的提交统一收敛到场景 1(最终提交 → `/complete-task`)。
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,15 +43,40 @@ date "+%Y-%m-%d %H:%M:%S%:z"
44
43
  - [ ] 所有代码都已提交
45
44
  - [ ] 所有测试通过
46
45
  - [ ] 代码审查已通过
47
- - [ ] 所有工作流步骤已完成(对 yaml `commit` 步骤的 `pr_tasks` 列表,仅在 `requiresPullRequest !== false` 时计入)
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
  下一步 - 完成并归档任务:
53
- - Claude Code / OpenCode: /complete-task {task-id}
54
- - Gemini CLI: /agent-infra:complete-task {task-id}
55
- - Codex CLI: $complete-task {task-id}
54
+ - Claude Code / OpenCode: /complete-task {task-ref}
55
+ - Gemini CLI: /agent-infra:complete-task {task-ref}
56
+ - Codex CLI: $complete-task {task-ref}
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}
56
80
  ```
57
81
 
58
82
  ### 场景 2:还有后续工作
@@ -75,25 +99,9 @@ date "+%Y-%m-%d %H:%M:%S%:z"
75
99
 
76
100
  ```text
77
101
  下一步 - 代码审查:
78
- - Claude Code / OpenCode: /review-code {task-id}
79
- - Gemini CLI: /agent-infra:review-code {task-id}
80
- - Codex CLI: $review-code {task-id}
81
- ```
82
-
83
- ### 场景 4:准备创建 PR
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-id}
95
- - Gemini CLI: /agent-infra:create-pr {task-id}
96
- - Codex CLI: $create-pr {task-id}
102
+ - Claude Code / OpenCode: /review-code {task-ref}
103
+ - Gemini CLI: /agent-infra:review-code {task-ref}
104
+ - Codex CLI: $review-code {task-ref}
97
105
  ```
98
106
 
99
- > 注意:四个场景之外,只要 `task.md` 中存在有效 `pr_number`,commit 技能必须先按 `reference/pr-summary-sync.md` 同步 PR 摘要,再进入完成校验。
107
+ > 注意:上述场景之外,只要 `task.md` 中存在有效 `pr_number`,commit 技能必须先按 `reference/pr-summary-sync.md` 同步 PR 摘要,再进入完成校验。
@@ -28,7 +28,7 @@ Before the state check is complete, do not make external-state assertions such a
28
28
 
29
29
  ## Task id short ref
30
30
 
31
- > If `{task-id}` begins with `#`, 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.
31
+ > 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
32
 
33
33
  ## Steps
34
34
 
@@ -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 `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.
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 those items toward the missing-work decision only when `.agents/.airc.json:requiresPullRequest !== false`**)
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
@@ -89,7 +115,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
89
115
  - Verify and check off all items in `## Completion Checklist` (change `- [ ]` to `- [x]`)
90
116
  - **Append** to `## Activity Log` (do NOT overwrite previous entries):
91
117
  ```
92
- - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Completed** by {agent} — Task moved to completed/
118
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Complete Task** by {agent} — Task moved to completed/
93
119
  ```
94
120
 
95
121
  ### 4. Move Task
@@ -146,6 +172,10 @@ 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
 
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.
178
+
149
179
  Output format:
150
180
  ```
151
181
  Task {task-id} completed; task directory moved to completed/.
@@ -157,6 +187,13 @@ Task info:
157
187
 
158
188
  Deliverables:
159
189
  - {List of key outputs: files modified, tests added, etc.}
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
+
196
+ Completed at: {completion-time}
160
197
  ```
161
198
 
162
199
 
@@ -28,7 +28,7 @@ tail .agents/workspace/active/{task-id}/task.md
28
28
 
29
29
  ## 任务入参短号别名
30
30
 
31
- > 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
31
+ > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
32
32
 
33
33
  ## 执行步骤
34
34
  ### 1. 验证任务存在
@@ -43,10 +43,36 @@ tail .agents/workspace/active/{task-id}/task.md
43
43
 
44
44
  ### 2. 验证完成前置条件(未满足则必须停止)
45
45
 
46
- **门控读取(项目级 PR 流程策略)**:在执行本步骤前,读取 `.agents/.airc.json` 的 `requiresPullRequest` 字段;当字段缺失或为 `true` 时视为「启用 PR 流程」(默认),仅当显式为 `false` 时视为「关闭 PR 流程」。下面的工作流步骤完成判定按此规则裁剪。
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` 列表,仅在 `.agents/.airc.json:requiresPullRequest !== false` 时计入未完成判定**)
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
  - [ ] 测试通过
@@ -88,7 +114,7 @@ date "+%Y-%m-%d %H:%M:%S%:z"
88
114
  - 逐项验证并勾选 `## 完成检查清单` 中的所有条目(将 `- [ ]` 改为 `- [x]`)
89
115
  - **追加**到 `## Activity Log`(不要覆盖之前的记录):
90
116
  ```
91
- - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Completed** by {agent} — Task moved to completed/
117
+ - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Complete Task** by {agent} — Task moved to completed/
92
118
  ```
93
119
 
94
120
  ### 4. 转移任务
@@ -145,6 +171,10 @@ node .agents/scripts/validate-artifact.js gate complete-task .agents/workspace/c
145
171
 
146
172
  > 仅在校验通过后执行本步骤。
147
173
 
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` 读取)。该块独立于「下一步」语义,不是工作流后继命令。
177
+
148
178
  输出格式:
149
179
  ```
150
180
  任务 {task-id} 已完成,任务目录已转移到 completed/。
@@ -156,6 +186,13 @@ node .agents/scripts/validate-artifact.js gate complete-task .agents/workspace/c
156
186
 
157
187
  交付物:
158
188
  - {关键产出列表:修改的文件、添加的测试等}
189
+
190
+ 可选:清理本任务的沙箱
191
+ (任务已归档,沙箱容器和 per-branch 配置目录不会自动回收。如果不再需要可执行:)
192
+
193
+ ai sandbox rm {branch}
194
+
195
+ Completed at: {completion-time}
159
196
  ```
160
197
 
161
198
 
@@ -18,7 +18,7 @@
18
18
  "require_completed_at": true
19
19
  },
20
20
  "activity-log": {
21
- "expected_action_pattern": "Completed",
21
+ "expected_action_pattern": "(Complete Task|Completed)",
22
22
  "freshness_minutes": 30
23
23
  },
24
24
  "completion-checklist": {
@@ -18,7 +18,7 @@
18
18
  "require_completed_at": true
19
19
  },
20
20
  "activity-log": {
21
- "expected_action_pattern": "Completed",
21
+ "expected_action_pattern": "(Complete Task|Completed)",
22
22
  "freshness_minutes": 30
23
23
  },
24
24
  "completion-checklist": {
@@ -13,24 +13,24 @@ Version stamp rule: when creating or updating `task.md` frontmatter, read `.agen
13
13
 
14
14
  ## Task id short ref
15
15
 
16
- > If `{task-id}` begins with `#`, 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.
16
+ > 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.
17
17
 
18
18
  ## Execution Flow
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 `requiresPullRequest` field. Treat missing or `true` as "PR flow enabled" (default); treat explicit `false` as "PR flow disabled".
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
- - missing / `true` -> continue to Step 1 below
26
- - 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:
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 `requiresPullRequest: false`).
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
- - Claude Code / OpenCode: /complete-task {task-id}
32
- - Gemini CLI: /agent-infra:complete-task {task-id}
33
- - Codex CLI: $complete-task {task-id}
31
+ - Claude Code / OpenCode: /complete-task {task-ref}
32
+ - Gemini CLI: /agent-infra:complete-task {task-ref}
33
+ - Codex CLI: $complete-task {task-ref}
34
34
  ```
35
35
 
36
36
  ### 1. Parse Command Arguments
@@ -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 PR Created 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).
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 `complete-task {task-id}` once the workflow is truly done.
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
 
@@ -13,24 +13,24 @@ description: "创建 Pull Request 到目标分支"
13
13
 
14
14
  ## 任务入参短号别名
15
15
 
16
- > 如果 `{task-id}` 入参以 `#` 开头,先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
16
+ > 如果 `{task-id}` 入参匹配 `^[#]?[0-9]+$`(裸数字或带 `#` 前缀),先读取 `.agents/rules/task-short-id.md` 的「SKILL 入参解析」段执行解析;后续命令视 `{task-id}` 为解析后的全长 `TASK-YYYYMMDD-HHMMSS` 形式。
17
17
 
18
18
  ## 执行流程
19
19
 
20
20
  ### 前置门控:项目级 PR 流程检查
21
21
 
22
- **门控读取(项目级 PR 流程策略)**:在执行编号步骤前,读取 `.agents/.airc.json` 的 `requiresPullRequest` 字段;当字段缺失或为 `true` 时视为「启用 PR 流程」(默认),仅当显式为 `false` 时视为「关闭 PR 流程」。
22
+ **门控读取(项目级 PR 流程策略)**:在执行编号步骤前,读取 `.agents/.airc.json` 的 `prFlow` 字段(三态:字段缺省 = 默认推荐 PR、允许跳过;`"required"` = 强制 PR;`"disabled"` = 强制无 PR)。
23
23
 
24
24
  按读取结果分支:
25
- - 缺失 / `true` → 继续到下方第 1 步
26
- - 显式 `false` → 输出以下消息后**立即停止**,不要执行任何后续编号步骤、不要触发任何 PR 创建命令、不要修改 `task.md` 的 `pr_number`、不要发布 PR 摘要评论:
25
+ - 缺省 / `"required"` → 继续到下方第 1 步
26
+ - `"disabled"` → 输出以下消息后**立即停止**,不要执行任何后续编号步骤、不要触发任何 PR 创建命令、不要修改 `task.md` 的 `pr_number` / `pr_status`、不要发布 PR 摘要评论:
27
27
 
28
28
  ```
29
- 当前项目未启用 PR 流程(`.agents/.airc.json` 中 `requiresPullRequest: false`)。
29
+ 当前项目未启用 PR 流程(`.agents/.airc.json` 中 `prFlow: "disabled"`)。
30
30
  无需创建 Pull Request,请直接运行:
31
- - Claude Code / OpenCode:/complete-task {task-id}
32
- - Gemini CLI:/agent-infra:complete-task {task-id}
33
- - Codex CLI:$complete-task {task-id}
31
+ - Claude Code / OpenCode:/complete-task {task-ref}
32
+ - Gemini CLI:/agent-infra:complete-task {task-ref}
33
+ - Codex CLI:$complete-task {task-ref}
34
34
  ```
35
35
 
36
36
  ### 1. 解析命令参数
@@ -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`,并追加 PR Created 的 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、元数据同步结果、摘要评论结果,并在工作流真正完成后推荐执行 `complete-task {task-id}`。
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
 
@@ -15,7 +15,7 @@
15
15
  ]
16
16
  },
17
17
  "activity-log": {
18
- "expected_action_pattern": "PR Created",
18
+ "expected_action_pattern": "(Create PR|PR Created)",
19
19
  "freshness_minutes": 30
20
20
  },
21
21
  "platform-sync": {
@@ -26,6 +26,7 @@
26
26
  "verify_pr_assignee": true,
27
27
  "verify_issue_fields": true,
28
28
  "verify_milestone": true,
29
+ "verify_milestone_specific": true,
29
30
  "expected_pr_comment_marker_key": "prSummary"
30
31
  }
31
32
  }