opencode-swarm-plugin 0.44.2 → 0.45.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.
Files changed (42) hide show
  1. package/README.md +277 -54
  2. package/bin/swarm.ts +1 -1
  3. package/dist/decision-trace-integration.d.ts +204 -0
  4. package/dist/decision-trace-integration.d.ts.map +1 -0
  5. package/dist/hive.d.ts.map +1 -1
  6. package/dist/hive.js +9 -9
  7. package/dist/index.d.ts +32 -2
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +535 -27
  10. package/dist/plugin.js +295 -27
  11. package/dist/query-tools.d.ts +20 -12
  12. package/dist/query-tools.d.ts.map +1 -1
  13. package/dist/swarm-decompose.d.ts +4 -4
  14. package/dist/swarm-decompose.d.ts.map +1 -1
  15. package/dist/swarm-prompts.d.ts.map +1 -1
  16. package/dist/swarm-prompts.js +220 -22
  17. package/dist/swarm-review.d.ts.map +1 -1
  18. package/dist/swarm-signature.d.ts +106 -0
  19. package/dist/swarm-signature.d.ts.map +1 -0
  20. package/dist/swarm-strategies.d.ts +16 -3
  21. package/dist/swarm-strategies.d.ts.map +1 -1
  22. package/dist/swarm.d.ts +4 -2
  23. package/dist/swarm.d.ts.map +1 -1
  24. package/examples/commands/swarm.md +745 -0
  25. package/examples/plugin-wrapper-template.ts +2611 -0
  26. package/examples/skills/hive-workflow/SKILL.md +212 -0
  27. package/examples/skills/skill-creator/SKILL.md +223 -0
  28. package/examples/skills/swarm-coordination/SKILL.md +292 -0
  29. package/global-skills/cli-builder/SKILL.md +344 -0
  30. package/global-skills/cli-builder/references/advanced-patterns.md +244 -0
  31. package/global-skills/learning-systems/SKILL.md +644 -0
  32. package/global-skills/skill-creator/LICENSE.txt +202 -0
  33. package/global-skills/skill-creator/SKILL.md +352 -0
  34. package/global-skills/skill-creator/references/output-patterns.md +82 -0
  35. package/global-skills/skill-creator/references/workflows.md +28 -0
  36. package/global-skills/swarm-coordination/SKILL.md +995 -0
  37. package/global-skills/swarm-coordination/references/coordinator-patterns.md +235 -0
  38. package/global-skills/swarm-coordination/references/strategies.md +138 -0
  39. package/global-skills/system-design/SKILL.md +213 -0
  40. package/global-skills/testing-patterns/SKILL.md +430 -0
  41. package/global-skills/testing-patterns/references/dependency-breaking-catalog.md +586 -0
  42. package/package.json +5 -2
