@ikunin/sprintpilot 2.0.7 → 2.0.9

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.
@@ -368,7 +368,7 @@ async function stripLegacyMarkers(projectRoot) {
368
368
  // Evict v1 skill dirs from tool skill dirs INSIDE projectRoot only. We
369
369
  // deliberately do NOT touch user-global ~/.claude/skills/ — a project-level
370
370
  // install must not reach across projects on the same machine.
371
- async function evictV1SkillsFromToolDirs(projectRoot) {
371
+ async function evictV1SkillsFromToolDirs(projectRoot, { dryRun = false } = {}) {
372
372
  const removed = [];
373
373
  const toolSkillDirs = [];
374
374
  for (const tool of ALL_TOOLS) {
@@ -382,7 +382,7 @@ async function evictV1SkillsFromToolDirs(projectRoot) {
382
382
  for (const v1Name of V1_SKILL_NAMES) {
383
383
  const target = path.join(dir, v1Name);
384
384
  if (await fs.pathExists(target)) {
385
- await fs.remove(target);
385
+ if (!dryRun) await fs.remove(target);
386
386
  removed.push(path.relative(projectRoot, target));
387
387
  }
388
388
  }
@@ -1001,6 +1001,22 @@ async function runInstall(options = {}) {
1001
1001
  throw err;
1002
1002
  }
1003
1003
 
1004
+ // 1b. Sweep orphaned v1-named skill dirs from tool dirs unconditionally.
1005
+ // evictV1Installation only fires when _bmad-addons/ is present, so a
1006
+ // user who upgraded long ago (and removed _bmad-addons/) never gets
1007
+ // stale .claude/skills/bmad-ma-* cleaned up — they linger as live
1008
+ // duplicates of the new sprintpilot-* skills. Idempotent, no-op when
1009
+ // nothing matches.
1010
+ const orphanedV1Skills = await evictV1SkillsFromToolDirs(projectRoot, { dryRun });
1011
+ if (orphanedV1Skills.length > 0) {
1012
+ console.log('');
1013
+ console.log(pc.yellow('Orphaned v1 skill directories found:'));
1014
+ for (const e of orphanedV1Skills) {
1015
+ console.log(` ${dryRun ? 'Would remove' : 'Removed'} legacy skill: ${e}`);
1016
+ }
1017
+ console.log('');
1018
+ }
1019
+
1004
1020
  // 2. Resolve output_folder
1005
1021
  const outputFolder = await readOutputFolder(projectRoot);
1006
1022
  if (outputFolder !== '_bmad-output') {
@@ -35,14 +35,19 @@ async function verifyBmadInstalled(projectRoot) {
35
35
  return data || {};
36
36
  }
37
37
 
38
- // BMad Method has used two manifest shapes:
39
- // - flat: { version: "6.3.0" }
40
- // - nested: { bmad: { version: "6.2.0" } }
41
- // The shipping v6 installer writes the nested form; some older installs
42
- // and our own unit-test fixture use the flat form. Try nested first,
43
- // then fall back to flat so either layout resolves to a real version.
38
+ // BMad Method has used three manifest shapes:
39
+ // - installation-scoped: { installation: { version: "6.2.2" }, modules: [...] }
40
+ // (the actual v6.2.x installer writes this — installation.version is
41
+ // the canonical source; modules[].version is per-module and not the
42
+ // overall BMad version)
43
+ // - nested: { bmad: { version: "6.2.0" } }
44
+ // - flat: { version: "6.3.0" }
45
+ // Try installation-scoped first (matches what users actually have on
46
+ // disk today), then nested, then flat. Older installs and our unit-test
47
+ // fixture use the flat form.
44
48
  function extractBmadVersion(data) {
45
49
  if (!data) return null;
50
+ if (data.installation && data.installation.version) return data.installation.version;
46
51
  if (data.bmad && data.bmad.version) return data.bmad.version;
47
52
  if (data.version) return data.version;
48
53
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikunin/sprintpilot",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "Sprintpilot — autopilot and multi-agent addon for BMad Method v6: git workflow, parallel agents, autonomous story execution",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {