Extract skill loading pipeline into single-responsibility modules: - skill-discovery.ts, skill-directory-loader.ts, skill-deduplication.ts - loaded-skill-from-path.ts, loaded-skill-template-extractor.ts - skill-template-resolver.ts, skill-definition-record.ts - git-master-template-injection.ts, allowed-tools-parser.ts - skill-mcp-config.ts, skill-resolution-options.ts - merger/ directory for skill merging logic
12 lines
500 B
TypeScript
12 lines
500 B
TypeScript
import type { CommandDefinition } from "../claude-code-command-loader/types"
|
|
import type { LoadedSkill } from "./types"
|
|
|
|
export function skillsToCommandDefinitionRecord(skills: LoadedSkill[]): Record<string, CommandDefinition> {
|
|
const result: Record<string, CommandDefinition> = {}
|
|
for (const skill of skills) {
|
|
const { name: _name, argumentHint: _argumentHint, ...openCodeCompatible } = skill.definition
|
|
result[skill.name] = openCodeCompatible as CommandDefinition
|
|
}
|
|
return result
|
|
}
|