@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
@@ -1,173 +0,0 @@
1
- ---
2
- name: implement-task
3
- description: "Implement a task from its technical plan and output a report"
4
- ---
5
-
6
- # Implement Task
7
-
8
- Implement the approved task and produce `implementation.md` or `implementation-r{N}.md`.
9
-
10
- ## Boundary / Critical Rules
11
-
12
- - Follow the latest approved plan artifact: `plan.md` or `plan-r{N}.md`
13
- - Never auto-run `git add` or `git commit`
14
- - Create a new implementation artifact for each round and never overwrite an older one
15
- - After executing this skill, you **must** immediately update task.md
16
-
17
- Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
18
-
19
- ## Common Rationalizations and Rebuttals
20
-
21
- Before implementing, stop if any of these thoughts appear. They are violations:
22
-
23
- | Rationalization | Rebuttal |
24
- |------|------|
25
- | "The code is too simple to need tests." | Simple code still regresses; without a failing-to-passing case there is no completion signal, so write a test that verifies business behavior first. |
26
- | "Writing code first and adding tests later is faster." | Tests added after implementation often mirror the implementation; goal-driven work defines the verifiable case first and then makes it pass. |
27
- | "This plan is flawed, so I will improve it as I go." | Deviations from `{plan-artifact}` must be recorded in the report; if the direction is questionable, stop and confirm instead of changing it silently. |
28
- | "The tests passed, so I can commit this too." | This skill never runs `git add` or `git commit`; committing is a separate step explicitly requested by the user. |
29
-
30
- ## Step 0: State Check (pre-execution hard gate)
31
-
32
- After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first. Reading instruction files does not count as an external-state action or conclusion.
33
-
34
- Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
35
-
36
- ```bash
37
- git status -s
38
- ls -la .agents/workspace/active/{task-id}/
39
- tail .agents/workspace/active/{task-id}/task.md
40
- ```
41
-
42
- Before the state check is complete, do not make external-state assertions such as "the code is unchanged", "tests passed", or "there are no other references", including in reasoning. This gate is only a structural floor; evidence pairing and authenticity still require the report template and review discipline.
43
-
44
- ## Steps
45
-
46
- ### 1. Verify Prerequisites
47
-
48
- Check these files first:
49
- - `.agents/workspace/active/{task-id}/task.md`
50
- - At least one technical plan artifact: `plan.md` or `plan-r{N}.md`
51
-
52
- If either file is missing, stop and ask the user to complete the prerequisite step.
53
-
54
- ### 2. Ensure the Task Branch
55
-
56
- Read the branch field in `## Context` from `task.md` and check whether the current Git branch matches it.
57
-
58
- - if a task branch is already recorded, switch to it when the current branch does not match
59
- - if no branch is recorded, check whether the current branch follows the naming convention and belongs to this task
60
- - if yes: record the current branch and continue
61
- - if no: create and switch to a new task branch that follows the naming rule
62
-
63
- After this step, write the final branch name back to `task.md`.
64
-
65
- > Branch naming rules, Git commands, and edge-case handling live in `reference/branch-management.md`. Read `reference/branch-management.md` before executing this step.
66
-
67
- ### 3. Narrow the Milestone
68
-
69
- If task.md contains a valid `issue_number`, read `.agents/rules/issue-sync.md` first to complete upstream repository detection plus permission detection; then read `.agents/rules/milestone-inference.md` and follow "Phase 2: `implement-task`" to narrow the Issue milestone before implementation starts; if `has_triage=false`, keep the current milestone unchanged.
70
-
71
- ### 4. Determine the Input Plan and Implementation Round
72
-
73
- Scan `.agents/workspace/active/{task-id}/` and record:
74
- - the highest-round plan file as `{plan-artifact}`
75
- - the next implementation artifact as `implementation.md` or `implementation-r{N}.md`
76
- - `{implementation-round}` and `{implementation-artifact}`
77
-
78
- If any `plan-r{N}.md` exists, read the highest-round plan file. Otherwise read `plan.md`.
79
-
80
- ### 5. Read the Technical Plan
81
-
82
- Read `{plan-artifact}` carefully and extract:
83
- - implementation steps
84
- - files to create or modify
85
- - test strategy
86
- - constraints, risks, and any approved tradeoffs
87
-
88
- ### 6. Implement the Code
89
-
90
- Follow `.agents/workflows/feature-development.yaml` and the plan in order.
91
-
92
- > Detailed implementation rules, the test execution loop, and deviation handling live in `reference/implementation-rules.md`. Read `reference/implementation-rules.md` before executing this step.
93
- > Test-writing discipline (RED-GREEN-REFACTOR and anti-patterns) lives in `.agents/rules/testing-discipline.md`; read it before adding or changing tests.
94
-
95
- ### 7. Run Test Verification
96
-
97
- Use the project test command from the `test` skill and keep iterating until all required tests pass.
98
-
99
- If tests fail, Attempt to fix the issue and re-run tests first. Only stop when you confirm an external blocker, missing environment, or unclear requirement that is out of scope for the task.
100
-
101
- ### 8. Write the Implementation Report
102
-
103
- Create `.agents/workspace/active/{task-id}/{implementation-artifact}`.
104
-
105
- > Report structure, required sections, and the full template live in `reference/report-template.md`. Read `reference/report-template.md` before writing the report.
106
-
107
- ### 9. Update Task Status
108
-
109
- Get the current time:
110
-
111
- ```bash
112
- date "+%Y-%m-%d %H:%M:%S%:z"
113
- ```
114
-
115
- Update `.agents/workspace/active/{task-id}/task.md`:
116
- - `current_step`: implementation
117
- - `assigned_to`: {current agent}
118
- - `updated_at`: {current time}
119
- - `agent_infra_version`: value from `.agents/rules/version-stamp.md`
120
- - review the `## Requirements` section and only change items from `- [ ]` to `- [x]` when they are clearly satisfied by this round's implemented code and passing tests
121
- - record `{implementation-artifact}` for Round `{implementation-round}`
122
- - append:
123
- `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Implementation (Round {N})** by {agent} — Code implemented, {n} files modified, {n} tests passed → {implementation-artifact}`
124
-
125
- If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure; read `.agents/rules/issue-sync.md` first and complete upstream repository detection plus permission detection):
126
- - Set `status: in-progress` by following issue-sync.md
127
- - Create or update the task comment marker defined in `.agents/rules/issue-sync.md` (follow the task.md comment sync rule in issue-sync.md)
128
- - Publish the `{implementation-artifact}` comment
129
-
130
- ### 10. Verification Gate
131
-
132
- Run the verification gate to confirm the task artifact and sync state are valid:
133
-
134
- ```bash
135
- node .agents/scripts/validate-artifact.js gate implement-task .agents/workspace/active/{task-id} {implementation-artifact} --format text
136
- ```
137
-
138
- Handle the result as follows:
139
- - exit code 0 (all checks passed) -> continue to the "Inform User" step
140
- - exit code 1 (validation failed) -> fix the reported issues and run the gate again
141
- - exit code 2 (network blocked) -> stop and tell the user that human intervention is required
142
-
143
- Keep the gate output in your reply as fresh evidence. Do not claim completion without output from this run.
144
-
145
- ### 11. Inform User
146
-
147
- > Execute this step only after the verification gate passes.
148
-
149
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name). Use the output template in `reference/output-template.md`.
150
-
151
- ## Completion Checklist
152
-
153
- - [ ] Implemented the approved code changes
154
- - [ ] Created `{implementation-artifact}`
155
- - [ ] All required tests passed
156
- - [ ] Updated task.md and appended the Activity Log entry
157
- - [ ] Included every TUI command format, including any custom TUIs, in the user-facing next step
158
-
159
- ## STOP
160
-
161
- Stop after the checklist is complete. Do not auto-commit.
162
-
163
- ## Notes
164
-
165
- - Round 1 uses `implementation.md`; later rounds use `implementation-r{N}.md`
166
- - Record any deviation from `{plan-artifact}` in the report
167
- - New tests must validate meaningful business behavior, not just passthrough data
168
-
169
- ## Error Handling
170
-
171
- - Task not found: `Task {task-id} not found`
172
- - Missing plan: `Technical plan not found, please run the plan-task skill first`
173
- - Test failure after local fixes: explain the external blocker and stop without creating the implementation artifact
@@ -1,20 +0,0 @@
1
- # Output Template
2
-
3
- When reporting that implementation is complete, use the following standard format:
4
-
5
- ```text
6
- Task {task-id} implementation complete.
7
-
8
- Summary:
9
- - Implementation round: Round {implementation-round}
10
- - Files modified: {count}
11
- - All tests passed: {yes/no}
12
-
13
- Output files:
14
- - Implementation report: .agents/workspace/active/{task-id}/{implementation-artifact}
15
-
16
- Next step - code review:
17
- - Claude Code / OpenCode: /review-task {task-id}
18
- - Gemini CLI: /{{project}}:review-task {task-id}
19
- - Codex CLI: $review-task {task-id}
20
- ```
@@ -1,20 +0,0 @@
1
- # 输出模板
2
-
3
- 向用户汇报实现完成时,使用以下标准格式:
4
-
5
- ```text
6
- 任务 {task-id} 实现完成。
7
-
8
- 摘要:
9
- - 实现轮次:Round {implementation-round}
10
- - 修改文件:{数量}
11
- - 所有测试通过:{是/否}
12
-
13
- 产出文件:
14
- - 实现报告:.agents/workspace/active/{task-id}/{implementation-artifact}
15
-
16
- 下一步 - 代码审查:
17
- - Claude Code / OpenCode:/review-task {task-id}
18
- - Gemini CLI:/{{project}}:review-task {task-id}
19
- - Codex CLI:$review-task {task-id}
20
- ```
@@ -1,153 +0,0 @@
1
- ---
2
- name: refine-task
3
- description: "Handle code review feedback and fix issues"
4
- ---
5
-
6
- # Refine Task
7
-
8
- Fix review findings and produce `refinement.md` or `refinement-r{N}.md`.
9
-
10
- ## Boundary / Critical Rules
11
-
12
- - Fix only the issues documented in review artifacts
13
- - env-blocked findings are outside the repair scope: the refinement report must preserve them and record "outside AI repair scope (environment-blocked)" instead of making no-op edits to clear the report
14
- - Never auto-run `git add` or `git commit`
15
- - After executing this skill, you **must** immediately update task.md
16
-
17
- Version stamp rule: when creating or updating `task.md` frontmatter, read `.agents/rules/version-stamp.md` first and write or refresh `agent_infra_version`.
18
-
19
- ## Common Rationalizations and Rebuttals
20
-
21
- | Rationalization | Rebuttal |
22
- |------|------|
23
- | "This review comment is wrong, so I will ignore it." | If you disagree, record the reason under unresolved issues in the report; do not silently skip blocker or major findings. |
24
- | "I can clean up nearby code while I am here." | Scope is limited to review findings; changes outside that scope are out of bounds. |
25
- | "Clearing env-blocked items makes the report look better." | env-blocked findings are outside the repair scope; preserve and label them truthfully, and never use no-op edits to pad the fix count. |
26
-
27
- ## Step 0: State Check (pre-execution hard gate)
28
-
29
- After loading workflow / skill / rules instructions, and before any task-state judgment or user-visible conclusion, run the state check first. Reading instruction files does not count as an external-state action or conclusion.
30
-
31
- Run these commands and paste the raw output into both the user-facing reply and this round's `## State Check` section:
32
-
33
- ```bash
34
- git status -s
35
- ls -la .agents/workspace/active/{task-id}/
36
- tail .agents/workspace/active/{task-id}/task.md
37
- ```
38
-
39
- Before the state check is complete, do not make external-state assertions such as "the code is unchanged", "tests passed", or "there are no other references", including in reasoning. This gate is only a structural floor; evidence pairing and authenticity still require the report template and review discipline.
40
-
41
- ## Steps
42
-
43
- ### 1. Verify Prerequisites
44
-
45
- Require:
46
- - `.agents/workspace/active/{task-id}/task.md`
47
- - at least one review artifact: `review.md` or `review-r{N}.md`
48
-
49
- During prerequisite discovery, record `{review-artifact}`, `{refinement-round}`, `{refinement-artifact}`, and Record `{implementation-artifact}` from the latest implementation report.
50
-
51
- Also validate the latest Code Review entry in Activity Log. If it points to a missing file, stop with:
52
- `Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists.`
53
-
54
- ### 2. Read Review and Implementation Context
55
-
56
- Read the latest `{review-artifact}` and `{implementation-artifact}` before editing any code.
57
-
58
- ### 3. Plan and Apply the Fixes
59
-
60
- Prioritize Blocker -> Major -> Minor and keep changes tightly scoped.
61
-
62
- > The detailed fix workflow, repair order, and verification loop live in `reference/fix-workflow.md`. Read `reference/fix-workflow.md` before making changes.
63
-
64
- ### 4. Run Test Verification
65
-
66
- Run the project test command after the fixes and keep the repair cycle focused on the documented findings.
67
-
68
- ### 5. Write the Refinement Report
69
-
70
- Create `.agents/workspace/active/{task-id}/{refinement-artifact}`.
71
-
72
- > The report structure and example sections live in `reference/report-template.md`. Read `reference/report-template.md` before writing the report.
73
-
74
- ### 6. Update Task Status
75
-
76
- Get the current time:
77
-
78
- ```bash
79
- date "+%Y-%m-%d %H:%M:%S%:z"
80
- ```
81
-
82
- Update task.md:
83
- - review the `## Requirements` section and only change items from `- [ ]` to `- [x]` when they are newly satisfied by this round's fixes and passing tests
84
- - preserve explicit optional Issue field metadata (`priority`, `effort`, `start_date`, `target_date`); only infer `priority` or `effort` from clear review context, and do not invent dates
85
- - append:
86
- `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Refinement (Round {N}, for {review-artifact})** by {agent} — Fixed {n} blockers, {n} major, {n} minor issues[, skipped {n} env-blocked] → {refinement-artifact}`
87
-
88
- Append `, skipped {n} env-blocked` when env-blocked > 0; omit it when env-blocked = 0.
89
-
90
- If task.md contains a valid `issue_number`, perform these sync actions (skip and continue on any failure):
91
- - Read `.agents/rules/issue-sync.md` before syncing, and complete upstream repository detection plus permission detection
92
- - Set `status: in-progress` by following issue-sync.md
93
- - Create or update the task comment marker defined in `.agents/rules/issue-sync.md` (follow the task.md comment sync rule in issue-sync.md)
94
- - Publish the `{refinement-artifact}` comment
95
-
96
- ### 7. Verification Gate
97
-
98
- Run the verification gate to confirm the task artifact and sync state are valid:
99
-
100
- ```bash
101
- node .agents/scripts/validate-artifact.js gate refine-task .agents/workspace/active/{task-id} {refinement-artifact} --format text
102
- ```
103
-
104
- Handle the result as follows:
105
- - exit code 0 (all checks passed) -> continue to the "Inform User" step
106
- - exit code 1 (validation failed) -> fix the reported issues and run the gate again
107
- - exit code 2 (network blocked) -> stop and tell the user that human intervention is required
108
-
109
- Keep the gate output in your reply as fresh evidence. Do not claim completion without output from this run.
110
-
111
- ### 8. Inform User
112
-
113
- > Execute this step only after the verification gate passes.
114
-
115
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name).
116
-
117
- After summarizing the fixes, present the next step:
118
-
119
- ```
120
- Next step - re-review or commit:
121
- - Re-review (always recommended):
122
- - Claude Code / OpenCode: /review-task {task-id}
123
- - Gemini CLI: /{{project}}:review-task {task-id}
124
- - Codex CLI: $review-task {task-id}
125
- - Commit directly (optional; only when all issues are resolved and changes are low risk):
126
- - Claude Code / OpenCode: /commit
127
- - Gemini CLI: /{{project}}:commit
128
- - Codex CLI: $commit
129
- ```
130
-
131
- ## Completion Checklist
132
-
133
- - [ ] Read the latest review and implementation context
134
- - [ ] Fixed all required Blocker and Major findings
135
- - [ ] Wrote `{refinement-artifact}`
136
- - [ ] Updated task.md and appended the Activity Log entry
137
- - [ ] Recommended the correct next step based on residual risk
138
-
139
- ## Notes
140
-
141
- - Round 1 uses `refinement.md`; later rounds use `refinement-r{N}.md`
142
- - Record any disagreement with a review comment under unresolved issues in the report
143
- - Do not expand scope beyond the review findings
144
-
145
- ## STOP
146
-
147
- Stop after the checklist is complete.
148
-
149
- ## Error Handling
150
-
151
- - Task not found: `Task {task-id} not found`
152
- - Missing review report: `Review report not found, please run the review-task skill first`
153
- - Review artifact mismatch: `Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists.`
@@ -1,153 +0,0 @@
1
- ---
2
- name: refine-task
3
- description: "处理代码审查反馈并修复问题"
4
- ---
5
-
6
- # 修复审查问题
7
-
8
- 修复审查发现的问题,并产出 `refinement.md` 或 `refinement-r{N}.md`。
9
-
10
- ## 行为边界 / 关键规则
11
-
12
- - 只修复审查产物中记录的问题
13
- - env-blocked 项不在修复范围内:refinement 报告必须如实保留这些项并记录“不在 AI 修复范围(环境性遗留)”,不能为了清空报告做 no-op 改动
14
- - 绝不自动执行 `git add` 或 `git commit`
15
- - 执行本技能后,你**必须**立即更新 task.md
16
-
17
- 版本戳规则:创建或更新 `task.md` frontmatter 时,先读取 `.agents/rules/version-stamp.md`,并写入或刷新 `agent_infra_version`。
18
-
19
- ## 常见违规借口与反驳
20
-
21
- | 借口 | 反驳 |
22
- |------|------|
23
- | 「这条审查意见不合理,直接忽略」 | 不同意要在报告的未解决问题中写明理由,不能静默跳过 blocker/major。 |
24
- | 「顺手把旁边也优化了」 | 范围严格限定在审查项内,范围外改动属于越界。 |
25
- | 「env-blocked 项清掉报告好看」 | env-blocked 不在修复范围,必须如实保留并标注,禁止 no-op 改动充数。 |
26
-
27
- ## 第 0 步:状态核对(执行前硬约束)
28
-
29
- 在加载 workflow / skill / rules 指令之后、做任何任务状态判断或用户可见结论之前,必须先执行状态核对。指令类文件读取不算对外动作或结论。
30
-
31
- 运行以下命令,并把原文粘贴到回复正文和本轮产物的 `## 状态核对` 段:
32
-
33
- ```bash
34
- git status -s
35
- ls -la .agents/workspace/active/{task-id}/
36
- tail .agents/workspace/active/{task-id}/task.md
37
- ```
38
-
39
- 状态核对完成前,禁止任何关于外部状态的断言(例如“代码没变”“测试已通过”“没有其他引用”),包括思考阶段。本门禁只提供结构下限;逐条证据配对和真实性仍需按报告模板与审查要求核对。
40
-
41
- ## 执行步骤
42
-
43
- ### 1. 验证前置条件
44
-
45
- 要求存在:
46
- - `.agents/workspace/active/{task-id}/task.md`
47
- - 至少一个审查产物:`review.md` 或 `review-r{N}.md`
48
-
49
- 在前置检查阶段必须记录 `{review-artifact}`、`{refinement-round}`、`{refinement-artifact}`,并从最新实现报告中记录 `{implementation-artifact}`。
50
-
51
- 同时校验 Activity Log 中最近一条 Code Review 记录;如果引用了不存在的文件,立即停止并输出:
52
- `Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists.`
53
-
54
- ### 2. 阅读审查与实现上下文
55
-
56
- 在修改代码前先读取最新的 `{review-artifact}` 和 `{implementation-artifact}`。
57
-
58
- ### 3. 规划并执行修复
59
-
60
- 按 Blocker -> Major -> Minor 的顺序处理,始终保持改动聚焦。
61
-
62
- > 详细修复流程、优先级和验证循环见 `reference/fix-workflow.md`。执行此步骤前先读取 `reference/fix-workflow.md`。
63
-
64
- ### 4. 运行测试验证
65
-
66
- 修复后运行项目测试命令,并把修复范围限制在审查结论内。
67
-
68
- ### 5. 编写修复报告
69
-
70
- 创建 `.agents/workspace/active/{task-id}/{refinement-artifact}`。
71
-
72
- > 报告结构和示例章节见 `reference/report-template.md`。写报告前先读取 `reference/report-template.md`。
73
-
74
- ### 6. 更新任务状态
75
-
76
- 获取当前时间:
77
-
78
- ```bash
79
- date "+%Y-%m-%d %H:%M:%S%:z"
80
- ```
81
-
82
- 更新 task.md:
83
- - 审查 `## 需求` 段落,仅把因本轮修复而新满足且有测试通过支撑的条目从 `- [ ]` 勾为 `- [x]`
84
- - 保留明确填写的可选 Issue 字段元数据(`priority`、`effort`、`start_date`、`target_date`);仅在审查上下文非常明确时推断 `priority` 或 `effort`,不要臆测日期
85
- - 追加:
86
- `- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Refinement (Round {N}, for {review-artifact})** by {agent} — Fixed {n} blockers, {n} major, {n} minor issues[, skipped {n} env-blocked] → {refinement-artifact}`
87
-
88
- env-blocked > 0 时附加 `, skipped {n} env-blocked`;env-blocked = 0 时省略。
89
-
90
- 如果 task.md 中存在有效的 `issue_number`,执行以下同步操作(任一失败则跳过并继续):
91
- - 执行前先读取 `.agents/rules/issue-sync.md`,完成 upstream 仓库检测和权限检测
92
- - 按 issue-sync.md 设置 `status: in-progress`
93
- - 创建或更新 `.agents/rules/issue-sync.md` 中定义的 task 评论标记(按 issue-sync.md 的 task.md 评论同步规则)
94
- - 发布 `{refinement-artifact}` 评论
95
-
96
- ### 7. 完成校验
97
-
98
- 运行完成校验,确认任务产物和同步状态符合规范:
99
-
100
- ```bash
101
- node .agents/scripts/validate-artifact.js gate refine-task .agents/workspace/active/{task-id} {refinement-artifact} --format text
102
- ```
103
-
104
- 处理结果:
105
- - 退出码 0(全部通过)-> 继续到「告知用户」步骤
106
- - 退出码 1(校验失败)-> 根据输出修复问题后重新运行校验
107
- - 退出码 2(网络中断)-> 停止执行并告知用户需要人工介入
108
-
109
- 将校验输出保留在回复中作为当次验证输出。没有当次校验输出,不得声明完成。
110
-
111
- ### 8. 告知用户
112
-
113
- > 仅在校验通过后执行本步骤。
114
-
115
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
116
-
117
- 输出修复摘要后,展示下一步:
118
-
119
- ```
120
- 下一步 - 重新审查或提交:
121
- - 重新审查(始终推荐):
122
- - Claude Code / OpenCode:/review-task {task-id}
123
- - Gemini CLI:/agent-infra:review-task {task-id}
124
- - Codex CLI:$review-task {task-id}
125
- - 直接提交(可选;仅在所有问题已解决且风险可控时):
126
- - Claude Code / OpenCode:/commit
127
- - Gemini CLI:/agent-infra:commit
128
- - Codex CLI:$commit
129
- ```
130
-
131
- ## 完成检查清单
132
-
133
- - [ ] 已读取最新审查与实现上下文
134
- - [ ] 已修复所有必需的 Blocker 和 Major 问题
135
- - [ ] 已写出 `{refinement-artifact}`
136
- - [ ] 已更新 task.md 并追加 Activity Log
137
- - [ ] 已根据剩余风险推荐正确的下一步
138
-
139
- ## 注意事项
140
-
141
- - 首轮修复使用 `refinement.md`,后续轮次使用 `refinement-r{N}.md`
142
- - 若不同意审查意见,要在报告的未解决问题中记录理由
143
- - 不要把范围扩展到审查项之外
144
-
145
- ## 停止
146
-
147
- 完成检查清单后立即停止。
148
-
149
- ## 错误处理
150
-
151
- - 任务未找到:`Task {task-id} not found`
152
- - 缺少审查报告:`Review report not found, please run the review-task skill first`
153
- - 审查产物不一致:`Review artifact mismatch: Activity Log references {expected} but file not found. Please verify the review artifact exists.`
@@ -1,64 +0,0 @@
1
- # Refinement Report Template
2
-
3
- Use this structure when writing `refinement.md` or `refinement-r{N}.md`.
4
-
5
- ## Output Template
6
-
7
- ```markdown
8
- # Refinement Report
9
-
10
- - **Refinement Round**: Round {refinement-round}
11
- - **Artifact File**: `{refinement-artifact}`
12
- - **Review Input**: `{review-artifact}`
13
- - **Implementation Context**: `{implementation-artifact}`
14
-
15
- ## State Check
16
-
17
- > Paste the raw state-check command output; each command starts with `$ `.
18
-
19
- ### Review Feedback Handling
20
-
21
- #### Blocker Fixes
22
- 1. **{issue-title}**
23
- - **Fix**: {what changed}
24
- - **File**: `{file-path}:{line-number}`
25
- - **Validation**: {validation}
26
-
27
- #### Major Issue Fixes
28
- 1. **{issue-title}**
29
- - **Fix**: {what changed}
30
- - **File**: `{file-path}:{line-number}`
31
-
32
- #### Minor Issue Handling
33
- 1. **{issue-title}**
34
- - **Fix**: {what changed}
35
-
36
- #### Environment-Blocked Handling
37
-
38
- > These findings are outside AI repair scope and do not count toward repair totals. Preserve them unchanged and identify the maintainer verification path.
39
-
40
- 1. **{issue-title}**
41
- - **Status**: skipped (outside AI repair scope)
42
- - **Required Environment**: {e.g. Docker sandbox / macOS host / third-party account}
43
- - **Maintainer Verification Steps**: {steps}
44
-
45
- > If this round has no env-blocked findings, keep the subsection heading and write "None".
46
-
47
- #### Unresolved Issues
48
- - {issue}: {reason}
49
-
50
-
51
- ## Evidence
52
-
53
- > 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.
54
-
55
- - Claim: {verified claim}
56
- ```text
57
- $ {command}
58
- {raw output}
59
- ```
60
-
61
- ### Test Results After Refinement
62
- - All tests passing: {yes/no}
63
- - Test output: {summary}
64
- ```
@@ -1,64 +0,0 @@
1
- # 修复报告模板
2
-
3
- 编写 `refinement.md` 或 `refinement-r{N}.md` 时,使用以下结构。
4
-
5
- ## 输出模板
6
-
7
- ```markdown
8
- # 修复报告
9
-
10
- - **修复轮次**: Round {refinement-round}
11
- - **产物文件**: `{refinement-artifact}`
12
- - **审查输入**: `{review-artifact}`
13
- - **实现上下文**: `{implementation-artifact}`
14
-
15
- ## 状态核对
16
-
17
- > 粘贴状态核对命令原文;每条命令以 `$ ` 开头。
18
-
19
- ### 审查反馈处理
20
-
21
- #### 阻塞项修复
22
- 1. **{issue-title}**
23
- - **修复**: {what changed}
24
- - **文件**: `{file-path}:{line-number}`
25
- - **验证**: {validation}
26
-
27
- #### 主要问题修复
28
- 1. **{issue-title}**
29
- - **修复**: {what changed}
30
- - **文件**: `{file-path}:{line-number}`
31
-
32
- #### 次要问题处理
33
- 1. **{issue-title}**
34
- - **修复**: {what changed}
35
-
36
- #### 环境性遗留处理
37
-
38
- > 这些项不在 AI 修复范围;不计入修复总数。仅原样保留并指明维护者后续验证路径。
39
-
40
- 1. **{issue-title}**
41
- - **状态**:跳过(不在 AI 修复范围)
42
- - **所需环境**:{e.g. Docker 沙箱 / macOS host / 第三方账号}
43
- - **维护者验证步骤**:{steps}
44
-
45
- > 如本轮无 env-blocked 项,保留小节标题并写「(无)」。
46
-
47
- #### 未解决问题
48
- - {issue}: {reason}
49
-
50
-
51
- ## 证据原文
52
-
53
- > 每条“我验证了 X”断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。
54
-
55
- - 断言:{verified claim}
56
- ```text
57
- $ {command}
58
- {raw output}
59
- ```
60
-
61
- ### 修复后的测试结果
62
- - 所有测试通过: {yes/no}
63
- - 测试输出: {summary}
64
- ```