opencode-swarm-plugin 0.12.25 → 0.12.27

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.
@@ -633,6 +633,13 @@
633
633
  {"id":"opencode-swarm-plugin-cert","title":"Test bead minimal","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-08T11:12:40.697512-08:00","updated_at":"2025-12-08T11:12:43.475157-08:00","closed_at":"2025-12-08T11:12:43.475157-08:00"}
634
634
  {"id":"opencode-swarm-plugin-cf7z","title":"Test bead minimal","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-07T19:41:10.601954-08:00","updated_at":"2025-12-07T19:41:13.224334-08:00","closed_at":"2025-12-07T19:41:13.224334-08:00"}
635
635
  {"id":"opencode-swarm-plugin-cjq3","title":"Thread link test bead","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-08T08:23:19.197074-08:00","updated_at":"2025-12-08T08:23:20.668185-08:00","closed_at":"2025-12-08T08:23:20.668185-08:00"}
636
+ {"id":"opencode-swarm-plugin-cliku","title":"Investigate potential skills for opencode-swarm-plugin","description":"Analyze codebase patterns, workflows, and domain knowledge to identify new skill opportunities beyond the existing 5 bundled skills","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-12T21:44:25.282969-08:00","updated_at":"2025-12-12T21:47:11.486359-08:00","closed_at":"2025-12-12T21:47:11.486359-08:00"}
637
+ {"id":"opencode-swarm-plugin-cliku.1","title":"Analyze src/ modules for extractable patterns","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:44:25.33437-08:00","updated_at":"2025-12-12T21:46:09.368653-08:00","closed_at":"2025-12-12T21:46:09.368662-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-cliku.1","depends_on_id":"opencode-swarm-plugin-cliku","type":"parent-child","created_at":"2025-12-12T21:44:25.335292-08:00","created_by":"daemon"}]}
638
+ {"id":"opencode-swarm-plugin-cliku.2","title":"Analyze existing skills for gaps and extensions","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:44:25.38425-08:00","updated_at":"2025-12-12T21:46:10.054798-08:00","closed_at":"2025-12-12T21:46:10.0548-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-cliku.2","depends_on_id":"opencode-swarm-plugin-cliku","type":"parent-child","created_at":"2025-12-12T21:44:25.385157-08:00","created_by":"daemon"}]}
639
+ {"id":"opencode-swarm-plugin-cliku.3","title":"Search CASS for skill-related patterns from past sessions","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:44:25.437227-08:00","updated_at":"2025-12-12T21:46:10.75249-08:00","closed_at":"2025-12-12T21:46:10.752496-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-cliku.3","depends_on_id":"opencode-swarm-plugin-cliku","type":"parent-child","created_at":"2025-12-12T21:44:25.438595-08:00","created_by":"daemon"}]}
640
+ {"id":"opencode-swarm-plugin-cliku.4","title":"Analyze CLI and plugin patterns for tooling skills","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:44:25.48734-08:00","updated_at":"2025-12-12T21:46:11.436638-08:00","closed_at":"2025-12-12T21:46:11.43664-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-cliku.4","depends_on_id":"opencode-swarm-plugin-cliku","type":"parent-child","created_at":"2025-12-12T21:44:25.488372-08:00","created_by":"daemon"}]}
641
+ {"id":"opencode-swarm-plugin-cliku.5","title":"Synthesize findings into skill recommendations","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-12T21:44:25.535457-08:00","updated_at":"2025-12-12T21:47:09.742548-08:00","closed_at":"2025-12-12T21:47:09.742548-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-cliku.5","depends_on_id":"opencode-swarm-plugin-cliku","type":"parent-child","created_at":"2025-12-12T21:44:25.536925-08:00","created_by":"daemon"}]}
642
+ {"id":"opencode-swarm-plugin-cliku.6","title":"Search pdf-brain for skill-worthy knowledge","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:46:12.83653-08:00","updated_at":"2025-12-12T21:46:46.011065-08:00","closed_at":"2025-12-12T21:46:46.011065-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-cliku.6","depends_on_id":"opencode-swarm-plugin-cliku","type":"parent-child","created_at":"2025-12-12T21:46:12.837492-08:00","created_by":"daemon"}]}
636
643
  {"id":"opencode-swarm-plugin-cmo6","title":"Update test bead","description":"Blocked on dependency","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-08T07:53:44.299916-08:00","updated_at":"2025-12-08T07:53:46.527966-08:00","closed_at":"2025-12-08T07:53:46.527966-08:00"}
