@fitlab-ai/agent-infra 0.3.1 → 0.3.2

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 (35) hide show
  1. package/README.md +12 -7
  2. package/README.zh-CN.md +12 -7
  3. package/bin/cli.js +1 -1
  4. package/lib/version.js +2 -1
  5. package/package.json +1 -1
  6. package/templates/.agents/README.md +12 -0
  7. package/templates/.agents/README.zh-CN.md +12 -0
  8. package/templates/.agents/skills/analyze-task/SKILL.md +106 -105
  9. package/templates/.agents/skills/close-codescan/SKILL.md +64 -63
  10. package/templates/.agents/skills/close-dependabot/SKILL.md +71 -70
  11. package/templates/.agents/skills/create-issue/SKILL.md +55 -10
  12. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +55 -10
  13. package/templates/.agents/skills/create-pr/SKILL.md +43 -6
  14. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +43 -6
  15. package/templates/.agents/skills/create-release-note/SKILL.md +18 -11
  16. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +18 -11
  17. package/templates/.agents/skills/create-task/SKILL.md +80 -78
  18. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +7 -6
  19. package/templates/.agents/skills/implement-task/SKILL.md +7 -10
  20. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +7 -10
  21. package/templates/.agents/skills/import-codescan/SKILL.md +54 -53
  22. package/templates/.agents/skills/import-dependabot/SKILL.md +57 -56
  23. package/templates/.agents/skills/import-issue/SKILL.md +58 -58
  24. package/templates/.agents/skills/init-labels/SKILL.md +8 -0
  25. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +8 -0
  26. package/templates/.agents/skills/plan-task/SKILL.md +151 -149
  27. package/templates/.agents/skills/sync-issue/SKILL.md +252 -273
  28. package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +26 -48
  29. package/templates/.agents/skills/sync-pr/SKILL.md +5 -25
  30. package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +4 -24
  31. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +1 -1
  32. package/templates/.claude/CLAUDE.md +13 -0
  33. package/templates/.claude/CLAUDE.zh-CN.md +13 -0
  34. package/templates/AGENTS.md +13 -0
  35. package/templates/AGENTS.zh-CN.md +13 -0
@@ -1,225 +1,227 @@
1
1
  ---
2
2
  name: plan-task
3
3
  description: >
4
- 为任务设计技术方案并输出详细的实施计划。当用户要求为已完成需求分析的任务设计方案或技术计划时触发。
5
- 这是一个强制性的人工审查检查点。参数:task-id。
4
+ Design a technical plan for a task and output a detailed implementation
5
+ plan. Triggered when the user asks for a design or technical plan after
6
+ requirements analysis is complete. This is a mandatory human review
7
+ checkpoint. Argument: task-id.
6
8
  ---
7
9
 
8
- # 设计技术方案
10
+ # Design Technical Plan
9
11
 
10
- ## 行为边界 / 关键规则
12
+ ## Boundary / Critical Rules
11
13
 
12
- - 本技能仅产出技术方案文档(`plan.md` `plan-r{N}.md`)—— 不修改任何业务代码
13
- - 这是一个**强制性的人工审查检查点** —— 不要自动进入实现阶段
14
- - 执行本技能后,你**必须**立即更新 task.md 中的任务状态
14
+ - This skill only outputs a technical plan document (`plan.md` or `plan-r{N}.md`) and does not modify any business code
15
+ - This is a **mandatory human review checkpoint**; do not automatically proceed to implementation
16
+ - After executing this skill, you **must** immediately update task status in task.md
15
17
 
16
- ## 执行步骤
18
+ ## Steps
17
19
 
18
- ### 1. 验证前置条件
20
+ ### 1. Verify Prerequisites
19
21
 
20
- 检查必要文件:
21
- - `.agent-workspace/active/{task-id}/task.md` - 任务文件
22
- - 至少一个分析产物:`analysis.md` `analysis-r{N}.md`
22
+ Check required files:
23
+ - `.agent-workspace/active/{task-id}/task.md` - Task file
24
+ - At least one analysis artifact: `analysis.md` or `analysis-r{N}.md`
23
25
 
24
- 注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
26
+ Note: `{task-id}` format is `TASK-{yyyyMMdd-HHmmss}`, for example `TASK-20260306-143022`
25
27
 
26
- 如果任一文件缺失,提示用户先完成前置步骤。
28
+ If any required file is missing, prompt the user to complete the prerequisite step first.
27
29
 
28
- ### 2. 确定方案轮次
30
+ ### 2. Determine the Plan Round
29
31
 
30
- 扫描 `.agent-workspace/active/{task-id}/` 目录中的方案产物文件:
31
- - 如果不存在 `plan.md` 且不存在 `plan-r*.md` 本轮为第 1 轮,产出 `plan.md`
32
- - 如果存在 `plan.md` 且不存在 `plan-r*.md` 本轮为第 2 轮,产出 `plan-r2.md`
33
- - 如果存在 `plan-r{N}.md` 本轮为第 N+1 轮,产出 `plan-r{N+1}.md`
32
+ Scan `.agent-workspace/active/{task-id}/` for plan artifact files:
33
+ - If neither `plan.md` nor `plan-r*.md` exists -> this is Round 1 and must create `plan.md`
34
+ - If `plan.md` exists and no `plan-r*.md` exists -> this is Round 2 and must create `plan-r2.md`
35
+ - If `plan-r{N}.md` exists -> this is Round N+1 and must create `plan-r{N+1}.md`
34
36
 
35
- 记录:
36
- - `{plan-round}`:本轮方案轮次
37
- - `{plan-artifact}`:本轮方案产物文件名
37
+ Record:
38
+ - `{plan-round}`: the current plan round
39
+ - `{plan-artifact}`: the artifact filename for this round
38
40
 
39
- ### 3. 阅读需求分析
41
+ ### 3. Read Requirements Analysis
40
42
 
41
- 扫描任务目录中的分析产物文件(`analysis.md`、`analysis-r{N}.md`):
42
- - 如果存在 `analysis-r{N}.md`,读取最高 N 的文件
43
- - 否则读取 `analysis.md`
44
- 以理解:
45
- - 需求及其背景
46
- - 相关文件和代码结构
47
- - 影响范围和依赖关系
48
- - 已识别的技术风险
49
- - 工作量和复杂度评估
43
+ Scan the task directory for analysis artifact files (`analysis.md`, `analysis-r{N}.md`):
44
+ - If any `analysis-r{N}.md` exists, read the highest N file
45
+ - otherwise read `analysis.md`
46
+ Use it to understand:
47
+ - the requirements and background
48
+ - related files and code structure
49
+ - impact scope and dependencies
50
+ - identified technical risks
51
+ - effort and complexity assessment
50
52
 
51
- ### 4. 理解问题
53
+ ### 4. Understand the Problem
52
54
 
53
- - 阅读分析中识别的相关源码文件
54
- - 理解当前架构和模式
55
- - 识别约束条件(向后兼容性、性能等)
56
- - 考虑边界情况和错误场景
55
+ - Read the relevant source files identified in the analysis
56
+ - Understand the current architecture and patterns
57
+ - Identify constraints (backward compatibility, performance, etc.)
58
+ - Consider edge cases and failure scenarios
57
59
 
58
- ### 5. 设计技术方案
60
+ ### 5. Design the Technical Plan
59
61
 
60
- 遵循 `.agents/workflows/feature-development.yaml` 中的 `technical-design` 步骤:
62
+ Follow the `technical-design` step in `.agents/workflows/feature-development.yaml`:
61
63
 
