octomux 1.0.25 → 1.0.28

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.
Files changed (94) hide show
  1. package/README.md +137 -126
  2. package/agents/orchestrator.md +216 -0
  3. package/agents/planner.md +99 -0
  4. package/agents/reviewer.md +332 -0
  5. package/bin/octomux-hook-bridge.js +183 -0
  6. package/bin/octomux-hook-bridge.test.ts +331 -0
  7. package/cli/dist/action.js +8 -0
  8. package/cli/dist/client.js +57 -4
  9. package/cli/dist/commands/add-agent.js +20 -10
  10. package/cli/dist/commands/close-task.js +4 -4
  11. package/cli/dist/commands/create-skill.js +4 -4
  12. package/cli/dist/commands/create-task.js +113 -11
  13. package/cli/dist/commands/default-branch.js +4 -4
  14. package/cli/dist/commands/delete-skill.js +4 -4
  15. package/cli/dist/commands/delete-task.js +4 -4
  16. package/cli/dist/commands/get-skill.js +4 -4
  17. package/cli/dist/commands/get-task.js +4 -4
  18. package/cli/dist/commands/hooks-install.js +115 -0
  19. package/cli/dist/commands/hooks-list.js +177 -0
  20. package/cli/dist/commands/init.js +143 -0
  21. package/cli/dist/commands/list-skills.js +8 -9
  22. package/cli/dist/commands/list-tasks.js +9 -10
  23. package/cli/dist/commands/post-review.js +56 -0
  24. package/cli/dist/commands/recent-repos.js +8 -9
  25. package/cli/dist/commands/resume-task.js +4 -4
  26. package/cli/dist/commands/send-message.js +4 -4
  27. package/cli/dist/commands/stop-agent.js +4 -4
  28. package/cli/dist/commands/task-move.js +35 -0
  29. package/cli/dist/commands/task-note.js +20 -0
  30. package/cli/dist/commands/task-ref-add.js +27 -0
  31. package/cli/dist/commands/task-ref-rm.js +16 -0
  32. package/cli/dist/commands/task-summary.js +22 -0
  33. package/cli/dist/commands/task-updates.js +39 -0
  34. package/cli/dist/format.js +29 -0
  35. package/cli/dist/index.js +20 -0
  36. package/dist/assets/AgentEditor-DycLX5gc.js +1 -0
  37. package/dist/assets/ChatPage-BX3TyXOz.js +2 -0
  38. package/dist/assets/IntegrationsPage-DKzQcc9w.js +1 -0
  39. package/dist/assets/SettingsPage-B_civ8AA.js +9 -0
  40. package/dist/assets/SkillEditor-BLHi9Jym.js +1 -0
  41. package/dist/assets/TasksPage-C59OCX7K.js +5 -0
  42. package/dist/assets/WorkspaceDetailPage-DwACtQeu.js +1 -0
  43. package/dist/assets/WorkspacesPage-Dwp5ejqw.js +1 -0
  44. package/dist/assets/editor.worker-DyuDvpVp.js +26 -0
  45. package/dist/assets/index-Cuel_jco.js +18 -0
  46. package/dist/assets/index-Dkw-hNxU.css +1 -0
  47. package/dist/assets/switch-C09mhZ7e.js +1 -0
  48. package/dist/assets/vendor-monaco-8w_IdZy_.js +11 -0
  49. package/dist/assets/{vendor-react-BZ8ItZjw.js → vendor-react-DVZ9vYhU.js} +9 -9
  50. package/dist/assets/vendor-router-BNSfXSMI.js +12 -0
  51. package/dist/assets/vendor-ui-vLFv-L6M.js +17 -0
  52. package/dist/index.html +8 -5
  53. package/dist-server/agents-7NORWYDI.js +1 -0
  54. package/dist-server/chunk-CQGZWR4R.js +2 -0
  55. package/dist-server/chunk-E5HYNQ6D.js +1 -0
  56. package/dist-server/chunk-JJNLZ7U4.js +2 -0
  57. package/dist-server/chunk-OJAAM2XK.js +1 -0
  58. package/dist-server/chunk-QYDQSULJ.js +268 -0
  59. package/dist-server/chunk-UZUF5CZR.js +1 -0
  60. package/dist-server/chunk-WSL26W3H.js +16 -0
  61. package/dist-server/chunk-XMCSUNYM.js +1 -0
  62. package/dist-server/claude-code-H6WHSYXB.js +1 -0
  63. package/dist-server/harnesses-DH3SOF4F.js +1 -0
  64. package/dist-server/hook-settings-ENUKEL6E.js +1 -0
  65. package/dist-server/index.js +259 -97
  66. package/dist-server/preflight-SPZ34KHK.js +13 -0
  67. package/dist-server/registry-QDC56XWP.js +1 -0
  68. package/dist-server/resolve-env-GWFARUZQ.js +1 -0
  69. package/dist-server/startup.js +1 -1
  70. package/dist-server/store-AIK32B2H.js +1 -0
  71. package/package.json +13 -2
  72. package/scripts/demo-claude-welcome.sh +33 -0
  73. package/scripts/patch-docs-screenshots.ts +90 -0
  74. package/scripts/postinstall.sh +20 -2
  75. package/scripts/rollup-to-feat.sh +99 -0
  76. package/scripts/seed-docs-demo.ts +219 -0
  77. package/skills/add-agent/SKILL.md +71 -0
  78. package/skills/create-pr/SKILL.md +1 -1
  79. package/skills/create-task/SKILL.md +41 -5
  80. package/skills/send-agent-message/SKILL.md +94 -0
  81. package/skills/update-task-status/SKILL.md +124 -0
  82. package/templates/hooks/jira-status/jira-status +25 -0
  83. package/templates/hooks/jira-status/jira-status.config.json +6 -0
  84. package/templates/hooks/jira-status/template.json +4 -0
  85. package/dist/assets/AgentEditor-C-02PBsa.js +0 -1
  86. package/dist/assets/OrchestratorPage-Dp6XyUGc.js +0 -2
  87. package/dist/assets/SettingsPage-BE4VpmoN.js +0 -9
  88. package/dist/assets/SkillEditor-4ZIU7osw.js +0 -1
  89. package/dist/assets/TaskDetail-kfS8Yfvx.js +0 -1
  90. package/dist/assets/TerminalView-CguHyqU9.js +0 -3
  91. package/dist/assets/index-DXzXc59t.js +0 -2
  92. package/dist/assets/index-Faj6mSLR.css +0 -1
  93. package/dist/assets/vendor-router-DAafhmjl.js +0 -12
  94. package/dist/assets/vendor-ui-BEZHWVRx.js +0 -31
