kungeskill 0.4.0 → 0.4.1

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": "kungeskill",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Manage Claude Code skills via symlinks — install, remove, update skills from a marketplace cache",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -5,7 +5,8 @@ const path = require('path');
5
5
 
6
6
  /**
7
7
  * Find the project's .claude/skills/ directory.
8
- * Walks up from cwd until it finds one, or creates it at cwd.
8
+ * Walks up from cwd until it finds a .git boundary or existing .claude/skills/.
9
+ * Will not cross project boundaries (stops at .git root).
9
10
  *
10
11
  * @param {string} [cwd] - Starting directory (defaults to process.cwd())
11
12
  * @returns {string} Absolute path to .claude/skills/
@@ -15,17 +16,27 @@ function findProjectSkillsDir(cwd) {
15
16
  let dir = path.resolve(cwd);
16
17
  const root = path.parse(dir).root;
17
18
 
18
- while (dir !== root) {
19
- const skillsDir = path.join(dir, '.claude', 'skills');
20
- if (fs.existsSync(skillsDir)) {
21
- return skillsDir;
19
+ // First pass: find the project root (directory with .git)
20
+ let projectRoot = null;
21
+ let searchDir = dir;
22
+ while (searchDir !== root) {
23
+ if (fs.existsSync(path.join(searchDir, '.git'))) {
24
+ projectRoot = searchDir;
25
+ break;
22
26
  }
23
- dir = path.dirname(dir);
27
+ searchDir = path.dirname(searchDir);
24
28
  }
25
29
 
26
- // Not found create at current working directory
27
- const skillsDir = path.join(cwd, '.claude', 'skills');
28
- fs.mkdirSync(skillsDir, { recursive: true });
30
+ // If no .git found, use cwd as project root
31
+ if (!projectRoot) {
32
+ projectRoot = cwd;
33
+ }
34
+
35
+ // Use .claude/skills/ at the project root
36
+ const skillsDir = path.join(projectRoot, '.claude', 'skills');
37
+ if (!fs.existsSync(skillsDir)) {
38
+ fs.mkdirSync(skillsDir, { recursive: true });
39
+ }
29
40
  return skillsDir;
30
41
  }
31
42