@ia-ccun/code-agent-cli 0.0.50-beta.3 → 0.0.50-beta.4

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 CHANGED
@@ -272,6 +272,68 @@ EOF
272
272
  | `/feat` | 功能开发 - 辅助功能开发 |
273
273
  | `/workflow` | 工作流 - 执行复杂工作流 |
274
274
 
275
+ ## 自定义 Agents
276
+
277
+ 内置 Agent 示例位于 `config/agent/agents/`(打包在 npm 包中)
278
+
279
+ | Agent | 说明 |
280
+ |-------|------|
281
+ | `agent-example` | 示例 Agent - 展示如何创建自定义 subagent |
282
+
283
+ ### 创建自定义 Agent
284
+
285
+ 在 `~/.aicode-cli/agent/agents/` 目录下创建 `<name>.md` 文件:
286
+
287
+ ```bash
288
+ # 创建 Agent 文件
289
+ cat > ~/.aicode-cli/agent/agents/my-agent.md << 'EOF'
290
+ ---
291
+ name: my-agent
292
+ description: "自定义 Agent 的简短描述"
293
+ tools: "read,bash,write,edit"
294
+ model: "qwen3.5-35b-a3b"
295
+ ---
296
+
297
+ # My Agent
298
+
299
+ ## 角色
300
+ 你是一个专业的代码优化助手...
301
+
302
+ ## 能力
303
+ 1. 代码分析
304
+ 2. 性能优化
305
+ 3. 重构建议
306
+
307
+ ## 工作流程
308
+ 1. 阅读代码
309
+ 2. 分析问题
310
+ 3. 提供建议
311
+ EOF
312
+ ```
313
+
314
+ **字段说明:**
315
+
316
+ | 字段 | 必填 | 说明 |
317
+ |------|------|------|
318
+ | `name` | 是 | Agent 标识符(小写+连字符) |
319
+ | `description` | 是 | 功能描述,用户据此选择 Agent |
320
+ | `tools` | 否 | 逗号分隔的工具列表 |
321
+ | `model` | 否 | 指定使用的模型 |
322
+
323
+ ### 使用 Agent
324
+
325
+ 在对话中自然语言调用:
326
+
327
+ ```
328
+ 使用 my-agent 来优化这段代码
329
+ ```
330
+
331
+ 或配合 pi-subagents 使用:
332
+
333
+ ```
334
+ /run my-agent "Review this implementation"
335
+ ```
336
+
275
337
  ## 项目结构
276
338
 
277
339
  ```
@@ -291,11 +353,3 @@ EOF
291
353
  │ └── postinstall.js # 安装脚本
292
354
  └── package.json
293
355
  ```
