bigpowers 2.87.2 → 2.87.4

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/.pi/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigpowers",
3
- "version": "2.87.2",
3
+ "version": "2.87.4",
4
4
  "description": "81 skills — 73 agent skills synthesizing 17 years of software engineering discipline into a prescriptive methodology for solo developers",
5
5
  "keywords": [
6
6
  "pi-package"
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [2.87.4](https://github.com/danielvm-git/bigpowers/compare/v2.87.3...v2.87.4) (2026-08-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **install:** uninstall menu now removes symlinks for all 18 tools and local installs ([#110](https://github.com/danielvm-git/bigpowers/issues/110)) ([5e8ae1c](https://github.com/danielvm-git/bigpowers/commit/5e8ae1ccd6a127502edde2b0dfb93a28609e82a3))
7
+
8
+ ## [2.87.3](https://github.com/danielvm-git/bigpowers/compare/v2.87.2...v2.87.3) (2026-08-07)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **skills:** pi no longer drops 16 skills — story tags moved inside frontmatter ([#108](https://github.com/danielvm-git/bigpowers/issues/108)) ([3d4f0cf](https://github.com/danielvm-git/bigpowers/commit/3d4f0cf33a0497a45bc525330fc048a5b2715e33))
14
+
1
15
  ## [2.87.2](https://github.com/danielvm-git/bigpowers/compare/v2.87.1...v2.87.2) (2026-08-05)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigpowers",
3
- "version": "2.87.2",
3
+ "version": "2.87.4",
4
4
  "description": "73 agent skills synthesizing 17 years of software engineering discipline into a prescriptive methodology for solo developers",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -404,23 +404,23 @@ function installLocal(tool, repoRoot) {
404
404
 
405
405
  function uninstallTool(toolId, repoRoot) {
406
406
  const homeDir = require('os').homedir();
407
+ // installLocal() resolves its own targets from process.cwd() at call time
408
+ // (bin/setup.js never passes a mode/cwd into uninstallTool), so the
409
+ // interactive Uninstall menu — which offers no global/local choice — must
410
+ // clean whichever scope was actually installed into. Previously this
411
+ // function only ever touched homeDir: a local install (`bigpowers install`
412
+ // → Local) was reported as "removed" but every local symlink survived.
413
+ const cwd = process.cwd();
407
414
 
408
415
  switch (toolId) {
409
416
  case 'claude': {
410
- const skillsDir = path.join(homeDir, '.claude', 'skills');
411
- if (fs.existsSync(skillsDir)) {
412
- for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
413
- if (!entry.isSymbolicLink()) continue;
414
- const target = fs.readlinkSync(path.join(skillsDir, entry.name));
415
- if (target.startsWith(repoRoot)) {
416
- removeSymlink(path.join(skillsDir, entry.name));
417
- }
418
- }
419
- }
417
+ removeRepoRootedSkillLinks(path.join(homeDir, '.claude', 'skills'), repoRoot);
420
418
  const hooksDir = path.join(homeDir, '.claude', 'hooks');
421
419
  removeSymlink(path.join(hooksDir, 'block-dangerous-git.sh'));
422
420
  removeSymlink(path.join(hooksDir, 'rtk-rewrite.sh'));
423
421
  removeSymlink(path.join(hooksDir, 'lib'));
422
+ // installLocal('claude') only links skills/ (no hooks) into cwd/.claude/skills
423
+ removeRepoRootedSkillLinks(path.join(cwd, '.claude', 'skills'), repoRoot);
424
424
  break;
425
425
  }
426
426
  case 'gemini':
@@ -434,18 +434,12 @@ function uninstallTool(toolId, repoRoot) {
434
434
  ]) {
435
435
  removeSymlink(path.join(homeDir, '.gemini', 'hooks', hookFile));
436
436
  }
437
+ // installLocal('gemini') links repoRoot/.gemini/extensions/bigpowers into cwd
438
+ removeSymlink(path.join(cwd, '.gemini', 'extensions', 'bigpowers'));
437
439
  break;
438
440
  case 'pi': {
439
- const skillsDir = path.join(homeDir, '.pi', 'agent', 'skills');
440
- if (fs.existsSync(skillsDir)) {
441
- for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
442
- if (!entry.isSymbolicLink()) continue;
443
- const target = fs.readlinkSync(path.join(skillsDir, entry.name));
444
- if (target.startsWith(repoRoot)) {
445
- removeSymlink(path.join(skillsDir, entry.name));
446
- }
447
- }
448
- }
441
+ removeRepoRootedSkillLinks(path.join(homeDir, '.pi', 'agent', 'skills'), repoRoot);
442
+ removeRepoRootedSkillLinks(path.join(cwd, '.pi', 'agent', 'skills'), repoRoot);
449
443
  break;
450
444
  }
451
445
  case 'hermes': {
@@ -460,6 +454,17 @@ function uninstallTool(toolId, repoRoot) {
460
454
  }
461
455
  }
462
456
  removeSymlink(path.join(homeDir, '.hermes', 'hooks', 'session-log'));
457
+ // installLocal('hermes') renders skills into cwd/.hermes/skills (no hook locally)
458
+ const localSkillsDir = path.join(cwd, '.hermes', 'skills');
459
+ if (fs.existsSync(localSkillsDir)) {
460
+ for (const entry of fs.readdirSync(localSkillsDir, { withFileTypes: true })) {
461
+ if (!entry.isSymbolicLink()) continue;
462
+ const target = fs.readlinkSync(path.join(localSkillsDir, entry.name));
463
+ if (target.startsWith(repoRoot) || target.includes('.hermes/skills')) {
464
+ removeSymlink(path.join(localSkillsDir, entry.name));
465
+ }
466
+ }
467
+ }
463
468
  break;
464
469
  }
465
470
  case 'zcode': {
@@ -474,6 +479,8 @@ function uninstallTool(toolId, repoRoot) {
474
479
  }
475
480
  }
476
481
  removeSymlink(path.join(homeDir, '.zcode', 'AGENTS.md'));
482
+ removeManagedSkillLinks(path.join(cwd, '.zcode', 'skills'), repoRoot);
483
+ removeSymlink(path.join(cwd, '.zcode', 'AGENTS.md'));
477
484
  break;
478
485
  }
