claude_swarm 0.1.3 → 0.1.4

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: 8d82adc5c9d855904f9809e4e2c8d9e34b7dbd5b2dd6ebec98e4072d6c81f3cf
4
- data.tar.gz: 1faa01211ebe1b05fcc0dbf8b654b77e3512b4a4653b9169ef8c1b1e40226680
3
+ metadata.gz: a4597e6fdc67837e39ae1c175cc9dded454460ec00488d92aa81cab928737b4a
4
+ data.tar.gz: 46790b958dc4916a3df066ae7384e753c84c6c4cc624ac62754cab646f2c9102
5
5
  SHA512:
6
- metadata.gz: 539f27f040ff91900bd8d88f925564f07ee4ad673eaaadcfdda228e44ca21adfd46a8be3dd40ae3a9b267b15ac5df4a5bd154d855f75ef85f1888522b71a716b
7
- data.tar.gz: 81c0d46bf825684597d80271e7b0e7480b8c92e80c2465af1513b6d80f4dea2100b173261311243f5514e4aeb07bbdedebc0467b293415647bd8397161f98e8d
6
+ metadata.gz: f876006a8368881b252e675fab2b2999ae5a79574caff9db081ea7ea72402ce172524d7c6a2fe9c4b967502971a1cab83895dfd1f339592a516c58298450426a
7
+ data.tar.gz: b55120d481b8605e11a7024f1d6626f5c1fecca18627b6247e4b517c16e29d762166408a1753b1fc1b845c80f820f9701ce30ef2b0edb7e8a58da1b3635d0cc4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [0.1.4]
2
+
3
+ ### Added
4
+ - **Required `description` field for instances**: Each instance must now have a description that clearly explains its role and specialization
5
+ - Dynamic task tool descriptions that include both the instance name and description (e.g., "Execute a task using Agent frontend_dev. Frontend developer specializing in React and modern web technologies")
6
+ - Description validation during configuration parsing - configurations without descriptions will fail with a clear error message
7
+
8
+ ### Changed
9
+ - Updated all documentation examples to include meaningful instance descriptions
10
+ - The `claude-swarm init` command now generates a template with description fields
11
+
1
12
  ## [0.1.3]
2
13
 
3
14
  ### Fixed
data/README.md CHANGED
@@ -41,6 +41,7 @@ swarm:
41
41
  main: lead
42
42
  instances:
43
43
  lead:
44
+ description: "Team lead coordinating development efforts"
44
45
  directory: .
45
46
  model: opus
46
47
  connections: [frontend, backend]
@@ -49,6 +50,7 @@ swarm:
49
50
  - Edit
50
51
  - Bash
51
52
  frontend:
53
+ description: "Frontend specialist handling UI and user experience"
52
54
  directory: ./frontend
53
55
  model: sonnet
54
56
  tools:
@@ -56,6 +58,7 @@ swarm:
56
58
  - Write
57
59
  - Bash
58
60
  backend:
61
+ description: "Backend developer managing APIs and data layer"
59
62
  directory: ./backend
60
63
  model: sonnet
61
64
  tools:
@@ -90,6 +93,7 @@ swarm:
90
93
  main: architect
91
94
  instances:
92
95
  architect:
96
+ description: "System architect coordinating between service teams"
93
97
  directory: .
94
98
  model: opus
95
99
  connections: [frontend_lead, backend_lead, mobile_lead, devops]
@@ -97,6 +101,7 @@ swarm:
97
101
  tools: [Read, Edit, WebSearch]
98
102
 
99
103
  frontend_lead:
104
+ description: "Frontend team lead overseeing React development"
100
105
  directory: ./web-frontend
101
106
  model: opus
102
107
  connections: [react_dev, css_expert]
@@ -104,18 +109,21 @@ swarm:
104
109
  tools: [Read, Edit, Bash]
105
110
 
106
111
  react_dev:
112
+ description: "React developer specializing in components and state management"
107
113
  directory: ./web-frontend/src
