@fitlab-ai/agent-infra 0.6.5 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/README.md +51 -25
  2. package/README.zh-CN.md +49 -23
  3. package/dist/lib/defaults.json +1 -0
  4. package/dist/lib/init.js +3 -0
  5. package/dist/lib/sandbox/commands/create.js +4 -2
  6. package/dist/lib/sandbox/commands/enter.js +15 -4
  7. package/dist/lib/sandbox/commands/list-running.js +108 -0
  8. package/dist/lib/sandbox/commands/ls.js +24 -45
  9. package/dist/lib/sandbox/commands/rebuild.js +4 -2
  10. package/dist/lib/sandbox/config.js +3 -0
  11. package/dist/lib/sandbox/index.js +2 -1
  12. package/dist/lib/sandbox/runtimes/ai-tools.dockerfile +10 -6
  13. package/dist/lib/sandbox/tools.js +213 -8
  14. package/dist/lib/update.js +12 -1
  15. package/lib/defaults.json +1 -0
  16. package/lib/init.ts +10 -0
  17. package/lib/sandbox/commands/create.ts +10 -2
  18. package/lib/sandbox/commands/enter.ts +14 -4
  19. package/lib/sandbox/commands/list-running.ts +135 -0
  20. package/lib/sandbox/commands/ls.ts +28 -49
  21. package/lib/sandbox/commands/rebuild.ts +9 -2
  22. package/lib/sandbox/config.ts +7 -0
  23. package/lib/sandbox/index.ts +2 -1
  24. package/lib/sandbox/runtimes/ai-tools.dockerfile +10 -6
  25. package/lib/sandbox/tools.ts +248 -9
  26. package/lib/update.ts +15 -1
  27. package/package.json +1 -1
  28. package/templates/.agents/QUICKSTART.en.md +1 -1
  29. package/templates/.agents/QUICKSTART.zh-CN.md +1 -1
  30. package/templates/.agents/README.en.md +79 -2
  31. package/templates/.agents/README.zh-CN.md +79 -2
  32. package/templates/.agents/rules/create-issue.en.md +1 -1
  33. package/templates/.agents/rules/create-issue.github.en.md +1 -1
  34. package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
  35. package/templates/.agents/rules/create-issue.zh-CN.md +1 -1
  36. package/templates/.agents/rules/issue-sync.github.en.md +6 -5
  37. package/templates/.agents/rules/issue-sync.github.zh-CN.md +6 -5
  38. package/templates/.agents/rules/milestone-inference.github.en.md +2 -2
  39. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +2 -2
  40. package/templates/.agents/rules/no-mid-flow-questions.en.md +57 -0
  41. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +57 -0
  42. package/templates/.agents/rules/pr-sync.github.en.md +4 -5
  43. package/templates/.agents/rules/pr-sync.github.zh-CN.md +4 -5
  44. package/templates/.agents/rules/task-management.en.md +9 -6
  45. package/templates/.agents/rules/task-management.zh-CN.md +9 -6
  46. package/templates/.agents/rules/testing-discipline.en.md +2 -2
  47. package/templates/.agents/rules/testing-discipline.zh-CN.md +2 -2
  48. package/templates/.agents/scripts/validate-artifact.js +1 -1
  49. package/templates/.agents/skills/analyze-task/SKILL.en.md +16 -4
  50. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +16 -4
  51. package/templates/.agents/skills/check-task/SKILL.en.md +43 -32
  52. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +42 -31
  53. package/templates/.agents/skills/code-task/SKILL.en.md +117 -0
  54. package/templates/.agents/skills/{implement-task → code-task}/SKILL.zh-CN.md +51 -24
  55. package/templates/.agents/skills/{implement-task → code-task}/config/verify.en.json +4 -4
  56. package/templates/.agents/skills/{implement-task → code-task}/config/verify.zh-CN.json +4 -4
  57. package/templates/.agents/skills/{implement-task → code-task}/reference/branch-management.zh-CN.md +2 -2
  58. package/templates/.agents/skills/{implement-task/reference/implementation-rules.en.md → code-task/reference/code-rules.en.md} +6 -6
  59. package/templates/.agents/skills/{implement-task/reference/implementation-rules.zh-CN.md → code-task/reference/code-rules.zh-CN.md} +3 -3
  60. package/templates/.agents/skills/code-task/reference/dual-mode.en.md +69 -0
  61. package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +69 -0
  62. package/templates/.agents/skills/{refine-task/reference/fix-workflow.en.md → code-task/reference/fix-mode.en.md} +12 -12
  63. package/templates/.agents/skills/{refine-task/reference/fix-workflow.zh-CN.md → code-task/reference/fix-mode.zh-CN.md} +8 -8
  64. package/templates/.agents/skills/code-task/reference/output-template.en.md +20 -0
  65. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +20 -0
  66. package/templates/.agents/skills/{implement-task → code-task}/reference/report-template.en.md +4 -4
  67. package/templates/.agents/skills/{implement-task → code-task}/reference/report-template.zh-CN.md +3 -3
  68. package/templates/.agents/skills/code-task/scripts/detect-mode.js +370 -0
  69. package/templates/.agents/skills/commit/SKILL.en.md +2 -2
  70. package/templates/.agents/skills/commit/SKILL.zh-CN.md +2 -2
  71. package/templates/.agents/skills/commit/reference/task-status-update.en.md +10 -6
  72. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +10 -6
  73. package/templates/.agents/skills/complete-task/SKILL.en.md +5 -3
  74. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +5 -3
  75. package/templates/.agents/skills/create-pr/SKILL.en.md +17 -1
  76. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +17 -1
  77. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  78. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  79. package/templates/.agents/skills/import-dependabot/SKILL.en.md +2 -2
  80. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +2 -2
  81. package/templates/.agents/skills/import-issue/SKILL.en.md +3 -3
  82. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +3 -3
  83. package/templates/.agents/skills/plan-task/SKILL.en.md +4 -4
  84. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -4
  85. package/templates/.agents/skills/restore-task/SKILL.en.md +4 -3
  86. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +4 -3
  87. package/templates/.agents/skills/review-analysis/SKILL.en.md +76 -0
  88. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +102 -0
  89. package/templates/.agents/skills/review-analysis/config/verify.en.json +51 -0
  90. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +51 -0
  91. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +87 -0
  92. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +87 -0
  93. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +90 -0
  94. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +91 -0
  95. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +47 -0
  96. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +47 -0
  97. package/templates/.agents/skills/{review-task → review-code}/SKILL.en.md +11 -9
  98. package/templates/.agents/skills/{review-task → review-code}/SKILL.zh-CN.md +15 -9
  99. package/templates/.agents/skills/{review-task → review-code}/config/verify.en.json +7 -5
  100. package/templates/.agents/skills/{review-task → review-code}/config/verify.zh-CN.json +6 -4
  101. package/templates/.agents/skills/{review-task → review-code}/reference/output-templates.en.md +21 -17
  102. package/templates/.agents/skills/{review-task → review-code}/reference/output-templates.zh-CN.md +19 -15
  103. package/templates/.agents/skills/{review-task → review-code}/reference/report-template.en.md +5 -6
  104. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +91 -0
  105. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +48 -0
  106. package/templates/.agents/skills/{review-task → review-code}/reference/review-criteria.zh-CN.md +10 -4
  107. package/templates/.agents/skills/review-plan/SKILL.en.md +76 -0
  108. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +102 -0
  109. package/templates/.agents/skills/{refine-task → review-plan}/config/verify.en.json +14 -10
  110. package/templates/.agents/skills/{refine-task → review-plan}/config/verify.zh-CN.json +14 -10
  111. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +87 -0
  112. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +87 -0
  113. package/templates/.agents/skills/review-plan/reference/report-template.en.md +90 -0
  114. package/templates/.agents/skills/{review-task → review-plan}/reference/report-template.zh-CN.md +3 -3
  115. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +47 -0
  116. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +47 -0
  117. package/templates/.agents/skills/test/SKILL.en.md +2 -2
  118. package/templates/.agents/skills/test/SKILL.zh-CN.md +13 -31
  119. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +1 -0
  120. package/templates/.agents/templates/task.en.md +3 -3
  121. package/templates/.agents/templates/task.zh-CN.md +2 -2
  122. package/templates/.agents/workflows/bug-fix.en.yaml +126 -80
  123. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +90 -44
  124. package/templates/.agents/workflows/feature-development.en.yaml +115 -70
  125. package/templates/.agents/workflows/feature-development.zh-CN.yaml +92 -47
  126. package/templates/.agents/workflows/refactoring.en.yaml +123 -78
  127. package/templates/.agents/workflows/refactoring.zh-CN.yaml +89 -44
  128. package/templates/.claude/commands/code-task.en.md +8 -0
  129. package/templates/.claude/commands/code-task.zh-CN.md +8 -0
  130. package/templates/.claude/commands/review-analysis.en.md +8 -0
  131. package/templates/.claude/commands/review-analysis.zh-CN.md +8 -0
  132. package/templates/.claude/commands/review-code.en.md +8 -0
  133. package/templates/.claude/commands/review-code.zh-CN.md +8 -0
  134. package/templates/.claude/commands/review-plan.en.md +8 -0
  135. package/templates/.claude/commands/review-plan.zh-CN.md +8 -0
  136. package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +1 -1
  137. package/templates/.gemini/commands/_project_/code-task.en.toml +8 -0
  138. package/templates/.gemini/commands/_project_/code-task.zh-CN.toml +8 -0
  139. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +1 -1
  140. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +1 -1
  141. package/templates/.gemini/commands/_project_/review-analysis.en.toml +8 -0
  142. package/templates/.gemini/commands/_project_/review-analysis.zh-CN.toml +8 -0
  143. package/templates/.gemini/commands/_project_/review-code.en.toml +8 -0
  144. package/templates/.gemini/commands/_project_/review-code.zh-CN.toml +8 -0
  145. package/templates/.gemini/commands/_project_/review-plan.en.toml +8 -0
  146. package/templates/.gemini/commands/_project_/review-plan.zh-CN.toml +8 -0
  147. package/templates/.opencode/commands/code-task.en.md +11 -0
  148. package/templates/.opencode/commands/code-task.zh-CN.md +11 -0
  149. package/templates/.opencode/commands/review-analysis.en.md +11 -0
  150. package/templates/.opencode/commands/review-analysis.zh-CN.md +11 -0
  151. package/templates/.opencode/commands/review-code.en.md +11 -0
  152. package/templates/.opencode/commands/review-code.zh-CN.md +11 -0
  153. package/templates/.opencode/commands/review-plan.en.md +11 -0
  154. package/templates/.opencode/commands/review-plan.zh-CN.md +11 -0
  155. package/templates/.agents/skills/implement-task/SKILL.en.md +0 -173
  156. package/templates/.agents/skills/implement-task/reference/output-template.en.md +0 -20
  157. package/templates/.agents/skills/implement-task/reference/output-template.zh-CN.md +0 -20
  158. package/templates/.agents/skills/refine-task/SKILL.en.md +0 -153
  159. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +0 -153
  160. package/templates/.agents/skills/refine-task/reference/report-template.en.md +0 -64
  161. package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +0 -64
  162. package/templates/.agents/skills/review-task/reference/review-criteria.en.md +0 -42
  163. package/templates/.claude/commands/implement-task.en.md +0 -8
  164. package/templates/.claude/commands/implement-task.zh-CN.md +0 -8
  165. package/templates/.claude/commands/refine-task.en.md +0 -8
  166. package/templates/.claude/commands/refine-task.zh-CN.md +0 -8
  167. package/templates/.claude/commands/review-task.en.md +0 -8
  168. package/templates/.claude/commands/review-task.zh-CN.md +0 -8
  169. package/templates/.gemini/commands/_project_/implement-task.en.toml +0 -8
  170. package/templates/.gemini/commands/_project_/implement-task.zh-CN.toml +0 -8
  171. package/templates/.gemini/commands/_project_/refine-task.en.toml +0 -8
  172. package/templates/.gemini/commands/_project_/refine-task.zh-CN.toml +0 -8
  173. package/templates/.gemini/commands/_project_/review-task.en.toml +0 -8
  174. package/templates/.gemini/commands/_project_/review-task.zh-CN.toml +0 -8
  175. package/templates/.opencode/commands/implement-task.en.md +0 -11
  176. package/templates/.opencode/commands/implement-task.zh-CN.md +0 -11
  177. package/templates/.opencode/commands/refine-task.en.md +0 -11
  178. package/templates/.opencode/commands/refine-task.zh-CN.md +0 -11
  179. package/templates/.opencode/commands/review-task.en.md +0 -11
  180. package/templates/.opencode/commands/review-task.zh-CN.md +0 -11
  181. /package/templates/.agents/skills/{implement-task → code-task}/reference/branch-management.en.md +0 -0
@@ -4,7 +4,7 @@ Read this file before coding or interpreting test failures.
4
4
 
5
5
  ## Execute Code Implementation
6
6
 
7
- Follow the `implementation` step in `.agents/workflows/feature-development.yaml`.
7
+ Follow the `code` step in `.agents/workflows/feature-development.yaml`.
8
8
 
9
9
  **Required tasks**:
10
10
  - [ ] implement the feature code according to the plan
@@ -23,7 +23,7 @@ Follow the `implementation` step in `.agents/workflows/feature-development.yaml`
23
23
 
24
24
  During implementation:
25
25
  - **Inner loop**: after each change, run the project's **smoke subset** (see the `test` skill) for fast feedback
26
- - **Before writing the implementation report**: run the **core subset** as final verification so code entering review has passed the complete core checks
26
+ - **Before writing the code report**: run the **core subset** as final verification so code entering review has passed the complete core checks
27
27
 
28
28
  > Refer to the `test` skill for project-specific commands; downstream projects without layered scripts should fall back to the full project test command.
29
29
 
@@ -39,8 +39,8 @@ Two-way failure handling:
39
39
  - continue until all required tests pass
40
40
  2. external blockers:
41
41
  - confirm the failure comes from missing environment, unrelated upstream breakage, or unclear requirements outside this task