62
- **必要任务**:
63
- - [ ] 定义技术方法和理由
64
- - [ ] 考虑备选方案并说明权衡
65
- - [ ] 按顺序详细列出实施步骤
66
- - [ ] 列出所有需要创建/修改的文件
67
- - [ ] 定义验证策略(测试、手动检查)
68
- - [ ] 评估方案的影响和风险
64
+ **Required tasks**:
65
+ - [ ] Define the technical approach and rationale
66
+ - [ ] Consider alternatives and explain the tradeoffs
67
+ - [ ] List implementation steps in detailed order
68
+ - [ ] List all files that need to be created or modified
69
+ - [ ] Define the verification strategy (tests, manual checks)
70
+ - [ ] Assess impact and risks
69
71
 
70
- **设计原则**:
71
- 1. **简洁性**:优先选择满足需求的最简方案
72
- 2. **一致性**:遵循现有代码模式和规范
73
- 3. **可测试性**:设计易于测试的方案
74
- 4. **可逆性**:优先选择易于回退的变更
72
+ **Design principles**:
73
+ 1. **Simplicity**: prefer the simplest approach that satisfies the requirement
74
+ 2. **Consistency**: follow existing code patterns and conventions
75
+ 3. **Testability**: design for straightforward testing
76
+ 4. **Reversibility**: prefer changes that are easy to roll back
75
77
 
76
- ### 6. 输出计划文档
78
+ ### 6. Output Plan Document
77
79
 
78
- 创建 `.agent-workspace/active/{task-id}/{plan-artifact}`。
80
+ Create `.agent-workspace/active/{task-id}/{plan-artifact}`.
79
81
 
80
- ### 7. 更新任务状态
82
+ ### 7. Update Task Status
81
83
 
82
- 获取当前时间:
84
+ Get the current time:
83
85
 
84
86
  ```bash
85
87
  date "+%Y-%m-%d %H:%M:%S"
86
88
  ```
87
89
 
88
- 更新 `.agent-workspace/active/{task-id}/task.md`:
89
- - `current_step`:technical-design
90
- - `assigned_to`:{当前 AI 代理}
91
- - `updated_at`:{当前时间}
92
- - 记录本轮方案产物:`{plan-artifact}`(Round `{plan-round}`)
93
- - 如任务模板包含 `## 设计` 段落,更新为指向 `{plan-artifact}` 的链接
94
- - 在工作流进度中标记 technical-design 为已完成,并注明实际轮次(如果任务模板支持)
95
- - **追加**到 `## Activity Log`(不要覆盖之前的记录):
90
+ Update `.agent-workspace/active/{task-id}/task.md`:
91
+ - `current_step`: technical-design
92
+ - `assigned_to`: {current AI agent}
93
+ - `updated_at`: {current time}
94
+ - Record the plan artifact for this round: `{plan-artifact}` (Round `{plan-round}`)
95
+ - If the task template contains a `## Design` section, update it to link to `{plan-artifact}`
96
+ - Mark technical-design as complete in workflow progress and include the actual round when the task template supports it
97
+ - **Append** to `## Activity Log` (do NOT overwrite previous entries):
96
98
  ```
97
99
  - {yyyy-MM-dd HH:mm:ss} — **Technical Design (Round {N})** by {agent} — Plan completed, awaiting human review → {artifact-filename}
98
100
  ```
99
101
 
100
- ### 8. 告知用户
102
+ ### 8. Inform User
101
103
 
102
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。
104
+ > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent.
103
105
 
104
- 输出格式:
106
+ Output format:
105
107
  ```
106
- 任务 {task-id} 技术方案完成。
108
+ Technical plan complete for task {task-id}.
107
109
 
108
- 方案概要:
109
- - 轮次:Round {plan-round}
110
- - 方法:{简要描述}
111
- - 需修改文件:{数量}
112
- - 需新建文件:{数量}
113
- - 预估复杂度:{评估}
110
+ Plan summary:
111
+ - Round: Round {plan-round}
112
+ - Approach: {brief description}
113
+ - Files to modify: {count}
114
+ - Files to create: {count}
115
+ - Estimated complexity: {assessment}
114
116
 
115
- 产出文件:
116
- - 技术方案:.agent-workspace/active/{task-id}/{plan-artifact}
117
+ Output file:
118
+ - Technical plan: .agent-workspace/active/{task-id}/{plan-artifact}
117
119
 
118
- 重要:人工审查检查点。
119
- 请在继续实现之前审查技术方案。
120
+ Important: human review checkpoint.
121
+ Please review the technical plan before continuing to implementation.
120
122
 
121
- 下一步 - 实施任务:
122
- - Claude Code / OpenCode:/implement-task {task-id}
123
- - Gemini CLI:/agent-infra:implement-task {task-id}
124
- - Codex CLI:$implement-task {task-id}
123
+ Next step - implement the task:
124
+ - Claude Code / OpenCode: /implement-task {task-id}
125
+ - Gemini CLI: /{{project}}:implement-task {task-id}
126
+ - Codex CLI: $implement-task {task-id}
125
127
  ```
