claudeAgentSkillScan.ts ×4

Frontier kind: Code frontier

unlabeled · c_aec08fa7d112

210 tests · 18623 LOC · 67 files · introduces 0 tests · 52 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges52 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1836 ranges18623 lines · 67 files · Browse complete extent
All tests (intent)
210 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: 52 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

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

Open complete file

1 > /*--------------------------------------------------------------------------------------------- claudeAgentSkillScan.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { URI } from '../../../../../../base/common/uri.js';
7 > import { dirname } from '../../../../../../base/common/resources.js';
8 > import { IFileService } from '../../../../../files/common/files.js';
9 > import { detectPluginFormat, readAgentComponents, readSkills, toParsedAgent, toParsedSkill, type INamedPluginResource, type IParsedAgent, type IParsedSkill } from '../../../../../agentPlugins/common/pluginParsers.js';
10 >
11 > /**
12 > * The `.claude/<sub>` directories one scope (project or user) contributes
13 > * customizations from. `commands` holds slash commands, which are a
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 } {
17 const base = URI.joinPath(scope, '.claude');
22 };
23 }
25 > /**
26 > * Merges parsed components into a name→component map. First-seen wins, so
27 > * scanning project before user (and skills before commands) makes the
28 > * earlier entry shadow same-named later ones deterministically.
29 > */
30 function collectByName<T extends INamedPluginResource>(into: Map<string, T>, items: readonly T[]): void {
31 for (const item of items) {
35 }
36 }
38 > /**
39 > * Drops any skill whose `.claude/skills/<name>/` directory is itself a
40 > * native plugin (it holds a plugin manifest in any supported format). Such
41 > * a directory is an in-place `@skills-dir` plugin, so its skills are
42 > * surfaced under its own `PluginCustomization` container rather than as
43 > * duplicate standalone skill rows (Decision PB-8). The check is
44 > * self-contained (manifest presence, via the shared
45 > * {@link detectPluginFormat}) so it holds for Claude / Open Plugins /
46 > * Copilot layouts and regardless of whether the plugin is enabled.
47 > */
48 async function excludeNativePluginSkills(skills: readonly INamedPluginResource[], fileService: IFileService): Promise<INamedPluginResource[]> {
49 const isPluginDir = await Promise.all(skills.map(async skill => {
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,