Skip to content

Commit 6be1839

Browse files
ellisjrclaude
andcommitted
fix: postinstall copies auto-skill subdirectories
Updates postinstall.js to also install auto-review, auto-unblock, and auto-security skills to ~/.claude/skills/sidecar/<name>/SKILL.md alongside the main SKILL.md. Without this, npm install would not deploy the auto-skills to the user's skill directory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f8802aa commit 6be1839

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

scripts/postinstall.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ const path = require('path');
1313
const os = require('os');
1414
const { execFileSync } = require('child_process');
1515

16-
const SKILL_SOURCE = path.join(__dirname, '..', 'skill', 'SKILL.md');
16+
const SKILL_DIR = path.join(__dirname, '..', 'skill');
17+
const SKILL_SOURCE = path.join(SKILL_DIR, 'SKILL.md');
1718
const SKILL_DEST_DIR = path.join(os.homedir(), '.claude', 'skills', 'sidecar');
1819
const SKILL_DEST = path.join(SKILL_DEST_DIR, 'SKILL.md');
1920

21+
const AUTO_SKILLS = ['auto-review', 'auto-unblock', 'auto-security'];
22+
2023
const MCP_CONFIG = { command: 'npx', args: ['-y', 'claude-sidecar@latest', 'mcp'] };
2124

2225
/**
@@ -50,7 +53,7 @@ function addMcpToConfigFile(configPath, name, config) {
5053
return status;
5154
}
5255

53-
/** Install skill file to ~/.claude/skills/sidecar/ */
56+
/** Install skill files to ~/.claude/skills/sidecar/ */
5457
function installSkill() {
5558
try {
5659
fs.mkdirSync(SKILL_DEST_DIR, { recursive: true });
@@ -59,6 +62,18 @@ function installSkill() {
5962
} catch (err) {
6063
console.error(`[claude-sidecar] Warning: Could not install skill: ${err.message}`);
6164
}
65+
66+
for (const name of AUTO_SKILLS) {
67+
try {
68+
const src = path.join(SKILL_DIR, name, 'SKILL.md');
69+
const destDir = path.join(SKILL_DEST_DIR, name);
70+
fs.mkdirSync(destDir, { recursive: true });
71+
fs.copyFileSync(src, path.join(destDir, 'SKILL.md'));
72+
console.log(`[claude-sidecar] Skill installed: ${name}`);
73+
} catch (err) {
74+
console.error(`[claude-sidecar] Warning: Could not install ${name} skill: ${err.message}`);
75+
}
76+
}
6277
}
6378

6479
/** Register MCP server in Claude Code config */

0 commit comments

Comments
 (0)