42
- - stop without creating `implementation.md` / `implementation-r{N}.md`
43
- - do not mark implementation complete in `task.md`
42
+ - stop without creating `code.md` / `code-r{N}.md`
43
+ - do not mark code complete in `task.md`
44
44
  - do not output the normal success/next-step template
45
45
 
46
46
  ## Notes
@@ -49,5 +49,5 @@ Two-way failure handling:
49
49
  2. **No auto-commit**: do not run `git commit` or `git add`
50
50
  3. **Test quality**: new tests must validate meaningful business logic
51
51
  4. **Code quality**: follow project coding conventions
52
- 5. **Plan deviation**: record any deviation in the implementation report
53
- 6. **Versioning**: Round 1 uses `implementation.md`; later rounds use `implementation-r{N}.md`
52
+ 5. **Plan deviation**: record any deviation in the code report
53
+ 6. **Versioning**: Round 1 uses `code.md`; later rounds use `code-r{N}.md`
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 执行代码实现
6
6
 
7
- 遵循 `.agents/workflows/feature-development.yaml` 中的 `implementation` 步骤。
7
+ 遵循 `.agents/workflows/feature-development.yaml` 中的 `code` 步骤。
8
8
 
9
9
  **必做任务**:
10
10
  - [ ] 按计划实现功能代码
