mini-coder 0.1.0 → 0.1.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/.claude/settings.local.json +43 -30
- package/README.md +38 -157
- package/dist/mc-edit.js +29 -5
- package/dist/mc.js +2758 -3282
- package/docs/mini-coder.1.md +206 -102
- package/lefthook.yml +15 -0
- package/package.json +3 -2
- package/docs/configs.md +0 -118
- package/docs/custom-agents.md +0 -69
- package/docs/custom-commands.md +0 -141
- package/docs/skills.md +0 -83
- package/research.md +0 -38
package/docs/mini-coder.1.md
CHANGED
|
@@ -1,156 +1,260 @@
|
|
|
1
1
|
# MINI-CODER(1)
|
|
2
2
|
|
|
3
3
|
## NAME
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
**mini-coder** — a small, fast CLI coding agent (executable: `mc`)
|
|
5
6
|
|
|
6
7
|
## SYNOPSIS
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
`mc` \[*options*\] \[*prompt*\]
|
|
8
10
|
|
|
9
11
|
## DESCRIPTION
|
|
10
|
-
|
|
12
|
+
|
|
13
|
+
Developer-focused CLI coding agent. Prioritizes dev flow — no slow startup, no GUI, no vendor lock-in. Uses 16 ANSI colors to inherit terminal theme. Built on Bun.js.
|
|
11
14
|
|
|
12
15
|
## OPTIONS
|
|
13
|
-
**-m, --model <id>**
|
|
14
|
-
: Specify the model to use (e.g., `zen/claude-sonnet-4-6`).
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
:
|
|
17
|
+
`-m`, `--model` *id*
|
|
18
|
+
: Model to use (e.g. `zen/claude-sonnet-4-6`).
|
|
19
|
+
|
|
20
|
+
`-c`, `--continue`
|
|
21
|
+
: Continue most recent session.
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
:
|
|
23
|
+
`-r`, `--resume` *id*
|
|
24
|
+
: Resume a specific session.
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
:
|
|
26
|
+
`-l`, `--list`
|
|
27
|
+
: List recent sessions.
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
:
|
|
29
|
+
`--cwd` *path*
|
|
30
|
+
: Set working directory.
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
:
|
|
32
|
+
`-h`, `--help`
|
|
33
|
+
: Display help.
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
:
|
|
35
|
+
*prompt*
|
|
36
|
+
: Optional one-shot prompt. Runs once then exits.
|
|
33
37
|
|
|
34
38
|
## INTERACTIVE COMMANDS
|
|
35
|
-
Inside the interactive session, the following slash commands are available:
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
:
|
|
40
|
+
`/model`
|
|
41
|
+
: List all available models.
|
|
42
|
+
|
|
43
|
+
`/model` *id*
|
|
44
|
+
: Switch model.
|
|
45
|
+
|
|
46
|
+
`/model effort` *low|medium|high|xhigh|off*
|
|
47
|
+
: Set reasoning effort.
|
|
48
|
+
|
|
49
|
+
`/reasoning` \[*on|off*\]
|
|
50
|
+
: Toggle reasoning display.
|
|
39
51
|
|
|
40
|
-
|
|
41
|
-
:
|
|
52
|
+
`/context prune` *off|balanced|aggressive*
|
|
53
|
+
: Pruning strategy.
|
|
42
54
|
|
|
43
|
-
|
|
44
|
-
:
|
|
55
|
+
`/context cap` *off|bytes|kb*
|
|
56
|
+
: Tool result payload cap.
|
|
45
57
|
|
|
46
|
-
|
|
47
|
-
:
|
|
58
|
+
`/cache` *on|off*
|
|
59
|
+
: Toggle prompt caching globally.
|
|
48
60
|
|
|
49
|
-
|
|
50
|
-
:
|
|
61
|
+
`/cache openai` *in_memory|24h*
|
|
62
|
+
: OpenAI cache retention.
|
|
51
63
|
|
|
52
|
-
|
|
53
|
-
:
|
|
64
|
+
`/cache gemini` *off|cachedContents/...*
|
|
65
|
+
: Gemini cached content.
|
|
54
66
|
|
|
55
|
-
|
|
56
|
-
:
|
|
67
|
+
`/undo`
|
|
68
|
+
: Remove last turn (does NOT revert filesystem).
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
:
|
|
70
|
+
`/new`
|
|
71
|
+
: Start a fresh session.
|
|
60
72
|
|
|
61
|
-
|
|
62
|
-
:
|
|
73
|
+
`/verbose`
|
|
74
|
+
: Toggle output truncation.
|
|
63
75
|
|
|
64
|
-
|
|
65
|
-
:
|
|
76
|
+
`/mcp list`
|
|
77
|
+
: List MCP servers.
|
|
66
78
|
|
|
67
|
-
|
|
68
|
-
:
|
|
79
|
+
`/mcp add` *name* `http` *url*
|
|
80
|
+
: Add HTTP MCP server.
|
|
69
81
|
|
|
70
|
-
|
|
71
|
-
:
|
|
82
|
+
`/mcp add` *name* `stdio` *cmd* \[*args...*\]
|
|
83
|
+
: Add stdio MCP server.
|
|
72
84
|
|
|
73
|
-
|
|
74
|
-
:
|
|
85
|
+
`/mcp remove` *name*
|
|
86
|
+
: Remove MCP server.
|
|
75
87
|
|
|
76
|
-
|
|
77
|
-
:
|
|
88
|
+
`/agent` \[*name*\]
|
|
89
|
+
: Set or clear active agent.
|
|
78
90
|
|
|
79
|
-
|
|
80
|
-
:
|
|
91
|
+
`/review`
|
|
92
|
+
: Review changes (custom command, auto-created globally).
|
|
81
93
|
|
|
82
|
-
|
|
83
|
-
:
|
|
94
|
+
`/login`
|
|
95
|
+
: Show OAuth login status.
|
|
84
96
|
|
|
85
|
-
|
|
86
|
-
:
|
|
97
|
+
`/login` *provider*
|
|
98
|
+
: Login via OAuth (opens browser for device flow). Currently supports `anthropic`.
|
|
87
99
|
|
|
100
|
+
`/logout` *provider*
|
|
101
|
+
: Clear saved OAuth tokens.
|
|
88
102
|
|
|
89
|
-
|
|
90
|
-
:
|
|
103
|
+
`/help`
|
|
104
|
+
: Command help.
|
|
91
105
|
|
|
92
|
-
|
|
93
|
-
:
|
|
106
|
+
`/exit`, `/quit`, `/q`
|
|
107
|
+
: Leave session.
|
|
94
108
|
|
|
95
109
|
## INLINE FEATURES
|
|
96
|
-
**Shell Integration**
|
|
97
|
-
: Prefix user prompts with `!` to run shell commands inline directly into the context.
|
|
98
110
|
|
|
99
|
-
|
|
100
|
-
:
|
|
111
|
+
`!` prefix
|
|
112
|
+
: Runs shell commands inline.
|
|
113
|
+
|
|
114
|
+
`@` prefix
|
|
115
|
+
: References files or skills (with tab completion).
|
|
101
116
|
|
|
102
117
|
## BUILT-IN TOOLS
|
|
103
|
-
The agent has access to the following tools:
|
|
104
|
-
* **shell**: Execute bash commands and capture output. Repo inspection and targeted file edits are typically done here via `mc-edit`.
|
|
105
|
-
* **subagent**: Spawn a focused mini-agent with a prompt.
|
|
106
|
-
* **listSkills**: List discovered skills without loading full skill bodies.
|
|
107
|
-
* **readSkill**: Load one `SKILL.md` on demand.
|
|
108
|
-
* **webSearch**: Search the internet (requires EXA key).
|
|
109
|
-
* **webContent**: Fetch full page content from a URL (requires EXA key).
|
|
110
|
-
* **MCP tools**: Connected external tools attached dynamically from configured MCP servers.
|
|
111
|
-
|
|
112
|
-
## FILE EDIT HELPER
|
|
113
|
-
**mc-edit**
|
|
114
|
-
: Helper command used from shell for one exact-text edit on an existing file. On success it prints a human-readable plain unified diff to stdout followed by a short metadata block (`ok`, `path`, `changed`). If the edit is a no-op, it prints `(no changes)` plus the same metadata. Errors are written to stderr.
|
|
115
118
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
**shell**
|
|
120
|
+
: Execute bash commands; repo inspection and `mc-edit` edits happen here.
|
|
121
|
+
|
|
122
|
+
**listSkills**
|
|
123
|
+
: List discovered skills (metadata only).
|
|
124
|
+
|
|
125
|
+
**readSkill**
|
|
126
|
+
: Load one SKILL.md on demand.
|
|
127
|
+
|
|
128
|
+
**webSearch**
|
|
129
|
+
: Search the web (requires `EXA_API_KEY`).
|
|
130
|
+
|
|
131
|
+
**webContent**
|
|
132
|
+
: Fetch page content (requires `EXA_API_KEY`).
|
|
133
|
+
|
|
134
|
+
MCP tools are connected dynamically from configured MCP servers.
|
|
135
|
+
|
|
136
|
+
## FILE EDITING — mc-edit
|
|
137
|
+
|
|
138
|
+
`mc-edit` is the helper for targeted file edits, invoked from **shell**.
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
mc-edit <path> (--old <text> | --old-file <path>) [--new <text> | --new-file <path>] [--cwd <path>]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
- Applies one exact-text edit to an existing file.
|
|
145
|
+
- The old text must match exactly once.
|
|
146
|
+
- Omit `--new`/`--new-file` to delete the matched text.
|
|
147
|
+
- Success: prints unified diff + metadata (`ok`, `path`, `changed`).
|
|
148
|
+
- No-op: prints `(no changes)` + metadata.
|
|
149
|
+
- Errors go to stderr.
|
|
150
|
+
|
|
151
|
+
Workflow: inspect with **shell** → edit with **mc-edit** → verify with **shell**.
|
|
152
|
+
|
|
153
|
+
## CUSTOM COMMANDS
|
|
154
|
+
|
|
155
|
+
Drop a `.md` file in `.agents/commands/` (local) or `~/.agents/commands/` (global) and it becomes a `/command`. Filename equals command name (`standup.md` → `/standup`).
|
|
156
|
+
|
|
157
|
+
`.claude/commands/*.md` is also supported.
|
|
158
|
+
|
|
159
|
+
**Frontmatter fields:**
|
|
160
|
+
|
|
161
|
+
`description`
|
|
162
|
+
: Shown in `/help`.
|
|
163
|
+
|
|
164
|
+
`model`
|
|
165
|
+
: Optional metadata field.
|
|
166
|
+
|
|
167
|
+
**Argument substitution:**
|
|
168
|
+
|
|
169
|
+
`$ARGUMENTS` expands to the full argument string; `$1`–`$9` expand to positional tokens.
|
|
119
170
|
|
|
120
|
-
**
|
|
121
|
-
|
|
171
|
+
**Shell interpolation:**
|
|
172
|
+
|
|
173
|
+
`` !`cmd` `` injects shell output at expansion time (10 s timeout).
|
|
174
|
+
|
|
175
|
+
**Precedence:** custom commands shadow built-ins. Local overrides global.
|
|
176
|
+
|
|
177
|
+
## CUSTOM AGENTS
|
|
178
|
+
|
|
179
|
+
Drop a `.md` file in `.agents/agents/` (local) or `~/.agents/agents/` (global). Filename equals agent name. Activate with `/agent <name>`.
|
|
180
|
+
|
|
181
|
+
`.claude/agents/*.md` is also supported.
|
|
182
|
+
|
|
183
|
+
**Frontmatter fields:**
|
|
184
|
+
|
|
185
|
+
`description`
|
|
186
|
+
: Shown in `/help`.
|
|
187
|
+
|
|
188
|
+
`model`
|
|
189
|
+
: Optional metadata field.
|
|
190
|
+
|
|
191
|
+
Body is the agent system prompt.
|
|
192
|
+
|
|
193
|
+
## SKILLS
|
|
194
|
+
|
|
195
|
+
Skills are reusable instruction files at `.agents/skills/<name>/SKILL.md`.
|
|
196
|
+
|
|
197
|
+
`.claude/skills/<name>/SKILL.md` is also supported.
|
|
198
|
+
|
|
199
|
+
**Frontmatter (both required):**
|
|
200
|
+
|
|
201
|
+
`name`
|
|
202
|
+
: Lowercase alphanumeric + hyphens, 1–64 chars.
|
|
203
|
+
|
|
204
|
+
`description`
|
|
205
|
+
: Help text.
|
|
206
|
+
|
|
207
|
+
Skills are never auto-loaded. Load explicitly:
|
|
208
|
+
|
|
209
|
+
- `@skill-name` in prompts (injects body wrapped in `<skill>` XML).
|
|
210
|
+
- **listSkills** / **readSkill** tools at runtime.
|
|
211
|
+
|
|
212
|
+
Local discovery walks up from cwd to the git worktree root.
|
|
213
|
+
|
|
214
|
+
## CONFIGURATION
|
|
215
|
+
|
|
216
|
+
Supports `.agents` and `.claude` layouts for commands, skills, agents, and context.
|
|
217
|
+
|
|
218
|
+
Config roots: `.agents/`, `.claude/` — local (repo) or global (`~/`).
|
|
219
|
+
|
|
220
|
+
**Context files** (one global + one local loaded):
|
|
221
|
+
|
|
222
|
+
- Global: `~/.agents/AGENTS.md` → `~/.agents/CLAUDE.md`
|
|
223
|
+
- Local: `./.agents/AGENTS.md` → `./CLAUDE.md` → `./AGENTS.md`
|
|
224
|
+
|
|
225
|
+
**Precedence:**
|
|
226
|
+
|
|
227
|
+
1. Local overrides global.
|
|
228
|
+
2. Same scope: `.agents` wins over `.claude`.
|
|
229
|
+
3. Skills: nearest ancestor directory wins.
|
|
230
|
+
|
|
231
|
+
## ENVIRONMENT
|
|
122
232
|
|
|
123
|
-
|
|
124
|
-
:
|
|
233
|
+
`OPENCODE_API_KEY`
|
|
234
|
+
: OpenCode Zen (recommended).
|
|
125
235
|
|
|
126
|
-
|
|
127
|
-
:
|
|
236
|
+
`ANTHROPIC_API_KEY`
|
|
237
|
+
: Direct Anthropic.
|
|
128
238
|
|
|
129
|
-
|
|
130
|
-
:
|
|
239
|
+
`OPENAI_API_KEY`
|
|
240
|
+
: Direct OpenAI.
|
|
131
241
|
|
|
132
|
-
|
|
133
|
-
:
|
|
242
|
+
`GOOGLE_API_KEY` / `GEMINI_API_KEY`
|
|
243
|
+
: Direct Gemini.
|
|
134
244
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
: Application data directory. Contains `sessions.db` (SQLite database for session history, MCP server configs, and model metadata), `api.log`, and `errors.log`.
|
|
245
|
+
`OLLAMA_BASE_URL`
|
|
246
|
+
: Ollama local (defaults to `http://localhost:11434`).
|
|
138
247
|
|
|
139
|
-
|
|
140
|
-
:
|
|
141
|
-
* **commands/*.md**: Custom slash commands.
|
|
142
|
-
* **agents/*.md**: Custom behavioral wrappers or subagents.
|
|
143
|
-
* **skills/<name>/SKILL.md**: Isolated context/instruction snippets.
|
|
248
|
+
`EXA_API_KEY`
|
|
249
|
+
: Enables **webSearch** / **webContent**.
|
|
144
250
|
|
|
145
|
-
|
|
146
|
-
: Auto-loaded system context files for project-specific instructions.
|
|
251
|
+
## FILES
|
|
147
252
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
* **Session Memory**: Persists conversation history in a local SQLite database, allowing users to resume past sessions effortlessly.
|
|
151
|
-
* **Subagent Delegation**: Includes a tool to spawn parallel instances of itself to tackle independent subtasks simultaneously (up to 10 levels deep).
|
|
152
|
-
* **Model Context Protocol (MCP)**: Native support for connecting external tools via MCP servers over HTTP or stdio.
|
|
153
|
-
* **Prompt Caching**: Configurable caching behaviors for supported providers (OpenAI, Gemini).
|
|
154
|
-
* **Undo Functionality**: Remove the last conversation turn from the current session history. It does not restore filesystem changes.
|
|
253
|
+
`~/.config/mini-coder/`
|
|
254
|
+
: App data directory (sessions.db, api.log, errors.log).
|
|
155
255
|
|
|
256
|
+
`.agents/` or `.claude/`
|
|
257
|
+
: Config directories for commands, agents, skills.
|
|
156
258
|
|
|
259
|
+
`AGENTS.md` / `CLAUDE.md`
|
|
260
|
+
: Project context files.
|
package/lefthook.yml
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mini-coder",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A small, fast CLI coding agent",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"test": "bun test --only-failures",
|
|
19
19
|
"test:verbose": "bun test",
|
|
20
20
|
"jscpd": "jscpd src",
|
|
21
|
-
"
|
|
21
|
+
"prepare": "lefthook install"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@ai-sdk/anthropic": "^3.0.60",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@types/bun": "latest",
|
|
38
38
|
"jscpd": "^4.0.8",
|
|
39
39
|
"knip": "^5.86.0",
|
|
40
|
+
"lefthook": "^2.1.4",
|
|
40
41
|
"typescript": "^5.9.3"
|
|
41
42
|
},
|
|
42
43
|
"knip": {
|
package/docs/configs.md
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
# Config conventions
|
|
2
|
-
|
|
3
|
-
mini-coder supports both its native `.agents` convention and `.claude` layouts for commands, skills, and agents.
|
|
4
|
-
|
|
5
|
-
Only commands, skills, agents, and context files are loaded from these roots. Hook directories are ignored.
|
|
6
|
-
|
|
7
|
-
Discovery is not identical for every config type:
|
|
8
|
-
|
|
9
|
-
- **Commands** and **agents** are loaded from the current working directory and the home directory only.
|
|
10
|
-
- **Skills** are loaded from the home directory plus local directories discovered by walking up from the current working directory to the git worktree root.
|
|
11
|
-
- **Context files** are only loaded from the current working directory and the home directory.
|
|
12
|
-
|
|
13
|
-
## Supported config roots
|
|
14
|
-
|
|
15
|
-
| Root | Purpose |
|
|
16
|
-
|---|---|
|
|
17
|
-
| `.agents/` | mini-coder native config |
|
|
18
|
-
| `.claude/` | Alternate config layout supported by mini-coder |
|
|
19
|
-
|
|
20
|
-
Each root can exist in:
|
|
21
|
-
|
|
22
|
-
- **Local (repo):** `./.agents`, `./.claude`
|
|
23
|
-
- **Global (home):** `~/.agents`, `~/.claude`
|
|
24
|
-
|
|
25
|
-
## Commands
|
|
26
|
-
|
|
27
|
-
Supported locations:
|
|
28
|
-
|
|
29
|
-
- `./.agents/commands/*.md`
|
|
30
|
-
- `~/.agents/commands/*.md`
|
|
31
|
-
- `./.claude/commands/*.md`
|
|
32
|
-
- `~/.claude/commands/*.md`
|
|
33
|
-
|
|
34
|
-
Format:
|
|
35
|
-
|
|
36
|
-
```md
|
|
37
|
-
---
|
|
38
|
-
description: Optional help text
|
|
39
|
-
model: optional/model-override
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
Prompt template body with $ARGUMENTS and $1..$9 support.
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Filename becomes the command name (`review.md` => `/review`).
|
|
46
|
-
|
|
47
|
-
## Skills
|
|
48
|
-
|
|
49
|
-
Supported locations:
|
|
50
|
-
|
|
51
|
-
- local: `./.agents/skills/<skill-name>/SKILL.md` and `./.claude/skills/<skill-name>/SKILL.md`
|
|
52
|
-
- global: `~/.agents/skills/<skill-name>/SKILL.md` and `~/.claude/skills/<skill-name>/SKILL.md`
|
|
53
|
-
|
|
54
|
-
For local skills, mini-coder searches not just the current working directory, but each ancestor directory up to the git worktree root.
|
|
55
|
-
|
|
56
|
-
Format:
|
|
57
|
-
|
|
58
|
-
```md
|
|
59
|
-
---
|
|
60
|
-
name: required-skill-name
|
|
61
|
-
description: Required help text
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
Skill instructions/content.
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Both `name` and `description` are required. Invalid skills are skipped with a warning.
|
|
68
|
-
|
|
69
|
-
## Agents
|
|
70
|
-
|
|
71
|
-
Supported locations:
|
|
72
|
-
|
|
73
|
-
- `./.agents/agents/*.md`
|
|
74
|
-
- `~/.agents/agents/*.md`
|
|
75
|
-
- `./.claude/agents/*.md`
|
|
76
|
-
- `~/.claude/agents/*.md`
|
|
77
|
-
|
|
78
|
-
Format:
|
|
79
|
-
|
|
80
|
-
```md
|
|
81
|
-
---
|
|
82
|
-
description: Optional help text
|
|
83
|
-
model: optional/model-override
|
|
84
|
-
mode: optional agent mode
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
Agent system prompt.
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Context files
|
|
91
|
-
|
|
92
|
-
mini-coder loads at most one global context file and at most one local context file, then includes both when present.
|
|
93
|
-
|
|
94
|
-
Global lookup order:
|
|
95
|
-
|
|
96
|
-
1. `~/.agents/AGENTS.md`
|
|
97
|
-
2. `~/.agents/CLAUDE.md`
|
|
98
|
-
|
|
99
|
-
Local lookup order:
|
|
100
|
-
|
|
101
|
-
1. `./.agents/AGENTS.md`
|
|
102
|
-
2. `./CLAUDE.md`
|
|
103
|
-
3. `./AGENTS.md`
|
|
104
|
-
|
|
105
|
-
Injection order:
|
|
106
|
-
|
|
107
|
-
1. Global context (if found)
|
|
108
|
-
2. Local context (if found)
|
|
109
|
-
|
|
110
|
-
## Precedence and conflicts
|
|
111
|
-
|
|
112
|
-
Precedence rules for commands, skills, and agents:
|
|
113
|
-
|
|
114
|
-
1. **Local overrides global**
|
|
115
|
-
2. At the **same scope** (both local or both global), if `.agents` and `.claude` define the same name, **`.agents` wins**
|
|
116
|
-
3. For **skills only**, when the same skill name exists in multiple local ancestor directories, the skill nearest to the current working directory wins
|
|
117
|
-
|
|
118
|
-
When same-scope `.agents` / `.claude` conflicts are detected for commands, skills, or agents, mini-coder prints a warning and uses the `.agents` version.
|
package/docs/custom-agents.md
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Custom Agents
|
|
2
|
-
|
|
3
|
-
A custom agent is a reusable system prompt with an optional model override.
|
|
4
|
-
You can activate one with `/agent <name>`, and non-`primary` agents are also exposed to the `subagent` tool.
|
|
5
|
-
|
|
6
|
-
mini-coder is shell-first, so custom agents should assume repo inspection and verification happen through shell, with targeted edits done via `mc-edit` invoked from shell.
|
|
7
|
-
|
|
8
|
-
## Where to put them
|
|
9
|
-
|
|
10
|
-
| Location | Scope |
|
|
11
|
-
|---|---|
|
|
12
|
-
| `.agents/agents/*.md` | Current repo only |
|
|
13
|
-
| `~/.agents/agents/*.md` | All projects (global) |
|
|
14
|
-
| `.claude/agents/*.md` | Current repo only (`.claude` layout) |
|
|
15
|
-
| `~/.claude/agents/*.md` | All projects (global, `.claude` layout) |
|
|
16
|
-
|
|
17
|
-
Local agents override global ones with the same name. At the same scope, `.agents` wins over `.claude`.
|
|
18
|
-
|
|
19
|
-
## Create an agent
|
|
20
|
-
|
|
21
|
-
The filename becomes the agent name.
|
|
22
|
-
|
|
23
|
-
`~/.agents/agents/reviewer.md`:
|
|
24
|
-
|
|
25
|
-
```md
|
|
26
|
-
---
|
|
27
|
-
description: Strict code reviewer focused on bugs and structure
|
|
28
|
-
model: zen/claude-sonnet-4-6
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
You are a senior engineer doing a code review. Be direct and specific.
|
|
32
|
-
Cite file and line number for every finding. Flag bugs first, then
|
|
33
|
-
structure issues, then style — only if they violate project conventions.
|
|
34
|
-
No flattery. End with a one-line verdict.
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Then in the REPL:
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
/agent reviewer
|
|
41
|
-
review the auth module for race conditions
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Frontmatter fields
|
|
45
|
-
|
|
46
|
-
| Field | Required | Description |
|
|
47
|
-
|---|---|---|
|
|
48
|
-
| `description` | No | Shown in `/help`. Defaults to filename. |
|
|
49
|
-
| `model` | No | Override the active model for this agent. |
|
|
50
|
-
| `mode` | No | Controls whether the agent is exposed through the `subagent` tool. `primary` excludes it from that tool and is intended for `/agent`. `subagent`, `all`, and an omitted value all keep it available to the `subagent` tool. Any loaded agent can currently still be selected with `/agent <name>`. |
|
|
51
|
-
|
|
52
|
-
The markdown body (after frontmatter) is the agent's system prompt.
|
|
53
|
-
|
|
54
|
-
## Combining with files
|
|
55
|
-
|
|
56
|
-
File references are resolved before the prompt is sent:
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
/agent reviewer
|
|
60
|
-
@src/auth/session.ts check this file for issues
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Listing agents
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
/help
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Agents are listed in magenta, tagged `(local)` or `(global)`.
|