claudeAgentSkillScan.ts ×6

Frontier kind: Code frontier

unlabeled · c_f2becc6732b3

19 tests · 19720 LOC · 67 files · introduces 0 tests · 46 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges46 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2201 ranges19720 lines · 67 files · Browse complete extent
All tests (intent)
19 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 46 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/claude/customizations/scan/claudeAgentSkillScan.ts 46 introduced LOC · 6 ranges

Open complete file

14 * variant of skills (folded into the skill set, skills winning conflicts).
15 */
16 > function scopeRoots(scope: URI): { readonly agents: URI; readonly skills: URI; readonly commands: URI } { claudeAgentSkillScan.ts
17 > const base = URI.joinPath(scope, '.claude');
18 > return {
19 > agents: URI.joinPath(base, 'agents'),
20 > skills: URI.joinPath(base, 'skills'),
21 > commands: URI.joinPath(base, 'commands'),
22 > };
23 > }
24
25 /**
28 * earlier entry shadow same-named later ones deterministically.
29 */
30 > function collectByName<T extends INamedPluginResource>(into: Map<string, T>, items: readonly T[]): void { claudeAgentSkillScan.ts
31 > for (const item of items) {
32 if (!into.has(item.name)) {
33 into.set(item.name, item);
34 }
35 }
37
38 /**
46 * Copilot layouts and regardless of whether the plugin is enabled.
47 */
48 > async function excludeNativePluginSkills(skills: readonly INamedPluginResource[], fileService: IFileService): Promise<INamedPluginResource[]> { claudeAgentSkillScan.ts
49 > const isPluginDir = await Promise.all(skills.map(async skill => {
50 const dir = dirname(skill.uri);
51 const format = await detectPluginFormat(dir, fileService);
52 return fileService.exists(URI.joinPath(dir, format.manifestPath));
54 > return skills.filter((_, i) => !isPluginDir[i]);
55 > }
56
57 /**
74 * not as directory entries).
75 */
76 > export async function scanClaudeDiskCustomizations( claudeAgentSkillScan.ts
77 > workingDirectory: URI | undefined,
78 > userHome: URI,
79 > fileService: IFileService,
80 > ): Promise<readonly (IParsedAgent | IParsedSkill)[]> {
81 > // Project scope first so it wins precedence over user scope.
82 > const scopes = workingDirectory ? [workingDirectory, userHome] : [userHome];
83 > const agents = new Map<string, IParsedAgent>();
84 > const skills = new Map<string, IParsedSkill>();
85 >
86 > for (const scope of scopes) {
87 > const { agents: agentsDir, skills: skillsDir, commands: commandsDir } = scopeRoots(scope);
88 > const [agentRes, skillRes, commandRes] = await Promise.all([
89 > readAgentComponents([agentsDir], fileService),
90 > // pluginRoot = the skills dir itself, so the readSkills fallback
91 > // targets `<skillsDir>/SKILL.md` (a legit single-skill dir), never
92 > // an unrelated `<userHome>/SKILL.md`.
93 > readSkills(skillsDir, [skillsDir], fileService),
94 > readAgentComponents([commandsDir], fileService),
95 > ]);
96 > collectByName(agents, agentRes.map(toParsedAgent));
97 > // Skills before commands so a same-named skill wins (spec section 3).
98 > // Drop `@skills-dir` plugin dirs first — they surface as plugins (PB-8).
99 > const standaloneSkills = await excludeNativePluginSkills(skillRes, fileService);
100 > collectByName(skills, standaloneSkills.map(toParsedSkill));
101 > collectByName(skills, commandRes.map(toParsedSkill));
102 > }
103 >
104 > return [...agents.values(), ...skills.values()];
105 > }