From d9d775b189911689f461689dbfff83daff09d892 Mon Sep 17 00:00:00 2001 From: Rohit Ghumare <48523873+rohitg00@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:56:06 +0100 Subject: [PATCH] fix: skillkit read searches all agent dirs and finds standalone .md skills getSearchDirs now collects skill directories from ALL agent adapters instead of only the configured agent. This fixes 'skill not found' when skills were installed to .claude/skills/ but the default agent is universal (which only searches skills/). findSkill now also checks name.md for standalone .md skills that were installed as plain files. --- packages/cli/src/helpers.ts | 30 ++++++++++++++++++++---------- packages/core/src/skills.ts | 8 +++++++- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/packages/cli/src/helpers.ts b/packages/cli/src/helpers.ts index fdd78f06..599b1dca 100644 --- a/packages/cli/src/helpers.ts +++ b/packages/cli/src/helpers.ts @@ -8,7 +8,7 @@ import { loadSkillMetadata as coreLoadSkillMetadata, saveSkillMetadata as coreSaveSkillMetadata, } from "@skillkit/core"; -import { getAdapter, detectAgent } from "@skillkit/agents"; +import { getAdapter, detectAgent, getAllAdapters } from "@skillkit/agents"; import type { AgentType, AgentAdapterInfo } from "@skillkit/core"; // Re-export metadata functions directly (they don't need adapter bridging) @@ -16,15 +16,25 @@ export const loadSkillMetadata = coreLoadSkillMetadata; export const saveSkillMetadata = coreSaveSkillMetadata; export function getSearchDirs(agentType?: AgentType): string[] { - const type = agentType || loadConfig().agent; - const adapter = getAdapter(type); - const adapterInfo: AgentAdapterInfo = { - type: adapter.type, - name: adapter.name, - skillsDir: adapter.skillsDir, - configFile: adapter.configFile, - }; - return coreGetSearchDirs(adapterInfo); + const dirs = new Set(); + + const adapters = agentType + ? [getAdapter(agentType)] + : getAllAdapters(); + + for (const adapter of adapters) { + const info: AgentAdapterInfo = { + type: adapter.type, + name: adapter.name, + skillsDir: adapter.skillsDir, + configFile: adapter.configFile, + }; + for (const dir of coreGetSearchDirs(info)) { + dirs.add(dir); + } + } + + return [...dirs]; } export function getInstallDir(global = false, agentType?: AgentType): string { diff --git a/packages/core/src/skills.ts b/packages/core/src/skills.ts index dfd919df..1a898b17 100644 --- a/packages/core/src/skills.ts +++ b/packages/core/src/skills.ts @@ -311,11 +311,17 @@ export function findSkill(name: string, searchDirs: string[]): Skill | null { for (const dir of searchDirs) { if (!existsSync(dir)) continue; + const location: SkillLocation = dir.includes(process.cwd()) ? 'project' : 'global'; + const skillPath = join(dir, name); if (existsSync(skillPath)) { - const location: SkillLocation = dir.includes(process.cwd()) ? 'project' : 'global'; return parseSkill(skillPath, location); } + + const mdPath = join(dir, name.endsWith('.md') ? name : `${name}.md`); + if (existsSync(mdPath)) { + return parseStandaloneSkill(mdPath, location); + } } return null;