claude_swarm 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d905c9233bd290f36581e1507efcfb081c4c06e25182d84cf7fc1aa5fd167468
4
- data.tar.gz: 666090b2014f5b451cb264bf4bffc658a6d543e1d4e074e7ccb0f9ab03e44327
3
+ metadata.gz: 868bb8a62ddb042e9971915da978ef619051be6ecdee7fb8b9a40678e11e2930
4
+ data.tar.gz: d8fdc4cbb9c6336a33d6e377b332a7e85511f594491aa1691f54a12ce76748f6
5
5
  SHA512:
6
- metadata.gz: 6dd8b14d36a9ae772be13170fa28c30e85a93a02b5bfe6793294eca51d34520e02dc9d1ddefd5312cb2682472e6bcaa7dcb36213d28d6adf0b08852889117f36
7
- data.tar.gz: d1762b2fd34da13e3262ebf82e3fd3576844c2487154c8b68a35f7e9ff270e96fa61f19a83e8488a8a2f630c96f6a61d78e827b352062cd695d5c656b06b9ca0
6
+ metadata.gz: f07b9ebdd1378f816d659d26ce68751fe9afd5ef79f98bc025d42e1a7fe88686ec7ca9b4bcd108047dc9e3d1a96b10446693a15f22ade0855c83a465278a5a0b
7
+ data.tar.gz: b43959ad4effb4c9bcfdd2cec0ac955b02f5303941ae313e0751f7dafb7a7a84ce86bb15d9e08b09cfc857329086473c4f6dcc0a5ebe3b87741721b9cb64997f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2025-05-24
3
+ ## [0.1.1] - 2025-05-24
4
4
 
5
5
  - Initial release
data/CLAUDE.md CHANGED
@@ -76,14 +76,12 @@ swarm:
76
76
  main: lead
77
77
  instances:
78
78
  lead:
79
- role: "Lead Developer"
80
79
  directory: .
81
80
  model: opus
82
81
  connections: [frontend, backend]
83
82
  prompt: "You are the lead developer coordinating the team"
84
83
  tools: [Read, Edit, Bash]
85
84
  frontend:
86
- role: "Frontend Developer"
87
85
  directory: ./frontend
88
86
  model: sonnet
89
87
  prompt: "You specialize in frontend development with React"
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Claude Swarm
2
2
 
3
- Claude Swarm orchestrates multiple Claude Code instances as a collaborative AI development team. It enables running AI agents with specialized roles, tools, and directory contexts, communicating via MCP (Model Context Protocol). Define your swarm topology in simple YAML and let Claude instances collaborate across codebases. Perfect for complex projects requiring specialized AI agents for frontend, backend, testing, DevOps, or research tasks.
3
+ Claude Swarm orchestrates multiple Claude Code instances as a collaborative AI development team. It enables running AI agents with specialized roles, tools, and directory contexts, communicating via MCP (Model Context Protocol) in a tree-like hierarchy. Define your swarm topology in simple YAML and let Claude instances delegate tasks through connected instances. Perfect for complex projects requiring specialized AI agents for frontend, backend, testing, DevOps, or research tasks.
4
4
 
5
5
  ## Installation
6
6
 
@@ -32,7 +32,7 @@ bundle install
32
32
 
33
33
  ### Quick Start
34
34
 
35
- 1. Create a `claude-swarm.yml` file in your project:
35
+ 1. Run `claude-swarm init` or create a `claude-swarm.yml` file in your project:
36
36
 
37
37
  ```yaml
38
38
  version: 1
@@ -41,16 +41,14 @@ swarm:
41
41
  main: lead
42
42
  instances:
43
43
  lead:
44
- role: "Lead Developer"
45
44
  directory: .
46
45
  model: opus
47
46
  connections: [frontend, backend]
48
- tools:
47
+ tools: # Tools aren't required if you run it with `--vibe`
49
48
  - Read
50
49
  - Edit
51
50
  - Bash
52
51
  frontend:
53
- role: "Frontend Developer"
54
52
  directory: ./frontend
55
53
  model: sonnet
56
54
  tools:
@@ -58,7 +56,6 @@ swarm:
58
56
  - Write
59
57
  - Bash
60
58
  backend:
61
- role: "Backend Developer"
62
59
  directory: ./backend
63
60
  model: sonnet
64
61
  tools:
@@ -72,14 +69,104 @@ swarm:
72
69
  ```bash
73
70
  claude-swarm
