rulesync 4.3.0 → 4.3.2

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/index.js CHANGED
@@ -5136,12 +5136,94 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
5136
5136
  }
5137
5137
  };
5138
5138
 
5139
- // src/features/skills/cursor-skill.ts
5139
+ // src/features/skills/geminicli-skill.ts
5140
+ import { join as join43 } from "path";
5141
+ var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
5142
+ static getSettablePaths(options) {
5143
+ if (options?.global) {
5144
+ throw new Error("GeminiCliSkill does not support global mode.");
5145
+ }
5146
+ return {
5147
+ relativeDirPath: join43(".gemini", "skills")
5148
+ };
5149
+ }
5150
+ static async fromDir(params) {
5151
+ const baseParams = await this.fromDirDefault(params);
5152
+ return new _GeminiCliSkill(baseParams);
5153
+ }
5154
+ static fromRulesyncSkill(params) {
5155
+ const baseParams = {
5156
+ ...this.fromRulesyncSkillDefault(params),
5157
+ relativeDirPath: this.getSettablePaths().relativeDirPath
5158
+ };
5159
+ return new _GeminiCliSkill(baseParams);
5160
+ }
5161
+ static isTargetedByRulesyncSkill(rulesyncSkill) {
5162
+ return this.isTargetedByRulesyncSkillDefault({
5163
+ rulesyncSkill,
5164
+ toolTarget: "geminicli"
5165
+ });
5166
+ }
5167
+ static forDeletion(params) {
5168
+ const baseParams = this.forDeletionDefault(params);
5169
+ return new _GeminiCliSkill(baseParams);
5170
+ }
5171
+ };
5172
+
5173
+ // src/features/skills/skills-processor.ts
5174
+ import { basename as basename14, join as join51 } from "path";
5175
+ import { z as z26 } from "zod/mini";
5176
+
5177
+ // src/types/dir-feature-processor.ts
5140
5178
  import { join as join44 } from "path";
5179
+ var DirFeatureProcessor = class {
5180
+ baseDir;
5181
+ constructor({ baseDir = process.cwd() }) {
5182
+ this.baseDir = baseDir;
5183
+ }
5184
+ /**
5185
+ * Return tool targets that this feature supports.
5186
+ */
5187
+ static getToolTargets(_params = {}) {
5188
+ throw new Error("Not implemented");
5189
+ }
5190
+ /**
5191
+ * Once converted to rulesync/tool dirs, write them to the filesystem.
5192
+ * Returns the number of directories written.
5193
+ */
5194
+ async writeAiDirs(aiDirs) {
5195
+ for (const aiDir of aiDirs) {
5196
+ const dirPath = aiDir.getDirPath();
5197
+ await ensureDir(dirPath);
5198
+ const mainFile = aiDir.getMainFile();
5199
+ if (mainFile) {
5200
+ const mainFilePath = join44(dirPath, mainFile.name);
5201
+ const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
5202
+ const contentWithNewline = addTrailingNewline(content);
5203
+ await writeFileContent(mainFilePath, contentWithNewline);
5204
+ }
5205
+ const otherFiles = aiDir.getOtherFiles();
5206
+ for (const file of otherFiles) {
5207
+ const filePath = join44(dirPath, file.relativeFilePathToDirPath);
5208
+ const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
5209
+ await writeFileContent(filePath, contentWithNewline);
5210
+ }
5211
+ }
5212
+ return aiDirs.length;
5213
+ }
5214
+ async removeAiDirs(aiDirs) {
5215
+ for (const aiDir of aiDirs) {
5216
+ await removeDirectory(aiDir.getDirPath());
5217
+ }
5218
+ }
5219
+ };
5220
+
5221
+ // src/features/skills/claudecode-skill.ts
5222
+ import { join as join46 } from "path";
5141
5223
  import { z as z21 } from "zod/mini";
5142
5224
 
5143
5225
  // src/features/skills/rulesync-skill.ts
5144
- import { join as join43 } from "path";
5226
+ import { join as join45 } from "path";
5145
5227
  import { z as z20 } from "zod/mini";
5146
5228
  var RulesyncSkillFrontmatterSchemaInternal = z20.looseObject({
5147
5229
  name: z20.string(),
@@ -5227,8 +5309,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
5227
5309
  dirName,
5228
5310
  global = false
5229
5311
  }) {
5230
- const skillDirPath = join43(baseDir, relativeDirPath, dirName);
5231
- const skillFilePath = join43(skillDirPath, SKILL_FILE_NAME);
5312
+ const skillDirPath = join45(baseDir, relativeDirPath, dirName);
5313
+ const skillFilePath = join45(skillDirPath, SKILL_FILE_NAME);
5232
5314
  if (!await fileExists(skillFilePath)) {
5233
5315
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
5234
5316
  }
@@ -5257,15 +5339,16 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
5257
5339
  }
5258
5340
  };
5259
5341
 
5260
- // src/features/skills/cursor-skill.ts
5261
- var CursorSkillFrontmatterSchema = z21.looseObject({
5342
+ // src/features/skills/claudecode-skill.ts
5343
+ var ClaudecodeSkillFrontmatterSchema = z21.looseObject({
5262
5344
  name: z21.string(),
5263
- description: z21.string()
5345
+ description: z21.string(),
5346
+ "allowed-tools": z21.optional(z21.array(z21.string()))
5264
5347
  });
5265
- var CursorSkill = class _CursorSkill extends ToolSkill {
5348
+ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5266
5349
  constructor({
5267
5350
  baseDir = process.cwd(),
5268
- relativeDirPath = join44(".cursor", "skills"),
5351
+ relativeDirPath = join46(".claude", "skills"),
5269
5352
  dirName,
5270
5353
  frontmatter,
5271
5354
  body,
@@ -5292,32 +5375,31 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5292
5375
  }
5293
5376
  }
5294
5377
  }
5295
- static getSettablePaths(options) {
5296
- if (options?.global) {
5297
- throw new Error("CursorSkill does not support global mode.");
5298
- }
5378
+ static getSettablePaths({
5379
+ global: _global = false
5380
+ } = {}) {
5299
5381
  return {
5300
- relativeDirPath: join44(".cursor", "skills")
5382
+ relativeDirPath: join46(".claude", "skills")
5301
5383
  };
5302
5384
  }
5303
5385
  getFrontmatter() {
5304
5386
  if (!this.mainFile?.frontmatter) {
5305
5387
  throw new Error("Frontmatter is not defined");
5306
5388
  }
5307
- const result = CursorSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5389
+ const result = ClaudecodeSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5308
5390
  return result;
5309
5391
  }
5310
5392
  getBody() {
5311
5393
  return this.mainFile?.body ?? "";
5312
5394
  }
5313
5395
  validate() {
5314
- if (!this.mainFile) {
5396
+ if (this.mainFile === void 0) {
5315
5397
  return {
5316
5398
  success: false,
5317
5399
  error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
5318
5400
  };
5319
5401
  }
5320
- const result = CursorSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5402
+ const result = ClaudecodeSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5321
5403
  if (!result.success) {
5322
5404
  return {
5323
5405
  success: false,
@@ -5333,7 +5415,12 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5333
5415
  const rulesyncFrontmatter = {
5334
5416
  name: frontmatter.name,
5335
5417
  description: frontmatter.description,
5336
- targets: ["*"]
5418
+ targets: ["*"],
5419
+ ...frontmatter["allowed-tools"] && {
5420
+ claudecode: {
5421
+ "allowed-tools": frontmatter["allowed-tools"]
5422
+ }
5423
+ }
5337
5424
  };
5338
5425
  return new RulesyncSkill({
5339
5426
  baseDir: this.baseDir,
@@ -5351,17 +5438,18 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5351
5438
  validate = true,
5352
5439
  global = false
5353
5440
  }) {
5354
- const settablePaths = _CursorSkill.getSettablePaths({ global });
5355
5441
  const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
5356
- const cursorFrontmatter = {
5442
+ const claudecodeFrontmatter = {
5357
5443
  name: rulesyncFrontmatter.name,
5358
- description: rulesyncFrontmatter.description
5444
+ description: rulesyncFrontmatter.description,
5445
+ "allowed-tools": rulesyncFrontmatter.claudecode?.["allowed-tools"]
5359
5446
  };
5360
- return new _CursorSkill({
5447
+ const settablePaths = _ClaudecodeSkill.getSettablePaths({ global });
5448
+ return new _ClaudecodeSkill({
5361
5449
  baseDir: rulesyncSkill.getBaseDir(),
5362
5450
  relativeDirPath: settablePaths.relativeDirPath,
5363
5451
  dirName: rulesyncSkill.getDirName(),
5364
- frontmatter: cursorFrontmatter,
5452
+ frontmatter: claudecodeFrontmatter,
5365
5453
  body: rulesyncSkill.getBody(),
5366
5454
  otherFiles: rulesyncSkill.getOtherFiles(),
5367
5455
  validate,
@@ -5370,21 +5458,21 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5370
5458
  }
5371
5459
  static isTargetedByRulesyncSkill(rulesyncSkill) {
5372
5460
  const targets = rulesyncSkill.getFrontmatter().targets;
5373
- return targets.includes("*") || targets.includes("cursor");
5461
+ return targets.includes("*") || targets.includes("claudecode");
5374
5462
  }
5375
5463
  static async fromDir(params) {
5376
5464
  const loaded = await this.loadSkillDirContent({
5377
5465
  ...params,
5378
- getSettablePaths: _CursorSkill.getSettablePaths
5466
+ getSettablePaths: _ClaudecodeSkill.getSettablePaths
5379
5467
  });
5380
- const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5468
+ const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5381
5469
  if (!result.success) {
5382
- const skillDirPath = join44(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
5470
+ const skillDirPath = join46(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
5383
5471
  throw new Error(
5384
- `Invalid frontmatter in ${join44(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
5472
+ `Invalid frontmatter in ${join46(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
5385
5473
  );
5386
5474
  }
5387
- return new _CursorSkill({
5475
+ return new _ClaudecodeSkill({
5388
5476
  baseDir: loaded.baseDir,
5389
5477
  relativeDirPath: loaded.relativeDirPath,
5390
5478
  dirName: loaded.dirName,
@@ -5401,10 +5489,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5401
5489
  dirName,
5402
5490
  global = false
5403
5491
  }) {
5404
- const settablePaths = _CursorSkill.getSettablePaths({ global });
5405
- return new _CursorSkill({
5492
+ return new _ClaudecodeSkill({
5406
5493
  baseDir,
5407
- relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
5494
+ relativeDirPath,
5408
5495
  dirName,
5409
5496
  frontmatter: { name: "", description: "" },
5410
5497
  body: "",
@@ -5415,100 +5502,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5415
5502
  }
5416
5503
  };
5417
5504
 
5418
- // src/features/skills/geminicli-skill.ts
5419
- import { join as join45 } from "path";
5420
- var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
5421
- static getSettablePaths(options) {
5422
- if (options?.global) {
5423
- throw new Error("GeminiCliSkill does not support global mode.");
5424
- }
5425
- return {
5426
- relativeDirPath: join45(".gemini", "skills")
5427
- };
5428
- }
5429
- static async fromDir(params) {
5430
- const baseParams = await this.fromDirDefault(params);
5431
- return new _GeminiCliSkill(baseParams);
5432
- }
5433
- static fromRulesyncSkill(params) {
5434
- const baseParams = {
5435
- ...this.fromRulesyncSkillDefault(params),
5436
- relativeDirPath: this.getSettablePaths().relativeDirPath
5437
- };
5438
- return new _GeminiCliSkill(baseParams);
5439
- }
5440
- static isTargetedByRulesyncSkill(rulesyncSkill) {
5441
- return this.isTargetedByRulesyncSkillDefault({
5442
- rulesyncSkill,
5443
- toolTarget: "geminicli"
5444
- });
5445
- }
5446
- static forDeletion(params) {
5447
- const baseParams = this.forDeletionDefault(params);
5448
- return new _GeminiCliSkill(baseParams);
5449
- }
5450
- };
5451
-
5452
- // src/features/skills/skills-processor.ts
5453
- import { basename as basename14, join as join51 } from "path";
5454
- import { z as z26 } from "zod/mini";
5455
-
5456
- // src/types/dir-feature-processor.ts
5457
- import { join as join46 } from "path";
5458
- var DirFeatureProcessor = class {
5459
- baseDir;
5460
- constructor({ baseDir = process.cwd() }) {
5461
- this.baseDir = baseDir;
5462
- }
5463
- /**
5464
- * Return tool targets that this feature supports.
5465
- */
5466
- static getToolTargets(_params = {}) {
5467
- throw new Error("Not implemented");
5468
- }
5469
- /**
5470
- * Once converted to rulesync/tool dirs, write them to the filesystem.
5471
- * Returns the number of directories written.
5472
- */
5473
- async writeAiDirs(aiDirs) {
5474
- for (const aiDir of aiDirs) {
5475
- const dirPath = aiDir.getDirPath();
5476
- await ensureDir(dirPath);
5477
- const mainFile = aiDir.getMainFile();
5478
- if (mainFile) {
5479
- const mainFilePath = join46(dirPath, mainFile.name);
5480
- const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
5481
- const contentWithNewline = addTrailingNewline(content);
5482
- await writeFileContent(mainFilePath, contentWithNewline);
5483
- }
5484
- const otherFiles = aiDir.getOtherFiles();
5485
- for (const file of otherFiles) {
5486
- const filePath = join46(dirPath, file.relativeFilePathToDirPath);
5487
- const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
5488
- await writeFileContent(filePath, contentWithNewline);
5489
- }
5490
- }
5491
- return aiDirs.length;
5492
- }
5493
- async removeAiDirs(aiDirs) {
5494
- for (const aiDir of aiDirs) {
5495
- await removeDirectory(aiDir.getDirPath());
5496
- }
5497
- }
5498
- };
5499
-
5500
- // src/features/skills/claudecode-skill.ts
5505
+ // src/features/skills/codexcli-skill.ts
5501
5506
  import { join as join47 } from "path";
5502
5507
  import { z as z22 } from "zod/mini";
5503
- var ClaudecodeSkillFrontmatterSchema = z22.looseObject({
5508
+ var CodexCliSkillFrontmatterSchema = z22.looseObject({
5504
5509
  name: z22.string(),
5505
- description: z22.string(),
5506
- "allowed-tools": z22.optional(z22.array(z22.string()))
5510
+ description: z22.string()
5507
5511
  });
5508
- var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5512
+ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5509
5513
  constructor({
5510
5514
  baseDir = process.cwd(),
5511
- relativeDirPath = join47(".claude", "skills"),
5515
+ relativeDirPath = join47(".codex", "skills"),
5512
5516
  dirName,
5513
5517
  frontmatter,
5514
5518
  body,
@@ -5535,31 +5539,32 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5535
5539
  }
5536
5540
  }
5537
5541
  }
5538
- static getSettablePaths({
5539
- global: _global = false
5540
- } = {}) {
5542
+ static getSettablePaths({ global = false } = {}) {
5543
+ if (!global) {
5544
+ throw new Error("CodexCliSkill only supports global mode. Please pass { global: true }.");
5545
+ }
5541
5546
  return {
5542
- relativeDirPath: join47(".claude", "skills")
5547
+ relativeDirPath: join47(".codex", "skills")
5543
5548
  };
5544
5549
  }
5545
5550
  getFrontmatter() {
5546
5551
  if (!this.mainFile?.frontmatter) {
5547
5552
  throw new Error("Frontmatter is not defined");
5548
5553
  }
5549
- const result = ClaudecodeSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5554
+ const result = CodexCliSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5550
5555
  return result;
5551
5556
  }
5552
5557
  getBody() {
5553
5558
  return this.mainFile?.body ?? "";
5554
5559
  }
5555
5560
  validate() {
5556
- if (this.mainFile === void 0) {
5561
+ if (!this.mainFile) {
5557
5562
  return {
5558
5563
  success: false,
5559
5564
  error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
5560
5565
  };
5561
5566
  }
5562
- const result = ClaudecodeSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5567
+ const result = CodexCliSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5563
5568
  if (!result.success) {
5564
5569
  return {
5565
5570
  success: false,
@@ -5575,12 +5580,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5575
5580
  const rulesyncFrontmatter = {
5576
5581
  name: frontmatter.name,
5577
5582
  description: frontmatter.description,
5578
- targets: ["*"],
5579
- ...frontmatter["allowed-tools"] && {
5580
- claudecode: {
5581
- "allowed-tools": frontmatter["allowed-tools"]
5582
- }
5583
- }
5583
+ targets: ["*"]
5584
5584
  };
5585
5585
  return new RulesyncSkill({
5586
5586
  baseDir: this.baseDir,
@@ -5598,18 +5598,17 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5598
5598
  validate = true,
5599
5599
  global = false
5600
5600
  }) {
5601
+ const settablePaths = _CodexCliSkill.getSettablePaths({ global });
5601
5602
  const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
5602
- const claudecodeFrontmatter = {
5603
+ const codexFrontmatter = {
5603
5604
  name: rulesyncFrontmatter.name,
5604
- description: rulesyncFrontmatter.description,
5605
- "allowed-tools": rulesyncFrontmatter.claudecode?.["allowed-tools"]
5605
+ description: rulesyncFrontmatter.description
5606
5606
  };
5607
- const settablePaths = _ClaudecodeSkill.getSettablePaths({ global });
5608
- return new _ClaudecodeSkill({
5607
+ return new _CodexCliSkill({
5609
5608
  baseDir: rulesyncSkill.getBaseDir(),
5610
5609
  relativeDirPath: settablePaths.relativeDirPath,
5611
5610
  dirName: rulesyncSkill.getDirName(),
5612
- frontmatter: claudecodeFrontmatter,
5611
+ frontmatter: codexFrontmatter,
5613
5612
  body: rulesyncSkill.getBody(),
5614
5613
  otherFiles: rulesyncSkill.getOtherFiles(),
5615
5614
  validate,
@@ -5618,21 +5617,21 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5618
5617
  }
5619
5618
  static isTargetedByRulesyncSkill(rulesyncSkill) {
5620
5619
  const targets = rulesyncSkill.getFrontmatter().targets;
5621
- return targets.includes("*") || targets.includes("claudecode");
5620
+ return targets.includes("*") || targets.includes("codexcli");
5622
5621
  }
5623
5622
  static async fromDir(params) {
5624
5623
  const loaded = await this.loadSkillDirContent({
5625
5624
  ...params,
5626
- getSettablePaths: _ClaudecodeSkill.getSettablePaths
5625
+ getSettablePaths: _CodexCliSkill.getSettablePaths
5627
5626
  });
5628
- const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5627
+ const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5629
5628
  if (!result.success) {
5630
5629
  const skillDirPath = join47(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
5631
5630
  throw new Error(
5632
5631
  `Invalid frontmatter in ${join47(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
5633
5632
  );
5634
5633
  }
5635
- return new _ClaudecodeSkill({
5634
+ return new _CodexCliSkill({
5636
5635
  baseDir: loaded.baseDir,
5637
5636
  relativeDirPath: loaded.relativeDirPath,
5638
5637
  dirName: loaded.dirName,
@@ -5649,7 +5648,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5649
5648
  dirName,
5650
5649
  global = false
5651
5650
  }) {
5652
- return new _ClaudecodeSkill({
5651
+ return new _CodexCliSkill({
5653
5652
  baseDir,
5654
5653
  relativeDirPath,
5655
5654
  dirName,
@@ -5662,17 +5661,18 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5662
5661
  }
5663
5662
  };
5664
5663
 
5665
- // src/features/skills/codexcli-skill.ts
5664
+ // src/features/skills/copilot-skill.ts
5666
5665
  import { join as join48 } from "path";
5667
5666
  import { z as z23 } from "zod/mini";
5668
- var CodexCliSkillFrontmatterSchema = z23.looseObject({
5667
+ var CopilotSkillFrontmatterSchema = z23.looseObject({
5669
5668
  name: z23.string(),
5670
- description: z23.string()
5669
+ description: z23.string(),
5670
+ license: z23.optional(z23.string())
5671
5671
  });
5672
- var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5672
+ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5673
5673
  constructor({
5674
5674
  baseDir = process.cwd(),
5675
- relativeDirPath = join48(".codex", "skills"),
5675
+ relativeDirPath = join48(".github", "skills"),
5676
5676
  dirName,
5677
5677
  frontmatter,
5678
5678
  body,
@@ -5699,19 +5699,19 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5699
5699
  }
5700
5700
  }
5701
5701
  }
5702
- static getSettablePaths({ global = false } = {}) {
5703
- if (!global) {
5704
- throw new Error("CodexCliSkill only supports global mode. Please pass { global: true }.");
5702
+ static getSettablePaths(options) {
5703
+ if (options?.global) {
5704
+ throw new Error("CopilotSkill does not support global mode.");
5705
5705
  }
5706
5706
  return {
5707
- relativeDirPath: join48(".codex", "skills")
5707
+ relativeDirPath: join48(".github", "skills")
5708
5708
  };
5709
5709
  }
5710
5710
  getFrontmatter() {
5711
5711
  if (!this.mainFile?.frontmatter) {
5712
5712
  throw new Error("Frontmatter is not defined");
5713
5713
  }
5714
- const result = CodexCliSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5714
+ const result = CopilotSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5715
5715
  return result;
5716
5716
  }
5717
5717
  getBody() {
@@ -5724,7 +5724,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5724
5724
  error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
5725
5725
  };
5726
5726
  }
5727
- const result = CodexCliSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5727
+ const result = CopilotSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5728
5728
  if (!result.success) {
5729
5729
  return {
5730
5730
  success: false,
@@ -5740,7 +5740,12 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5740
5740
  const rulesyncFrontmatter = {
5741
5741
  name: frontmatter.name,
5742
5742
  description: frontmatter.description,
5743
- targets: ["*"]
5743
+ targets: ["*"],
5744
+ ...frontmatter.license && {
5745
+ copilot: {
5746
+ license: frontmatter.license
5747
+ }
5748
+ }
5744
5749
  };
5745
5750
  return new RulesyncSkill({
5746
5751
  baseDir: this.baseDir,
@@ -5758,17 +5763,18 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5758
5763
  validate = true,
5759
5764
  global = false
5760
5765
  }) {
5761
- const settablePaths = _CodexCliSkill.getSettablePaths({ global });
5766
+ const settablePaths = _CopilotSkill.getSettablePaths({ global });
5762
5767
  const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
5763
- const codexFrontmatter = {
5768
+ const copilotFrontmatter = {
5764
5769
  name: rulesyncFrontmatter.name,
5765
- description: rulesyncFrontmatter.description
5770
+ description: rulesyncFrontmatter.description,
5771
+ license: rulesyncFrontmatter.copilot?.license
5766
5772
  };
5767
- return new _CodexCliSkill({
5773
+ return new _CopilotSkill({
5768
5774
  baseDir: rulesyncSkill.getBaseDir(),
5769
5775
  relativeDirPath: settablePaths.relativeDirPath,
5770
5776
  dirName: rulesyncSkill.getDirName(),
5771
- frontmatter: codexFrontmatter,
5777
+ frontmatter: copilotFrontmatter,
5772
5778
  body: rulesyncSkill.getBody(),
5773
5779
  otherFiles: rulesyncSkill.getOtherFiles(),
5774
5780
  validate,
@@ -5777,21 +5783,21 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5777
5783
  }
5778
5784
  static isTargetedByRulesyncSkill(rulesyncSkill) {
5779
5785
  const targets = rulesyncSkill.getFrontmatter().targets;
5780
- return targets.includes("*") || targets.includes("codexcli");
5786
+ return targets.includes("*") || targets.includes("copilot");
5781
5787
  }
5782
5788
  static async fromDir(params) {
5783
5789
  const loaded = await this.loadSkillDirContent({
5784
5790
  ...params,
5785
- getSettablePaths: _CodexCliSkill.getSettablePaths
5791
+ getSettablePaths: _CopilotSkill.getSettablePaths
5786
5792
  });
5787
- const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5793
+ const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5788
5794
  if (!result.success) {
5789
5795
  const skillDirPath = join48(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
5790
5796
  throw new Error(
5791
5797
  `Invalid frontmatter in ${join48(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
5792
5798
  );
5793
5799
  }
5794
- return new _CodexCliSkill({
5800
+ return new _CopilotSkill({
5795
5801
  baseDir: loaded.baseDir,
5796
5802
  relativeDirPath: loaded.relativeDirPath,
5797
5803
  dirName: loaded.dirName,
@@ -5808,9 +5814,10 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5808
5814
  dirName,
5809
5815
  global = false
5810
5816
  }) {
5811
- return new _CodexCliSkill({
5817
+ const settablePaths = _CopilotSkill.getSettablePaths({ global });
5818
+ return new _CopilotSkill({
5812
5819
  baseDir,
5813
- relativeDirPath,
5820
+ relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
5814
5821
  dirName,
5815
5822
  frontmatter: { name: "", description: "" },
5816
5823
  body: "",
@@ -5821,18 +5828,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5821
5828
  }
5822
5829
  };
5823
5830
 
5824
- // src/features/skills/copilot-skill.ts
5831
+ // src/features/skills/cursor-skill.ts
5825
5832
  import { join as join49 } from "path";
5826
5833
  import { z as z24 } from "zod/mini";
5827
- var CopilotSkillFrontmatterSchema = z24.looseObject({
5834
+ var CursorSkillFrontmatterSchema = z24.looseObject({
5828
5835
  name: z24.string(),
5829
- description: z24.string(),
5830
- license: z24.optional(z24.string())
5836
+ description: z24.string()
5831
5837
  });
5832
- var CopilotSkill = class _CopilotSkill extends ToolSkill {
5838
+ var CursorSkill = class _CursorSkill extends ToolSkill {
5833
5839
  constructor({
5834
5840
  baseDir = process.cwd(),
5835
- relativeDirPath = join49(".github", "skills"),
5841
+ relativeDirPath = join49(".cursor", "skills"),
5836
5842
  dirName,
5837
5843
  frontmatter,
5838
5844
  body,
@@ -5861,17 +5867,17 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5861
5867
  }
5862
5868
  static getSettablePaths(options) {
5863
5869
  if (options?.global) {
5864
- throw new Error("CopilotSkill does not support global mode.");
5870
+ throw new Error("CursorSkill does not support global mode.");
5865
5871
  }
5866
5872
  return {
5867
- relativeDirPath: join49(".github", "skills")
5873
+ relativeDirPath: join49(".cursor", "skills")
5868
5874
  };
5869
5875
  }
5870
5876
  getFrontmatter() {
5871
5877
  if (!this.mainFile?.frontmatter) {
5872
5878
  throw new Error("Frontmatter is not defined");
5873
5879
  }
5874
- const result = CopilotSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5880
+ const result = CursorSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5875
5881
  return result;
5876
5882
  }
5877
5883
  getBody() {
@@ -5884,7 +5890,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5884
5890
  error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
5885
5891
  };
5886
5892
  }
5887
- const result = CopilotSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5893
+ const result = CursorSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5888
5894
  if (!result.success) {
5889
5895
  return {
5890
5896
  success: false,
@@ -5900,12 +5906,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5900
5906
  const rulesyncFrontmatter = {
5901
5907
  name: frontmatter.name,
5902
5908
  description: frontmatter.description,
5903
- targets: ["*"],
5904
- ...frontmatter.license && {
5905
- copilot: {
5906
- license: frontmatter.license
5907
- }
5908
- }
5909
+ targets: ["*"]
5909
5910
  };
5910
5911
  return new RulesyncSkill({
5911
5912
  baseDir: this.baseDir,
@@ -5923,18 +5924,17 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5923
5924
  validate = true,
5924
5925
  global = false
5925
5926
  }) {
5926
- const settablePaths = _CopilotSkill.getSettablePaths({ global });
5927
+ const settablePaths = _CursorSkill.getSettablePaths({ global });
5927
5928
  const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
5928
- const copilotFrontmatter = {
5929
+ const cursorFrontmatter = {
5929
5930
  name: rulesyncFrontmatter.name,
5930
- description: rulesyncFrontmatter.description,
5931
- license: rulesyncFrontmatter.copilot?.license
5931
+ description: rulesyncFrontmatter.description
5932
5932
  };
5933
- return new _CopilotSkill({
5933
+ return new _CursorSkill({
5934
5934
  baseDir: rulesyncSkill.getBaseDir(),
5935
5935
  relativeDirPath: settablePaths.relativeDirPath,
5936
5936
  dirName: rulesyncSkill.getDirName(),
5937
- frontmatter: copilotFrontmatter,
5937
+ frontmatter: cursorFrontmatter,
5938
5938
  body: rulesyncSkill.getBody(),
5939
5939
  otherFiles: rulesyncSkill.getOtherFiles(),
5940
5940
  validate,
@@ -5943,21 +5943,21 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5943
5943
  }
5944
5944
  static isTargetedByRulesyncSkill(rulesyncSkill) {
5945
5945
  const targets = rulesyncSkill.getFrontmatter().targets;
5946
- return targets.includes("*") || targets.includes("copilot");
5946
+ return targets.includes("*") || targets.includes("cursor");
5947
5947
  }
5948
5948
  static async fromDir(params) {
5949
5949
  const loaded = await this.loadSkillDirContent({
5950
5950
  ...params,
5951
- getSettablePaths: _CopilotSkill.getSettablePaths
5951
+ getSettablePaths: _CursorSkill.getSettablePaths
5952
5952
  });
5953
- const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5953
+ const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5954
5954
  if (!result.success) {
5955
5955
  const skillDirPath = join49(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
5956
5956
  throw new Error(
5957
5957
  `Invalid frontmatter in ${join49(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
5958
5958
  );
5959
5959
  }
5960
- return new _CopilotSkill({
5960
+ return new _CursorSkill({
5961
5961
  baseDir: loaded.baseDir,
5962
5962
  relativeDirPath: loaded.relativeDirPath,
5963
5963
  dirName: loaded.dirName,
@@ -5974,8 +5974,8 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5974
5974
  dirName,
5975
5975
  global = false
5976
5976
  }) {
5977
- const settablePaths = _CopilotSkill.getSettablePaths({ global });
5978
- return new _CopilotSkill({
5977
+ const settablePaths = _CursorSkill.getSettablePaths({ global });
5978
+ return new _CursorSkill({
5979
5979
  baseDir,
5980
5980
  relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
5981
5981
  dirName,
@@ -10003,8 +10003,7 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
10003
10003
  supportsGlobal: false,
10004
10004
  ruleDiscoveryMode: "auto",
10005
10005
  additionalConventions: {
10006
- subagents: { subagentClass: CursorSubagent },
10007
- skills: { skillClass: CursorSkill }
10006
+ subagents: { subagentClass: CursorSubagent }
10008
10007
  },
10009
10008
  createsSeparateConventionsRule: true
10010
10009
  }
@@ -12468,7 +12467,7 @@ async function mcpCommand({ version }) {
12468
12467
  }
12469
12468
 
12470
12469
  // src/cli/index.ts
12471
- var getVersion = () => "4.3.0";
12470
+ var getVersion = () => "4.3.2";
12472
12471
  var main = async () => {
12473
12472
  const program = new Command();
12474
12473
  const version = getVersion();