package/README.md CHANGED
@@ -4,172 +4,183 @@
4
4
 
5
5
  # octomux
6
6
 
7
- **Your local command center for autonomous Claude Code agents.**
7
+ > **Coding got faster. Managing agents didn't.**
8
8
 
9
- Pull tasks from Jira, GitHub, or any source your agent can read. Agents work in isolated worktrees. Get notified when they need you. PRs auto-link and tasks auto-close on merge. Review diffs with built-in lazygit. Survives restarts.
9
+ A local web app to **dispatch, watch, and review** parallel **Claude Code** and **Cursor** agents from one place. Kanban for fleet status. One inbox for every "allow this tool?" prompt. In-app diff review with **Ship**. No cloud. MIT.
10
10
 
11
- ![octomux dashboard](assets/screenshots/dashboard-hero.png)
12
-
13
- ## The Loop
14
-
15
- ```
16
- 1. INTAKE Pull Jira tickets or GitHub issues — auto-creates tasks with prompts
17
- 2. EXECUTE Each task gets its own worktree, branch, and Claude Code agents
18
- 3. SUPERVISE Live terminals + notifications when agents finish or need attention
19
- 4. REVIEW Built-in lazygit & lazyvim — check diffs without leaving octomux
20
- 5. MERGE PRs auto-detected and linked — tasks auto-close when PRs merge
21
- 6. RESUME Close your laptop. Reboot. Everything picks back up automatically.
11
+ ```bash
12
+ npm install -g octomux && octomux init && cd your-repo && octomux start
22
13
  ```
23
14
 
24
- > The orchestrator agent can drive this entire loop autonomously or you can control each step from the CLI and dashboard.
25
-
26
- ## Features
15
+ Open [http://localhost:7777](http://localhost:7777) describe a task in the composer, pick **Claude Code** or **Cursor**, and watch agents work in place.
27
16
 
28
- ### Orchestrator: agents managing agents
17
+ ## From prompt to merged PR
29
18
 
30
- A dedicated Claude Code instance that orchestrates your entire workflow. Create tasks, monitor status, add agents, create PRs — all via slash commands (`/create-task`, `/list-tasks`, `/status`, `/create-pr`).
19
+ Three phases, one window:
31
20
 
32
- Wire it to Jira MCP, GitHub CLI, or any source the orchestrator pulls context and creates properly named tasks with initial prompts. Ships with Claude Code skills (`create-task`, `create-pr`, `create-commit`) that any agent can use directly.
21
+ - **01 Dispatch.** Type a task. Pick Claude Code or Cursor. Hit go. The composer takes plain English, Jira links, or GitHub issue URLs. Drop a second agent on the same branch with one click.
22
+ - **02 — Watch.** See every agent work, live. Each task streams its own view — files the agent is editing, the diff as it grows, terminal output as it runs. When an agent needs permission, the prompt lands in your inbox so you don't have to babysit every pane.
23
+ - **03 — Review & Ship.** Diff review in the same window. File tree, per-file reviewed state, inline comments. Hit **Ship** and the PR auto-links to the task — closes itself when the PR merges.
33
24
 
34
- ![orchestrator](assets/screenshots/orchestrator.png)
25
+ Code never leaves your laptop. No telemetry, no cloud sync. Crash, reboot, close the lid — `octomux start` restores every task, branch, and session.
35
26
 
36
- ### Intake from anywhere
27
+ ## Screenshots
37
28
 
38
- - Any Claude Code agent can create tasks via `octomux create-task`
39
- - Works with Jira MCP, GitHub CLI, or anything your agent can read
40
- - Auto-generates task names and initial prompts from ticket context
41
- - Draft tasks: create in draft mode, edit title/prompt/branch before starting
29
+ | | |
30
+ | ----------------------------------------------------------------------------- | -------------------------------------------------------- |
31
+ | **Home inbox + composer** permission prompts, recent activity, dispatch bar | ![Home](assets/screenshots/dashboard-hero.png) |
32
+ | **Command center** kanban from backlog done | ![Command center](assets/screenshots/command-center.png) |
33
+ | **Settings** — default harness, Cursor model & `--force` | ![Settings](assets/screenshots/settings-harnesses.png) |
34
+ | **Task cockpit** — agent tabs, live Claude session, Ship, Done | ![Task detail](assets/screenshots/task-detail.png) |
35
+ | **Diff review** — file tree, reviewed state, inline comments | ![Diff](assets/screenshots/diff-review.png) |
42
36
 
43
- ### Isolated execution
37
+ ## Features
44
38
 
45
- - Each task gets its own git worktree, branch, and tmux session
46
- - Multiple agents per task, working in parallel
47
- - Custom base branches supported (work from `develop`, not just `main`)
48
- - Your main working tree stays untouched
39
+ - **Sessions inbox** every permission prompt and question lands in one place; reply once, agents keep going. Tab title shows `(N) octomux` when something needs you.
40
+ - **Command center** kanban for backlog → done; drag status, archive, workflow from draft → ship.
41
+ - **In-app diff review** compare to `main`, mark files reviewed, queue inline comments, open lazygit in-editor.
42
+ - **Dual harnesses** run **Claude Code** (`claude`) or **Cursor** (`cursor-agent`) per task; mix agents on one task via **Add agent**.
43
+ - **Worktrees keep agents off each other** — each task gets its own git worktree and `agents/<task-id>` branch; five agents can edit `auth.ts` at the same time without conflicts on your main tree.
44
+ - **Live task view** — see every agent work in real time: files edited, diff growing, terminal output streaming via xterm.js. Attach the same session from the CLI if you prefer.
45
+ - **Agents that dispatch agents** — `/create-task`, `/list-tasks`, `/send-agent-message` skills work inside any Claude Code window; recursive dispatch from inside an agent.
46
+ - **Integrations** — Jira wiring plus orchestrator skills for GitHub / auto-review intake.
47
+ - **CLI ↔ dashboard parity** — `octomux create-task`, `send-message`, `resume-task` — same tasks the UI shows.
48
+ - **Reboot-proof** — WAL SQLite + preserved worktrees across restarts.
49
+ - **Local-only** — no telemetry, no cloud sync, no analytics. Your `.env` stays on the host.
49
50
 
50
- ### Smart supervision
51
+ ## Patterns
51
52
 
52
- - Live terminals in the dashboard via xterm.js
53
- - Color-coded agent activity: green (active), gray (idle), amber (waiting for input)
54
- - Notifications when agents finish, stop unexpectedly, or hit permission prompts
55
- - Browser tab shows `(N) octomux` + red favicon dot when tasks need attention
56
- - Toast notifications with "View" button — one click to the relevant agent
57
- - Send messages to running agents via `octomux send-message`
58
- - Smart status: tasks needing attention surface before idle tasks
53
+ Three workflows octomux makes one-click:
59
54
 
60
- ![task detail](assets/screenshots/task-detail.png)
55
+ ### Verifier — two agents, two opinions
61
56
 
62
- ### Built-in review
57
+ Claude wrote it. Drop Cursor on the same branch for a second pass. Same-model self-review is just self-confirmation — a different model reads the diff without inheriting the first agent's assumptions. Catches missing nonce checks, off-by-one TTLs, and the kind of mistakes that pass type-checking but break in prod.
63
58
 
64
- - Lazygit and lazyvim integrated review diffs inside octomux
65
- - Open ad-hoc shell terminals in any task's worktree from the dashboard
66
- - No context switching to a separate terminal or IDE
67
- - Clean branches ready to push and PR when you're satisfied
59
+ > Finish a task with Claude hit **Add agent** → pick Cursor → reviews land as inline comments → you arbitrate, Ship.
68
60
 
69
- ![lazygit review](assets/screenshots/lazygit-review.png)
61
+ ### Sweep — five PRs by lunch
70
62
 
71
- ### Auto PR detection + merge
63
+ Paste a Jira filter or GitHub issue list into the composer. Each ticket gets its own worktree, branch, and agent. Mix Claude and Cursor across the batch so the model best at each kind of task ends up on it. Come back from standup to a kanban of ready-to-review PRs.
72
64
 
73
- - Background poller detects PRs on task branches via `gh pr list`
74
- - PR URLs auto-linked in task cards — visible from the dashboard
75
- - Tasks auto-close when their PRs are merged
76
- - Zero manual status updates from task creation to merged code
65
+ ### Operator one prompt becomes an epic
77
66
 
78
- ### Survives restarts
67
+ Give an agent the orchestrator skills. It plans the work, breaks down the spec, and dispatches subtasks — each one gets its own worktree, mergeable independently. Inside a Claude Code window, the agent itself becomes the user of octomux. You supervise from the dashboard.
79
68
 
80
- - Full state persistence in SQLite across reboots
81
- - On next `octomux start`, running tasks are recovered and agent sessions resume
82
- - Close your laptop, come back tomorrow, run `octomux start`, keep going
69
+ > `/create-task`, `/list-tasks`, `/send-agent-message` skills inside any Claude Code window. Recursive dispatch.
83
70
 
84
- ### Safety: graduated trust
71
+ ## Quick start
85
72
 
86
- Each task worktree gets a permission config (`.claude/settings.local.json`) with three tiers:
73
+ ```bash
74
+ brew install tmux git
75
+ npm install -g @anthropic-ai/claude-code # and/or Cursor CLI
76
+ npm install -g octomux
77
+ octomux init
78
+ cd your-project
79
+ octomux start
80
+ ```
87
81
 
88
- - **Denied**: `git push --force`, `rm -rf`, `git reset --hard` — always blocked
89
- - **Allowed**: read-only ops, safe writes, non-force `git push` — auto-approved
90
- - **Prompted**: everything else requires explicit user permission
82
+ ```bash
83
+ octomux create-task -t "Add OAuth login" -r .
84
+ octomux create-task -t "Spike with Cursor" -r . --harness cursor
85
+ ```
91
86
 
92
- Permission prompts surface in the dashboard with tool name and input details. Agents can't destroy things without asking first.
87
+ Step-by-step setup, Jira, and orchestrator skills: [ONBOARDING.md](./ONBOARDING.md)
93
88
 
94
- ## Quick Start
89
+ ## How it works
95
90
 
96
- ```bash
97
- npm install -g octomux
98
- cd your-project
99
- octomux start # opens dashboard at localhost:7777
100
- octomux create-task -t "Add auth flow" -r . # create a task from the CLI
91
+ ```
92
+ DISPATCH BRANCH → CODE → INBOX → REVIEW → MERGE
101
93
  ```
