54
return skills.filter((_, i) => !isPluginDir[i]);
55
}
57
>
/**
58
>
* Scans a Claude session's `.claude/{agents,skills,commands}` directories
59
>
* (project + user scope) and returns the discovered customizations with
60
>
* their real source-file URIs and parsed names/descriptions.
61
>
*
62
>
* Reuses the shared parsers in `pluginParsers.ts`:
63
>
* - agents — flat `<name>.md` files, frontmatter name/description.
64
>
* - skills — `<dir>/SKILL.md` layout, frontmatter name/description.
65
>
* - commands — flat `<name>.md` files; a variant of skills, so they are
66
>
* folded into the skill set (skills win on a name conflict).
67
>
*
68
>
* Each scope is scanned independently and merged project-before-user so
69
>
* precedence is deterministic (the shared readers parallelize/sort
70
>
* internally, so handing them both scopes at once would NOT guarantee
71
>
* which scope wins on a name clash). Within a scope, skills are collected
72
>
* before commands so skills win same-name conflicts. MCP servers are
73
>
* resolved separately (they live inline in `settings.json` / `.mcp.json`,
74
>
* not as directory entries).
75
>
*/
76
export async function scanClaudeDiskCustomizations(
77
workingDirectory: URI | undefined,