637
644
  {"id":"opencode-swarm-plugin-cmx0j","title":"Thread link test bead","description":"Important context here\n\n[thread:test-thread-789]","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-10T09:06:08.377019-08:00","updated_at":"2025-12-10T09:06:10.913752-08:00","closed_at":"2025-12-10T09:06:10.913752-08:00"}
638
645
  {"id":"opencode-swarm-plugin-cor","title":"Bead to close","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-07T19:34:53.00247-08:00","updated_at":"2025-12-07T19:34:53.027513-08:00","closed_at":"2025-12-07T19:34:53.027513-08:00"}
@@ -828,6 +835,15 @@
828
835
  {"id":"opencode-swarm-plugin-ga3","title":"Query test bead","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-07T19:39:18.459646-08:00","updated_at":"2025-12-07T19:39:20.527941-08:00","closed_at":"2025-12-07T19:39:20.527941-08:00"}
829
836
  {"id":"opencode-swarm-plugin-gatr","title":"Epic with file references","description":"","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-08T11:11:08.773318-08:00","updated_at":"2025-12-08T11:11:10.670318-08:00","closed_at":"2025-12-08T11:11:10.670318-08:00"}
830
837
  {"id":"opencode-swarm-plugin-gatr.2","title":"Edit src/b.ts","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-08T11:11:08.844156-08:00","updated_at":"2025-12-08T11:11:10.722914-08:00","closed_at":"2025-12-08T11:11:10.722914-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-gatr.2","depends_on_id":"opencode-swarm-plugin-gatr","type":"parent-child","created_at":"2025-12-08T11:11:08.844503-08:00","created_by":"daemon"}]}
