MCPcopy Index your code
hub / github.com/codeaashu/claude-code / resolveSkillFilePath

Function resolveSkillFilePath

src/skills/bundledSkills.ts:196–206  ·  view source on GitHub ↗

Normalize and validate a skill-relative path; throws on traversal.

(baseDir: string, relPath: string)

Source from the content-addressed store, hash-verified

194
195/** Normalize and validate a skill-relative path; throws on traversal. */
196function resolveSkillFilePath(baseDir: string, relPath: string): string {
197 const normalized = normalize(relPath)
198 if (
199 isAbsolute(normalized) ||
200 normalized.split(pathSep).includes('..') ||
201 normalized.split('/').includes('..')
202 ) {
203 throw new Error(`bundled skill file path escapes skill dir: ${relPath}`)
204 }
205 return join(baseDir, normalized)
206}
207
208function prependBaseDir(
209 blocks: ContentBlockParam[],

Callers 1

writeSkillFilesFunction · 0.85

Calls 1

normalizeFunction · 0.50

Tested by

no test coverage detected