@fitlab-ai/agent-infra 0.8.3 → 0.8.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.
Files changed (100) hide show
  1. package/README.zh-CN.md +10 -0
  2. package/bin/cli.ts +1 -1
  3. package/dist/bin/cli.js +1 -1
  4. package/dist/lib/cp.js +56 -15
  5. package/dist/lib/defaults.json +1 -0
  6. package/dist/lib/sandbox/capture.js +5 -3
  7. package/dist/lib/sandbox/clipboard/bridge.js +12 -9
  8. package/dist/lib/sandbox/clipboard/inbox.js +82 -0
  9. package/dist/lib/sandbox/commands/create.js +39 -23
  10. package/dist/lib/sandbox/runtimes/base.dockerfile +3 -0
  11. package/dist/lib/sandbox/shell.js +9 -1
  12. package/dist/lib/sandbox/tools.js +2 -2
  13. package/lib/cp.ts +56 -15
  14. package/lib/defaults.json +1 -0
  15. package/lib/sandbox/capture.ts +5 -3
  16. package/lib/sandbox/clipboard/bridge.ts +14 -12
  17. package/lib/sandbox/clipboard/inbox.ts +83 -0
  18. package/lib/sandbox/commands/create.ts +48 -24
  19. package/lib/sandbox/runtimes/base.dockerfile +3 -0
  20. package/lib/sandbox/shell.ts +11 -2
  21. package/lib/sandbox/tools.ts +5 -5
  22. package/package.json +1 -1
  23. package/templates/.agents/README.en.md +3 -0
  24. package/templates/.agents/README.zh-CN.md +3 -0
  25. package/templates/.agents/rules/create-issue.github.en.md +1 -1
  26. package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
  27. package/templates/.agents/rules/review-handshake.en.md +2 -2
  28. package/templates/.agents/rules/review-handshake.zh-CN.md +2 -2
  29. package/templates/.agents/rules/testing-discipline.en.md +3 -41
  30. package/templates/.agents/rules/testing-discipline.zh-CN.md +3 -41
  31. package/templates/.agents/scripts/validate-artifact.js +93 -0
  32. package/templates/.agents/skills/analyze-task/SKILL.en.md +1 -1
  33. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +2 -2
  34. package/templates/.agents/skills/archive-tasks/scripts/archive-tasks.sh +1 -1
  35. package/templates/.agents/skills/block-task/SKILL.en.md +1 -1
  36. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
  37. package/templates/.agents/skills/cancel-task/SKILL.en.md +1 -1
  38. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
  39. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +9 -9
  40. package/templates/.agents/skills/close-codescan/SKILL.en.md +1 -1
  41. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +2 -2
  42. package/templates/.agents/skills/close-dependabot/SKILL.en.md +1 -1
  43. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +2 -2
  44. package/templates/.agents/skills/code-task/SKILL.en.md +1 -1
  45. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +1 -1
  46. package/templates/.agents/skills/code-task/reference/branch-management.zh-CN.md +2 -2
  47. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +2 -2
  48. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +2 -2
  49. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +1 -1
  50. package/templates/.agents/skills/commit/SKILL.en.md +1 -1
  51. package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
  52. package/templates/.agents/skills/commit/reference/task-status-update.en.md +6 -6
  53. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +6 -6
  54. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +27 -3
  55. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +27 -3
  56. package/templates/.agents/skills/complete-task/SKILL.en.md +1 -1
  57. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +1 -1
  58. package/templates/.agents/skills/create-pr/SKILL.en.md +4 -4
  59. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +4 -4
  60. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +1 -1
  61. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +1 -1
  62. package/templates/.agents/skills/create-task/SKILL.en.md +2 -2
  63. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -5
  64. package/templates/.agents/skills/import-codescan/SKILL.en.md +2 -2
  65. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +3 -3
  66. package/templates/.agents/skills/import-dependabot/SKILL.en.md +2 -2
  67. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +3 -3
  68. package/templates/.agents/skills/import-issue/SKILL.en.md +2 -2
  69. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +3 -3
  70. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +1 -1
  71. package/templates/.agents/skills/init-milestones/SKILL.en.md +3 -2
  72. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +4 -3
  73. package/templates/.agents/skills/init-milestones/scripts/init-milestones.github.sh +165 -41
  74. package/templates/.agents/skills/plan-task/SKILL.en.md +1 -1
  75. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +2 -2
  76. package/templates/.agents/skills/restore-task/SKILL.en.md +1 -1
  77. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +1 -1
  78. package/templates/.agents/skills/review-analysis/SKILL.en.md +1 -1
  79. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +1 -1
  80. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +5 -5
  81. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +5 -5
  82. package/templates/.agents/skills/review-code/SKILL.en.md +8 -4
  83. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +6 -3
  84. package/templates/.agents/skills/review-code/config/verify.en.json +1 -0
  85. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -0
  86. package/templates/.agents/skills/review-code/reference/output-templates.en.md +5 -5
  87. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +5 -5
  88. package/templates/.agents/skills/review-code/reference/report-template.en.md +2 -2
  89. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +2 -2
  90. package/templates/.agents/skills/review-plan/SKILL.en.md +1 -1
  91. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +1 -1
  92. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +5 -5
  93. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +5 -5
  94. package/templates/.agents/skills/test/SKILL.zh-CN.md +26 -8
  95. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +1 -1
  96. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +29 -6
  97. package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -2
  98. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +2 -2
  99. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +8 -1
  100. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +8 -1
