Skip to content

Commit 8fce25d

Browse files
feat: add explicit skills folder handling to create-rule.js
Update create-rule script to properly handle the new skills folder structure for claude-code and claude-code-4.5. **Changes:** - Exclude 'skills' from main directory copy - Copy skills folder explicitly with progress indication - Apply template substitutions to skills files - Show clear progress: "Copying skills folder" **Behavior:** Skills are now excluded from the main recursive copy and copied separately with proper template substitutions and progress feedback. This ensures: - Skills copied only once (no duplication) - Template variables properly substituted - Clear user feedback during installation - Consistent with output-styles handling **Impact:** When users run `node create-rule.js --tool=claude-code` or `--tool=claude-code-4.5`, the skills folder will be properly copied to `~/.claude/skills/` with all agent prompts, workflows, scripts, and documentation intact.
1 parent 83c1d63 commit 8fce25d

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

create-rule.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const TOOL_CONFIG = {
3636
ruleDir: 'claude-code',
3737
targetSubdir: '.claude',
3838
copyEntireFolder: true,
39-
excludeFiles: ['settings.local.json'],
39+
excludeFiles: ['settings.local.json', 'skills'],
4040
templateSubstitutions: {
4141
'CLAUDE.md': {
4242
'TOOL_DIR': '.claude',
@@ -52,7 +52,7 @@ const TOOL_CONFIG = {
5252
ruleDir: 'claude-code-4.5',
5353
targetSubdir: '.claude',
5454
copyEntireFolder: true,
55-
excludeFiles: ['settings.local.json'],
55+
excludeFiles: ['settings.local.json', 'skills'],
5656
templateSubstitutions: {
5757
'CLAUDE.md': {
5858
'TOOL_DIR': '.claude',
@@ -393,13 +393,25 @@ async function handleFullDirectoryCopy(tool, config, overrideHomeDir = null, tar
393393
showProgress('Copying output-styles folder');
394394
const outputStylesSource = path.join(__dirname, 'claude-code', 'output-styles');
395395
const outputStylesDest = path.join(destDir, 'output-styles');
396-
396+
397397
if (fs.existsSync(outputStylesSource)) {
398398
const outputStylesFiles = copyDirectoryRecursive(outputStylesSource, outputStylesDest, [], {});
399399
completeProgress(`Copied ${outputStylesFiles} output-styles files`);
400400
}
401401
}
402402

403+
// Copy skills folder for claude-code and claude-code-4.5
404+
if (tool === 'claude-code' || tool === 'claude-code-4.5') {
405+
showProgress('Copying skills folder');
406+
const skillsSource = path.join(__dirname, config.ruleDir, 'skills');
407+
const skillsDest = path.join(destDir, 'skills');
408+
409+
if (fs.existsSync(skillsSource)) {
410+
const skillsFiles = copyDirectoryRecursive(skillsSource, skillsDest, [], config.templateSubstitutions || {});
411+
completeProgress(`Copied ${skillsFiles} skill files`);
412+
}
413+
}
414+
403415
// Copy tool-specific files if they exist
404416
if (config.toolSpecificFiles) {
405417
showProgress('Copying tool-specific files');

0 commit comments

Comments
 (0)