agentsmesh 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/targets.js CHANGED
@@ -15,86 +15,6 @@ var __export = (target31, all) => {
15
15
  for (var name in all)
16
16
  __defProp(target31, name, { get: all[name], enumerable: true });
17
17
  };
18
-
19
- // src/config/core/conversions.ts
20
- function usesCommandSkillProjection(target31) {
21
- return Object.prototype.hasOwnProperty.call(DEFAULT_COMMANDS_TO_SKILLS, target31);
22
- }
23
- function usesAgentSkillProjection(target31) {
24
- return Object.prototype.hasOwnProperty.call(DEFAULT_AGENTS_TO_SKILLS, target31);
25
- }
26
- function resolveConversionValue(value, scope) {
27
- if (value === void 0) return void 0;
28
- if (typeof value === "boolean") return value;
29
- return value[scope];
30
- }
31
- function shouldConvertCommandsToSkills(config, target31, defaultEnabled, scope = "project") {
32
- const raw = config.conversions?.commands_to_skills?.[target31];
33
- const configVal = resolveConversionValue(raw, scope);
34
- if (configVal !== void 0) return configVal;
35
- if (usesCommandSkillProjection(target31)) return DEFAULT_COMMANDS_TO_SKILLS[target31];
36
- return defaultEnabled ?? false;
37
- }
38
- function shouldConvertAgentsToSkills(config, target31, defaultEnabled, scope = "project") {
39
- const raw = config.conversions?.agents_to_skills?.[target31];
40
- const configVal = resolveConversionValue(raw, scope);
41
- if (configVal !== void 0) return configVal;
42
- if (usesAgentSkillProjection(target31)) return DEFAULT_AGENTS_TO_SKILLS[target31];
43
- return defaultEnabled ?? false;
44
- }
45
- var DEFAULT_COMMANDS_TO_SKILLS, DEFAULT_AGENTS_TO_SKILLS;
46
- var init_conversions = __esm({
47
- "src/config/core/conversions.ts"() {
48
- DEFAULT_COMMANDS_TO_SKILLS = {
49
- amp: true,
50
- "codex-cli": true,
51
- goose: true,
52
- kiro: true,
53
- warp: true
54
- };
55
- DEFAULT_AGENTS_TO_SKILLS = {
56
- amp: true,
57
- "gemini-cli": false,
58
- // native .gemini/agents/*.md per agent-structures
59
- cline: true,
60
- "codex-cli": false,
61
- // native .codex/agents/*.toml per agent-structures
62
- windsurf: true,
63
- goose: true,
64
- antigravity: true,
65
- continue: true,
66
- warp: true
67
- };
68
- }
69
- });
70
-
71
- // src/targets/catalog/capabilities.ts
72
- function cap(level, flavor) {
73
- return flavor !== void 0 ? { level, flavor } : { level };
74
- }
75
- function normalizeCapabilityValue(input) {
76
- if (typeof input === "string") {
77
- return { level: input };
78
- }
79
- return input;
80
- }
81
- function normalizeTargetCapabilities(caps) {
82
- return {
83
- rules: normalizeCapabilityValue(caps.rules),
84
- additionalRules: normalizeCapabilityValue(caps.additionalRules),
85
- commands: normalizeCapabilityValue(caps.commands),
86
- agents: normalizeCapabilityValue(caps.agents),
87
- skills: normalizeCapabilityValue(caps.skills),
88
- mcp: normalizeCapabilityValue(caps.mcp),
89
- hooks: normalizeCapabilityValue(caps.hooks),
90
- ignore: normalizeCapabilityValue(caps.ignore),
91
- permissions: normalizeCapabilityValue(caps.permissions)
92
- };
93
- }
94
- var init_capabilities = __esm({
95
- "src/targets/catalog/capabilities.ts"() {
96
- }
97
- });
98
18
  function capabilityLevel(capability) {
99
19
  return typeof capability === "string" ? capability : capability.level;
100
20
  }