@@ -0,0 +1,212 @@
1
+ ---
2
+ name: hive-workflow
3
+ description: Issue tracking and task management using the hive system. Use when creating, updating, or managing work items. Use when you need to track bugs, features, tasks, or epics. Do NOT use for simple one-off questions or explorations.
4
+ tags:
5
+ - hive
6
+ - issues
7
+ - tracking
8
+ - workflow
9
+ tools:
10
+ - hive_create
11
+ - hive_query
12
+ - hive_update
13
+ - hive_close
14
+ - hive_create_epic
15
+ - hive_sync
16
+ related_skills:
17
+ - swarm-coordination
18
+ ---
19
+
20
+ # Hive Workflow Skill
21
+
22
+ Hive is a local-first issue tracking system designed for AI agents. This skill provides best practices for effective cell management.
23
+
24
+ **NOTE:** For swarm workflows, combine this skill with `swarm-coordination` from global-skills/.
25
+
26
+ ## Cell Types
27
+
28
+ | Type | When to Use |
29
+ | --------- | --------------------------------------- |
30
+ | `bug` | Something is broken and needs fixing |
31
+ | `feature` | New functionality to add |
32
+ | `task` | General work item |
33
+ | `chore` | Maintenance, refactoring, dependencies |
34
+ | `epic` | Large initiative with multiple subtasks |
35
+
36
+ ## Creating Effective Cells
37
+
38
+ ### Good Cell Titles
39
+
40
+ ```text
41
+ - "Fix null pointer exception in UserService.getProfile()"
42
+ - "Add dark mode toggle to settings page"
43
+ - "Migrate auth tokens from localStorage to httpOnly cookies"
44
+ ```
45
+
46
+ ### Bad Cell Titles
47
+
48
+ ```text
49
+ - "Fix bug" (too vague)
50
+ - "Make it better" (not actionable)
51
+ - "stuff" (meaningless)
52
+ ```
53
+
54
+ ### Cell Body Structure
55
+
56
+ ```markdown
57
+ ## Problem
58
+
59
+ [Clear description of the issue or need]
60
+
61
+ ## Expected Behavior
62
+
63
+ [What should happen]
64
+
65
+ ## Current Behavior
66
+
67
+ [What currently happens, for bugs]
68
+
69
+ ## Proposed Solution
70
+
71
+ [How to fix/implement, if known]
72
+
73
+ ## Acceptance Criteria
74
+
75
+ - [ ] Criterion 1
76
+ - [ ] Criterion 2
77
+
78
+ ## Notes
79
+
80
+ [Any additional context, links, or constraints]
81
+ ```
82
+
83
+ ## Workflow States
84
+
85
+ ```text
86
+ open → in_progress → closed
87
+
88
+ blocked (optional)
89
+ ```
90
+
91
+ ### State Transitions
92
+
93
+ ### Open → In Progress
94
+
95
+ ```typescript
96
+ hive_update(id: "hv-abc123", state: "in_progress")
97
+ ```
98
+
99
+ Use when you start working on a cell.
100
+
101
+ ### In Progress → Closed
102
+
103
+ ```typescript
104
+ hive_close(id: "hv-abc123", resolution: "Fixed in commit abc1234")
105
+ ```
106
+
107
+ Use when work is complete.
108
+
109
+ ### In Progress → Blocked
110
+
111
+ ```typescript
112
+ hive_update(id: "hv-abc123", state: "blocked", body: "Blocked by #hv-xyz789")
113
+ ```
114
+
115
+ Use when you can't proceed due to a dependency.
116
+
117
+ ## Querying Cells
118
+
119
+ ### Find Open Work
120
+
121
+ ```typescript
122
+ hive_query(state: "open", type: "bug")
123
+ ```
124
+
125
+ ### Search by Keywords
126
+
127
+ ```typescript
128
+ hive_query(search: "authentication")
129
+ ```
130
+
131
+ ### List Recent Activity
132
+
133
+ ```typescript
134
+ hive_query(limit: 10, sort: "updated")
135
+ ```
136
+
137
+ ## Epic Management
138
+
139
+ Epics are containers for related work:
140
+
141
+ ```markdown
142
+ ---
143
+ type: epic
144
+ title: User Authentication Overhaul
145
+ ---
146
+
147
+ ## Objective
148
+
149
+ Modernize the authentication system
150
+
151
+ ## Subtasks
152
+
153
+ - [ ] #hv-001: Implement OAuth2 provider
154
+ - [ ] #hv-002: Add MFA support
155
+ - [ ] #hv-003: Migrate session storage
156
+ - [ ] #hv-004: Update login UI
157
+ ```
158
+
159
+ ### Creating an Epic with Subtasks
160
+
161
+ 1. Create the epic first:
162
+
163
+ ```typescript
164
+ hive_create(type: "epic", title: "User Auth Overhaul", body: "...")
165
+ ```
166
+
167
+ 2. Create subtasks linked to the epic:
168
+
169
+ ```typescript
170
+ hive_create(type: "task", title: "Implement OAuth2", parent: "epic-id")
171
+ ```
172
+
173
+ ## Best Practices
174
+
175
+ ```text
176
+ 1. **One cell per logical unit of work** - Don't combine unrelated fixes
177
+ 2. **Update state promptly** - Keep cells reflecting reality
178
+ 3. **Add context in body** - Future you will thank present you
179
+ 4. **Link related cells** - Use `#hv-id` references
180
+ 5. **Close with resolution** - Explain how it was resolved
181
+ 6. **Use labels** - `priority:high`, `area:frontend`, etc.
182
+ ```
183
+
184
+ ## Sync and Collaboration
185
+
186
+ Cells sync with git:
187
+
188
+ - Changes tracked locally
189
+ - Use `hive_sync()` to commit and push to remote
190
+
191
+ ## Integration with Swarm
192
+
193
+ When working in a swarm:
194
+
195
+ ```text
196
+ 1. Load `swarm-coordination` skill with `skills_use(name="swarm-coordination")`
197
+ 2. Create epic with `hive_create_epic()` (atomic operation)
198
+ 3. Coordinator assigns cells to worker agents
199
+ 4. Workers load relevant skills based on subtask type
200
+ 5. Close cells as subtasks complete
201
+ 6. Close epic when all subtasks done
202
+ 7. Sync with `hive_sync()` (MANDATORY at session end)
203
+ ```
204
+
205
+ ### Skill Recommendations for Common Cell Types
206
+
207
+ ```text
208
+ - `type: "bug"` → Load `testing-patterns` for regression tests
209
+ - `type: "feature"` → Load `system-design` for architecture
210
+ - `type: "chore"` → Load `testing-patterns` if refactoring
211
+ - `type: "epic"` → Load `swarm-coordination` for decomposition
212
+ ```
@@ -0,0 +1,223 @@
1
+ ---
2
+ name: skill-creator
3
+ description: Guide for creating effective agent skills. Use when you want to create a new skill, improve an existing skill, or learn best practices for skill development. Helps codify learned patterns into reusable, discoverable skills.
4
+ tags:
5
+ - meta
6
+ - skills
7
+ - learning
8
+ - documentation
9
+ tools:
10
+ - skills_init
11
+ - skills_create
12
+ - skills_update
13
+ - skills_read
14
+ ---
15
+
16
+ # Skill Creator
17
+
18
+ This skill provides guidance for creating effective skills that extend agent capabilities with specialized knowledge, workflows, and tools.
19
+
20
+ ## What Are Skills?
21
+
22
+ Skills are modular, self-contained packages that extend agent capabilities by providing:
23
+
24
+ 1. **Specialized workflows** - Multi-step procedures for specific domains
25
+ 2. **Tool integrations** - Instructions for working with specific file formats or APIs
26
+ 3. **Domain expertise** - Project-specific knowledge, schemas, business logic
27
+ 4. **Bundled resources** - Scripts, references, and assets for complex tasks
28
+
29
+ Think of skills as "onboarding guides" that transform a general-purpose agent into a specialized one equipped with procedural knowledge.
30
+
31
+ ## Skill Anatomy
32
+
33
+ Every skill consists of a required SKILL.md file and optional bundled resources:
34
+
35
+ ```
36
+ skill-name/
37
+ ├── SKILL.md (required)
38
+ │ ├── YAML frontmatter (name, description, tags, tools)
39
+ │ └── Markdown instructions
40
+ └── Bundled Resources (optional)
41
+ ├── scripts/ - Executable code (run with skills_execute)
42
+ └── references/ - Documentation (load with skills_read)
43
+ ```
44
+
45
+ ### Progressive Disclosure
46
+
47
+ Skills use a three-level loading system:
48
+
49
+ 1. **Metadata** (name + description) - Always in context (~100 words)
50
+ 2. **SKILL.md body** - When skill triggers (<5k words)
51
+ 3. **Bundled resources** - On-demand as needed
52
+
53
+ Keep SKILL.md lean. Move detailed content to references/.
54
+
55
+ ## Creating a Skill
56
+
57
+ ### Step 1: Understand the Use Cases
58
+
59
+ Before creating, understand concrete examples:
60
+ - What triggers should activate this skill?
61
+ - What user requests would benefit from it?
62
+ - What workflows does it enable?
63
+
64
+ **Ask clarifying questions** if scope is unclear.
65
+
66
+ ### Step 2: Initialize the Skill
67
+
68
+ Use `skills_init` to create the full template structure:
69
+
70
+ ```
71
+ skills_init(
72
+ name: "my-skill",
73
+ description: "Initial description",
74
+ directory: ".opencode/skills"
75
+ )
76
+ ```
77
+
78
+ This creates:
79
+ - SKILL.md with TODO placeholders
80
+ - scripts/ with example script
81
+ - references/ with example doc
82
+
83
+ ### Step 3: Complete the SKILL.md
84
+
85
+ Fill in the TODO placeholders. Key sections:
86
+
87
+ **Frontmatter** - Critical for discoverability:
88
+ ```yaml
89
+ ---
90
+ name: my-skill
91
+ description: What it does and WHEN to use it. Be specific about triggering scenarios.
92
+ tags:
93
+ - category
94
+ - domain
95
+ tools:
96
+ - tool_names_used
97
+ ---
98
+ ```
99
+
100
+ **When to Use** - Specific triggering scenarios:
101
+ ```markdown
102
+ ## When to Use This Skill
103
+
104
+ - When working on X type of task
105
+ - When files matching Y pattern are involved
106
+ - When the user asks about Z topic
107
+ ```
108
+
109
+ **Instructions** - Actionable, imperative form:
110
+ ```markdown
111
+ ## Instructions
112
+
113
+ 1. Read the configuration file first
114
+ 2. Check for existing patterns before creating
115
+ 3. Always validate output before completing
116
+ ```
117
+
118
+ **Examples** - Realistic user requests:
119
+ ```markdown
120
+ ## Examples
121
+
122
+ ### Example: Realistic Scenario
123
+
124
+ **User**: "Help me do X"
125
+
126
+ **Process**:
127
+ 1. First step
128
+ 2. Second step
129
+ 3. Final step
130
+ ```
131
+
132
+ ### Step 4: Add Bundled Resources (Optional)
133
+
134
+ **scripts/** - Executable helpers:
135
+ - Use for repeated automation
136
+ - Token-efficient (run without reading)
137
+ - Run via `skills_execute`
138
+
139
+ **references/** - On-demand documentation:
140
+ - Detailed guides too long for SKILL.md
141
+ - API documentation
142
+ - Complex workflows
143
+ - Load via `skills_read`
144
+
145
+ ### Step 5: Test and Iterate
146
+
147
+ 1. Use `skills_use` to load the skill
148
+ 2. Try it on real tasks
149
+ 3. Notice struggles or inefficiencies
150
+ 4. Update SKILL.md based on experience
151
+ 5. Test again
152
+
153
+ ## Best Practices
154
+
155
+ ### Metadata Quality
156
+
157
+ The `name` and `description` determine when the skill triggers:
158
+
159
+ **Good descriptions**:
160
+ - "Guide for creating MCP servers. Use when building tools that connect LLMs to external APIs."
161
+ - "File organization helper. Use when Downloads folder is messy or files need restructuring."
162
+
163
+ **Bad descriptions**:
164
+ - "A useful skill" (too vague)
165
+ - "Does stuff with files" (not actionable)
166
+
167
+ ### Writing Style
168
+
169
+ Use **imperative/infinitive form** throughout:
170
+ - "Read the file first" (not "You should read the file")
171
+ - "Check for patterns" (not "Consider checking patterns")
172
+
173
+ ### Keep SKILL.md Lean
174
+
175
+ - Core instructions only (<5k words)
176
+ - Move details to references/
177
+ - Use examples sparingly
178
+ - Delete placeholder sections
179
+
180
+ ### Design for Discoverability
181
+
182
+ - Tags help agents find skills by category
183
+ - "When to Use" sections enable proper triggering
184
+ - Tools list shows what capabilities the skill uses
185
+
186
+ ## Quick Reference
187
+
188
+ ### Creating Skills
189
+
190
+ | Tool | Use When |
191
+ |------|----------|
192
+ | `skills_init` | Want full template structure with TODOs |
193
+ | `skills_create` | Have complete content ready to write |
194
+ | `swarm_learn` | Converting learned patterns to skills |
195
+
196
+ ### Managing Skills
197
+
198
+ | Tool | Use For |
199
+ |------|---------|
200
+ | `skills_list` | Discover available skills |
201
+ | `skills_use` | Activate a skill by loading its content |
202
+ | `skills_read` | Load a reference file from a skill |
203
+ | `skills_update` | Modify an existing skill |
204
+ | `skills_delete` | Remove an obsolete skill |
205
+
206
+ ### Execution
207
+
208
+ | Tool | Use For |
209
+ |------|---------|
210
+ | `skills_execute` | Run a script from a skill |
211
+ | `skills_add_script` | Add a new script to a skill |
212
+
213
+ ## From Learned Patterns to Skills
214
+
215
+ When you discover something reusable during work:
216
+
217
+ 1. **Identify the pattern** - What worked well?
218
+ 2. **Consider scope** - Is it project-specific or universal?
219
+ 3. **Use `swarm_learn`** - Document the learning
220
+ 4. **Create the skill** - Use `create_skill=true` or `skills_init`
221
+ 5. **Test and refine** - Iterate based on usage
222
+
223
+ Skills make swarms smarter over time by preserving learned knowledge for future agents.
@@ -0,0 +1,292 @@
1
+ ---
2
+ name: swarm-coordination
3
+ description: Multi-agent coordination patterns for OpenCode swarm workflows. Use when working on complex tasks that benefit from parallelization, when coordinating multiple agents, or when managing task decomposition. Do NOT use for simple single-agent tasks.
4
+ tags:
5
+ - swarm
6
+ - multi-agent
7
+ - coordination
8
+ tools:
9
+ - swarm_decompose
10
+ - swarm_complete
11
+ - swarmmail_init
12
+ - swarmmail_send
13
+ - swarmmail_inbox
14
+ - swarmmail_read_message
15
+ - swarmmail_reserve
16
+ - swarmmail_release
17
+ - skills_use
18
+ - skills_list
19
+ related_skills:
20
+ - testing-patterns
21
+ - system-design
22
+ - cli-builder
23
+ ---
24
+
25
+ # Swarm Coordination Skill
26
+
27
+ This skill provides guidance for effective multi-agent coordination in OpenCode swarm workflows.
28
+
29
+ **IMPORTANT:** This skill references global skills in `global-skills/`. Workers should load domain-specific skills based on their subtask type.
30
+
31
+ ## MANDATORY: Swarm Mail
32
+
33
+ **ALL coordination MUST use `swarmmail_*` tools.** This is non-negotiable.
34
+
35
+ Swarm Mail is embedded (no external server needed) and provides:
36
+
37
+ - File reservations to prevent conflicts
38
+ - Message passing between agents
39
+ - Thread-based coordination tied to cells
40
+
41
+ ## When to Use Swarm Coordination
42
+
43
+ Use swarm coordination when:
44
+
45
+ - A task has multiple independent subtasks that can run in parallel
46
+ - The task requires different specializations (e.g., frontend + backend + tests)
47
+ - Work can be divided by file/module boundaries
48
+ - Time-to-completion matters and parallelization helps
49
+
50
+ Do NOT use swarm coordination when:
51
+
52
+ - The task is simple and can be done by one agent
53
+ - Subtasks have heavy dependencies on each other
54
+ - The overhead of coordination exceeds the benefit
55
+
56
+ ## Task Decomposition Strategy
57
+
58
+ ### 1. Analyze the Task
59
+
60
+ Before decomposing, understand:
61
+
62
+ - What are the distinct units of work?
63
+ - Which parts can run in parallel vs sequentially?
64
+ - What are the file/module boundaries?
65
+ - Are there shared resources that need coordination?
66
+
67
+ ### 2. Choose a Decomposition Strategy
68
+
69
+ **Parallel Strategy** - For independent subtasks:
70
+
71
+ ```text
72
+ Parent Task: "Add user authentication"
73
+ ├── Subtask 1: "Create auth API endpoints" (backend)
74
+ ├── Subtask 2: "Build login/signup forms" (frontend)
75
+ ├── Subtask 3: "Write auth integration tests" (testing)
76
+ └── Subtask 4: "Add auth documentation" (docs)
77
+ ```
78
+
79
+ **Sequential Strategy** - When order matters:
80
+
81
+ ```text
82
+ Parent Task: "Migrate database schema"
83
+ ├── Step 1: "Create migration files"
84
+ ├── Step 2: "Update model definitions"
85
+ ├── Step 3: "Run migrations"
86
+ └── Step 4: "Verify data integrity"
87
+ ```
88
+
89
+ **Hybrid Strategy** - Mixed dependencies:
90
+
91
+ ```text
92
+ Parent Task: "Add feature X"
93
+ ├── Phase 1 (parallel):
94
+ │ ├── Subtask A: "Design API"
95
+ │ └── Subtask B: "Design UI mockups"
96
+ ├── Phase 2 (sequential, after Phase 1):
97
+ │ └── Subtask C: "Implement based on designs"
98
+ └── Phase 3 (parallel):
99
+ ├── Subtask D: "Write tests"
100
+ └── Subtask E: "Update docs"
101
+ ```
102
+
103
+ ## File Reservation Protocol
104
+
105
+ When multiple agents work on the same codebase:
106
+
107
+ 1. **Initialize Swarm Mail first** - Use `swarmmail_init` before any work
108
+ 2. **Reserve files before editing** - Use `swarmmail_reserve` to claim files
109
+ 3. **Respect reservations** - Don't edit files reserved by other agents
110
+ 4. **Release when done** - Use `swarmmail_release` or let `swarm_complete` handle it
111
+ 5. **Coordinate on shared files** - If you must edit a reserved file, send a message to the owning agent
112
+
113
+ ```typescript
114
+ // Initialize first
115
+ await swarmmail_init({
116
+ project_path: "$PWD",
117
+ task_description: "Working on auth feature",
118
+ });
119
+
120
+ // Reserve files
121
+ await swarmmail_reserve({
122
+ paths: ["src/auth/**"],
123
+ reason: "bd-123: Auth implementation",
124
+ ttl_seconds: 3600,
125
+ });
126
+
127
+ // Work...
128
+
129
+ // Release when done
130
+ await swarmmail_release();
131
+ ```
132
+
133
+ ## Communication Patterns
134
+
135
+ ### Broadcasting Updates
136
+
137
+ ```typescript
138
+ swarmmail_send({
139
+ to: ["*"],
140
+ subject: "API Complete",
141
+ body: "Completed API endpoints, ready for frontend integration",
142
+ thread_id: epic_id,
143
+ });
144
+ ```
145
+
146
+ ### Direct Coordination
147
+
148
+ ```typescript
149
+ swarmmail_send({
150
+ to: ["frontend-agent"],
151
+ subject: "Auth API Spec",
152
+ body: "Auth API is at /api/auth/*, here's the spec...",
153
+ thread_id: epic_id,
154
+ });
155
+ ```
156
+
157
+ ### Checking for Messages
158
+
159
+ ```typescript
160
+ // Check inbox (max 5, no bodies for context safety)
161
+ const inbox = await swarmmail_inbox();
162
+
163
+ // Read specific message body
164
+ const message = await swarmmail_read_message({ message_id: N });
165
+ ```
166
+
167
+ ### Reporting Blockers
168
+
169
+ ```typescript
170
+ swarmmail_send({
171
+ to: ["coordinator"],
172
+ subject: "BLOCKED: Need DB schema",
173
+ body: "Can't proceed without users table",
174
+ thread_id: epic_id,
175
+ importance: "urgent",
176
+ });
177
+ ```
178
+
179
+ ## Best Practices
180
+
181
+ 1. **Initialize Swarm Mail first** - Always call `swarmmail_init` before any work
182
+ 2. **Small, focused subtasks** - Each subtask should be completable in one agent session
183
+ 3. **Clear boundaries** - Define exactly what files/modules each subtask touches
184
+ 4. **Explicit handoffs** - When one task enables another, communicate clearly
185
+ 5. **Graceful failures** - If a subtask fails, don't block the whole swarm
186
+ 6. **Progress updates** - Use beads to track subtask status
187
+ 7. **Load relevant skills** - Workers should call `skills_use()` based on their task type:
188
+ - Testing work → `skills_use(name="testing-patterns")`
189
+ - Architecture decisions → `skills_use(name="system-design")`
190
+ - CLI development → `skills_use(name="cli-builder")`
191
+ - Multi-agent coordination → `skills_use(name="swarm-coordination")`
192
+
193
+ ## Common Patterns
194
+
195
+ ### Feature Development
196
+
197
+ ```yaml
198
+ decomposition:
199
+ strategy: hybrid
200
+ skills: [system-design, swarm-coordination]
201
+ phases:
202
+ - name: design
203
+ parallel: true
204
+ subtasks: [api-design, ui-design]
205
+ recommended_skills: [system-design]
206
+ - name: implement
207
+ parallel: true
208
+ subtasks: [backend, frontend]
209
+ recommended_skills: [system-design]
210
+ - name: validate
211
+ parallel: true
212
+ subtasks: [tests, docs, review]
213
+ recommended_skills: [testing-patterns]
214
+ ```
215
+
216
+ ### Bug Fix Swarm
217
+
218
+ ```yaml
219
+ decomposition:
220
+ strategy: sequential
221
+ skills: [testing-patterns]
222
+ subtasks:
223
+ - reproduce-bug
224
+ - identify-root-cause
225
+ - implement-fix
226
+ - add-regression-test
227
+ recommended_skills: [testing-patterns]
228
+ ```
229
+
230
+ ### Refactoring
231
+
232
+ ```yaml
233
+ decomposition:
234
+ strategy: parallel
235
+ skills: [testing-patterns, system-design]
236
+ subtasks:
237
+ - refactor-module-a
238
+ - refactor-module-b
239
+ - update-imports
240
+ - run-full-test-suite
241
+ recommended_skills: [testing-patterns, system-design]
242
+ ```
243
+
244
+ ## Skill Integration Workflow
245
+
246
+ **For Coordinators:**
247
+
248
+ 1. Initialize Swarm Mail with `swarmmail_init`
249
+ 2. Load `swarm-coordination` skill
250
+ 3. Analyze task type
251
+ 4. Load additional skills based on domain (testing, design, CLI)
252
+ 5. Include skill recommendations in `shared_context` for workers
253
+
254
+ **For Workers:**
255
+
256
+ 1. Initialize Swarm Mail with `swarmmail_init`
257
+ 2. Read `shared_context` from coordinator
258
+ 3. Load recommended skills with `skills_use(name="skill-name")`
259
+ 4. Apply skill knowledge to subtask
260
+ 5. Report progress via `swarmmail_send`
261
+ 6. Complete with `swarm_complete`
262
+
263
+ **Example shared_context:**
264
+
265
+ ```markdown
266
+ ## Context from Coordinator
267
+
268
+ Past similar tasks: [CASS results]
269
+ Project learnings: [semantic-memory results]
270
+
271
+ ## Recommended Skills
272
+
273
+ - skills_use(name="testing-patterns") - for test creation
274
+ - skills_use(name="system-design") - for module boundaries
275
+
276
+ ## Task-Specific Notes
277
+
278
+ [Domain knowledge from coordinator]
279
+ ```
280
+
281
+ ## Swarm Mail Quick Reference
282
+
283
+ | Tool | Purpose |
284
+ | ------------------------ | ----------------------------------- |
285
+ | `swarmmail_init` | Initialize session (REQUIRED FIRST) |
286
+ | `swarmmail_send` | Send message to agents |
287
+ | `swarmmail_inbox` | Check inbox (max 5, no bodies) |
288
+ | `swarmmail_read_message` | Read specific message body |
289
+ | `swarmmail_reserve` | Reserve files for exclusive editing |
290
+ | `swarmmail_release` | Release file reservations |
291
+ | `swarmmail_ack` | Acknowledge message |
292
+ | `swarmmail_health` | Check database health |