74
71
  ```
72
+ or if you are feeling the vibes...
73
+ ```bash
74
+ claude-swarm --vibe # That will allow ALL tools for all instances! Be Careful!
75
+ ```
75
76
 
76
77
  This will:
77
- - Generate MCP configuration files in `.claude-swarm/`
78
- - Create a shared session timestamp for centralized logging
79
78
  - Launch the main instance (lead) with connections to other instances
80
- - The lead instance can communicate with frontend and backend instances via MCP
79
+ - The lead instance can communicate with the other instances via MCP
81
80
  - All instances log to `.claude-swarm/logs/session-{timestamp}/`
82
81
 
82
+ #### Multi-Level Swarm Example
83
+
84
+ Here's a more complex example showing specialized teams working on different parts of a project:
85
+
86
+ ```yaml
87
+ version: 1
88
+ swarm:
89
+ name: "Multi-Service Development Team"
90
+ main: architect
91
+ instances:
92
+ architect:
93
+ directory: .
94
+ model: opus
95
+ connections: [frontend_lead, backend_lead, mobile_lead, devops]
96
+ prompt: "You are the system architect coordinating between different service teams"
97
+ tools: [Read, Edit, WebSearch]
98
+
99
+ frontend_lead:
100
+ directory: ./web-frontend
101
+ model: opus
102
+ connections: [react_dev, css_expert]
103
+ prompt: "You lead the web frontend team working with React"
104
+ tools: [Read, Edit, Bash]
105
+
106
+ react_dev:
107
+ directory: ./web-frontend/src
108
+ model: sonnet
109
+ prompt: "You specialize in React components and state management"
110
+ tools: [Edit, Write, "Bash(npm:*)"]
111
+
112
+ css_expert:
113
+ directory: ./web-frontend/styles
114
+ model: sonnet
115
+ prompt: "You handle all CSS and styling concerns"
116
+ tools: [Edit, Write, Read]
117
+
118
+ backend_lead:
119
+ directory: ./api-server
120
+ model: opus
121
+ connections: [api_dev, database_expert]
122
+ prompt: "You lead the API backend team"
123
+ tools: [Read, Edit, Bash]
124
+
125
+ api_dev:
126
+ directory: ./api-server/src
127
+ model: sonnet
128
+ prompt: "You develop REST API endpoints"
129
+ tools: [Edit, Write, Bash]
130
+
131
+ database_expert:
132
+ directory: ./api-server/db
133
+ model: sonnet
134
+ prompt: "You handle database schema and migrations"
135
+ tools: [Edit, Write, "Bash(psql:*, migrate:*)"]
136
+
137
+ mobile_lead:
138
+ directory: ./mobile-app
139
+ model: sonnet
140
+ connections: [ios_dev, android_dev]
141
+ prompt: "You coordinate mobile development across platforms"
142
+ tools: [Read, Edit]
143
+
144
+ ios_dev:
145
+ directory: ./mobile-app/ios
146
+ model: sonnet
147
+ prompt: "You develop the iOS application"
148
+ tools: [Edit, Write, "Bash(xcodebuild:*, pod:*)"]
149
+
150
+ android_dev:
151
+ directory: ./mobile-app/android
152
+ model: sonnet
153
+ prompt: "You develop the Android application"
154
+ tools: [Edit, Write, "Bash(gradle:*, adb:*)"]
155
+
156
+ devops:
157
+ directory: ./infrastructure
158
+ model: sonnet
159
+ prompt: "You handle CI/CD and infrastructure"
160
+ tools: [Read, Edit, "Bash(docker:*, kubectl:*)"]
161
+ ```
162
+
163
+ In this setup:
164
+ - The architect (main instance) can delegate tasks to team leads
165
+ - Each team lead can work with their specialized developers
166
+ - Each instance is independent - connections create separate MCP server instances
167
+ - Teams work in isolated directories with role-appropriate tools
168
+
169
+
83
170
  ### Configuration Format
84
171
 
85
172
  #### Top Level
@@ -97,7 +184,6 @@ swarm:
97
184
 
98
185
  Each instance can have:
99
186
 
100
- - **role**: Human-readable role description (defaults to instance name)
101
187
  - **directory**: Working directory for this instance (can use ~ for home)
102
188
  - **model**: Claude model to use (opus, sonnet, haiku)
103
189
  - **connections**: Array of other instances this one can communicate with
@@ -107,7 +193,6 @@ Each instance can have:
107
193
 
108
194
  ```yaml
109
195
  instance_name:
110
- role: "Role Description"
111
196
  directory: ~/project/path
112
197
  model: opus
113
198
  connections: [other_instance1, other_instance2]
@@ -188,7 +273,6 @@ swarm:
188
273
  main: architect
189
274
  instances:
190
275
  architect:
191
- role: "Software Architect"
192
276
  directory: .
193
277
  model: opus
194
278
  connections: [frontend, backend, devops]
@@ -199,7 +283,6 @@ swarm:
199
283
  - WebSearch
200
284
 
201
285
  frontend:
202
- role: "Frontend Developer"
203
286
  directory: ./frontend
204
287
  model: sonnet
205
288
  connections: [architect]
@@ -210,7 +293,6 @@ swarm:
210
293
  - Bash
211
294
 
212
295
  backend:
213
- role: "Backend Developer"
214
296
  directory: ./backend
215
297
  model: sonnet
216
298
  connections: [architect, database]
@@ -220,7 +302,6 @@ swarm:
220
302
  - Bash
221
303
 
222
304
  database:
223
- role: "Database Administrator"
224
305
  directory: ./db
225
306
  model: haiku
226
307
  tools:
@@ -228,7 +309,6 @@ swarm:
228
309
  - Bash