@@ -6,7 +6,9 @@ import { fileURLToPath } from "node:url";
6
6
 
7
7
  import {
8
8
  extractReviewBaseline,
9
+ extractReviewDiffFingerprint,
9
10
  findAuthoritativeReviewCodeArtifact,
11
+ parseReviewVerdict,
10
12
  resolvePostReviewGlobs
11
13
  } from "./lib/post-review-commit.js";
12
14
 
@@ -223,6 +225,8 @@ function runCheck(type, context) {
223
225
  return checkCompletionChecklist(context);
224
226
  case "review-ledger":
225
227
  return checkReviewLedger(context);
228
+ case "review-fact":
229
+ return checkReviewFact(context);
226
230
  case "post-review-commit":
227
231
  return checkPostReviewCommit(context);
228
232
  default: {
@@ -818,6 +822,95 @@ function checkPostReviewCommit({ taskDir, config }) {
818
822
  );
819
823
  }
820
824
 
825
+ function checkReviewFact({ taskDir, artifactFile }) {
826
+ const resolvedArtifact = resolveArtifactPath(
827
+ taskDir,
828
+ "review-code.md|review-code-r{N}.md",
829
+ artifactFile
830
+ );
831
+ if (!resolvedArtifact.ok) {
832
+ return failResult("review-fact", resolvedArtifact.message);
833
+ }
834
+
835
+ const task = loadTask(taskDir);
836
+ if (!task.ok) {
837
+ return failResult("review-fact", task.message);
838
+ }
839
+
840
+ const content = fs.readFileSync(resolvedArtifact.path, "utf8");
841
+ const verdict = parseReviewVerdict(content);
842
+ const reviewBaseline = extractReviewBaseline(content);
843
+ const reviewedFingerprint = extractReviewDiffFingerprint(content);
844
+
845
+ if (!["通过", "需要修改", "拒绝", "Approved", "Changes Requested", "Rejected"].includes(verdict)) {
846
+ return failResult("review-fact", `Unsupported review verdict '${verdict}'`);
847
+ }
848
+
849
+ let gitRoot;
850
+ let head;
851
+ let baseline;
852
+ try {
853
+ gitRoot = execFileSync("git", ["-C", taskDir, "rev-parse", "--show-toplevel"], { encoding: "utf8" }).trim();
854
+ head = execFileSync("git", ["-C", gitRoot, "rev-parse", "HEAD"], { encoding: "utf8" }).trim();
855
+ baseline = execFileSync("git", ["-C", gitRoot, "rev-parse", `${reviewBaseline}^{commit}`], { encoding: "utf8" }).trim();
856
+ } catch {
857
+ return blockedResult(
858
+ "review-fact",
859
+ `Unable to resolve review baseline '${reviewBaseline}' in the task repository; re-run review-code`
860
+ );
861
+ }
862
+
863
+ if (baseline !== head) {
864
+ return failResult(
865
+ "review-fact",
866
+ `Review baseline ${baseline.slice(0, 8)} does not match current HEAD ${head.slice(0, 8)}; re-run review-code`
867
+ );
868
+ }
869
+
870
+ let actualFingerprint;
871
+ try {
872
+ actualFingerprint = execFileSync(
873
+ process.execPath,
874
+ [path.join(repoRoot, ".agents", "scripts", "review-diff-fingerprint.js"), "worktree", baseline],
875
+ { cwd: gitRoot, encoding: "utf8" }
876
+ ).trim();
877
+ } catch {
878
+ return blockedResult(
879
+ "review-fact",
880
+ `Unable to recompute reviewed diff fingerprint from baseline ${baseline.slice(0, 8)}; re-run review-code`
881
+ );
882
+ }
883
+
884
+ if (actualFingerprint !== reviewedFingerprint) {
885
+ return failResult(
886
+ "review-fact",
887
+ `Reviewed diff fingerprint does not match the current worktree for baseline ${baseline.slice(0, 8)}; re-run review-code`
888
+ );
889
+ }
890
+
891
+ if (["通过", "Approved"].includes(verdict)) {
892
+ const lastReviewedCommit = String(task.metadata.last_reviewed_commit || "").trim();
893
+ let reviewedCommit = "";
894
+ try {
895
+ reviewedCommit = execFileSync("git", ["-C", gitRoot, "rev-parse", `${lastReviewedCommit}^{commit}`], { encoding: "utf8" }).trim();
896
+ } catch {
897
+ // The failure below names the missing or invalid task review fact.
898
+ }
899
+
900
+ if (reviewedCommit !== baseline) {
901
+ return failResult(
902
+ "review-fact",
903
+ `Approved review must set task last_reviewed_commit to baseline ${baseline.slice(0, 8)}`
904
+ );
905
+ }
906
+ }
907
+
908
+ return passResult(
909
+ "review-fact",
910
+ `Review fact valid for ${path.basename(resolvedArtifact.path)} at ${baseline.slice(0, 8)}`
911
+ );
912
+ }
913
+
821
914
  function resolvePostReviewBaseline({ gitRoot, lastReviewedCommit, reviewBaseline, reviewArtifact }) {
822
915
  if (lastReviewedCommit) {
823
916
  if (SHA_PATTERN.test(lastReviewedCommit) && gitCommitExists(gitRoot, lastReviewedCommit)) {
@@ -210,7 +210,7 @@ Create `.agents/workspace/active/{task-id}/{analysis-artifact}`.
210
210
  Get the current time:
211
211
 
212
212
  ```bash
213
- date "+%Y-%m-%d %H:%M:%S%:z"
213
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
214
214
  ```
215
215
 
216
216
  Update `.agents/workspace/active/{task-id}/task.md`:
@@ -209,7 +209,7 @@ tail .agents/workspace/active/{task-id}/task.md
209
209
  获取当前时间:
210
210
 
211
211
  ```bash
212
- date "+%Y-%m-%d %H:%M:%S%:z"
212
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
213
213
  ```
214
214
 
215
215
  更新 `.agents/workspace/active/{task-id}/task.md`:
@@ -275,7 +275,7 @@ node .agents/scripts/validate-artifact.js gate analyze-task .agents/workspace/ac
275
275
 
276
276
  下一步 - 审查需求分析:
277
277
  - Claude Code / OpenCode:/review-analysis {task-ref}
278
- - Gemini CLI:/agent-infra:review-analysis {task-ref}
278
+ - Gemini CLI:/{{project}}:review-analysis {task-ref}
279
279
  - Codex CLI:$review-analysis {task-ref}
280
280
  ```
281
281
 
@@ -210,7 +210,7 @@ rebuild_manifest() {
210
210
  entries_file="$tmpdir/manifest.tsv"
211
211
  month_keys_file="$tmpdir/manifest-months.tsv"
212
212
  year_keys_file="$tmpdir/manifest-years.tsv"
213
- generated_at=$(date "+%Y-%m-%d %H:%M:%S%:z")
213
+ generated_at=$(date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/')
214
214
 
215
215
  mkdir -p "$ARCHIVE_DIR"
216
216
  : > "$entries_file"
@@ -58,7 +58,7 @@ Before blocking, thoroughly analyze:
58
58
  Get the current time:
59
59
 
60
60
  ```bash
61
- date "+%Y-%m-%d %H:%M:%S%:z"
61
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
62
62
  ```
63
63
 
64
64
  Update `.agents/workspace/active/{task-id}/task.md`:
@@ -57,7 +57,7 @@ description: >
57
57
  获取当前时间:
58
58
 
59
59
  ```bash
60
- date "+%Y-%m-%d %H:%M:%S%:z"
60
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
61
61
  ```
62
62
 
63
63
  更新 `.agents/workspace/active/{task-id}/task.md`:
@@ -140,7 +140,7 @@ ai sandbox rm {branch}
140
140
 
141
141
  下一步 - 检查任务状态(解除阻塞后):
142
142
  - Claude Code / OpenCode:/check-task {task-ref}
143
- - Gemini CLI:/agent-infra:check-task {task-ref}
143
+ - Gemini CLI:/{{project}}:check-task {task-ref}
144
144
  - Codex CLI:$check-task {task-ref}
145
145
  ```
146
146
 
@@ -58,7 +58,7 @@ When syncing to the Issue, replace any existing `status:` labels with the inferr
58
58
  Get the current time:
59
59
 
60
60
  ```bash
61
- date "+%Y-%m-%d %H:%M:%S%:z"
61
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
62
62
  ```
63
63
 
64
64
  Update `task.md` in the task directory:
@@ -57,7 +57,7 @@ description: >
57
57
  获取当前时间:
58
58
 
59
59
  ```bash
60
- date "+%Y-%m-%d %H:%M:%S%:z"
60
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
61
61
  ```
62
62
 
63
63
  更新任务目录中的 `task.md`:
@@ -149,7 +149,7 @@ ai sandbox rm {branch}
149
149
 
150
150
  下一步 - 查看已转移任务:
151
151
  - Claude Code / OpenCode:/check-task {task-ref}
152
- - Gemini CLI:/agent-infra:check-task {task-ref}
152
+ - Gemini CLI:/{{project}}:check-task {task-ref}
153
153
  - Codex CLI:$check-task {task-ref}
154
154
  ```
155
155
 
@@ -78,15 +78,15 @@ ai task status {task-id}
78
78
 
79
79
  | 当前状态 | Claude Code / OpenCode | Gemini CLI | Codex CLI |
80
80
  |--------------------|------------------------------|------------------------------------------|------------------------------|
81
- | 分析完成 | `/review-analysis {task-ref}` | `/agent-infra:review-analysis {task-ref}` | `$review-analysis {task-ref}` |
82
- | 需求分析审查通过 | `/plan-task {task-ref}` | `/agent-infra:plan-task {task-ref}` | `$plan-task {task-ref}` |
83
- | 需求分析审查有问题 | `/analyze-task {task-ref}` | `/agent-infra:analyze-task {task-ref}` | `$analyze-task {task-ref}` |
84
- | 计划完成 | `/review-plan {task-ref}` | `/agent-infra:review-plan {task-ref}` | `$review-plan {task-ref}` |
85
- | 技术方案审查通过 | `/code-task {task-ref}` | `/agent-infra:code-task {task-ref}` | `$code-task {task-ref}` |
86
- | 技术方案审查有问题 | `/plan-task {task-ref}` | `/agent-infra:plan-task {task-ref}` | `$plan-task {task-ref}` |
87
- | 实现完成 | `/review-code {task-ref}` | `/agent-infra:review-code {task-ref}` | `$review-code {task-ref}` |
88
- | 代码审查通过 | `/commit` | `/agent-infra:commit` | `$commit` |
89
- | 代码审查有问题 | `/code-task {task-ref}` | `/agent-infra:code-task {task-ref}` | `$code-task {task-ref}` |
81
+ | 分析完成 | `/review-analysis {task-ref}` | `/{{project}}:review-analysis {task-ref}` | `$review-analysis {task-ref}` |
82
+ | 需求分析审查通过 | `/plan-task {task-ref}` | `/{{project}}:plan-task {task-ref}` | `$plan-task {task-ref}` |
83
+ | 需求分析审查有问题 | `/analyze-task {task-ref}` | `/{{project}}:analyze-task {task-ref}` | `$analyze-task {task-ref}` |
84
+ | 计划完成 | `/review-plan {task-ref}` | `/{{project}}:review-plan {task-ref}` | `$review-plan {task-ref}` |
85
+ | 技术方案审查通过 | `/code-task {task-ref}` | `/{{project}}:code-task {task-ref}` | `$code-task {task-ref}` |
86
+ | 技术方案审查有问题 | `/plan-task {task-ref}` | `/{{project}}:plan-task {task-ref}` | `$plan-task {task-ref}` |
87
+ | 实现完成 | `/review-code {task-ref}` | `/{{project}}:review-code {task-ref}` | `$review-code {task-ref}` |
88
+ | 代码审查通过 | `/commit` | `/{{project}}:commit` | `$commit` |
89
+ | 代码审查有问题 | `/code-task {task-ref}` | `/{{project}}:code-task {task-ref}` | `$code-task {task-ref}` |
90
90
  | 任务被阻塞 | 解除阻塞或提供所需信息 | — | 解除阻塞或提供所需信息 |
91
91
  | 任务已完成 | 无需操作 | — | 无需操作 |
92
92
 
@@ -88,7 +88,7 @@ If a related task exists (search for `codescan_alert_number: <alert-number>`):
88
88
  Get the current time:
89
89
 
90
90
  ```bash
91
- date "+%Y-%m-%d %H:%M:%S%:z"
91
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
92
92
  ```
93
93
 
94
94
  - Add the dismissal record to task.md
@@ -88,7 +88,7 @@ Code Scanning 告警 #{alert-number}
88
88
  获取当前时间:
89
89
 
90
90
  ```bash
91
- date "+%Y-%m-%d %H:%M:%S%:z"
91
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
92
92
  ```
93
93
 
94
94
  - 添加关闭记录到 task.md
@@ -128,7 +128,7 @@ ai sandbox rm {branch}
128
128
 
129
129
  下一步 - 完成并归档任务(如有关联任务):
130
130
  - Claude Code / OpenCode:/complete-task {task-ref}
131
- - Gemini CLI:/agent-infra:complete-task {task-ref}
131
+ - Gemini CLI:/{{project}}:complete-task {task-ref}
132
132
  - Codex CLI:$complete-task {task-ref}
133
133
  ```
134
134
 
@@ -96,7 +96,7 @@ If a related task exists (search for `security_alert_number: <alert-number>`):
96
96
  Get the current time:
97
97
 
98
98
  ```bash
99
- date "+%Y-%m-%d %H:%M:%S%:z"
99
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
100
100
  ```
101
101
 
102
102
  - Add the dismissal record to task.md
@@ -96,7 +96,7 @@ CVE:{cve-id}
96
96
  获取当前时间:
97
97
 
98
98
  ```bash
99
- date "+%Y-%m-%d %H:%M:%S%:z"
99
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
100
100
  ```
101
101
 
102
102
  - 添加关闭记录到 task.md
@@ -136,7 +136,7 @@ ai sandbox rm {branch}
136
136
 
137
137
  下一步 - 完成并归档任务(如有关联任务):
138
138
  - Claude Code / OpenCode:/complete-task {task-ref}
139
- - Gemini CLI:/agent-infra:complete-task {task-ref}
139
+ - Gemini CLI:/{{project}}:complete-task {task-ref}
140
140
  - Codex CLI:$complete-task {task-ref}
141
141
  ```
142
142
 
@@ -114,7 +114,7 @@ Create `.agents/workspace/active/{task-id}/{code-artifact}`.
114
114
  Get the current time:
115
115
 
116
116
  ```bash
117
- date "+%Y-%m-%d %H:%M:%S%:z"
117
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
118
118
  ```
119
119
 
120
120
  Set `current_step` to `code`, refresh task metadata, and append one Activity Log entry:
@@ -156,7 +156,7 @@ echo "$result"
156
156
  获取当前时间:
157
157
 
158
158
  ```bash
159
- date "+%Y-%m-%d %H:%M:%S%:z"
159
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
160
160
  ```
161
161
 
162
162
  更新 `.agents/workspace/active/{task-id}/task.md`:
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 分支名规则
6
6
 
7
- - 格式:`agent-infra-{type}-{slug}`
7
+ - 格式:`{{project}}-{type}-{slug}`
8
8
  - 项目前缀:读取 `.agents/.airc.json` 中的 `project`
9
9
  - `{type}`:读取 `task.md` frontmatter 中的 `type`
10
10
  - `{slug}`:根据任务标题提取 3-6 个英文关键词,转为 kebab-case
@@ -23,7 +23,7 @@
23
23
  - 当前分支不一致:按下方”创建与切换命令”章节切换到已记录分支
24
24
 
25
25
  场景 B:`task.md` 未记录任务分支
26
- - 判断当前分支是否符合项目分支命名规范(`agent-infra-{type}-{slug}`)且语义上属于当前任务
26
+ - 判断当前分支是否符合项目分支命名规范(`{{project}}-{type}-{slug}`)且语义上属于当前任务
27
27
  - 符合:将当前分支名回写到 `task.md`,继续
28
28
  - 不符合:生成新的任务分支名,按下方”创建与切换命令”章节创建并切换,回写到 `task.md`
29
29
 
@@ -74,11 +74,11 @@ Fix status:
74
74
  Next step - re-review or commit:
75
75
  - Re-review (always recommended):
76
76
  - Claude Code / OpenCode: /review-code {task-ref}
77
- - Gemini CLI: /agent-infra:review-code {task-ref}
77
+ - Gemini CLI: /{{project}}:review-code {task-ref}
78
78
  - Codex CLI: $review-code {task-ref}
79
79
  - Commit directly (optional; only when all issues are resolved and changes are low risk):
80
80
  - Claude Code / OpenCode: /commit
81
- - Gemini CLI: /agent-infra:commit
81
+ - Gemini CLI: /{{project}}:commit
82
82
  - Codex CLI: $commit
83
83
  ```
84
84
 
@@ -74,11 +74,11 @@ manual-validation 项不在修复范围。处理规则:
74
74
  下一步 - 重新审查或提交:
75
75
  - 重新审查(始终推荐):
76
76
  - Claude Code / OpenCode:/review-code {task-ref}
77
- - Gemini CLI:/agent-infra:review-code {task-ref}
77
+ - Gemini CLI:/{{project}}:review-code {task-ref}
78
78
  - Codex CLI:$review-code {task-ref}
79
79
  - 直接提交(可选;仅在所有问题已解决且风险可控时):
80
80
  - Claude Code / OpenCode:/commit
81
- - Gemini CLI:/agent-infra:commit
81
+ - Gemini CLI:/{{project}}:commit
82
82
  - Codex CLI:$commit
83
83
  ```
84
84
 
@@ -15,6 +15,6 @@
15
15
 
16
16
  下一步 - 代码审查:
17
17
  - Claude Code / OpenCode:/review-code {task-ref}
18
- - Gemini CLI:/agent-infra:review-code {task-ref}
18
+ - Gemini CLI:/{{project}}:review-code {task-ref}
19
19
  - Codex CLI:$review-code {task-ref}
20
20
  ```
@@ -91,7 +91,7 @@ Fold the push outcome (pushed / skipped(no PR) / failed) into the next step's "U
91
91
  Get the current time:
92
92
 
93
93
  ```bash
94
- date "+%Y-%m-%d %H:%M:%S%:z"
94
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
95
95
  ```
96
96
 
97
97
  > 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.
@@ -91,7 +91,7 @@ c. 安全降级(不阻塞已完成的 `git commit`,仅提示用户):
91
91
  获取当前时间:
92
92
 
93
93
  ```bash
94
- date "+%Y-%m-%d %H:%M:%S%:z"
94
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
95
95
  ```
96
96
 
97
97
  > 完整的 4 种状态分支、前置条件检查和多 TUI 下一步命令见 `reference/task-status-update.md`。更新任务状态前,先读取 `reference/task-status-update.md`。
@@ -9,7 +9,7 @@ Before updating task metadata, read `.agents/rules/version-stamp.md` and refresh
9
9
  Get the current time first:
10
10
 
11
11
  ```bash
12
- date "+%Y-%m-%d %H:%M:%S%:z"
12
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
13
13
  ```
14
14
 
15
15
  For every task-related commit, append this Activity Log entry in `task.md`:
@@ -60,7 +60,7 @@ Required next-step commands (rendered by `prFlow`):
60
60
  ```text
61
61
  Next step - complete and archive the task:
62
62
  - Claude Code / OpenCode: /complete-task {task-ref}
63
- - Gemini CLI: /agent-infra:complete-task {task-ref}
63
+ - Gemini CLI: /{{project}}:complete-task {task-ref}
64
64
  - Codex CLI: $complete-task {task-ref}
65
65
  ```
66
66
 
@@ -69,7 +69,7 @@ Next step - complete and archive the task:
69
69
  ```text
70
70
  Next step - create Pull Request:
71
71
  - Claude Code / OpenCode: /create-pr {task-ref}
72
- - Gemini CLI: /agent-infra:create-pr {task-ref}
72
+ - Gemini CLI: /{{project}}:create-pr {task-ref}
73
73
  - Codex CLI: $create-pr {task-ref}
74
74
  ```
75
75
 
@@ -79,11 +79,11 @@ field absent -> two options:
79
79
  Next step - choose one:
80
80
  - Go through the PR flow:
81
81
  - Claude Code / OpenCode: /create-pr {task-ref}
82
- - Gemini CLI: /agent-infra:create-pr {task-ref}
82
+ - Gemini CLI: /{{project}}:create-pr {task-ref}
83
83
  - Codex CLI: $create-pr {task-ref}
84
84
  - Complete directly (no PR):
85
85
  - Claude Code / OpenCode: /complete-task {task-ref}
86
- - Gemini CLI: /agent-infra:complete-task {task-ref}
86
+ - Gemini CLI: /{{project}}:complete-task {task-ref}
87
87
  - Codex CLI: $complete-task {task-ref}
88
88
  ```
89
89
 
@@ -108,7 +108,7 @@ Required next-step commands:
108
108
  ```text
109
109
  Next step - code review:
110
110
  - Claude Code / OpenCode: /review-code {task-ref}
111
- - Gemini CLI: /agent-infra:review-code {task-ref}
111
+ - Gemini CLI: /{{project}}:review-code {task-ref}
112
112
  - Codex CLI: $review-code {task-ref}
113
113
  ```
114
114
 
@@ -9,7 +9,7 @@
9
9
  先获取当前时间:
10
10
 
11
11
  ```bash
12
- date "+%Y-%m-%d %H:%M:%S%:z"
12
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
13
13
  ```
14
14
 
15
15
  对于每一次与任务相关的提交,都要在 `task.md` 中追加以下 Activity Log:
@@ -60,7 +60,7 @@ last_reviewed_commit: {new_head}
60
60
  ```text
61
61
  下一步 - 完成并归档任务:
62
62
  - Claude Code / OpenCode: /complete-task {task-ref}
63
- - Gemini CLI: /agent-infra:complete-task {task-ref}
63
+ - Gemini CLI: /{{project}}:complete-task {task-ref}
64
64
  - Codex CLI: $complete-task {task-ref}
65
65
  ```
66
66
 
@@ -69,7 +69,7 @@ last_reviewed_commit: {new_head}
69
69
  ```text
70
70
  下一步 - 创建 Pull Request:
71
71
  - Claude Code / OpenCode: /create-pr {task-ref}
72
- - Gemini CLI: /agent-infra:create-pr {task-ref}
72
+ - Gemini CLI: /{{project}}:create-pr {task-ref}
73
73
  - Codex CLI: $create-pr {task-ref}
74
74
  ```
75
75
 
@@ -79,11 +79,11 @@ last_reviewed_commit: {new_head}
79
79
  下一步 - 二选一:
80
80
  - 走 PR 流程:
81
81
  - Claude Code / OpenCode: /create-pr {task-ref}
82
- - Gemini CLI: /agent-infra:create-pr {task-ref}
82
+ - Gemini CLI: /{{project}}:create-pr {task-ref}
83
83
  - Codex CLI: $create-pr {task-ref}
84
84
  - 直接完成(无 PR):
85
85
  - Claude Code / OpenCode: /complete-task {task-ref}
86
- - Gemini CLI: /agent-infra:complete-task {task-ref}
86
+ - Gemini CLI: /{{project}}:complete-task {task-ref}
87
87
  - Codex CLI: $complete-task {task-ref}
88
88
  ```
89
89
 
@@ -108,7 +108,7 @@ last_reviewed_commit: {new_head}
108
108
  ```text
109
109
  下一步 - 代码审查:
110
110
  - Claude Code / OpenCode: /review-code {task-ref}
111
- - Gemini CLI: /agent-infra:review-code {task-ref}
111
+ - Gemini CLI: /{{project}}:review-code {task-ref}
112
112
  - Codex CLI: $review-code {task-ref}
113
113
  ```
114
114
 
@@ -82,14 +82,19 @@ Follow `reference/summary-update.md` to resolve the PR number, find the `sync-pr
82
82
 
83
83
  ### 5. Create the Manual Validation Artifact
84
84
 
85
- Before this step, read `reference/report-template.md`. Create `{manual-validation-artifact}` with state check, validation verdict, validation scope, validation details, and PR summary sync result.
85
+ Before this step, read `reference/report-template.md`. Create `{manual-validation-artifact}` and record:
86
+ - State check
87
+ - Validation verdict
88
+ - Validation scope
89
+ - Validation details
90
+ - PR summary sync result
86
91
 
87
92
  ### 6. Update task.md
88
93
 
89
94
  Get the current time:
90
95
 
91
96
  ```bash
92
- date "+%Y-%m-%d %H:%M:%S%:z"
97
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
93
98
  ```
94
99
 
95
100
  Update `.agents/workspace/active/{task-id}/task.md`:
@@ -113,6 +118,25 @@ Run:
113
118
  node .agents/scripts/validate-artifact.js gate complete-manual-validation .agents/workspace/active/{task-id} {manual-validation-artifact} --format text
114
119
  ```
115
120
 
121
+ Handle the result:
122
+ - Exit code 0 -> tell the user
123
+ - Exit code 1 -> fix the reported problem and rerun
124
+ - Exit code 2 -> stop and report that manual intervention is required
125
+
116
126
  ### 8. Tell the User
117
127
 
118
- Report the artifact path, PR summary sync result, and verification output. Before rendering the final output, read `.agents/rules/next-step-output.md` and append `Completed at: YYYY-MM-DD HH:mm:ss` as the absolute last line.
128
+ Report:
129
+ - Artifact path
130
+ - PR summary sync result
131
+ - Current verification output
132
+ - Suggested next step: continue with `commit` / `create-pr`, or enter the final review flow
133
+
134
+ Before rendering the final output, read `.agents/rules/next-step-output.md` and append `Completed at: YYYY-MM-DD HH:mm:ss` as the absolute last line.
135
+
136
+ ## Completion Checklist
137
+
138
+ - [ ] Read `reference/summary-update.md`
139
+ - [ ] Created the manual validation artifact
140
+ - [ ] Updated the same PR summary comment, or stopped according to failure semantics
141
+ - [ ] Updated task.md and appended the Activity Log
142
+ - [ ] Ran the verification gate
@@ -82,14 +82,19 @@ complete-manual-validation {task-ref} [{pr-ref}] {verification-summary}
82
82
 
83
83
  ### 5. 创建人工验证产物
84
84
 
85
- 执行此步骤前,先读取 `reference/report-template.md`。创建 `{manual-validation-artifact}`,记录状态核对、验证结论、验证范围、验证详情和 PR 摘要同步结果。
85
+ 执行此步骤前,先读取 `reference/report-template.md`。创建 `{manual-validation-artifact}`,记录:
86
+ - 状态核对
87
+ - 验证结论
88
+ - 验证范围
89
+ - 验证详情
90
+ - PR 摘要同步结果
86
91
 
87
92
  ### 6. 更新 task.md
88
93
 
89
94
  获取当前时间:
90
95
 
91
96
  ```bash
92
- date "+%Y-%m-%d %H:%M:%S%:z"
97
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
93
98
  ```
94
99
 
95
100
  更新 `.agents/workspace/active/{task-id}/task.md`:
@@ -113,6 +118,25 @@ date "+%Y-%m-%d %H:%M:%S%:z"
113
118
  node .agents/scripts/validate-artifact.js gate complete-manual-validation .agents/workspace/active/{task-id} {manual-validation-artifact} --format text
114
119
  ```
115
120
 
121
+ 处理结果:
122
+ - 退出码 0 -> 告知用户
123
+ - 退出码 1 -> 修复问题后重新运行
124
+ - 退出码 2 -> 停止并告知需要人工介入
125
+
116
126
  ### 8. 告知用户
117
127
 
118
- 输出产物路径、PR 摘要同步结果和当次完成校验输出。渲染最终输出前,先读取 `.agents/rules/next-step-output.md`,并在绝对最后一行追加 `Completed at: YYYY-MM-DD HH:mm:ss`。
128
+ 输出:
129
+ - 产物路径
130
+ - PR 摘要同步结果
131
+ - 当次完成校验输出
132
+ - 下一步建议:继续 `commit` / `create-pr` 或进入最终审查流程
133
+
134
+ 渲染最终输出前,先读取 `.agents/rules/next-step-output.md`,并在绝对最后一行追加 `Completed at: YYYY-MM-DD HH:mm:ss`。
135
+
136
+ ## 完成检查清单
137
+
138
+ - [ ] 已读取 `reference/summary-update.md`
139
+ - [ ] 已创建人工验证产物
140
+ - [ ] 已更新同一条 PR 摘要评论,或按失败语义停止
141
+ - [ ] 已更新 task.md 并追加 Activity Log
142
+ - [ ] 已运行完成校验
@@ -123,7 +123,7 @@ If prerequisites are not met and the user did not explicitly provide `--force`,
123
123
  Get the current time:
124
124
 
125
125
  ```bash
126
- date "+%Y-%m-%d %H:%M:%S%:z"
126
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
127
127
  ```
128
128
 
129
129
  Update `.agents/workspace/active/{task-id}/task.md`:
@@ -122,7 +122,7 @@ Please complete the missing steps first, or use --force to override.
122
122
  获取当前时间:
123
123
 
124
124
  ```bash
125
- date "+%Y-%m-%d %H:%M:%S%:z"
125
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
126
126
  ```
127
127
 
128
128
  更新 `.agents/workspace/active/{task-id}/task.md`:
@@ -41,7 +41,7 @@ Branch on the result:
41
41
  This project does not enable the PR flow (`.agents/.airc.json` sets `prFlow: "disabled"`).
42
42
  No Pull Request is required; run instead:
43
43
  - Claude Code / OpenCode: /complete-task {task-ref}
44
- - Gemini CLI: /agent-infra:complete-task {task-ref}
44
+ - Gemini CLI: /{{project}}:complete-task {task-ref}
45
45
  - Codex CLI: $complete-task {task-ref}
46
46
  ```
47
47
 
@@ -105,7 +105,7 @@ Aggregate a reviewer-facing summary from those artifacts and maintain a single i
105
105
  Get the current time:
106
106
 
107
107
  ```bash
108
- date "+%Y-%m-%d %H:%M:%S%:z"
108
+ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
109
109
  ```
110
110
 
111
111
  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.
@@ -136,7 +136,7 @@ Explain the created PR URL, summarize metadata sync and summary-comment results,
136
136
  ```
137
137
  Next step - Watch PR checks (auto self-heal until required checks are green):
138
138
  - Claude Code / OpenCode: /watch-pr {task-ref}
139
- - Gemini CLI: /agent-infra:watch-pr {task-ref}
139
+ - Gemini CLI: /{{project}}:watch-pr {task-ref}
140
140
  - Codex CLI: $watch-pr {task-ref}
141
141
  ```
142
142
 
@@ -145,7 +145,7 @@ Alternatively, to skip CI monitoring and archive the task right away, use `compl
145
145
  ```
146
146
  Next step (alternative) - Skip monitoring and archive the task directly:
147
147
  - Claude Code / OpenCode: /complete-task {task-ref}
148
- - Gemini CLI: /agent-infra:complete-task {task-ref}
148
+ - Gemini CLI: /{{project}}:complete-task {task-ref}
149
149
  - Codex CLI: $complete-task {task-ref}
150
150
  ```
151
151