MCPcopy
hub / github.com/EveryInc/compound-engineering-plugin / loadCommands

Function loadCommands

src/parsers/claude.ts:77–99  ·  view source on GitHub ↗
(commandsDirs: string[])

Source from the content-addressed store, hash-verified

75}
76
77async 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
101async function loadSkills(skillsDirs: string[]): Promise<ClaudeSkill[]> {
102 const entries = await collectFiles(skillsDirs)

Callers 1

loadClaudePluginFunction · 0.85

Calls 4

readTextFunction · 0.90
parseFrontmatterFunction · 0.90
parseAllowedToolsFunction · 0.85
collectMarkdownFilesFunction · 0.70

Tested by

no test coverage detected