@lifeaitools/rdc-skills 0.9.7 → 0.9.8
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/package.json +1 -1
- package/scripts/install-rdc-skills.js +15 -16
package/package.json
CHANGED
|
@@ -155,23 +155,22 @@ function cleanUserSkills(userSkillsDir) {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
// ── Stale hook cleanup ────────────────────────────────────────────────────────
|
|
158
|
-
// Remove hook files
|
|
159
|
-
//
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
//
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
'
|
|
168
|
-
'rate-limit-retry.js', 'post-work-check.js', 'no-stop-open-epics.js',
|
|
169
|
-
'require-work-item-on-commit.js', 'verify-rdc-skills.js',
|
|
158
|
+
// Remove ONLY explicitly orphaned hook files — hooks that were previously shipped
|
|
159
|
+
// by rdc-skills and have since been removed from the project.
|
|
160
|
+
// NEVER use "not in source = remove" logic: most hooks in ~/.claude/hooks/ are
|
|
161
|
+
// not managed by rdc-skills (they come from other plugins or were written directly).
|
|
162
|
+
function cleanStaleHooks(hooksDstDir) {
|
|
163
|
+
if (!fs.existsSync(hooksDstDir)) return 0;
|
|
164
|
+
// Explicit orphan list — add entries here when a hook is intentionally removed.
|
|
165
|
+
// Format: filename that should be deleted if it still exists.
|
|
166
|
+
const ORPHANED_HOOKS = [
|
|
167
|
+
'verify-rdc-skills.js', // removed in v0.9.7 — was checking for old flat-file format
|
|
170
168
|
];
|
|
171
169
|
let removed = 0;
|
|
172
|
-
for (const f of
|
|
173
|
-
|
|
174
|
-
|
|
170
|
+
for (const f of ORPHANED_HOOKS) {
|
|
171
|
+
const p = path.join(hooksDstDir, f);
|
|
172
|
+
if (fs.existsSync(p)) {
|
|
173
|
+
try { fs.unlinkSync(p); removed++; } catch {}
|
|
175
174
|
}
|
|
176
175
|
}
|
|
177
176
|
return removed;
|
|
@@ -547,7 +546,7 @@ async function main() {
|
|
|
547
546
|
|
|
548
547
|
// 0.5b. Stale hook cleanup — remove hooks we no longer ship
|
|
549
548
|
{
|
|
550
|
-
const staleRemoved = cleanStaleHooks(hooksDst
|
|
549
|
+
const staleRemoved = cleanStaleHooks(hooksDst);
|
|
551
550
|
if (staleRemoved > 0) ok(`[0.5b] Hook cleanup — removed ${staleRemoved} orphaned hook file(s)`);
|
|
552
551
|
}
|
|
553
552
|
|