838
+ {"id":"opencode-swarm-plugin-gf1n8","title":"Add skills documentation and create 7 new bundled skills","description":"Update README with skills feature documentation, publish new version, then create 7 new skills: agent-patterns, tacit-knowledge-extraction, learning-systems, zod-validation, resilience-patterns, mcp-tool-authoring, testing-strategies","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-12T21:49:01.067542-08:00","updated_at":"2025-12-12T21:53:55.973974-08:00","closed_at":"2025-12-12T21:53:55.973974-08:00"}
839
+ {"id":"opencode-swarm-plugin-gf1n8.1","title":"Update README with skills documentation","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-12T21:49:01.108379-08:00","updated_at":"2025-12-12T21:49:37.717118-08:00","closed_at":"2025-12-12T21:49:37.717118-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-gf1n8.1","depends_on_id":"opencode-swarm-plugin-gf1n8","type":"parent-child","created_at":"2025-12-12T21:49:01.109457-08:00","created_by":"daemon"}]}
840
+ {"id":"opencode-swarm-plugin-gf1n8.2","title":"Create agent-patterns skill from PDF","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:49:01.147507-08:00","updated_at":"2025-12-12T21:53:28.210831-08:00","closed_at":"2025-12-12T21:53:28.210831-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-gf1n8.2","depends_on_id":"opencode-swarm-plugin-gf1n8","type":"parent-child","created_at":"2025-12-12T21:49:01.148296-08:00","created_by":"daemon"}]}
841
+ {"id":"opencode-swarm-plugin-gf1n8.3","title":"Create tacit-knowledge-extraction skill","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:49:01.190071-08:00","updated_at":"2025-12-12T21:53:29.05083-08:00","closed_at":"2025-12-12T21:53:29.05083-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-gf1n8.3","depends_on_id":"opencode-swarm-plugin-gf1n8","type":"parent-child","created_at":"2025-12-12T21:49:01.191674-08:00","created_by":"daemon"}]}
842
+ {"id":"opencode-swarm-plugin-gf1n8.4","title":"Create learning-systems skill","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:49:01.240273-08:00","updated_at":"2025-12-12T21:53:29.822709-08:00","closed_at":"2025-12-12T21:53:29.822709-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-gf1n8.4","depends_on_id":"opencode-swarm-plugin-gf1n8","type":"parent-child","created_at":"2025-12-12T21:49:01.241765-08:00","created_by":"daemon"}]}
843
+ {"id":"opencode-swarm-plugin-gf1n8.5","title":"Create zod-validation skill","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:49:01.286597-08:00","updated_at":"2025-12-12T21:53:30.592121-08:00","closed_at":"2025-12-12T21:53:30.592121-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-gf1n8.5","depends_on_id":"opencode-swarm-plugin-gf1n8","type":"parent-child","created_at":"2025-12-12T21:49:01.287248-08:00","created_by":"daemon"}]}
844
+ {"id":"opencode-swarm-plugin-gf1n8.6","title":"Create resilience-patterns skill","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:49:01.326304-08:00","updated_at":"2025-12-12T21:53:31.396458-08:00","closed_at":"2025-12-12T21:53:31.396458-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-gf1n8.6","depends_on_id":"opencode-swarm-plugin-gf1n8","type":"parent-child","created_at":"2025-12-12T21:49:01.327839-08:00","created_by":"daemon"}]}
845
+ {"id":"opencode-swarm-plugin-gf1n8.7","title":"Create mcp-tool-authoring skill","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:49:01.3722-08:00","updated_at":"2025-12-12T21:53:32.220987-08:00","closed_at":"2025-12-12T21:53:32.220987-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-gf1n8.7","depends_on_id":"opencode-swarm-plugin-gf1n8","type":"parent-child","created_at":"2025-12-12T21:49:01.373746-08:00","created_by":"daemon"}]}
846
+ {"id":"opencode-swarm-plugin-gf1n8.8","title":"Create testing-strategies skill","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-12T21:49:01.415744-08:00","updated_at":"2025-12-12T21:53:32.979008-08:00","closed_at":"2025-12-12T21:53:32.979008-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-gf1n8.8","depends_on_id":"opencode-swarm-plugin-gf1n8","type":"parent-child","created_at":"2025-12-12T21:49:01.417461-08:00","created_by":"daemon"}]}
831
847
  {"id":"opencode-swarm-plugin-gf3y","title":"Query test bead","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-08T11:12:25.651349-08:00","updated_at":"2025-12-08T11:12:28.033348-08:00","closed_at":"2025-12-08T11:12:28.033348-08:00"}
832
848
  {"id":"opencode-swarm-plugin-ggq","title":"Limit test bead 4","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-07T19:36:06.582584-08:00","updated_at":"2025-12-07T19:36:08.680139-08:00","closed_at":"2025-12-07T19:36:08.680139-08:00"}
833
849
  {"id":"opencode-swarm-plugin-gh1h","title":"Bead to close","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-08T11:11:38.973012-08:00","updated_at":"2025-12-08T11:11:38.996815-08:00","closed_at":"2025-12-08T11:11:38.996815-08:00"}
@@ -925,6 +941,7 @@
925
941
  {"id":"opencode-swarm-plugin-if3v","title":"Limit test bead 4","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-08T11:10:53.346318-08:00","updated_at":"2025-12-08T11:10:55.820026-08:00","closed_at":"2025-12-08T11:10:55.820026-08:00"}
926
942
  {"id":"opencode-swarm-plugin-ijyv","title":"Epic with file references","description":"","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-08T08:56:56.579396-08:00","updated_at":"2025-12-08T08:56:58.480064-08:00","closed_at":"2025-12-08T08:56:58.480064-08:00"}
927
943
  {"id":"opencode-swarm-plugin-ijyv.2","title":"Edit src/b.ts","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-08T08:56:56.641855-08:00","updated_at":"2025-12-08T08:56:58.530793-08:00","closed_at":"2025-12-08T08:56:58.530793-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-ijyv.2","depends_on_id":"opencode-swarm-plugin-ijyv","type":"parent-child","created_at":"2025-12-08T08:56:56.642441-08:00","created_by":"daemon"}]}
944
+ {"id":"opencode-swarm-plugin-ijzjd","title":"Update README to document skills feature","description":"","status":"closed","priority":1,"issue_type":"task","created_at":"2025-12-12T21:46:13.821586-08:00","updated_at":"2025-12-12T21:49:38.634771-08:00","closed_at":"2025-12-12T21:49:38.634771-08:00"}
928
945
  {"id":"opencode-swarm-plugin-ikff","title":"Integration test epic","description":"Testing epic creation","status":"closed","priority":1,"issue_type":"epic","created_at":"2025-12-08T08:56:56.45202-08:00","updated_at":"2025-12-08T08:56:58.380335-08:00","closed_at":"2025-12-08T08:56:58.380335-08:00"}
929
946
  {"id":"opencode-swarm-plugin-ikff.1","title":"Subtask 1","description":"","status":"closed","priority":2,"issue_type":"task","created_at":"2025-12-08T08:56:56.484256-08:00","updated_at":"2025-12-08T08:56:58.407318-08:00","closed_at":"2025-12-08T08:56:58.407318-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-ikff.1","depends_on_id":"opencode-swarm-plugin-ikff","type":"parent-child","created_at":"2025-12-08T08:56:56.485079-08:00","created_by":"daemon"}]}
930
947
  {"id":"opencode-swarm-plugin-ikff.2","title":"Subtask 2","description":"","status":"closed","priority":3,"issue_type":"task","created_at":"2025-12-08T08:56:56.516509-08:00","updated_at":"2025-12-08T08:56:58.432353-08:00","closed_at":"2025-12-08T08:56:58.432353-08:00","dependencies":[{"issue_id":"opencode-swarm-plugin-ikff.2","depends_on_id":"opencode-swarm-plugin-ikff","type":"parent-child","created_at":"2025-12-08T08:56:56.517327-08:00","created_by":"daemon"}]}
@@ -0,0 +1,31 @@
1
+ name: opencode
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [created]
6
+ pull_request_review_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ opencode:
11
+ if: |
12
+ contains(github.event.comment.body, ' /oc') ||
13
+ startsWith(github.event.comment.body, '/oc') ||
14
+ contains(github.event.comment.body, ' /opencode') ||
15
+ startsWith(github.event.comment.body, '/opencode')
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ id-token: write
19
+ contents: read
20
+ pull-requests: read
21
+ issues: read
22
+ steps:
23
+ - name: Checkout repository
24
+ uses: actions/checkout@v4
25
+
26
+ - name: Run opencode
27
+ uses: sst/opencode/github@latest
28
+ env:
29
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
30
+ with:
31
+ model: anthropic/claude-sonnet-4-5
package/README.md CHANGED
@@ -170,6 +170,111 @@ model: anthropic/claude-haiku-4-5 # Your chosen worker model
170
170
 
171
171
  Edit these files to customize behavior. Run `swarm setup` to regenerate defaults.
172
172
 
173
+ ## Skills
174
+
175
+ Skills are reusable knowledge packages that agents can load on-demand. They contain domain expertise, workflows, and patterns that help agents perform specialized tasks.
176
+
177
+ ### Using Skills
178
+
179
+ ```bash
180
+ # List available skills
181
+ swarm tool skills_list
182
+
183
+ # Read a skill's content
184
+ swarm tool skills_read --json '{"name": "debugging"}'
185
+
186
+ # Use a skill (get formatted for context injection)
187
+ swarm tool skills_use --json '{"name": "code-review", "context": "reviewing a PR"}'
188
+ ```
189
+
190
+ In OpenCode, agents can use skills directly:
191
+
192
+ ```
193
+ skills_list() # See what's available
194
+ skills_use(name="debugging") # Load debugging patterns
195
+ skills_use(name="swarm-coordination") # Load swarm workflow
196
+ ```
197
+
198
+ ### Bundled Skills
199
+
200
+ | Skill | Tags | Description |
201
+ | ---------------------------- | -------------------- | ------------------------------------------------------------------------------------ |
202
+ | `agent-patterns` | ai, agents, patterns | AI agent design patterns - capability whiteboards, architecture evolution, evals |
203
+ | `cli-builder` | cli, typescript, bun | Building TypeScript CLIs with Bun - argument parsing, subcommands, output formatting |
204
+ | `code-review` | review, quality | Code review patterns - systematic checklists, feedback patterns |
205
+ | `debugging` | debugging, errors | Systematic debugging - root cause analysis, error resolution |
206
+ | `learning-systems` | learning, feedback | Implicit feedback scoring, confidence decay, anti-pattern detection |
207
+ | `mcp-tool-authoring` | mcp, tools | Building MCP tools - schema definition, context passing, error handling |
208
+ | `resilience-patterns` | errors, recovery | Error recovery, retry strategies, graceful degradation |
209
+ | `skill-creator` | meta, skills | Guide for creating effective skills |
210
+ | `swarm-coordination` | swarm, multi-agent | Multi-agent coordination patterns for swarm workflows |
211
+ | `tacit-knowledge-extraction` | knowledge, patterns | Extracting tacit knowledge into pattern languages |
212
+ | `testing-strategies` | testing, vitest | Testing async/swarm operations, mocking patterns |
213
+ | `zod-validation` | zod, typescript | Schema validation patterns with Zod |
214
+
215
+ ### Skill Locations
216
+
217
+ Skills are loaded from three locations (in order):
218
+
219
+ 1. **Project skills**: `.opencode/skills/`, `.claude/skills/`, or `skills/`
220
+ 2. **Global skills**: `~/.config/opencode/skills/`
221
+ 3. **Bundled skills**: Included with the plugin
222
+
223
+ ### Creating Skills
224
+
225
+ ```bash
226
+ # Initialize project skills directory
227
+ swarm tool skills_init
228
+
229
+ # Create a new skill
230
+ swarm tool skills_create --json '{"name": "my-skill", "description": "What it does", "tags": ["tag1", "tag2"]}'
231
+ ```
232
+
233
+ Or use the `skill-creator` skill for guidance:
234
+
235
+ ```
236
+ skills_use(name="skill-creator")
237
+ ```
238
+
239
+ Each skill is a directory containing:
240
+
241
+ ```
242
+ my-skill/
243
+ SKILL.md # Main content (required)
244
+ references/ # Optional supporting files
245
+ patterns.md
246
+ examples.md
247
+ ```
248
+
249
+ ### SKILL.md Format
250
+
251
+ ```markdown
252
+ ---
253
+ name: my-skill
254
+ description: Brief description for discovery
255
+ tags:
256
+ - tag1
257
+ - tag2
258
+ ---
259
+
260
+ # My Skill
261
+
262
+ ## When to Use
263
+
264
+ - Trigger condition 1
265
+ - Trigger condition 2
266
+
267
+ ## Patterns
268
+
269
+ ### Pattern Name
270
+
271
+ Description and examples...
272
+
273
+ ## Anti-Patterns
274
+
275
+ What NOT to do...
276
+ ```
277
+
173
278
  ## Dependencies
174
279
 
175
280
  | Dependency | Purpose | Required |
package/bin/swarm.ts CHANGED
@@ -1072,6 +1072,79 @@ async function setup() {
1072
1072
  }
1073
1073
  }
1074
1074
 
