MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / getSkillContent

Method getSkillContent

src/services/skills/SkillsManager.ts:261–283  ·  view source on GitHub ↗
(name: string, currentMode?: string)

Source from the content-addressed store, hash-verified

259 }
260
261 async getSkillContent(name: string, currentMode?: string): Promise<SkillContent | null> {
262 // If mode is provided, try to find the best matching skill
263 let skill: SkillMetadata | undefined
264
265 if (currentMode) {
266 const modeSkills = this.getSkillsForMode(currentMode)
267 skill = modeSkills.find((s) => s.name === name)
268 } else {
269 // Fall back to any skill with this name
270 skill = Array.from(this.skills.values()).find((s) => s.name === name)
271 }
272
273 if (!skill) return null
274
275 // Read skill content from disk
276 const fileContent = await fs.readFile(skill.path, "utf-8")
277 const { content: body } = matter(fileContent)
278
279 return {
280 ...skill,
281 instructions: body.trim(),
282 }
283 }
284
285 /**
286 * Get all skills metadata (for UI display)

Callers

nothing calls this directly

Calls 3

getSkillsForModeMethod · 0.95
fromMethod · 0.80
readFileMethod · 0.45

Tested by

no test coverage detected