294
-
295
- ## 文档
296
-
297
- 更多功能请参考 [pi-coding-agent 文档](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent)
298
-
299
- ## License
300
-
301
- MIT
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: agent-example
3
+ description: "示例 Agent - 展示如何创建自定义 subagent。可删除或复制此文件作为模板。"
4
+ tools: "read,bash,write,edit"
5
+ model: "qwen3.5-35b-a3b"
6
+ ---
7
+
8
+ # 示例 Agent
9
+
10
+ > 💡 这是一个自定义 subagent 示例,展示如何创建具有个性和能力的 Agent。
11
+ > 你可以复制此文件,修改 frontmatter 和下方内容来创建自己的 Agent。
12
+
13
+ ## 角色
14
+
15
+ 你是一个专业的代码优化助手,专注于提升代码质量和开发效率。
16
+
17
+ ## 能力
18
+
19
+ 1. **代码分析**:深入理解代码逻辑,识别潜在问题
20
+ 2. **性能优化**:发现性能瓶颈,提供优化方案
21
+ 3. **重构建议**:改善代码结构和可读性
22
+ 4. **最佳实践**:推荐行业标准和设计模式
23
+
24
+ ## 工作流程
25
+
26
+ 1. 首先使用 `read` 工具阅读需要优化的代码
27
+ 2. 分析问题并给出具体建议
28
+ 3. 使用 `edit` 工具实施改进(需用户确认)
29
+ 4. 使用 `bash` 工具验证修改结果
30
+
31
+ ## 输出风格
32
+
33
+ - 简洁明了,避免冗长解释
34
+ - 使用 Markdown 格式展示代码变更
35
+ - 标注修改原因和预期效果
36
+ - 对重大变更提供回退方案
37
+
38
+ ---
39
+
40
+ ## 📖 创建自定义 Agent 指南
41
+
42
+ ### 文件位置
43
+
44
+ | 类型 | 路径 |
45
+ |------|----------------------------------------|
46
+ | 用户级 | `~/.aicode-cli/agent/agents/<name>.md` |
47
+ | 项目级 | `.aicode-cli/agents/<name>.md` |
48
+
49
+ ### 文件结构
50
+
51
+ Agent 文件必须是 `.md` 格式,包含 YAML frontmatter 和 Markdown body:
52
+
53
+ ```markdown
54
+ ---
55
+ name: my-agent # 必填:Agent 名称(小写+连字符)
56
+ description: "简短描述" # 必填:Agent 功能描述
57
+ tools: "read,bash,write" # 可选:允许使用的工具(逗号分隔)
58
+ model: "provider/model-id" # 可选:指定使用的模型
59
+ ---
60
+
61
+ # Agent 标题
62
+
63
+ 这里是 Agent 的 system prompt,定义:
64
+ - 角色定位
65
+ - 能力和职责
66
+ - 工作流程
67
+ - 输出风格
68
+ - 任何你希望 Agent 遵循的规则
69
+ ```
70
+
71
+ ### Frontmatter 字段说明
72
+
73
+ | 字段 | 必填 | 说明 |
74
+ |------|------|------|
75
+ | `name` | 是 | Agent 标识符,小写字母和连字符 |
76
+ | `description` | 是 | 功能描述,用户通过此描述选择 Agent |
77
+ | `tools` | 否 | 逗号分隔的工具列表,不填则使用默认工具集 |
78
+ | `model` | 否 | 指定模型,如 `qwen3.5-35b-a3b` |
79
+
80
+ ### 使用方式
81
+
82
+ 在对话中调用 subagent 时,aicode 会自动发现并使用这些自定义 Agent:
83
+
84
+ ```
85
+ 使用 agent-example 来优化这段代码
86
+ ```
87
+
88
+ 或在 settings.json 的 `subagents.agentOverrides` 中配置模型覆盖。
@@ -17,6 +17,39 @@
17
17
  "npm:pi-mcp-adapter@2.4.0",
18
18
  "npm:@juicesharp/rpiv-todo",
19
19
  "npm:@juicesharp/rpiv-ask-user-question",
20
- "npm:@juicesharp/rpiv-advisor"
21
- ]
20
+ "npm:@juicesharp/rpiv-advisor",
21
+ "npm:@samfp/pi-memory@1.1.1"
22
+ ],
23
+ "memory": {
24
+ "lessonInjection": "selective",
25
+ "consolidationModel": "qwen3.5-35b-a3b"
26
+ },
27
+ "subagents": {
28
+ "agentOverrides": {
29
+ "scout": {
30
+ "model": "qwen3.5-35b-a3b"
31
+ },
32
+ "researcher": {
33
+ "model": "qwen3.5-35b-a3b"
34
+ },
35
+ "planner": {
36
+ "model": "qwen3.5-35b-a3b"
37
+ },
38
+ "worker": {
39
+ "model": "qwen3.5-35b-a3b"
40
+ },
41
+ "reviewer": {
42
+ "model": "qwen3.5-35b-a3b"
43
+ },
44
+ "context-builder": {
45
+ "model": "qwen3.5-35b-a3b"
46
+ },
47
+ "oracle": {
48
+ "model": "qwen3.5-35b-a3b"
49
+ },
50
+ "delegate": {
51
+ "model": "qwen3.5-35b-a3b"
52
+ }
53
+ }
54
+ }
22
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ia-ccun/code-agent-cli",
3
- "version": "0.0.50-beta.3",
3
+ "version": "0.0.50-beta.4",
4
4
  "description": "AI Coding Agent CLI - 基于OpenClaw🦞底层Agent(pi)原理封装的编码智能体(供学习使用)。",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",