MCPcopy Create free account
hub / github.com/codeaashu/claude-code / extractBundledSkillFiles

Function extractBundledSkillFiles

src/skills/bundledSkills.ts:131–145  ·  view source on GitHub ↗

* Extract a bundled skill's reference files to disk so the model can * Read/Grep them on demand. Called lazily on first skill invocation. * * Returns the directory written to, or null if write failed (skill * continues to work, just without the base-directory prefix).

(
  skillName: string,
  files: Record<string, string>,
)

Source from the content-addressed store, hash-verified

129 * continues to work, just without the base-directory prefix).
130 */
131async function extractBundledSkillFiles(
132 skillName: string,
133 files: Record<string, string>,
134): Promise<string | null> {
135 const dir = getBundledSkillExtractDir(skillName)
136 try {
137 await writeSkillFiles(dir, files)
138 return dir
139 } catch (e) {
140 logForDebugging(
141 `Failed to extract bundled skill '${skillName}' to ${dir}: ${e instanceof Error ? e.message : String(e)}`,
142 )
143 return null
144 }
145}
146
147async function writeSkillFiles(
148 dir: string,

Callers 1

registerBundledSkillFunction · 0.85

Calls 3

writeSkillFilesFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected