opencode-swarm-plugin 0.12.20 → 0.12.22

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.
@@ -0,0 +1,165 @@
1
+ ---
2
+ name: beads-workflow
3
+ description: Issue tracking and task management using the beads 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
+ - beads
6
+ - issues
7
+ - tracking
8
+ - workflow
9
+ tools:
10
+ - beads_create
11
+ - beads_query
12
+ - beads_update
13
+ - beads_close
14
+ ---
15
+
16
+ # Beads Workflow Skill
17
+
18
+ Beads is a local-first issue tracking system designed for AI agents. This skill provides best practices for effective bead management.
19
+
20
+ ## Bead Types
21
+
22
+ | Type | When to Use |
23
+ |------|-------------|
24
+ | `bug` | Something is broken and needs fixing |
25
+ | `feature` | New functionality to add |
26
+ | `task` | General work item |
27
+ | `chore` | Maintenance, refactoring, dependencies |
28
+ | `epic` | Large initiative with multiple subtasks |
29
+
30
+ ## Creating Effective Beads
31
+
32
+ ### Good Bead Titles
33
+ - "Fix null pointer exception in UserService.getProfile()"
34
+ - "Add dark mode toggle to settings page"
35
+ - "Migrate auth tokens from localStorage to httpOnly cookies"
36
+
37
+ ### Bad Bead Titles
38
+ - "Fix bug" (too vague)
39
+ - "Make it better" (not actionable)
40
+ - "stuff" (meaningless)
41
+
42
+ ### Bead Body Structure
43
+
44
+ ```markdown
45
+ ## Problem
46
+ [Clear description of the issue or need]
47
+
48
+ ## Expected Behavior
49
+ [What should happen]
50
+
51
+ ## Current Behavior
52
+ [What currently happens, for bugs]
53
+
54
+ ## Proposed Solution
55
+ [How to fix/implement, if known]
56
+
57
+ ## Acceptance Criteria
58
+ - [ ] Criterion 1
59
+ - [ ] Criterion 2
60
+
61
+ ## Notes
62
+ [Any additional context, links, or constraints]
63
+ ```
64
+
65
+ ## Workflow States
66
+
67
+ ```
68
+ open → in_progress → closed
69
+
70
+ blocked (optional)
71
+ ```
72
+
73
+ ### State Transitions
74
+
75
+ **Open → In Progress**
76
+ ```
77
+ beads_update(id: "abc123", state: "in_progress")
78
+ ```
79
+ Use when you start working on a bead.
80
+
81
+ **In Progress → Closed**
82
+ ```
83
+ beads_close(id: "abc123", resolution: "Fixed in commit abc1234")
84
+ ```
85
+ Use when work is complete.
86
+
87
+ **In Progress → Blocked**
88
+ ```
89
+ beads_update(id: "abc123", state: "blocked", body: "Blocked by #xyz789")
90
+ ```
91
+ Use when you can't proceed due to a dependency.
92
+
93
+ ## Querying Beads
94
+
95
+ ### Find Open Work
96
+ ```
97
+ beads_query(state: "open", type: "bug")
98
+ ```
99
+
100
+ ### Search by Keywords
101
+ ```
102
+ beads_query(search: "authentication")
103
+ ```
104
+
105
+ ### List Recent Activity
106
+ ```
107
+ beads_query(limit: 10, sort: "updated")
108
+ ```
109
+
110
+ ## Epic Management
111
+
112
+ Epics are containers for related work:
113
+
114
+ ```markdown
115
+ ---
116
+ type: epic
117
+ title: User Authentication Overhaul
118
+ ---
119
+
120
+ ## Objective
121
+ Modernize the authentication system
122
+
123
+ ## Subtasks
124
+ - [ ] #bead-001: Implement OAuth2 provider
125
+ - [ ] #bead-002: Add MFA support
126
+ - [ ] #bead-003: Migrate session storage
127
+ - [ ] #bead-004: Update login UI
128
+ ```
129
+
130
+ ### Creating an Epic with Subtasks
131
+
132
+ 1. Create the epic first:
133
+ ```
134
+ beads_create(type: "epic", title: "User Auth Overhaul", body: "...")
135
+ ```
136
+
137
+ 2. Create subtasks linked to the epic:
138
+ ```
139
+ beads_create(type: "task", title: "Implement OAuth2", parent: "epic-id")
140
+ ```
141
+
142
+ ## Best Practices
143
+
144
+ 1. **One bead per logical unit of work** - Don't combine unrelated fixes
145
+ 2. **Update state promptly** - Keep beads reflecting reality
146
+ 3. **Add context in body** - Future you will thank present you
147
+ 4. **Link related beads** - Use `#bead-id` references
148
+ 5. **Close with resolution** - Explain how it was resolved
149
+ 6. **Use labels** - `priority:high`, `area:frontend`, etc.
150
+
151
+ ## Sync and Collaboration
152
+
153
+ Beads sync automatically with the central server:
154
+ - Changes push on close
155
+ - Conflicts merge automatically
156
+ - Use `bd sync` to force sync
157
+
158
+ ## Integration with Swarm
159
+
160
+ When working in a swarm:
161
+ 1. Create a parent bead for the overall task
162
+ 2. Decompose into child beads for subtasks
163
+ 3. Assign agents to specific beads
164
+ 4. Close beads as subtasks complete
165
+ 5. Close parent when all children done
@@ -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,148 @@
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
+ - agentmail_init
12
+ - agentmail_send
13
+ ---
14
+
15
+ # Swarm Coordination Skill
16
+
17
+ This skill provides guidance for effective multi-agent coordination in OpenCode swarm workflows.
18
+
19
+ ## When to Use Swarm Coordination
20
+
21
+ Use swarm coordination when:
22
+ - A task has multiple independent subtasks that can run in parallel
23
+ - The task requires different specializations (e.g., frontend + backend + tests)
24
+ - Work can be divided by file/module boundaries
25
+ - Time-to-completion matters and parallelization helps
26
+
27
+ Do NOT use swarm coordination when:
28
+ - The task is simple and can be done by one agent
29
+ - Subtasks have heavy dependencies on each other
30
+ - The overhead of coordination exceeds the benefit
31
+
32
+ ## Task Decomposition Strategy
33
+
34
+ ### 1. Analyze the Task
35
+
36
+ Before decomposing, understand:
37
+ - What are the distinct units of work?
38
+ - Which parts can run in parallel vs sequentially?
39
+ - What are the file/module boundaries?
40
+ - Are there shared resources that need coordination?
41
+
42
+ ### 2. Choose a Decomposition Strategy
43
+
44
+ **Parallel Strategy** - For independent subtasks:
45
+ ```
46
+ Parent Task: "Add user authentication"
47
+ ├── Subtask 1: "Create auth API endpoints" (backend)
48
+ ├── Subtask 2: "Build login/signup forms" (frontend)
49
+ ├── Subtask 3: "Write auth integration tests" (testing)
50
+ └── Subtask 4: "Add auth documentation" (docs)
51
+ ```
52
+
53
+ **Sequential Strategy** - When order matters:
54
+ ```
55
+ Parent Task: "Migrate database schema"
56
+ ├── Step 1: "Create migration files"
57
+ ├── Step 2: "Update model definitions"
58
+ ├── Step 3: "Run migrations"
59
+ └── Step 4: "Verify data integrity"
60
+ ```
61
+
62
+ **Hybrid Strategy** - Mixed dependencies:
63
+ ```
64
+ Parent Task: "Add feature X"
65
+ ├── Phase 1 (parallel):
66
+ │ ├── Subtask A: "Design API"
67
+ │ └── Subtask B: "Design UI mockups"
68
+ ├── Phase 2 (sequential, after Phase 1):
69
+ │ └── Subtask C: "Implement based on designs"
70
+ └── Phase 3 (parallel):
71
+ ├── Subtask D: "Write tests"
72
+ └── Subtask E: "Update docs"
73
+ ```
74
+
75
+ ## File Reservation Protocol
76
+
77
+ When multiple agents work on the same codebase:
78
+
79
+ 1. **Reserve files before editing** - Use `agentmail_reserve` to claim files
80
+ 2. **Respect reservations** - Don't edit files reserved by other agents
81
+ 3. **Release when done** - Files auto-release on task completion
82
+ 4. **Coordinate on shared files** - If you must edit a reserved file, send a message to the owning agent
83
+
84
+ ## Communication Patterns
85
+
86
+ ### Broadcasting Updates
87
+ ```
88
+ agentmail_send(recipients: ["all"], message: "Completed API endpoints, ready for frontend integration")
89
+ ```
90
+
91
+ ### Direct Coordination
92
+ ```
93
+ agentmail_send(recipients: ["frontend-agent"], message: "Auth API is at /api/auth/*, here's the spec...")
94
+ ```
95
+
96
+ ### Blocking on Dependencies
97
+ ```
98
+ # Wait for a dependency before proceeding
99
+ agentmail_receive(wait: true, filter: "api-complete")
100
+ ```
101
+
102
+ ## Best Practices
103
+
104
+ 1. **Small, focused subtasks** - Each subtask should be completable in one agent session
105
+ 2. **Clear boundaries** - Define exactly what files/modules each subtask touches
106
+ 3. **Explicit handoffs** - When one task enables another, communicate clearly
107
+ 4. **Graceful failures** - If a subtask fails, don't block the whole swarm
108
+ 5. **Progress updates** - Use beads to track subtask status
109
+
110
+ ## Common Patterns
111
+
112
+ ### Feature Development
113
+ ```yaml
114
+ decomposition:
115
+ strategy: hybrid
116
+ phases:
117
+ - name: design
118
+ parallel: true
119
+ subtasks: [api-design, ui-design]
120
+ - name: implement
121
+ parallel: true
122
+ subtasks: [backend, frontend]
123
+ - name: validate
124
+ parallel: true
125
+ subtasks: [tests, docs, review]
126
+ ```
127
+
128
+ ### Bug Fix Swarm
129
+ ```yaml
130
+ decomposition:
131
+ strategy: sequential
132
+ subtasks:
133
+ - reproduce-bug
134
+ - identify-root-cause
135
+ - implement-fix
136
+ - add-regression-test
137
+ ```
138
+
139
+ ### Refactoring
140
+ ```yaml
141
+ decomposition:
142
+ strategy: parallel
143
+ subtasks:
144
+ - refactor-module-a
145
+ - refactor-module-b
146
+ - update-imports
147
+ - run-full-test-suite
148
+ ```