@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
@@ -0,0 +1,90 @@
1
+ # Review Report Template
2
+
3
+ Use this template when writing `review-plan.md` or `review-plan-r{N}.md`.
4
+
5
+ ## Output Template
6
+
7
+ ```markdown
8
+ # Technical Plan Review Report
9
+
10
+ - **Review Round**: Round {review-round}
11
+ - **Artifact File**: `{review-artifact}`
12
+ - **Review Input**:
13
+ - `{plan-artifact}`
14
+
15
+ ## State Check
16
+
17
+ > Paste the raw state-check command output; each command starts with `$ `.
18
+
19
+ ## Review Summary
20
+
21
+ - **Reviewer**: {reviewer-name}
22
+ - **Review Time**: {timestamp}
23
+ - **Scope**: {file-count and major modules}
24
+ - **Overall Verdict**: {Approved / Changes Requested / Rejected}
25
+ - **Findings (AI-actionable)**: 0 blockers, 0 majors, 0 minors / **env-blocked**: 0
26
+
27
+ ## Findings
28
+
29
+ ### Blockers (must fix)
30
+
31
+ #### 1. {Issue title}
32
+ **File**: `{file-path}:{line-number}`
33
+ **Description**: {details}
34
+ **Suggested Fix**: {fix suggestion}
35
+
36
+ ### Major Issues (should fix)
37
+
38
+ #### 1. {Issue title}
39
+ **File**: `{file-path}:{line-number}`
40
+ **Description**: {details}
41
+ **Suggested Fix**: {fix suggestion}
42
+
43
+ ### Minor Issues (optional improvements)
44
+
45
+ #### 1. {Improvement point}
46
+ **File**: `{file-path}:{line-number}`
47
+ **Suggestion**: {improvement suggestion}
48
+
49
+ ## Environment-Blocked Findings
50
+
51
+ > Items the AI agent cannot close in the current execution environment; they do not participate in the next plan round. Maintainers carry them in the PR description as a "manual verification required" checklist.
52
+
53
+ #### 1. {environment-blocked finding title}
54
+ **File**: `{file-path}:{line-number}` (if applicable)
55
+ **Description**: {details}
56
+ **Required Environment**: {e.g. Docker sandbox / macOS host / privileged root / third-party account}
57
+ **Manual Verification Steps**: {steps for the human verifier}
58
+
59
+ > If this round has no env-blocked findings, keep the section heading and write "None".
60
+
61
+
62
+ ## Evidence
63
+
64
+ > Pair each "I verified X" claim with the corresponding raw tool output; the gate only checks that this section exists and at least one `$ ` line is present.
65
+
66
+ - Claim: {verified claim}
67
+ ```text
68
+ $ {command}
69
+ {raw output}
70
+ ```
71
+
72
+ ## Highlights
73
+
74
+ - {what went well}
75
+
76
+ ## Alignment with Plan
77
+
78
+ - [ ] Implementation matches the technical plan
79
+ - [ ] No unintended scope expansion
80
+
81
+ ## Conclusion and Recommendation
82
+
83
+ ### Approval Decision
84
+ - [ ] Approved
85
+ - [ ] Changes Requested
86
+ - [ ] Rejected
87
+
88
+ ### Next Steps
89
+ {recommended next step}
90
+ ```
@@ -1,6 +1,6 @@
1
1
  # 审查报告模板
2
2
 
3
- 编写 `review.md` 或 `review-r{N}.md` 时使用本模板。
3
+ 编写 `review-plan.md` 或 `review-plan-r{N}.md` 时使用本模板。
4
4
 
5
5
  ## 输出模板
6
6
 
@@ -10,8 +10,8 @@
10
10
  - **审查轮次**:第 {review-round} 轮
11
11
  - **产物文件**:`{review-artifact}`
12
12
  - **审查输入**:
13
- - `{implementation-artifact}`
14
- - `{refinement-artifact}`(如存在)
13
+ - `{code-artifact}`
14
+ - `{code-artifact}`(如存在)
15
15
 