@@ -118,7 +38,7 @@ function validateCapabilityImplementations(descriptor31, capabilities17, ctx, pa
118
38
  function validateDescriptor(value) {
119
39
  return targetDescriptorSchema.parse(value);
120
40
  }
121
- var capabilityLevelSchema, capabilitiesSchema, generatorsSchema, pathResolversSchema, layoutSchema, globalSupportSchema, legacyGlobalKeys, generatorRequirements, settingsBackedFeatures, targetDescriptorSchemaBase, targetDescriptorSchema;
41
+ var capabilityLevelSchema, capabilitiesSchema, generatorsSchema, pathResolversSchema, layoutSchema, globalSupportSchema, legacyGlobalKeys, generatorRequirements, settingsBackedFeatures, conversionDefaultsSchema, metadataSchema, targetDescriptorSchemaBase, targetDescriptorSchema;
122
42
  var init_target_descriptor_schema = __esm({
123
43
  "src/targets/catalog/target-descriptor.schema.ts"() {
124
44
  capabilityLevelSchema = z.union([
@@ -182,8 +102,19 @@ var init_target_descriptor_schema = __esm({
182
102
  { feature: "permissions", generator: "generatePermissions" }
183
103
  ];
184
104
  settingsBackedFeatures = ["mcp", "hooks", "ignore", "permissions"];
105
+ conversionDefaultsSchema = z.object({
106
+ commandsToSkills: z.boolean().optional(),
107
+ agentsToSkills: z.boolean().optional()
108
+ }).strict();
109
+ metadataSchema = z.object({
110
+ displayName: z.string().min(1),
111
+ category: z.enum(["cli", "ide", "agent-platform"]),
112
+ officialUrl: z.string().min(1),
113
+ shortDescription: z.string().min(1)
114
+ }).passthrough();
185
115
  targetDescriptorSchemaBase = z.object({
186
116
  id: z.string().regex(/^[a-z][a-z0-9-]*$/, "Target id must be lowercase with hyphens"),
117
+ metadata: metadataSchema,
187
118
  generators: generatorsSchema,
188
119
  capabilities: capabilitiesSchema,
189
120
  emptyImportMessage: z.string(),
@@ -191,7 +122,13 @@ var init_target_descriptor_schema = __esm({
191
122
  project: layoutSchema,
192
123
  globalSupport: globalSupportSchema.optional(),
193
124
  buildImportPaths: z.function(),
194
- detectionPaths: z.array(z.string())
125
+ detectionPaths: z.array(z.string()),
126
+ excludeFromStarterInit: z.boolean().optional(),
127
+ conversionDefaults: conversionDefaultsSchema.optional(),
128
+ emitScopedSettings: z.function().optional(),
129
+ mergeGeneratedOutputContent: z.function().optional(),
130
+ postProcessHookOutputs: z.function().optional(),
131
+ preservesManualActivation: z.boolean().optional()
195
132
  }).passthrough();
196
133
  targetDescriptorSchema = targetDescriptorSchemaBase.superRefine((value, ctx) => {
197
134
  for (const key of legacyGlobalKeys) {
@@ -216,10 +153,15 @@ var init_target_descriptor_schema = __esm({
216
153
 
217
154
  // src/targets/catalog/registry.ts
218
155
  function builtinDescriptors() {
219
- if (!_builtinDescriptors) {
220
- _builtinDescriptors = new Map(BUILTIN_TARGETS.map((d) => [d.id, d]));
156
+ if (_builtinDescriptors) return _builtinDescriptors;
157
+ const defined = BUILTIN_TARGETS.filter(
158
+ (d) => d !== void 0 && typeof d.id === "string"
159
+ );
160
+ const map = new Map(defined.map((d) => [d.id, d]));
161
+ if (defined.length === BUILTIN_TARGETS.length) {
162
+ _builtinDescriptors = map;
221
163
  }
222
- return _builtinDescriptors;
164
+ return map;
223
165
  }
224
166
  function registerTargetDescriptor(descriptor31) {
225
167
  const validated = validateDescriptor(descriptor31);
@@ -240,6 +182,65 @@ var init_registry = __esm({
240
182
  }
241
183
  });
242
184
 
185
+ // src/config/core/conversions.ts
186
+ function builtinDefault(target31, key) {
187
+ return getDescriptor(target31)?.conversionDefaults?.[key];
188
+ }
189
+ function resolveConversionValue(value, scope) {
190
+ if (value === void 0) return void 0;
191
+ if (typeof value === "boolean") return value;
192
+ return value[scope];
193
+ }
194
+ function shouldConvertCommandsToSkills(config, target31, defaultEnabled, scope = "project") {
195
+ const raw = config.conversions?.commands_to_skills?.[target31];
196
+ const configVal = resolveConversionValue(raw, scope);
197
+ if (configVal !== void 0) return configVal;
198
+ const builtin = builtinDefault(target31, "commandsToSkills");
199
+ if (builtin !== void 0) return builtin;
200
+ return defaultEnabled ?? false;
201
+ }
202
+ function shouldConvertAgentsToSkills(config, target31, defaultEnabled, scope = "project") {
203
+ const raw = config.conversions?.agents_to_skills?.[target31];
204
+ const configVal = resolveConversionValue(raw, scope);
205
+ if (configVal !== void 0) return configVal;
206
+ const builtin = builtinDefault(target31, "agentsToSkills");
207
+ if (builtin !== void 0) return builtin;
208
+ return defaultEnabled ?? false;
209
+ }
210
+ var init_conversions = __esm({
211
+ "src/config/core/conversions.ts"() {
212
+ init_registry();
213
+ }
214
+ });
215
+
216
+ // src/targets/catalog/capabilities.ts
217
+ function cap(level, flavor) {
218
+ return flavor !== void 0 ? { level, flavor } : { level };
219
+ }
220
+ function normalizeCapabilityValue(input) {
221
+ if (typeof input === "string") {
222
+ return { level: input };
223
+ }
224
+ return input;
225
+ }
226
+ function normalizeTargetCapabilities(caps) {
227
+ return {
228
+ rules: normalizeCapabilityValue(caps.rules),
229
+ additionalRules: normalizeCapabilityValue(caps.additionalRules),
230
+ commands: normalizeCapabilityValue(caps.commands),
231
+ agents: normalizeCapabilityValue(caps.agents),
232
+ skills: normalizeCapabilityValue(caps.skills),
233
+ mcp: normalizeCapabilityValue(caps.mcp),
234
+ hooks: normalizeCapabilityValue(caps.hooks),
235
+ ignore: normalizeCapabilityValue(caps.ignore),
236
+ permissions: normalizeCapabilityValue(caps.permissions)
237
+ };
238
+ }
239
+ var init_capabilities = __esm({
240
+ "src/targets/catalog/capabilities.ts"() {
241
+ }
242
+ });
243
+
243
244
  // src/targets/catalog/shared-artifact-owner.ts
244
245
  function findSharedArtifactOwnershipConflicts(descriptors) {
245
246
  const owners = [];
@@ -345,6 +346,23 @@ function parseFrontmatter(content) {
345
346
  const frontmatter = yamlStr === "" ? {} : parse(yamlStr) ?? {};
346
347
  return { frontmatter, body };
347
348
  }
349
+ function extractBody(content) {
350
+ if (content.indexOf("---") !== 0) return content.trim();
351
+ const close = content.indexOf("---", 3);
352
+ if (close === -1) return content.trim();
353
+ return content.slice(close + 3).trim();
354
+ }
355
+ function tryParseFrontmatter(content, filePath) {
356
+ try {
357
+ return { ok: true, value: parseFrontmatter(content) };
358
+ } catch (err) {
359
+ const message = err instanceof Error ? err.message : String(err);
360
+ const wrapped = new Error(`Failed to parse frontmatter in ${filePath}: ${message}`, {
361
+ cause: err
362
+ });
363
+ return { ok: false, error: wrapped, bodyFallback: extractBody(content) };
364
+ }
365
+ }
348
366
  function serializeFrontmatter(frontmatter, body) {
349
367
  const keys = Object.keys(frontmatter);
350
368
  if (keys.length === 0) return body;
@@ -594,7 +612,18 @@ var init_fs_text_encoding = __esm({
594
612
  EXECUTABLE_SCRIPT_EXTENSIONS = /* @__PURE__ */ new Set([".sh", ".bash", ".zsh"]);
595
613
  }
596
614
  });
597
- async function readDirRecursive(dir, visited) {
615
+ function shouldSkipRecursiveBranch(segments) {
616
+ if (segments.length > MAX_RECURSIVE_DEPTH) return true;
617
+ const counts = /* @__PURE__ */ new Map();
618
+ for (const segment of segments) {
619
+ const count = (counts.get(segment) ?? 0) + 1;
620
+ if (count >= MAX_SEGMENT_REPETITIONS) return true;
621
+ counts.set(segment, count);
622
+ }
623
+ return false;
624
+ }
625
+ async function readDirRecursive(dir, visited, branchSegments) {
626
+ const currentBranchSegments = branchSegments ?? [basename(dir)];
598
627
  let canonicalDir;
599
628
  try {
600
629
  canonicalDir = await realpath(dir);
@@ -620,7 +649,9 @@ async function readDirRecursive(dir, visited) {
620
649
  () => false
621
650
  );
622
651
  if (walkChild) {
623
- files.push(...await readDirRecursive(full, seen));
652
+ const nextSegments = [...currentBranchSegments, ent.name];
653
+ if (shouldSkipRecursiveBranch(nextSegments)) continue;
654
+ files.push(...await readDirRecursive(full, seen, nextSegments));
624
655
  } else {
625
656
  files.push(full);
626
657
  }
@@ -636,9 +667,12 @@ async function readDirRecursive(dir, visited) {
636
667
  );
637
668
  }
638
669
  }
670
+ var MAX_RECURSIVE_DEPTH, MAX_SEGMENT_REPETITIONS;
639
671
  var init_fs_traverse = __esm({
640
672
  "src/utils/filesystem/fs-traverse.ts"() {
641
673
  init_errors();
674
+ MAX_RECURSIVE_DEPTH = 32;
675
+ MAX_SEGMENT_REPETITIONS = 3;
642
676
  }
643
677
  });
644
678
  async function readFileSafe(path) {
@@ -1808,7 +1842,9 @@ function shouldRewritePathToken(fullContent, start, end, matchText, rewriteBareP
1808
1842
  }
1809
1843
  if (before === "@") return true;
1810
1844
  if (before === "(") {
1811
- return after === ")" || after === "#" || after === "?" || after === " " || after === " ";
1845
+ if (fullContent[start - 2] === "]") {
1846
+ return after === ")" || after === "#" || after === "?" || after === " " || after === " ";
1847
+ }
1812
1848
  }
1813
1849
  if (!rewriteBarePathTokens) return false;
1814
1850
  if (isRootRelativePathToken(normalizedCandidate)) return true;
@@ -2202,6 +2238,55 @@ var init_descriptor_default_mappers = __esm({
2202
2238
  }
2203
2239
  });
2204
2240
 
2241
+ // src/install/importers/boilerplate-filter.ts
2242
+ function boilerplateKind(filename) {
2243
+ const lower = filename.toLowerCase();
2244
+ const dotIdx = lower.lastIndexOf(".");
2245
+ const stem = dotIdx > 0 ? lower.slice(0, dotIdx) : lower;
2246
+ return BOILERPLATE_STEMS.get(stem);
2247
+ }
2248
+ function isPreservedBoilerplate(filename) {
2249
+ return boilerplateKind(filename) === "preserved";
2250
+ }
2251
+ var BOILERPLATE_STEMS;
2252
+ var init_boilerplate_filter = __esm({
2253
+ "src/install/importers/boilerplate-filter.ts"() {
2254
+ BOILERPLATE_STEMS = /* @__PURE__ */ new Map([
2255
+ // Noise — upstream-repo housekeeping with no downstream value.
2256
+ ["contributing", "noise"],
2257
+ ["changelog", "noise"],
2258
+ ["changes", "noise"],
2259
+ ["history", "noise"],
2260
+ ["code_of_conduct", "noise"],
2261
+ ["security", "noise"],
2262
+ ["support", "noise"],
2263
+ ["maintainers", "noise"],
2264
+ ["governance", "noise"],
2265
+ ["authors", "noise"],
2266
+ ["contributors", "noise"],
2267
+ ["codeowners", "noise"],
2268
+ ["citation", "noise"],
2269
+ ["acknowledgments", "noise"],
2270
+ ["acknowledgements", "noise"],
2271
+ // Preserved — installed alongside content but never treated as an entity.
2272
+ // LICENSE family: legal attribution required by MIT/Apache/BSD/GPL.
2273
+ ["license", "preserved"],
2274
+ ["license-mit", "preserved"],
2275
+ ["license-apache", "preserved"],
2276
+ ["license-bsd", "preserved"],
2277
+ ["license-gpl", "preserved"],
2278
+ ["notice", "preserved"],
2279
+ ["copying", "preserved"],
2280
+ ["copyright", "preserved"],
2281
+ // README: skill-specific context (overview, usage, prerequisites) that
2282
+ // explains the skill to the downstream consumer. Filtered from entity
2283
+ // discovery so it can never become a phantom rule/command/agent named
2284
+ // "README", but kept as a supporting file so the docs travel with the install.
2285
+ ["readme", "preserved"]
2286
+ ]);
2287
+ }
2288
+ });
2289
+
2205
2290
  // src/targets/catalog/import-descriptor.ts
2206
2291
  function resolveScopedSources(paths, scope) {
2207
2292
  if (!paths) return [];
@@ -2235,18 +2320,32 @@ async function runSingleFile(spec, sources, projectRoot, fromTool, normalize) {
2235
2320
  const destPath = join(destDir, spec.canonicalRootFilename);
2236
2321
  const normalizeTo = (destinationFile) => normalize(content, srcPath, destinationFile);
2237
2322
  if (spec.map) {
2238
- const mapping = await spec.map({
2239
- absolutePath: srcPath,
2240
- relativePath: rel2,
2241
- content,
2242
- destDir,
2243
- normalizeTo
2244
- });
2323
+ let mapping;
2324
+ try {
2325
+ mapping = await spec.map({
2326
+ absolutePath: srcPath,
2327
+ relativePath: rel2,
2328
+ content,
2329
+ destDir,
2330
+ normalizeTo
2331
+ });
2332
+ } catch (err) {
2333
+ const msg = err instanceof Error ? err.message : String(err);
2334
+ process.stderr.write(`\u26A0 skipping ${srcPath}: ${msg}
2335
+ `);
2336
+ continue;
2337
+ }
2245
2338
  if (!mapping) continue;
2246
2339
  await writeFileAtomic(mapping.destPath, mapping.content);
2247
2340
  return [{ fromTool, fromPath: srcPath, toPath: mapping.toPath, feature: spec.feature }];
2248
2341
  }
2249
- const { frontmatter, body } = parseFrontmatter(normalizeTo(destPath));
2342
+ const result = tryParseFrontmatter(normalizeTo(destPath), srcPath);
2343
+ if (!result.ok) {
2344
+ process.stderr.write(`\u26A0 skipping ${srcPath}: ${result.error.message}
2345
+ `);
2346
+ continue;
2347
+ }
2348
+ const { frontmatter, body } = result.value;
2250
2349
  const remapped = spec.frontmatterRemap ? spec.frontmatterRemap(frontmatter) : frontmatter;
2251
2350
  const outFm = spec.markAsRoot ? { ...remapped, root: true } : remapped;
2252
2351
  const outContent = await serializeImportedRuleWithFallback(destPath, outFm, body);
@@ -2275,13 +2374,22 @@ async function runDirectory(spec, sources, projectRoot, fromTool, normalize) {
2275
2374
  fromTool,
2276
2375
  normalize,
2277
2376
  mapEntry: async ({ srcPath, relativePath, content, normalizeTo }) => {
2278
- const mapping = await mapper({
2279
- absolutePath: srcPath,
2280
- relativePath,
2281
- content,
2282
- destDir,
2283
- normalizeTo: (destinationFile) => normalizeTo(destinationFile)
2284
- });
2377
+ if (isPreservedBoilerplate(basename(srcPath))) return null;
2378
+ let mapping;
2379
+ try {
2380
+ mapping = await mapper({
2381
+ absolutePath: srcPath,
2382
+ relativePath,
2383
+ content,
2384
+ destDir,
2385
+ normalizeTo: (destinationFile) => normalizeTo(destinationFile)
2386
+ });
2387
+ } catch (err) {
2388
+ const msg = err instanceof Error ? err.message : String(err);
2389
+ process.stderr.write(`\u26A0 skipping ${srcPath}: ${msg}
2390
+ `);
2391
+ return null;
2392
+ }
2285
2393
  if (!mapping) return null;
2286
2394
  return {
2287
2395
  destPath: mapping.destPath,
@@ -2422,6 +2530,7 @@ var init_descriptor_import_runner = __esm({
2422
2530
  init_import_metadata();
2423
2531
  init_import_orchestrator();
2424
2532
  init_descriptor_default_mappers();
2533
+ init_boilerplate_filter();
2425
2534
  init_import_descriptor();
2426
2535
  }
2427
2536
  });
@@ -3299,7 +3408,7 @@ var init_crush = __esm({
3299
3408
  });
3300
3409
 
3301
3410
  // src/targets/cursor/constants.ts
3302
- var CURSOR_TARGET, CURSOR_COMPAT_AGENTS, CURSOR_LEGACY_RULES, CURSOR_RULES_DIR, CURSOR_GENERAL_RULE, CURSOR_COMMANDS_DIR, CURSOR_AGENTS_DIR, CURSOR_SKILLS_DIR, CURSOR_MCP, CURSOR_HOOKS, CURSOR_SETTINGS, CURSOR_IGNORE, CURSOR_INDEXING_IGNORE, CURSOR_GLOBAL_EXPORT_DIR, CURSOR_GLOBAL_USER_RULES, CURSOR_DOT_CURSOR_AGENTS, CURSOR_GLOBAL_MCP_EXPORT, CURSOR_GLOBAL_SKILLS_DIR, CURSOR_GLOBAL_AGENTS_DIR, CURSOR_CANONICAL_RULES_DIR, CURSOR_CANONICAL_COMMANDS_DIR, CURSOR_CANONICAL_AGENTS_DIR, CURSOR_CANONICAL_SKILLS_DIR, CURSOR_CANONICAL_MCP, CURSOR_CANONICAL_PERMISSIONS, CURSOR_CANONICAL_HOOKS, CURSOR_CANONICAL_IGNORE;
3411
+ var CURSOR_TARGET, CURSOR_COMPAT_AGENTS, CURSOR_LEGACY_RULES, CURSOR_RULES_DIR, CURSOR_GENERAL_RULE, CURSOR_COMMANDS_DIR, CURSOR_AGENTS_DIR, CURSOR_SKILLS_DIR, CURSOR_MCP, CURSOR_HOOKS, CURSOR_SETTINGS, CURSOR_IGNORE, CURSOR_INDEXING_IGNORE, CURSOR_GLOBAL_EXPORT_DIR, CURSOR_GLOBAL_USER_RULES, CURSOR_DOT_CURSOR_AGENTS, CURSOR_CANONICAL_RULES_DIR, CURSOR_CANONICAL_COMMANDS_DIR, CURSOR_CANONICAL_AGENTS_DIR, CURSOR_CANONICAL_SKILLS_DIR, CURSOR_CANONICAL_MCP, CURSOR_CANONICAL_PERMISSIONS, CURSOR_CANONICAL_HOOKS, CURSOR_CANONICAL_IGNORE;
3303
3412
  var init_constants11 = __esm({
3304
3413
  "src/targets/cursor/constants.ts"() {
3305
3414
  CURSOR_TARGET = "cursor";
@@ -3318,9 +3427,6 @@ var init_constants11 = __esm({
3318
3427
  CURSOR_GLOBAL_EXPORT_DIR = ".agentsmesh-exports/cursor";
3319
3428
  CURSOR_GLOBAL_USER_RULES = `${CURSOR_GLOBAL_EXPORT_DIR}/user-rules.md`;
3320
3429
  CURSOR_DOT_CURSOR_AGENTS = ".cursor/AGENTS.md";
3321
- CURSOR_GLOBAL_MCP_EXPORT = CURSOR_MCP;
3322
- CURSOR_GLOBAL_SKILLS_DIR = CURSOR_SKILLS_DIR;
3323
- CURSOR_GLOBAL_AGENTS_DIR = CURSOR_AGENTS_DIR;
3324
3430
  CURSOR_CANONICAL_RULES_DIR = ".agentsmesh/rules";
3325
3431
  CURSOR_CANONICAL_COMMANDS_DIR = ".agentsmesh/commands";
3326
3432
  CURSOR_CANONICAL_AGENTS_DIR = ".agentsmesh/agents";
@@ -4451,7 +4557,7 @@ var init_linter2 = __esm({
4451
4557
  });
4452
4558
 
4453
4559
  // src/targets/amazon-q/index.ts
4454
- var target2, project2, global, globalCapabilities, descriptor2;
4560
+ var target2, project2, globalLayout2, globalCapabilities, descriptor2;
4455
4561
  var init_amazon_q2 = __esm({
4456
4562
  "src/targets/amazon-q/index.ts"() {
4457
4563
  init_generator2();
@@ -4482,7 +4588,7 @@ var init_amazon_q2 = __esm({
4482
4588
  }
4483
4589
  }
4484
4590
  };
4485
- global = {
4591
+ globalLayout2 = {
4486
4592
  managedOutputs: {
4487
4593
  dirs: [AMAZON_Q_GLOBAL_RULES_DIR],
4488
4594
  files: [AMAZON_Q_GLOBAL_MCP_FILE]
@@ -4545,7 +4651,7 @@ var init_amazon_q2 = __esm({
4545
4651
  globalSupport: {
4546
4652
  capabilities: globalCapabilities,
4547
4653
  detectionPaths: [AMAZON_Q_GLOBAL_RULES_DIR, AMAZON_Q_GLOBAL_MCP_FILE],
4548
- layout: global
4654
+ layout: globalLayout2
4549
4655
  },
4550
4656
  importer: {
4551
4657
  rules: {
@@ -4615,13 +4721,22 @@ var init_generator3 = __esm({
4615
4721
 
4616
4722
  // src/targets/catalog/skill-mirror.ts
4617
4723
  function mirrorSkillsToAgents(path, skillsDir, activeTargets) {
4618
- if (path.startsWith(`${skillsDir}/`) && !activeTargets.includes("codex-cli")) {
4724
+ const hasNativeWriter = activeTargets.some((id) => NATIVE_AGENTS_SKILL_WRITERS.includes(id));
4725
+ if (path.startsWith(`${skillsDir}/`) && !hasNativeWriter) {
4619
4726
  return `.agents/skills/${path.slice(skillsDir.length + 1)}`;
4620
4727
  }
4621
4728
  return null;
4622
4729
  }
4730
+ var NATIVE_AGENTS_SKILL_WRITERS;
4623
4731
  var init_skill_mirror = __esm({
4624
4732
  "src/targets/catalog/skill-mirror.ts"() {
4733
+ NATIVE_AGENTS_SKILL_WRITERS = [
4734
+ "amp",
4735
+ "antigravity",
4736
+ "codex-cli",
4737
+ "goose",
4738
+ "replit-agent"
4739
+ ];
4625
4740
  }
4626
4741
  });
4627
4742
  async function importAmpMcp(projectRoot, settingsPath, results) {
@@ -4763,7 +4878,7 @@ function mergeAmpSettings(existing, newContent) {
4763
4878
  }
4764
4879
  return JSON.stringify(base, null, 2);
4765
4880
  }
4766
- var target3, project3, globalLayout2, capabilities2, descriptor3;
4881
+ var target3, project3, globalLayout3, capabilities2, descriptor3;
4767
4882
  var init_amp2 = __esm({
4768
4883
  "src/targets/amp/index.ts"() {
4769
4884
  init_command_skill();
@@ -4803,7 +4918,7 @@ var init_amp2 = __esm({
4803
4918
  }
4804
4919
  }
4805
4920
  };
4806
- globalLayout2 = {
4921
+ globalLayout3 = {
4807
4922
  rootInstructionPath: AMP_GLOBAL_ROOT_FILE,
4808
4923
  skillDir: AMP_GLOBAL_SKILLS_DIR,
4809
4924
  managedOutputs: {
@@ -4866,7 +4981,7 @@ var init_amp2 = __esm({
4866
4981
  globalSupport: {
4867
4982
  capabilities: capabilities2,
4868
4983
  detectionPaths: [AMP_GLOBAL_ROOT_FILE, AMP_GLOBAL_MCP_FILE],
4869
- layout: globalLayout2
4984
+ layout: globalLayout3
4870
4985
  },
4871
4986
  importer: {
4872
4987
  rules: {
@@ -4900,7 +5015,8 @@ var init_amp2 = __esm({
4900
5015
  ".agents/skills/": "consumer"
4901
5016
  },
4902
5017
  buildImportPaths: buildAmpImportPaths,
4903
- detectionPaths: [AMP_ROOT_FILE, AMP_MCP_FILE]
5018
+ detectionPaths: [AMP_ROOT_FILE, AMP_MCP_FILE],
5019
+ conversionDefaults: { commandsToSkills: true, agentsToSkills: true }
4904
5020
  };
4905
5021
  }
4906
5022
  });
@@ -5140,7 +5256,7 @@ var init_linter4 = __esm({
5140
5256
  });
5141
5257
 
5142
5258
  // src/targets/antigravity/index.ts
5143
- var target4, project4, global2, globalCapabilities2, descriptor4;
5259
+ var target4, project4, globalLayout4, globalCapabilities2, descriptor4;
5144
5260
  var init_antigravity2 = __esm({
5145
5261
  "src/targets/antigravity/index.ts"() {
5146
5262
  init_capabilities();
@@ -5164,6 +5280,20 @@ var init_antigravity2 = __esm({
5164
5280
  project4 = {
5165
5281
  rootInstructionPath: ANTIGRAVITY_RULES_ROOT,
5166
5282
  skillDir: ".agents/skills",
5283
+ // managedOutputs is the sole signal `cleanupStaleGeneratedOutputs` uses to
5284
+ // decide which dirs/files to scan when reconciling post-uninstall state.
5285
+ // Antigravity emits across three dirs:
5286
+ // - `.agents/rules` (rules)
5287
+ // - `.agents/workflows` (commands → workflows projection)
5288
+ // - `.agents/skills` (agents → skills projection + native skills)
5289
+ // Without all three here, projected outputs from an uninstalled pack would
5290
+ // linger in the user's project. The root rule file and (suppressed) MCP
5291
+ // config are listed under `files` so a flip from one root style to another
5292
+ // doesn't leave both behind.
5293
+ managedOutputs: {
5294
+ dirs: [ANTIGRAVITY_RULES_DIR, ANTIGRAVITY_WORKFLOWS_DIR, ANTIGRAVITY_SKILLS_DIR],
5295
+ files: [ANTIGRAVITY_RULES_ROOT]
5296
+ },
5167
5297
  rewriteGeneratedPath(path) {
5168
5298
  if (path === ANTIGRAVITY_MCP_CONFIG) return null;
5169
5299
  return path;
@@ -5180,7 +5310,7 @@ var init_antigravity2 = __esm({
5180
5310
  }
5181
5311
  }
5182
5312
  };
5183
- global2 = {
5313
+ globalLayout4 = {
5184
5314
  rootInstructionPath: ANTIGRAVITY_GLOBAL_ROOT,
5185
5315
  renderPrimaryRootInstruction: renderAntigravityGlobalInstructions,
5186
5316
  skillDir: ANTIGRAVITY_GLOBAL_SKILLS_DIR,
@@ -5208,7 +5338,7 @@ var init_antigravity2 = __esm({
5208
5338
  return `${ANTIGRAVITY_GLOBAL_WORKFLOWS_DIR}/${name}.md`;
5209
5339
  },
5210
5340
  agentPath(name) {
5211
- return `${ANTIGRAVITY_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
5341
+ return `${ANTIGRAVITY_GLOBAL_SKILLS_DIR}/${projectedAgentSkillDirName(name)}/SKILL.md`;
5212
5342
  }
5213
5343
  }
5214
5344
  };
@@ -5255,7 +5385,7 @@ var init_antigravity2 = __esm({
5255
5385
  ".gemini/antigravity/workflows",
5256
5386
  ".gemini/antigravity/mcp_config.json"
5257
5387
  ],
5258
- layout: global2
5388
+ layout: globalLayout4
5259
5389
  },
5260
5390
  importer: {
5261
5391
  rules: {
@@ -5296,7 +5426,8 @@ var init_antigravity2 = __esm({
5296
5426
  ".agents/rules/",
5297
5427
  ".agents/skills/",
5298
5428
  ".agents/workflows/"
5299
- ]
5429
+ ],
5430
+ conversionDefaults: { agentsToSkills: true }
5300
5431
  };
5301
5432
  }
5302
5433
  });
@@ -5628,7 +5759,7 @@ function buildSettingsContent(canonical) {
5628
5759
  if (Object.keys(settings).length === 0) return null;
5629
5760
  return JSON.stringify(settings, null, 2);
5630
5761
  }
5631
- var target5, project5, globalLayout3, capabilities3, globalCapabilities3, descriptor5;
5762
+ var target5, project5, globalLayout5, capabilities3, globalCapabilities3, descriptor5;
5632
5763
  var init_augment_code2 = __esm({
5633
5764
  "src/targets/augment-code/index.ts"() {
5634
5765
  init_generator5();
@@ -5663,7 +5794,7 @@ var init_augment_code2 = __esm({
5663
5794
  }
5664
5795
  }
5665
5796
  };
5666
- globalLayout3 = {
5797
+ globalLayout5 = {
5667
5798
  skillDir: AUGMENT_CODE_GLOBAL_SKILLS_DIR,
5668
5799
  managedOutputs: {
5669
5800
  dirs: [
@@ -5749,7 +5880,7 @@ var init_augment_code2 = __esm({
5749
5880
  AUGMENT_CODE_GLOBAL_SKILLS_DIR,
5750
5881
  AUGMENT_CODE_GLOBAL_SETTINGS_FILE
5751
5882
  ],
5752
- layout: globalLayout3
5883
+ layout: globalLayout5
5753
5884
  },
5754
5885
  emitScopedSettings(canonical) {
5755
5886
  const content = buildSettingsContent(canonical);
@@ -6149,6 +6280,19 @@ async function importClaudeSkills(projectRoot, results, normalize) {
6149
6280
  const skillDir = dirname(skillMdPath);
6150
6281
  const skillName = basename(skillDir);
6151
6282
  const destSkillDir = join(destBase, skillName);
6283
+ const skillMdContent = await readFileSafe(skillMdPath);
6284
+ if (skillMdContent === null) continue;
6285
+ const normalizedSkillMd = normalize(
6286
+ skillMdContent,
6287
+ skillMdPath,
6288
+ join(destSkillDir, "SKILL.md")
6289
+ );
6290
+ const skillMdParsed = tryParseFrontmatter(normalizedSkillMd, skillMdPath);
6291
+ if (!skillMdParsed.ok) {
6292
+ process.stderr.write(`\u26A0 skipping ${skillMdPath}: ${skillMdParsed.error.message}
6293
+ `);
6294
+ continue;
6295
+ }
6152
6296
  const skillFiles = await readDirRecursive(skillDir);
6153
6297
  for (const filePath of skillFiles) {
6154
6298
  const fileContent = await readFileSafe(filePath);
@@ -6157,13 +6301,12 @@ async function importClaudeSkills(projectRoot, results, normalize) {
6157
6301
  const destPath = join(destSkillDir, relPath);
6158
6302
  await mkdirp(dirname(destPath));
6159
6303
  const normalized = normalize(fileContent, filePath, destPath);
6160
- const parsed = relPath === "SKILL.md" ? parseFrontmatter(normalized) : null;
6161
6304
  await writeFileAtomic(
6162
6305
  destPath,
6163
6306
  relPath === "SKILL.md" ? await serializeImportedSkillWithFallback(
6164
6307
  destPath,
6165
- parsed?.frontmatter ?? {},
6166
- parsed?.body ?? ""
6308
+ skillMdParsed.value.frontmatter,
6309
+ skillMdParsed.value.body
6167
6310
  ) : normalized
6168
6311
  );
6169
6312
  const toPath = `${CLAUDE_CANONICAL_SKILLS_DIR}/${skillName}/${relPath}`;
@@ -6284,7 +6427,7 @@ var init_linter6 = __esm({
6284
6427
  });
6285
6428
 
6286
6429
  // src/targets/claude-code/index.ts
6287
- var target6, project6, global3, globalCapabilities4, descriptor6;
6430
+ var target6, project6, globalLayout6, globalCapabilities4, descriptor6;
6288
6431
  var init_claude_code2 = __esm({
6289
6432
  "src/targets/claude-code/index.ts"() {
6290
6433
  init_generator6();
@@ -6328,7 +6471,7 @@ var init_claude_code2 = __esm({
6328
6471
  }
6329
6472
  }
6330
6473
  };
6331
- global3 = {
6474
+ globalLayout6 = {
6332
6475
  rootInstructionPath: CLAUDE_ROOT,
6333
6476
  skillDir: ".claude/skills",
6334
6477
  renderPrimaryRootInstruction: renderClaudeGlobalPrimaryInstructions,
@@ -6407,7 +6550,7 @@ var init_claude_code2 = __esm({
6407
6550
  ".claude.json",
6408
6551
  ".agents/skills"
6409
6552
  ],
6410
- layout: global3,
6553
+ layout: globalLayout6,
6411
6554
  scopeExtras: generateClaudeGlobalExtras
6412
6555
  },
6413
6556
  importer: {
@@ -6941,55 +7084,117 @@ async function findDirectorySkills(skillsDir) {
6941
7084
  }
6942
7085
  return skills;
6943
7086
  }
7087
+ async function importSkillsDirectory(sourceSkillsDirs, options, recognizers = []) {
7088
+ for (const sourceDir of sourceSkillsDirs) {
7089
+ const absSkillsDir = join(options.projectRoot, sourceDir);
7090
+ const directorySkills = await findDirectorySkills(absSkillsDir);
7091
+ if (directorySkills.size === 0) continue;
7092
+ let importedAny = false;
7093
+ for (const [skillName, skillDir] of directorySkills) {
7094
+ const skillMdPath = join(skillDir, "SKILL.md");
7095
+ const rawContent = await readFileSafe(skillMdPath);
7096
+ if (rawContent === null) continue;
7097
+ importedAny = true;
7098
+ const { frontmatter, body: rawBody } = parseFrontmatter(rawContent);
7099
+ const ctx = {
7100
+ skillName,
7101
+ skillDir,
7102
+ skillMdPath,
7103
+ rawContent,
7104
+ frontmatter,
7105
+ rawBody,
7106
+ options
7107
+ };
7108
+ let handled = false;
7109
+ for (const recognizer of recognizers) {
7110
+ const claimed = await recognizer.recognize(ctx);
7111
+ if (claimed) {
7112
+ handled = true;
7113
+ break;
7114
+ }
7115
+ }
7116
+ if (!handled) {
7117
+ await importDirectorySkill(skillName, skillDir, options);
7118
+ }
7119
+ }
7120
+ if (importedAny) return;
7121
+ }
7122
+ }
7123
+ function projectedAgentRecognizer(config) {
7124
+ return {
7125
+ async recognize(ctx) {
7126
+ const projectedAgent = parseProjectedAgentSkillFrontmatter(ctx.frontmatter, ctx.skillName);
7127
+ if (!projectedAgent) return false;
7128
+ const { options } = ctx;
7129
+ await removePathIfExists(
7130
+ join(options.projectRoot, options.destCanonicalSkillsDir, ctx.skillName)
7131
+ );
7132
+ const destAgentsDir = join(options.projectRoot, config.canonicalAgentsDir);
7133
+ await mkdirp(destAgentsDir);
7134
+ const agentPath = join(destAgentsDir, `${projectedAgent.name}.md`);
7135
+ const normalizedBody = options.normalize(ctx.rawBody, ctx.skillMdPath, agentPath);
7136
+ await writeFileAtomic(agentPath, serializeImportedAgent(projectedAgent, normalizedBody));
7137
+ options.results.push({
7138
+ fromTool: options.targetName,
7139
+ fromPath: ctx.skillMdPath,
7140
+ toPath: `${config.canonicalAgentsDir}/${projectedAgent.name}.md`,
7141
+ feature: "agents"
7142
+ });
7143
+ return true;
7144
+ }
7145
+ };
7146
+ }
7147
+ function commandSkillRecognizer(config) {
7148
+ return {
7149
+ async recognize(ctx) {
7150
+ const command = parseCommandSkillFrontmatter(ctx.frontmatter, ctx.skillName);
7151
+ if (!command) return false;
7152
+ const { options } = ctx;
7153
+ await removePathIfExists(
7154
+ join(options.projectRoot, options.destCanonicalSkillsDir, ctx.skillName)
7155
+ );
7156
+ const destCommandsDir = join(options.projectRoot, config.canonicalCommandsDir);
7157
+ await mkdirp(destCommandsDir);
7158
+ const commandPath = join(destCommandsDir, `${command.name}.md`);
7159
+ const normalizedBody = options.normalize(ctx.rawBody, ctx.skillMdPath, commandPath);
7160
+ await writeFileAtomic(commandPath, serializeImportedCommand(command, normalizedBody));
7161
+ options.results.push({
7162
+ fromTool: options.targetName,
7163
+ fromPath: ctx.skillMdPath,
7164
+ toPath: `${config.canonicalCommandsDir}/${command.name}.md`,
7165
+ feature: "commands"
7166
+ });
7167
+ return true;
7168
+ }
7169
+ };
7170
+ }
6944
7171
  var init_skill_import_pipeline = __esm({
6945
7172
  "src/targets/import/shared/skill-import-pipeline.ts"() {
6946
7173
  init_fs();
6947
7174
  init_markdown();
6948
7175
  init_import_metadata();
6949
7176
  init_reserved();
7177
+ init_projected_agent_skill();
7178
+ init_command_skill();
7179
+ init_scoped_agents_import();
6950
7180
  }
6951
7181
  });
7182
+
7183
+ // src/targets/cline/skills-adapter.ts
6952
7184
  async function importClineSkills(projectRoot, results, normalize, skillsRelDir = CLINE_SKILLS_DIR) {
6953
- const skillsDir = join(projectRoot, skillsRelDir);
6954
- const directorySkills = await findDirectorySkills(skillsDir);
6955
7185
  const options = {
6956
7186
  projectRoot,
6957
- sourceSkillsDir: skillsRelDir,
6958
7187
  destCanonicalSkillsDir: CLINE_CANONICAL_SKILLS_DIR,
6959
7188
  targetName: "cline",
6960
7189
  normalize,
6961
7190
  results
6962
7191
  };
6963
- for (const [skillName, skillDir] of directorySkills) {
6964
- const skillMdPath = join(skillDir, "SKILL.md");
6965
- const content = await readFileSafe(skillMdPath);
6966
- if (!content) continue;
6967
- const rawParsed = parseFrontmatter(content);
6968
- const projectedAgent = parseProjectedAgentSkillFrontmatter(rawParsed.frontmatter, skillName);
6969
- if (projectedAgent) {
6970
- const destAgentsDir = join(projectRoot, CLINE_CANONICAL_AGENTS_DIR);
6971
- await mkdirp(destAgentsDir);
6972
- const agentPath = join(destAgentsDir, `${projectedAgent.name}.md`);
6973
- await writeFileAtomic(
6974
- agentPath,
6975
- serializeImportedAgent(projectedAgent, normalize(rawParsed.body, skillMdPath, agentPath))
6976
- );
6977
- results.push({
6978
- fromTool: "cline",
6979
- fromPath: skillMdPath,
6980
- toPath: `${CLINE_CANONICAL_AGENTS_DIR}/${projectedAgent.name}.md`,
6981
- feature: "agents"
6982
- });
6983
- continue;
6984
- }
6985
- await importDirectorySkill(skillName, skillDir, options);
6986
- }
7192
+ await importSkillsDirectory([skillsRelDir], options, [
7193
+ projectedAgentRecognizer({ canonicalAgentsDir: CLINE_CANONICAL_AGENTS_DIR })
7194
+ ]);
6987
7195
  }
6988
7196
  var init_skills_adapter = __esm({
6989
7197
  "src/targets/cline/skills-adapter.ts"() {
6990
- init_fs();
6991
- init_markdown();
6992
- init_projected_agent_skill();
6993
7198
  init_skill_import_pipeline();
6994
7199
  init_constants8();
6995
7200
  }
@@ -7135,7 +7340,7 @@ var init_lint4 = __esm({
7135
7340
  });
7136
7341
 
7137
7342
  // src/targets/cline/index.ts
7138
- var target7, project7, globalLayout4, globalCapabilities5, descriptor7;
7343
+ var target7, project7, globalLayout7, globalCapabilities5, descriptor7;
7139
7344
  var init_cline2 = __esm({
7140
7345
  "src/targets/cline/index.ts"() {
7141
7346
  init_generator7();
@@ -7183,7 +7388,7 @@ var init_cline2 = __esm({
7183
7388
  }
7184
7389
  }
7185
7390
  };
7186
- globalLayout4 = {
7391
+ globalLayout7 = {
7187
7392
  skillDir: CLINE_SKILLS_DIR,
7188
7393
  managedOutputs: {
7189
7394
  dirs: [
@@ -7275,10 +7480,11 @@ var init_cline2 = __esm({
7275
7480
  CLINE_MCP_SETTINGS,
7276
7481
  CLINE_IGNORE
7277
7482
  ],
7278
- layout: globalLayout4
7483
+ layout: globalLayout7
7279
7484
  },
7280
7485
  buildImportPaths: buildClineImportPaths,
7281
- detectionPaths: [".clinerules", ".cline"]
7486
+ detectionPaths: [".clinerules", ".cline"],
7487
+ conversionDefaults: { agentsToSkills: true }
7282
7488
  };
7283
7489
  }
7284
7490
  });
@@ -7652,82 +7858,23 @@ var init_mcp_helpers = __esm({
7652
7858
  init_constants28();
7653
7859
  }
7654
7860
  });
7861
+
7862
+ // src/targets/codex-cli/skills-adapter.ts
7655
7863
  async function importSkills(projectRoot, results, normalize) {
7656
7864
  const options = {
7657
7865
  projectRoot,
7658
- sourceSkillsDir: CODEX_SKILLS_DIR,
7659
7866
  destCanonicalSkillsDir: CODEX_CANONICAL_SKILLS_DIR,
7660
7867
  targetName: CODEX_TARGET,
7661
7868
  normalize,
7662
7869
  results
7663
7870
  };
7664
- for (const skillsRoot of [CODEX_SKILLS_DIR, CODEX_SKILLS_FALLBACK_DIR]) {
7665
- const skillsDir = join(projectRoot, skillsRoot);
7666
- const entries = await readdir(skillsDir, {
7667
- encoding: "utf8",
7668
- withFileTypes: true
7669
- }).catch(() => null);
7670
- if (entries === null) continue;
7671
- let importedAny = false;
7672
- for (const ent of entries) {
7673
- if (!ent.isDirectory() && !ent.isSymbolicLink()) continue;
7674
- const skillPath = join(skillsDir, ent.name);
7675
- const skillMdPath = join(skillPath, "SKILL.md");
7676
- const skillMdContent = await readFileSafe(skillMdPath);
7677
- if (!skillMdContent) continue;
7678
- importedAny = true;
7679
- const skillName = ent.name;
7680
- const destSkillPath = join(projectRoot, CODEX_CANONICAL_SKILLS_DIR, skillName, "SKILL.md");
7681
- const normalized = normalize(skillMdContent, skillMdPath, destSkillPath);
7682
- const { frontmatter, body } = parseFrontmatter(normalized);
7683
- const command = parseCommandSkillFrontmatter(frontmatter, ent.name);
7684
- if (command) {
7685
- await removePathIfExists(join(projectRoot, CODEX_CANONICAL_SKILLS_DIR, skillName));
7686
- const destCommandsDir = join(projectRoot, CODEX_CANONICAL_COMMANDS_DIR);
7687
- await mkdirp(destCommandsDir);
7688
- const commandPath = join(destCommandsDir, `${command.name}.md`);
7689
- await writeFileAtomic(
7690
- commandPath,
7691
- serializeImportedCommand(command, normalize(body, skillMdPath, commandPath))
7692
- );
7693
- results.push({
7694
- fromTool: CODEX_TARGET,
7695
- fromPath: skillMdPath,
7696
- toPath: `${CODEX_CANONICAL_COMMANDS_DIR}/${command.name}.md`,
7697
- feature: "commands"
7698
- });
7699
- continue;
7700
- }
7701
- const projectedAgent = parseProjectedAgentSkillFrontmatter(frontmatter, ent.name);
7702
- if (projectedAgent) {
7703
- await removePathIfExists(join(projectRoot, CODEX_CANONICAL_SKILLS_DIR, skillName));
7704
- const destAgentsDir = join(projectRoot, CODEX_CANONICAL_AGENTS_DIR);
7705
- await mkdirp(destAgentsDir);
7706
- const agentPath = join(destAgentsDir, `${projectedAgent.name}.md`);
7707
- await writeFileAtomic(
7708
- agentPath,
7709
- serializeImportedAgent(projectedAgent, normalize(body, skillMdPath, agentPath))
7710
- );
7711
- results.push({
7712
- fromTool: CODEX_TARGET,
7713
- fromPath: skillMdPath,
7714
- toPath: `${CODEX_CANONICAL_AGENTS_DIR}/${projectedAgent.name}.md`,
7715
- feature: "agents"
7716
- });
7717
- continue;
7718
- }
7719
- await importDirectorySkill(skillName, skillPath, options);
7720
- }
7721
- if (importedAny) return;
7722
- }
7871
+ await importSkillsDirectory([CODEX_SKILLS_DIR, CODEX_SKILLS_FALLBACK_DIR], options, [
7872
+ commandSkillRecognizer({ canonicalCommandsDir: CODEX_CANONICAL_COMMANDS_DIR }),
7873
+ projectedAgentRecognizer({ canonicalAgentsDir: CODEX_CANONICAL_AGENTS_DIR })
7874
+ ]);
7723
7875
  }
7724
7876
  var init_skills_adapter2 = __esm({
7725
7877
  "src/targets/codex-cli/skills-adapter.ts"() {
7726
- init_fs();
7727
- init_markdown();
7728
- init_command_skill();
7729
- init_projected_agent_skill();
7730
- init_scoped_agents_import();
7731
7878
  init_skill_import_pipeline();
7732
7879
  init_constants28();
7733
7880
  }
@@ -8117,7 +8264,7 @@ var init_codex_rule_paths = __esm({
8117
8264
  init_instruction_mirror();
8118
8265
  }
8119
8266
  });
8120
- var target8, project8, global4, globalCapabilities6, descriptor8;
8267
+ var target8, project8, globalLayout8, globalCapabilities6, descriptor8;
8121
8268
  var init_codex_cli2 = __esm({
8122
8269
  "src/targets/codex-cli/index.ts"() {
8123
8270
  init_generator9();
@@ -8163,7 +8310,7 @@ var init_codex_cli2 = __esm({
8163
8310
  }
8164
8311
  }
8165
8312
  };
8166
- global4 = {
8313
+ globalLayout8 = {
8167
8314
  rootInstructionPath: CODEX_GLOBAL_AGENTS_MD,
8168
8315
  renderPrimaryRootInstruction: renderCodexGlobalInstructions,
8169
8316
  extraRuleOutputPaths(rule) {
@@ -8241,7 +8388,7 @@ var init_codex_cli2 = __esm({
8241
8388
  ".codex/rules",
8242
8389
  ".agents/skills"
8243
8390
  ],
8244
- layout: global4
8391
+ layout: globalLayout8
8245
8392
  },
8246
8393
  buildImportPaths: buildCodexCliImportPaths,
8247
8394
  sharedArtifacts: {
@@ -8254,7 +8401,9 @@ var init_codex_cli2 = __esm({
8254
8401
  ".codex/config.toml",
8255
8402
  ".codex/agents",
8256
8403
  ".codex/rules"
8257
- ]
8404
+ ],
8405
+ excludeFromStarterInit: true,
8406
+ conversionDefaults: { commandsToSkills: true, agentsToSkills: false }
8258
8407
  };
8259
8408
  }
8260
8409
  });
@@ -8617,7 +8766,7 @@ var init_scope_extras = __esm({
8617
8766
  });
8618
8767
 
8619
8768
  // src/targets/continue/index.ts
8620
- var target9, project9, globalLayout5, globalCapabilities7, descriptor9;
8769
+ var target9, project9, globalLayout9, globalCapabilities7, descriptor9;
8621
8770
  var init_continue2 = __esm({
8622
8771
  "src/targets/continue/index.ts"() {
8623
8772
  init_projected_agent_skill();
@@ -8659,7 +8808,7 @@ var init_continue2 = __esm({
8659
8808
  }
8660
8809
  }
8661
8810
  };
8662
- globalLayout5 = {
8811
+ globalLayout9 = {
8663
8812
  rootInstructionPath: CONTINUE_ROOT_RULE,
8664
8813
  outputFamilies: [
8665
8814
  { id: "compat-agents", kind: "additional", explicitPaths: [CONTINUE_GLOBAL_AGENTS_MD] }
@@ -8733,7 +8882,7 @@ var init_continue2 = __esm({
8733
8882
  ".continue/mcpServers",
8734
8883
  CONTINUE_SKILLS_DIR
8735
8884
  ],
8736
- layout: globalLayout5,
8885
+ layout: globalLayout9,
8737
8886
  scopeExtras: generateContinueScopeExtras
8738
8887
  },
8739
8888
  importer: {
@@ -8755,7 +8904,8 @@ var init_continue2 = __esm({
8755
8904
  }
8756
8905
  },
8757
8906
  buildImportPaths: buildContinueImportPaths,
8758
- detectionPaths: [".continue/rules", ".continue/skills", ".continue/mcpServers"]
8907
+ detectionPaths: [".continue/rules", ".continue/skills", ".continue/mcpServers"],
8908
+ conversionDefaults: { agentsToSkills: true }
8759
8909
  };
8760
8910
  }
8761
8911
  });
@@ -9081,7 +9231,6 @@ async function importSkills2(projectRoot, results, normalize, skillsDirRel = COP
9081
9231
  const directorySkills = await findDirectorySkills(skillsDir);
9082
9232
  const options = {
9083
9233
  projectRoot,
9084
- sourceSkillsDir: skillsDirRel,
9085
9234
  destCanonicalSkillsDir: COPILOT_CANONICAL_SKILLS_DIR,
9086
9235
  targetName: COPILOT_TARGET,
9087
9236
  normalize,
@@ -9406,7 +9555,7 @@ var init_scope_extras2 = __esm({
9406
9555
  };
9407
9556
  }
9408
9557
  });
9409
- var target10, project10, global5, globalCapabilities8, descriptor10;
9558
+ var target10, project10, globalLayout10, globalCapabilities8, descriptor10;
9410
9559
  var init_copilot2 = __esm({
9411
9560
  "src/targets/copilot/index.ts"() {
9412
9561
  init_generator11();
@@ -9460,7 +9609,7 @@ var init_copilot2 = __esm({
9460
9609
  }
9461
9610
  }
9462
9611
  };
9463
- global5 = {
9612
+ globalLayout10 = {
9464
9613
  rootInstructionPath: COPILOT_GLOBAL_INSTRUCTIONS,
9465
9614
  renderPrimaryRootInstruction: renderCopilotGlobalInstructions,
9466
9615
  outputFamilies: [
@@ -9566,7 +9715,7 @@ var init_copilot2 = __esm({
9566
9715
  COPILOT_GLOBAL_PROMPTS_DIR,
9567
9716
  COPILOT_GLOBAL_AGENTS_SKILLS_DIR
9568
9717
  ],
9569
- layout: global5,
9718
+ layout: globalLayout10,
9570
9719
  scopeExtras: generateCopilotGlobalExtras
9571
9720
  },
9572
9721
  importer: {
@@ -9935,7 +10084,7 @@ var init_settings = __esm({
9935
10084
  });
9936
10085
 
9937
10086
  // src/targets/crush/index.ts
9938
- var target11, project11, globalLayout6, capabilities4, globalCapabilities9, descriptor11;
10087
+ var target11, project11, globalLayout11, capabilities4, globalCapabilities9, descriptor11;
9939
10088
  var init_crush2 = __esm({
9940
10089
  "src/targets/crush/index.ts"() {
9941
10090
  init_command_skill();
@@ -9980,7 +10129,7 @@ var init_crush2 = __esm({
9980
10129
  }
9981
10130
  }
9982
10131
  };
9983
- globalLayout6 = {
10132
+ globalLayout11 = {
9984
10133
  rootInstructionPath: CRUSH_GLOBAL_ROOT_FILE,
9985
10134
  skillDir: CRUSH_GLOBAL_SKILLS_DIR,
9986
10135
  managedOutputs: {
@@ -10053,7 +10202,7 @@ var init_crush2 = __esm({
10053
10202
  globalSupport: {
10054
10203
  capabilities: globalCapabilities9,
10055
10204
  detectionPaths: [CRUSH_GLOBAL_ROOT_FILE, CRUSH_GLOBAL_CONFIG_FILE, CRUSH_GLOBAL_SKILLS_DIR],
10056
- layout: globalLayout6
10205
+ layout: globalLayout11
10057
10206
  },
10058
10207
  mergeGeneratedOutputContent(existing, pending, newContent, resolvedPath) {
10059
10208
  const base = pending?.content ?? existing;
@@ -10600,7 +10749,6 @@ async function importSkills3(projectRoot, results, normalize, skillsRelDir = CUR
10600
10749
  const directorySkills = await findDirectorySkills(skillsDir);
10601
10750
  const options = {
10602
10751
  projectRoot,
10603
- sourceSkillsDir: skillsRelDir,
10604
10752
  destCanonicalSkillsDir: CURSOR_CANONICAL_SKILLS_DIR,
10605
10753
  targetName: "cursor",
10606
10754
  normalize,
@@ -10636,20 +10784,20 @@ async function hasGlobalCursorArtifacts(projectRoot) {
10636
10784
  const candidates = [
10637
10785
  join(projectRoot, CURSOR_DOT_CURSOR_AGENTS),
10638
10786
  join(projectRoot, CURSOR_GLOBAL_USER_RULES),
10639
- join(projectRoot, CURSOR_GLOBAL_MCP_EXPORT),
10787
+ join(projectRoot, CURSOR_MCP),
10640
10788
  join(projectRoot, CURSOR_HOOKS),
10641
10789
  join(projectRoot, CURSOR_IGNORE),
10642
- join(projectRoot, CURSOR_GLOBAL_SKILLS_DIR),
10643
- join(projectRoot, CURSOR_GLOBAL_AGENTS_DIR),
10790
+ join(projectRoot, CURSOR_SKILLS_DIR),
10791
+ join(projectRoot, CURSOR_AGENTS_DIR),
10644
10792
  join(projectRoot, CURSOR_COMMANDS_DIR)
10645
10793
  ];
10646
10794
  for (const p of candidates) {
10647
10795
  const stat5 = await readFileSafe(p);
10648
10796
  if (stat5 !== null && stat5.trim() !== "") return true;
10649
10797
  }
10650
- const skillFiles = await readDirRecursive(join(projectRoot, CURSOR_GLOBAL_SKILLS_DIR));
10798
+ const skillFiles = await readDirRecursive(join(projectRoot, CURSOR_SKILLS_DIR));
10651
10799
  if (skillFiles.some((f) => f.endsWith(".md"))) return true;
10652
- const agentFiles = await readDirRecursive(join(projectRoot, CURSOR_GLOBAL_AGENTS_DIR));
10800
+ const agentFiles = await readDirRecursive(join(projectRoot, CURSOR_AGENTS_DIR));
10653
10801
  if (agentFiles.some((f) => f.endsWith(".md"))) return true;
10654
10802
  const commandFiles = await readDirRecursive(join(projectRoot, CURSOR_COMMANDS_DIR));
10655
10803
  if (commandFiles.some((f) => f.endsWith(".md"))) return true;
@@ -10706,7 +10854,7 @@ async function importGlobalDotCursorAgents(projectRoot, results, normalize) {
10706
10854
  });
10707
10855
  }
10708
10856
  async function importGlobalMcp(projectRoot, results) {
10709
- const mcpPath = join(projectRoot, CURSOR_GLOBAL_MCP_EXPORT);
10857
+ const mcpPath = join(projectRoot, CURSOR_MCP);
10710
10858
  const content = await readFileSafe(mcpPath);
10711
10859
  if (content === null || content.trim() === "") return;
10712
10860
  let parsed;
@@ -10727,7 +10875,7 @@ async function importGlobalMcp(projectRoot, results) {
10727
10875
  });
10728
10876
  }
10729
10877
  async function importGlobalAgents(projectRoot, results, normalize) {
10730
- const agentsDir = join(projectRoot, CURSOR_GLOBAL_AGENTS_DIR);
10878
+ const agentsDir = join(projectRoot, CURSOR_AGENTS_DIR);
10731
10879
  const destDir = join(projectRoot, CURSOR_CANONICAL_AGENTS_DIR);
10732
10880
  results.push(
10733
10881
  ...await importFileDirectory({
@@ -10776,7 +10924,7 @@ async function importFromCursorGlobalExports(projectRoot) {
10776
10924
  if (!rootWritten) rootWritten = await importGlobalUserRules(projectRoot, results, normalize);
10777
10925
  if (!rootWritten) await importGlobalDotCursorAgents(projectRoot, results, normalize);
10778
10926
  await importGlobalMcp(projectRoot, results);
10779
- await importSkills3(projectRoot, results, normalize, CURSOR_GLOBAL_SKILLS_DIR);
10927
+ await importSkills3(projectRoot, results, normalize, CURSOR_SKILLS_DIR);
10780
10928
  await importGlobalAgents(projectRoot, results, normalize);
10781
10929
  await importGlobalCommands(projectRoot, results, normalize);
10782
10930
  await importSettings2(projectRoot, results);
@@ -10950,7 +11098,7 @@ var init_lint9 = __esm({
10950
11098
  });
10951
11099
 
10952
11100
  // src/targets/cursor/index.ts
10953
- var target12, project12, global6, globalCapabilities10, descriptor12;
11101
+ var target12, project12, globalLayout12, globalCapabilities10, descriptor12;
10954
11102
  var init_cursor2 = __esm({
10955
11103
  "src/targets/cursor/index.ts"() {
10956
11104
  init_generator14();
@@ -11000,7 +11148,7 @@ var init_cursor2 = __esm({
11000
11148
  }
11001
11149
  }
11002
11150
  };
11003
- global6 = {
11151
+ globalLayout12 = {
11004
11152
  rootInstructionPath: CURSOR_GENERAL_RULE,
11005
11153
  outputFamilies: [
11006
11154
  {
@@ -11009,18 +11157,13 @@ var init_cursor2 = __esm({
11009
11157
  explicitPaths: [CURSOR_COMPAT_AGENTS, CURSOR_DOT_CURSOR_AGENTS]
11010
11158
  }
11011
11159
  ],
11012
- skillDir: CURSOR_GLOBAL_SKILLS_DIR,
11160
+ skillDir: CURSOR_SKILLS_DIR,
11013
11161
  managedOutputs: {
11014
- dirs: [
11015
- CURSOR_RULES_DIR,
11016
- CURSOR_COMMANDS_DIR,
11017
- CURSOR_GLOBAL_AGENTS_DIR,
11018
- CURSOR_GLOBAL_SKILLS_DIR
11019
- ],
11162
+ dirs: [CURSOR_RULES_DIR, CURSOR_COMMANDS_DIR, CURSOR_AGENTS_DIR, CURSOR_SKILLS_DIR],
11020
11163
  files: [
11021
11164
  CURSOR_GENERAL_RULE,
11022
11165
  CURSOR_DOT_CURSOR_AGENTS,
11023
- CURSOR_GLOBAL_MCP_EXPORT,
11166
+ CURSOR_MCP,
11024
11167
  CURSOR_HOOKS,
11025
11168
  CURSOR_IGNORE,
11026
11169
  CURSOR_GLOBAL_USER_RULES
@@ -11049,7 +11192,7 @@ var init_cursor2 = __esm({
11049
11192
  return `${CURSOR_COMMANDS_DIR}/${name}.md`;
11050
11193
  },
11051
11194
  agentPath(name, _config) {
11052
- return `${CURSOR_GLOBAL_AGENTS_DIR}/${name}.md`;
11195
+ return `${CURSOR_AGENTS_DIR}/${name}.md`;
11053
11196
  }
11054
11197
  }
11055
11198
  };
@@ -11101,11 +11244,11 @@ var init_cursor2 = __esm({
11101
11244
  CURSOR_HOOKS,
11102
11245
  CURSOR_IGNORE,
11103
11246
  CURSOR_SKILLS_DIR,
11104
- CURSOR_GLOBAL_AGENTS_DIR,
11247
+ CURSOR_AGENTS_DIR,
11105
11248
  CURSOR_COMMANDS_DIR,
11106
11249
  CURSOR_GLOBAL_USER_RULES
11107
11250
  ],
11108
- layout: global6
11251
+ layout: globalLayout12
11109
11252
  },
11110
11253
  importer: {
11111
11254
  // Project-only declarable features. Rules/mcp/skills/settings/ignore stay
@@ -11264,7 +11407,7 @@ var init_lint10 = __esm({
11264
11407
  });
11265
11408
 
11266
11409
  // src/targets/deepagents-cli/index.ts
11267
- var target13, project13, globalLayout7, capabilities5, globalCapabilities11, descriptor13;
11410
+ var target13, project13, globalLayout13, capabilities5, globalCapabilities11, descriptor13;
11268
11411
  var init_deepagents_cli2 = __esm({
11269
11412
  "src/targets/deepagents-cli/index.ts"() {
11270
11413
  init_command_skill();
@@ -11304,7 +11447,7 @@ var init_deepagents_cli2 = __esm({
11304
11447
  }
11305
11448
  }
11306
11449
  };
11307
- globalLayout7 = {
11450
+ globalLayout13 = {
11308
11451
  rootInstructionPath: DEEPAGENTS_CLI_GLOBAL_ROOT_FILE,
11309
11452
  skillDir: DEEPAGENTS_CLI_GLOBAL_SKILLS_DIR,
11310
11453
  managedOutputs: {
@@ -11375,7 +11518,7 @@ var init_deepagents_cli2 = __esm({
11375
11518
  globalSupport: {
11376
11519
  capabilities: globalCapabilities11,
11377
11520
  detectionPaths: [DEEPAGENTS_CLI_GLOBAL_ROOT_FILE, DEEPAGENTS_CLI_GLOBAL_MCP_FILE],
11378
- layout: globalLayout7
11521
+ layout: globalLayout13
11379
11522
  },
11380
11523
  importer: {
11381
11524
  rules: {
@@ -11597,7 +11740,7 @@ var init_lint11 = __esm({
11597
11740
  });
11598
11741
 
11599
11742
  // src/targets/factory-droid/index.ts
11600
- var target14, project14, globalLayout8, capabilities6, descriptor14;
11743
+ var target14, project14, globalLayout14, capabilities6, descriptor14;
11601
11744
  var init_factory_droid2 = __esm({
11602
11745
  "src/targets/factory-droid/index.ts"() {
11603
11746
  init_generator16();
@@ -11636,7 +11779,7 @@ var init_factory_droid2 = __esm({
11636
11779
  }
11637
11780
  }
11638
11781
  };
11639
- globalLayout8 = {
11782
+ globalLayout14 = {
11640
11783
  rootInstructionPath: FACTORY_DROID_GLOBAL_ROOT_FILE,
11641
11784
  skillDir: FACTORY_DROID_GLOBAL_SKILLS_DIR,
11642
11785
  managedOutputs: {
@@ -11703,7 +11846,7 @@ var init_factory_droid2 = __esm({
11703
11846
  FACTORY_DROID_GLOBAL_MCP_FILE,
11704
11847
  FACTORY_DROID_GLOBAL_DROIDS_DIR
11705
11848
  ],
11706
- layout: globalLayout8
11849
+ layout: globalLayout14
11707
11850
  },
11708
11851
  importer: {
11709
11852
  rules: {
@@ -12646,7 +12789,7 @@ var init_scoped_settings_emit = __esm({
12646
12789
  });
12647
12790
 
12648
12791
  // src/targets/gemini-cli/index.ts
12649
- var target15, project15, global7, globalCapabilities12, descriptor15;
12792
+ var target15, project15, globalLayout15, globalCapabilities12, descriptor15;
12650
12793
  var init_gemini_cli2 = __esm({
12651
12794
  "src/targets/gemini-cli/index.ts"() {
12652
12795
  init_generator18();
@@ -12716,7 +12859,7 @@ var init_gemini_cli2 = __esm({
12716
12859
  }
12717
12860
  }
12718
12861
  };
12719
- global7 = {
12862
+ globalLayout15 = {
12720
12863
  rootInstructionPath: GEMINI_GLOBAL_ROOT,
12721
12864
  outputFamilies: [
12722
12865
  { id: "compat-agents", kind: "additional", explicitPaths: [GEMINI_GLOBAL_COMPAT_AGENTS] }
@@ -12827,7 +12970,7 @@ var init_gemini_cli2 = __esm({
12827
12970
  GEMINI_GLOBAL_SKILLS_DIR,
12828
12971
  GEMINI_GLOBAL_AGENTS_DIR
12829
12972
  ],
12830
- layout: global7
12973
+ layout: globalLayout15
12831
12974
  },
12832
12975
  importer: {
12833
12976
  rules: {
@@ -12848,7 +12991,8 @@ var init_gemini_cli2 = __esm({
12848
12991
  }
12849
12992
  },
12850
12993
  buildImportPaths: buildGeminiCliImportPaths,
12851
- detectionPaths: ["GEMINI.md", ".gemini"]
12994
+ detectionPaths: ["GEMINI.md", ".gemini"],
12995
+ conversionDefaults: { agentsToSkills: false }
12852
12996
  };
12853
12997
  }
12854
12998
  });
@@ -12975,7 +13119,7 @@ var init_lint13 = __esm({
12975
13119
  });
12976
13120
 
12977
13121
  // src/targets/goose/index.ts
12978
- var target16, project16, globalLayout9, capabilities7, descriptor16;
13122
+ var target16, project16, globalLayout16, capabilities7, descriptor16;
12979
13123
  var init_goose2 = __esm({
12980
13124
  "src/targets/goose/index.ts"() {
12981
13125
  init_command_skill();
@@ -13016,7 +13160,7 @@ var init_goose2 = __esm({
13016
13160
  }
13017
13161
  }
13018
13162
  };
13019
- globalLayout9 = {
13163
+ globalLayout16 = {
13020
13164
  rootInstructionPath: GOOSE_GLOBAL_ROOT_FILE,
13021
13165
  skillDir: GOOSE_GLOBAL_SKILLS_DIR,
13022
13166
  managedOutputs: {
@@ -13026,9 +13170,6 @@ var init_goose2 = __esm({
13026
13170
  rewriteGeneratedPath(path) {
13027
13171
  if (path === GOOSE_ROOT_FILE) return GOOSE_GLOBAL_ROOT_FILE;
13028
13172
  if (path === GOOSE_IGNORE) return GOOSE_GLOBAL_IGNORE;
13029
- if (path.startsWith(`${GOOSE_SKILLS_DIR}/`)) {
13030
- return path;
13031
- }
13032
13173
  return path;
13033
13174
  },
13034
13175
  mirrorGlobalPath(path, activeTargets) {
@@ -13079,7 +13220,7 @@ var init_goose2 = __esm({
13079
13220
  globalSupport: {
13080
13221
  capabilities: capabilities7,
13081
13222
  detectionPaths: [GOOSE_GLOBAL_ROOT_FILE, GOOSE_GLOBAL_IGNORE, GOOSE_GLOBAL_SKILLS_DIR],
13082
- layout: globalLayout9
13223
+ layout: globalLayout16
13083
13224
  },
13084
13225
  importer: {
13085
13226
  rules: {
@@ -13108,7 +13249,8 @@ var init_goose2 = __esm({
13108
13249
  ".agents/skills/": "consumer"
13109
13250
  },
13110
13251
  buildImportPaths: buildGooseImportPaths,
13111
- detectionPaths: [GOOSE_ROOT_FILE, GOOSE_IGNORE]
13252
+ detectionPaths: [GOOSE_ROOT_FILE, GOOSE_IGNORE],
13253
+ conversionDefaults: { commandsToSkills: true, agentsToSkills: true }
13112
13254
  };
13113
13255
  }
13114
13256
  });
@@ -13504,7 +13646,7 @@ var init_lint15 = __esm({
13504
13646
  });
13505
13647
 
13506
13648
  // src/targets/junie/index.ts
13507
- var target18, project18, global8, globalCapabilities13, descriptor18;
13649
+ var target18, project18, globalLayout17, globalCapabilities13, descriptor18;
13508
13650
  var init_junie2 = __esm({
13509
13651
  "src/targets/junie/index.ts"() {
13510
13652
  init_generator21();
@@ -13544,7 +13686,7 @@ var init_junie2 = __esm({
13544
13686
  }
13545
13687
  }
13546
13688
  };
13547
- global8 = {
13689
+ globalLayout17 = {
13548
13690
  rootInstructionPath: JUNIE_GLOBAL_AGENTS_MD,
13549
13691
  renderPrimaryRootInstruction: renderJunieGlobalInstructions,
13550
13692
  skillDir: JUNIE_GLOBAL_SKILLS_DIR,
@@ -13642,7 +13784,7 @@ var init_junie2 = __esm({
13642
13784
  JUNIE_GLOBAL_COMMANDS_DIR,
13643
13785
  JUNIE_GLOBAL_MCP_FILE
13644
13786
  ],
13645
- layout: global8
13787
+ layout: globalLayout17
13646
13788
  },
13647
13789
  importer: {
13648
13790
  rules: {
@@ -14039,7 +14181,7 @@ var init_lint16 = __esm({
14039
14181
  });
14040
14182
 
14041
14183
  // src/targets/kilo-code/index.ts
14042
- var target19, project19, globalLayout10, capabilities9, descriptor19;
14184
+ var target19, project19, globalLayout18, capabilities9, descriptor19;
14043
14185
  var init_kilo_code2 = __esm({
14044
14186
  "src/targets/kilo-code/index.ts"() {
14045
14187
  init_generator22();
@@ -14080,7 +14222,7 @@ var init_kilo_code2 = __esm({
14080
14222
  }
14081
14223
  }
14082
14224
  };
14083
- globalLayout10 = {
14225
+ globalLayout18 = {
14084
14226
  rootInstructionPath: KILO_CODE_GLOBAL_AGENTS_MD,
14085
14227
  skillDir: KILO_CODE_GLOBAL_SKILLS_DIR,
14086
14228
  managedOutputs: {
@@ -14151,7 +14293,7 @@ var init_kilo_code2 = __esm({
14151
14293
  KILO_CODE_GLOBAL_MCP_FILE,
14152
14294
  KILO_CODE_GLOBAL_IGNORE
14153
14295
  ],
14154
- layout: globalLayout10
14296
+ layout: globalLayout18
14155
14297
  },
14156
14298
  importer: {
14157
14299
  rules: [
@@ -14561,7 +14703,7 @@ var init_lint17 = __esm({
14561
14703
  });
14562
14704
 
14563
14705
  // src/targets/kiro/index.ts
14564
- var target20, project20, global9, globalCapabilities14, descriptor20;
14706
+ var target20, project20, globalLayout19, globalCapabilities14, descriptor20;
14565
14707
  var init_kiro2 = __esm({
14566
14708
  "src/targets/kiro/index.ts"() {
14567
14709
  init_command_skill();
@@ -14603,7 +14745,7 @@ var init_kiro2 = __esm({
14603
14745
  }
14604
14746
  }
14605
14747
  };
14606
- global9 = {
14748
+ globalLayout19 = {
14607
14749
  rootInstructionPath: KIRO_GLOBAL_STEERING_AGENTS_MD,
14608
14750
  skillDir: KIRO_GLOBAL_SKILLS_DIR,
14609
14751
  managedOutputs: {
@@ -14702,7 +14844,7 @@ var init_kiro2 = __esm({
14702
14844
  KIRO_GLOBAL_MCP_FILE,
14703
14845
  KIRO_GLOBAL_IGNORE
14704
14846
  ],
14705
- layout: global9
14847
+ layout: globalLayout19
14706
14848
  },
14707
14849
  importer: {
14708
14850
  agents: {
@@ -14736,7 +14878,8 @@ var init_kiro2 = __esm({
14736
14878
  KIRO_HOOKS_DIR,
14737
14879
  KIRO_MCP_FILE,
14738
14880
  KIRO_IGNORE
14739
- ]
14881
+ ],
14882
+ conversionDefaults: { commandsToSkills: true }
14740
14883
  };
14741
14884
  }
14742
14885
  });
@@ -15035,7 +15178,7 @@ var init_lint18 = __esm({
15035
15178
  });
15036
15179
 
15037
15180
  // src/targets/opencode/index.ts
15038
- var target21, project21, globalLayout11, capabilities10, descriptor21;
15181
+ var target21, project21, globalLayout20, capabilities10, descriptor21;
15039
15182
  var init_opencode2 = __esm({
15040
15183
  "src/targets/opencode/index.ts"() {
15041
15184
  init_generator24();
@@ -15075,7 +15218,7 @@ var init_opencode2 = __esm({
15075
15218
  }
15076
15219
  }
15077
15220
  };
15078
- globalLayout11 = {
15221
+ globalLayout20 = {
15079
15222
  rootInstructionPath: OPENCODE_GLOBAL_AGENTS_MD,
15080
15223
  skillDir: OPENCODE_GLOBAL_SKILLS_DIR,
15081
15224
  managedOutputs: {
@@ -15147,7 +15290,7 @@ var init_opencode2 = __esm({
15147
15290
  OPENCODE_GLOBAL_SKILLS_DIR,
15148
15291
  OPENCODE_GLOBAL_CONFIG_FILE
15149
15292
  ],
15150
- layout: globalLayout11
15293
+ layout: globalLayout20
15151
15294
  },
15152
15295
  importer: {
15153
15296
  rules: [
@@ -15340,7 +15483,7 @@ var init_lint19 = __esm({
15340
15483
  });
15341
15484
 
15342
15485
  // src/targets/pi-agent/index.ts
15343
- var target22, project22, globalLayout12, capabilities11, descriptor22;
15486
+ var target22, project22, globalLayout21, capabilities11, descriptor22;
15344
15487
  var init_pi_agent2 = __esm({
15345
15488
  "src/targets/pi-agent/index.ts"() {
15346
15489
  init_command_skill();
@@ -15380,7 +15523,7 @@ var init_pi_agent2 = __esm({
15380
15523
  }
15381
15524
  }
15382
15525
  };
15383
- globalLayout12 = {
15526
+ globalLayout21 = {
15384
15527
  rootInstructionPath: PI_AGENT_GLOBAL_ROOT_FILE,
15385
15528
  skillDir: PI_AGENT_GLOBAL_SKILLS_DIR,
15386
15529
  managedOutputs: {
@@ -15443,7 +15586,7 @@ var init_pi_agent2 = __esm({
15443
15586
  globalSupport: {
15444
15587
  capabilities: capabilities11,
15445
15588
  detectionPaths: [PI_AGENT_GLOBAL_ROOT_FILE],
15446
- layout: globalLayout12
15589
+ layout: globalLayout21
15447
15590
  },
15448
15591
  importer: {
15449
15592
  rules: {
@@ -15589,7 +15732,7 @@ var init_linter23 = __esm({
15589
15732
  });
15590
15733
 
15591
15734
  // src/targets/qwen-code/index.ts
15592
- var target23, project23, globalLayout13, capabilities12, globalCapabilities15, descriptor23;
15735
+ var target23, project23, globalLayout22, capabilities12, globalCapabilities15, descriptor23;
15593
15736
  var init_qwen_code2 = __esm({
15594
15737
  "src/targets/qwen-code/index.ts"() {
15595
15738
  init_generator26();
@@ -15628,7 +15771,7 @@ var init_qwen_code2 = __esm({
15628
15771
  }
15629
15772
  }
15630
15773
  };
15631
- globalLayout13 = {
15774
+ globalLayout22 = {
15632
15775
  rootInstructionPath: QWEN_GLOBAL_ROOT,
15633
15776
  skillDir: QWEN_GLOBAL_SKILLS_DIR,
15634
15777
  managedOutputs: {
@@ -15709,7 +15852,7 @@ var init_qwen_code2 = __esm({
15709
15852
  QWEN_GLOBAL_AGENTS_DIR,
15710
15853
  QWEN_GLOBAL_SKILLS_DIR
15711
15854
  ],
15712
- layout: globalLayout13
15855
+ layout: globalLayout22
15713
15856
  },
15714
15857
  importer: {
15715
15858
  rules: [
@@ -16198,7 +16341,7 @@ function computeStatus5(existing, content) {
16198
16341
  if (existing !== content) return "updated";
16199
16342
  return "unchanged";
16200
16343
  }
16201
- var target25, project25, generateRooGlobalExtras, global10, globalCapabilities16, descriptor25;
16344
+ var target25, project25, generateRooGlobalExtras, globalLayout23, globalCapabilities16, descriptor25;
16202
16345
  var init_roo_code2 = __esm({
16203
16346
  "src/targets/roo-code/index.ts"() {
16204
16347
  init_fs();
@@ -16261,7 +16404,7 @@ var init_roo_code2 = __esm({
16261
16404
  }
16262
16405
  ];
16263
16406
  };
16264
- global10 = {
16407
+ globalLayout23 = {
16265
16408
  rootInstructionPath: ROO_CODE_GLOBAL_AGENTS_MD,
16266
16409
  skillDir: ROO_CODE_GLOBAL_SKILLS_DIR,
16267
16410
  managedOutputs: {
@@ -16362,7 +16505,7 @@ var init_roo_code2 = __esm({
16362
16505
  ROO_CODE_GLOBAL_AGENTS_MD,
16363
16506
  ROO_CODE_GLOBAL_MODES_FILE
16364
16507
  ],
16365
- layout: global10,
16508
+ layout: globalLayout23,
16366
16509
  scopeExtras: generateRooGlobalExtras
16367
16510
  },
16368
16511
  importer: {
@@ -16554,7 +16697,7 @@ var init_lint21 = __esm({
16554
16697
  });
16555
16698
 
16556
16699
  // src/targets/rovodev/index.ts
16557
- var target26, project26, globalLayout14, capabilities14, globalCapabilities17, descriptor26;
16700
+ var target26, project26, globalLayout24, capabilities14, globalCapabilities17, descriptor26;
16558
16701
  var init_rovodev2 = __esm({
16559
16702
  "src/targets/rovodev/index.ts"() {
16560
16703
  init_command_skill();
@@ -16595,7 +16738,7 @@ var init_rovodev2 = __esm({
16595
16738
  }
16596
16739
  }
16597
16740
  };
16598
- globalLayout14 = {
16741
+ globalLayout24 = {
16599
16742
  rootInstructionPath: ROVODEV_GLOBAL_ROOT_FILE,
16600
16743
  skillDir: ROVODEV_GLOBAL_SKILLS_DIR,
16601
16744
  managedOutputs: {
@@ -16669,7 +16812,7 @@ var init_rovodev2 = __esm({
16669
16812
  globalSupport: {
16670
16813
  capabilities: globalCapabilities17,
16671
16814
  detectionPaths: [ROVODEV_GLOBAL_DIR, ROVODEV_GLOBAL_ROOT_FILE, ROVODEV_GLOBAL_SKILLS_DIR],
16672
- layout: globalLayout14
16815
+ layout: globalLayout24
16673
16816
  },
16674
16817
  importer: {
16675
16818
  rules: {
@@ -16838,7 +16981,7 @@ var init_linter27 = __esm({
16838
16981
  });
16839
16982
 
16840
16983
  // src/targets/trae/index.ts
16841
- var target27, project27, global11, globalCapabilities18, descriptor27;
16984
+ var target27, project27, globalLayout25, globalCapabilities18, descriptor27;
16842
16985
  var init_trae2 = __esm({
16843
16986
  "src/targets/trae/index.ts"() {
16844
16987
  init_generator30();
@@ -16875,7 +17018,7 @@ var init_trae2 = __esm({
16875
17018
  }
16876
17019
  }
16877
17020
  };
16878
- global11 = {
17021
+ globalLayout25 = {
16879
17022
  rootInstructionPath: TRAE_GLOBAL_ROOT_RULE,
16880
17023
  skillDir: TRAE_GLOBAL_SKILLS_DIR,
16881
17024
  managedOutputs: {
@@ -16958,7 +17101,7 @@ var init_trae2 = __esm({
16958
17101
  TRAE_GLOBAL_SKILLS_DIR,
16959
17102
  TRAE_GLOBAL_MCP_FILE
16960
17103
  ],
16961
- layout: global11
17104
+ layout: globalLayout25
16962
17105
  },
16963
17106
  importer: {
16964
17107
  mcp: {
@@ -17105,7 +17248,7 @@ var init_lint22 = __esm({
17105
17248
  });
17106
17249
 
17107
17250
  // src/targets/warp/index.ts
17108
- var target28, project28, globalLayout15, capabilities15, globalCapabilities19, descriptor28;
17251
+ var target28, project28, globalLayout26, capabilities15, globalCapabilities19, descriptor28;
17109
17252
  var init_warp2 = __esm({
17110
17253
  "src/targets/warp/index.ts"() {
17111
17254
  init_command_skill();
@@ -17146,7 +17289,7 @@ var init_warp2 = __esm({
17146
17289
  }
17147
17290
  }
17148
17291
  };
17149
- globalLayout15 = {
17292
+ globalLayout26 = {
17150
17293
  rootInstructionPath: void 0,
17151
17294
  skillDir: WARP_GLOBAL_SKILLS_DIR,
17152
17295
  managedOutputs: {
@@ -17164,7 +17307,7 @@ var init_warp2 = __esm({
17164
17307
  },
17165
17308
  paths: {
17166
17309
  rulePath() {
17167
- return WARP_GLOBAL_SKILLS_DIR;
17310
+ return null;
17168
17311
  },
17169
17312
  commandPath(name) {
17170
17313
  return `${WARP_GLOBAL_SKILLS_DIR}/${commandSkillDirName(name)}/SKILL.md`;
@@ -17218,7 +17361,7 @@ var init_warp2 = __esm({
17218
17361
  globalSupport: {
17219
17362
  capabilities: globalCapabilities19,
17220
17363
  detectionPaths: [WARP_GLOBAL_SKILLS_DIR],
17221
- layout: globalLayout15
17364
+ layout: globalLayout26
17222
17365
  },
17223
17366
  importer: {
17224
17367
  rules: {
@@ -17242,7 +17385,8 @@ var init_warp2 = __esm({
17242
17385
  }
17243
17386
  },
17244
17387
  buildImportPaths: buildWarpImportPaths,
17245
- detectionPaths: [WARP_ROOT_FILE, WARP_LEGACY_ROOT_FILE, WARP_MCP_FILE]
17388
+ detectionPaths: [WARP_ROOT_FILE, WARP_LEGACY_ROOT_FILE, WARP_MCP_FILE],
17389
+ conversionDefaults: { commandsToSkills: true, agentsToSkills: true }
17246
17390
  };
17247
17391
  }
17248
17392
  });
@@ -17535,49 +17679,22 @@ var init_importer_workflows = __esm({
17535
17679
  init_constants31();
17536
17680
  }
17537
17681
  });
17682
+
17683
+ // src/targets/windsurf/skills-adapter.ts
17538
17684
  async function importSkills4(projectRoot, results, normalize, skillsRelDir = WINDSURF_SKILLS_DIR) {
17539
- const skillsDir = join(projectRoot, skillsRelDir);
17540
- const directorySkills = await findDirectorySkills(skillsDir);
17541
17685
  const options = {
17542
17686
  projectRoot,
17543
- sourceSkillsDir: skillsRelDir,
17544
17687
  destCanonicalSkillsDir: WINDSURF_CANONICAL_SKILLS_DIR,
17545
17688
  targetName: "windsurf",
17546
17689
  normalize,
17547
17690
  results
17548
17691
  };
17549
- for (const [skillName, skillDir] of directorySkills) {
17550
- const skillMdPath = join(skillDir, "SKILL.md");
17551
- const content = await readFileSafe(skillMdPath);
17552
- if (!content) continue;
17553
- const rawParsed = parseFrontmatter(content);
17554
- const projectedAgent = parseProjectedAgentSkillFrontmatter(rawParsed.frontmatter, skillName);
17555
- if (projectedAgent) {
17556
- await removePathIfExists(join(projectRoot, WINDSURF_CANONICAL_SKILLS_DIR, skillName));
17557
- const destAgentsDir = join(projectRoot, WINDSURF_CANONICAL_AGENTS_DIR);
17558
- await mkdirp(destAgentsDir);
17559
- const agentPath = join(destAgentsDir, `${projectedAgent.name}.md`);
17560
- await writeFileAtomic(
17561
- agentPath,
17562
- serializeImportedAgent(projectedAgent, normalize(rawParsed.body, skillMdPath, agentPath))
17563
- );
17564
- results.push({
17565
- fromTool: "windsurf",
17566
- fromPath: skillMdPath,
17567
- toPath: `${WINDSURF_CANONICAL_AGENTS_DIR}/${projectedAgent.name}.md`,
17568
- feature: "agents"
17569
- });
17570
- continue;
17571
- }
17572
- await importDirectorySkill(skillName, skillDir, options);
17573
- }
17692
+ await importSkillsDirectory([skillsRelDir], options, [
17693
+ projectedAgentRecognizer({ canonicalAgentsDir: WINDSURF_CANONICAL_AGENTS_DIR })
17694
+ ]);
17574
17695
  }
17575
17696
  var init_skills_adapter5 = __esm({
17576
17697
  "src/targets/windsurf/skills-adapter.ts"() {
17577
- init_fs();
17578
- init_markdown();
17579
- init_projected_agent_skill();
17580
- init_scoped_agents_import();
17581
17698
  init_skill_import_pipeline();
17582
17699
  init_constants31();
17583
17700
  }
@@ -17894,7 +18011,7 @@ function directoryScopedRuleDir2(globs) {
17894
18011
  if (dirs.length !== globs.length) return null;
17895
18012
  return dirs.every((dir) => dir === dirs[0]) ? dirs[0] : null;
17896
18013
  }
17897
- var target29, project29, global12, globalCapabilities20, descriptor29;
18014
+ var target29, project29, globalLayout27, globalCapabilities20, descriptor29;
17898
18015
  var init_windsurf2 = __esm({
17899
18016
  "src/targets/windsurf/index.ts"() {
17900
18017
  init_generator33();
@@ -17948,7 +18065,7 @@ var init_windsurf2 = __esm({
17948
18065
  }
17949
18066
  }
17950
18067
  };
17951
- global12 = {
18068
+ globalLayout27 = {
17952
18069
  rootInstructionPath: WINDSURF_GLOBAL_RULES,
17953
18070
  skillDir: WINDSURF_GLOBAL_SKILLS_DIR,
17954
18071
  managedOutputs: {
@@ -18052,10 +18169,11 @@ var init_windsurf2 = __esm({
18052
18169
  WINDSURF_GLOBAL_MCP_FILE,
18053
18170
  WINDSURF_GLOBAL_IGNORE
18054
18171
  ],
18055
- layout: global12
18172
+ layout: globalLayout27
18056
18173
  },
18057
18174
  buildImportPaths: buildWindsurfImportPaths,
18058
- detectionPaths: [".windsurfrules", ".windsurf"]
18175
+ detectionPaths: [".windsurfrules", ".windsurf"],
18176
+ conversionDefaults: { agentsToSkills: true }
18059
18177
  };
18060
18178
  }
18061
18179
  });
@@ -18216,7 +18334,7 @@ function mergeZedSettings(existing, newContent) {
18216
18334
  }
18217
18335
  return JSON.stringify(base, null, 2);
18218
18336
  }
18219
- var target30, project30, globalLayout16, capabilities16, globalCapabilities21, descriptor30;
18337
+ var target30, project30, globalLayout28, capabilities16, globalCapabilities21, descriptor30;
18220
18338
  var init_zed2 = __esm({
18221
18339
  "src/targets/zed/index.ts"() {
18222
18340
  init_generator34();
@@ -18249,7 +18367,7 @@ var init_zed2 = __esm({
18249
18367
  }
18250
18368
  }
18251
18369
  };
18252
- globalLayout16 = {
18370
+ globalLayout28 = {
18253
18371
  rootInstructionPath: void 0,
18254
18372
  managedOutputs: {
18255
18373
  dirs: [],
@@ -18314,7 +18432,7 @@ var init_zed2 = __esm({
18314
18432
  globalSupport: {
18315
18433
  capabilities: globalCapabilities21,
18316
18434
  detectionPaths: [ZED_GLOBAL_SETTINGS_FILE],
18317
- layout: globalLayout16
18435
+ layout: globalLayout28
18318
18436
  },
18319
18437
  importer: {
18320
18438
  rules: {