479
486
  case 'mimo': {
@@ -488,6 +495,8 @@ function uninstallTool(toolId, repoRoot) {
488
495
  }
489
496
  }
490
497
  removeSymlink(path.join(homeDir, '.mimocode', 'AGENTS.md'));
498
+ removeManagedSkillLinks(path.join(cwd, '.mimocode', 'skills'), repoRoot);
499
+ removeSymlink(path.join(cwd, '.mimocode', 'AGENTS.md'));
491
500
  break;
492
501
  }
493
502
  case 'antigravity':
@@ -502,10 +511,20 @@ function uninstallTool(toolId, repoRoot) {
502
511
  }
503
512
  }
504
513
  }
514
+ // installLocal('antigravity') renders into cwd/.agents/skills and — only
515
+ // if absent — symlinks cwd/AGENTS.md. Skip the local skills dir entirely
516
+ // when cwd === repoRoot: that's this repo's own tracked .agents/skills
517
+ // source tree (the installer's rendered-skill INPUT), not an install
518
+ // target, and must never be touched by uninstall.
519
+ if (cwd !== repoRoot) {
520
+ removeManagedSkillLinks(path.join(cwd, '.agents', 'skills'), repoRoot);
521
+ }
522
+ removeSymlink(path.join(cwd, 'AGENTS.md'));
505
523
  break;
506
524
  }
507
525
  case 'cursor':
508
526
  removeSymlink(path.join(homeDir, '.cursor', 'rules'));
527
+ removeSymlink(path.join(cwd, '.cursor', 'rules'));
509
528
  break;
510
529
  case 'codex':
511
530
  {
@@ -518,7 +537,60 @@ function uninstallTool(toolId, repoRoot) {
518
537
  }
519
538
  }
520
539
  removeSymlink(path.join(homeDir, '.codex', 'hooks', 'pre-tool-git-guard.sh'));
540
+ removeSymlink(path.join(homeDir, '.codex', 'AGENTS.md'));
541
+ // installLocal('codex') only symlinks cwd/.codex/AGENTS.md (no skills/hooks locally)
542
+ removeSymlink(path.join(cwd, '.codex', 'AGENTS.md'));
521
543
  break; // story: e65s02
544
+ case 'qwen':
545
+ removeManagedSkillLinks(path.join(homeDir, '.qwen', 'skills'), repoRoot);
546
+ removeSymlink(path.join(homeDir, '.qwen', 'QWEN.md'));
547
+ removeSymlink(path.join(homeDir, '.qwen', 'hooks', 'pre-tool-git-guard.sh'));
548
+ break; // story: e68s02
549
+ case 'codebuddy':
550
+ removeManagedSkillLinks(path.join(homeDir, '.codebuddy', 'skills'), repoRoot);
551
+ removeSymlink(path.join(homeDir, '.codebuddy', 'AGENTS.md'));
552
+ removeSymlink(path.join(homeDir, '.codebuddy', 'hooks', 'pre-tool-git-guard.sh'));
553
+ break; // story: e72s02
554
+ case 'cline':
555
+ removeManagedSkillLinks(path.join(homeDir, '.cline', 'skills'), repoRoot);
556
+ break; // story: e66s02
557
+ case 'kilo':
558
+ case 'kilocode': {
559
+ const rulesDir = path.join(homeDir, '.kilocode', 'rules');
560
+ if (fs.existsSync(rulesDir)) {
561
+ for (const f of fs.readdirSync(rulesDir)) {
562
+ if (!f.endsWith('.md')) continue;
563
+ removeSymlink(path.join(rulesDir, f));
564
+ }
565
+ }
566
+ removeManagedFile(path.join(homeDir, '.kilocode', 'AGENTS.md'));
567
+ break; // story: e67s02
568
+ }
569
+ case 'trae':
570
+ removeManagedSkillLinks(path.join(homeDir, '.trae', 'skills'), repoRoot);
571
+ removeSymlink(path.join(homeDir, '.trae', 'AGENTS.md'));
572
+ removeSymlink(path.join(homeDir, '.trae', 'hooks', 'pre-tool-git-guard.sh'));
573
+ break; // story: e70s02
574
+ case 'windsurf': {
575
+ const rulesDir = path.join(homeDir, '.codeium', 'windsurf', 'rules');
576
+ if (fs.existsSync(rulesDir)) {
577
+ for (const f of fs.readdirSync(rulesDir)) {
578
+ if (!f.endsWith('.md')) continue;
579
+ removeSymlink(path.join(rulesDir, f));
580
+ }
581
+ }
582
+ removeManagedFile(path.join(homeDir, '.codeium', 'windsurf', 'AGENTS.md'));
583
+ removeSymlink(path.join(homeDir, '.codeium', 'windsurf', 'hooks', 'pre-tool-git-guard.sh'));
584
+ break; // story: e73s02
585
+ }
586
+ case 'opencode':
587
+ removeManagedSkillLinks(path.join(homeDir, '.config', 'opencode', 'skills'), repoRoot);
588
+ removeSymlink(path.join(homeDir, '.config', 'opencode', 'AGENTS.md'));
589
+ break; // story: e62s02
590
+ case 'copilot':
591
+ removeManagedSkillLinks(path.join(homeDir, '.copilot', 'skills'), repoRoot);
592
+ removeManagedFile(path.join(homeDir, '.copilot', 'AGENTS.md'));
593
+ break; // story: e71s02
522
594
  }
