Keep the repository’s module structure and implementations cohesive and non-redundant.
Apply these rules:
core/skills/ with only an index.ts/types.ts that add no navigation or separation value; keep the public surface where it’s simplest.source), extract a single shared implementation and parameterize the difference.Example (dedupe loaders by parameterizing the difference):
function loadSkillsFromDir(dir: string, source: SkillSource): Skill[] {
// shared parsing + file scanning logic here
}
// instead of two nearly identical functions
const piSkills = loadSkillsFromDir(piDir, "pi");
const claudeSkills = loadSkillsFromDir(claudeDir, "claude");