@@ -39,7 +39,7 @@
39
39
  - 持续处理直到所有必需测试通过
40
40
  2. 外部阻塞:
41
41
  - 确认失败来自缺失环境、无关的上游损坏,或任务范围外的需求不明确
42
- - 停止,并且不要创建 `implementation.md` / `implementation-r{N}.md`
42
+ - 停止,并且不要创建 `code.md` / `code-r{N}.md`
43
43
  - 不要在 `task.md` 中把实现标记为完成
44
44
  - 不要输出正常的成功/下一步模板
45
45
 
@@ -50,4 +50,4 @@
50
50
  3. **测试质量**:新增测试必须验证有意义的业务逻辑
51
51
  4. **代码质量**:遵循项目编码规范
52
52
  5. **方案偏离**:任何偏离都要记录到实现报告中
53
- 6. **版本命名**:Round 1 使用 `implementation.md`,后续轮次使用 `implementation-r{N}.md`
53
+ 6. **版本命名**:Round 1 使用 `code.md`,后续轮次使用 `code-r{N}.md`
@@ -0,0 +1,69 @@
1
+ # code-task dual mode
2
+
3
+ This file documents `scripts/detect-mode.js`. The script is the source of truth; update this document whenever the script changes.
4
+
5
+ ## Input
6
+
7
+ ```bash
8
+ node .agents/skills/code-task/scripts/detect-mode.js .agents/workspace/active/{task-id}
9
+ ```
10
+
11
+ The script scans `plan.md` / `plan-r{N}.md`, `review-plan.md` / `review-plan-r{N}.md`, `code.md` / `code-r{N}.md`, and `review-code.md` / `review-code-r{N}.md` in the task directory.
12
+
13
+ ## Eight Branches
14
+
15
+ > Branches are evaluated top-down in this table; the first match returns and skips later rows.
16
+
17
+ | Condition | mode | exit | Behavior |
18
+ |---|---|---:|---|
19
+ | no code artifact | `init` | 0 | initial implementation, output `code.md` |
20
+ | latest review-plan is approved (`Approved` or `Approved-with-issues`, i.e. `Overall Verdict: Approved` regardless of findings counts), its "Review Input" / "审查输入" entry names the same plan file as the latest `plan(-r{N})?.md` in the task directory, and its mtime is newer than the latest code artifact | `init` | 0 | plan has been approved after the latest code; enter a new implementation round, `next_round = code_max + 1`, `next_artifact = code-r{next_round}.md`. This branch fires regardless of whether review-code exists or passes. Plan and review-plan rounds are independent counters (e.g. `plan-r5` may be approved by `review-plan-r4`); the link is established via the review-plan's "Review Input" entry, not by matching round numbers. |
21
+ | `rev_max < code_max` | `error` | 2 | latest code round is unreviewed; run `review-code` first |
22
+ | `rev_max > code_max` | `error` | 2 | inconsistent state; manual inspection required |
23
+ | latest review-code is Approved with 0/0/0 | `refused` | 1 | already approved; do not run `code-task` again |
24
+ | latest review-code is Approved with major/minor findings | `fix` | 0 | optional fix mode |
25
+ | latest review-code is Changes Requested | `fix` | 0 | required fix mode |
26
+ | latest review-code is Rejected | `refused` | 1 | re-plan instead of local fixing |
27
+
28
+ ## Verdict Parsing
29
+
30
+ The script supports zh-CN and English review-code reports:
31
+
32
+ | Meaning | zh-CN | English |
33
+ |---|---|---|
34
+ | summary section | `## 审查摘要` | `## Review Summary` |
35
+ | verdict field | `**总体结论**:` | `**Overall Verdict**:` |
36
+ | findings field | `**发现(AI 可处理)**:` | `**Findings (AI-actionable)**:` |
37
+
38
+ Verdict mapping:
39
+
40
+ - `通过` / `Approved` -> `Approved`, then blocker/major/minor counts split it into `Approved` or `Approved-with-issues`
41
+ - `需要修改` / `Changes Requested` -> `Changes Requested`
42
+ - `拒绝` / `Rejected` -> `Rejected`
43
+
44
+ env-blocked counts do not affect mode selection.
45
+
46
+ ## Output Contract
47
+
48
+ The script prints JSON:
49
+
50
+ ```json
51
+ {
52
+ "mode": "init",
53
+ "code_max": 0,
54
+ "rev_max": 0,
55
+ "verdict": null,
56
+ "next_round": 1,
57
+ "next_artifact": "code.md",
58
+ "review_artifact": null,
59
+ "message": "..."
60
+ }
61
+ ```
62
+
63
+ In the replan-driven init branch (row #2), `review_artifact` points to the `review-plan-r{N}.md` that triggered replan rather than a review-code artifact, preserving the attribution chain.
64
+
65
+ exit code:
66
+
67
+ - `0`: continue, `mode` is `init` or `fix`
68
+ - `1`: stop, `mode` is `refused`
69
+ - `2`: inconsistent state, `mode` is `error`
@@ -0,0 +1,69 @@
1
+ # code-task 双模式判定
2
+
3
+ 本文件说明 `scripts/detect-mode.js` 的行为。脚本是单点真相;修改脚本时必须同步更新本文档。
4
+
5
+ ## 输入
6
+
7
+ ```bash
8
+ node .agents/skills/code-task/scripts/detect-mode.js .agents/workspace/active/{task-id}
9
+ ```
10
+
11
+ 脚本扫描任务目录中的 `plan.md` / `plan-r{N}.md`、`review-plan.md` / `review-plan-r{N}.md`、`code.md` / `code-r{N}.md` 和 `review-code.md` / `review-code-r{N}.md`。
12
+
13
+ ## 8 个分支
14
+
15
+ > 分支按表中自上而下的顺序评估,命中即返回;后续分支不再判定。
16
+
17
+ | 条件 | mode | exit | 行为 |
18
+ |---|---|---:|---|
19
+ | 无 code 产物 | `init` | 0 | 初次实现,产物为 `code.md` |
20
+ | 最新 review-plan 已批准(`通过` 或 `通过 + major/minor 建议`,即 `Approved` 或 `Approved-with-issues`),且其「审查输入」/「Review Input」字段引用的 plan 文件 == 任务目录中最新的 `plan(-r{N})?.md`,且最新 review-plan 的 mtime > 最新 code 的 mtime | `init` | 0 | plan 已在 code 之后被批准;进入新一轮实现,`next_round = code_max + 1`、`next_artifact = code-r{next_round}.md`。**不论 review-code 是否已审**,本分支均先命中。plan 与 review-plan 的轮次独立递增(如 `plan-r5` 可被 `review-plan-r4` 批准),通过 review-plan 的「审查输入」字段建立批准关系,不要求同号 |
21
+ | `rev_max < code_max` | `error` | 2 | 最新代码未审查,先运行 `review-code` |
22
+ | `rev_max > code_max` | `error` | 2 | 数据状态异常,需要人工检查 |
23
+ | 最新 review-code 为 Approved 且 0/0/0 | `refused` | 1 | 已通过,无需再次运行 `code-task` |
24
+ | 最新 review-code 为 Approved 但有 major/minor | `fix` | 0 | 可选修复模式 |
25
+ | 最新 review-code 为 Changes Requested | `fix` | 0 | 必需修复模式 |
26
+ | 最新 review-code 为 Rejected | `refused` | 1 | 需要重新设计,不进入局部修复 |
27
+
28
+ ## verdict 解析
29
+
30
+ 脚本支持中文和英文 review-code 报告:
31
+
32
+ | 语义 | 中文 | 英文 |
33
+ |---|---|---|
34
+ | 摘要段落 | `## 审查摘要` | `## Review Summary` |
35
+ | 总体结论字段 | `**总体结论**:` | `**Overall Verdict**:` |
36
+ | 发现统计字段 | `**发现(AI 可处理)**:` | `**Findings (AI-actionable)**:` |
37
+
38
+ 结论映射:
39
+
40
+ - `通过` / `Approved` -> `Approved`,再按 blocker/major/minor 计数拆成 `Approved` 或 `Approved-with-issues`
41
+ - `需要修改` / `Changes Requested` -> `Changes Requested`
42
+ - `拒绝` / `Rejected` -> `Rejected`
43
+
44
+ env-blocked 计数不参与 mode 判定。
45
+
46
+ ## 输出契约
47
+
48
+ 脚本输出 JSON:
49
+
50
+ ```json
51
+ {
52
+ "mode": "init",
53
+ "code_max": 0,
54
+ "rev_max": 0,
55
+ "verdict": null,
56
+ "next_round": 1,
57
+ "next_artifact": "code.md",
58
+ "review_artifact": null,
59
+ "message": "..."
60
+ }
61
+ ```
62
+
63
+ `review_artifact` 字段在第 2 分支(replan-driven init)下指向触发的 `review-plan-r{N}.md` 而非 review-code 产物,用于追溯触发原因。
64
+
65
+ exit code:
66
+
67
+ - `0`:可继续,`mode` 为 `init` 或 `fix`
68
+ - `1`:拒绝继续,`mode` 为 `refused`
69
+ - `2`:状态异常,`mode` 为 `error`
@@ -1,6 +1,6 @@
1
1
  # Fix Workflow
2
2
 
3
- Read this file before changing code during refinement.
3
+ Read this file before changing code during fix mode.
4
4
 
5
5
  ## Plan the Fixes
6
6
 
@@ -24,7 +24,7 @@ Detailed priority rules:
24
24
 
25
25
  env-blocked findings are outside the repair scope. Handling rules:
26
26
  - do not write code changes for these findings
27
- - list them unchanged in the refinement report's "Environment-Blocked Handling" section and mark them "outside AI repair scope"
27
+ - list them unchanged in the code report's "Environment-Blocked Handling" section and mark them "outside AI repair scope"
28
28
  - do not repeat them under unresolved issues, to avoid visually double-counting them
29
29
  - their destination is the PR description, where maintainers carry them as a "manual verification required" checklist
30
30
 
@@ -38,7 +38,7 @@ For each fix:
38
38
 
39
39
  ## Run Test Verification
40
40
 
41
- Before writing the refinement report, run the project's **core subset** as final verification and confirm that all required tests still pass. If the project does not have layered scripts, fall back to the full project test command.
41
+ Before writing the code report, run the project's **core subset** as final verification and confirm that all required tests still pass. If the project does not have layered scripts, fall back to the full project test command.
42
42
 
43
43
  ## Choose the Next-Step Branch
44
44
 
@@ -53,22 +53,22 @@ Prohibition:
53
53
  Required output template:
54
54
 
55
55
  ```text
56
- Task {task-id} refinement completed.
56
+ Task {task-id} fix completed.
57
57
 
58
- Refinement status:
58
+ Fix status:
59
59
  - Blockers fixed: {fixed-blockers}/{total-blockers}
60
60
  - Major issues fixed: {fixed-majors}/{total-majors}
61
61
  - Minor issues fixed: {fixed-minors}/{total-minors}
62
62
  - [If env-blocked > 0] env-blocked skipped: {count}
63
63
  - All tests passing: {yes/no}
64
64
  - Review input: {review-artifact}
65
- - Refinement artifact: {refinement-artifact}
65
+ - Code artifact: {code-artifact}
66
66
 
67
67
  Next step - re-review or commit:
68
68
  - Re-review (always recommended):
69
- - Claude Code / OpenCode: /review-task {task-id}
70
- - Gemini CLI: /agent-infra:review-task {task-id}
71
- - Codex CLI: $review-task {task-id}
69
+ - Claude Code / OpenCode: /review-code {task-id}
70
+ - Gemini CLI: /agent-infra:review-code {task-id}
71
+ - Codex CLI: $review-code {task-id}
72
72
  - Commit directly (optional; only when all issues are resolved and changes are low risk):
73
73
  - Claude Code / OpenCode: /commit
74
74
  - Gemini CLI: /agent-infra:commit
@@ -77,9 +77,9 @@ Next step - re-review or commit:
77
77
 
78
78
  ## Notes
79
79
 
80
- 1. **Prerequisite**: a review artifact must exist (`review.md` or `review-r{N}.md`)
80
+ 1. **Prerequisite**: a code review artifact must exist (`review-code.md` or `review-code-r{N}.md`)
81
81
  2. **No auto-commit**: do not run `git commit`
82
82
  3. **Scope discipline**: only fix reviewed issues
83
83
  4. **Disagreement handling**: record any disagreement in the report
84
- 5. **Re-review**: always recommend `review-task` as the default next step after refinement
85
- 6. **Consistency**: the latest review artifact, Activity Log entry, and refinement report must reference the same round
84
+ 5. **Re-review**: always recommend `review-code` as the default next step after fix mode
85
+ 6. **Consistency**: the latest review artifact, Activity Log entry, and code report must reference the same round
@@ -24,7 +24,7 @@
24
24
 
25
25
  env-blocked 项不在修复范围。处理规则:
26
26
  - 不要为这些项编写代码改动
27
- - 在 refinement 报告的「环境性遗留处理」段落原样列出,标注「不在 AI 修复范围」
27
+ - 在 code 报告的「环境性遗留处理」段落原样列出,标注「不在 AI 修复范围」
28
28
  - 不要在 unresolved 段落里重复列出(避免视觉计数翻倍)
29
29
  - 这些项的去向:维护者在 PR description 中以「待人工验证」清单承接
30
30
 
@@ -38,7 +38,7 @@ env-blocked 项不在修复范围。处理规则:
38
38
 
39
39
  ## 运行测试验证
40
40
 
41
- refinement 报告前,运行项目测试的 **core 子集**做最终验证,确保所有必需测试仍然通过。如果项目没有分层 script,回退到完整项目测试命令。
41
+ code 报告前,运行项目测试的 **core 子集**做最终验证,确保所有必需测试仍然通过。如果项目没有分层 script,回退到完整项目测试命令。
42
42
 
43
43
  ## 选择下一步分支
44
44
 
@@ -62,13 +62,13 @@ env-blocked 项不在修复范围。处理规则:
62
62
  - [如 env-blocked > 0] 环境性遗留跳过:{数量}
63
63
  - 所有测试通过:{是/否}
64
64
  - 审查输入:{review-artifact}
65
- - 修复产物:{refinement-artifact}
65
+ - 修复产物:{code-artifact}
66
66
 
67
67
  下一步 - 重新审查或提交:
68
68
  - 重新审查(始终推荐):
69
- - Claude Code / OpenCode:/review-task {task-id}
70
- - Gemini CLI:/agent-infra:review-task {task-id}
71
- - Codex CLI:$review-task {task-id}
69
+ - Claude Code / OpenCode:/review-code {task-id}
70
+ - Gemini CLI:/agent-infra:review-code {task-id}
71
+ - Codex CLI:$review-code {task-id}
72
72
  - 直接提交(可选;仅在所有问题已解决且风险可控时):
73
73
  - Claude Code / OpenCode:/commit
74
74
  - Gemini CLI:/agent-infra:commit
@@ -77,9 +77,9 @@ env-blocked 项不在修复范围。处理规则:
77
77
 
78
78
  ## 注意事项
79
79
 
80
- 1. **前置条件**:必须存在审查产物(`review.md` 或 `review-r{N}.md`)
80
+ 1. **前置条件**:必须存在代码审查产物(`review-code.md` 或 `review-code-r{N}.md`)
81
81
  2. **禁止自动提交**:不要执行 `git commit`
82
82
  3. **范围约束**:只修复审查中列出的问题
83
83
  4. **分歧处理**:如果不同意审查意见,要在报告里明确记录
84
- 5. **重新审查**:修复后始终推荐执行 `review-task`
84
+ 5. **重新审查**:修复后始终推荐执行 `review-code`
85
85
  6. **一致性**:最新审查产物、Activity Log 记录和修复报告必须引用同一轮次
@@ -0,0 +1,20 @@
1
+ # Output Template
2
+
3
+ When reporting that implementation is complete, use the following standard format:
4
+
5
+ ```text
6
+ Task {task-id} code implementation complete.
7
+
8
+ Summary:
9
+ - Implementation round: Round {code-round}
10
+ - Files modified: {count}
11
+ - All tests passed: {yes/no}
12
+
13
+ Output files:
14
+ - Code report: .agents/workspace/active/{task-id}/{code-artifact}
15
+
16
+ Next step - code review:
17
+ - Claude Code / OpenCode: /review-code {task-id}
18
+ - Gemini CLI: /{{project}}:review-code {task-id}
19
+ - Codex CLI: $review-code {task-id}
20
+ ```
@@ -0,0 +1,20 @@
1
+ # 输出模板
2
+
3
+ 向用户汇报实现完成时,使用以下标准格式:
4
+
5
+ ```text
6
+ 任务 {task-id} 实现完成。
7
+
8
+ 摘要:
9
+ - 实现轮次:Round {code-round}
10
+ - 修改文件:{数量}
11
+ - 所有测试通过:{是/否}
12
+
13
+ 产出文件:
14
+ - 实现报告:.agents/workspace/active/{task-id}/{code-artifact}
15
+
16
+ 下一步 - 代码审查:
17
+ - Claude Code / OpenCode:/review-code {task-id}
18
+ - Gemini CLI:/agent-infra:review-code {task-id}
19
+ - Codex CLI:$review-code {task-id}
20
+ ```
@@ -1,14 +1,14 @@
1
- # Implementation Report Template
1
+ # Code Report Template
2
2
 
3
- Use this structure when creating `implementation.md` or `implementation-r{N}.md`.
3
+ Use this structure when creating `code.md` or `code-r{N}.md`.
4
4
 
5
5
  ## Output Template
6
6
 
7
7
  ```markdown
8
8
  # Implementation Report
9
9
 
10
- - **Implementation Round**: Round {implementation-round}
11
- - **Artifact File**: `{implementation-artifact}`
10
+ - **Implementation Round**: Round {code-round}
11
+ - **Artifact File**: `{code-artifact}`
12
12
 
13
13
  ## State Check
14
14
 
@@ -1,14 +1,14 @@
1
1
  # 实现报告模板
2
2
 
3
- 创建 `implementation.md` 或 `implementation-r{N}.md` 时,使用以下结构。
3
+ 创建 `code.md` 或 `code-r{N}.md` 时,使用以下结构。
4
4
 
5
5
  ## 输出模板
6
6
 
7
7
  ```markdown
8
8
  # 实现报告
9
9
 
10
- - **实现轮次**: Round {implementation-round}
11
- - **产物文件**: `{implementation-artifact}`
10
+ - **实现轮次**: Round {code-round}
11
+ - **产物文件**: `{code-artifact}`
12
12
 
13
13
  ## 状态核对
14
14