bonzai-tree 1.0.130 → 1.0.135
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.
|
@@ -8,22 +8,27 @@ function detectClaudeHandler(req, res) {
|
|
|
8
8
|
const claudeMdPath = path.join(ROOT, 'CLAUDE.md');
|
|
9
9
|
const claudeMd = fs.existsSync(claudeMdPath) ? 'CLAUDE.md' : null;
|
|
10
10
|
|
|
11
|
-
// Scan .claude/commands/
|
|
11
|
+
// Scan both .claude/skills/ and .claude/commands/ for .md files
|
|
12
12
|
const skills = [];
|
|
13
|
-
const
|
|
13
|
+
const dirs = [
|
|
14
|
+
path.join(ROOT, '.claude', 'skills'),
|
|
15
|
+
path.join(ROOT, '.claude', 'commands'),
|
|
16
|
+
];
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
skills.push(path.relative(ROOT, fullPath));
|
|
24
|
-
}
|
|
18
|
+
function scanDir(dir) {
|
|
19
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
20
|
+
for (const entry of entries) {
|
|
21
|
+
const fullPath = path.join(dir, entry.name);
|
|
22
|
+
if (entry.isDirectory()) {
|
|
23
|
+
scanDir(fullPath);
|
|
24
|
+
} else if (entry.isFile() && entry.name.endsWith('.md')) {
|
|
25
|
+
skills.push(path.relative(ROOT, fullPath));
|
|
25
26
|
}
|
|
26
|
-
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
for (const dir of dirs) {
|
|
31
|
+
if (fs.existsSync(dir)) scanDir(dir);
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
res.json({ claudeMd, skills });
|