@@ -1,201 +0,0 @@
1----
2-name: mini-coder
3-description: "How to use the `mc` CLI coding agent — interactive sessions, one-shot prompts, slash commands, file editing with mc-edit, and orchestrating subagents for complex tasks. Use when helping users operate mc, or when acting as an mc agent yourself."
4----
5-
6-# mini-coder
7-
8-Use this skill when you need to help a user operate the `mc` command-line tool, or when you are acting as an `mc` agent yourself.
9-
10-`mc` is the executable for **mini-coder**, a small CLI coding agent. This skill covers **how to use the tool**, not how the mini-coder repo is implemented.
11-
12-## Command-line usage
13-
14-```sh
15-mc # interactive session
16-mc "explain this codebase" # one-shot prompt
17-mc -c # continue most recent session
18-mc -r <session-id> # resume a specific session
19-mc -l # list recent sessions
20-mc -m <model-id> # pick a model
21-mc --cwd <path> # run in another directory
22-mc -h # help
23-```
24-
25-## Interactive slash commands
26-
27-Inside `mc`:
28-
29-| Command | Purpose |
30-| ----------------------------------------------- | --------------------------------------------- |
31-| `/help` | Show help |
32-| `/model` | List models |
33-| `/model <id>` | Switch model |
34-| `/model effort <low\|medium\|high\|xhigh\|off>` | Set reasoning effort |
35-| `/reasoning [on\|off]` | Toggle reasoning display |
36-| `/verbose` | Toggle output truncation |
37-| `/undo` | Remove last turn (does not revert filesystem) |
38-| `/new` | Start a fresh session |
39-| `/mcp list` | List MCP servers |
40-| `/mcp add <name> http <url>` | Add HTTP MCP server |
41-| `/mcp add <name> stdio <cmd> [args...]` | Add stdio MCP server |
42-| `/mcp remove <name>` | Remove MCP server |
43-| `/login [provider]` | Show or start OAuth login |
44-| `/logout <provider>` | Clear OAuth tokens |
45-| `/exit`, `/quit`, `/q` | Leave the session |
46-
47-## Prompt input features
48-
49-- **Shell input** — prefix with `!` to run a shell command inline and feed output to the LLM.
50-- **File references** — `@path/to/file` embeds a file into the prompt (autocompletes paths).
51-- **Skill / agent refs** — `/` triggers autocomplete for skills and agents.
52-- **Images** — paste image data URLs or file paths directly.
53-- **ESC** interrupts an in-progress response (preserves partial output). `Ctrl+C` exits forcefully, `Ctrl+D` exits gracefully.
54-
55-## File editing with mc-edit
56-
57-`mc` is shell-first. The preferred workflow is: **inspect → edit → verify**.
58-
59-```sh
60-mc-edit <path> (--old <text> | --old-file <path>) [--new <text> | --new-file <path>] [--cwd <path>]
61-```
62-
63-- Applies one exact-text replacement per invocation.
64-- Old text must match exactly once (fails on zero or multiple matches).
65-- Omit `--new` / `--new-file` to delete matched text.
66-- Prints a unified diff + metadata on success; errors go to stderr.
67-
68-### Examples
69-
70-```sh
71-mc-edit src/auth.ts --old "function login(user)" --new "async function login(user)"
72-
73-mc-edit src/config.ts --old "// TODO: remove this
74-const DEBUG = true;"
75-
76-mc-edit src/big.ts --old-file /tmp/old.txt --new-file /tmp/new.txt
77-```
78-
79-## Config locations
80-
81-mini-coder discovers configs from both `.agents` and `.claude` layouts:
82-
83-| Scope | Paths |
84-| ------ | -------------------------------------------------------------------------------------- |
85-| Local | `.agents/commands/*.md`, `.agents/agents/*.md`, `.agents/skills/<name>/SKILL.md` |
86-| Global | `~/.agents/commands/*.md`, `~/.agents/agents/*.md`, `~/.agents/skills/<name>/SKILL.md` |
87-
88-Same structure applies under `.claude/` and `~/.claude/`.
89-
90-App data (sessions, MCP config, logs) lives in `~/.config/mini-coder/`.
91-
92-## Orchestration mode
93-
94-For complex, multi-part tasks you can use `mc` as a subagent coordinator.
95-
96-### Core principles
97-
98-- **Decompose first.** Break the task into 2–5 independent, self-contained subtasks.
99-- **Delegate aggressively.** Spawn focused subagents via `mc "prompt"` in the shell tool — each gets a single precise goal.
100-- **Parallelise when possible.** Dispatch independent subtasks concurrently.
101-- **Stay the coordinator.** You own the big picture; subagents handle the details. Synthesise their results, resolve conflicts, report back clearly.
102-- **Fail fast.** If a subagent fails, stop and reassess before continuing.
103-
104-### Subagent prompt hygiene
105-
106-- Be explicit about what the agent should produce (a file, a code change, a summary).
107-- Include all relevant paths, constraints, and acceptance criteria — subagents have no shared memory.
108-- Never give vague briefs; ambiguity leads to rework and wasted tokens.
109-
110-### When NOT to delegate
111-
112-- Trivial lookups or single-file reads — do them directly.
113-- Tasks requiring continuous back-and-forth with the user — handle interactively.
114-
115-## Using tmux with mc
116-
117-When testing `mc` interactively from an outer agent or script, use `tmux` to drive the session. This avoids the limitations of non-interactive shell invocations.
118-
119-### Setup
120-
121-```sh
122-tmux new-session -d -s test -x 200 -y 50
123-tmux send-keys -t test 'bun run dev' Enter # or 'mc'
124-sleep 3 # wait for banner
125-```
126-
127-### Sending input
128-
129-Use `-l` (literal) to avoid key-name interpretation, then send `Enter` separately:
130-
131-```sh
132-tmux send-keys -t test -l "What files are in src/"
133-tmux send-keys -t test Enter
134-sleep 10
135-tmux capture-pane -t test -p -S -30 # read last 30 lines
136-```
137-
138-### Paste detection
139-
140-`mc` uses bracketed paste mode. When `tmux send-keys` delivers text rapidly (even with `-l`), the terminal may wrap it in paste brackets. This causes `mc` to show a `[pasted: "…"]` label instead of echoing the typed text. **This is expected behavior** — real users typing character-by-character won't trigger it.
141-
142-To work around it in automation:
143-
144-- **Short prompts**: use `send-keys -l "text"` + `send-keys Enter` — paste label is cosmetic, submission still works.
145-- **Slash commands**: same pattern — `/model zen/claude-haiku-4-5` + `Enter`.
146-- **Multi-line input**: not supported in the prompt; send one logical prompt per submission.
147-
148-### Reading output
149-
150-```sh
151-tmux capture-pane -t test -p -S -50 # last 50 lines
152-tmux capture-pane -t test -p -S -50 -E -1 # specific range
153-```
154-
155-Capture after a generous `sleep` — tool calls and streaming take time.
156-
157-### Sending special keys
158-
159-```sh
160-tmux send-keys -t test Escape # interrupt response (ESC)
161-tmux send-keys -t test C-d # graceful exit (Ctrl+D)
162-tmux send-keys -t test C-c # force exit (Ctrl+C)
163-```
164-
165-### Cleanup
166-
167-```sh
168-tmux send-keys -t test C-d
169-sleep 1
170-tmux kill-session -t test
171-```
172-
173-### Full example: test a model switch + prompt
174-
175-```sh
176-tmux new-session -d -s test -x 200 -y 50
177-tmux send-keys -t test 'mc' Enter
178-sleep 3
179-
180-tmux send-keys -t test -l "/model zen/gemini-3-flash"
181-tmux send-keys -t test Enter
182-sleep 2
183-
184-tmux send-keys -t test -l "List the files in the current directory"
185-tmux send-keys -t test Enter
186-sleep 15
187-
188-tmux capture-pane -t test -p -S -30 # review output
189-
190-tmux send-keys -t test C-d
191-sleep 1
192-tmux kill-session -t test
193-```
194-
195-## Tips for helping users
196-
197-- Prefer exact commands the user can paste.
198-- Distinguish **shell commands** (outside `mc`) from **slash commands** (inside `mc`).
199-- Suggest `mc -h` or `/help` for discovery.
200-- Suggest `mc -l` / `mc -c` / `mc -r <id>` for session recovery.
201-- Mention `--cwd` for wrong-directory issues, `-m` for model selection.