@fitlab-ai/agent-infra 0.4.1 → 0.4.3

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 (142) hide show
  1. package/README.md +44 -44
  2. package/README.zh-CN.md +44 -44
  3. package/lib/defaults.json +7 -9
  4. package/lib/init.js +1 -0
  5. package/lib/update.js +13 -1
  6. package/package.json +3 -3
  7. package/templates/.agents/QUICKSTART.md +7 -7
  8. package/templates/.agents/QUICKSTART.zh-CN.md +13 -13
  9. package/templates/.agents/README.md +31 -18
  10. package/templates/.agents/README.zh-CN.md +33 -20
  11. package/templates/.agents/rules/issue-sync.md +185 -0
  12. package/templates/.agents/rules/issue-sync.zh-CN.md +185 -0
  13. package/templates/.agents/scripts/validate-artifact.js +1280 -0
  14. package/templates/.agents/skills/analyze-task/SKILL.md +24 -1
  15. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +24 -1
  16. package/templates/.agents/skills/analyze-task/config/verify.json +41 -0
  17. package/templates/.agents/skills/archive-tasks/SKILL.md +40 -0
  18. package/templates/.agents/skills/archive-tasks/SKILL.zh-CN.md +40 -0
  19. package/templates/.agents/skills/archive-tasks/scripts/archive-tasks.sh +403 -0
  20. package/templates/.agents/skills/block-task/SKILL.md +25 -37
  21. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +25 -37
  22. package/templates/.agents/skills/block-task/config/verify.json +28 -0
  23. package/templates/.agents/skills/close-codescan/SKILL.md +7 -0
  24. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +7 -0
  25. package/templates/.agents/skills/close-dependabot/SKILL.md +7 -0
  26. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +7 -0
  27. package/templates/.agents/skills/commit/SKILL.md +17 -0
  28. package/templates/.agents/skills/commit/SKILL.zh-CN.md +17 -0
  29. package/templates/.agents/skills/commit/config/verify.json +22 -0
  30. package/templates/.agents/skills/commit/reference/task-status-update.md +3 -3
  31. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +3 -3
  32. package/templates/.agents/skills/complete-task/SKILL.md +24 -10
  33. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +24 -10
  34. package/templates/.agents/skills/complete-task/config/verify.json +30 -0
  35. package/templates/.agents/skills/create-issue/SKILL.md +41 -5
  36. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +41 -5
  37. package/templates/.agents/skills/create-issue/config/verify.json +27 -0
  38. package/templates/.agents/skills/create-issue/reference/label-and-type.md +10 -11
  39. package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +10 -11
  40. package/templates/.agents/skills/create-pr/SKILL.md +59 -16
  41. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +59 -16
  42. package/templates/.agents/skills/create-pr/config/verify.json +26 -0
  43. package/templates/.agents/skills/create-pr/reference/branch-strategy.md +3 -3
  44. package/templates/.agents/skills/create-pr/reference/branch-strategy.zh-CN.md +3 -3
  45. package/templates/.agents/skills/{sync-pr → create-pr}/reference/comment-publish.md +6 -6
  46. package/templates/.agents/skills/{sync-pr → create-pr}/reference/comment-publish.zh-CN.md +10 -10
  47. package/templates/.agents/skills/create-pr/reference/pr-body-template.md +15 -6
  48. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +15 -6
  49. package/templates/.agents/skills/create-task/SKILL.md +25 -3
  50. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +25 -3
  51. package/templates/.agents/skills/create-task/config/verify.json +24 -0
  52. package/templates/.agents/skills/implement-task/SKILL.md +44 -8
  53. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +44 -8
  54. package/templates/.agents/skills/implement-task/config/verify.json +41 -0
  55. package/templates/.agents/skills/implement-task/reference/branch-management.md +48 -0
  56. package/templates/.agents/skills/implement-task/reference/branch-management.zh-CN.md +49 -0
  57. package/templates/.agents/skills/implement-task/reference/output-template.md +20 -0
  58. package/templates/.agents/skills/implement-task/reference/output-template.zh-CN.md +20 -0
  59. package/templates/.agents/skills/import-codescan/SKILL.md +18 -7
  60. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +18 -7
  61. package/templates/.agents/skills/import-codescan/config/verify.json +24 -0
  62. package/templates/.agents/skills/import-dependabot/SKILL.md +18 -7
  63. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +18 -7
  64. package/templates/.agents/skills/import-dependabot/config/verify.json +24 -0
  65. package/templates/.agents/skills/import-issue/SKILL.md +19 -1
  66. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +19 -1
  67. package/templates/.agents/skills/import-issue/config/verify.json +27 -0
  68. package/templates/.agents/skills/init-labels/SKILL.md +40 -10
  69. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +40 -10
  70. package/templates/.agents/skills/init-labels/scripts/init-labels.sh +1 -22
  71. package/templates/.agents/skills/init-milestones/SKILL.md +13 -0
  72. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +13 -0
  73. package/templates/.agents/skills/plan-task/SKILL.md +29 -75
  74. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +29 -75
  75. package/templates/.agents/skills/plan-task/config/verify.json +42 -0
  76. package/templates/.agents/skills/refine-task/SKILL.md +51 -4
  77. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +51 -4
  78. package/templates/.agents/skills/refine-task/config/verify.json +37 -0
  79. package/templates/.agents/skills/refine-title/SKILL.md +10 -2
  80. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +10 -2
  81. package/templates/.agents/skills/restore-task/SKILL.md +159 -0
  82. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +159 -0
  83. package/templates/.agents/skills/restore-task/config/verify.json +24 -0
  84. package/templates/.agents/skills/review-task/SKILL.md +25 -1
  85. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +25 -1
  86. package/templates/.agents/skills/review-task/config/verify.json +40 -0
  87. package/templates/.agents/skills/update-agent-infra/SKILL.md +11 -0
  88. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +11 -0
  89. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +8 -10
  90. package/templates/.claude/commands/archive-tasks.md +9 -0
  91. package/templates/.claude/commands/archive-tasks.zh-CN.md +9 -0
  92. package/templates/.claude/commands/create-pr.md +1 -1
  93. package/templates/.claude/commands/create-pr.zh-CN.md +1 -1
  94. package/templates/.claude/commands/restore-task.md +9 -0
  95. package/templates/.claude/commands/restore-task.zh-CN.md +9 -0
  96. package/templates/.gemini/commands/_project_/archive-tasks.toml +10 -0
  97. package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +10 -0
  98. package/templates/.gemini/commands/_project_/restore-task.toml +8 -0
  99. package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +8 -0
  100. package/templates/.github/workflows/status-label.yml +82 -0
  101. package/templates/.opencode/commands/archive-tasks.md +11 -0
  102. package/templates/.opencode/commands/archive-tasks.zh-CN.md +11 -0
  103. package/templates/.opencode/commands/restore-task.md +11 -0
  104. package/templates/.opencode/commands/restore-task.zh-CN.md +11 -0
  105. package/templates/.agents/skills/sync-issue/SKILL.md +0 -91
  106. package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +0 -91
  107. package/templates/.agents/skills/sync-issue/reference/comment-publish.md +0 -88
  108. package/templates/.agents/skills/sync-issue/reference/comment-publish.zh-CN.md +0 -88
  109. package/templates/.agents/skills/sync-issue/reference/delivery-detection.md +0 -42
  110. package/templates/.agents/skills/sync-issue/reference/delivery-detection.zh-CN.md +0 -42
  111. package/templates/.agents/skills/sync-issue/reference/label-sync.md +0 -63
  112. package/templates/.agents/skills/sync-issue/reference/label-sync.zh-CN.md +0 -63
  113. package/templates/.agents/skills/sync-issue/reference/milestone-sync.md +0 -37
  114. package/templates/.agents/skills/sync-issue/reference/milestone-sync.zh-CN.md +0 -37
  115. package/templates/.agents/skills/sync-pr/SKILL.md +0 -72
  116. package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +0 -72
  117. package/templates/.agents/skills/sync-pr/reference/delivery-detection.md +0 -54
  118. package/templates/.agents/skills/sync-pr/reference/delivery-detection.zh-CN.md +0 -54
  119. package/templates/.claude/CLAUDE.md +0 -138
  120. package/templates/.claude/CLAUDE.zh-CN.md +0 -138
  121. package/templates/.claude/commands/sync-issue.md +0 -8
  122. package/templates/.claude/commands/sync-issue.zh-CN.md +0 -8
  123. package/templates/.claude/commands/sync-pr.md +0 -8
  124. package/templates/.claude/commands/sync-pr.zh-CN.md +0 -8
  125. package/templates/.claude/project-rules.md +0 -65
  126. package/templates/.claude/project-rules.zh-CN.md +0 -65
  127. package/templates/.codex/README.md +0 -38
  128. package/templates/.codex/README.zh-CN.md +0 -37
  129. package/templates/.gemini/commands/_project_/sync-issue.toml +0 -8
  130. package/templates/.gemini/commands/_project_/sync-issue.zh-CN.toml +0 -8
  131. package/templates/.gemini/commands/_project_/sync-pr.toml +0 -8
  132. package/templates/.gemini/commands/_project_/sync-pr.zh-CN.toml +0 -8
  133. package/templates/.opencode/COMMAND_STYLE_GUIDE.md +0 -232
  134. package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +0 -232
  135. package/templates/.opencode/README.md +0 -76
  136. package/templates/.opencode/README.zh-CN.md +0 -77
  137. package/templates/.opencode/commands/sync-issue.md +0 -11
  138. package/templates/.opencode/commands/sync-issue.zh-CN.md +0 -11
  139. package/templates/.opencode/commands/sync-pr.md +0 -11
  140. package/templates/.opencode/commands/sync-pr.zh-CN.md +0 -11
  141. package/templates/AGENTS.md +0 -112
  142. package/templates/AGENTS.zh-CN.md +0 -112
package/README.md CHANGED
@@ -1,15 +1,25 @@
1
- # Agent Infra
1
+ <p align="center">
2
+ <img src="./assets/logo.svg" alt="Agent Infra Logo" width="200">
3
+ </p>
2
4
 
3
- [![npm version](https://img.shields.io/npm/v/@fitlab-ai/agent-infra)](https://www.npmjs.com/package/@fitlab-ai/agent-infra)
4
- [![npm downloads](https://img.shields.io/npm/dm/@fitlab-ai/agent-infra)](https://www.npmjs.com/package/@fitlab-ai/agent-infra)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](License.txt)
6
- [![Node.js >= 18](https://img.shields.io/badge/Node.js-%3E%3D18-brightgreen?logo=node.js)](https://nodejs.org/)
7
- [![GitHub release](https://img.shields.io/github/v/release/fitlab-ai/agent-infra)](https://github.com/fitlab-ai/agent-infra/releases)
8
- [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
5
+ <h1 align="center">Agent Infra</h1>
9
6
 
10
- The missing collaboration layer for AI coding agents — unified skills and workflows for Claude Code, Codex, Gemini CLI, and OpenCode.
7
+ <p align="center">
8
+ The missing collaboration layer for AI coding agents — unified skills and workflows for Claude Code, Codex, Gemini CLI, and OpenCode.
9
+ </p>
11
10
 
12
- **Semi-automated programming, powered by AI agents.** Define a requirement, let AI handle analysis, planning, coding, review, and delivery — you only step in when it matters.
11
+ <p align="center">
12
+ <strong>From issue to merged PR in 9 commands.</strong> Define a requirement, let AI handle analysis, planning, coding, review, and delivery — you only step in when it matters.
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://www.npmjs.com/package/@fitlab-ai/agent-infra"><img src="https://img.shields.io/npm/v/@fitlab-ai/agent-infra" alt="npm version"></a>
17
+ <a href="https://www.npmjs.com/package/@fitlab-ai/agent-infra"><img src="https://img.shields.io/npm/dm/@fitlab-ai/agent-infra" alt="npm downloads"></a>
18
+ <a href="License.txt"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
19
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node.js-%3E%3D18-brightgreen?logo=node.js" alt="Node.js >= 18"></a>
20
+ <a href="https://github.com/fitlab-ai/agent-infra/releases"><img src="https://img.shields.io/github/v/release/fitlab-ai/agent-infra" alt="GitHub release"></a>
21
+ <a href="CONTRIBUTING.md"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
22
+ </p>
13
23
 
14
24
  [中文版](README.zh-CN.md)
15
25
 
@@ -74,7 +84,7 @@ Just fix it at the application layer in LoginService.
74
84
 
75
85
  ```bash
76
86
  /commit
77
- /create-pr
87
+ /create-pr TASK-20260319-100000
78
88
  /complete-task TASK-20260319-100000
79
89
  ```
80
90
 
@@ -172,40 +182,30 @@ agent-infra is intentionally simple: a bootstrap CLI creates the seed configurat
172
182
  1. **Install** — `npm install -g @fitlab-ai/agent-infra` (or use the shell script wrapper)
173
183
  2. **Initialize** — `ai init` in the project root to generate `.agents/.airc.json` and install the seed command
174
184
  3. **Render** — run `update-agent-infra` in any AI TUI to detect the bundled template version and generate all managed files
175
- 4. **Develop** — use 28 built-in skills to drive the full lifecycle: `analysis → design → implementation → review → fix → commit`
185
+ 4. **Develop** — use built-in skills to drive the full lifecycle: `analysis → design → implementation → review → fix → commit`
176
186
  5. **Update** — run `update-agent-infra` again whenever a new template version is available
177
187
 
178
188
  ### Layered Architecture
179
189
 
180
- ```mermaid
181
- block-beta
182
- columns 4
183
-
184
- block:tui:4
185
- columns 4
186
- claude["Claude Code"] codex["Codex"] gemini["Gemini CLI"] opencode["OpenCode"]
187
- end
188
-
189
- space:4
190
-
191
- block:shared:4
192
- columns 3
193
- skills["28 Skills"] workflows["4 Workflows"] templates["Templates"]
194
- end
195
-
196
- space:4
197
-
198
- block:project:4
199
- columns 4
200
- agents[".agents/"] config[".agents/.airc.json"] workspace[".agents/workspace/"] governance["AGENTS.md"]
201
- end
202
-
203
- tui -- "slash commands" --> shared
204
- shared -- "renders into" --> project
190
+ ```text
191
+ ┌───────────────────────────────────────────────────────┐
192
+ │ AI TUI Layer │
193
+ │ Claude Code · Codex · Gemini CLI · OpenCode │
194
+ └──────────────────────────┬────────────────────────────┘
195
+ slash commands
196
+
197
+ ┌───────────────────────────────────────────────────────┐
198
+ │ Shared Layer │
199
+ │ Skills · Workflows · Templates │
200
+ └──────────────────────────┬────────────────────────────┘
201
+ │ renders into
202
+
203
+ ┌───────────────────────────────────────────────────────┐
204
+ │ Project Layer │
205
+ │ .agents/ · AGENTS.md │
206
+ └───────────────────────────────────────────────────────┘
205
207
  ```
206
208
 
207
- GitHub renders Mermaid diagrams natively. If a downstream renderer does not, the text above still explains the system structure.
208
-
209
209
  <a id="what-you-get"></a>
210
210
 
211
211
  ## What You Get
@@ -217,7 +217,7 @@ my-project/
217
217
  ├── .agents/ # Shared AI collaboration config
218
218
  │ ├── .airc.json # Central configuration
219
219
  │ ├── workspace/ # Task workspace (git-ignored)
220
- │ ├── skills/ # 28 built-in AI skills
220
+ │ ├── skills/ # Built-in AI skills
221
221
  │ ├── workflows/ # 4 prebuilt workflows
222
222
  │ └── templates/ # Task and artifact templates
223
223
  ├── .claude/ # Claude Code config and commands
@@ -230,7 +230,7 @@ my-project/
230
230
 
231
231
  ## Built-in AI Skills
232
232
 
233
- agent-infra ships with **28 built-in AI skills**. They are organized by use case, but they all share the same design goal: every AI TUI should be able to execute the same workflow vocabulary in the same repository.
233
+ agent-infra ships with **a rich set of built-in AI skills**. They are organized by use case, but they all share the same design goal: every AI TUI should be able to execute the same workflow vocabulary in the same repository.
234
234
 
235
235
  <a id="task-lifecycle"></a>
236
236
 
@@ -255,6 +255,7 @@ agent-infra ships with **28 built-in AI skills**. They are organized by use case
255
255
  |-------|-------------|------------|----------------------|
256
256
  | `check-task` | Inspect the current task status, workflow progress, and next step. | `task-id` | Check progress without modifying task state. |
257
257
  | `block-task` | Move a task to blocked state and record the blocker reason. | `task-id`, `reason` (optional) | Pause work when an external dependency or decision is missing. |
258
+ | `restore-task` | Restore local task files from GitHub Issue sync comments. | `issue-number`, `task-id` (optional) | Recover a task workspace after switching machines or clearing local state. |
258
259
 
259
260
  <a id="issue-and-pr"></a>
260
261
 
@@ -263,9 +264,7 @@ agent-infra ships with **28 built-in AI skills**. They are organized by use case
263
264
  | Skill | Description | Parameters | Recommended use case |
264
265
  |-------|-------------|------------|----------------------|
265
266
  | `create-issue` | Create a GitHub Issue from a task file. | `task-id` | Push a local task into GitHub tracking. |
266
- | `sync-issue` | Post task progress updates back to the linked GitHub Issue. | `task-id` or `issue-number` | Keep stakeholders updated as the task evolves. |
267
- | `create-pr` | Open a Pull Request to an inferred or explicit target branch. | `target-branch` (optional) | Publish reviewed changes for merge. |
268
- | `sync-pr` | Sync task progress and review metadata into the Pull Request. | `task-id` | Keep PR metadata aligned with the local task record. |
267
+ | `create-pr` | Open a Pull Request to an inferred or explicit target branch. | `task-id` (optional), `target-branch` (optional) | Publish reviewed changes for merge, with optional explicit task linkage after a fresh session. |
269
268
 
270
269
  <a id="code-quality"></a>
271
270
 
@@ -307,6 +306,7 @@ agent-infra ships with **28 built-in AI skills**. They are organized by use case
307
306
  | `refine-title` | Rewrite an Issue or PR title into Conventional Commits format. | `number` | Normalize inconsistent GitHub titles. |
308
307
  | `init-labels` | Initialize the repository's standard GitHub label set. | None | Bootstrap labels in a new repository. |
309
308
  | `init-milestones` | Initialize the repository's milestone structure. | None | Bootstrap milestone tracking in a new repository. |
309
+ | `archive-tasks` | Archive completed tasks into a date-organized directory with a manifest index. | `[--days N \| --before DATE \| TASK-ID...]` | Periodically clean up the `completed/` directory. |
310
310
  | `update-agent-infra` | Update the project's collaboration infrastructure to the latest template version. | None | Refresh shared AI tooling without rebuilding local conventions. |
311
311
 
312
312
  > Every skill works across supported AI TUIs. The command prefix changes, but the workflow semantics stay the same.
@@ -380,7 +380,7 @@ The generated `.agents/.airc.json` file is the central contract between the boot
380
380
  "project": "my-project",
381
381
  "org": "my-org",
382
382
  "language": "en",
383
- "templateVersion": "v0.4.1",
383
+ "templateVersion": "v0.4.3",
384
384
  "files": {
385
385
  "managed": [
386
386
  ".agents/workspace/README.md",
package/README.zh-CN.md CHANGED
@@ -1,15 +1,25 @@
1
- # Agent Infra
1
+ <p align="center">
2
+ <img src="./assets/logo.svg" alt="Agent Infra 标志" width="200">
3
+ </p>
2
4
 
3
- [![npm version](https://img.shields.io/npm/v/@fitlab-ai/agent-infra)](https://www.npmjs.com/package/@fitlab-ai/agent-infra)
4
- [![npm downloads](https://img.shields.io/npm/dm/@fitlab-ai/agent-infra)](https://www.npmjs.com/package/@fitlab-ai/agent-infra)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](License.txt)
6
- [![Node.js >= 18](https://img.shields.io/badge/Node.js-%3E%3D18-brightgreen?logo=node.js)](https://nodejs.org/)
7
- [![GitHub release](https://img.shields.io/github/v/release/fitlab-ai/agent-infra)](https://github.com/fitlab-ai/agent-infra/releases)
8
- [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
5
+ <h1 align="center">Agent Infra</h1>
9
6
 
10
- AI 编程代理之间缺失的协作层 —— 为 Claude Code、Codex、Gemini CLI、OpenCode 提供统一的 skills 和工作流。
7
+ <p align="center">
8
+ AI 编程代理之间缺失的协作层 —— 为 Claude Code、Codex、Gemini CLI、OpenCode 提供统一的 skills 和工作流。
9
+ </p>
11
10
 
12
- **AI Agent 半自动化编程神器。** 定义需求,让 AI 完成分析、方案设计、编码、审查和交付 —— 你只需在关键节点介入。
11
+ <p align="center">
12
+ <strong>从 Issue 到合并 PR,只需 9 条命令。</strong> 定义需求,让 AI 完成分析、方案设计、编码、审查和交付 —— 你只需在关键节点介入。
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://www.npmjs.com/package/@fitlab-ai/agent-infra"><img src="https://img.shields.io/npm/v/@fitlab-ai/agent-infra" alt="npm version"></a>
17
+ <a href="https://www.npmjs.com/package/@fitlab-ai/agent-infra"><img src="https://img.shields.io/npm/dm/@fitlab-ai/agent-infra" alt="npm downloads"></a>
18
+ <a href="License.txt"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
19
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node.js-%3E%3D18-brightgreen?logo=node.js" alt="Node.js >= 18"></a>
20
+ <a href="https://github.com/fitlab-ai/agent-infra/releases"><img src="https://img.shields.io/github/v/release/fitlab-ai/agent-infra" alt="GitHub release"></a>
21
+ <a href="CONTRIBUTING.md"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome"></a>
22
+ </p>
13
23
 
14
24
  [English](README.md)
15
25
 
@@ -74,7 +84,7 @@ agent-infra 的目标就是把这层协作面标准化。它为所有支持的 A
74
84
 
75
85
  ```bash
76
86
  /commit
77
- /create-pr
87
+ /create-pr TASK-20260319-100000
78
88
  /complete-task TASK-20260319-100000
79
89
  ```
80
90
 
@@ -172,40 +182,30 @@ agent-infra 的结构刻意保持简单:引导 CLI 负责生成种子配置,
172
182
  1. **安装** — `npm install -g @fitlab-ai/agent-infra`(或使用 shell 脚本便捷封装)
173
183
  2. **初始化** — 在项目根目录运行 `ai init`,生成 `.agents/.airc.json` 并安装种子命令
174
184
  3. **渲染** — 在任意 AI TUI 中执行 `update-agent-infra`,检测当前打包模板版本并生成所有受管理文件
175
- 4. **开发** — 使用 28 个内置 skill 驱动完整生命周期:`analysis → design → implementation → review → fix → commit`
185
+ 4. **开发** — 使用内置 skill 驱动完整生命周期:`analysis → design → implementation → review → fix → commit`
176
186
  5. **升级** — 有新模板版本时再次执行 `update-agent-infra` 即可
177
187
 
178
188
  ### 分层架构
179
189
 
180
- ```mermaid
181
- block-beta
182
- columns 4
183
-
184
- block:tui:4
185
- columns 4
186
- claude["Claude Code"] codex["Codex"] gemini["Gemini CLI"] opencode["OpenCode"]
187
- end
188
-
189
- space:4
190
-
191
- block:shared:4
192
- columns 3
193
- skills["28 Skills"] workflows["4 Workflows"] templates["Templates"]
194
- end
195
-
196
- space:4
197
-
198
- block:project:4
199
- columns 4
200
- agents[".agents/"] config[".agents/.airc.json"] workspace[".agents/workspace/"] governance["AGENTS.md"]
201
- end
202
-
203
- tui -- "slash commands" --> shared
204
- shared -- "renders into" --> project
190
+ ```text
191
+ ┌───────────────────────────────────────────────────────┐
192
+ │ AI TUI Layer │
193
+ │ Claude Code · Codex · Gemini CLI · OpenCode │
194
+ └──────────────────────────┬────────────────────────────┘
195
+ slash 命令
196
+
197
+ ┌───────────────────────────────────────────────────────┐
198
+ │ Shared Layer │
199
+ │ Skills · Workflows · Templates │
200
+ └──────────────────────────┬────────────────────────────┘
201
+ │ 渲染为
202
+
203
+ ┌───────────────────────────────────────────────────────┐
204
+ │ Project Layer │
205
+ │ .agents/ · AGENTS.md │
206
+ └───────────────────────────────────────────────────────┘
205
207
  ```
206
208
 
207
- GitHub 原生支持 Mermaid 渲染。即使某些下游渲染器不支持,上方文字也足以传达系统结构。
208
-
209
209
  <a id="what-you-get"></a>
210
210
 
211
211
  ## 安装效果
@@ -217,7 +217,7 @@ my-project/
217
217
  ├── .agents/ # 共享 AI 协作配置
218
218
  │ ├── .airc.json # 中央配置文件
219
219
  │ ├── workspace/ # 任务工作区(git 忽略)
220
- │ ├── skills/ # 28 个内置 AI skills
220
+ │ ├── skills/ # 内置 AI skills
221
221
  │ ├── workflows/ # 4 个预置工作流
222
222
  │ └── templates/ # 任务与产物模板
223
223
  ├── .claude/ # Claude Code 配置与命令
@@ -230,7 +230,7 @@ my-project/
230
230
 
231
231
  ## 内置 AI Skills
232
232
 
233
- agent-infra 内置 **28 AI skills**。它们按使用场景分组,但共享同一个核心目标:无论使用哪种 AI TUI,都能在同一仓库里执行相同的工作流词汇和协作约定。
233
+ agent-infra 提供 **丰富的内置 AI skills**。它们按使用场景分组,但共享同一个核心目标:无论使用哪种 AI TUI,都能在同一仓库里执行相同的工作流词汇和协作约定。
234
234
 
235
235
  <a id="task-lifecycle"></a>
236
236
 
@@ -255,6 +255,7 @@ agent-infra 内置 **28 个 AI skills**。它们按使用场景分组,但共
255
255
  |-------|------|------|---------|
256
256
  | `check-task` | 查看当前任务状态、工作流进度和下一步建议。 | `task-id` | 不修改任务状态,仅检查当前进展。 |
257
257
  | `block-task` | 将任务标记为阻塞并记录阻塞原因。 | `task-id`、`reason`(可选) | 缺少外部依赖、决策或资源时暂停任务。 |
258
+ | `restore-task` | 从 GitHub Issue 同步评论中还原本地任务文件。 | `issue-number`、`task-id`(可选) | 换机器或清空本地状态后恢复任务工作区。 |
258
259
 
259
260
  <a id="issue-and-pr"></a>
260
261
 
@@ -263,9 +264,7 @@ agent-infra 内置 **28 个 AI skills**。它们按使用场景分组,但共
263
264
  | Skill | 描述 | 参数 | 推荐场景 |
264
265
  |-------|------|------|---------|
265
266
  | `create-issue` | 根据任务文件创建 GitHub Issue。 | `task-id` | 需要把本地任务同步到 GitHub 跟踪时。 |
266
- | `sync-issue` | 将任务进度同步回关联的 GitHub Issue。 | `task-id` 或 `issue-number` | 任务推进过程中持续同步状态。 |
267
- | `create-pr` | 向推断出的目标分支或显式指定分支创建 Pull Request。 | `target-branch`(可选) | 变更准备合入时创建 PR。 |
268
- | `sync-pr` | 将任务进度和审查元数据同步到 Pull Request。 | `task-id` | 让 PR 元数据与本地任务记录保持一致。 |
267
+ | `create-pr` | 向推断出的目标分支或显式指定分支创建 Pull Request。 | `task-id`(可选)、`target-branch`(可选) | 变更准备合入时创建 PR;清空上下文后也可显式传入任务关联。 |
269
268
 
270
269
  <a id="code-quality"></a>
271
270
 
@@ -307,6 +306,7 @@ agent-infra 内置 **28 个 AI skills**。它们按使用场景分组,但共
307
306
  | `refine-title` | 将 Issue 或 PR 标题重构为 Conventional Commits 格式。 | `number` | GitHub 标题格式不规范时。 |
308
307
  | `init-labels` | 初始化仓库标准 GitHub labels 体系。 | 无 | 新仓库首次配置 labels 时。 |
309
308
  | `init-milestones` | 初始化仓库 milestones 结构。 | 无 | 新仓库首次建立里程碑时。 |
309
+ | `archive-tasks` | 将已完成任务按日期归档到目录中,并生成 `manifest` 索引。 | `[--days N \| --before DATE \| TASK-ID...]` | 需要定期清理 `completed/` 目录时。 |
310
310
  | `update-agent-infra` | 将项目协作基础设施升级到最新模板版本。 | 无 | 需要刷新共享 AI 工具层时。 |
311
311
 
312
312
  > 所有 skills 都可跨支持的 AI TUI 复用。变化的只是命令前缀,工作流语义保持一致。
@@ -380,7 +380,7 @@ import-issue #42 从 GitHub Issue 导入任务
380
380
  "project": "my-project",
381
381
  "org": "my-org",
382
382
  "language": "en",
383
- "templateVersion": "v0.4.1",
383
+ "templateVersion": "v0.4.3",
384
384
  "files": {
385
385
  "managed": [
386
386
  ".agents/workspace/README.md",
package/lib/defaults.json CHANGED
@@ -1,7 +1,13 @@
1
1
  {
2
+ "labels": {
3
+ "in": {}
4
+ },
2
5
  "files": {
3
6
  "managed": [
7
+ ".agents/QUICKSTART.md",
8
+ ".agents/README.md",
4
9
  ".agents/skills/",
10
+ ".agents/scripts/",
5
11
  ".agents/templates/",
6
12
  ".agents/workflows/",
7
13
  ".agents/workspace/README.md",
@@ -16,22 +22,14 @@
16
22
  "**/test-integration.*",
17
23
  "**/test.*",
18
24
  "**/upgrade-dependency.*",
19
- ".agents/QUICKSTART.md",
20
- ".agents/README.md",
21
25
  ".agents/skills/release/SKILL.*",
22
26
  ".agents/skills/test-integration/SKILL.*",
23
27
  ".agents/skills/test/SKILL.*",
24
28
  ".agents/skills/upgrade-dependency/SKILL.*",
25
- ".claude/CLAUDE.md",
26
- ".claude/project-rules.md",
27
29
  ".claude/settings.json",
28
- ".codex/README.md",
29
30
  ".gemini/settings.json",
30
31
  ".github/hooks/pre-commit",
31
- ".gitignore",
32
- ".opencode/COMMAND_STYLE_GUIDE.md",
33
- ".opencode/README.md",
34
- "AGENTS.md"
32
+ ".gitignore"
35
33
  ],
36
34
  "ejected": []
37
35
  }
package/lib/init.js CHANGED
@@ -162,6 +162,7 @@ async function cmdInit() {
162
162
  org: orgName,
163
163
  language,
164
164
  templateVersion: VERSION,
165
+ labels: structuredClone(defaults.labels),
165
166
  files: structuredClone(defaults.files)
166
167
  };
167
168
 
package/lib/update.js CHANGED
@@ -139,8 +139,15 @@ async function cmdUpdate() {
139
139
  // sync file registry
140
140
  const { added, changed } = syncFileRegistry(config);
141
141
  const hasNewEntries = added.managed.length > 0 || added.merged.length > 0;
142
+ const labelsAdded = !config.labels;
143
+ let configChanged = changed;
142
144
 
143
- if (changed) {
145
+ if (labelsAdded) {
146
+ config.labels = structuredClone(defaults.labels);
147
+ configChanged = true;
148
+ }
149
+
150
+ if (configChanged) {
144
151
  console.log('');
145
152
  if (hasNewEntries) {
146
153
  info(`New file entries synced to ${CONFIG_PATH}:`);
@@ -150,9 +157,14 @@ async function cmdUpdate() {
150
157
  for (const entry of added.merged) {
151
158
  ok(` merged: ${entry}`);
152
159
  }
160
+ } else if (labelsAdded) {
161
+ info(`Default labels.in config added to ${CONFIG_PATH}.`);
153
162
  } else {
154
163
  info(`File registry changed in ${CONFIG_PATH}.`);
155
164
  }
165
+ if (hasNewEntries && labelsAdded) {
166
+ info(`Default labels.in config added to ${CONFIG_PATH}.`);
167
+ }
156
168
  fs.writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2) + '\n', 'utf8');
157
169
  ok(`Updated ${CONFIG_PATH}`);
158
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fitlab-ai/agent-infra",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Bootstrap tool for AI multi-tool collaboration infrastructure — works with Claude Code, Codex, Gemini CLI, and OpenCode",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -43,7 +43,7 @@
43
43
  "scripts": {
44
44
  "build": "node scripts/build-inline.js",
45
45
  "prepare": "git config core.hooksPath .github/hooks || true",
46
- "test": "node scripts/build-inline.js --check && node --test tests/*.test.js",
47
- "prepublishOnly": "node scripts/build-inline.js --check && node --test tests/*.test.js"
46
+ "test": "node scripts/build-inline.js --check && node --test tests/cli/*.test.js tests/templates/*.test.js tests/core/*.test.js",
47
+ "prepublishOnly": "node scripts/build-inline.js --check && node --test tests/cli/*.test.js tests/templates/*.test.js tests/core/*.test.js"
48
48
  }
49
49
  }
@@ -4,7 +4,7 @@ This guide walks you through using multiple AI coding assistants together on a p
4
4
 
5
5
  ## Prerequisites
6
6
 
7
- - At least one AI coding tool installed (Claude Code, Codex CLI, Gemini CLI, or Cursor)
7
+ - At least one AI coding tool installed (Claude Code, Codex CLI, Gemini CLI, or OpenCode)
8
8
  - A project with `.agents/` directory set up (this project)
9
9
  - Familiarity with your project's codebase
10
10
 
@@ -32,7 +32,7 @@ cp .agents/templates/task.md .agents/workspace/active/task-001.md
32
32
  id: task-001
33
33
  type: feature # feature | bugfix | refactor | docs | review
34
34
  status: open # open | in-progress | review | blocked | completed
35
- assigned_to: claude # claude | codex | gemini | cursor | human
35
+ assigned_to: claude # claude | codex | gemini | opencode | human
36
36
  ```
37
37
 
38
38
  3. Describe the task in the body of the document.
@@ -63,7 +63,7 @@ gemini
63
63
  # create a technical design. Define interfaces and outline the approach."
64
64
  ```
65
65
 
66
- ### Phase 3: Implementation (Recommended: Codex CLI or Cursor)
66
+ ### Phase 3: Implementation (Recommended: Codex CLI or OpenCode)
67
67
 
68
68
  ```bash
69
69
  # Switch to Codex CLI for implementation
@@ -91,7 +91,7 @@ claude
91
91
  ### Bug Fix
92
92
 
93
93
  1. **Reproduce & Analyze** (Claude Code): Identify the root cause.
94
- 2. **Implement Fix** (Codex CLI / Cursor): Write the fix and tests.
94
+ 2. **Implement Fix** (Codex CLI / OpenCode): Write the fix and tests.
95
95
  3. **Review** (Claude Code): Verify the fix is correct and complete.
96
96
  4. **Commit**: Create PR with bug fix description.
97
97
 
@@ -100,7 +100,7 @@ claude
100
100
  cp .agents/templates/task.md .agents/workspace/active/bugfix-001.md
101
101
  # Edit the task, then:
102
102
  # 1. Use Claude Code to analyze
103
- # 2. Use Codex/Cursor to fix
103
+ # 2. Use Codex/OpenCode to fix
104
104
  # 3. Use Claude Code to review
105
105
  ```
106
106
 
@@ -119,7 +119,7 @@ cp .agents/templates/review-report.md .agents/workspace/active/review-pr-42.md
119
119
 
120
120
  1. **Analyze Scope** (Claude Code / Gemini CLI): Map all affected areas.
121
121
  2. **Design** (Claude Code): Plan the refactoring approach.
122
- 3. **Implement** (Codex CLI / Cursor): Execute the refactoring.
122
+ 3. **Implement** (Codex CLI / OpenCode): Execute the refactoring.
123
123
  4. **Verify** (Claude Code): Ensure no regressions, run tests.
124
124
 
125
125
  ```bash
@@ -156,7 +156,7 @@ Even if you're switching between AIs quickly, a brief handoff note saves time an
156
156
  ### 3. Use the Right Tool for the Job
157
157
 
158
158
  - Complex analysis? Use Claude Code or Gemini CLI.
159
- - Straightforward implementation? Use Codex CLI or Cursor.
159
+ - Straightforward implementation? Use Codex CLI or OpenCode.
160
160
  - Large file review? Use Gemini CLI.
161
161
 
162
162
  ### 4. Keep Tasks Small
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 前提条件
6
6
 
7
- - 至少安装一个 AI 编程工具(Claude Code、Codex CLI、Gemini CLI 或 Cursor
7
+ - 至少安装一个 AI 编程工具(Claude Code、Codex CLI、Gemini CLI 或 OpenCode
8
8
  - 项目已设置 `.agents/` 目录(本项目已就绪)
9
9
  - 熟悉你的项目代码库
10
10
 
@@ -23,7 +23,7 @@ git config core.hooksPath .github/hooks
23
23
  1. 将任务模板复制到活跃工作区:
24
24
 
25
25
  ```bash
26
- cp .agents/templates/task.zh-CN.md .agents/workspace/active/task-001.md
26
+ cp .agents/templates/task.md .agents/workspace/active/task-001.md
27
27
  ```
28
28
 
29
29
  2. 填写任务元数据:
@@ -32,7 +32,7 @@ cp .agents/templates/task.zh-CN.md .agents/workspace/active/task-001.md
32
32
  id: task-001
33
33
  type: feature # feature | bugfix | refactor | docs | review
34
34
  status: open # open | in-progress | review | blocked | completed
35
- assigned_to: claude # claude | codex | gemini | cursor | human
35
+ assigned_to: claude # claude | codex | gemini | opencode | human
36
36
  ```
37
37
 
38
38
  3. 在文档正文中描述任务。
@@ -63,7 +63,7 @@ gemini
63
63
  # 创建技术设计方案。定义接口并概述实现思路。"
64
64
  ```
65
65
 
66
- ### 阶段 3:实现(推荐:Codex CLI 或 Cursor
66
+ ### 阶段 3:实现(推荐:Codex CLI 或 OpenCode
67
67
 
68
68
  ```bash
69
69
  # 切换到 Codex CLI 进行实现
@@ -91,16 +91,16 @@ claude
91
91
  ### 缺陷修复
92
92
 
93
93
  1. **复现和分析**(Claude Code):识别根本原因。
94
- 2. **实现修复**(Codex CLI / Cursor):编写修复代码和测试。
94
+ 2. **实现修复**(Codex CLI / OpenCode):编写修复代码和测试。
95
95
  3. **审查**(Claude Code):验证修复是否正确和完整。
96
96
  4. **提交**:创建包含缺陷修复描述的 PR。
97
97
 
98
98
  ```bash
99
99
  # 快速缺陷修复工作流
100
- cp .agents/templates/task.zh-CN.md .agents/workspace/active/bugfix-001.md
100
+ cp .agents/templates/task.md .agents/workspace/active/bugfix-001.md
101
101
  # 编辑任务,然后:
102
102
  # 1. 使用 Claude Code 分析
103
- # 2. 使用 Codex/Cursor 修复
103
+ # 2. 使用 Codex/OpenCode 修复
104
104
  # 3. 使用 Claude Code 审查
105
105
  ```
106
106
 
@@ -111,7 +111,7 @@ cp .agents/templates/task.zh-CN.md .agents/workspace/active/bugfix-001.md
111
111
  3. **报告**:从模板生成审查报告。
112
112
 
113
113
  ```bash
114
- cp .agents/templates/review-report.zh-CN.md .agents/workspace/active/review-pr-42.md
114
+ cp .agents/templates/review-report.md .agents/workspace/active/review-pr-42.md
115
115
  # 使用 Claude Code 填写审查内容
116
116
  ```
117
117
 
@@ -119,12 +119,12 @@ cp .agents/templates/review-report.zh-CN.md .agents/workspace/active/review-pr-4
119
119
 
120
120
  1. **分析范围**(Claude Code / Gemini CLI):映射所有受影响区域。
121
121
  2. **设计**(Claude Code):规划重构方案。
122
- 3. **实现**(Codex CLI / Cursor):执行重构。
122
+ 3. **实现**(Codex CLI / OpenCode):执行重构。
123
123
  4. **验证**(Claude Code):确保没有回归问题,运行测试。
124
124
 
125
125
  ```bash
126
- cp .agents/templates/task.zh-CN.md .agents/workspace/active/refactor-001.md
127
- # 按照 .agents/workflows/refactoring.zh-CN.yaml 中的重构工作流执行
126
+ cp .agents/templates/task.md .agents/workspace/active/refactor-001.md
127
+ # 按照 .agents/workflows/refactoring.yaml 中的重构工作流执行
128
128
  ```
129
129
 
130
130
  ## 创建交接文档
@@ -132,7 +132,7 @@ cp .agents/templates/task.zh-CN.md .agents/workspace/active/refactor-001.md
132
132
  在 AI 工具之间切换时,创建交接文档:
133
133
 
134
134
  ```bash
135
- cp .agents/templates/handoff.zh-CN.md .agents/workspace/active/handoff-task-001-phase2.md
135
+ cp .agents/templates/handoff.md .agents/workspace/active/handoff-task-001-phase2.md
136
136
  ```
137
137
 
138
138
  填写:
@@ -156,7 +156,7 @@ cp .agents/templates/handoff.zh-CN.md .agents/workspace/active/handoff-task-001-
156
156
  ### 3. 选择合适的工具
157
157
 
158
158
  - 复杂分析?使用 Claude Code 或 Gemini CLI。
159
- - 直接的实现工作?使用 Codex CLI 或 Cursor
159
+ - 直接的实现工作?使用 Codex CLI 或 OpenCode
160
160
  - 大文件审查?使用 Gemini CLI。
161
161
 
162
162
  ### 4. 保持任务小而精