1075
+ // Offer to update AGENTS.md with skill awareness
1076
+ const agentsPath = join(configDir, "AGENTS.md");
1077
+ if (existsSync(agentsPath)) {
1078
+ const updateAgents = await p.confirm({
1079
+ message: "Update AGENTS.md with skill awareness?",
1080
+ initialValue: true,
1081
+ });
1082
+
1083
+ if (!p.isCancel(updateAgents) && updateAgents) {
1084
+ const s = p.spinner();
1085
+ s.start("Updating AGENTS.md...");
1086
+
1087
+ const agentsPrompt = `You are updating the user's AGENTS.md file to add skill awareness.
1088
+
1089
+ ## Task
1090
+ Read ${agentsPath} and add a Skills section if one doesn't exist. If a skills section exists, update it.
1091
+
1092
+ ## What to Add
1093
+
1094
+ 1. **Tool Preferences** - If there's a tool_preferences or similar section, add skills tools:
1095
+ - skills_list - discover available skills
1096
+ - skills_use - load skill for context injection
1097
+ - skills_read - read full skill content
1098
+
1099
+ 2. **Skills Section** - Add this (adapt style to match the file):
1100
+
1101
+ ### Skills (Knowledge Injection)
1102
+
1103
+ Skills are reusable knowledge packages. Load them on-demand for specialized tasks.
1104
+
1105
+ **When to Use:**
1106
+ - Before unfamiliar work - check if a skill exists
1107
+ - When you need domain-specific patterns
1108
+ - For complex workflows that benefit from guidance
1109
+
1110
+ **Usage:**
1111
+ \`\`\`
1112
+ skills_list() # See available skills
1113
+ skills_use(name="debugging") # Load a skill
1114
+ skills_use(name="code-review", context="reviewing auth") # With context
1115
+ \`\`\`
1116
+
1117
+ **Bundled Skills:** agent-patterns, cli-builder, code-review, debugging, learning-systems, mcp-tool-authoring, resilience-patterns, skill-creator, swarm-coordination, tacit-knowledge-extraction, testing-strategies, zod-validation
1118
+
1119
+ ## Rules
1120
+ - Preserve existing content and style
1121
+ - Don't duplicate - update if skills section exists
1122
+ - Keep tone consistent
1123
+ - Place near tool preferences or as logical new section
1124
+
1125
+ Edit the file now.`;
1126
+
1127
+ try {
1128
+ const result = Bun.spawnSync(["opencode", "run", agentsPrompt], {
1129
+ stdout: "pipe",
1130
+ stderr: "pipe",
1131
+ timeout: 120000,
1132
+ });
1133
+
1134
+ if (result.exitCode === 0) {
1135
+ s.stop("AGENTS.md updated");
1136
+ p.log.success("Added skill awareness to AGENTS.md");
1137
+ } else {
1138
+ s.stop("Could not update AGENTS.md");
1139
+ p.log.warn("You can manually add skills section later");
1140
+ }
1141
+ } catch {
1142
+ s.stop("Could not update AGENTS.md");
1143
+ p.log.warn("You can manually add skills section later");
1144
+ }
1145
+ }
1146
+ }
1147
+
1075
1148
  p.note(
1076
1149
  'cd your-project\nbd init\nopencode\n/swarm "your task"\n\nSkills: Use skills_list to see available skills',
1077
1150
  "Next steps",
@@ -1351,6 +1424,7 @@ ${cyan("Commands:")}
1351
1424
  swarm doctor Health check - shows status of all dependencies
1352
1425
  swarm init Initialize beads in current project
1353
1426
  swarm config Show paths to generated config files
1427
+ swarm agents Update AGENTS.md with skill awareness
1354
1428
  swarm update Update to latest version
1355
1429
  swarm version Show version and banner
1356
1430
  swarm tool Execute a tool (for plugin wrapper)
@@ -1525,6 +1599,131 @@ async function listTools() {
1525
1599
  );
1526
1600
  }
1527
1601
 
