@jarrodmedrano/claude-skills 1.0.0 → 1.0.2

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/README.md CHANGED
@@ -12,7 +12,15 @@ In any project where you want to use these skills:
12
12
  npm install @jarrodmedrano/claude-skills
13
13
  ```
14
14
 
15
- The skills will automatically be copied to your project's `.claude/skills/` directory during installation.
15
+ The skills will automatically be copied to your project's `.claude/skills/` and `.claude/commands/` directories during installation.
16
+
17
+ **If the automatic installation doesn't work** (e.g., if you used `npm install --ignore-scripts`), you can manually install the skills:
18
+
19
+ ```bash
20
+ npx claude-skills install
21
+ ```
22
+
23
+ This will copy all skills and commands to the appropriate directories in your project.
16
24
 
17
25
  ### Use as local directory
18
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jarrodmedrano/claude-skills",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Reusable Claude Code skills for web development projects",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -22,6 +22,7 @@
22
22
  "license": "MIT",
23
23
  "files": [
24
24
  ".claude/skills/**/*",
25
+ ".claude/commands/**/*",
25
26
  "scripts/**/*",
26
27
  "bin/**/*",
27
28
  "README.md"
@@ -9,40 +9,76 @@ const path = require('path');
9
9
 
10
10
  function copySkills() {
11
11
  // Find the project root (where package.json is, going up from node_modules)
12
- let currentDir = process.cwd();
12
+ let projectRoot = process.cwd();
13
13
 
14
14
  // If we're in node_modules, go up to find the project root
15
- if (currentDir.includes('node_modules')) {
16
- const parts = currentDir.split(path.sep);
15
+ if (projectRoot.includes('node_modules')) {
16
+ const parts = projectRoot.split(path.sep);
17
17
  const nodeModulesIndex = parts.lastIndexOf('node_modules');
18
- currentDir = parts.slice(0, nodeModulesIndex).join(path.sep);
18
+ projectRoot = parts.slice(0, nodeModulesIndex).join(path.sep);
19
19
  }
20
20
 
21
- const targetDir = path.join(currentDir, '.claude', 'skills');
22
- const sourceDir = path.join(__dirname, '..', '.claude', 'skills');
21
+ // Determine package location (either in node_modules or current directory)
22
+ let packageRoot;
23
+ if (projectRoot.includes('node_modules')) {
24
+ // During install, cwd might be the package itself in node_modules
25
+ packageRoot = process.cwd();
26
+ } else {
27
+ // Try to find the package in node_modules
28
+ const possiblePackagePath = path.join(projectRoot, 'node_modules', 'jarrod-claude-skills');
29
+ if (fs.existsSync(possiblePackagePath)) {
30
+ packageRoot = possiblePackagePath;
31
+ } else {
32
+ // Fallback: assume we're running from the package directory itself
33
+ packageRoot = __dirname.includes('node_modules')
34
+ ? path.join(__dirname, '..')
35
+ : path.join(__dirname, '..');
36
+ }
37
+ }
23
38
 
24
- // Create .claude/skills directory if it doesn't exist
25
- if (!fs.existsSync(targetDir)) {
26
- fs.mkdirSync(targetDir, { recursive: true });
39
+ const skillsTargetDir = path.join(projectRoot, '.claude', 'skills');
40
+ const commandsTargetDir = path.join(projectRoot, '.claude', 'commands');
41
+ const skillsSourceDir = path.join(packageRoot, '.claude', 'skills');
42
+ const commandsSourceDir = path.join(packageRoot, '.claude', 'commands');
43
+
44
+ // Create .claude directories if they don't exist
45
+ if (!fs.existsSync(skillsTargetDir)) {
46
+ fs.mkdirSync(skillsTargetDir, { recursive: true });
27
47
  console.log('✓ Created .claude/skills directory');
28
48
  }
29
49
 
30
- // Copy skills
50
+ if (!fs.existsSync(commandsTargetDir)) {
51
+ fs.mkdirSync(commandsTargetDir, { recursive: true });
52
+ console.log('✓ Created .claude/commands directory');
53
+ }
54
+
55
+ // Copy skills and commands
31
56
  try {
32
- copyRecursive(sourceDir, targetDir);
33
- console.log('✓ Claude Code skills installed successfully!');
34
- console.log(` Skills location: ${targetDir}`);
57
+ if (fs.existsSync(skillsSourceDir)) {
58
+ copyRecursive(skillsSourceDir, skillsTargetDir);
59
+ console.log(`✓ Skills copied to ${skillsTargetDir}`);
60
+ }
61
+
62
+ if (fs.existsSync(commandsSourceDir)) {
63
+ copyRecursive(commandsSourceDir, commandsTargetDir);
64
+ console.log(`✓ Commands copied to ${commandsTargetDir}`);
65
+ }
66
+
67
+ console.log('\n✓ Claude Code skills installed successfully!');
35
68
  console.log('\nAvailable skills:');
36
69
  console.log(' /new-website - Create frontend projects');
37
70
  console.log(' /new-backend - Create backend APIs');
38
71
  console.log(' /new-fullstack - Create full-stack apps');
39
72
  console.log(' /project-setup - Initialize any project');
73
+ console.log('\nAvailable commands:');
40
74
  console.log(' /code-review - Code review workflows');
41
75
  console.log(' /design-review - Design review workflows');
42
76
  console.log(' /security-review - Security review workflows');
43
- console.log('\nTo update skills later, run: npm run update-skills');
77
+ console.log('\nTo update later, run: npm run update-skills');
44
78
  } catch (error) {
45
79
  console.error('Error copying skills:', error.message);
80
+ console.error('Package root:', packageRoot);
81
+ console.error('Project root:', projectRoot);
46
82
  process.exit(1);
47
83
  }
48
84
  }
File without changes
File without changes
File without changes
File without changes