@wular/coder 0.2.0 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wular/coder",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Delegating coding-agent runtime",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,7 +22,6 @@
22
22
  "dist",
23
23
  "plugins",
24
24
  ".claude-plugin",
25
- ".agents",
26
25
  "README.md",
27
26
  "docs"
28
27
  ],
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: coder
3
+ description: Use Coder for any coding, implementation, or investigation task - features, fixes, refactors, debugging, tests, code questions. You orchestrate, never implement yourself; dispatch through the `coder` CLI, one coder per focused goal, fanning out many coders in parallel as the work needs.
4
+ ---
5
+
6
+ # Coder dispatch
7
+
8
+ You dispatch coding tasks through the `coder` runtime instead of implementing them yourself. By default the runtime picks the engine from its configured chain; flags like `--agent`/`--model`/`--effort` override it.
9
+
10
+ If `coder` is not on PATH, install it yourself without asking (`npm install -g @wular/coder`). Assume nothing about setup state - the user may or may not have run setup. When a dispatch fails because engines are missing or logged out, run `coder setup-host` and follow its output: it checks engines and auth, seeds the config, refreshes this skill, auto-updates codex when too old for the default model, and prints the exact fix for anything not ready (safe to re-run anytime). Ask the user before installing an engine CLI or changing auth; if setup updated codex, tell the user to restart their codex session.
11
+
12
+ ## Dispatching a task
13
+
14
+ - If your harness sandboxes terminal commands or asks approval for them (Codex does both), run every `coder` command with escalated/approved permissions - outside the sandbox, justification: Coder is a supervisor - it spawns engines, keeps state in `~/.coder`, and enforces its own sandbox and approval policy on the task. Never retry a blocked `coder` call inside a (stricter) sandbox or with HOME/state env workarounds.
15
+ - One coder per focused goal. When the work splits into independent parts, decompose it and dispatch each part as its own `coder task run` call - fan out a wide web of coders running in parallel, not one giant dispatch. Give each coder a self-contained goal with all context - overview, file paths, constraints (read-only, git rules). Run independent tasks concurrently; use `steer` to continue a single coder's thread.
16
+ - Delegation is a hard gate for anything the engine can do itself: do not read source files, investigate, or write code first - no matter how simple the task. Fold into the task text whatever only you have - conversation context, results from tools the engine lacks. The coder worker runs with plugins disabled (no skills, MCP, or connectors), so include any context only a plugin or MCP tool of yours produced.
17
+ - Compose one self-contained task text (goal, relevant paths, constraints) and dispatch it. It backgrounds by default: the runtime does a startup check and prints a task id (or errors / hands off, see exit codes):
18
+
19
+ ```bash
20
+ coder task run "<task text>"
21
+ ```
22
+
23
+ Fetch the answer with `coder task result <task-id> --wait` - it blocks until the task finishes, then prints only the final result (keeps your context clean). Only use `--wait` when your harness can run it in a **background shell** (so it does not block you); without one, poll `coder task result <task-id>` (no `--wait`) until it is done. Or skip the two steps and block on the run itself with `--wait` on `coder task run`.
24
+
25
+ - A `--wait` (on `run` or `result`) exits **4** when the task is waiting on a permission approval: relay the approval to the user, apply their decision with `coder approve <task-id> <approval-id> [--deny]`, then re-fetch with `coder task result <task-id> --wait`. (Unanswered approvals auto-deny after 120s and the task moves on.)
26
+
27
+ - `coder task run` exits after its startup check. Exit 0: the task started - relay the task id and fetch its result (above). Exit 1: it failed to start or the turn failed - report it, do not retry or fall back yourself. Exit 3: no engine in the chain could start and stdout carries a `run-native-subagent` payload - see below.
28
+ - When the first engine can't start (auth, quota, rate limit), the runtime automatically falls back to the next engine in the chain, runs the same task on it, and still exits 0 - so just fetch the result. If the failure mentions a usage-limit reset time, relay that to the user.
29
+ - Engine, model, and effort come from config; add `--agent` / `--model` / `--effort` when the user asks or it is unambiguous from context (agents: `codex`, `claude`; codex models: `spark`, `luna`, `terra`, `sol`; claude models: `opus`, `sonnet`, `fable`; efforts: `low|medium|high`).
30
+ - `spark` is only for the very lightest tasks (formatting, renames, quick lookups) - very fast and very cheap. It runs on a separate quota, so reach for it when the others hit a usage limit; it may still run once they are exhausted.
31
+ - Permissions default to auto mode (workspace-write + policy-answered escalations). Pass `--permissions read-only` when the task is read-only; `--permissions workspace-write` to forbid any escalation beyond the project.
32
+ - A background dispatch prints a task id plus its result/steer/stop commands. Relay them and fetch the result (above) rather than polling.
33
+
34
+ ## Last resort: run-native-subagent payload (exit 3)
35
+
36
+ When no coder engine can start (missing binaries, auth, quota across the whole chain), the runtime exits 3 with a JSON payload (`fallback.action: "run-native-subagent"`). Mention the failure to the user (including any limit-reset time). If your harness has a subagent facility, spawn one subagent whose prompt is the payload's `task` verbatim, prefixed with: "NEVER run git write operations (commit, checkout, stash, reset, push, etc.); leave changes uncommitted." If the payload's `permissions` is not `auto`, append it: `read-only` means investigate and report without modifying anything; `workspace-write` means never touch anything outside the workspace. Relay its output when it completes. If your harness has no subagent facility, report the failure and stop - never implement the task yourself.
37
+
38
+ ## Supervision loop
39
+
40
+ With coders running in the background, don't fire-and-forget: check in on them recurrently with whatever scheduling facility your harness has (interval by the work's pace, 10m default); without one, check between your other steps. Each tick: `coder task list`, fetch finished results, dispatch newly unblocked coders, steer stuck ones, stop off-track ones, surface pending approvals. Stop when all tasks are done and relayed.
41
+
42
+ ## Controlling tasks
43
+
44
+ - Continue prior work ("keep going", "apply the top fix"): `coder task steer <task-id> "<follow-up>"`.
45
+ - Inspect: `coder task result <task-id>` (status + answer; add `--wait` to block until done) and `coder task list`. (`coder task stream <task-id>` streams the live progress log - to watch/debug in special cases, generally not for you to consume.)
46
+ - Interrupt: `coder task stop <task-id>`.
47
+ - If status shows `pendingApprovals`, surface them to the user; apply their decision with `coder task approve <task-id> <approval-id> [--deny]`.
48
+
49
+ ## Hard rules
50
+
51
+ - Forward task text verbatim in `steer` follow-ups - never rewrite or summarize what the user asked for.
52
+ - Tell every coder to never run git write operations (commit, checkout, stash, reset, rebase, merge, push, etc.) and to leave changes uncommitted.
53
+ - Pass the user's constraints (read-only, scoped paths) into each coder's task text, and honor them over your own preferences.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Delegate coding tasks to a Coder subagent. Your main context stays clean.",
5
5
  "author": {
6
6
  "name": "muzam1l"
@@ -5,13 +5,13 @@ description: Use Coder for any coding, implementation, or investigation task - f
5
5
 
6
6
  # Coder dispatch
7
7
 
8
- You dispatch coding tasks through the `coder` runtime instead of implementing them yourself. By default the runtime picks the engine from its configured chain; Flags like `--agent`/`--model`/`--effort` override it.
8
+ You dispatch coding tasks through the `coder` runtime instead of implementing them yourself. By default the runtime picks the engine from its configured chain; flags like `--agent`/`--model`/`--effort` override it.
9
9
 
10
- If `coder` is not on PATH, install it yourself without asking (`npm install -g @wular/coder`), then continue; suggest the user run `/coder:setup` to configure the engines and chain.
10
+ If `coder` is not on PATH, install it yourself without asking (`npm install -g @wular/coder`). Assume nothing about setup state - the user may or may not have run setup. When a dispatch fails because engines are missing or logged out, run `coder setup-host claude` and follow its output: it checks engines and auth, seeds the config, installs the host plugin, auto-updates codex when too old for the default model, and prints the exact fix for anything not ready (safe to re-run anytime). Ask the user before installing an engine CLI or changing auth; if setup updated codex, tell the user to restart their codex session. For a guided setup, suggest `/coder:setup`.
11
11
 
12
12
  ## Dispatching a task
13
13
 
14
- - One coder per focused goal. When the work splits into independent parts, decompose it and dispatch each part as its own background `coder task` - fan out a wide web of coders running in parallel, not one giant dispatch. Give each coder a self-contained goal with all context - overview, file paths, constraints (read-only, git rules). Run independent tasks concurrently; use `steer` to continue a single coder's thread.
14
+ - One coder per focused goal. When the work splits into independent parts, decompose it and dispatch each part as its own `coder task run` call - fan out a wide web of coders running in parallel, not one giant dispatch. Give each coder a self-contained goal with all context - overview, file paths, constraints (read-only, git rules). Run independent tasks concurrently; use `steer` to continue a single coder's thread.
15
15
  - Delegation is a hard gate for anything the engine can do itself: do not read source files, investigate, or write code first - no matter how simple the task. Fold into the task text whatever only you have - conversation context, results from tools the engine lacks. The coder worker runs with plugins disabled (no skills, MCP, or connectors), so include any context only a plugin or MCP tool of yours produced.
16
16
  - Compose one self-contained task text (goal, relevant paths, constraints) and dispatch it. It backgrounds by default: the runtime does a startup check and prints a task id (or errors / hands off, see exit codes):
17
17
 
@@ -19,7 +19,7 @@ If `coder` is not on PATH, install it yourself without asking (`npm install -g @
19
19
  coder task run "<task text>"
20
20
  ```
21
21
 
22
- Fetch the answer with `coder task result <task-id> --wait` - it blocks until the task finishes, then prints only the final answer (keeps your context clean). Run it as a **background Bash call** so it does not block you and you are re-invoked on completion:
22
+ Fetch the answer with `coder task result <task-id> --wait` - it blocks until the task finishes, then prints only the final result (keeps your context clean). Run it as a **background Bash call** so it does not block you and you are re-invoked on completion:
23
23
 
24
24
  ```bash
25
25
  coder task result <task-id> --wait # Bash run_in_background: true
@@ -29,7 +29,8 @@ If `coder` is not on PATH, install it yourself without asking (`npm install -g @
29
29
 
30
30
  - A `--wait` (on `run` or `result`) exits **4** when the task is waiting on a permission approval: relay the approval to the user, apply their decision with `coder approve <task-id> <approval-id> [--deny]`, then re-fetch with `coder task result <task-id> --wait`. (Unanswered approvals auto-deny after 120s and the task moves on.)
31
31
 
32
- - `coder task run` exits after its startup check. Exit 0: the task started - relay the task id and fetch its result (above). Exit 1: it failed to start - report it, do not retry or fall back yourself. Exit 3: no engine in the chain could start and stdout carries a `run-native-subagent` payload - see below. (The runtime runs every engine itself, claude included, and falls back through its configured chain on startup failures - never fall back by implementing the task yourself.)
32
+ - `coder task run` exits after its startup check. Exit 0: the task started - relay the task id and fetch its result (above). Exit 1: it failed to start or the turn failed - report it, do not retry or fall back yourself. Exit 3: no engine in the chain could start and stdout carries a `run-native-subagent` payload - see below.
33
+ - When the first engine can't start (auth, quota, rate limit), the runtime automatically falls back to the next engine in the chain, runs the same task on it, and still exits 0 - so just fetch the result. If the failure mentions a usage-limit reset time, relay that to the user.
33
34
  - Engine, model, and effort come from config; add `--agent` / `--model` / `--effort` when the user asks or it is unambiguous from context (agents: `codex`, `claude`; codex models: `spark`, `luna`, `terra`, `sol`; claude models: `opus`, `sonnet`, `fable`; efforts: `low|medium|high`).
34
35
  - `spark` is only for the very lightest tasks (formatting, renames, quick lookups) - very fast and very cheap. It runs on a separate quota, so reach for it when the others hit a usage limit; it may still run once they are exhausted.
35
36
  - Permissions default to auto mode (workspace-write + policy-answered escalations). Pass `--permissions read-only` when the task is read-only; `--permissions workspace-write` to forbid any escalation beyond the project.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "coder",
3
3
  "displayName": "Coder",
4
- "version": "0.2.0",
4
+ "version": "0.2.2",
5
5
  "description": "Delegate coding tasks to a Coder subagent. Your main context stays clean.",
6
6
  "author": {
7
7
  "name": "muzam1l"
@@ -2,91 +2,57 @@
2
2
 
3
3
  # Coder
4
4
 
5
- ### Delegate the coding. Keep your context.
5
+ **Delegate coding to subagents of any model from your favorite harness.**
6
6
 
7
7
  </div>
8
8
 
9
- One runtime that hands your coding tasks to the best engine available and lets you steer, inspect, or stop any task while it works.
10
-
11
- Plugs into Claude Code or Codex to enable the harness with Coder instances.
12
-
13
9
  ## Why Coder
14
10
 
15
- - **A clean main thread.** Installed in Claude Code or Codex, dispatch is a single command from your session; the actual coding runs in a Coder subagent. File dumps, test output, and retries stay there; only the outcome returns to your conversation.
16
- - **Fast dispatch.** Coder keeps a single Codex engine warm in the background and hands tasks to it directly, instead of booting the CLI for every request. A handoff starts in seconds.
17
- - **Unified permissions.** One permission model across agents, with three modes: **Read-only**, **Workspace-write**, and **Auto**. Auto is the default: safe commands run, dangerous ones are blocked, and anything in between is brought to you for a yes/no.
18
- - **Tasks you can steer.** Every dispatch is a task. Check on it, read its result, give it follow-up instructions, or stop it, all by id, while it keeps working in the background.
19
- - **Graceful fallback.** If Codex can't start (auth, usage limits, not installed), the task flows to a Claude subagent with the same instructions. You configure the chain and the default model and effort for each agent.
20
- - **Any model, anywhere.** Codex can point at local models (Ollama, LM Studio, and other OpenAI-compatible endpoints) and third-party providers, so Coder can run your tasks on those too - not just the hosted defaults. That opens up the whole scope of engines you can delegate to.
11
+ - **Cross-harness.** One runtime, every host. The same subagents and models from Claude Code, Codex and more.
12
+ - **Cross-model.** Codex, Claude, any OpenAI-compatible endpoint, or local models. Pick per task.
13
+ - **Clean context.** Your conversation stays about intent and orchestration; implementation details live in the subagents.
14
+ - **Fast dispatch.** Handoffs are instant, and light enough to spin up a large number of subagents at once.
15
+ - **Steerable tasks.** Full visibility into every task, from live progress to mid-run course corrections.
16
+ - **Unified permissions.** Three modes across all engines: _Read-only_, _Workspace-write_, and _Auto_.
21
17
 
22
18
  ## Get started
23
19
 
24
- Coder runs your tasks on an **engine CLI** - it needs at least one of the [codex CLI](https://github.com/openai/codex) (`npm install -g @openai/codex`, then `codex login`) or the [Claude Code CLI](https://github.com/anthropics/claude-code) (`npm install -g @anthropic-ai/claude-code`, then `claude auth login`) installed and logged in. `coder setup-host` reports which are ready; if none is, install one of them to run tasks.
25
-
26
- Follow the install host specific guides below, then you can ask like:
27
-
28
- > Use Coder to explain the directory structure of the workspace.
29
-
30
- You can also add this to CLAUDE.md.
31
-
32
- > Always use Coder for all implementation and system exploring tasks.
33
-
34
- The work happens in the engine, and your session gets the result. Codex is the primary engine when available, with a Claude subagent as fallback.
35
-
36
- ### Cursor
20
+ **1. Install a host plugin**:
37
21
 
38
22
  ```
39
23
  /add-plugin Coder
40
24
  ```
41
25
 
42
- ### Claude Code
26
+ Or from the shell (installs the same skill via the Agent Skills dir, `~/.agents/skills`):
43
27
 
44
- ```
45
- /plugin marketplace add muzam1l/coder
46
-
47
- /plugin install coder@coder-plugins
48
-
49
- /reload-plugins
50
-
51
- /coder:setup
52
- ```
53
-
54
- Or from the shell:
55
-
56
- ```
28
+ ```bash
57
29
  npm install -g @wular/coder
58
- coder setup-host claude
30
+ coder setup-host agents
59
31
  ```
60
32
 
61
- ### Codex
33
+ **2. Connect at least one engine.** Either an engine CLI, logged in, to use that subscription:
62
34
 
63
- ```
64
- codex plugin marketplace add muzam1l/coder
65
- codex plugin add coder@coder-plugins
35
+ ```bash
36
+ npm install -g @openai/codex && codex login
37
+ # and/or
38
+ npm install -g @anthropic-ai/claude-code && claude auth login
66
39
  ```
67
40
 
68
- Or from the npm directly:
41
+ Or a local/provider model of your own (see [Bring your own model](docs/custom-models.md)). `coder setup-host` checks what's ready.
69
42
 
70
- ```
71
- npm install -g @wular/coder
72
- coder setup-host codex
73
- ```
43
+ **3. Ask your host to use it:**
74
44
 
75
- Note: Codex 'Approve for me' just disables invoking CLI agents, so just use 'Ask for approval'/'Full Access' when using Codex/ChatGPT app as host.
45
+ > Use Coder to explain the directory structure of the workspace.
76
46
 
77
- ## Staying up to date
47
+ Or make it the default in AGENTS.md/CLAUDE.md:
78
48
 
79
- ```bash
80
- coder upgrade
81
- ```
82
-
83
- It updates the CLI through whichever package manager installed it (npm, pnpm, yarn, or bun, auto-detected) and refreshes the host plugins to match. Narrow it with `--cli-only`, `--plugins-only`, `--codex`, `--claude`, or force a manager with `--pm <npm|pnpm|yarn|bun>`.
49
+ > Always use Coder for all implementation and system exploring tasks.
84
50
 
85
- Set `CODER_NO_UPDATE_CHECK=1` to silence the update notice.
51
+ Recommended setup: Claude Code as host (fable low/medium) and Codex (terra) as engine - best for performance and cost distribution.
86
52
 
87
53
  ## Configuration
88
54
 
89
- Machine defaults live in `~/.coder/config.json`; drop a `coder.config.json` in a repo to override per project.
55
+ Machine defaults live in `~/.coder/config.json`; a `coder.config.json` in a repo overrides per project.
90
56
 
91
57
  ```json
92
58
  {
@@ -94,26 +60,35 @@ Machine defaults live in `~/.coder/config.json`; drop a `coder.config.json` in a
94
60
  "agents": {
95
61
  "codex": { "model": "terra", "effort": "high", "permissions": "auto" },
96
62
  "claude": { "model": "opus", "effort": "medium", "permissions": "auto" }
63
+ },
64
+ "models": {
65
+ "qwen": { "baseUrl": "http://localhost:11434/v1", "model": "qwen2.5-coder:32b" }
97
66
  }
98
67
  }
99
68
  ```
100
69
 
70
+ ## Staying up to date
71
+
72
+ ```bash
73
+ coder upgrade
74
+ ```
75
+
76
+ Updates the CLI through whichever package manager installed it and refreshes the host plugins to match. See `coder upgrade --help` for narrowing flags. Set `CODER_NO_UPDATE_CHECK=1` to silence the update notice.
77
+
101
78
  ## Advanced usage
102
79
 
103
- You rarely need these - the agent drives tasks itself - but you can run them. Task commands live under `coder task <sub>`; the common ones have a top-level shortcut. Full docs: `coder --help`, `coder task <sub> --help`.
80
+ You rarely need these - the host agent drives tasks itself - but everything is scriptable:
104
81
 
105
82
  ```bash
106
- coder run "<text>" # dispatch a task (--wait to block for the answer)
107
- coder result [task-id] # status + final answer (--wait blocks until done)
108
- coder list [--all|--stopped] # list tasks (running by default)
109
- coder task steer <id> "<text>" # continue a task with new instructions
110
- coder task stop <id> # interrupt it
111
- coder task stream [id] # watch the live progress log (you/debugging)
112
- coder task archive <id> # archive a session (--all-stopped for all finished)
113
- coder task delete <id> # delete a session (--all-archived for all archived)
114
- coder task approve <id> <appr> # answer an escalated permission (--deny)
83
+ coder run "<text>" # dispatch a task (--wait to block for the answer)
84
+ coder list # list running tasks (--all for running & stopped)
85
+ coder result [task-id] # status + final answer (--wait blocks until done)
86
+ coder task steer <task-id> "<text>" # continue a task with new instructions
87
+ coder task stop <task-id> # interrupt it
88
+ coder task stream [task-id] # watch the live progress log
89
+ coder task approve <task-id> <appr-id> # answer an escalated permission (--deny)
115
90
  ```
116
91
 
117
- `run`/`list`/`result`/`stream` are shortcuts for the `task` subcommand. Any `[task-id]` defaults to the most recent task and accepts a unique prefix.
92
+ Any `[task-id]` defaults to the most recent task.
118
93
 
119
- Run flags (`run`/`steer`): `--wait` (foreground), `--agent codex|claude`, `--model spark|luna|terra|sol|opus|sonnet|fable`, `--effort low|medium|high`, `--permissions read-only|workspace-write|auto`, `--resume <task-id>`, `--json`.
94
+ Full docs: `coder --help`.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: coder
3
+ description: Use Coder for any coding, implementation, or investigation task - features, fixes, refactors, debugging, tests, code questions. You orchestrate, never implement yourself; dispatch through the `coder` CLI, one coder per focused goal, fanning out many coders in parallel as the work needs.
4
+ ---
5
+
6
+ # Coder dispatch (Cursor host)
7
+
8
+ You dispatch coding tasks through the `coder` runtime instead of implementing them yourself. By default the runtime picks the engine from its configured chain; flags like `--agent`/`--model`/`--effort` override it.
9
+
10
+ If `coder` is not on PATH, install it yourself without asking (`npm install -g @wular/coder`). Assume nothing about setup state - the user may or may not have run setup. When a dispatch fails because engines are missing or logged out, run `coder setup-host` and follow its output: it checks engines and auth, seeds the config, auto-updates codex when too old for the default model, and prints the exact fix for anything not ready (safe to re-run anytime; no host plugin to install - Cursor gets this skill from its marketplace). Ask the user before installing an engine CLI or changing auth; if setup updated codex, tell the user to restart their codex session.
11
+
12
+ ## Dispatching a task
13
+
14
+ - `coder` commands are safe to run in the terminal - the runtime is a supervisor: it spawns engines, keeps state in `~/.coder`, and enforces its own OS sandbox and approval policy on the task. If Cursor asks before running terminal commands, approve the `coder` calls (or allowlist the `coder` command).
15
+ - One coder per focused goal. When the work splits into independent parts, decompose it and dispatch each part as its own `coder task run` call - fan out a wide web of coders running in parallel, not one giant dispatch. Give each coder a self-contained goal with all context - overview, file paths, constraints (read-only, git rules). Run independent tasks concurrently; use `steer` to continue a single coder's thread.
16
+ - Delegation is a hard gate for anything the engine can do itself: do not read source files, investigate, or write code first - no matter how simple the task. Fold into the task text whatever only you have - conversation context, results from tools the engine lacks. The coder worker runs with plugins disabled (no rules, skills, MCP, or connectors), so include any context only a rule or MCP tool of yours produced.
17
+ - Compose one self-contained task text (goal, relevant paths, constraints) and dispatch it. It backgrounds by default: the runtime does a startup check and prints a task id (or errors / hands off, see exit codes):
18
+
19
+ ```bash
20
+ coder task run "<task text>"
21
+ ```
22
+
23
+ Fetch the answer with `coder task result <task-id> --wait` - it blocks until the task finishes, then prints only the final result (keeps your context clean). Only use `--wait` when you can run it in a **background terminal** (so it does not block you); if you can't, poll `coder task result <task-id>` (no `--wait`) until it is done. Or skip the two steps and block on the run itself with `--wait` on `coder task run`.
24
+
25
+ - A `--wait` (on `run` or `result`) exits **4** when the task is waiting on a permission approval: relay the approval to the user, apply their decision with `coder approve <task-id> <approval-id> [--deny]`, then re-fetch with `coder task result <task-id> --wait`. (Unanswered approvals auto-deny after 120s and the task moves on.)
26
+
27
+ - `coder task run` exits after its startup check. Exit 0: the task started - relay the task id and fetch its result (above). Exit 1: it failed to start or the turn failed - report it, do not retry or fall back yourself. Exit 3: no engine in the chain could start and stdout carries a `run-native-subagent` payload - see below.
28
+ - When the first engine can't start (auth, quota, rate limit), the runtime automatically falls back to the next engine in the chain, runs the same task on it, and still exits 0 - so just fetch the result. If the failure mentions a usage-limit reset time, relay that to the user.
29
+ - Engine, model, and effort come from config; add `--agent` / `--model` / `--effort` when the user asks or it is unambiguous from context (agents: `codex`, `claude`; codex models: `spark`, `luna`, `terra`, `sol`; claude models: `opus`, `sonnet`, `fable`; efforts: `low|medium|high`).
30
+ - `spark` is only for the very lightest tasks (formatting, renames, quick lookups) - very fast and very cheap. It runs on a separate quota, so reach for it when the others hit a usage limit; it may still run once they are exhausted.
31
+ - Permissions default to auto mode (workspace-write + policy-answered escalations). Pass `--permissions read-only` when the task is read-only; `--permissions workspace-write` to forbid any escalation beyond the project.
32
+ - A background dispatch prints a task id plus its result/steer/stop commands. Relay them and fetch the result (above) rather than polling.
33
+
34
+ ## Last resort: run-native-subagent payload (exit 3)
35
+
36
+ When no coder engine can start (missing binaries, auth, quota across the whole chain), the runtime exits 3 with a JSON payload (`fallback.action: "run-native-subagent"`). Mention the failure to the user (including any limit-reset time), then run the task with your own subagent facility: spawn one subagent whose prompt is the payload's `task` verbatim, prefixed with: "NEVER run git write operations (commit, checkout, stash, reset, push, etc.); leave changes uncommitted." If the payload's `permissions` is not `auto`, append it: `read-only` means investigate and report without modifying anything; `workspace-write` means never touch anything outside the workspace. Relay its output when it completes.
37
+
38
+ ## Supervision loop
39
+
40
+ With coders running in the background, don't fire-and-forget: run a recurring monitoring loop in this session (interval by the work's pace, 10m default). Each tick: `coder task list`, fetch finished results, dispatch newly unblocked coders, steer stuck ones, stop off-track ones, surface pending approvals. Stop the loop when all tasks are done and relayed.
41
+
42
+ ## Controlling tasks
43
+
44
+ - Continue prior work ("keep going", "apply the top fix"): `coder task steer <task-id> "<follow-up>"`.
45
+ - Inspect: `coder task result <task-id>` (status + answer; add `--wait` to block until done) and `coder task list`. (`coder task stream <task-id>` streams the live progress log - to watch/debug in special cases, generally not for you to consume.)
46
+ - Interrupt: `coder task stop <task-id>`.
47
+ - If status shows `pendingApprovals`, surface them to the user; apply their decision with `coder task approve <task-id> <approval-id> [--deny]`.
48
+
49
+ ## Hard rules
50
+
51
+ - Forward task text verbatim in `steer` follow-ups - never rewrite or summarize what the user asked for.
52
+ - Tell every coder to never run git write operations (commit, checkout, stash, reset, rebase, merge, push, etc.) and to leave changes uncommitted.
53
+ - Pass the user's constraints (read-only, scoped paths) into each coder's task text, and honor them over your own preferences.
@@ -1,18 +0,0 @@
1
- {
2
- "name": "coder-plugins",
3
- "interface": {
4
- "displayName": "Coder"
5
- },
6
- "plugins": [
7
- {
8
- "name": "coder",
9
- "source": {
10
- "source": "local",
11
- "path": "./plugins/codex"
12
- },
13
- "policy": {
14
- "installation": "AVAILABLE"
15
- }
16
- }
17
- ]
18
- }
@@ -1,9 +0,0 @@
1
- {
2
- "name": "coder",
3
- "version": "0.2.0",
4
- "interface": {
5
- "displayName": "Coder (plugin)"
6
- },
7
- "description": "Delegate coding tasks to a Coder subagent. Your main context stays clean.",
8
- "skills": "./skills/"
9
- }
@@ -1,51 +0,0 @@
1
- ---
2
- name: handle
3
- description: Use Coder for any coding, implementation, or investigation task - features, fixes, refactors, debugging, tests, code questions. You orchestrate, never implement yourself; dispatch through the `coder` CLI, one coder per focused goal, fanning out many coders in parallel as the work needs.
4
- ---
5
-
6
- # Coder dispatch (codex host)
7
-
8
- You dispatch coding tasks through the `coder` runtime instead of implementing them yourself. By default the runtime picks the engine from its configured chain; `--agent`/`--model`/`--effort` override it. You never spawn agents yourself in this host.
9
-
10
- If `coder` is not on PATH, install it yourself without asking: `npm install -g @wular/coder`, then `coder setup-host codex`. Only if that fails, show the user the error and those two commands. The configured chain (`coder config`) decides which engine runs first and which is the fallback; set it with `coder config set chain <first>,<second>`. Each engine needs its own CLI; the claude engine needs the claude CLI installed - if it is not, ask the user before installing it (on yes: `npm install -g @anthropic-ai/claude-code`, then have them run `claude` once to log in).
11
-
12
- When you run setup, also check codex is new enough for the default GPT-5.6 model, which needs codex `>= 0.144` (`codex --version`). If it is older, update it automatically without asking with `codex update` (codex's own updater; fall back to `npm install -g @openai/codex@latest` if it fails), then tell the user to restart their codex session so the update takes effect.
13
-
14
- ## Dispatching a task
15
-
16
- - Run every `coder` command with escalated permissions (outside your sandbox), justification: Coder is a supervisor - it spawns engines, keeps state in `~/.coder`, and enforces its own sandbox and approval policy on the task. Never retry a sandbox-blocked `coder` call sandboxed again or with HOME/state env workarounds.
17
- - One coder per focused goal. When the work splits into independent parts, decompose it and dispatch each part as its own `coder task run` call - fan out a wide web of coders, not one giant dispatch. Give each coder a self-contained goal with all context - overview, file paths, constraints (read-only, git rules); use `steer` to continue a single coder's thread.
18
- - Delegation is a hard gate for anything the engine can do itself: do not read source files, investigate, or write code first - no matter how simple the task. Fold into the task text whatever only you have - conversation context, results from tools the engine lacks. The coder worker runs with plugins disabled (no skills, MCP, or connectors), so include any context only a plugin or MCP tool of yours produced.
19
- - Compose one self-contained task text (goal, relevant paths, constraints) and dispatch it. It backgrounds by default: the runtime does a startup check and prints a task id (or errors / hands off, see exit codes):
20
-
21
- ```bash
22
- coder task run "<task text>"
23
- ```
24
-
25
- Fetch the answer with `coder task result <task-id> --wait` - it blocks until the task finishes, then prints only the final result (keeps your context clean). Only use `--wait` when you can run it in a **background shell** (so it does not block you); if you can't use that, poll `coder task result <task-id>` (no `--wait`) until it is done. Or skip the two steps and block on the run itself with `--wait` on `coder task run`. A `--wait` exits **4** when the task is waiting on a permission approval: relay it to the user, apply their decision with `coder approve <task-id> <approval-id> [--deny]`, then re-fetch with `coder task result <task-id> --wait` (unanswered approvals auto-deny after 120s and the task moves on).
26
-
27
- - `coder task run` exits after its startup check. Exit 0: the task started - fetch its result (above). Exit 1: it failed to start / the turn failed - report it, do not retry.
28
- - Exit 3: no engine in the chain could start; stdout carries a JSON payload (`fallback.action: "run-native-subagent"`). Mention the failure to the user (including any limit-reset time), then run the task with your own subagent facility: spawn one subagent whose prompt is the payload's `task` verbatim, prefixed with: "NEVER run git write operations (commit, checkout, stash, reset, push, etc.); leave changes uncommitted." If the payload's `permissions` is not `auto`, append it: `read-only` means investigate and report without modifying anything; `workspace-write` means never touch anything outside the workspace. Relay its output when it completes.
29
- - When the first engine can't start (auth, quota, rate limit), the runtime automatically falls back to the next engine in the chain, runs the same task on it via CLI, and still exits 0 - so just fetch the result. If the failure mentions a usage-limit reset time, relay that to the user.
30
-
31
- - Engine, model, and effort come from config; add `--agent` / `--model` / `--effort` when the user asks or it is unambiguous from context (agents: `codex`, `claude`; codex models: `spark`, `luna`, `terra`, `sol`; claude models: `opus`, `sonnet`, `fable`; efforts: `low|medium|high`).
32
- - `spark` is only for the very lightest tasks (formatting, renames, quick lookups) - very fast and very cheap. It runs on a separate quota, so reach for it when the others hit a usage limit; it may still run once they are exhausted.
33
- - Permissions default to auto mode. Pass `--permissions read-only` when the task is read-only; `--permissions workspace-write` to forbid any escalation beyond the project.
34
- - A background dispatch prints a task id plus its result/steer/stop commands. Relay them and fetch the result (above) rather than polling.
35
-
36
- ## Supervision loop
37
-
38
- With coders running in the background, don't fire-and-forget: run a recurring monitoring loop in this task (interval by the work's pace, 10m default). Each tick: `coder task list`, fetch finished results, dispatch newly unblocked coders, steer stuck ones, stop off-track ones, surface pending approvals. Stop the loop when all tasks are done and relayed.
39
-
40
- ## Controlling tasks
41
-
42
- - Continue prior work ("keep going", "apply the top fix"): `coder task steer <task-id> "<follow-up>"`.
43
- - Inspect: `coder task result <task-id>` (status + answer; add `--wait` to block until done) and `coder task list`. (`coder task stream <task-id>` streams the live progress log - to watch/debug in special cases, generally not for you to consume.)
44
- - Interrupt: `coder task stop <task-id>`.
45
- - If status shows `pendingApprovals`, surface them to the user; apply their decision with `coder task approve <task-id> <approval-id> [--deny]`.
46
-
47
- ## Hard rules
48
-
49
- - Forward task text verbatim in `steer` and retries - never rewrite or summarize what the user asked for.
50
- - Tell every coder, in its task text, to never run git write operations (commit, checkout, stash, reset, rebase, merge, push, etc.) and to leave changes uncommitted. The runtime's permission model also enforces this on the engines.
51
- - Pass the user's constraints (read-only, scoped paths) into each coder's task text, and honor them over your own preferences.
@@ -1,50 +0,0 @@
1
- ---
2
- name: handle
3
- description: Use Coder for any coding, implementation, or investigation task - features, fixes, refactors, debugging, tests, code questions. You orchestrate, never implement yourself; dispatch through the `coder` CLI, one coder per focused goal, fanning out many coders in parallel as the work needs.
4
- ---
5
-
6
- # Coder dispatch (Cursor host)
7
-
8
- You dispatch coding tasks through the `coder` runtime instead of implementing them yourself. By default the runtime picks the engine from its configured chain; `--agent`/`--model`/`--effort` override it. You never spawn agents yourself; the runtime spawns and supervises them.
9
-
10
- If `coder` is not on PATH, install it yourself without asking: `npm install -g @wular/coder`, then run `coder setup-host` to seed the config and check engine readiness (no host plugin is installed - Cursor gets this skill from the marketplace). Only if that fails, show the user the error and those commands. Coder needs at least one engine CLI installed and logged in: codex (`npm install -g @openai/codex`, then `codex login`) and/or claude (`npm install -g @anthropic-ai/claude-code`, then run `claude` once to log in) - ask the user before installing an engine CLI. The configured chain (`coder config`) decides which engine runs first and which is the fallback; set it with `coder config set chain <first>,<second>`.
11
-
12
- When you run setup, also check codex is new enough for the default GPT-5.6 model, which needs codex `>= 0.144` (`codex --version`). If it is older, update it automatically without asking with `codex update` (codex's own updater; fall back to `npm install -g @openai/codex@latest` if it fails), then tell the user to restart their codex session so the update takes effect.
13
-
14
- ## Dispatching a task
15
-
16
- - `coder` commands are safe to run in the terminal - the runtime is a supervisor: it spawns engines, keeps state in `~/.coder`, and enforces its own OS sandbox and approval policy on the task. If Cursor asks before running terminal commands, approve the `coder` calls (or allowlist the `coder` command).
17
- - One coder per focused goal. When the work splits into independent parts, decompose it and dispatch each part as its own `coder task run` call - fan out a wide web of coders, not one giant dispatch. Give each coder a self-contained goal with all context - overview, file paths, constraints (read-only, git rules); use `steer` to continue a single coder's thread.
18
- - Delegation is a hard gate for anything the engine can do itself: do not read source files, investigate, or write code first - no matter how simple the task. Fold into the task text whatever only you have - conversation context, results from tools the engine lacks. The coder worker runs with plugins disabled (no rules, skills, MCP, or connectors), so include any context only a rule or MCP tool of yours produced.
19
- - Compose one self-contained task text (goal, relevant paths, constraints) and dispatch it. It backgrounds by default: the runtime does a startup check and prints a task id (or errors, see exit codes):
20
-
21
- ```bash
22
- coder task run "<task text>"
23
- ```
24
-
25
- Fetch the answer with `coder task result <task-id> --wait` - it blocks until the task finishes, then prints only the final result (keeps your context clean). Run it in a **background terminal** so it does not block you; if you can't, poll `coder task result <task-id>` (no `--wait`) until it is done. Or skip the two steps and block on the run itself with `--wait` on `coder task run`. A `--wait` exits **4** when the task is waiting on a permission approval: relay it to the user, apply their decision with `coder task approve <task-id> <approval-id> [--deny]`, then re-fetch with `coder task result <task-id> --wait` (unanswered approvals auto-deny after 120s and the task moves on).
26
-
27
- - `coder task run` exits after its startup check. Exit 0: the task started - fetch its result (above). Exit 1: it failed to start / the turn failed - report it, do not retry.
28
- - Exit 3: no engine in the chain could start; stdout carries a JSON payload (`fallback.action: "run-native-subagent"`). Mention the failure to the user (including any limit-reset time), then run the task with your own subagent facility: spawn one subagent whose prompt is the payload's `task` verbatim, prefixed with: "NEVER run git write operations (commit, checkout, stash, reset, push, etc.); leave changes uncommitted." If the payload's `permissions` is not `auto`, append it: `read-only` means investigate and report without modifying anything; `workspace-write` means never touch anything outside the workspace. Relay its output when it completes.
29
- - Codex startup failures (auth, quota, rate limit) fall back to the next engine in the chain automatically - the runtime reruns the same task on the claude engine via its CLI and still exits 0, so just fetch the result. If it mentions a usage-limit reset time, relay that to the user.
30
- - Engine, model, and effort come from config; add `--agent` / `--model` / `--effort` when the user asks or it is unambiguous from context (agents: `codex`, `claude`; codex models: `spark`, `luna`, `terra`, `sol`; claude models: `opus`, `sonnet`, `fable`; efforts: `low|medium|high`).
31
- - `spark` is only for the very lightest tasks (formatting, renames, quick lookups) - very fast and very cheap. It runs on a separate quota, so reach for it when the others hit a usage limit; it may still run once they are exhausted.
32
- - Permissions default to auto mode. Pass `--permissions read-only` when the task is read-only; `--permissions workspace-write` to forbid any escalation beyond the project.
33
- - A background dispatch prints a task id plus its result/steer/stop commands. Relay them and fetch the result (above) rather than polling.
34
-
35
- ## Supervision loop
36
-
37
- With coders running in the background, don't fire-and-forget: run a recurring monitoring loop in this session (interval by the work's pace, 10m default). Each tick: `coder task list`, fetch finished results, dispatch newly unblocked coders, steer stuck ones, stop off-track ones, surface pending approvals. Stop the loop when all tasks are done and relayed.
38
-
39
- ## Controlling tasks
40
-
41
- - Continue prior work ("keep going", "apply the top fix"): `coder task steer <task-id> "<follow-up>"`.
42
- - Inspect: `coder task result <task-id>` (status + answer; add `--wait` to block until done) and `coder task list`. (`coder task stream <task-id>` streams the live progress log - to watch/debug in special cases, generally not for you to consume.)
43
- - Interrupt: `coder task stop <task-id>`.
44
- - If status shows `pendingApprovals`, surface them to the user; apply their decision with `coder task approve <task-id> <approval-id> [--deny]`.
45
-
46
- ## Hard rules
47
-
48
- - Forward task text verbatim in `steer` and retries - never rewrite or summarize what the user asked for.
49
- - Tell every coder, in its task text, to never run git write operations (commit, checkout, stash, reset, rebase, merge, push, etc.) and to leave changes uncommitted. The runtime's permission model also enforces this on the engines.
50
- - Pass the user's constraints (read-only, scoped paths) into each coder's task text, and honor them over your own preferences.