16
16
  ## 状态核对
17
17
 
@@ -0,0 +1,47 @@
1
+ # Review Criteria
2
+
3
+ Read this file before reviewing technical plan artifacts or classifying finding severity.
4
+
5
+ ## Technical Plan Review
6
+
7
+ Follow the `design-review` step in `.agents/workflows/feature-development.yaml`.
8
+
9
+ **Required review areas**:
10
+ - [ ] The plan covers the approved requirement analysis
11
+ - [ ] Implementation steps are concrete, ordered, and verifiable
12
+ - [ ] Architecture boundaries, data flow, and interface changes are clear
13
+ - [ ] Test strategy covers critical paths, regression risks, and edge cases
14
+ - [ ] Risks, migration, rollback, or compatibility handling are sufficient
15
+ - [ ] The plan avoids over-design and unrelated scope expansion
16
+
17
+ **Common anti-examples**:
18
+ - Saying "modify related code" without executable steps and verification points
19
+ - Ignoring risks or constraints listed in the analysis
20
+ - Introducing unnecessary abstractions, configuration, or frameworks for a single-use requirement
21
+
22
+ ## Common Review Principles
23
+
24
+ 1. **Strict but fair**: identify issues and acknowledge solid work
25
+ 2. **Specific**: cite exact file paths and line numbers
26
+ 3. **Actionable**: suggest a concrete fix
27
+ 4. **Severity-based**: clearly distinguish blockers, major issues, and minor issues
28
+
29
+ ## Environment-Blocked Classification
30
+
31
+ Some findings cannot be closed by an AI agent in the current execution environment, for example:
32
+
33
+ - Missing Docker / sandbox access for end-to-end validation
34
+ - Missing a specific OS for macOS-only behavior
35
+ - Missing third-party accounts / OAuth
36
+ - Missing privileged operations such as root, sudo, or special network access
37
+
38
+ **Decision tree**: "Can the AI agent close this item independently without changing the environment?"
39
+ - Yes -> blocker / major / minor, based on risk
40
+ - No -> **env-blocked** (a meta-category, not part of severity ordering)
41
+
42
+ Where env-blocked items go:
43
+ - Record them in an independent review report section named "Environment-Blocked Findings"
44
+ - Include them at the end of the numeric summary, for example `(+ 1 env-blocked)`
45
+ - Do **not** include them in the code-task fix loop; maintainers carry them in the PR description under manual verification
46
+
47
+ Also inspect the latest technical plan artifact, latest requirement-analysis review artifact, and `task.md` Activity Log so the report reflects the full design context.
@@ -0,0 +1,47 @@
1
+ # 审查标准
2
+
3
+ 在审查技术方案或划分问题严重程度之前先读取本文件。
4
+
5
+ ## 执行技术方案审查
6
+
7
+ 遵循 `.agents/workflows/feature-development.yaml` 中的 `design-review` 步骤。
8
+
9
+ **必查范围**:
10
+ - [ ] 方案是否覆盖已批准的需求分析
11
+ - [ ] 实现步骤是否具体、顺序合理且可验证
12
+ - [ ] 架构边界、数据流和接口变化是否清晰
13
+ - [ ] 测试策略是否覆盖关键路径、回归风险和边界情况
14
+ - [ ] 风险、迁移、回滚或兼容性处理是否充分
15
+ - [ ] 方案是否避免过度设计和无关扩张
16
+
17
+ **常见反例**:
18
+ - 方案只写“修改相关代码”,没有可执行步骤和验证点
19
+ - 设计没有回应分析中列出的风险或约束
20
+ - 为单次需求引入不必要的新抽象、配置或框架
21
+
22
+ ## 通用审查原则
23
+
24
+ 1. **严格但公正**:既要指出问题,也要承认做得好的部分
25
+ 2. **具体**:引用准确的文件路径和行号
26
+ 3. **可执行**:给出明确可落地的修复建议
27
+ 4. **按严重程度分类**:明确区分 blocker、major 和 minor
28
+
29
+ ## 环境性遗留分类
30
+
31
+ 某些发现项是 AI agent 在本执行环境**无法闭环**的,例如:
32
+
33
+ - 缺 Docker / 沙箱而无法跑端到端验证
34
+ - 缺特定 OS(macOS-only 行为)
35
+ - 缺第三方账号 / OAuth
36
+ - 缺特权操作(root、sudo、特殊网络)
37
+
38
+ **分类决策树**:「AI agent 能否在不改环境的前提下独立闭环这一项?」
39
+ - 是 -> blocker / major / minor 之一(按风险定档)
40
+ - 否 -> **env-blocked**(元类目,不参与严重程度排序)
41
+
42
+ env-blocked 项的去向:
43
+ - 写入 review 报告独立段落「环境性遗留」
44
+ - 在数字摘要末尾附带显示(如 `(+ 1 env-blocked)`)
45
+ - **不**进入 code-task 修复循环;维护者在 PR description 中以「待人工验证」清单形式承接
46
+
47
+ 同时检查最新技术方案产物、最新需求分析审查产物和 `task.md` Activity Log,确保报告反映完整的设计上下文。
@@ -35,7 +35,7 @@ This project uses three test layers as an optional optimization; if the test sui
35
35
  ```
36
36
 
37
37
  Use for:
38
- - implement-task / refine-task inner loops
38
+ - code-task inner loops
39
39
  - save-and-run / frequent feedback
40
40
  - project structure, configuration, and template contract checks
41
41
 
@@ -50,7 +50,7 @@ Use for:
50
50
 
51
51
  Use for:
52
52
  - pre-commit hook (automatic)
53
- - final verification before writing implementation.md / refinement.md
53
+ - final verification before writing code.md / code-r{N}.md
54
54
  - local gate before pushing a PR
55
55
 
56
56
  ### full (complete test suite)
@@ -1,74 +1,56 @@
1
1
  ---
2
2
  name: test
3
- description: "执行项目完整测试流程"
3
+ description: >
4
+ 执行项目完整测试流程(编译检查 + 单元测试)。
5
+ 当用户要求运行测试或验证代码质量时触发。
4
6
  ---
5
7
 
6
8
  # 执行测试
7
9
 
8
10
  执行项目的完整测试流程,包括编译检查和单元测试。
9
11
 
10
- <!-- TODO: 将以下命令替换为你的项目实际命令 -->
11
-
12
12
  ## 1. 编译 / 类型检查
13
13
 
14
- ```bash
15
- # TODO: 替换为你的项目编译命令
16
- # npx tsc --noEmit (TypeScript)
17
- # mvn compile (Maven)
18
- # go build ./... (Go)
19
- # make build (通用)
20
- ```
21
-
22
- 确认无编译错误。
14
+ 本项目由 Node.js CLI 和模板文件组成,无需编译。跳过此步骤。
23
15
 
24
16
  ## 2. 运行单元测试(按层级选择)
25
17
 
26
- 本项目把测试分为三层(可选优化);如果项目测试规模较小,可以全部映射到同一个完整测试命令。
18
+ 本项目把测试分为三层,按场景选择运行命令;新增测试文件默认归入 **full**,确认足够快且足够核心后,再上调到 core 或 smoke。
27
19
 
28
20
  ### smoke(目标 <5s)
29
21
 
30
22
  ```bash
