@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifeaitools/rdc-skills",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
4
4
  "description": "RDC typed-agent dispatch skill suite for Claude Code \u00e2\u20ac\u201d plan, build, review, overnight builds",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -155,23 +155,22 @@ function cleanUserSkills(userSkillsDir) {
155
155
  }
156
156
 
157
157
  // ── Stale hook cleanup ────────────────────────────────────────────────────────
158
- // Remove hook files from ~/.claude/hooks/ that are no longer in the source hooks/ dir.
159
- // Prevents orphaned hooks (removed from source but still installed) from misfiring.
160
- function cleanStaleHooks(hooksDstDir, hooksSrcDir) {
161
- if (!fs.existsSync(hooksDstDir) || !fs.existsSync(hooksSrcDir)) return 0;
162
- const sourceFiles = new Set(fs.readdirSync(hooksSrcDir).filter(f => f.endsWith('.js')));
163
- // These hooks were written by us (rdc-skills) safe to remove if no longer in source.
164
- // We only manage our own hooks; never touch hooks we didn't install.
165
- const knownHooks = [
166
- 'check-cwd.js', 'check-stale-work-items.js', 'check-services.js',
167
- 'precompact-log.js', 'postcompact-log.js', 'restart-brief.js',
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 knownHooks) {
173
- if (!sourceFiles.has(f) && fs.existsSync(path.join(hooksDstDir, f))) {
174
- try { fs.unlinkSync(path.join(hooksDstDir, f)); removed++; } catch {}
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, hooksSrc);
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