523
595
  }
524
596
 
@@ -533,6 +605,61 @@ function removeSymlink(p) {
533
605
  return false;
534
606
  }
535
607
 
608
+ // Strict variant of removeManagedSkillLinks: only removes symlinks whose
609
+ // target starts with THIS repoRoot exactly (no 'bigpowers' substring match).
610
+ // Used for claude/pi, where a looser match could delete symlinks pointing at
611
+ // an unrelated bigpowers checkout elsewhere on disk (e.g. a second clone).
612
+ function removeRepoRootedSkillLinks(skillsDir, repoRoot) {
613
+ if (!fs.existsSync(skillsDir)) return;
614
+ for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
615
+ if (!entry.isSymbolicLink()) continue;
616
+ const linkPath = path.join(skillsDir, entry.name);
617
+ let target;
618
+ try {
619
+ target = fs.readlinkSync(linkPath);
620
+ } catch {
621
+ continue;
622
+ }
623
+ if (target.startsWith(repoRoot)) {
624
+ removeSymlink(linkPath);
625
+ }
626
+ }
627
+ }
628
+
629
+ // Remove bigpowers-managed skill symlinks from a tool's skills dir. Only touches
630
+ // symlinks that resolve back into the repo (installGlobal creates them via
631
+ // linkRenderedSkills → linkDir), leaving any user-authored entries alone.
632
+ function removeManagedSkillLinks(skillsDir, repoRoot) {
633
+ if (!fs.existsSync(skillsDir)) return;
634
+ for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
635
+ if (!entry.isSymbolicLink()) continue;
636
+ const linkPath = path.join(skillsDir, entry.name);
637
+ let target;
638
+ try {
639
+ target = fs.readlinkSync(linkPath);
640
+ } catch {
641
+ continue;
642
+ }
643
+ if (target.startsWith(repoRoot) || target.includes('bigpowers')) {
644
+ removeSymlink(linkPath);
645
+ }
646
+ }
647
+ }
648
+
649
+ // Remove a file the installer placed as a plain copy (kilo/windsurf/copilot use
650
+ // fs.copyFileSync for AGENTS.md, so removeSymlink would skip it). Also handles
651
+ // the symlink case so it's safe on either install shape.
652
+ function removeManagedFile(p) {
653
+ try {
654
+ const stat = fs.lstatSync(p);
655
+ if (stat.isSymbolicLink() || stat.isFile()) {
656
+ fs.unlinkSync(p);
657
+ return true;
658
+ }
659
+ } catch {}
660
+ return false;
661
+ }
662
+
536
663
  function detectExistingInstall() {
537
664
  const homeDir = require('os').homedir();
538
665
  const marker = path.join(homeDir, '.claude', 'skills', 'survey-context');
@@ -48,6 +48,9 @@ parse_frontmatter() {
48
48
  fi
49
49
  [ "$in_block" -ne 1 ] && continue
50
50
 
51
+ # Skip comment lines (e.g. # story: tags inside the frontmatter block)
52
+ [[ "$line" == \#* || "$line" == \<\!--* ]] && continue
53
+
51
54
  case "$line" in
52
55
  name:*)
53
56
  name="${line#name: }"
@@ -76,6 +79,8 @@ parse_frontmatter() {
76
79
  continue
77
80
  fi
78
81
  [ "$continued" -eq 0 ] && continue
82
+ # Skip comment lines (e.g. # story: tags inside the frontmatter block)
83
+ [[ "$line" == \#* || "$line" == \<\!--* ]] && continue
79
84
  # If next field starts (unindented key:), stop
80
85
  [[ "$line" =~ ^[a-zA-Z_]+: ]] && break
81
86
  desc="$desc $line"
@@ -103,7 +108,7 @@ parse_frontmatter_okf() {
103
108
  _PF_NAME=$(awk '/^---/{f++} f==1 && /^name:/{print; exit}' "$file" | sed 's/^name:[[:space:]]*//')
104
109
  _PF_MODEL=$(awk '/^---/{f++} f==1 && /^model:/{print; exit}' "$file" | sed 's/^model:[[:space:]]*//')
105
110
  _PF_EFFORT=$(awk '/^---/{f++} f==1 && /^effort:/{print; exit}' "$file" | sed 's/^effort:[[:space:]]*//')
106
- _PF_DESCRIPTION=$(awk '/^---/{f++; next} f==1 && /^description:/{p=1; sub(/^description:[[:space:]]*/,""); print; next} f==1 && p && /^[a-z]+:/{exit} f==1 && p{print}' "$file" \
111
+ _PF_DESCRIPTION=$(awk '/^---/{f++; next} f==1 && /^description:/{p=1; sub(/^description:[[:space:]]*/,""); print; next} f==1 && p && /^[a-z]+:/{exit} f==1 && p && !/^[[:space:]]*#/ && !/^[[:space:]]*<!--/{print}' "$file" \
107
112
  | tr -d '\n' \
108
113
  | sed -E 's/[[:space:]]+/ /g')
109
114
 
@@ -87,6 +87,116 @@ try {
87
87
  uninstallTool('cursor', ROOT);
88
88
  assert.ok(!fs.existsSync(rulesDst), 'uninstallTool(cursor) must remove rules symlink');
89
89
 
90
+ // Regression: every tool the uninstall menu offers must have a real uninstall
91
+ // path. Before this, qwen/codebuddy/cline/kilo/trae/windsurf/opencode/copilot
92
+ // had install cases but no uninstall case — uninstall reported success while
93
+ // leaving every symlink in place.
94
+ installGlobal({ id: 'qwen', name: 'Qwen Code' }, ROOT);
95
+ const qwenSkills = path.join(tmpHome, '.qwen', 'skills');
96
+ const qwenSample = fs.existsSync(qwenSkills)
97
+ && fs.readdirSync(qwenSkills).find((n) => {
98
+ try { return fs.lstatSync(path.join(qwenSkills, n)).isSymbolicLink(); } catch { return false; }
99
+ });
100
+ assert.ok(qwenSample, 'qwen install must create at least one skill symlink');
101
+ uninstallTool('qwen', ROOT);
102
+ assert.ok(
103
+ !fs.existsSync(path.join(qwenSkills, qwenSample)),
104
+ 'uninstallTool(qwen) must remove repo-rooted skill symlinks'
105
+ );
106
+
107
+ // copilot writes AGENTS.md as a plain copy (not a symlink); uninstall must
108
+ // still remove it via removeManagedFile.
109
+ installGlobal({ id: 'copilot', name: 'Copilot' }, ROOT);
110
+ const copilotAgents = path.join(tmpHome, '.copilot', 'AGENTS.md');
111
+ const copilotHadAgents = fs.existsSync(copilotAgents);
112
+ uninstallTool('copilot', ROOT);
113
+ if (copilotHadAgents) {
114
+ assert.ok(!fs.existsSync(copilotAgents), 'uninstallTool(copilot) must remove copied AGENTS.md');
115
+ }
116
+ const copilotSkills = path.join(tmpHome, '.copilot', 'skills');
117
+ if (fs.existsSync(copilotSkills)) {
118
+ const leftover = fs.readdirSync(copilotSkills).find((n) => {
119
+ try { return fs.lstatSync(path.join(copilotSkills, n)).isSymbolicLink(); } catch { return false; }
120
+ });
121
+ assert.ok(!leftover, 'uninstallTool(copilot) must remove skill symlinks');
122
+ }
123
+
124
+ // Regression: uninstallTool() only ever touched homeDir. The interactive
125
+ // Uninstall menu (bin/setup.js handleUninstall) never asks global-vs-local
126
+ // and calls uninstallTool(toolId, ROOT) unconditionally — so a *local*
127
+ // install (`bigpowers install` → Local) was reported "removed" while every
128
+ // local symlink survived, for every tool. Verify local install/uninstall
129
+ // round-trips for tools spanning each install shape: skill-symlink dir
130
+ // (pi, claude), single linked dir (cursor, gemini), and a linked file
131
+ // (codex AGENTS.md).
132
+ const { installLocal } = require('../scripts/lib/install-helpers.js');
133
+ const savedCwd = process.cwd();
134
+ const tmpCwd = mkdtempSync(path.join(os.tmpdir(), 'bp-install-helpers-local-'));
135
+ try {
136
+ process.chdir(tmpCwd);
137
+
138
+ installLocal({ id: 'pi', name: 'pi' }, ROOT);
139
+ const localPiSkills = path.join(tmpCwd, '.pi', 'agent', 'skills');
140
+ const localPiSample = fs.readdirSync(localPiSkills).find((n) => {
141
+ try { return fs.lstatSync(path.join(localPiSkills, n)).isSymbolicLink(); } catch { return false; }
142
+ });
143
+ assert.ok(localPiSample, 'local pi install must create at least one skill symlink');
144
+ uninstallTool('pi', ROOT);
145
+ assert.ok(
146
+ !fs.existsSync(path.join(localPiSkills, localPiSample)),
147
+ 'uninstallTool(pi) must also remove LOCAL (cwd) skill symlinks, not just global'
148
+ );
149
+
150
+ installLocal({ id: 'claude', name: 'Claude Code' }, ROOT);
151
+ const localClaudeSkills = path.join(tmpCwd, '.claude', 'skills');
152
+ const localClaudeSample = fs.readdirSync(localClaudeSkills).find((n) => {
153
+ try { return fs.lstatSync(path.join(localClaudeSkills, n)).isSymbolicLink(); } catch { return false; }
154
+ });
155
+ assert.ok(localClaudeSample, 'local claude install must create at least one skill symlink');
156
+ uninstallTool('claude', ROOT);
157
+ assert.ok(
158
+ !fs.existsSync(path.join(localClaudeSkills, localClaudeSample)),
159
+ 'uninstallTool(claude) must also remove LOCAL (cwd) skill symlinks, not just global'
160
+ );
161
+
162
+ installLocal({ id: 'cursor', name: 'Cursor' }, ROOT);
163
+ const localCursorRules = path.join(tmpCwd, '.cursor', 'rules');
164
+ assert.ok(fs.lstatSync(localCursorRules).isSymbolicLink(), 'local cursor install must symlink .cursor/rules');
165
+ uninstallTool('cursor', ROOT);
166
+ assert.ok(!fs.existsSync(localCursorRules), 'uninstallTool(cursor) must remove LOCAL .cursor/rules symlink');
167
+
168
+ installLocal({ id: 'gemini', name: 'Gemini' }, ROOT);
169
+ const localGeminiExt = path.join(tmpCwd, '.gemini', 'extensions', 'bigpowers');
170
+ assert.ok(fs.lstatSync(localGeminiExt).isSymbolicLink(), 'local gemini install must symlink extensions/bigpowers');
171
+ uninstallTool('gemini', ROOT);
172
+ assert.ok(!fs.existsSync(localGeminiExt), 'uninstallTool(gemini) must remove LOCAL extensions/bigpowers symlink');
173
+
174
+ installLocal({ id: 'codex', name: 'Codex' }, ROOT);
175
+ const localCodexAgents = path.join(tmpCwd, '.codex', 'AGENTS.md');
176
+ assert.ok(fs.lstatSync(localCodexAgents).isSymbolicLink(), 'local codex install must symlink AGENTS.md');
177
+ uninstallTool('codex', ROOT);
178
+ assert.ok(!fs.existsSync(localCodexAgents), 'uninstallTool(codex) must remove LOCAL AGENTS.md symlink');
179
+ } finally {
180
+ process.chdir(savedCwd);
181
+ rmSync(tmpCwd, { recursive: true, force: true });
182
+ }
183
+
184
+ // Guard against future drift: assert the menu's supported set matches the
185
+ // uninstall switch. Any id in SUPPORTED_IDS with no uninstall case regresses
186
+ // this bug (silent no-op reported as success).
187
+ const helpersSrc = fs.readFileSync(path.join(ROOT, 'scripts', 'lib', 'install-helpers.js'), 'utf8');
188
+ const uninstallBody = helpersSrc.slice(helpersSrc.indexOf('function uninstallTool'));
189
+ const setupText = fs.readFileSync(path.join(ROOT, 'bin/setup.js'), 'utf8');
190
+ const supportedLine = setupText.match(/const SUPPORTED_IDS = new Set\(\[([^\]]*)\]\)/);
191
+ assert.ok(supportedLine, 'SUPPORTED_IDS must be declarable from bin/setup.js');
192
+ const supportedIds = supportedLine[1].match(/'([^']+)'/g).map((s) => s.replace(/'/g, ''));
193
+ for (const id of supportedIds) {
194
+ assert.ok(
195
+ new RegExp(`case '${id}':`).test(uninstallBody),
196
+ `uninstallTool must handle '${id}' (listed in SUPPORTED_IDS) — else uninstall silently no-ops`
197
+ );
198
+ }
199
+
90
200
  const installPaths = [
91
201
  path.join(ROOT, 'scripts', 'install.sh'),
92
202
  ...fs.readdirSync(path.join(ROOT, 'scripts', 'lib'))
@@ -1,5 +1,21 @@
1
1
  #!/usr/bin/env python3
2
- """Validate YAML frontmatter in all .pi/skills/*/SKILL.md files."""
2
+ """Validate YAML frontmatter in SKILL.md files (sources + generated .pi/skills).
3
+
4
+ Rules per file (sources and generated copies alike):
5
+
6
+ R1 file must start with the frontmatter delimiter '---' at byte 0.
7
+ pi (dist/utils/frontmatter.js) and the Agent Skills spec require the
8
+ opening delimiter to be the first characters of the file. Story tags
9
+ (`# story:` / `<!-- story: -->`) must live INSIDE the frontmatter block
10
+ as YAML comments, or below the closing delimiter — never above it,
11
+ or pi drops the skill as "description is required".
12
+ (story: BUG-2026-08-06-pi-drops-skills-frontmatter)
13
+ R2 frontmatter must parse as YAML (PyYAML or bundled simple_yaml).
14
+ R3 description must not embed 'model: sonnet' as literal text.
15
+
16
+ Exits 1 on any failure. Called by the sync-skills.sh post-generation guard
17
+ and by scripts/test-setup-no-pyyaml.sh.
18
+ """
3
19
  import glob
4
20
  import sys
5
21
  import os
@@ -17,64 +33,99 @@ except ModuleNotFoundError:
17
33
  from simple_yaml import parse_simple_yaml
18
34
  _load_yaml = parse_simple_yaml
19
35
 
20
- SKILLS_DIR = ".pi/skills"
21
- files = sorted(glob.glob(f"{SKILLS_DIR}/*/SKILL.md"))
36
+ # Source of truth (skills/*/SKILL.md) and the pi-distributed copy (.pi/skills).
37
+ SKILL_ROOTS = ["skills", ".pi/skills"]
38
+
39
+
40
+ def validate_tree(root):
41
+ """Return (passed, delimiter_failures, parse_failures, semantic_failures)."""
42
+ files = sorted(glob.glob(os.path.join(root, "*/SKILL.md")))
43
+ parse_failures = []
44
+ semantic_failures = []
45
+ delimiter_failures = []
46
+ passed = []
47
+
48
+ for path in files:
49
+ skill_name = os.path.basename(os.path.dirname(path))
50
+ with open(path) as f:
51
+ content = f.read()
52
+
53
+ # R1 — pi's frontmatter gate: opening delimiter must be at byte 0.
54
+ if not content.startswith("---"):
55
+ delimiter_failures.append((skill_name, "file must start with '---' (story tags belong inside the frontmatter block or below it)"))
56
+ continue
22
57
 
23
- parse_failures = []
24
- semantic_failures = []
25
- passed = []
58
+ parts = content.split("---", 2)
59
+ if len(parts) < 3:
60
+ parse_failures.append((skill_name, "missing frontmatter delimiters"))
61
+ continue
26
62
 
27
- for path in files:
28
- skill_name = os.path.basename(os.path.dirname(path))
29
- with open(path) as f:
30
- content = f.read()
63
+ frontmatter = parts[1]
31
64
 
32
- parts = content.split("---", 2)
33
- if len(parts) < 3:
34
- parse_failures.append((skill_name, "missing frontmatter delimiters"))
35
- continue
65
+ try:
66
+ data = _load_yaml(frontmatter)
67
+ except Exception as e:
68
+ parse_failures.append((skill_name, str(e).split("\n")[0]))
69
+ continue
36
70
 
37
- frontmatter = parts[1]
71
+ if data is None:
72
+ parse_failures.append((skill_name, "empty frontmatter"))
73
+ continue
38
74
 
39
- try:
40
- data = _load_yaml(frontmatter)
41
- except Exception as e:
42
- parse_failures.append((skill_name, str(e).split("\n")[0]))
43
- continue
75
+ # R3 — semantic check: model hint embedded in description
76
+ desc = data.get("description", "")
77
+ if desc and "model: sonnet" in desc:
78
+ semantic_failures.append(skill_name)
44
79
 
45
- if data is None:
46
- parse_failures.append((skill_name, "empty frontmatter"))
47
- continue
80
+ passed.append(skill_name)
48
81
 
49
- # Semantic check: model hint embedded in description
50
- desc = data.get("description", "")
51
- if desc and "model: sonnet" in desc:
52
- semantic_failures.append(skill_name)
82
+ return passed, delimiter_failures, parse_failures, semantic_failures
53
83
 
54
- passed.append(skill_name)
55
84
 
56
- # Report
57
- print(f"Total SKILL.md files: {len(files)}")
58
- print(f"Parse OK: {len(passed)}")
59
- print(f"Parse FAIL: {len(parse_failures)}")
60
- print(f"Semantic issues (model in desc): {len(semantic_failures)}")
85
+ all_passed = []
86
+ all_delimiter = []
87
+ all_parse = []
88
+ all_semantic = []
89
+
90
+ for root in SKILL_ROOTS:
91
+ passed, delimiter_failures, parse_failures, semantic_failures = validate_tree(root)
92
+ all_passed += passed
93
+ all_delimiter += delimiter_failures
94
+ all_parse += parse_failures
95
+ all_semantic += semantic_failures
96
+ total = len(passed) + len(delimiter_failures) + len(parse_failures) + len(semantic_failures)
97
+ print(f"[{root}] SKILL.md files: {total} — parse OK: {len(passed)}")
98
+
99
+ print()
100
+ print(f"Total SKILL.md files: {len(all_passed) + len(all_delimiter) + len(all_parse) + len(all_semantic)}")
101
+ print(f"Parse OK: {len(all_passed)}")
102
+ print(f"Delimiter FAIL (must start with '---'): {len(all_delimiter)}")
103
+ print(f"Parse FAIL: {len(all_parse)}")
104
+ print(f"Semantic issues (model in desc): {len(all_semantic)}")
61
105
  print()
62
106
 
63
- if parse_failures:
107
+ if all_delimiter:
108
+ print("=== DELIMITER FAILURES (file does not start with '---') ===")
109
+ for name, err in all_delimiter:
110
+ print(f" {name}: {err}")
111
+ print()
112
+
113
+ if all_parse:
64
114
  print("=== PARSE FAILURES ===")
65
- for name, err in parse_failures:
115
+ for name, err in all_parse:
66
116
  print(f" {name}: {err}")
67
117
  print()
68
118
 
69
- if semantic_failures:
119
+ if all_semantic:
70
120
  print("=== SEMANTIC ISSUES (model embedded in description) ===")
71
- for name in sorted(semantic_failures):
121
+ for name in sorted(all_semantic):
72
122
  print(f" {name}")
73
123
  print()
74
124
 
75
- if parse_failures or semantic_failures:
76
- print(f"FAIL: {len(parse_failures)} parse + {len(semantic_failures)} semantic issues")
125
+ if all_delimiter or all_parse or all_semantic:
126
+ n = len(all_delimiter) + len(all_parse) + len(all_semantic)
127
+ print(f"FAIL: {n} issues ({len(all_delimiter)} delimiter + {len(all_parse)} parse + {len(all_semantic)} semantic)")
77
128
  sys.exit(1)
78
129
  else:
79
- print("PASS: all SKILL.md YAML frontmatter valid")
130
+ print("PASS: all SKILL.md YAML frontmatter valid (sources + .pi/skills)")
80
131
  sys.exit(0)
@@ -1,7 +1,7 @@
1
+ ---
1
2
  # story: e51s04
2
3
  # story: e45s18
3
4
  # story: e45s31
4
- ---
5
5
  name: audit-code
6
6
  model: haiku
7
7
  effort: standard
@@ -1,7 +1,7 @@
1
- # story: e45s02
2
- <!-- story: e45s12 -->
3
- <!-- story: e79s02 -->
4
1
  ---
2
+ # story: e45s02
3
+ # story: e45s12
4
+ # story: e79s02
5
5
  name: craft-skill
6
6
  model: sonnet
7
7
  effort: standard
@@ -1,6 +1,6 @@
1
- # story: e45s31
2
- <!-- story: e45s14 -->
3
1
  ---
2
+ # story: e45s31
3
+ # story: e45s14
4
4
  name: deepen-architecture
5
5
  model: sonnet
6
6
  effort: standard
@@ -1,5 +1,5 @@
1
- <!-- story: e45s15 -->
2
1
  ---
2
+ # story: e45s15
3
3
  name: deploy
4
4
  description: "Build → verify artifact → deploy → wait → smoke deployment pipeline. Platform-agnostic (MCP or CLI), with configurable timeout, retry with exponential backoff, and integrated health-check. The deploy half of CI/CD: run after build to push to production."
5
5
  model: sonnet
@@ -1,10 +1,10 @@
1
+ ---
1
2
  # story: e80s01
2
3
  # story: e80s03
3
4
  # story: e51s04
4
5
  # story: e45s06
5
6
  # story: e45s08
6
7
  # story: e45s34
7
- ---
8
8
  name: develop-tdd
9
9
  model: sonnet
10
10
  effort: standard
@@ -1,5 +1,5 @@
1
- # story: e45s38
2
1
  ---
2
+ # story: e45s38
3
3
  name: diagnose-stall
4
4
  model: haiku
5
5
  effort: light
@@ -1,5 +1,5 @@
1
- # story: e80s01
2
1
  ---
2
+ # story: e80s01
3
3
  name: enforce-first
4
4
  model: haiku
5
5
  effort: standard
@@ -1,5 +1,5 @@
1
- # story: e51s04
2
1
  ---
2
+ # story: e51s04
3
3
  name: fix-bug
4
4
  model: sonnet
5
5
  effort: standard
@@ -1,6 +1,6 @@
1
+ ---
1
2
  # story: e80s01
2
3
  # story: e45s05
3
- ---
4
4
  name: gate-trace
5
5
  description: "Deterministic traceability quality gate — reads coverage matrix + blind-spot data, applies decision rules with oracle confidence downgrade, emits PASS/CONCERNS/FAIL/WAIVED verdict. Use before release-branch to gate merges on traceability."
6
6
  # story: e38s06
@@ -1,9 +1,9 @@
1
+ ---
1
2
  # story: e45s04
2
3
  # story: e45s06
3
4
  # story: e45s09
4
5
  # story: e45s33
5
6
  # story: e45s35
6
- ---
7
7
  name: plan-work
8
8
  model: opus
9
9
  effort: standard
@@ -1,5 +1,5 @@
1
- # story: e51s04
2
1
  ---
2
+ # story: e51s04
3
3
  name: quick-fix
4
4
  description: "Streamlined fast-path for trivial data-only fixes — no TDD, no branching ceremony. Collapses 6 skills into 2 for changes that are purely data with no logic risk. Aborts with fallback to investigate-bug if guardrails trigger."
5
5
  model: sonnet
@@ -1,7 +1,7 @@
1
- # story: e45s07
2
- <!-- story: e45s07 -->
3
- <!-- story: e45s17 -->
4
1
  ---
2
+ # story: e45s07
3
+ # story: e45s07
4
+ # story: e45s17
5
5
  name: request-review
6
6
  model: opus
7
7
  effort: standard
@@ -1,5 +1,5 @@
1
- # story: e45s37
2
1
  ---
2
+ # story: e45s37
3
3
  name: run-evals
4
4
  description: Eval-Driven Development — define capability and regression evals before building; code graders use verify commands, model graders use explicit rubrics; log pass@k. Use before develop-tdd on new features, or when measuring agent capability over runs.
5
5
  model: sonnet
@@ -1,5 +1,5 @@
1
- # story: e80s02
2
1
  ---
2
+ # story: e80s02
3
3
  name: smoke-test
4
4
  phase: verify
5
5
  description: "Post-deploy health-check against a live URL. Validates HTTP status, response content, and critical endpoints. Runnable standalone OR as the final step of the deploy skill."
@@ -1,5 +1,5 @@
1
- # story: e80s02
2
1
  ---
2
+ # story: e80s02
3
3
  name: validate-contracts
4
4
  phase: verify
5
5
  description: "Assert data shape consistency across system boundaries — live API responses against JSON Schema, key-set comparison across layers, data shape validation for migrations and exports. Catches silent data corruption before deploy."
@@ -1,7 +1,7 @@
1
+ ---
1
2
  # story: e80s01
2
3
  # story: e80s04
3
4
  # story: e45s08
4
- ---
5
5
  name: validate-fix
6
6
  model: haiku
7
7
  effort: standard
package/skills-lock.json CHANGED
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "audit-code": {
15
15
  "description": "Self-review checklist for the coding agent to run before dispatching a reviewer. Checks CONVENTIONS.md compliance, Boy Scout Rule, test coverage, types, and SOLID. Produces a pass/fail checklist. Use before request-review, before committing, or when user asks for a code quality check.",
16
- "sha256": "b0342883680fee6c",
16
+ "sha256": "6c37decb8b323a18",
17
17
  "path": "skills/audit-codeSKILL.md"
18
18
  },
19
19
  "audit-plan": {
@@ -48,12 +48,12 @@
48
48
  },
49
49
  "craft-skill": {
50
50
  "description": "Create new bigpowers skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill for the bigpowers lifecycle.",
51
- "sha256": "f3b08c24979f1857",
51
+ "sha256": "b1d4efb0dcecb204",
52
52
  "path": "skills/craft-skillSKILL.md"
53
53
  },
54
54
  "deepen-architecture": {
55
55
  "description": "Find deepening opportunities in a codebase, informed by the domain language in specs/tech-architecture/tech-stack.md and the decisions in specs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.",
56
- "sha256": "da2760c0cb49a3e4",
56
+ "sha256": "ee41e4524031fee3",
57
57
  "path": "skills/deepen-architectureSKILL.md"
58
58
  },
59
59
  "define-language": {
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "deploy": {
75
75
  "description": "\"Build → verify artifact → deploy → wait → smoke deployment pipeline. Platform-agnostic (MCP or CLI), with configurable timeout, retry with exponential backoff, and integrated health-check. The deploy half of CI/CD: run after build to push to production.\"",
76
- "sha256": "ddfcbfbfc464c620",
76
+ "sha256": "d355906aff894cfc",
77
77
  "path": "skills/deploySKILL.md"
78
78
  },
79
79
  "design-interface": {
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "develop-tdd": {
85
85
  "description": "Test-driven development with red-green-refactor loop using vertical slices. Use for features (epic tasks) or bugs (specs/bugs/BUG-*.md).",
86
- "sha256": "8b3934e2291b863d",
86
+ "sha256": "433c1315e6604899",
87
87
  "path": "skills/develop-tddSKILL.md"
88
88
  },
89
89
  "diagnose-root": {
@@ -93,7 +93,7 @@
93
93
  },
94
94
  "diagnose-stall": {
95
95
  "description": "Diagnose why agent orchestration stopped producing progress — silent stalls in /loop, dispatch-agents, or execute-plan. Use when work appears hung, no output for several minutes, or a subagent never returned.",
96
- "sha256": "c0fe87349399c112",
96
+ "sha256": "983d5a3a922af07d",
97
97
  "path": "skills/diagnose-stallSKILL.md"
98
98
  },
99
99
  "dispatch-agents": {
@@ -113,7 +113,7 @@
113
113
  },
114
114
  "enforce-first": {
115
115
  "description": "Apply the F.I.R.S.T test quality rubric (per CONVENTIONS.md §Tests) to a test suite or individual tests. Use when develop-tdd is writing tests, when test quality needs to be checked, or when user mentions F.I.R.S.T or \"test quality\".",
116
- "sha256": "1ec1183ee6377917",
116
+ "sha256": "567d0efaa59d1262",
117
117
  "path": "skills/enforce-firstSKILL.md"
118
118
  },
119
119
  "evolve-skill": {
@@ -138,12 +138,12 @@
138
138
  },
139
139
  "fix-bug": {
140
140
  "description": "Bug fix orchestrator — active_flow fix_bug; reads specs/bugs/BUG-*.md; chains investigate-bug, develop-tdd, validate-fix. Use when user reports a defect.",
141
- "sha256": "8e9e5922211b7e3b",
141
+ "sha256": "575a3ce60745c5c3",
142
142
  "path": "skills/fix-bugSKILL.md"
143
143
  },
144
144
  "gate-trace": {
145
145
  "description": "\"Deterministic traceability quality gate — reads coverage matrix + blind-spot data, applies decision rules with oracle confidence downgrade, emits PASS/CONCERNS/FAIL/WAIVED verdict. Use before release-branch to gate merges on traceability.\"",
146
- "sha256": "87e0c49ff90ec34c",
146
+ "sha256": "097c31ec960861ce",
147
147
  "path": "skills/gate-traceSKILL.md"
148
148
  },
149
149
  "generate-allure-report": {
@@ -238,7 +238,7 @@
238
238
  },
239
239
  "plan-work": {
240
240
  "description": "\"PLANNING SPINE STEP 3 of 3 — Plan the work: write detailed implementation tasks into the active epic capsule (specs/epics/eNN-slug/). Produces countable-story-format .md specs and runnable -tasks.yaml files. Use after slice-tasks (step 2). Not a substitute for scope-work (step 1) or slice-tasks (step 2).\"",
241
- "sha256": "32c2bcaf16cb4ad2",
241
+ "sha256": "0558f03399e6b93f",
242
242
  "path": "skills/plan-workSKILL.md"
243
243
  },
244
244
  "publish-package": {
@@ -248,7 +248,7 @@
248
248
  },
249
249
  "quick-fix": {
250
250
  "description": "\"Streamlined fast-path for trivial data-only fixes — no TDD, no branching ceremony. Collapses 6 skills into 2 for changes that are purely data with no logic risk. Aborts with fallback to investigate-bug if guardrails trigger.\"",
251
- "sha256": "6a1b70cb1530c428",
251
+ "sha256": "5631a3980b214748",
252
252
  "path": "skills/quick-fixSKILL.md"
253
253
  },
254
254
  "release-branch": {
@@ -258,7 +258,7 @@
258
258
  },
259
259
  "request-review": {
260
260
  "description": "Dispatch a fresh reviewer agent with a clean context to critique the code after audit-code passes. The reviewer has no shared state with the coding agent and gives a genuine second opinion. Use after audit-code passes, before committing, or when user wants an independent code review.",
261
- "sha256": "f362641a467c3000",
261
+ "sha256": "f395a14585b78aaf",
262
262
  "path": "skills/request-reviewSKILL.md"
263
263
  },
264
264
  "research-first": {
@@ -283,7 +283,7 @@
283
283
  },
284
284
  "run-evals": {
285
285
  "description": "Eval-Driven Development — define capability and regression evals before building; code graders use verify commands, model graders use explicit rubrics; log pass@k. Use before develop-tdd on new features, or when measuring agent capability over runs.",
286
- "sha256": "d20ba2bece1b1c72",
286
+ "sha256": "7bc7cfd24a41d9e3",
287
287
  "path": "skills/run-evalsSKILL.md"
288
288
  },
289
289
  "run-planning": {
@@ -338,7 +338,7 @@
338
338
  },
339
339
  "smoke-test": {
340
340
  "description": "\"Post-deploy health-check against a live URL. Validates HTTP status, response content, and critical endpoints. Runnable standalone OR as the final step of the deploy skill.\"",
341
- "sha256": "050170d66ada581e",
341
+ "sha256": "407669c94dee6b53",
342
342
  "path": "skills/smoke-testSKILL.md"
343
343
  },
344
344
  "spike-prototype": {
@@ -373,12 +373,12 @@
373
373
  },
374
374
  "validate-contracts": {
375
375
  "description": "\"Assert data shape consistency across system boundaries — live API responses against JSON Schema, key-set comparison across layers, data shape validation for migrations and exports. Catches silent data corruption before deploy.\"",
376
- "sha256": "d93c9ae2953ac457",
376
+ "sha256": "6541a7f72b3f0493",
377
377
  "path": "skills/validate-contractsSKILL.md"
378
378
  },
379
379
  "validate-fix": {
380
380
  "description": "Prove a fix works before declaring done — re-run the failing test, run the full suite, typecheck, lint, and harden against recurrence. Use after implementing a bug fix, when user says \"is this fixed?\", or before closing an investigation.",
381
- "sha256": "f94972af3fd48e3e",
381
+ "sha256": "d7fac868ccbf5dbe",
382
382
  "path": "skills/validate-fixSKILL.md"
383
383
  },
384
384
  "verify-work": {