126
128
 
127
- ## 输出模板
129
+ ## Output Template
128
130
 
129
131
  ```markdown
130
- # 技术方案
132
+ # Technical Plan
131
133
 
132
- - **方案轮次**:Round {plan-round}
133
- - **产物文件**:`{plan-artifact}`
134
+ - **Plan round**: Round {plan-round}
135
+ - **Artifact file**: `{plan-artifact}`
134
136
 
135
- ## 问题理解
136
- {总结需要解决的问题和关键约束}
137
+ ## Problem Understanding
138
+ {Summarize the problem to solve and the key constraints}
137
139
 
138
- ## 约束条件
139
- - {约束 1}
140
- - {约束 2}
140
+ ## Constraints
141
+ - {Constraint 1}
142
+ - {Constraint 2}
141
143
 
142
- ## 方案对比
144
+ ## Option Comparison
143
145
 
144
- ### 方案 A{名称}
145
- - **方法**:{描述}
146
- - **优点**:{优势}
147
- - **缺点**:{劣势}
146
+ ### Option A: {Name}
147
+ - **Approach**: {Description}
148
+ - **Pros**: {Advantages}
149
+ - **Cons**: {Drawbacks}
148
150
 
149
- ### 方案 B{名称}
150
- - **方法**:{描述}
151
- - **优点**:{优势}
152
- - **缺点**:{劣势}
151
+ ### Option B: {Name}
152
+ - **Approach**: {Description}
153
+ - **Pros**: {Advantages}
154
+ - **Cons**: {Drawbacks}
153
155
 
154
- ### 决策
155
- {选择哪个方案以及原因}
156
+ ### Decision
157
+ {Which option was chosen and why}
156
158
 
157
- ## 技术方法
158
- {所选方案的详细描述}
159
+ ## Technical Approach
160
+ {Detailed description of the selected approach}
159
161
 
160
- ## 实施步骤
162
+ ## Implementation Steps
161
163
 
162
- ### 步骤 1{标题}
163
- - **文件**:`{file-path}`
164
- - **操作**:{要做什么}
165
- - **详情**:{具体细节}
164
+ ### Step 1: {Title}
165
+ - **File**: `{file-path}`
166
+ - **Action**: {What to do}
167
+ - **Details**: {Specific details}
166
168
 
167
- ### 步骤 2{标题}
169
+ ### Step 2: {Title}
168
170
  ...
169
171
 
170
- ## 文件清单
172
+ ## File List
171
173
 
172
- ### 新建文件
173
- - `{file-path}` - {用途}
174
+ ### New Files
175
+ - `{file-path}` - {Purpose}
174
176
 
175
- ### 修改文件
176
- - `{file-path}` - {修改内容}
177
+ ### Modified Files
178
+ - `{file-path}` - {Planned changes}
177
179
 
178
- ## 验证策略
180
+ ## Verification Strategy
179
181
 
180
- ### 单元测试
181
- - {测试用例 1}
182
- - {测试用例 2}
182
+ ### Unit Tests
183
+ - {Test case 1}
184
+ - {Test case 2}
183
185
 
184
- ### 手动验证
185
- - {验证步骤}
186
+ ### Manual Validation
187
+ - {Validation step}
186
188
 
187
- ## 影响评估
188
- - 破坏性变更:{是/否 - 详情}
189
- - 性能影响:{评估}
190
- - 安全考量:{评估}
189
+ ## Impact Assessment
190
+ - Breaking change: {Yes/No - details}
191
+ - Performance impact: {Assessment}
192
+ - Security considerations: {Assessment}
191
193
 
192
- ## 风险控制
193
- - {风险 1}{缓解措施}
194
- - {风险 2}{缓解措施}
194
+ ## Risk Control
195
+ - {Risk 1}: {Mitigation}
196
+ - {Risk 2}: {Mitigation}
195
197
  ```
