@qodercn-ai/qoderclicn 0.1.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.
- package/LICENSE +202 -0
- package/README.md +153 -0
- package/bundle/builtin/agent-creator/SKILL.md +327 -0
- package/bundle/builtin/hook-config/SKILL.md +480 -0
- package/bundle/builtin/mcp-config/SKILL.md +155 -0
- package/bundle/builtin/skill-creator/SKILL.md +294 -0
- package/bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js +101 -0
- package/bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.d.ts +7 -0
- package/bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js +9 -0
- package/bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.d.ts +48 -0
- package/bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js +323 -0
- package/bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.d.ts +36 -0
- package/bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js +7 -0
- package/bundle/node_modules/@google/gemini-cli-devtools/package.json +34 -0
- package/bundle/policies/sandbox-default.toml +19 -0
- package/bundle/qoderclicn.js +51 -0
- package/bundle/sandbox-macos-permissive-open.sb +27 -0
- package/bundle/sandbox-macos-permissive-proxied.sb +37 -0
- package/bundle/sandbox-macos-restrictive-open.sb +96 -0
- package/bundle/sandbox-macos-restrictive-proxied.sb +98 -0
- package/bundle/sandbox-macos-strict-open.sb +131 -0
- package/bundle/sandbox-macos-strict-proxied.sb +133 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Qoder CLI
|
|
2
|
+
|
|
3
|
+
Qoder CLI 是Qoder品牌下的 CLI
|
|
4
|
+
AI 编程助手,将强大的 AI 编程能力直接带入你的终端。
|
|
5
|
+
|
|
6
|
+
## 🚀 Why Qoder CLI?
|
|
7
|
+
|
|
8
|
+
- **🧠 强大的 AI 模型** — 支持多种大语言模型,百万级 token 上下文窗口
|
|
9
|
+
- **🔧 内置工具** — 文件操作、Shell 命令执行、Web 搜索、代码搜索
|
|
10
|
+
- **🔌 可扩展** — 支持 MCP (Model Context Protocol) 协议,轻松接入自定义工具
|
|
11
|
+
- **💻 终端优先** — 为命令行开发者设计,高效交互
|
|
12
|
+
|
|
13
|
+
## 📦 安装
|
|
14
|
+
|
|
15
|
+
**需要 Node.js >= 20.0.0**
|
|
16
|
+
|
|
17
|
+
全局安装:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm install -g @qoder-ai/qodercli
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 📋 发布渠道
|
|
24
|
+
|
|
25
|
+
### Stable(稳定版)
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npm install -g @qoder-ai/qodercli@latest
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Node原生兼容版(beta)
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
npm install -g @qoder-ai/qodercli@beta
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 🚀 快速开始
|
|
38
|
+
|
|
39
|
+
### 基本用法
|
|
40
|
+
|
|
41
|
+
在当前目录启动交互式会话:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
qodercli
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
指定模型:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
qodercli -m <model-name>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
非交互模式(适合脚本调用):
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
qodercli -p "解释这个代码仓库的架构"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 使用示例
|
|
60
|
+
|
|
61
|
+
**分析现有代码:**
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
cd your-project/
|
|
65
|
+
qodercli
|
|
66
|
+
> 给我总结一下昨天的所有代码变更
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**生成代码:**
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
qodercli
|
|
73
|
+
> 帮我写一个 Express 中间件,实现请求频率限制
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**调试问题:**
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
qodercli
|
|
80
|
+
> 这个测试为什么会失败?帮我修复它
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 📋 核心功能
|
|
84
|
+
|
|
85
|
+
### 代码理解与生成
|
|
86
|
+
|
|
87
|
+
- 查询和编辑大型代码库
|
|
88
|
+
- 支持多模态输入(图片、PDF 等)生成代码
|
|
89
|
+
- 自然语言调试
|
|
90
|
+
|
|
91
|
+
### 自动化与集成
|
|
92
|
+
|
|
93
|
+
- 自动化 Git 操作、PR 处理等任务
|
|
94
|
+
- 通过 MCP 服务器扩展能力
|
|
95
|
+
- 支持非交互模式在脚本中运行
|
|
96
|
+
|
|
97
|
+
### 高级能力
|
|
98
|
+
|
|
99
|
+
- Web 搜索获取实时信息
|
|
100
|
+
- 会话检查点(保存/恢复对话)
|
|
101
|
+
- 自定义上下文文件,定制项目行为
|
|
102
|
+
|
|
103
|
+
## 🔐 认证配置
|
|
104
|
+
|
|
105
|
+
Qoder CLI 使用自有认证体系,支持以下认证方式:
|
|
106
|
+
|
|
107
|
+
### 方式一:浏览器登录(推荐)
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
qodercli
|
|
111
|
+
# 首次运行自动打开浏览器引导登录
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
或显式执行登录命令:
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
qodercli login
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
后台每 30 分钟自动刷新 token,无需手动干预
|
|
121
|
+
|
|
122
|
+
> 如果环境不支持自动打开浏览器,设置 `NO_BROWSER=1`
|
|
123
|
+
> 后 CLI 会打印 URL 供手动访问。
|
|
124
|
+
|
|
125
|
+
### 方式二:Personal Access Token (PAT)
|
|
126
|
+
|
|
127
|
+
适用于 CI/CD 流水线或无浏览器环境:
|
|
128
|
+
|
|
129
|
+
```sh
|
|
130
|
+
export QODER_PERSONAL_ACCESS_TOKEN="your-pat-token"
|
|
131
|
+
qodercli
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
PAT 可在 Qoder 账号设置页 (`https://qoder.com/account/integrations`) 创建和管理。
|
|
135
|
+
|
|
136
|
+
### 认证相关环境变量
|
|
137
|
+
|
|
138
|
+
| 环境变量 | 说明 |
|
|
139
|
+
| ----------------------------- | --------------------------------- |
|
|
140
|
+
| `QODER_PERSONAL_ACCESS_TOKEN` | PAT 令牌,设置后自动使用 PAT 认证 |
|
|
141
|
+
| `QODER_CONFIG_DIR` | 自定义配置目录(默认 `~/.qoder`) |
|
|
142
|
+
| `NO_BROWSER` | 设置后禁止自动打开浏览器 |
|
|
143
|
+
|
|
144
|
+
### 会话内命令
|
|
145
|
+
|
|
146
|
+
| 命令 | 说明 |
|
|
147
|
+
| ----------------------- | ------------------ |
|
|
148
|
+
| `/login` 或 `/signin` | 在会话中执行登录 |
|
|
149
|
+
| `/logout` 或 `/signout` | 退出登录(需确认) |
|
|
150
|
+
|
|
151
|
+
## 🔌 MCP 扩展
|
|
152
|
+
|
|
153
|
+
在配置文件中添加 MCP 服务器,扩展 CLI 的能力
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-creator
|
|
3
|
+
description:
|
|
4
|
+
Guide for creating custom agents. Use when users want to create a new agent
|
|
5
|
+
that runs in an isolated context with custom system prompts and
|
|
6
|
+
specific tool access.
|
|
7
|
+
allowed-tools: Edit, Write
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Creating Custom Agents for Qoder CLI
|
|
11
|
+
|
|
12
|
+
This skill guides you through creating custom agents. Agents are
|
|
13
|
+
specialized AI assistants that run in isolated contexts with custom system
|
|
14
|
+
prompts, specific tool access, and independent permissions.
|
|
15
|
+
|
|
16
|
+
## When to Use Agents
|
|
17
|
+
|
|
18
|
+
Use agents when you need:
|
|
19
|
+
|
|
20
|
+
- **Context isolation** for long research or exploration tasks
|
|
21
|
+
- **Parallel execution** of multiple independent workstreams
|
|
22
|
+
- **Specialized expertise** with custom prompts for specific domains
|
|
23
|
+
- **Reusable configurations** across projects
|
|
24
|
+
|
|
25
|
+
**When NOT to use agents:**
|
|
26
|
+
|
|
27
|
+
- Simple, single-purpose tasks (use skills instead)
|
|
28
|
+
- Tasks requiring frequent back-and-forth with the user
|
|
29
|
+
- Quick, targeted changes
|
|
30
|
+
|
|
31
|
+
## Agent Locations
|
|
32
|
+
|
|
33
|
+
| Location | Scope | Priority |
|
|
34
|
+
| -------------------------------- | ----------------- | -------- |
|
|
35
|
+
| `<project>/${QODER_CONFIG_DIR}/agents/` | Current project | Higher |
|
|
36
|
+
| `~/${QODER_CONFIG_DIR}/agents/` | All your projects | Lower |
|
|
37
|
+
|
|
38
|
+
**Project agents** (`${QODER_CONFIG_DIR}/agents/`): Ideal for codebase-specific
|
|
39
|
+
agents. Check into version control to share with your team.
|
|
40
|
+
|
|
41
|
+
**User agents** (`~/${QODER_CONFIG_DIR}/agents/`): Personal agents available across
|
|
42
|
+
all your projects.
|
|
43
|
+
|
|
44
|
+
## Agent File Format
|
|
45
|
+
|
|
46
|
+
Each agent is a Markdown file with YAML frontmatter:
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
---
|
|
50
|
+
name: agent-name
|
|
51
|
+
description: When to use this agent. Be specific!
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
You are a [role]. When invoked:
|
|
55
|
+
|
|
56
|
+
1. [First step]
|
|
57
|
+
2. [Second step]
|
|
58
|
+
3. [Output format]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Required Fields
|
|
62
|
+
|
|
63
|
+
| Field | Description |
|
|
64
|
+
| ------------- | -------------------------------------------------------------------------- |
|
|
65
|
+
| `name` | Unique identifier (lowercase letters and hyphens only) |
|
|
66
|
+
| `description` | When to delegate to this agent (be specific). Including trigger scenarios. |
|
|
67
|
+
|
|
68
|
+
## Writing Effective Descriptions
|
|
69
|
+
|
|
70
|
+
The description is **critical**. Include "use proactively" to encourage
|
|
71
|
+
automatic delegation - Qoder CLI uses it to decide when to delegate.
|
|
72
|
+
|
|
73
|
+
```yaml
|
|
74
|
+
# Bad - Too vague
|
|
75
|
+
description: Helps with code
|
|
76
|
+
|
|
77
|
+
# Good - Specific and actionable
|
|
78
|
+
description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Optional Fields
|
|
82
|
+
|
|
83
|
+
| Field | Description |
|
|
84
|
+
| ---------------- | ----------------------------------------------------------------------------------- |
|
|
85
|
+
| `tools` | Tools the agent can use (string or array) |
|
|
86
|
+
| `disallowedTools`| Tools to explicitly deny (string or array) |
|
|
87
|
+
| `model` | Model to use: `inherit` (default), `sonnet`, `opus`, `haiku` |
|
|
88
|
+
| `color` | Display color: `red`, `blue`, `green`, `yellow`, `purple`, `orange`, `pink`, `cyan` |
|
|
89
|
+
| `displayName` | Human-friendly display name |
|
|
90
|
+
| `maxTurns` | Maximum conversation turns (positive integer) |
|
|
91
|
+
| `timeoutMins` | Timeout in minutes (positive integer) |
|
|
92
|
+
| `effort` | Thinking effort: `low`, `medium`, `high`, `max` |
|
|
93
|
+
| `skills` | Skills the agent can use (string or array) |
|
|
94
|
+
|
|
95
|
+
#### Tools
|
|
96
|
+
|
|
97
|
+
Specify which tools the agent has access to. This limits the agent's
|
|
98
|
+
capabilities for security and focus.
|
|
99
|
+
|
|
100
|
+
```yaml
|
|
101
|
+
# Read-only access
|
|
102
|
+
tools: Read, Grep, Glob
|
|
103
|
+
|
|
104
|
+
# Full development access
|
|
105
|
+
tools: Bash, Read, Write, Edit, Glob, Grep
|
|
106
|
+
|
|
107
|
+
# Web research capabilities
|
|
108
|
+
tools: Read, WebSearch, WebFetch
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Available Tools:**
|
|
112
|
+
|
|
113
|
+
- `Bash` - Execute shell commands
|
|
114
|
+
- `Read` - Read file contents
|
|
115
|
+
- `Write` - Create new files
|
|
116
|
+
- `Edit` - Modify existing files
|
|
117
|
+
- `Glob` - Find files by pattern
|
|
118
|
+
- `Grep` - Search file contents
|
|
119
|
+
- `WebSearch` - Search the web
|
|
120
|
+
- `WebFetch` - Fetch web page content
|
|
121
|
+
|
|
122
|
+
If not specified, the agent inherits default tool access.
|
|
123
|
+
|
|
124
|
+
## Agent Creation Workflow
|
|
125
|
+
|
|
126
|
+
### Step 1: Decide the Scope
|
|
127
|
+
|
|
128
|
+
If not sure where to create the agent, ask the user with two options:
|
|
129
|
+
|
|
130
|
+
- **Project-level** (`.agents/`): For team-shared, codebase-specific agents
|
|
131
|
+
- **User-level** (`~/.agents/`): For personal agents across all projects
|
|
132
|
+
|
|
133
|
+
### Step 2: Gather Requirements
|
|
134
|
+
|
|
135
|
+
Understand what the agent should do:
|
|
136
|
+
|
|
137
|
+
- What specific task or domain?
|
|
138
|
+
- What tools does it need?
|
|
139
|
+
- Should it be read-only or have write access?
|
|
140
|
+
- Any special constraints or workflows?
|
|
141
|
+
|
|
142
|
+
### Step 3: Create the File
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# For project-level
|
|
146
|
+
mkdir -p ${QODER_CONFIG_DIR}/agents
|
|
147
|
+
touch ${QODER_CONFIG_DIR}/agents/agent-name.md
|
|
148
|
+
|
|
149
|
+
# For user-level
|
|
150
|
+
mkdir -p ~/${QODER_CONFIG_DIR}/agents
|
|
151
|
+
touch ~/${QODER_CONFIG_DIR}/agents/agent-name.md
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Step 4: Write Configuration
|
|
155
|
+
|
|
156
|
+
Create the markdown file with:
|
|
157
|
+
|
|
158
|
+
1. YAML frontmatter with required fields
|
|
159
|
+
2. System prompt in the body
|
|
160
|
+
|
|
161
|
+
### Step 5: Verify
|
|
162
|
+
|
|
163
|
+
- Check file location is correct
|
|
164
|
+
- Verify YAML syntax is valid
|
|
165
|
+
- Confirm the description clearly describes when to use it
|
|
166
|
+
- Tell the user: run `/agents reload` to make the new agent available in the
|
|
167
|
+
current session. They can then invoke it with:
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
@agent-name [task description]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Best Practices
|
|
174
|
+
|
|
175
|
+
1. **Design focused agents** - Each should excel at one specific task
|
|
176
|
+
2. **Write detailed descriptions** - Be detailed and specific so Qoder CLI knows
|
|
177
|
+
when to delegate
|
|
178
|
+
3. **Limit tool access** - Grant only necessary permissions for security and
|
|
179
|
+
focus
|
|
180
|
+
4. **Keep prompts concise** - Long, rambling prompts dilute focus
|
|
181
|
+
|
|
182
|
+
## Anti-Patterns to Avoid
|
|
183
|
+
|
|
184
|
+
- **Vague descriptions** - "Use for general tasks" gives no signal
|
|
185
|
+
- **Overly long prompts** - A 2000-word prompt doesn't make it smarter
|
|
186
|
+
|
|
187
|
+
## Examples
|
|
188
|
+
|
|
189
|
+
### Verifier
|
|
190
|
+
|
|
191
|
+
```markdown
|
|
192
|
+
---
|
|
193
|
+
name: verifier
|
|
194
|
+
description:
|
|
195
|
+
Validates completed work. Use after tasks are marked done to confirm
|
|
196
|
+
implementations are functional.
|
|
197
|
+
color: yellow
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
You are a skeptical validator. Your job is to verify that work claimed as
|
|
201
|
+
complete actually works.
|
|
202
|
+
|
|
203
|
+
When invoked:
|
|
204
|
+
|
|
205
|
+
1. Identify what was claimed to be completed
|
|
206
|
+
2. Check that the implementation exists and is functional
|
|
207
|
+
3. Run relevant tests or verification steps
|
|
208
|
+
4. Look for edge cases that may have been missed
|
|
209
|
+
|
|
210
|
+
Be thorough and skeptical. Report:
|
|
211
|
+
|
|
212
|
+
- What was verified and passed
|
|
213
|
+
- What was claimed but incomplete or broken
|
|
214
|
+
- Specific issues that need to be addressed
|
|
215
|
+
|
|
216
|
+
Do not accept claims at face value. Test everything.
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Debugger
|
|
220
|
+
|
|
221
|
+
```markdown
|
|
222
|
+
---
|
|
223
|
+
name: debugger
|
|
224
|
+
description:
|
|
225
|
+
Debugging specialist for errors and test failures. Use when encountering
|
|
226
|
+
issues.
|
|
227
|
+
color: red
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
You are an expert debugger specializing in root cause analysis.
|
|
231
|
+
|
|
232
|
+
When invoked:
|
|
233
|
+
|
|
234
|
+
1. Capture error message and stack trace
|
|
235
|
+
2. Identify reproduction steps
|
|
236
|
+
3. Isolate the failure location
|
|
237
|
+
4. Implement minimal fix
|
|
238
|
+
5. Verify solution works
|
|
239
|
+
|
|
240
|
+
For each issue, provide:
|
|
241
|
+
|
|
242
|
+
- Root cause explanation
|
|
243
|
+
- Evidence supporting the diagnosis
|
|
244
|
+
- Specific code fix
|
|
245
|
+
- Testing approach
|
|
246
|
+
|
|
247
|
+
Focus on fixing the underlying issue, not symptoms.
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Data Scientist
|
|
251
|
+
|
|
252
|
+
```markdown
|
|
253
|
+
---
|
|
254
|
+
name: data-scientist
|
|
255
|
+
description:
|
|
256
|
+
Data analysis expert for SQL queries, BigQuery operations, and data insights.
|
|
257
|
+
Use proactively for data analysis tasks and queries.
|
|
258
|
+
tools: Bash, Read, Write
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
You are a data scientist specializing in SQL and BigQuery analysis.
|
|
262
|
+
|
|
263
|
+
When invoked:
|
|
264
|
+
|
|
265
|
+
1. Understand the data analysis requirement
|
|
266
|
+
2. Write efficient SQL queries
|
|
267
|
+
3. Use BigQuery command line tools (bq) when appropriate
|
|
268
|
+
4. Analyze and summarize results
|
|
269
|
+
5. Present findings clearly
|
|
270
|
+
|
|
271
|
+
Key practices:
|
|
272
|
+
|
|
273
|
+
- Write optimized SQL queries with proper filters
|
|
274
|
+
- Use appropriate aggregations and joins
|
|
275
|
+
- Include comments explaining complex logic
|
|
276
|
+
- Format results for readability
|
|
277
|
+
- Provide data-driven recommendations
|
|
278
|
+
|
|
279
|
+
For each analysis:
|
|
280
|
+
|
|
281
|
+
- Explain the query approach
|
|
282
|
+
- Document any assumptions
|
|
283
|
+
- Highlight key findings
|
|
284
|
+
- Suggest next steps based on data
|
|
285
|
+
|
|
286
|
+
Always ensure queries are efficient and cost-effective.
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Security Auditor
|
|
290
|
+
|
|
291
|
+
```markdown
|
|
292
|
+
---
|
|
293
|
+
name: security-auditor
|
|
294
|
+
description:
|
|
295
|
+
Security specialist. Use when implementing auth, payments, or handling
|
|
296
|
+
sensitive data. Proactively audit security-sensitive code.
|
|
297
|
+
tools: Read, Grep, Glob
|
|
298
|
+
color: red
|
|
299
|
+
model: sonnet
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
You are a security expert auditing code for vulnerabilities.
|
|
303
|
+
|
|
304
|
+
When invoked:
|
|
305
|
+
|
|
306
|
+
1. Identify security-sensitive code paths
|
|
307
|
+
2. Check for common vulnerabilities (injection, XSS, auth bypass)
|
|
308
|
+
3. Verify secrets are not hardcoded
|
|
309
|
+
4. Review input validation and sanitization
|
|
310
|
+
|
|
311
|
+
Report findings by severity:
|
|
312
|
+
|
|
313
|
+
- Critical (must fix before deploy)
|
|
314
|
+
- High (fix soon)
|
|
315
|
+
- Medium (address when possible)
|
|
316
|
+
|
|
317
|
+
Security checklist:
|
|
318
|
+
|
|
319
|
+
- SQL injection prevention
|
|
320
|
+
- XSS protection
|
|
321
|
+
- CSRF tokens
|
|
322
|
+
- Authentication bypass risks
|
|
323
|
+
- Authorization checks
|
|
324
|
+
- Secret management
|
|
325
|
+
- Input validation
|
|
326
|
+
- Output encoding
|
|
327
|
+
```
|