Skip to content

Commit f86ebe5

Browse files
committed
feat(dev): v1.27.4 - add discover-skills.js helper script
- Add scripts/discover-skills.js for reliable skill discovery - Searches all 7 official Claude Code skill locations - Single Bash call replaces complex multi-step Glob searches - Outputs JSON with summary stats and full skill metadata - Works with Node.js or Bun - Falls back to manual Glob if script unavailable Benefits: - External models (Grok, Gemini) no longer struggle with complex search - Centralized logic easier to maintain and test - Consistent skill discovery across all agents/commands
1 parent 3391d22 commit f86ebe5

4 files changed

Lines changed: 322 additions & 121 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@
191191
{
192192
"name": "dev",
193193
"source": "./plugins/dev",
194-
"description": "Universal development assistant with real skill discovery. v1.27.3: Complete skill discovery - searches all 7 official locations: personal, project, nested (monorepos), marketplace plugins, local plugins, and legacy commands. 44 skills.",
195-
"version": "1.27.3",
194+
"description": "Universal development assistant with real skill discovery. v1.27.4: Added discover-skills.js helper script for reliable skill discovery across all 7 official locations. Single Bash call replaces complex multi-step Glob searches. 44 skills.",
195+
"version": "1.27.4",
196196
"author": {
197197
"name": "Jack Rudenko",
198198
"email": "i@madappgang.com",

plugins/dev/agents/stack-detector.md

Lines changed: 27 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -182,129 +182,39 @@ tools: TaskCreate, TaskUpdate, TaskList, TaskGet, Read, Write, Glob, Grep, Bash
182182
<steps>
183183
<step>Mark skill discovery as in_progress</step>
184184
<step>
185-
**IMPORTANT: Confirm working directory with Bash: pwd**
186-
This ensures all relative paths are correct.
187-
</step>
188-
189-
<!-- LOCATION 1: Personal skills (user-wide) -->
190-
<step>
191-
**1. Search PERSONAL skills (user-wide, all projects):**
192-
```
193-
Use Glob with ABSOLUTE path: ~/.claude/skills/**/SKILL.md
194-
195-
Example path: ~/.claude/skills/explain-code/SKILL.md
196-
```
197-
Source: "personal"
198-
</step>
199-
200-
<!-- LOCATION 2: Project skills -->
201-
<step>
202-
**2. Search PROJECT skills (this project only):**
203-
```
204-
Use Glob with relative pattern: .claude/skills/**/SKILL.md
205-
206-
Example path: .claude/skills/tdd-workflow/SKILL.md
207-
```
208-
Source: "project"
209-
CRITICAL: Use relative path, NOT absolute.
210-
</step>
211-
212-
<!-- LOCATION 3: Nested skills (monorepos) -->
213-
<step>
214-
**3. Search NESTED skills (monorepo packages):**
215-
```
216-
Use Glob with pattern: **/.claude/skills/**/SKILL.md
217-
218-
Example path: packages/frontend/.claude/skills/design-system/SKILL.md
219-
```
220-
Source: "nested"
221-
Note: For monorepo setups where packages have their own skills.
222-
</step>
223-
224-
<!-- LOCATION 4: Legacy commands -->
225-
<step>
226-
**4. Search LEGACY commands (backward compatibility):**
227-
```
228-
Use Glob with pattern: .claude/commands/*.md
229-
230-
Example path: .claude/commands/review.md
231-
```
232-
Source: "legacy-command"
233-
Note: Files here work the same as skills but lack supporting files.
234-
</step>
235-
236-
<!-- LOCATION 5: Marketplace-installed plugins -->
237-
<step>
238-
**5. Parse .claude/settings.json for ENABLED PLUGINS:**
239-
```
240-
If .claude/settings.json exists:
241-
- Read file
242-
- Extract enabledPlugins object
243-
- For each enabled plugin where value == true:
244-
- Parse: "dev@mag-claude-plugins" → plugin="dev", marketplace="mag-claude-plugins"
245-
- Add to list for marketplace search
246-
```
247-
</step>
248-
<step>
249-
**6. Search MARKETPLACE-INSTALLED plugin skills:**
185+
**Run the skill discovery helper script:**
186+
```bash
187+
node "${CLAUDE_PLUGIN_ROOT}/scripts/discover-skills.js" "$(pwd)"
250188
```
251-
For each enabled plugin from step 5:
252-
253-
Example: "dev@mag-claude-plugins" is enabled
254-
→ Glob: ~/.claude/plugins/marketplaces/mag-claude-plugins/plugins/dev/skills/**/SKILL.md
255-
256-
This is where REAL plugin skills live when installed via marketplace!
257-
Use ABSOLUTE path with ~ expansion.
258-
```
259-
Source: "plugin:{plugin-name}"
260-
</step>
261189

262-
<!-- LOCATION 6: Local plugins in workspace -->
263-
<step>
264-
**7. Search LOCAL plugin skills (workspace/project):**
265-
```
266-
Use Glob patterns:
267-
- .claude-plugin/skills/**/SKILL.md
268-
- plugins/*/skills/**/SKILL.md
269-
```
270-
Source: "local-plugin"
271-
Note: For locally-developed plugins, not marketplace installs.
190+
This script searches ALL 7 official Claude Code skill locations:
191+
1. Personal skills: ~/.claude/skills/
192+
2. Project skills: .claude/skills/
193+
3. Nested skills (monorepos): **/.claude/skills/
194+
4. Legacy commands: .claude/commands/
195+
5. Marketplace plugins: ~/.claude/plugins/marketplaces/{m}/plugins/{p}/skills/
196+
6. Local plugins: .claude-plugin/skills/, plugins/*/skills/
197+
7. Enterprise (managed settings)
198+
199+
The script outputs JSON with:
200+
- summary: { total, bySource, byCategory }
201+
- skills: [{ name, description, path, source, categories }]
272202
</step>
273-
274-
<!-- Parse all discovered skills -->
275203
<step>
276-
**8. Parse each discovered SKILL.md:**
277-
278-
STEP A: Use Read tool to read the file content
279-
STEP B: Find the YAML frontmatter (between --- markers at top)
280-
STEP C: Extract these fields from frontmatter:
281-
- name: (the skill name, or directory name if omitted)
282-
- description: (what the skill does)
283-
STEP D: Add to discovered_skills array:
284-
{
285-
"name": "{extracted name}",
286-
"description": "{extracted description}",
287-
"path": "{file path}",
288-
"source": "{source from above steps}",
289-
"categories": []
290-
}
291-
292-
DO NOT make up names. Only use values actually found in the file.
204+
**Parse the JSON output:**
205+
- Extract the `skills` array for `discovered_skills`
206+
- Note the `summary` for reporting
207+
- Each skill has: name, description, path, source, categories
293208
</step>
294-
295-
<!-- Categorize skills -->
296209
<step>
297-
**9. Categorize each discovered skill by keywords:**
298-
299-
Check name and description for these keywords:
300-
- "test", "tdd", "spec" → add category "testing"
301-
- "debug", "trace", "error" → add category "debugging"
302-
- "react", "vue", "component", "ui" → add category "frontend"
303-
- "api", "endpoint", "server" → add category "backend"
304-
- "workflow", "process", "pipeline" → add category "workflow"
305-
- "doc", "readme" → add category "documentation"
306-
- "security", "auth", "jwt" → add category "security"
307-
- "database", "sql", "orm" → add category "database"
210+
**If script fails (node not available), fall back to manual search:**
211+
Use Glob to search these patterns in order:
212+
1. ~/.claude/skills/**/SKILL.md (personal)
213+
2. .claude/skills/**/SKILL.md (project)
214+
3. .claude/commands/*.md (legacy)
215+
216+
For marketplace plugins, read .claude/settings.json and search:
217+
~/.claude/plugins/marketplaces/{marketplace}/plugins/{plugin}/skills/**/SKILL.md
308218
</step>
309219
<step>Mark skill discovery as completed</step>
310220
</steps>

plugins/dev/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "dev",
3-
"version": "1.27.3",
4-
"description": "Universal development assistant with real skill discovery. v1.27.3: Complete skill discovery - searches all 7 official locations: personal, project, nested (monorepos), marketplace plugins, local plugins, and legacy commands. 44 skills.",
3+
"version": "1.27.4",
4+
"description": "Universal development assistant with real skill discovery. v1.27.4: Added discover-skills.js helper script for reliable skill discovery across all 7 official locations. Single Bash call replaces complex multi-step Glob searches. 44 skills.",
55
"author": {
66
"name": "Jack Rudenko",
77
"email": "i@madappgang.com",

0 commit comments

Comments
 (0)