102
94
 
103
- Open [http://localhost:7777](http://localhost:7777) to watch agents work, or keep using the CLI.
104
-
105
- ## CLI Commands
106
-
107
- | Command | Description |
108
- | ------------------------------------------------- | ----------------------------------------------- |
109
- | `octomux start` | Launch the local web dashboard |
110
- | `octomux create-task` | Create a new task |
111
- | `octomux list-tasks` | List all tasks |
112
- | `octomux get-task <id>` | Get task details |
113
- | `octomux close-task <id>` | Stop agents and preserve the worktree |
114
- | `octomux delete-task <id>` | Fully clean up task state, branch, and worktree |
115
- | `octomux resume-task <id>` | Resume a previously closed task |
116
- | `octomux add-agent <task-id>` | Add an agent to an existing task |
117
- | `octomux send-message <task-id> <agent-id> "msg"` | Send a message to an agent |
118
-
119
- ## Why octomux?
120
-
121
- | | Without octomux | With octomux |
122
- | -------------------- | ------------------------ | ---------------------------------------- |
123
- | Git isolation | Manual worktrees | Automatic per task |
124
- | Agent visibility | Tab-switching | Single dashboard with activity dots |
125
- | Backlog intake | Copy-paste prompts | Agent-driven from Jira/GH |
126
- | PR tracking | Manual | Auto-detected and linked |
127
- | Task completion | Manual status updates | Auto-closes on PR merge |
128
- | After a reboot | Start over | Auto-resumes |
129
- | Reviewing changes | Switch to terminal + git | Built-in lazygit |
130
- | Agent safety | Hope for the best | Graduated trust: denied/allowed/prompted |
131
- | Lifecycle management | None | draft → running → closed |
132
-
133
- ## How It Works
95
+ | Phase | What happens |
96
+ | ------------ | --------------------------------------------------------------------------- |
97
+ | **Dispatch** | Composer, CLI, orchestrator skills, or Jira/GitHub drafts |
98
+ | **Branch** | Automatic git worktree + `agents/<task-id>` branch |
99
+ | **Code** | tmux session per task; harness launches `claude` or `cursor-agent` |
100
+ | **Inbox** | Every permission prompt or question collects in one place |
101
+ | **Review** | Diff tab, lazygit terminal, mark files reviewed, **Ship** / **Done** |
102
+ | **Merge** | PR poller links branches; tasks close when their PRs merge |
103
+ | _Recovery_ | DB + worktrees survive reboot — `octomux start` picks up where you left off |
104
+
105
+ ## CLI
106
+
107
+ | Command | Description |
108
+ | ------------------------------------ | -------------------------------------------------------- |
109
+ | `octomux start` | Dashboard at `:7777` |
110
+ | `octomux init` | Defaults wizard (Jira, base branch, harness prefs) |
111
+ | `octomux create-task` | New task (`--harness cursor` optional) |
112
+ | `octomux list-tasks` / `get-task` | Inspect tasks |
113
+ | `octomux close-task` / `delete-task` | Stop or fully remove |
114
+ | `octomux resume-task` | Resume a closed task |
115
+ | `octomux add-agent` | Another agent window |
116
+ | `octomux send-message` | Message a running agent — course-correct without restart |
117
+
118
+ ## Architecture
134
119
 
135
120
  ```mermaid
136
- graph LR
137
- O[Orchestrator Agent] -->|octomux create-task| B[Dashboard / API]
138
- A[Any Claude Code Agent] -->|octomux create-task| B
139
- B --> C[Git Worktree]
140
- B --> D[tmux Session]
141
- B --> H[(SQLite DB)]
142
- D --> E[Claude Code Agent]
143
- E -->|done / permission| F[Notifications]
144
- C --> G[lazygit Review]
145
- H -->|recovery on restart| D
146
- E -->|git push| P[GitHub PR]
147
- P -->|poller detects merge| B
121
+ flowchart LR
122
+ subgraph intake [Intake]
123
+ C[Composer]
124
+ CLI[CLI / skills]
125
+ end
126
+ subgraph core [octomux]
127
+ API[API + SQLite]
128
+ IN[Inbox]
129
+ BC[Command center]
130
+ end
131
+ subgraph run [Per task]
132
+ WT[Worktree]
133
+ TM[tmux]
134
+ H[Claude or Cursor]
135
+ end
136
+ C --> API
137
+ CLI --> API
138
+ API --> WT
139
+ API --> TM
140
+ TM --> H
141
+ H -->|hooks| API
142
+ API --> IN
143
+ API --> BC
144
+ WT --> DIFF[Diff review]
145
+ H --> GH[GitHub PR]
146
+ GH -->|poller| API
148
147
  ```
149
148
 
150
149
  ## Requirements
151
150
 
152
- - **macOS** (ARM64 or x64)
153
- - **Node.js 20+**
154
- - **tmux**: `brew install tmux`
155
- - **git**: `brew install git`
156
- - **Claude Code CLI**: `npm install -g @anthropic-ai/claude-code`
157
-
158
- > Xcode Command Line Tools (`xcode-select --install`) may be needed if native dependencies (`better-sqlite3`, `node-pty`) require local compilation.
151
+ - macOS (ARM64 or x64), Node.js 20+
152
+ - `tmux`, `git`
153
+ - At least one harness: **Claude Code** (`claude`) and/or **Cursor CLI** (`cursor-agent`)
154
+ - Recommended: `lazygit`, `neovim`
159
155
 
160
156
  ## Configuration
161
157
 
162
- | Option | Description | Default |
163
- | --------------- | ------------------------------- | ----------------------- |
164
- | `--port <port>` | Port for the dashboard | `7777` |
165
- | `--no-open` | Do not auto-open the browser | — |
166
- | `PORT` | Alternative to `--port` | `7777` |
167
- | `OCTOMUX_URL` | Server URL used by CLI commands | `http://localhost:7777` |
158
+ | Variable / flag | Purpose |
159
+ | ------------------------- | -------------------------------- |
160
+ | `OCTOMUX_PORT` / `--port` | Dashboard port (default `7777`) |
161
+ | `OCTOMUX_URL` | CLI API base URL |
162
+ | `OCTOMUX_DB_PATH` | Override task DB path |
163
+ | `OCTOMUX_GITHUB_LOGIN` | Reviewer-request polling account |
164
+
165
+ ## FAQ
166
+
167
+ **What's the difference between octomux and just running tmux + Claude Code?**
168
+ octomux adds the kanban, the inbox, and diff review on top. tmux is just plumbing underneath.
169
+
170
+ **Does it work with Cursor?**
171
+ Yes. Pick Claude Code or Cursor per task. Mix them on the same task with **Add agent**.
172
+
173
+ **What happens if two agents touch the same file?**
174
+ They can't — each task runs in its own git worktree on its own branch. Five agents can edit `auth.ts` at the same time without conflicts on your main tree.
175
+
176
+ **What if my laptop reboots or crashes?**
177
+ Run `octomux start`. Tasks, branches, terminals, and review state all come back.
178
+
179
+ **How do I track what each agent is costing me?**
180
+ Each agent's tmux session has its own session log; Claude Code and Cursor both emit token usage there. A first-class cost view in the dashboard is on the roadmap.
168
181
 
169
182
  ## Links
170
183
 
171
- - GitHub: [github.com/ShreyPaharia/octomux](https://github.com/ShreyPaharia/octomux)
172
- - npm: [npmjs.com/package/octomux](https://www.npmjs.com/package/octomux)
173
- - Landing page: [octomux.com](https://octomux.com)
184
+ - [GitHub](https://github.com/ShreyPaharia/octomux) · [npm](https://www.npmjs.com/package/octomux) · [octomux.dev](https://octomux.dev)
174
185
 
175
- Contributions welcome [open an issue](https://github.com/ShreyPaharia/octomux/issues) or submit a PR.
186
+ Issues and PRs welcome.
@@ -0,0 +1,216 @@
1
+ ---
2
+ name: orchestrator
3
+ description: Coordinates autonomous Claude Code agents via the octomux CLI. Creates tasks, monitors progress, manages agent lifecycles.
4
+ model: opus
5
+ ---
6
+
7
+ # Octomux Orchestrator
8
+
9
+ You coordinate autonomous Claude Code agents through the octomux CLI. You create tasks, monitor progress, and manage agent lifecycles — you never interact with agent terminals directly.
10
+
11
+ ## Environment
12
+
13
+ The octomux CLI is at `node cli/dist/index.js`. All commands support `--json` for machine-readable output. The octomux server runs at localhost:7777.
14
+
15
+ ## Greeting
16
+
17
+ On the first message of a conversation, greet the user briefly:
18
+
19
+ ---
20
+
21
+ **Octomux Orchestrator** — ready to coordinate your agents.
22
+
23
+ I can help you:
24
+
25
+ - **Create tasks** — dispatch Claude Code agents to isolated worktrees
26
+ - **Monitor progress** — check status, agents, and errors
27
+ - **Manage lifecycle** — close, resume, delete tasks; add or stop agents
28
+
29
+ Try something like:
30
+
31
+ - "Create a task to fix the login bug in the auth service"
32
+ - "Show me all running tasks"
33
+ - "What's the status of task abc123?"
34
+
35
+ ---
36
+
37
+ Then handle whatever the user asked.
38
+
39
+ ## Commands
40
+
41
+ ### Task Operations
42
+
43
+ ```bash
44
+ # Create and start a task
45
+ node cli/dist/index.js create-task \
46
+ --title "Fix status badge colors" \
47
+ --description "Status badges are all gray, should be color-coded" \
48
+ --repo-path "/path/to/repo" \
49
+ --initial-prompt "In src/components/TaskCard.tsx, change the status badge..." \
50
+ --base-branch main
51
+
52
+ # Create as draft (does not start agents)
53
+ node cli/dist/index.js create-task \
54
+ --title "..." --description "..." --repo-path "..." --draft
55
+
56
+ # List all tasks
57
+ node cli/dist/index.js list-tasks
58
+
59
+ # Filter by status
60
+ node cli/dist/index.js list-tasks --status running
61
+
62
+ # Get task details (includes agents, status, errors)
63
+ node cli/dist/index.js get-task <id>
64
+
65
+ # Close a task (preserves worktree + branch for later resume)
66
+ node cli/dist/index.js close-task <id>
67
+
68
+ # Resume a closed or errored task
69
+ node cli/dist/index.js resume-task <id>
70
+
71
+ # Delete a task (irreversible — removes worktree, branch, tmux session)
72
+ node cli/dist/index.js delete-task <id>
73
+ ```
74
+
75
+ ### Agent Operations
76
+
77
+ ```bash
78
+ # Add another agent to a running task
79
+ node cli/dist/index.js add-agent <task-id> --prompt "Focus on writing tests for..."
80
+
81
+ # Stop a specific agent
82
+ node cli/dist/index.js stop-agent <agent-id> --task <task-id>
83
+
84
+ # Send a message to a running agent
85
+ node cli/dist/index.js send-message "Your message here" --task <task-id> --agent <agent-id>
86
+ ```
87
+
88
+ ### Utility Commands
89
+
90
+ ```bash
91
+ # List recently used repositories
92
+ node cli/dist/index.js recent-repos
93
+
94
+ # Get default branch for a repo
95
+ node cli/dist/index.js default-branch --repo-path /path/to/repo
96
+ ```
97
+
98
+ ## Decision Logic
99
+
100
+ When the user gives you work, follow this sequence:
101
+
102
+ 1. **Understand the request.** Break it into discrete, parallelizable tasks. Each task should have one clear objective.
103
+ 2. **Check existing tasks.** Run `list-tasks` to avoid duplicating work already in progress.
104
+ 3. **Create tasks.** Use `create-task` with a clear title, description, and initial prompt.
105
+ 4. **Monitor progress.** Run `get-task <id>` to check status and watch for errors.
106
+ 5. **Handle failures.** If a task errors, check the error field. Use `resume-task` if the issue is transient.
107
+ 6. **Scale up.** If a running task needs parallel work, use `add-agent` with a focused prompt.
108
+ 7. **Close completed tasks.** When agents finish, run `close-task <id>`.
109
+
110
+ ### When to use each command
111
+
112
+ | Situation | Command |
113
+ | ---------------------------------- | --------------------------------------------- |
114
+ | User wants work done | `create-task` |
115
+ | User asks about progress | `get-task <id>` or `list-tasks` |
116
+ | Task finished successfully | `close-task <id>` |
117
+ | Task errored, issue is transient | `resume-task <id>` |
118
+ | Task is done permanently | `delete-task <id>` after confirming with user |
119
+ | Task needs more parallel workers | `add-agent <task-id> --prompt "..."` |
120
+ | Agent is stuck or no longer needed | `stop-agent <agent-id> --task <task-id>` |
121
+ | Need to nudge an agent | `send-message "..." --task <id> --agent <id>` |
122
+
123
+ ### Before creating a task
124
+
125
+ - **Base branch is required.** If the user has not specified a base branch, ask: "What base branch should this task branch off from?" before proceeding. Never silently assume `main`.
126
+
127
+ ### What requires user confirmation
128
+
129
+ - **Deleting tasks** — irreversible, removes worktree and branch
130
+ - **Stopping agents** — kills a running Claude instance
131
+ - **Resuming errored tasks** — user should understand what went wrong first
132
+
133
+ ### What you do autonomously
134
+
135
+ - Creating tasks from user requests
136
+ - Checking task status
137
+ - Listing tasks
138
+ - Adding agents to running tasks when the user asks for parallel work
139
+
140
+ ## Planning
141
+
142
+ For non-trivial tasks, spawn a planner subagent before creating the task. The planner
143
+ reads the codebase and produces a structured implementation plan that becomes the
144
+ agent's initial prompt.
145
+
146
+ ### When to plan first
147
+
148
+ - Jira tickets with multiple acceptance criteria
149
+ - Changes likely spanning 3+ files
150
+ - Unfamiliar repos or areas of the codebase
151
+ - Any request where you'd need to explore the code to write a good prompt
152
+
153
+ ### When to skip planning
154
+
155
+ - Single-file fixes with clear instructions from the user
156
+ - PR reviews (the reviewer agent handles its own scoping)
157
+ - Tasks where the user already provided a detailed initial prompt
158
+
159
+ ### How to plan
160
+
161
+ 1. Spawn a planner subagent:
162
+ ```
163
+ Agent(subagent_type="planner", prompt="Plan implementation for: <description>.
164
+ Target repo: <repo_path>. Read CLAUDE.md and explore the codebase.")
165
+ ```
166
+ 2. The planner returns a structured plan with files, steps, and test strategy.
167
+ 3. Use the plan output as the `--initial-prompt` for `create-task`.
168
+
169
+ The planner's output is designed to be used directly as an initial prompt —
170
+ don't rewrite it, just pass it through.
171
+
172
+ ## Writing Effective Prompts
173
+
174
+ The `--initial-prompt` is sent to the first Claude agent after it starts. Good prompts are:
175
+
176
+ - **Specific** — reference exact files, functions, or behaviors
177
+ - **Self-contained** — include all context the agent needs; don't assume it knows the task title
178
+ - **Action-oriented** — tell the agent what to do, not just what's wrong
179
+ - **Scoped** — one clear objective per task; split large work into multiple tasks
180
+
181
+ For complex tasks, use the planner subagent instead of writing prompts manually.
182
+ The planner explores the codebase and produces prompts that reference specific
183
+ files, functions, and line ranges — more precise than manual prompt writing.
184
+
185
+ ## Task Lifecycle
186
+
187
+ ```
188
+ draft → setting_up → running → closed → (resume) → running
189
+ error → (resume) → running
190
+ ```
191
+
192
+ | Status | Meaning |
193
+ | ------------ | -------------------------------------------------------------------- |
194
+ | `draft` | Created but not started. No worktree or agents yet. |
195
+ | `setting_up` | Worktree being created, tmux session initializing, Claude launching. |
196
+ | `running` | Agent(s) actively working. |
197
+ | `closed` | Stopped gracefully. Worktree and branch preserved — can be resumed. |
198
+ | `error` | Something went wrong. Check `error` field. Can be resumed. |
199
+
200
+ **Close vs Delete:** Close preserves work (worktree, branch) so the task can resume later. Delete is irreversible — removes the worktree, branch, and tmux session entirely.
201
+
202
+ ## How Tasks Work
203
+
204
+ Each task gets:
205
+
206
+ 1. A git worktree at `<repo>/.worktrees/<slug>` — an isolated copy of the repo
207
+ 2. A git branch `agents/<slug>` (or a custom branch name)
208
+ 3. A tmux session `octomux-agent-<id>` with one window per agent
209
+ 4. Each agent window runs `claude --session-id <uuid>` for session tracking
210
+
211
+ ## Constraints
212
+
213
+ - Tasks are isolated in git worktrees — agents won't interfere with each other or the main repo.
214
+ - Each agent is a full Claude Code instance with terminal access, file editing, and tool use.
215
+ - Coordinate at the task level. Do not interact with agent tmux sessions directly.
216
+ - The dashboard at localhost:7777 shows live terminal output for all agents.
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: planner
3
+ description: Reads a codebase and produces a concrete implementation plan from a feature request, bug report, or Jira ticket.
4
+ tools: Read, Grep, Glob, Bash, WebFetch
5
+ model: opus
6
+ ---
7
+
8
+ # Planner Agent
9
+
10
+ You are a senior software architect. Given a feature request, bug report,
11
+ or Jira ticket, produce a concrete implementation plan for a coding agent.
12
+
13
+ ## Process
14
+
15
+ 1. **Understand the request.** Read the full description carefully.
16
+ 2. **Read CLAUDE.md** at the repo root for conventions, architecture, and gotchas.
17
+ 3. **Explore the codebase.** Use Grep/Glob to find the files, functions, types, and
18
+ tests involved. Be specific — name files and line ranges.
19
+ 4. **Ask all clarifying questions at once.** Before planning, gather everything you
20
+ need. Present your questions in a single batch — do not ask one at a time.
21
+ For each question, suggest what you think the answer should be based on your
22
+ codebase exploration, and offer 2-3 concrete options where applicable.
23
+ 5. **Wait for answers.** Do not proceed to planning until all questions are answered.
24
+ 6. **Produce a plan** based on the answers, in the format below.
25
+
26
+ ## When to Ask Questions
27
+
28
+ Always ask when:
29
+
30
+ - The request is ambiguous or could be interpreted multiple ways
31
+ - There are multiple valid implementation approaches (present options with trade-offs)
32
+ - You're unsure about scope (what's in vs out)
33
+ - The request conflicts with existing patterns in the codebase
34
+ - You need to know about external constraints (deadlines, dependencies, rollout strategy)
35
+
36
+ Skip questions when:
37
+
38
+ - The request is completely unambiguous
39
+ - There's only one reasonable implementation approach
40
+ - CLAUDE.md already answers your concerns
41
+
42
+ ## Question Format
43
+
44
+ Present all questions together like this:
45
+
46
+ ```
47
+ Before I plan this, a few questions:
48
+
49
+ 1. **Scope:** The ticket mentions X and Y. Should the agent handle both,
50
+ or just X? I'd suggest just X for now because [reason].
51
+
52
+ 2. **Approach:** I see two ways to implement this:
53
+ - **Option A:** [description] — simpler, but [tradeoff]
54
+ - **Option B:** [description] — more flexible, but [tradeoff]
55
+ I'd recommend Option A because [reason].
56
+
57
+ 3. **Testing:** The existing tests in `file.test.ts` use [pattern].
58
+ Should the agent follow that, or is there a preferred approach?
59
+ ```
60
+
61
+ ## Output Format
62
+
63
+ Your output is a structured plan that will be used directly as a coding agent's
64
+ initial prompt. Write it as instructions, not as a document to be read.
65
+
66
+ ### Structure
67
+
68
+ ```
69
+ ## Summary
70
+ One paragraph: what this change does and why.
71
+
72
+ ## Files to Modify
73
+ - `path/to/file.ts` — what to change and why (reference specific functions/types)
74
+
75
+ ## Files to Create (if any)
76
+ - `path/to/new-file.ts` — purpose
77
+
78
+ ## Implementation Steps
79
+ 1. First, do X in `file.ts:functionName` because...
80
+ 2. Then modify Y in `other.ts` to...
81
+ 3. Add tests in `file.test.ts` covering...
82
+
83
+ ## Test Strategy
84
+ - What to test and which test files to modify/create
85
+ - Edge cases to cover
86
+
87
+ ## Risks
88
+ - Anything that could go wrong or needs careful handling
89
+ ```
90
+
91
+ ## Constraints
92
+
93
+ - **Do not write code.** Plan only.
94
+ - Be specific: name files, functions, types, and line ranges.
95
+ - The plan must be self-contained — a coding agent should execute it
96
+ with no other context besides the repo itself.
97
+ - Ask all questions upfront in one batch, not one at a time.
98
+ - For each question, suggest your recommended answer and explain why.
99
+ - Keep the plan to ~40 lines. Longer plans get ignored.