fix: improve skill discovery and list output #17
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rtlabs-llm-agents/agent-skills-cli!17
Loading…
Reference in a new issue
No description provided.
Delete branch "KirioXX/fix/improve-skill-discovery"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Fix skill discovery so
skills listcan find skills installed viaskills installacross canonical storage (~/.skills,./.skills) and agent-specific directories. Also addssource paths to
skills listoutput for easier inspection, and updates docs/tests accordingly.Type of Change
Testing
npm run buildpassesskills --helpChecklist
Fixes #15
Summary by CodeRabbit
New Features
Tests
Documentation
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
8f1a0a42-7b44-4061-be73-18d4ce20840c📥 Commits
Reviewing files that changed from the base of the PR and between
df37628523andeb8a3f12d4.📒 Files selected for processing (5)
README.mddocs/superpowers/plans/2026-06-01-skill-discovery-paths.mdsrc/cli/commands/list.tssrc/core/loader.test.tssrc/core/loader.ts✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 Walkthrough
Walkthrough
Expands discovery to include canonical (~/.skills, ./.skills) and agent-specific directories, deduplicates discovered skills by metadata.name, exposes agent discovery helpers, integrates merged search paths into
skills listoutput (including source paths), and adds tests and documentation.Changes
Skill Discovery Path Expansion and Deduplication
src/core/loader.tsgetDefaultSkillPaths(cwd, home)centralizes discovery roots;DEFAULT_SKILL_PATHSis derived from it.discoverSkills()globs**/SKILL.mdper-root (cwd roots, dot files, maxDepth), loads metadata, and deduplicates results bymetadata.name, returning oneSkillRefper name.src/core/loader.test.ts~/.skillsand./.skills, and that two identical skills under different roots are deduplicated to a single canonical path.src/cli/agents.tsAgentConfiggains optionaldiscoveryDirs?: string[].getAgentDiscoveryPaths(agent)aggregatesglobalDir,projectDir, anddiscoveryDirswith legacy fallbacks for unknown agents;getAllAgentDiscoveryPaths()unions deduped roots across agents.src/cli/commands/list.ts,src/cli/commands/list.test.tsListedSkilltype and helpers:getListSearchPaths()(mergesDEFAULT_SKILL_PATHS+getAllAgentDiscoveryPaths()),formatSkillSourcePath(),getListJsonEntry(),getListDisplayLines().registerListCommand()uses merged search paths fordiscoverSkills, includessourcePathin JSON, adds a “Source” table column, always prints Source in default output, and prints description only with--verbose. Tests verify search path contents andsourcePathpresence.README.md,docs/superpowers/plans/2026-06-01-skill-discovery-paths.mdgetDefaultSkillPaths,DEFAULT_SKILL_PATHS, updateddiscoverSkillswith dedupe), and verification steps.Sequence Diagram
🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
#15are addressed: discovery paths now include canonical storage (~/.skills, ./.skills), agent-specific directories are supported, and installed skills are now discoverable via skills list.#15: skill discovery path alignment, list command improvements, supporting tests, documentation, and README updates are all in scope.✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment
@coderabbitai helpto get the list of available commands and usage tips.Actionable comments posted: 6
🧹 Nitpick comments (1)
🤖 Prompt for all review comments with AI agents
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
dcd1f777-149d-4405-bbbb-0fd75524954a📥 Commits
Reviewing files that changed from the base of the PR and between
956140bfceand909c1ce150.📒 Files selected for processing (7)
README.mddocs/superpowers/plans/2026-06-01-skill-discovery-paths.mdsrc/cli/agents.tssrc/cli/commands/list.test.tssrc/cli/commands/list.tssrc/core/loader.test.tssrc/core/loader.ts@ -350,0 +245,4 @@| **OpenAI Codex** | `.codex/skills/` | `~/.codex/skills/` || **Windsurf** | `.windsurf/skills/` | `~/.codeium/windsurf/skills/` || **Cline** | `.cline/skills/` | `~/.cline/skills/` || **Gemini CLI** | `.gemini/skills/` | `~/.gemini/skills/` |⚠️ Potential issue | 🟠 Major | ⚡ Quick win
Move the discovery note outside the table to fix broken rendering.
The discovery note is inserted between table rows, which breaks the Markdown table structure. Most parsers will terminate the table before this note, causing the OpenCode row and subsequent agent information to render incorrectly.
📝 Proposed fix to relocate the note
🤖 Prompt for AI Agents
✅ Addressed in commits
bea1b49toeb8a3f1@ -0,0 +1,195 @@# Skill Discovery Paths Implementation Plan⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
Consider adding an h2 section heading before Task 1.
The document jumps from h1 (line 1) to h3 (line 13), which violates Markdown heading hierarchy. Adding an h2 heading like
## Implementation Tasksbefore Task 1 would improve document structure and fix the markdownlint warning.📋 Proposed fix for heading hierarchy
🤖 Prompt for AI Agents
✅ Addressed in commits
bea1b49toeb8a3f1⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
Plan implementation differs from actual loader code.
The
getDefaultSkillPathsimplementation in the plan (lines 99-107) doesn't match the actual implementation shown in context snippets:Plan is missing:
join(home, ".gemini", "antigravity", "skills")(the plan shows shorterjoin(home, '.antigravity', 'skills'))".agent/skills"directoryActual implementation has 6 paths, plan shows 5.
This discrepancy could mislead readers referencing this plan document. The actual implementation correctly includes the full Antigravity path and the agent-specific
.agent/skillsdirectory as mentioned in the PR objectives.📝 Proposed fix to match actual implementation
📝 Committable suggestion
🤖 Prompt for AI Agents
✅ Addressed in commits
bea1b49toeb8a3f1@ -1,87 +1,171 @@/**⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
Print the actual computed search paths instead of a hardcoded list.
Lines 63–69 can become stale and misleading because discovery now includes additional agent-specific directories.
Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
✅ Addressed in commits
bea1b49toeb8a3f1@ -0,0 +1,45 @@import { describe, expect, it } from "vitest";⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
Use
homedir()in the test instead ofprocess.env.HOME.Line 17 can diverge from runtime path resolution used by production code, causing environment-dependent failures.
Proposed fix
🤖 Prompt for AI Agents
✅ Addressed in commits
bea1b49toeb8a3f1@ -204,1 +1,3 @@}/*** Skill Loader Module* Handles discovery and loading of skills from the filesystem⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
Respect explicit
maxDepth: 0in discovery config.Line 63 uses
config.maxDepth || 3, so an explicit0is ignored and replaced with3.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
✅ Addressed in commits
bea1b49toeb8a3f1View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.