1602
+ // ============================================================================
1603
+ // Agents Command - Update AGENTS.md with skill awareness
1604
+ // ============================================================================
1605
+
1606
+ async function agents() {
1607
+ const home = process.env.HOME || process.env.USERPROFILE || "~";
1608
+ const agentsPath = join(home, ".config", "opencode", "AGENTS.md");
1609
+
1610
+ p.intro(yellow(BANNER));
1611
+
1612
+ // Check if AGENTS.md exists
1613
+ if (!existsSync(agentsPath)) {
1614
+ p.log.warn("No AGENTS.md found at " + agentsPath);
1615
+ p.log.message(
1616
+ dim("Create one first, then run this command to add skill awareness"),
1617
+ );
1618
+ p.outro("Aborted");
1619
+ return;
1620
+ }
1621
+
1622
+ // Check if opencode is available
1623
+ const opencode = await checkCommand("opencode", ["--version"]);
1624
+ if (!opencode.available) {
1625
+ p.log.error("OpenCode not found");
1626
+ p.log.message(dim("Install: npm install -g opencode"));
1627
+ p.outro("Aborted");
1628
+ return;
1629
+ }
1630
+
1631
+ const confirm = await p.confirm({
1632
+ message: "Update AGENTS.md with skill awareness?",
1633
+ initialValue: true,
1634
+ });
1635
+
1636
+ if (p.isCancel(confirm) || !confirm) {
1637
+ p.outro("Aborted");
1638
+ return;
1639
+ }
1640
+
1641
+ const s = p.spinner();
1642
+ s.start("Updating AGENTS.md with skill awareness...");
1643
+
1644
+ const prompt = `You are updating the user's AGENTS.md file to add skill awareness.
1645
+
1646
+ ## Task
1647
+ Read ~/.config/opencode/AGENTS.md and add a Skills section if one doesn't exist.
1648
+
1649
+ ## What to Add
1650
+ Add a section about using skills. Include:
1651
+
1652
+ 1. **Tool Preferences Update** - Add skills_* tools to the tool priority list:
1653
+ - skills_list - discover available skills
1654
+ - skills_use - load skill for context injection
1655
+ - skills_read - read full skill content
1656
+
1657
+ 2. **Skills Section** - Add this section (adapt to match the file's style):
1658
+
1659
+ ### Skills (Knowledge Injection)
1660
+
1661
+ Skills are reusable knowledge packages. Load them on-demand for specialized tasks.
1662
+
1663
+ **When to Use Skills:**
1664
+ - Before starting unfamiliar work - check if a skill exists
1665
+ - When you need domain-specific patterns
1666
+ - For complex workflows that benefit from guidance
1667
+
1668
+ **Available Skills** (run \`skills_list()\` to see current list):
1669
+ - agent-patterns: AI agent design patterns
1670
+ - cli-builder: TypeScript CLI patterns
1671
+ - code-review: Review checklists
1672
+ - debugging: Root cause analysis
1673
+ - learning-systems: Feedback scoring, pattern maturity
1674
+ - mcp-tool-authoring: Building MCP tools
1675
+ - resilience-patterns: Error recovery, retries
1676
+ - skill-creator: Creating new skills
1677
+ - swarm-coordination: Multi-agent workflows
1678
+ - tacit-knowledge-extraction: Pattern mining
1679
+ - testing-strategies: Vitest patterns
1680
+ - zod-validation: Schema validation
1681
+
1682
+ **Usage Pattern:**
1683
+ \`\`\`
1684
+ # Check what's available
1685
+ skills_list()
1686
+
1687
+ # Load a skill before starting work
1688
+ skills_use(name="debugging")
1689
+
1690
+ # Load with context
1691
+ skills_use(name="code-review", context="reviewing auth changes")
1692
+ \`\`\`
1693
+
1694
+ ## Rules
1695
+ - Preserve the existing content and style
1696
+ - Add the skills section in a logical place (near tool preferences or as a new section)
1697
+ - Don't duplicate if a skills section already exists - update it instead
1698
+ - Keep the tone consistent with the rest of the file
1699
+
1700
+ Edit the file now.`;
1701
+
1702
+ try {
1703
+ const result = Bun.spawnSync(["opencode", "run", prompt], {
1704
+ stdio: ["inherit", "pipe", "pipe"],
1705
+ timeout: 120000, // 2 minute timeout
1706
+ });
1707
+
1708
+ if (result.exitCode === 0) {
1709
+ s.stop("AGENTS.md updated with skill awareness");
1710
+ p.log.success("Skills section added to " + agentsPath);
1711
+ p.log.message(
1712
+ dim("Skills available: skills_list, skills_use, skills_read"),
1713
+ );
1714
+ } else {
1715
+ const stderr = result.stderr?.toString() || "";
1716
+ s.stop("Failed to update AGENTS.md");
1717
+ p.log.error(stderr || "Unknown error");
1718
+ }
1719
+ } catch (error) {
1720
+ s.stop("Failed to update AGENTS.md");
1721
+ p.log.error(String(error));
1722
+ }
1723
+
1724
+ p.outro("Done");
1725
+ }
1726
+
1528
1727
  // ============================================================================
1529
1728
  // Main
1530
1729
  // ============================================================================
@@ -1560,6 +1759,9 @@ switch (command) {
1560
1759
  }
1561
1760
  break;
1562
1761
  }
1762
+ case "agents":
1763
+ await agents();
1764
+ break;
1563
1765
  case "version":
1564
1766
  case "--version":
1565
1767
  case "-v":