31
- # TODO: 替换为本项目的 smoke 子集命令
32
- # npm run test:smoke (Node.js)
33
- # pytest -m "not slow" (Python)
34
- # go test -short ./... (Go)
23
+ npm run test:smoke
35
24
  ```
36
25
 
37
26
  适用场景:
38
- - implement-task / refine-task 内循环
27
+ - code-task 内循环
39
28
  - 保存即跑 / 频繁反馈
40
29
  - 仅断言项目结构、配置、模板契约
41
30
 
42
31
  ### core(目标 <15s)
43
32
 
44
33
  ```bash
45
- # TODO: 替换为本项目的 core 子集命令
46
- # npm run test:core (Node.js)
47
- # pytest -m "not contract" (Python)
48
- # go test ./... (Go)
34
+ npm run test:core
49
35
  ```
50
36
 
51
37
  适用场景:
52
38
  - pre-commit hook(自动调用)
53
- - 写 implementation.md / refinement.md 报告前的最终验证
39
+ - 写 code.md / code-r{N}.md 报告前的最终验证
54
40
  - 推送 PR 前的本地把关
55
41
 
56
- ### full(完整测试)
42
+ ### full(目标 <60s)
57
43
 
58
44
  ```bash
59
- # TODO: 替换为本项目的完整测试命令
60
- # npm test (Node.js)
61
- # mvn test (Maven)
62
- # pytest (Python)
63
- # go test ./... (Go)
45
+ npm test
64
46
  ```
65
47
 
66
48
  适用场景:
67
49
  - release / tag 前
68
- - CI
50
+ - CI(unit-tests.yml)
69
51
  - main 合并前的最终把关
70
52
 
71
- 如果项目暂不分层,smoke / core / full 可以全部映射到同一个完整测试命令;分层是反馈速度优化项,不是使用协作工作流的前置条件。
53
+ full 层运行全部项目测试。`npm test` 使用通配匹配项目测试文件,**新增的测试文件会自动归入 full**,这是安全网。
72
54
 
73
55
  ## 3. 输出结果
74
56
 
@@ -23,6 +23,7 @@ const DEFAULTS = {
23
23
  "platform": {
24
24
  "type": "github"
25
25
  },
26
+ "requiresPullRequest": true,
26
27
  "sandbox": {
27
28
  "engine": null,
28
29
  "runtimes": [
@@ -11,7 +11,7 @@ priority: # Optional Issue field: Urgent | High | Medium |
11
11
  effort: # Optional Issue field: High | Medium | Low
12
12
  start_date: # Optional Issue field for Feature: YYYY-MM-DD
13
13
  target_date: # Optional Issue field for Feature: YYYY-MM-DD
14
- current_step: analysis # analysis | design | implementation | review | fix | commit
14
+ current_step: requirement-analysis # requirement-analysis | requirement-analysis-review | technical-design | technical-design-review | code | code-review | completed
15
15
  assigned_to: # claude | codex | gemini | opencode | human
16
16
  ---
17
17
 
@@ -46,11 +46,11 @@ assigned_to: # claude | codex | gemini | opencode | human
46
46
 
47
47
  ## Implementation Notes
48
48
 
49
- [Notes from the implementation phase. Decisions made, trade-offs, deviations from design.]
49
+ [Notes from the code phase. Decisions made, trade-offs, deviations from design.]
50
50
 
51
51
  ## Review Feedback
52
52
 
53
- <!-- Populated by review-task -->
53
+ <!-- Populated by review-* -->
54
54
 
55
55
  ## Activity Log
56
56
 
@@ -11,7 +11,7 @@ priority: # 可选 Issue 字段:Urgent | High | Medium |
11
11
  effort: # 可选 Issue 字段:High | Medium | Low
12
12
  start_date: # Feature 可选 Issue 字段:YYYY-MM-DD
13
13
  target_date: # Feature 可选 Issue 字段:YYYY-MM-DD
14
- current_step: analysis # analysis | design | implementation | review | fix | commit
14
+ current_step: requirement-analysis # requirement-analysis | requirement-analysis-review | technical-design | technical-design-review | code | code-review | completed
15
15
  assigned_to: # claude | codex | gemini | opencode | human
16
16
  ---
17
17
 
@@ -50,7 +50,7 @@ assigned_to: # claude | codex | gemini | opencode | human
50
50
 
51
51
  ## 审查反馈
52
52
 
53
- <!-- 由 review-task 填写 -->
53
+ <!-- 由 review-* 填写 -->
54
54
 
55
55
  ## 活动日志
56
56
 
@@ -1,149 +1,195 @@
1
- # Bug Fix Workflow
2
- # Use this workflow when fixing a bug.
1
+ # Bug-fix workflow
2
+ # Use this workflow when fixing a defect.
3
+ #
4
+ # Note: a step's `pr_tasks` list is counted toward workflow progress only when
5
+ # `.agents/.airc.json:requiresPullRequest !== false` (see .agents/skills/complete-task/SKILL.md).
3
6
 
4
7
  name: bug-fix
5
- description: Workflow for diagnosing and fixing a bug.
8
+ description: Workflow for diagnosing and fixing a defect.
6
9
 
7
10
  steps:
8
11
  - name: analysis
9
- description: Reproduce the bug, identify the root cause, and determine the scope of the fix.
12
+ description: Reproduce the defect, identify the root cause, and define the fix scope.
10
13
  recommended_agents:
11
14
  - claude
12
15
  - gemini
13
16
  tasks:
14
- - Understand the bug report and expected behavior
15
- - Reproduce the bug when possible
17
+ - Understand the defect report and expected behavior
18
+ - Reproduce the defect when possible
16
19
  - Trace the code path to identify the root cause
17
- - Determine impacted files and components
18
- - Record findings in the task file
20
+ - Determine affected files and components
21
+ - Record findings in the task workspace
19
22
  inputs:
20
- - Bug report or issue description
23
+ - Defect report or Issue description
21
24
  - Reproduction steps
22
25
  - Project codebase
23
26
  artifact_versioning:
24
27
  outputs:
25
28
  - name: analysis
26
29
  pattern: "analysis.md | analysis-r{N}.md"
27
- rule: "Scan existing analysis artifacts; create analysis.md for the first round, then analysis-r{N}.md for later revisions (N = current highest round + 1)"
30
+ rule: "Scan existing analysis artifacts; create analysis.md for round 1 and analysis-r{N}.md for later revisions (N = current highest round + 1)"
28
31
  outputs:
29
- - Root cause analysis
30
- - List of impacted files
31
- - Updated task file (analysis section)
32
+ - Root-cause analysis
33
+ - Affected files list
34
+ - Updated task analysis notes
35
+
36
+ - name: analysis-review
37
+ description: Review whether the defect analysis has sufficient reproduction evidence, a clear root cause, and a scoped fix.
38
+ recommended_agents:
39
+ - claude
40
+ - gemini
41
+ tasks:
42
+ - Verify reproduction evidence or the non-reproducible explanation
43
+ - Check root-cause reasoning and impact scope
44
+ - Confirm the analysis is ready for design
45
+ - Create the requirement analysis review report
46
+ inputs:
47
+ - Latest root-cause analysis
48
+ - Defect report or Issue description
49
+ artifact_versioning:
50
+ inputs:
51
+ - name: analysis
52
+ pattern: "analysis.md | analysis-r{N}.md"
53
+ rule: "Read the highest-round analysis artifact as review input"
54
+ outputs:
55
+ - name: review-analysis
56
+ pattern: "review-analysis.md | review-analysis-r{N}.md"
57
+ rule: "Scan existing requirement-analysis review artifacts; create review-analysis.md for round 1 and review-analysis-r{N}.md for later rounds (N = current highest round + 1)"
58
+ outputs:
59
+ - Requirement analysis review report
60
+ - Findings to fix, if any
32
61
 
33
62
  - name: design
34
- description: Plan the fix and consider edge cases.
63
+ description: Plan the fix and account for edge cases.
35
64
  recommended_agents:
36
65
  - claude
37
66
  tasks:
38
- - Determine the best approach for fixing the bug
39
- - Identify potential side effects of the fix
40
- - Plan test cases to validate the fix
41
- - Record the fix plan in the task file
67
+ - Determine the best fix approach
68
+ - Identify potential side effects
69
+ - Plan regression tests
70
+ - Record the fix plan in the task workspace
42
71
  inputs:
43
- - Root cause analysis from the previous step
72
+ - Approved root-cause analysis
44
73
  - Project architecture
45
74
  artifact_versioning:
46
75
  inputs:
47
76
  - name: analysis
48
77
  pattern: "analysis.md | analysis-r{N}.md"
49
78
  rule: "Read the highest-round analysis artifact as design input"
79
+ - name: review-analysis
80
+ pattern: "review-analysis.md | review-analysis-r{N}.md"
81
+ rule: "Read the highest-round analysis review artifact and confirm feedback is approved or handled"
50
82
  outputs:
51
83
  - name: plan
52
84
  pattern: "plan.md | plan-r{N}.md"
53
- rule: "Scan existing plan artifacts; create plan.md for the first round, then plan-r{N}.md for later revisions (N = current highest round + 1)"
85
+ rule: "Scan existing plan artifacts; create plan.md for round 1 and plan-r{N}.md for later revisions (N = current highest round + 1)"
54
86
  outputs:
55
- - Fix plan recorded in the task file
56
- - List of test cases to add
87
+ - Fix plan
88
+ - Regression test list
57
89
 
58
- - name: implementation
59
- description: Implement the bug fix and add regression tests.
90
+ - name: design-review
91
+ description: Review whether the fix plan addresses the root cause, has sufficient tests, and controls side effects.
60
92
  recommended_agents:
61
- - codex
62
- - cursor
93
+ - claude
94
+ - gemini
63
95
  tasks:
64
- - Create a bug-fix branch
65
- - Implement the fix
66
- - Add regression tests that would fail without the fix
67
- - Verify that existing tests still pass
68
- - Ensure the code follows project conventions
96
+ - Verify the plan covers the approved root-cause analysis
97
+ - Check regression test strategy and potential side effects
98
+ - Confirm the plan is ready for coding
99
+ - Create the plan review report
69
100
  inputs:
70
- - Fix plan from the previous step
71
- - Project coding standards
101
+ - Latest fix plan
102
+ - Latest root-cause analysis and review report
72
103
  artifact_versioning:
104
+ inputs:
105
+ - name: plan
106
+ pattern: "plan.md | plan-r{N}.md"
107
+ rule: "Read the highest-round plan artifact as review input"
73
108
  outputs:
74
- - name: implementation
75
- pattern: "implementation.md | implementation-r{N}.md"
76
- rule: "Scan existing implementation artifacts; create implementation.md for the first round, then implementation-r{N}.md for later re-implementations (N = current highest round + 1)"
109
+ - name: review-plan
110
+ pattern: "review-plan.md | review-plan-r{N}.md"
111
+ rule: "Scan existing plan review artifacts; create review-plan.md for round 1 and review-plan-r{N}.md for later rounds (N = current highest round + 1)"
77
112
  outputs:
78
- - Bug-fix branch with the implementation
79
- - Regression test files
80
- - Updated task file (implementation notes)
113
+ - Plan review report
114
+ - Findings to fix, if any
81
115
 
82
- - name: review
83
- description: Verify that the fix is correct and complete.
116
+ - name: code
117
+ description: Implement the defect fix and regression coverage; run the same stage again after code review to handle fixes.
84
118
  recommended_agents:
85
- - claude
119
+ - codex
120
+ - cursor
86
121
  tasks:
87
- - Verify that the fix addresses the root cause
88
- - Check whether regression tests are sufficient
89
- - Ensure no new issues were introduced
90
- - Verify that the fix does not break existing functionality
91
- - Create a review report
122
+ - Create a bug-fix branch
123
+ - Implement the fix
124
+ - Add a regression test that fails without the fix
125
+ - Fix findings from the latest code-review artifact when in fix mode
126
+ - Verify existing tests still pass
127
+ - Ensure code follows project conventions
92
128
  inputs:
93
- - Bug-fix branch
94
- - Root cause analysis
129
+ - Approved fix plan
130
+ - Project coding standards
131
+ - Latest code review report when in fix mode
95
132
  artifact_versioning:
96
133
  inputs:
97
- - name: implementation
98
- pattern: "implementation.md | implementation-r{N}.md"
99
- rule: "Read the highest-round implementation artifact as review input"
134
+ - name: plan
135
+ pattern: "plan.md | plan-r{N}.md"
136
+ rule: "Read the highest-round plan artifact as implementation input"
137
+ - name: review-plan
138
+ pattern: "review-plan.md | review-plan-r{N}.md"
139
+ rule: "Read the highest-round plan review artifact and confirm feedback is approved or handled"
140
+ - name: review-code
141
+ pattern: "review-code.md | review-code-r{N}.md"
142
+ rule: "In fix mode, read the highest-round code review artifact and verify it matches the latest Code Review entry in task.md Activity Log"
100
143
  outputs:
101
- - name: review
102
- pattern: "review.md | review-r{N}.md"
103
- rule: "Scan existing review artifacts; create review.md for the first round, then review-r{N}.md for later rounds (N = current highest round + 1)"
144
+ - name: code
145
+ pattern: "code.md | code-r{N}.md"
146
+ rule: "Scan existing code artifacts; create code.md for round 1 and code-r{N}.md for later fixes or reimplementation (N = current highest round + 1)"
104
147
  outputs:
105
- - Review report
106
- - List of issues if any
148
+ - Bug-fix branch with implementation or fixes
149
+ - Regression test files
150
+ - Updated task notes
107
151
 
108
- - name: fix
109
- description: Address issues found during review.
152
+ - name: code-review
153
+ description: Verify that the fix is correct and complete.
110
154
  recommended_agents:
111
- - codex
112
- - cursor
155
+ - claude
113
156
  tasks:
114
- - Fix issues identified in the review
115
- - Update tests as needed
116
- - Verify that all tests pass
157
+ - Verify the fix addresses the root cause
158
+ - Check regression test sufficiency
159
+ - Ensure no new problems were introduced
160
+ - Verify the fix does not break existing behavior
161
+ - Create the code review report
117
162
  inputs:
118
- - Review report
119
163
  - Bug-fix branch
164
+ - Root-cause analysis
120
165
  artifact_versioning:
121
166
  inputs:
122
- - name: review
123
- pattern: "review.md | review-r{N}.md"
124
- rule: "Read the highest-round review artifact and verify that it matches the latest Code Review entry in the task.md Activity Log"
167
+ - name: code
168
+ pattern: "code.md | code-r{N}.md"
169
+ rule: "Read the highest-round code artifact as review input"
125
170
  outputs:
126
- - name: refinement
127
- pattern: "refinement.md | refinement-r{N}.md"
128
- rule: "Scan existing refinement artifacts; create refinement.md for the first round, then refinement-r{N}.md for later rounds (N = current highest round + 1)"
171
+ - name: review-code
172
+ pattern: "review-code.md | review-code-r{N}.md"
173
+ rule: "Scan existing code review artifacts; create review-code.md for round 1 and review-code-r{N}.md for later rounds (N = current highest round + 1)"
129
174
  outputs:
130
- - Updated branch with fixes
131
- - Updated task file
175
+ - Code review report
176
+ - Findings list, if any
132
177
 
133
178
  - name: commit
134
- description: Finalize the bug fix and create a pull request.
179
+ description: Finalize the defect fix and create a pull request (the PR portion runs only when the project enables the PR flow).
135
180
  recommended_agents:
136
181
  - claude
137
182
  - human
138
183
  tasks:
139
184
  - Ensure all tests pass
140
- - Write a commit message that references the bug or issue
141
- - Create a pull request with a bug-fix summary
142
- - Link the PR to the bug report issue
185
+ - Write a commit message that references the defect or Issue
143
186
  - Move the task to completed
187
+ pr_tasks:
188
+ - Create a pull request with a defect-fix description
189
+ - Link the PR to the defect report Issue
144
190
  inputs:
145
191
  - Final bug-fix branch
146
- - Task file
192
+ - Task workspace
147
193
  outputs:
148
- - Pull request
149
- - Completed task file (stored in .agents/workspace/completed/)
194
+ - Completed task workspace under .agents/workspace/completed/
195
+ - Pull request (only when the project enables the PR flow)