108
114
  model: sonnet
109
115
  prompt: "You specialize in React components and state management"
110
116
  tools: [Edit, Write, "Bash(npm:*)"]
111
117
 
112
118
  css_expert:
119
+ description: "CSS specialist handling styling and responsive design"
113
120
  directory: ./web-frontend/styles
114
121
  model: sonnet
115
122
  prompt: "You handle all CSS and styling concerns"
116
123
  tools: [Edit, Write, Read]
117
124
 
118
125
  backend_lead:
126
+ description: "Backend team lead managing API development"
119
127
  directory: ./api-server
120
128
  model: opus
121
129
  connections: [api_dev, database_expert]
@@ -123,18 +131,21 @@ swarm:
123
131
  tools: [Read, Edit, Bash]
124
132
 
125
133
  api_dev:
134
+ description: "API developer building REST endpoints"
126
135
  directory: ./api-server/src
127
136
  model: sonnet
128
137
  prompt: "You develop REST API endpoints"
129
138
  tools: [Edit, Write, Bash]
130
139
 
131
140
  database_expert:
141
+ description: "Database specialist managing schemas and migrations"
132
142
  directory: ./api-server/db
133
143
  model: sonnet
134
144
  prompt: "You handle database schema and migrations"
135
145
  tools: [Edit, Write, "Bash(psql:*, migrate:*)"]
136
146
 
137
147
  mobile_lead:
148
+ description: "Mobile team lead coordinating cross-platform development"
138
149
  directory: ./mobile-app
139
150
  model: sonnet
140
151
  connections: [ios_dev, android_dev]
@@ -142,18 +153,21 @@ swarm:
142
153
  tools: [Read, Edit]
143
154
 
144
155
  ios_dev:
156
+ description: "iOS developer building native Apple applications"
145
157
  directory: ./mobile-app/ios
146
158
  model: sonnet
147
159
  prompt: "You develop the iOS application"
148
160
  tools: [Edit, Write, "Bash(xcodebuild:*, pod:*)"]
149
161
 
150
162
  android_dev:
163
+ description: "Android developer creating native Android apps"
151
164
  directory: ./mobile-app/android
152
165
  model: sonnet
153
166
  prompt: "You develop the Android application"
154
167
  tools: [Edit, Write, "Bash(gradle:*, adb:*)"]
155
168
 
156
169
  devops:
170
+ description: "DevOps engineer managing CI/CD and infrastructure"
157
171
  directory: ./infrastructure
158
172
  model: sonnet
159
173
  prompt: "You handle CI/CD and infrastructure"
@@ -182,6 +196,10 @@ swarm:
182
196
 
183
197
  #### Instance Configuration
184
198
 
199
+ Each instance must have:
200
+
201
+ - **description** (required): Brief description of the agent's role (used in task tool descriptions)
202
+
185
203
  Each instance can have:
186
204
 
187
205
  - **directory**: Working directory for this instance (can use ~ for home)
@@ -193,6 +211,7 @@ Each instance can have:
193
211
 
194
212
  ```yaml
195
213
  instance_name:
214
+ description: "Specialized agent focused on specific tasks"
196
215
  directory: ~/project/path
197
216
  model: opus
198
217
  connections: [other_instance1, other_instance2]
@@ -273,6 +292,7 @@ swarm:
273
292
  main: architect
274
293
  instances:
275
294
  architect:
295
+ description: "Lead architect responsible for system design and code quality"
276
296
  directory: .
277
297
  model: opus
278
298
  connections: [frontend, backend, devops]
@@ -283,6 +303,7 @@ swarm:
283
303
  - WebSearch
284
304
 
285
305
  frontend:
306
+ description: "Frontend developer specializing in React and TypeScript"
286
307
  directory: ./frontend
287
308
  model: sonnet
288
309
  connections: [architect]
@@ -293,6 +314,7 @@ swarm:
293
314
  - Bash
294
315
 
295
316
  backend:
317
+ description: "Backend developer building APIs and services"
296
318
  directory: ./backend
297
319
  model: sonnet
298
320
  connections: [architect, database]
@@ -302,6 +324,7 @@ swarm:
302
324
  - Bash
303
325
 
304
326
  database:
327
+ description: "Database administrator managing data persistence"
305
328
  directory: ./db
306
329
  model: haiku
307
330
  tools:
@@ -309,6 +332,7 @@ swarm:
309
332
  - Bash
310
333
 
311
334
  devops:
335
+ description: "DevOps engineer handling deployment and infrastructure"
312
336
  directory: .
313
337
  model: sonnet
314
338
  connections: [architect]
@@ -327,6 +351,7 @@ swarm:
327
351
  main: lead_researcher
328
352
  instances:
329
353
  lead_researcher:
354
+ description: "Lead researcher coordinating analysis and documentation"
330
355
  directory: ~/research
331
356
  model: opus
332
357
  connections: [data_analyst, writer]
@@ -340,6 +365,7 @@ swarm:
340
365
  url: "https://arxiv-mcp.example.com"
341
366
 
342
367
  data_analyst:
368
+ description: "Data analyst processing research data and statistics"
343
369
  directory: ~/research/data
344
370
  model: sonnet
345
371
  tools:
@@ -353,6 +379,7 @@ swarm:
353
379
  args: ["--notebook-dir", "."]
354
380
 
355
381
  writer:
382
+ description: "Technical writer preparing research documentation"
356
383
  directory: ~/research/papers
357
384
  model: sonnet
358
385
  tools:
@@ -397,7 +424,7 @@ claude-swarm mcp-serve INSTANCE_NAME --config CONFIG_FILE --session-timestamp TI
397
424
  - Sessions can be reset via the MCP server interface
398
425
  4. **Main Instance Launch**: The main instance is launched with its MCP configuration, giving it access to all connected instances
399
426
  5. **Inter-Instance Communication**: Connected instances expose themselves as MCP servers with these tools:
400
- - **task**: Execute tasks using Claude Code with configurable tools and return results
427
+ - **task**: Execute tasks using Claude Code with configurable tools and return results. The tool description includes the instance name and description (e.g., "Execute a task using Agent frontend_dev. Frontend developer specializing in React and TypeScript")
401
428
  - **session_info**: Get current Claude session information including ID and working directory
402
429
  - **reset_session**: Reset the Claude session for a fresh start
403
430
  6. **Session Management**: All session files are organized in `.claude-swarm/sessions/{timestamp}/`:
data/claude-swarm.yml CHANGED
@@ -4,6 +4,7 @@ swarm:
4
4
  main: lead_developer
5
5
  instances:
6
6
  lead_developer:
7
+ description: "Lead developer coordinating the team and making architectural decisions"
7
8
  directory: .
8
9
  model: sonnet
9
10
  prompt: "You are the lead developer coordinating the team"
@@ -13,14 +14,8 @@ swarm:
13
14
  # Example instances (uncomment and modify as needed):
14
15
 
15
16
  frontend_dev:
17
+ description: "Frontend developer specializing in React and modern web technologies"
16
18
  directory: .
17
19
  model: sonnet
18
20
  prompt: "You specialize in frontend development with React, TypeScript, and modern web technologies"
19
21
  tools: [Read, Edit, Write, "Bash(npm:*)", "Bash(yarn:*)", "Bash(pnpm:*)"]
20
- connections: [css_dev]
21
-
22
- css_dev:
23
- directory: .
24
- model: sonnet
25
- prompt: "You specialize in CSS development with Tailwind CSS, CSS Modules, and modern web technologies"
26
- tools: [Read, Edit, Write, "Bash(npm:*)", "Bash(yarn:*)", "Bash(pnpm:*)"]
@@ -4,14 +4,14 @@ swarm:
4
4
  main: lead_rails_dev
5
5
  instances:
6
6
  lead_rails_dev:
7
- role: "Lead Rails Developer"
7
+ description: "Senior Rails developer with 10+ years experience, coordinating the team and making architectural decisions"
8
8
  directory: .
9
9
  model: opus
10
10
  connections: [backend_dev, frontend_dev, test_engineer]
11
11
  prompt: "You are a senior Ruby on Rails developer with 10+ years of experience. You excel at Rails architecture, performance optimization, and best practices. You coordinate the team and make architectural decisions."
12
12
 
13
13
  backend_dev:
14
- role: "Backend Rails Developer"
14
+ description: "Backend specialist focusing on Rails models, controllers, services, jobs, and API design"
15
15
  directory: .
16
16
  model: sonnet
17
17
  connections: [test_engineer]
@@ -23,14 +23,14 @@ swarm:
23
23
  args: ["exec", "hbt", "stdio"]
24
24
 
25
25
  frontend_dev:
26
- role: "Rails Frontend Developer"
26
+ description: "Frontend Rails developer specializing in views, Stimulus/Turbo, and responsive UIs"
27
27
  directory: .
28
28
  model: sonnet
29
29
  connections: [test_engineer]
30
30
  prompt: "You are a Rails developer specializing in views, partials, helpers, Stimulus/Turbo, and asset pipeline. You excel at creating responsive UIs with Rails' built-in tools and modern CSS/JavaScript integration."
31
31
 
32
32
  test_engineer:
33
- role: "Rails Test Engineer"
33
+ description: "Testing expert specializing in Minitest and Rails testing best practices"
34
34
  directory: .
35
35
  model: sonnet
36
36
  prompt: "You are a Rails testing expert specializing in Minitest. You write comprehensive unit tests, integration tests, system tests, and fixtures. You ensure high test coverage and follow Rails testing best practices including proper use of assertions, test helpers, and factories."
@@ -69,6 +69,13 @@ module ClaudeSwarm
69
69
  version: "1.0.0"
70
70
  )
71
71
 
72
+ # Set dynamic description for TaskTool based on instance config
73
+ if @instance_config[:description]
74
+ TaskTool.description "Execute a task using Agent #{@instance_config[:name]}. #{@instance_config[:description]}"
75
+ else
76
+ TaskTool.description "Execute a task using Agent #{@instance_config[:name]}"
77
+ end
78
+
72
79
  # Register tool classes (not instances)
73
80
  server.register_tool(TaskTool)
74
81
  server.register_tool(SessionInfoTool)
@@ -83,7 +90,7 @@ module ClaudeSwarm
83
90
  description "Execute a task using Claude Code"
84
91
 
85
92
  arguments do
86
- required(:prompt).filled(:string).description("The task or question for Claude")
93
+ required(:prompt).filled(:string).description("The task or question for the agent")
87
94
  optional(:new_session).filled(:bool).description("Start a new session (default: false)")
88
95
  optional(:system_prompt).filled(:string).description("Override the system prompt for this request")
89
96
  end
@@ -157,7 +164,7 @@ module ClaudeSwarm
157
164
 
158
165
  class SessionInfoTool < FastMcp::Tool
159
166
  tool_name "session_info"
160
- description "Get information about the current Claude session"
167
+ description "Get information about the current Claude session for this agent"
161
168
 
162
169
  arguments do
163
170
  # No arguments needed
@@ -176,7 +183,7 @@ module ClaudeSwarm
176
183
 
177
184
  class ResetSessionTool < FastMcp::Tool
178
185
  tool_name "reset_session"
179
- description "Reset the Claude session, starting fresh on the next task"
186
+ description "Reset the Claude session for this agent, starting fresh on the next task"
180
187
 
181
188
  arguments do
182
189
  # No arguments needed
@@ -55,6 +55,8 @@ module ClaudeSwarm
55
55
  desc: "Claude model to use (e.g., opus, sonnet)"
56
56
  method_option :prompt, aliases: "-p", type: :string,
57
57
  desc: "System prompt for the instance"
58
+ method_option :description, type: :string,
59
+ desc: "Description of the instance's role"
58
60
  method_option :tools, aliases: "-t", type: :array,
59
61
  desc: "Allowed tools for the instance"
60
62
  method_option :mcp_config_path, type: :string,
@@ -71,6 +73,7 @@ module ClaudeSwarm
71
73
  directory: options[:directory],
72
74
  model: options[:model],
73
75
  prompt: options[:prompt],
76
+ description: options[:description],
74
77
  tools: options[:tools] || [],
75
78
  mcp_config_path: options[:mcp_config_path],
76
79
  vibe: options[:vibe]
@@ -105,6 +108,7 @@ module ClaudeSwarm
105
108
  main: lead_developer
106
109
  instances:
107
110
  lead_developer:
111
+ description: "Lead developer who coordinates the team and makes architectural decisions"
108
112
  directory: .
109
113
  model: sonnet
110
114
  prompt: "You are the lead developer coordinating the team"
@@ -114,24 +118,28 @@ module ClaudeSwarm
114
118
  # Example instances (uncomment and modify as needed):
115
119
 
116
120
  # frontend_dev:
121
+ # description: "Frontend developer specializing in React and modern web technologies"
117
122
  # directory: ./frontend
118
123
  # model: sonnet
119
124
  # prompt: "You specialize in frontend development with React, TypeScript, and modern web technologies"
120
125
  # tools: [Read, Edit, Write, "Bash(npm:*)", "Bash(yarn:*)", "Bash(pnpm:*)"]
121
126
 
122
127
  # backend_dev:
128
+ # description: "Backend developer focusing on APIs, databases, and server architecture"
123
129
  # directory: ../other-app/backend
124
130
  # model: sonnet
125
131
  # prompt: "You specialize in backend development, APIs, databases, and server architecture"
126
132
  # tools: [Read, Edit, Write, Bash]
127
133
 
128
134
  # devops_engineer:
135
+ # description: "DevOps engineer managing infrastructure, CI/CD, and deployments"
129
136
  # directory: .
130
137
  # model: sonnet
131
138
  # prompt: "You specialize in infrastructure, CI/CD, containerization, and deployment"
132
139
  # tools: [Read, Edit, Write, "Bash(docker:*)", "Bash(kubectl:*)", "Bash(terraform:*)"]
133
140
 
134
141
  # qa_engineer:
142
+ # description: "QA engineer ensuring quality through comprehensive testing"
135
143
  # directory: ./tests
136
144
  # model: sonnet
137
145
  # prompt: "You specialize in testing, quality assurance, and test automation"
@@ -72,6 +72,10 @@ module ClaudeSwarm
72
72
 
73
73
  def parse_instance(name, config)
74
74
  config ||= {}
75
+
76
+ # Validate required fields
77
+ raise Error, "Instance '#{name}' missing required 'description' field" unless config["description"]
78
+
75
79
  {
76
80
  name: name,
77
81
  directory: expand_path(config["directory"] || "."),
@@ -79,7 +83,8 @@ module ClaudeSwarm
79
83
  connections: Array(config["connections"]),
80
84
  tools: Array(config["tools"]),
81
85
  mcps: parse_mcps(config["mcps"] || []),
82
- prompt: config["prompt"]
86
+ prompt: config["prompt"],
87
+ description: config["description"]
83
88
  }
84
89
  end
85
90
 
@@ -98,6 +98,8 @@ module ClaudeSwarm
98
98
  # Add optional arguments
99
99
  args.push("--prompt", instance[:prompt]) if instance[:prompt]
100
100
 
101
+ args.push("--description", instance[:description]) if instance[:description]
102
+
101
103
  args.push("--tools", instance[:tools].join(",")) if instance[:tools] && !instance[:tools].empty?
102
104
 
103
105
  args.push("--mcp-config-path", mcp_config_path(name))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClaudeSwarm
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Arruda