opencode-swarm-plugin 0.45.5 → 0.45.7

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.
package/bin/swarm.ts CHANGED
@@ -20,6 +20,7 @@ import {
20
20
  mkdirSync,
21
21
  readFileSync,
22
22
  readdirSync,
23
+ renameSync,
23
24
  rmSync,
24
25
  statSync,
25
26
  writeFileSync,
@@ -1512,7 +1513,8 @@ async function doctor() {
1512
1513
  }
1513
1514
 
1514
1515
  // Project skills (check current directory)
1515
- const projectSkillsDirs = [".opencode/skills", ".claude/skills", "skills"];
1516
+ // OpenCode uses singular "skill", Claude uses plural "skills"
1517
+ const projectSkillsDirs = [".opencode/skill", ".claude/skills", "skill"];
1516
1518
  for (const dir of projectSkillsDirs) {
1517
1519
  if (existsSync(dir)) {
1518
1520
  try {
@@ -2107,9 +2109,21 @@ async function setup(forceReinstall = false, nonInteractive = false) {
2107
2109
  // Track file operation statistics
2108
2110
  const stats: FileStats = { created: 0, updated: 0, unchanged: 0 };
2109
2111
 
2112
+ // Migrate legacy "skills" → "skill" for OpenCode compatibility
2113
+ const legacySkillsDir = join(configDir, "skills");
2114
+ const skillsDir = join(configDir, "skill");
2115
+ if (existsSync(legacySkillsDir) && !existsSync(skillsDir)) {
2116
+ p.log.step("Migrating skills directory...");
2117
+ try {
2118
+ renameSync(legacySkillsDir, skillsDir);
2119
+ p.log.message(dim(` Renamed: ${legacySkillsDir} → ${skillsDir}`));
2120
+ } catch (err) {
2121
+ p.log.warn(`Could not migrate skills directory: ${err}`);
2122
+ }
2123
+ }
2124
+
2110
2125
  // Create directories if needed
2111
2126
  p.log.step("Creating configuration directories...");
2112
- const skillsDir = join(configDir, "skills");
2113
2127
  for (const dir of [pluginDir, commandDir, agentDir, swarmAgentDir, skillsDir]) {
2114
2128
  mkdirWithStatus(dir);
2115
2129
  }
@@ -2145,7 +2159,7 @@ async function setup(forceReinstall = false, nonInteractive = false) {
2145
2159
  }
2146
2160
  }
2147
2161
 
2148
- // If the user keeps their skills in ~/.config/opencode/skills, offer to sync the bundled set
2162
+ // If the user keeps their skills in ~/.config/opencode/skill, offer to sync the bundled set
2149
2163
  if (bundledSkills.length > 0) {
2150
2164
  const globalSkills = listDirectoryNames(skillsDir);
2151
2165
  const managedBundled = globalSkills.filter((name) =>
@@ -2361,12 +2375,12 @@ async function init() {
2361
2375
 
2362
2376
  // Offer to create project skills directory
2363
2377
  const createSkillsDir = await p.confirm({
2364
- message: "Create project skills directory (.opencode/skills/)?",
2378
+ message: "Create project skills directory (.opencode/skill/)?",
2365
2379
  initialValue: false,
2366
2380
  });
2367
2381
 
2368
2382
  if (!p.isCancel(createSkillsDir) && createSkillsDir) {
2369
- const skillsPath = ".opencode/skills";
2383
+ const skillsPath = ".opencode/skill";
2370
2384
  if (!existsSync(skillsPath)) {
2371
2385
  mkdirSync(skillsPath, { recursive: true });
2372
2386
  p.log.success("Created " + skillsPath + "/");
@@ -2470,9 +2484,9 @@ function config() {
2470
2484
 
2471
2485
  // Project skills locations
2472
2486
  console.log(` 📁 Project skills locations ${dim("(checked in order)")}`);
2473
- console.log(` ${dim(".opencode/skills/")}`);
2474
- console.log(` ${dim(".claude/skills/")}`);
2475
- console.log(` ${dim("skills/")}`);
2487
+ console.log(` ${dim(".opencode/skill/")}`);
2488
+ console.log(` ${dim(".claude/skills/")}`); // Claude uses plural
2489
+ console.log(` ${dim("skill/")}`);
2476
2490
  console.log();
2477
2491
 
2478
2492
  // Bundled skills info