bigpowers 2.87.5 → 2.87.6

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigpowers",
3
- "version": "2.87.5",
3
+ "version": "2.87.6",
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
  "gemini-extension"
package/.pi/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigpowers",
3
- "version": "2.87.5",
3
+ "version": "2.87.6",
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,10 @@
1
+ ## [2.87.6](https://github.com/danielvm-git/bigpowers/compare/v2.87.5...v2.87.6) (2026-09-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **install:** refuse to replace non-managed files or dirs during setup ([#114](https://github.com/danielvm-git/bigpowers/issues/114)) ([f866adc](https://github.com/danielvm-git/bigpowers/commit/f866adca03901fc3a2797e968f866176cf604891)), closes [#112](https://github.com/danielvm-git/bigpowers/issues/112)
7
+
1
8
  ## [2.87.5](https://github.com/danielvm-git/bigpowers/compare/v2.87.4...v2.87.5) (2026-08-07)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bigpowers",
3
- "version": "2.87.5",
3
+ "version": "2.87.6",
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": {
@@ -19,6 +19,31 @@
19
19
  const fs = require('fs');
20
20
  const path = require('path');
21
21
 
22
+ // Package root — every link the installer creates points back into this
23
+ // directory, which is how "managed" is detected (see assertReplaceable).
24
+ const REPO_ROOT = path.resolve(__dirname, '..', '..');
25
+
26
+ // Refuse to replace a destination that is not already a bigpowers-managed
27
+ // symlink. Prevents setup from silently destroying a user's own file or
28
+ // directory (e.g. an existing ~/.claude/hooks/rtk-rewrite.sh installed by
29
+ // RTK itself, or a user-authored skills dir with a colliding name). (#112)
30
+ function assertReplaceable(dst) {
31
+ let st;
32
+ try {
33
+ st = fs.lstatSync(dst);
34
+ } catch {
35
+ return; // nothing there — safe to create
36
+ }
37
+ if (st.isSymbolicLink()) {
38
+ const target = fs.readlinkSync(dst);
39
+ if (target.startsWith(REPO_ROOT)) return; // managed by bigpowers — safe to re-link
40
+ }
41
+ throw new Error(
42
+ `Refusing to replace ${dst}: it exists and is not a bigpowers-managed symlink. ` +
43
+ `Back it up or remove it manually, then re-run setup.`
44
+ );
45
+ }
46
+
22
47
  function linkSkills(skillsDir, targetDir) {
23
48
  for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
24
49
  if (!entry.isDirectory()) continue;
@@ -27,11 +52,8 @@ function linkSkills(skillsDir, targetDir) {
27
52
  const src = path.join(skillsDir, entry.name);
28
53
  const dst = path.join(targetDir, entry.name);
29
54
 
30
- // Remove existing symlink or directory
31
- try {
32
- fs.rmSync(dst, { force: true, recursive: true });
33
- } catch {}
34
-
55
+ assertReplaceable(dst);
56
+ fs.rmSync(dst, { force: true });
35
57
  fs.symlinkSync(src, dst);
36
58
  }
37
59
  }
@@ -42,18 +64,14 @@ function linkDir(src, dst) {
42
64
  `Link source missing: ${src} (run bash scripts/sync-skills.sh first)`
43
65
  );
44
66
  }
45
- // Remove existing symlink or directory
46
- try {
47
- fs.rmSync(dst, { force: true, recursive: true });
48
- } catch {}
67
+ assertReplaceable(dst);
68
+ fs.rmSync(dst, { force: true });
49
69
  fs.symlinkSync(src, dst);
50
70
  }
51
71
 
52
72
  function linkFile(src, dst) {
53
- // Remove existing symlink or file
54
- try {
55
- fs.rmSync(dst, { force: true });
56
- } catch {}
73
+ assertReplaceable(dst);
74
+ fs.rmSync(dst, { force: true });
57
75
  fs.symlinkSync(src, dst);
58
76
  }
59
77
 
@@ -82,10 +100,8 @@ function linkHook(src, dst) {
82
100
  `Hook source missing: ${src} (expected under repo skills/ or scripts/hooks/; fix path or restore file)`
83
101
  );
84
102
  }
85
- // Remove existing symlink or file
86
- try {
87
- fs.rmSync(dst, { force: true });
88
- } catch {}
103
+ assertReplaceable(dst);
104
+ fs.rmSync(dst, { force: true });
89
105
  fs.symlinkSync(src, dst);
90
106
  try { fs.chmodSync(src, 0o755); } catch {}
91
107
  }