@dolusoft/claude-collab 1.11.5 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +250 -226
- package/dist/cli.js +4408 -741
- package/dist/cli.js.map +1 -1
- package/dist/mcp-main.js +4456 -748
- package/dist/mcp-main.js.map +1 -1
- package/package.json +84 -80
- package/scripts/setup-skills.mjs +54 -0
- package/skills/collab-backend/SKILL.md +72 -0
- package/skills/collab-devops/SKILL.md +66 -0
- package/skills/collab-frontend/SKILL.md +122 -0
- package/skills/collab-lead/SKILL.md +237 -0
- package/skills/collab-manager/SKILL.md +253 -0
- package/skills/collab-observer/SKILL.md +121 -0
- package/skills/collab-qa/SKILL.md +113 -0
package/README.md
CHANGED
|
@@ -1,226 +1,250 @@
|
|
|
1
|
-
# Claude Collab
|
|
2
|
-
|
|
3
|
-
Real-time collaboration between Claude Code terminals via MCP (Model Context Protocol).
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@dolusoft/claude-collab)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
Claude Collab lets multiple Claude Code terminals
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
###
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
#
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
##
|
|
165
|
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
#
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
#
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
1
|
+
# Claude Collab
|
|
2
|
+
|
|
3
|
+
Real-time P2P collaboration between Claude Code terminals via MCP (Model Context Protocol).
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@dolusoft/claude-collab)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Claude Collab lets multiple Claude Code terminals form an **autonomous team** that communicates in real-time over a local network. Terminals **automatically discover each other** via UDP multicast — no IP addresses, no port numbers, no hub server required.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
┌──────────────────┐
|
|
14
|
+
│ zahid (user) │
|
|
15
|
+
└────────┬─────────┘
|
|
16
|
+
│
|
|
17
|
+
┌────────▼─────────┐
|
|
18
|
+
│ Manager (opus) │
|
|
19
|
+
│ /collab-manager │
|
|
20
|
+
└────────┬─────────┘
|
|
21
|
+
│
|
|
22
|
+
┌────────▼─────────┐
|
|
23
|
+
│ Lead (opus) │
|
|
24
|
+
│ /collab-lead │
|
|
25
|
+
└────────┬─────────┘
|
|
26
|
+
┌──────────────┼──────────────┐
|
|
27
|
+
┌──────▼──────┐ ┌────▼────┐ ┌───────▼───────┐
|
|
28
|
+
│ Frontend │ │ QA │ │ Backend │
|
|
29
|
+
│ (sonnet) │ │(sonnet) │ │ (sonnet) │
|
|
30
|
+
└─────────────┘ └─────────┘ └───────────────┘
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## How It Works
|
|
34
|
+
|
|
35
|
+
1. **User** starts Manager (`/collab-manager`) and gives a task
|
|
36
|
+
2. **Manager** spawns Lead, gives briefing, tracks progress via `list_issues` + `check_replies`
|
|
37
|
+
3. **Lead** spawns workers (frontend, qa, etc.), assigns tasks with complexity labels, manages pipeline
|
|
38
|
+
4. **Workers** implement tasks, update pipeline status, report back to lead
|
|
39
|
+
5. **Pipeline** tracks every issue: `assigned` → `in_progress` → `dev_done` → `testing` → `qa_passed` → `done`
|
|
40
|
+
6. **Inactivity monitor** reminds silent peers (10min) and alerts lead/manager (15min)
|
|
41
|
+
|
|
42
|
+
All communication uses P2P WebSockets — no central server. Manager and Lead use **non-blocking messaging** (`send` + `check_replies`), workers use **blocking messaging** (`ask` + `reply`).
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
claude mcp add claude-collab -- npx -y @dolusoft/claude-collab
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
That's it. Skills are installed automatically via `postinstall`.
|
|
51
|
+
|
|
52
|
+
## Quick Start
|
|
53
|
+
|
|
54
|
+
### Autonomous Team (recommended)
|
|
55
|
+
|
|
56
|
+
Start a manager and give it a task:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
/collab-manager
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The manager will:
|
|
63
|
+
1. Join the network
|
|
64
|
+
2. Analyze your project
|
|
65
|
+
3. Spawn a lead (opus model)
|
|
66
|
+
4. Lead spawns workers (sonnet model)
|
|
67
|
+
5. Team works autonomously, reports at milestones
|
|
68
|
+
|
|
69
|
+
### Manual Team
|
|
70
|
+
|
|
71
|
+
Start individual roles in separate terminals:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
/collab-lead # Team Lead — coordinates workers
|
|
75
|
+
/collab-frontend # Frontend Developer
|
|
76
|
+
/collab-backend # Backend Developer
|
|
77
|
+
/collab-qa # QA Engineer
|
|
78
|
+
/collab-devops # DevOps Engineer
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## MCP Tools (15)
|
|
82
|
+
|
|
83
|
+
### Messaging
|
|
84
|
+
|
|
85
|
+
| Tool | Description |
|
|
86
|
+
|------|-------------|
|
|
87
|
+
| `join_network` | Join the P2P network with name, role, and optional team |
|
|
88
|
+
| `send` | Send a non-blocking message. Returns immediately. Use `check_replies` to get responses |
|
|
89
|
+
| `check_replies` | Check for replies to previously sent messages |
|
|
90
|
+
| `ask` | Ask a peer a question. Blocks up to 2 minutes for a response |
|
|
91
|
+
| `reply` | Reply to a question by its ID |
|
|
92
|
+
| `broadcast` | Send a message to all peers or filter by role |
|
|
93
|
+
|
|
94
|
+
### Pipeline Tracking
|
|
95
|
+
|
|
96
|
+
| Tool | Description |
|
|
97
|
+
|------|-------------|
|
|
98
|
+
| `update_issue` | Update issue pipeline status. Notifies relevant peers automatically |
|
|
99
|
+
| `list_issues` | List all tracked issues and their pipeline status |
|
|
100
|
+
|
|
101
|
+
### Team Management
|
|
102
|
+
|
|
103
|
+
| Tool | Description |
|
|
104
|
+
|------|-------------|
|
|
105
|
+
| `spawn_terminal` | Spawn a new Claude Code terminal with a role and model |
|
|
106
|
+
| `observe` | Read a peer's terminal output without interrupting them (lead/manager only) |
|
|
107
|
+
| `health_check` | Check all peers' health and activity status |
|
|
108
|
+
| `kick_member` | Remove a stale peer from the network |
|
|
109
|
+
| `report_status` | Share your current status (working/blocked/idle/reviewing/testing/deploying) |
|
|
110
|
+
|
|
111
|
+
### Info
|
|
112
|
+
|
|
113
|
+
| Tool | Description |
|
|
114
|
+
|------|-------------|
|
|
115
|
+
| `peers` | List connected peers with their roles and status |
|
|
116
|
+
| `history` | Show message history (sent and received) |
|
|
117
|
+
|
|
118
|
+
## Team Roles & Skills
|
|
119
|
+
|
|
120
|
+
| Skill | Role | Model | Communication | Responsibilities |
|
|
121
|
+
|-------|------|-------|---------------|-----------------|
|
|
122
|
+
| `/collab-manager` | Project Manager | opus | `send` + `check_replies` | Spawn lead, give briefing, track pipeline, report at milestones |
|
|
123
|
+
| `/collab-lead` | Team Lead | opus | `send` + `check_replies` | Spawn workers, assign tasks with complexity labels, manage QA cycle |
|
|
124
|
+
| `/collab-frontend` | Frontend Dev | sonnet | `ask` + `reply` | Build UI, update pipeline, report to lead |
|
|
125
|
+
| `/collab-backend` | Backend Dev | sonnet | `ask` + `reply` | Build APIs/DB, coordinate with frontend |
|
|
126
|
+
| `/collab-qa` | QA Engineer | sonnet | `ask` + `reply` | Test features, report bugs (no fixing), update pipeline |
|
|
127
|
+
| `/collab-devops` | DevOps Engineer | sonnet | `ask` + `reply` | CI/CD, deployments, environment management |
|
|
128
|
+
|
|
129
|
+
### Complexity Labels
|
|
130
|
+
|
|
131
|
+
Lead assigns complexity labels to tasks, determining which superpowers workers must use:
|
|
132
|
+
|
|
133
|
+
| Label | Meaning | Required Superpowers |
|
|
134
|
+
|-------|---------|---------------------|
|
|
135
|
+
| `[BASIT]` | Small fix, single file | verification |
|
|
136
|
+
| `[ORTA]` | Multiple files, moderate | brainstorming + TDD + verification |
|
|
137
|
+
| `[BUYUK]` | Architectural impact | brainstorming + plan + TDD + verification |
|
|
138
|
+
|
|
139
|
+
### Plugin Distribution
|
|
140
|
+
|
|
141
|
+
Lead assigns plugins to workers based on project stack:
|
|
142
|
+
|
|
143
|
+
| Plugin | Frontend | Backend | QA | DevOps |
|
|
144
|
+
|--------|:--------:|:-------:|:--:|:------:|
|
|
145
|
+
| superpowers | required | required | required | required |
|
|
146
|
+
| typescript-lsp | yes | yes | - | - |
|
|
147
|
+
| chrome-devtools-mcp | yes | - | yes | - |
|
|
148
|
+
| frontend-design | yes | - | - | - |
|
|
149
|
+
| context7 | yes | yes | - | - |
|
|
150
|
+
| commit-commands | yes | yes | - | yes |
|
|
151
|
+
| security-guidance | - | yes | yes | yes |
|
|
152
|
+
|
|
153
|
+
## Issue Pipeline
|
|
154
|
+
|
|
155
|
+
Every issue flows through a tracked pipeline:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
assigned → in_progress → dev_done → testing → qa_passed → done
|
|
159
|
+
→ qa_rejected (back to dev)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Pipeline state is synced across all peers via P2P. Late joiners receive full state on connect.
|
|
163
|
+
|
|
164
|
+
## Network Requirements
|
|
165
|
+
|
|
166
|
+
- All machines must be on the **same local network** (LAN, Wi-Fi, or VPN)
|
|
167
|
+
- UDP multicast port `11776` must be reachable
|
|
168
|
+
- WebSocket port (auto-selected in range `11700-11750`) must be accessible
|
|
169
|
+
|
|
170
|
+
On Windows, allow network access when prompted on first run.
|
|
171
|
+
|
|
172
|
+
## Configuration
|
|
173
|
+
|
|
174
|
+
| Env variable | Default | Description |
|
|
175
|
+
|---|---|---|
|
|
176
|
+
| `CLAUDE_COLLAB_PORT_MIN` | `11700` | WS port range start |
|
|
177
|
+
| `CLAUDE_COLLAB_PORT_MAX` | `11750` | WS port range end |
|
|
178
|
+
| `CLAUDE_COLLAB_LOG_DIR` | `~/.claude-collab/logs` | Override log file directory |
|
|
179
|
+
|
|
180
|
+
## Architecture
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
src/
|
|
184
|
+
├── domain/ # Entities, Value Objects
|
|
185
|
+
├── application/ # Use Cases, DTOs
|
|
186
|
+
├── infrastructure/
|
|
187
|
+
│ ├── p2p/
|
|
188
|
+
│ │ ├── multicast-discovery.ts # UDP multicast peer discovery + auto-reconnect
|
|
189
|
+
│ │ ├── p2p-node.ts # WebSocket P2P node + ICollabClient + safeSend
|
|
190
|
+
│ │ ├── p2p-message-protocol.ts # Wire protocol (17 message types)
|
|
191
|
+
│ │ └── dashboard-broadcaster.ts # Real-time dashboard WebSocket
|
|
192
|
+
│ ├── logging/
|
|
193
|
+
│ │ └── collab-logger.ts # CollabLogger + logCrash
|
|
194
|
+
│ └── terminal-injector/
|
|
195
|
+
│ ├── windows-injector.ts # PowerShell P/Invoke (WriteConsoleInput)
|
|
196
|
+
│ ├── windows-reader.ts # ReadConsoleOutput
|
|
197
|
+
│ └── injection-queue.ts # FIFO message delivery + fire-and-forget
|
|
198
|
+
├── shared/types/
|
|
199
|
+
│ └── collab-client.interface.ts # ICollabClient contract
|
|
200
|
+
├── presentation/mcp/
|
|
201
|
+
│ ├── server.ts # MCP server setup
|
|
202
|
+
│ └── tools/ # 15 MCP tools
|
|
203
|
+
└── skills/ # 6 role-based skills
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## P2P Message Types (17)
|
|
207
|
+
|
|
208
|
+
| Type | Purpose |
|
|
209
|
+
|------|---------|
|
|
210
|
+
| `P2P_HELLO` | Identity handshake on connect |
|
|
211
|
+
| `P2P_ASK` / `P2P_ASK_ACK` | Send question + acknowledge |
|
|
212
|
+
| `P2P_GET_ANSWER` / `P2P_ANSWER` | Check/deliver answer |
|
|
213
|
+
| `P2P_ANSWER_PENDING` | Answer not ready yet |
|
|
214
|
+
| `P2P_SEND` | Non-blocking message (fire-and-forget or expect-reply) |
|
|
215
|
+
| `P2P_OBSERVE_REQ` / `P2P_OBSERVE_RES` | Terminal observation |
|
|
216
|
+
| `P2P_BROADCAST` | Team-wide announcement |
|
|
217
|
+
| `P2P_STATUS_UPDATE` | Status reporting |
|
|
218
|
+
| `P2P_ISSUE_UPDATE` | Pipeline state change |
|
|
219
|
+
| `P2P_ISSUE_SYNC_REQ` / `P2P_ISSUE_SYNC_RES` | Pipeline state sync for late joiners |
|
|
220
|
+
| `P2P_PING` / `P2P_PONG` | Connection keepalive |
|
|
221
|
+
| `P2P_ERROR` | Error notification |
|
|
222
|
+
|
|
223
|
+
## Logging
|
|
224
|
+
|
|
225
|
+
Claude Collab includes a structured logging system for debugging and observability.
|
|
226
|
+
|
|
227
|
+
- **`CollabLogger`** class: Each node writes structured JSON logs to `~/.claude-collab/logs/collab-YYYY-MM-DD.log`. Constructor accepts `nodeName` and optional `logDir`. Supports 30+ event types (`SEND`, `ASK`, `WS_CONNECT_OK`, `PEER_DISCOVERED`, etc.)
|
|
228
|
+
- **`safeSend()`**: Private method in `p2p-node.ts`. Wraps all `ws.send()` calls to prevent crashes on closed sockets. Checks WebSocket `readyState` before sending, logs on error.
|
|
229
|
+
- **`logCrash()`**: Standalone function. Works without a `CollabLogger` instance — captures process crashes (`uncaughtException`, `unhandledRejection`) and writes directly to the log file. Registered as a global handler in `mcp-main.ts`.
|
|
230
|
+
- **Log files**: `~/.claude-collab/logs/` directory, daily rotation (date-based filenames), JSON-per-line format
|
|
231
|
+
- **Env variable**: `CLAUDE_COLLAB_LOG_DIR` overrides the log directory
|
|
232
|
+
|
|
233
|
+
## Development
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
git clone https://github.com/dolusoft/claude-collab.git
|
|
237
|
+
cd claude-collab
|
|
238
|
+
pnpm install
|
|
239
|
+
pnpm build # build with tsup
|
|
240
|
+
pnpm test # run tests
|
|
241
|
+
pnpm dev # watch mode
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## License
|
|
245
|
+
|
|
246
|
+
MIT — see [LICENSE](LICENSE) for details.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
Created by [Dolusoft](https://github.com/dolusoft) · Built with [Model Context Protocol](https://modelcontextprotocol.io)
|