196
198
 
197
- ## 完成检查清单
199
+ ## Completion Checklist
198
200
 
199
- - [ ] 阅读并理解了需求分析
200
- - [ ] 考虑了备选方案
201
- - [ ] 创建了计划文档 `.agent-workspace/active/{task-id}/{plan-artifact}`
202
- - [ ] 更新了 task.md 中的 `current_step` technical-design
203
- - [ ] 更新了 task.md 中的 `updated_at` 为当前时间
204
- - [ ] task.md 中记录了 `{plan-artifact}` 为已完成产物
205
- - [ ] 在工作流进度中标记了 technical-design 为已完成
206
- - [ ] 追加了 Activity Log 条目到 task.md
207
- - [ ] 告知了用户这是人工审查检查点
208
- - [ ] 告知了用户下一步(必须展示所有 TUI 的命令格式,不要筛选)
201
+ - [ ] Read and understood the requirements analysis
202
+ - [ ] Considered alternative options
203
+ - [ ] Created the plan document `.agent-workspace/active/{task-id}/{plan-artifact}`
204
+ - [ ] Updated `current_step` to technical-design in task.md
205
+ - [ ] Updated `updated_at` to the current time in task.md
206
+ - [ ] Recorded `{plan-artifact}` as a completed artifact in task.md
207
+ - [ ] Marked technical-design as complete in workflow progress
208
+ - [ ] Appended an Activity Log entry to task.md
209
+ - [ ] Informed the user that this is a human review checkpoint
210
+ - [ ] Informed the user of the next step (must include all TUI command formats; do not filter)
209
211
 
210
- ## 停止
212
+ ## STOP
211
213
 
212
- 完成检查清单后,**立即停止**。
213
- 这是一个**强制性的人工审查检查点** —— 用户必须审查并批准计划后才能继续实现。
214
+ After completing the checklist, **stop immediately**.
215
+ This is a **mandatory human review checkpoint**; the user must review and approve the plan before implementation can continue.
214
216
 
215
- ## 注意事项
217
+ ## Notes
216
218
 
217
- 1. **前置条件**:必须已完成至少一轮需求分析(`analysis.md` `analysis-r{N}.md` 存在)
218
- 2. **人工审查**:这是强制性检查点 —— 不要自动进入实现阶段
219
- 3. **计划质量**:计划应足够具体,使另一个 AI 代理无需额外上下文即可实现
220
- 4. **版本化规则**:首轮方案使用 `plan.md`;后续修订使用 `plan-r{N}.md`
219
+ 1. **Prerequisite**: at least one round of requirements analysis must already be complete (`analysis.md` or `analysis-r{N}.md` exists)
220
+ 2. **Human review**: this is a mandatory checkpoint; do not automatically proceed to implementation
221
+ 3. **Plan quality**: the plan should be detailed enough that another AI agent can implement it without extra context
222
+ 4. **Versioning rule**: the first plan uses `plan.md`; later revisions use `plan-r{N}.md`
221
223
 
222
- ## 错误处理
224
+ ## Error Handling
223
225
 
224
- - 任务未找到:提示 "Task {task-id} not found, please check the task ID"
225
- - 缺少分析:提示 "Analysis not found, please run the analyze-task skill first"
226
+ - Task not found: output "Task {task-id} not found, please check the task ID"
227
+ - Analysis missing: output "Analysis not found, please run the analyze-task skill first"