MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / loadSkillByName

Function loadSkillByName

src/skills/loader.ts:88–103  ·  view source on GitHub ↗
(name: string, cwd: string)

Source from the content-addressed store, hash-verified

86
87/** Load a single skill by name without applying enabled-state filtering. */
88export async function loadSkillByName(name: string, cwd: string): Promise<SkillSpec | null> {
89 for (const { root, origin } of [
90 { root: projectSkillsDir(cwd), origin: 'project' as const },
91 { root: userSkillsDir(), origin: 'user' as const },
92 ]) {
93 const skillDir = path.join(root, name);
94 const skillFile = path.join(skillDir, 'SKILL.md');
95 try {
96 const raw = await fs.readFile(skillFile, 'utf-8');
97 return parseSkill(raw, name, skillDir, origin);
98 } catch {
99 continue;
100 }
101 }
102 return null;
103}
104
105/** Parse a SKILL.md into a SkillSpec. Returns null if the spec is unusable. */
106export function parseSkill(

Callers 3

buildSkillCommandFunction · 0.85
promoteCandidateFunction · 0.85
curateCandidatesFunction · 0.85

Calls 3

projectSkillsDirFunction · 0.85
userSkillsDirFunction · 0.85
parseSkillFunction · 0.85

Tested by

no test coverage detected