229
310
 
230
311
  devops:
231
- role: "DevOps Engineer"
232
312
  directory: .
233
313
  model: sonnet
234
314
  connections: [architect]
@@ -247,7 +327,6 @@ swarm:
247
327
  main: lead_researcher
248
328
  instances:
249
329
  lead_researcher:
250
- role: "Lead Researcher"
251
330
  directory: ~/research
252
331
  model: opus
253
332
  connections: [data_analyst, writer]
@@ -261,7 +340,6 @@ swarm:
261
340
  url: "https://arxiv-mcp.example.com"
262
341
 
263
342
  data_analyst:
264
- role: "Data Analyst"
265
343
  directory: ~/research/data
266
344
  model: sonnet
267
345
  tools:
@@ -275,7 +353,6 @@ swarm:
275
353
  args: ["--notebook-dir", "."]
276
354
 
277
355
  writer:
278
- role: "Technical Writer"
279
356
  directory: ~/research/papers
280
357
  model: sonnet
281
358
  tools:
@@ -78,6 +78,63 @@ module ClaudeSwarm
78
78
  end
79
79
  end
80
80
 
81
+ desc "init", "Initialize a new claude-swarm.yml configuration file"
82
+ method_option :force, aliases: "-f", type: :boolean, default: false,
83
+ desc: "Overwrite existing configuration file"
84
+ def init
85
+ config_path = "claude-swarm.yml"
86
+
87
+ if File.exist?(config_path) && !options[:force]
88
+ error "Configuration file already exists: #{config_path}"
89
+ error "Use --force to overwrite"
90
+ exit 1
91
+ end
92
+
93
+ template = <<~YAML
94
+ version: 1
95
+ swarm:
96
+ name: "Swarm Name"
97
+ main: lead_developer
98
+ instances:
99
+ lead_developer:
100
+ directory: .
101
+ model: sonnet
102
+ prompt: "You are the lead developer coordinating the team"
103
+ tools: [Read, Edit, Bash, Write]
104
+ # connections: [frontend_dev, backend_dev]
105
+
106
+ # Example instances (uncomment and modify as needed):
107
+
108
+ # frontend_dev:
109
+ # directory: ./frontend
110
+ # model: sonnet
111
+ # prompt: "You specialize in frontend development with React, TypeScript, and modern web technologies"
112
+ # tools: [Read, Edit, Write, "Bash(npm:*)", "Bash(yarn:*)", "Bash(pnpm:*)"]
113
+
114
+ # backend_dev:
115
+ # directory: ../other-app/backend
116
+ # model: sonnet
117
+ # prompt: "You specialize in backend development, APIs, databases, and server architecture"
118
+ # tools: [Read, Edit, Write, Bash]
119
+
120
+ # devops_engineer:
121
+ # directory: .
122
+ # model: sonnet
123
+ # prompt: "You specialize in infrastructure, CI/CD, containerization, and deployment"
124
+ # tools: [Read, Edit, Write, "Bash(docker:*)", "Bash(kubectl:*)", "Bash(terraform:*)"]
125
+
126
+ # qa_engineer:
127
+ # directory: ./tests
128
+ # model: sonnet
129
+ # prompt: "You specialize in testing, quality assurance, and test automation"
130
+ # tools: [Read, Edit, Write, Bash]
131
+ YAML
132
+
133
+ File.write(config_path, template)
134
+ say "Created #{config_path}", :green
135
+ say "Edit this file to configure your swarm, then run 'claude-swarm' to start"
136
+ end
137
+
81
138
  desc "version", "Show Claude Swarm version"
82
139
  def version
83
140
  say "Claude Swarm #{VERSION}"
@@ -74,7 +74,6 @@ module ClaudeSwarm
74
74
  config ||= {}
75
75
  {
76
76
  name: name,
77
- role: config["role"] || name.to_s.tr("_", " ").capitalize,
78
77
  directory: expand_path(config["directory"] || "."),
79
78
  model: config["model"] || "sonnet",
80
79
  connections: Array(config["connections"]),
@@ -28,7 +28,7 @@ module ClaudeSwarm
28
28
 
29
29
  # Launch the main instance
30
30
  main_instance = @config.main_instance_config
31
- puts "🚀 Launching main instance: #{@config.main_instance} (#{main_instance[:role]})"
31
+ puts "🚀 Launching main instance: #{@config.main_instance}"
32
32
  puts " Model: #{main_instance[:model]}"
33
33
  puts " Directory: #{main_instance[:directory]}"
34
34
  puts " Tools: #{main_instance[:tools].join(", ")}" if main_instance[:tools].any?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClaudeSwarm
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: claude_swarm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Arruda
@@ -57,7 +57,7 @@ files:
57
57
  - LICENSE
58
58
  - README.md
59
59
  - Rakefile
60
- - claude-swarm.yml
60
+ - example/claude-swarm.yml
61
61
  - exe/claude-swarm
62
62
  - lib/claude_swarm.rb
63
63
  - lib/claude_swarm/claude_code_executor.rb
File without changes