(commandsDirs: string[])
| 75 | } |
| 76 | |
| 77 | async function loadCommands(commandsDirs: string[]): Promise<ClaudeCommand[]> { |
| 78 | const files = await collectMarkdownFiles(commandsDirs) |
| 79 | |
| 80 | const commands: ClaudeCommand[] = [] |
| 81 | for (const file of files) { |
| 82 | const raw = await readText(file) |
| 83 | const { data, body } = parseFrontmatter(raw, file) |
| 84 | const name = (data.name as string) ?? path.basename(file, ".md") |
| 85 | const allowedTools = parseAllowedTools(data["allowed-tools"]) |
| 86 | const disableModelInvocation = data["disable-model-invocation"] === true ? true : undefined |
| 87 | commands.push({ |
| 88 | name, |
| 89 | description: data.description as string | undefined, |
| 90 | argumentHint: data["argument-hint"] as string | undefined, |
| 91 | model: data.model as string | undefined, |
| 92 | allowedTools, |
| 93 | disableModelInvocation, |
| 94 | body: body.trim(), |
| 95 | sourcePath: file, |
| 96 | }) |
| 97 | } |
| 98 | return commands |
| 99 | } |
| 100 | |
| 101 | async function loadSkills(skillsDirs: string[]): Promise<ClaudeSkill[]> { |
| 102 | const entries = await collectFiles(skillsDirs) |
no test coverage detected