@fitlab-ai/agent-infra 0.4.1 → 0.4.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.
- package/README.md +23 -13
- package/README.zh-CN.md +23 -13
- package/lib/defaults.json +3 -9
- package/package.json +1 -1
- package/templates/.agents/QUICKSTART.md +7 -7
- package/templates/.agents/QUICKSTART.zh-CN.md +13 -13
- package/templates/.agents/README.md +15 -16
- package/templates/.agents/README.zh-CN.md +17 -18
- package/templates/.agents/skills/commit/reference/task-status-update.md +3 -3
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +3 -3
- package/templates/.agents/skills/create-pr/SKILL.md +20 -11
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +20 -11
- package/templates/.agents/skills/create-task/SKILL.md +1 -1
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/implement-task/SKILL.md +1 -0
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +1 -0
- package/templates/.agents/skills/import-issue/SKILL.md +1 -0
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +1 -0
- package/templates/.agents/skills/refine-task/SKILL.md +4 -2
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +4 -2
- package/templates/.agents/skills/sync-issue/SKILL.md +14 -12
- package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +14 -12
- package/templates/.agents/skills/sync-issue/reference/comment-publish.md +0 -4
- package/templates/.agents/skills/sync-issue/reference/comment-publish.zh-CN.md +0 -4
- package/templates/.agents/skills/sync-issue/reference/label-sync.md +4 -5
- package/templates/.agents/skills/sync-issue/reference/label-sync.zh-CN.md +4 -5
- package/templates/.agents/skills/sync-pr/SKILL.md +26 -11
- package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +26 -11
- package/templates/.agents/skills/sync-pr/reference/comment-publish.zh-CN.md +4 -4
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +4 -10
- package/templates/.claude/commands/create-pr.md +1 -1
- package/templates/.claude/commands/create-pr.zh-CN.md +1 -1
- package/templates/.claude/commands/sync-pr.md +1 -1
- package/templates/.claude/commands/sync-pr.zh-CN.md +1 -1
- package/templates/.gemini/commands/_project_/sync-pr.toml +1 -1
- package/templates/.gemini/commands/_project_/sync-pr.zh-CN.toml +1 -1
- package/templates/.opencode/commands/sync-pr.md +1 -1
- package/templates/.opencode/commands/sync-pr.zh-CN.md +1 -1
- package/templates/.agents/skills/sync-issue/reference/delivery-detection.md +0 -42
- package/templates/.agents/skills/sync-issue/reference/delivery-detection.zh-CN.md +0 -42
- package/templates/.claude/CLAUDE.md +0 -138
- package/templates/.claude/CLAUDE.zh-CN.md +0 -138
- package/templates/.claude/project-rules.md +0 -65
- package/templates/.claude/project-rules.zh-CN.md +0 -65
- package/templates/.codex/README.md +0 -38
- package/templates/.codex/README.zh-CN.md +0 -37
- package/templates/.opencode/COMMAND_STYLE_GUIDE.md +0 -232
- package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +0 -232
- package/templates/.opencode/README.md +0 -76
- package/templates/.opencode/README.zh-CN.md +0 -77
- package/templates/AGENTS.md +0 -112
- package/templates/AGENTS.zh-CN.md +0 -112
package/README.md
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./assets/logo.svg" alt="Agent Infra Logo" width="200">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/@fitlab-ai/agent-infra)
|
|
5
|
-
[](License.txt)
|
|
6
|
-
[](https://nodejs.org/)
|
|
7
|
-
[](https://github.com/fitlab-ai/agent-infra/releases)
|
|
8
|
-
[](CONTRIBUTING.md)
|
|
5
|
+
<h1 align="center">Agent Infra</h1>
|
|
9
6
|
|
|
10
|
-
|
|
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
|
-
|
|
11
|
+
<p align="center">
|
|
12
|
+
<strong>Semi-automated programming, powered by AI agents.</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
|
|
|
@@ -264,8 +274,8 @@ agent-infra ships with **28 built-in AI skills**. They are organized by use case
|
|
|
264
274
|
|-------|-------------|------------|----------------------|
|
|
265
275
|
| `create-issue` | Create a GitHub Issue from a task file. | `task-id` | Push a local task into GitHub tracking. |
|
|
266
276
|
| `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. |
|
|
277
|
+
| `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. |
|
|
278
|
+
| `sync-pr` | Sync task progress and review metadata into the Pull Request. | `task-id` or `pr-number` | Keep PR metadata aligned with the local task record from either task or PR entrypoints. |
|
|
269
279
|
|
|
270
280
|
<a id="code-quality"></a>
|
|
271
281
|
|
|
@@ -380,7 +390,7 @@ The generated `.agents/.airc.json` file is the central contract between the boot
|
|
|
380
390
|
"project": "my-project",
|
|
381
391
|
"org": "my-org",
|
|
382
392
|
"language": "en",
|
|
383
|
-
"templateVersion": "v0.4.
|
|
393
|
+
"templateVersion": "v0.4.2",
|
|
384
394
|
"files": {
|
|
385
395
|
"managed": [
|
|
386
396
|
".agents/workspace/README.md",
|
package/README.zh-CN.md
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./assets/logo.svg" alt="Agent Infra 标志" width="200">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/@fitlab-ai/agent-infra)
|
|
5
|
-
[](License.txt)
|
|
6
|
-
[](https://nodejs.org/)
|
|
7
|
-
[](https://github.com/fitlab-ai/agent-infra/releases)
|
|
8
|
-
[](CONTRIBUTING.md)
|
|
5
|
+
<h1 align="center">Agent Infra</h1>
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
AI 编程代理之间缺失的协作层 —— 为 Claude Code、Codex、Gemini CLI、OpenCode 提供统一的 skills 和工作流。
|
|
9
|
+
</p>
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
<p align="center">
|
|
12
|
+
<strong>AI Agent 半自动化编程神器。</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
|
|
|
@@ -264,8 +274,8 @@ agent-infra 内置 **28 个 AI skills**。它们按使用场景分组,但共
|
|
|
264
274
|
|-------|------|------|---------|
|
|
265
275
|
| `create-issue` | 根据任务文件创建 GitHub Issue。 | `task-id` | 需要把本地任务同步到 GitHub 跟踪时。 |
|
|
266
276
|
| `sync-issue` | 将任务进度同步回关联的 GitHub Issue。 | `task-id` 或 `issue-number` | 任务推进过程中持续同步状态。 |
|
|
267
|
-
| `create-pr` | 向推断出的目标分支或显式指定分支创建 Pull Request。 | `target-branch`(可选) | 变更准备合入时创建 PR
|
|
268
|
-
| `sync-pr` | 将任务进度和审查元数据同步到 Pull Request。 | `task-id` |
|
|
277
|
+
| `create-pr` | 向推断出的目标分支或显式指定分支创建 Pull Request。 | `task-id`(可选)、`target-branch`(可选) | 变更准备合入时创建 PR;清空上下文后也可显式传入任务关联。 |
|
|
278
|
+
| `sync-pr` | 将任务进度和审查元数据同步到 Pull Request。 | `task-id` 或 `pr-number` | 允许从任务入口或 PR 入口同步,让 PR 元数据与本地任务记录保持一致。 |
|
|
269
279
|
|
|
270
280
|
<a id="code-quality"></a>
|
|
271
281
|
|
|
@@ -380,7 +390,7 @@ import-issue #42 从 GitHub Issue 导入任务
|
|
|
380
390
|
"project": "my-project",
|
|
381
391
|
"org": "my-org",
|
|
382
392
|
"language": "en",
|
|
383
|
-
"templateVersion": "v0.4.
|
|
393
|
+
"templateVersion": "v0.4.2",
|
|
384
394
|
"files": {
|
|
385
395
|
"managed": [
|
|
386
396
|
".agents/workspace/README.md",
|
package/lib/defaults.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
3
|
"managed": [
|
|
4
|
+
".agents/QUICKSTART.md",
|
|
5
|
+
".agents/README.md",
|
|
4
6
|
".agents/skills/",
|
|
5
7
|
".agents/templates/",
|
|
6
8
|
".agents/workflows/",
|
|
@@ -16,22 +18,14 @@
|
|
|
16
18
|
"**/test-integration.*",
|
|
17
19
|
"**/test.*",
|
|
18
20
|
"**/upgrade-dependency.*",
|
|
19
|
-
".agents/QUICKSTART.md",
|
|
20
|
-
".agents/README.md",
|
|
21
21
|
".agents/skills/release/SKILL.*",
|
|
22
22
|
".agents/skills/test-integration/SKILL.*",
|
|
23
23
|
".agents/skills/test/SKILL.*",
|
|
24
24
|
".agents/skills/upgrade-dependency/SKILL.*",
|
|
25
|
-
".claude/CLAUDE.md",
|
|
26
|
-
".claude/project-rules.md",
|
|
27
25
|
".claude/settings.json",
|
|
28
|
-
".codex/README.md",
|
|
29
26
|
".gemini/settings.json",
|
|
30
27
|
".github/hooks/pre-commit",
|
|
31
|
-
".gitignore"
|
|
32
|
-
".opencode/COMMAND_STYLE_GUIDE.md",
|
|
33
|
-
".opencode/README.md",
|
|
34
|
-
"AGENTS.md"
|
|
28
|
+
".gitignore"
|
|
35
29
|
],
|
|
36
30
|
"ejected": []
|
|
37
31
|
}
|
package/package.json
CHANGED
|
@@ -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
|
|
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 |
|
|
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
|
|
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 /
|
|
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/
|
|
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 /
|
|
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
|
|
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 或
|
|
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.
|
|
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 |
|
|
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 或
|
|
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 /
|
|
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.
|
|
100
|
+
cp .agents/templates/task.md .agents/workspace/active/bugfix-001.md
|
|
101
101
|
# 编辑任务,然后:
|
|
102
102
|
# 1. 使用 Claude Code 分析
|
|
103
|
-
# 2. 使用 Codex/
|
|
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.
|
|
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 /
|
|
122
|
+
3. **实现**(Codex CLI / OpenCode):执行重构。
|
|
123
123
|
4. **验证**(Claude Code):确保没有回归问题,运行测试。
|
|
124
124
|
|
|
125
125
|
```bash
|
|
126
|
-
cp .agents/templates/task.
|
|
127
|
-
# 按照 .agents/workflows/refactoring.
|
|
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.
|
|
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 或
|
|
159
|
+
- 直接的实现工作?使用 Codex CLI 或 OpenCode。
|
|
160
160
|
- 大文件审查?使用 Gemini CLI。
|
|
161
161
|
|
|
162
162
|
### 4. 保持任务小而精
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Multi-AI Collaboration Guide
|
|
2
2
|
|
|
3
|
-
This project supports collaboration across multiple AI coding assistants, including Claude Code, OpenAI Codex CLI, Gemini CLI,
|
|
3
|
+
This project supports collaboration across multiple AI coding assistants, including Claude Code, OpenAI Codex CLI, Gemini CLI, OpenCode, and others.
|
|
4
4
|
|
|
5
5
|
## Dual-Config Architecture
|
|
6
6
|
|
|
@@ -8,10 +8,10 @@ Different AI tools read configuration from different locations:
|
|
|
8
8
|
|
|
9
9
|
| AI Tool | Primary Config | Fallback |
|
|
10
10
|
|---------|---------------|----------|
|
|
11
|
-
| Claude Code | `.claude/` (CLAUDE.md, commands/, settings
|
|
11
|
+
| Claude Code | `.claude/` (CLAUDE.md, commands/, settings.json) | - |
|
|
12
12
|
| OpenAI Codex CLI | `AGENTS.md` | - |
|
|
13
13
|
| Gemini CLI | `AGENTS.md` | - |
|
|
14
|
-
|
|
|
14
|
+
| OpenCode | `AGENTS.md` | - |
|
|
15
15
|
| Other AI Tools | `AGENTS.md` | Project README |
|
|
16
16
|
|
|
17
17
|
- **Claude Code** uses its dedicated `.claude/` directory for project instructions, slash commands, and settings.
|
|
@@ -23,10 +23,8 @@ This dual-config approach ensures every AI tool receives appropriate project con
|
|
|
23
23
|
|
|
24
24
|
```
|
|
25
25
|
.agents/ # AI collaboration config (version-controlled)
|
|
26
|
-
README.md #
|
|
27
|
-
README.zh-CN.md # Chinese version
|
|
26
|
+
README.md # Collaboration guide
|
|
28
27
|
QUICKSTART.md # Quick start guide
|
|
29
|
-
QUICKSTART.zh-CN.md # Quick start guide (Chinese)
|
|
30
28
|
templates/ # Task and document templates
|
|
31
29
|
task.md # Task template
|
|
32
30
|
handoff.md # AI-to-AI handoff template
|
|
@@ -45,7 +43,7 @@ This dual-config approach ensures every AI tool receives appropriate project con
|
|
|
45
43
|
.claude/ # Claude Code specific config
|
|
46
44
|
CLAUDE.md # Project instructions for Claude
|
|
47
45
|
commands/ # Slash commands
|
|
48
|
-
settings
|
|
46
|
+
settings.json # Claude settings
|
|
49
47
|
```
|
|
50
48
|
|
|
51
49
|
## Collaboration Model
|
|
@@ -76,21 +74,21 @@ When one AI completes a phase, it produces a **handoff document** (see `.agents/
|
|
|
76
74
|
|
|
77
75
|
Each AI tool has different strengths. Use them accordingly:
|
|
78
76
|
|
|
79
|
-
| Capability | Claude Code | Codex CLI | Gemini CLI |
|
|
80
|
-
|
|
77
|
+
| Capability | Claude Code | Codex CLI | Gemini CLI | OpenCode |
|
|
78
|
+
|-----------|-------------|-----------|------------|----------|
|
|
81
79
|
| Codebase analysis | Excellent | Good | Excellent | Good |
|
|
82
|
-
| Code review | Excellent | Good | Good |
|
|
80
|
+
| Code review | Excellent | Good | Good | Good |
|
|
83
81
|
| Implementation | Good | Excellent | Good | Excellent |
|
|
84
|
-
| Large context | Good | Fair | Excellent |
|
|
85
|
-
| Refactoring | Good | Good | Good |
|
|
86
|
-
| Documentation | Excellent | Good | Good |
|
|
82
|
+
| Large context | Good | Fair | Excellent | Fair |
|
|
83
|
+
| Refactoring | Good | Good | Good | Good |
|
|
84
|
+
| Documentation | Excellent | Good | Good | Good |
|
|
87
85
|
|
|
88
86
|
### Recommended Assignments
|
|
89
87
|
|
|
90
88
|
- **Analysis & Review** - Claude Code (strong reasoning, thorough exploration)
|
|
91
|
-
- **Implementation** - Codex CLI or
|
|
89
|
+
- **Implementation** - Codex CLI or OpenCode (fast code generation, command-driven editing)
|
|
92
90
|
- **Large Context Tasks** - Gemini CLI (large context window for cross-file analysis)
|
|
93
|
-
- **
|
|
91
|
+
- **Command-Driven Iteration** - OpenCode (workflow-friendly TUI execution)
|
|
94
92
|
|
|
95
93
|
## Quick Start
|
|
96
94
|
|
|
@@ -118,10 +116,11 @@ When writing or updating `.agents/skills/*/SKILL.md` files and their templates,
|
|
|
118
116
|
|
|
119
117
|
1. Use consecutive integers for top-level steps: `1.`, `2.`, `3.`.
|
|
120
118
|
2. Use nested numbering only for child actions that belong to a parent step: `1.1`, `1.2`, `2.1`.
|
|
121
|
-
3. Use `a`, `b`, and `c` markers for branches, conditions, or alternative paths within the same step.
|
|
119
|
+
3. Use `a`, `b`, and `c` markers for branches, conditions, or alternative paths within the same step; keep them scoped to child options rather than standalone decision tracks or output templates.
|
|
122
120
|
4. Do not use intermediate numbers such as `1.5` or `2.5`; if a new standalone step is needed, renumber the following top-level steps.
|
|
123
121
|
5. When renumbering, update every in-document step reference so the instructions remain accurate.
|
|
124
122
|
6. Extract long bash scripts into a sibling `scripts/` directory; the SKILL.md should contain only a single-line invocation (e.g., `bash .agents/skills/<skill>/scripts/<script>.sh`) and a brief summary of the script's responsibilities.
|
|
123
|
+
7. In SKILL.md files and their `reference/` templates, use “Scenario” naming for standalone condition branches, decision paths, or output templates (for example, “Scenario A”).
|
|
125
124
|
|
|
126
125
|
### SKILL.md Size Control
|
|
127
126
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 多 AI 协作指南
|
|
2
2
|
|
|
3
|
-
本项目支持多个 AI 编程助手协同工作,包括 Claude Code、OpenAI Codex CLI、Gemini CLI、
|
|
3
|
+
本项目支持多个 AI 编程助手协同工作,包括 Claude Code、OpenAI Codex CLI、Gemini CLI、OpenCode 等。
|
|
4
4
|
|
|
5
5
|
## 双配置架构
|
|
6
6
|
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
| AI 工具 | 主要配置 | 备选配置 |
|
|
10
10
|
|---------|---------|---------|
|
|
11
|
-
| Claude Code | `.claude/`(CLAUDE.md、commands/、settings
|
|
11
|
+
| Claude Code | `.claude/`(CLAUDE.md、commands/、settings.json) | - |
|
|
12
12
|
| OpenAI Codex CLI | `AGENTS.md` | - |
|
|
13
13
|
| Gemini CLI | `AGENTS.md` | - |
|
|
14
|
-
|
|
|
14
|
+
| OpenCode | `AGENTS.md` | - |
|
|
15
15
|
| 其他 AI 工具 | `AGENTS.md` | 项目 README |
|
|
16
16
|
|
|
17
17
|
- **Claude Code** 使用专属的 `.claude/` 目录存放项目指令、斜杠命令和设置。
|
|
@@ -23,10 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
```
|
|
25
25
|
.agents/ # AI 协作配置(版本控制)
|
|
26
|
-
README.md #
|
|
27
|
-
README.zh-CN.md # 中文版本
|
|
26
|
+
README.md # 协作指南
|
|
28
27
|
QUICKSTART.md # 快速入门指南
|
|
29
|
-
QUICKSTART.zh-CN.md # 快速入门指南(中文)
|
|
30
28
|
templates/ # 任务和文档模板
|
|
31
29
|
task.md # 任务模板
|
|
32
30
|
handoff.md # AI 间交接模板
|
|
@@ -45,7 +43,7 @@
|
|
|
45
43
|
.claude/ # Claude Code 专属配置
|
|
46
44
|
CLAUDE.md # Claude 项目指令
|
|
47
45
|
commands/ # 斜杠命令
|
|
48
|
-
settings
|
|
46
|
+
settings.json # Claude 设置
|
|
49
47
|
```
|
|
50
48
|
|
|
51
49
|
## 协作模型
|
|
@@ -76,26 +74,26 @@
|
|
|
76
74
|
|
|
77
75
|
每个 AI 工具有不同的优势,请据此分配任务:
|
|
78
76
|
|
|
79
|
-
| 能力 | Claude Code | Codex CLI | Gemini CLI |
|
|
80
|
-
|
|
77
|
+
| 能力 | Claude Code | Codex CLI | Gemini CLI | OpenCode |
|
|
78
|
+
|-----|-------------|-----------|------------|----------|
|
|
81
79
|
| 代码库分析 | 优秀 | 良好 | 优秀 | 良好 |
|
|
82
|
-
| 代码审查 | 优秀 | 良好 | 良好 |
|
|
80
|
+
| 代码审查 | 优秀 | 良好 | 良好 | 良好 |
|
|
83
81
|
| 代码实现 | 良好 | 优秀 | 良好 | 优秀 |
|
|
84
|
-
| 大上下文处理 | 良好 | 一般 | 优秀 |
|
|
85
|
-
| 重构 | 良好 | 良好 | 良好 |
|
|
86
|
-
| 文档编写 | 优秀 | 良好 | 良好 |
|
|
82
|
+
| 大上下文处理 | 良好 | 一般 | 优秀 | 一般 |
|
|
83
|
+
| 重构 | 良好 | 良好 | 良好 | 良好 |
|
|
84
|
+
| 文档编写 | 优秀 | 良好 | 良好 | 良好 |
|
|
87
85
|
|
|
88
86
|
### 推荐分配
|
|
89
87
|
|
|
90
88
|
- **分析和审查** - Claude Code(推理能力强,探索全面)
|
|
91
|
-
- **代码实现** - Codex CLI 或
|
|
89
|
+
- **代码实现** - Codex CLI 或 OpenCode(代码生成快,命令式工作流顺手)
|
|
92
90
|
- **大上下文任务** - Gemini CLI(大上下文窗口,适合跨文件分析)
|
|
93
|
-
-
|
|
91
|
+
- **命令式迭代** - OpenCode(适合按工作流连续推进)
|
|
94
92
|
|
|
95
93
|
## 快速入门
|
|
96
94
|
|
|
97
|
-
1. **阅读快速入门指南**:参见 `QUICKSTART.
|
|
98
|
-
2. **创建任务**:将 `.agents/templates/task.
|
|
95
|
+
1. **阅读快速入门指南**:参见 `QUICKSTART.md` 获取分步说明。
|
|
96
|
+
2. **创建任务**:将 `.agents/templates/task.md` 复制到 `.agents/workspace/active/`。
|
|
99
97
|
3. **分配给 AI**:更新任务元数据中的 `assigned_to` 字段。
|
|
100
98
|
4. **执行工作流**:按照 `.agents/workflows/` 中相应的工作流执行。
|
|
101
99
|
5. **交接**:切换 AI 时,从模板创建交接文档。
|
|
@@ -118,10 +116,11 @@
|
|
|
118
116
|
|
|
119
117
|
1. 顶级步骤使用连续整数:`1.`、`2.`、`3.`。
|
|
120
118
|
2. 只有父步骤下的从属动作才使用子步骤:`1.1`、`1.2`、`2.1`。
|
|
121
|
-
3.
|
|
119
|
+
3. 同一步中的从属选项、条件分支或并列可能性使用 `a`、`b`、`c` 标记;仅用于步骤内部的子项展开,不用于命名独立的决策路径或输出模板。
|
|
122
120
|
4. 不要使用 `1.5`、`2.5` 这类中间编号;如新增独立步骤,应整体顺延后续编号。
|
|
123
121
|
5. 调整编号时,必须同步更新文中的步骤引用,确保说明、命令和检查点一致。
|
|
124
122
|
6. 长 bash 脚本应从 SKILL.md 提取到同级 `scripts/` 目录中,SKILL.md 只保留单行调用(如 `bash .agents/skills/<skill>/scripts/<script>.sh`)和对脚本职责的概要说明。
|
|
123
|
+
7. 在 SKILL.md 及其 `reference/` 模板中,如需为独立的条件分流、决策路径或输出模板命名,统一使用“场景”命名(例如使用“场景 A”)。
|
|
125
124
|
|
|
126
125
|
### SKILL.md 体积控制
|
|
127
126
|
|
|
@@ -82,7 +82,7 @@ Required next-step commands:
|
|
|
82
82
|
|
|
83
83
|
```text
|
|
84
84
|
Next step - create Pull Request:
|
|
85
|
-
- Claude Code / OpenCode: /create-pr
|
|
86
|
-
- Gemini CLI: /agent-infra:create-pr
|
|
87
|
-
- Codex CLI: $create-pr
|
|
85
|
+
- Claude Code / OpenCode: /create-pr {task-id}
|
|
86
|
+
- Gemini CLI: /agent-infra:create-pr {task-id}
|
|
87
|
+
- Codex CLI: $create-pr {task-id}
|
|
88
88
|
```
|
|
@@ -82,7 +82,7 @@ date "+%Y-%m-%d %H:%M:%S"
|
|
|
82
82
|
|
|
83
83
|
```text
|
|
84
84
|
下一步 - 创建 Pull Request:
|
|
85
|
-
- Claude Code / OpenCode: /create-pr
|
|
86
|
-
- Gemini CLI: /agent-infra:create-pr
|
|
87
|
-
- Codex CLI: $create-pr
|
|
85
|
+
- Claude Code / OpenCode: /create-pr {task-id}
|
|
86
|
+
- Gemini CLI: /agent-infra:create-pr {task-id}
|
|
87
|
+
- Codex CLI: $create-pr {task-id}
|
|
88
88
|
```
|
|
@@ -9,38 +9,47 @@ Create a Pull Request and, when task-related, sync the essential metadata immedi
|
|
|
9
9
|
|
|
10
10
|
## Execution Flow
|
|
11
11
|
|
|
12
|
-
### 1.
|
|
12
|
+
### 1. Parse Command Arguments
|
|
13
|
+
|
|
14
|
+
Identify arguments from the command input:
|
|
15
|
+
- arguments matching `TASK-{yyyyMMdd-HHmmss}` -> `{task-id}`
|
|
16
|
+
- remaining arguments -> `{target-branch}`
|
|
17
|
+
|
|
18
|
+
If `{task-id}` is provided, read `.agents/workspace/active/{task-id}/task.md` to load task metadata such as `issue_number` and `type`.
|
|
19
|
+
If `{task-id}` is omitted, try to resolve it from the current session context; if it still cannot be determined, skip task-association logic in later steps.
|
|
20
|
+
|
|
21
|
+
### 2. Determine the Target Branch
|
|
13
22
|
|
|
14
23
|
Use the explicit argument when provided. Otherwise infer the target branch from Git history and branch topology.
|
|
15
24
|
|
|
16
25
|
> Detailed branch detection rules live in `reference/branch-strategy.md`. Read `reference/branch-strategy.md` before auto-detecting the base branch.
|
|
17
26
|
|
|
18
|
-
###
|
|
27
|
+
### 3. Prepare the PR Body
|
|
19
28
|
|
|
20
29
|
Read `.github/PULL_REQUEST_TEMPLATE.md` when it exists, review recent merged PRs for style, and gather all commits between `<target-branch>` and `HEAD`.
|
|
21
30
|
|
|
22
31
|
> Template handling, HEREDOC body generation, and `Generated with AI assistance` requirements live in `reference/pr-body-template.md`. Read `reference/pr-body-template.md` before writing the PR body.
|
|
23
32
|
|
|
24
|
-
###
|
|
33
|
+
### 4. Check Remote Branch State
|
|
25
34
|
|
|
26
35
|
Confirm whether the current branch already has an upstream. Push with `git push -u origin <current-branch>` when required.
|
|
27
36
|
|
|
28
|
-
###
|
|
37
|
+
### 5. Create the PR
|
|
29
38
|
|
|
30
39
|
Create the PR with `gh pr create --base <target-branch> --title "<title>" --assignee @me --body ...`.
|
|
31
40
|
|
|
32
|
-
If
|
|
41
|
+
If `{task-id}` is available and the related task provides `issue_number`, keep `Closes #{issue-number}` in the PR body.
|
|
33
42
|
|
|
34
|
-
###
|
|
43
|
+
### 6. Sync PR Metadata
|
|
35
44
|
|
|
36
|
-
For task-
|
|
45
|
+
For PRs where `{task-id}` is available, sync the core metadata immediately:
|
|
37
46
|
- run `gh label list --search "type:" --limit 1 --json name --jq 'length'`
|
|
38
47
|
- add the mapped type label with `gh pr edit {pr-number} --add-label "{type-label}"`
|
|
39
48
|
- add relevant `in: {module}` labels with `gh pr edit {pr-number} --add-label "in: {module}"`
|
|
40
49
|
- set the milestone with `gh pr edit {pr-number} --milestone "{milestone-title}"`
|
|
41
50
|
- keep Development linking in the PR body with `Closes #{issue-number}` when applicable
|
|
42
51
|
|
|
43
|
-
###
|
|
52
|
+
### 7. Update Task Status
|
|
44
53
|
|
|
45
54
|
Get the current time:
|
|
46
55
|
|
|
@@ -48,9 +57,9 @@ Get the current time:
|
|
|
48
57
|
date "+%Y-%m-%d %H:%M:%S"
|
|
49
58
|
```
|
|
50
59
|
|
|
51
|
-
If
|
|
60
|
+
If `{task-id}` is available, update task.md with `pr_number`, `updated_at`, and append the PR Created Activity Log entry.
|
|
52
61
|
|
|
53
|
-
###
|
|
62
|
+
### 8. Inform the User
|
|
54
63
|
|
|
55
64
|
Explain the created PR URL, summarize metadata sync results, and present both follow-up commands in order:
|
|
56
65
|
- optional `sync-pr {task-id}` to publish reviewer-facing context
|
|
@@ -59,7 +68,7 @@ Explain the created PR URL, summarize metadata sync results, and present both fo
|
|
|
59
68
|
## Notes
|
|
60
69
|
|
|
61
70
|
- Review every commit in the branch, not only the latest one
|
|
62
|
-
- `create-pr` must not defer type-label mapping to `sync-pr`; inline the mapping here
|
|
71
|
+
- `create-pr` must not defer type-label mapping to `sync-pr`; inline the mapping here when `{task-id}` is available
|
|
63
72
|
- When metadata inheritance from the Issue fails, continue with task.md and branch-based fallbacks
|
|
64
73
|
|
|
65
74
|
## Error Handling
|