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.cjs CHANGED
@@ -5159,12 +5159,94 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
5159
5159
  }
5160
5160
  };
5161
5161
 
5162
- // src/features/skills/cursor-skill.ts
5162
+ // src/features/skills/geminicli-skill.ts
5163
+ var import_node_path45 = require("path");
5164
+ var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
5165
+ static getSettablePaths(options) {
5166
+ if (options?.global) {
5167
+ throw new Error("GeminiCliSkill does not support global mode.");
5168
+ }
5169
+ return {
5170
+ relativeDirPath: (0, import_node_path45.join)(".gemini", "skills")
5171
+ };
5172
+ }
5173
+ static async fromDir(params) {
5174
+ const baseParams = await this.fromDirDefault(params);
5175
+ return new _GeminiCliSkill(baseParams);
5176
+ }
5177
+ static fromRulesyncSkill(params) {
5178
+ const baseParams = {
5179
+ ...this.fromRulesyncSkillDefault(params),
5180
+ relativeDirPath: this.getSettablePaths().relativeDirPath
5181
+ };
5182
+ return new _GeminiCliSkill(baseParams);
5183
+ }
5184
+ static isTargetedByRulesyncSkill(rulesyncSkill) {
5185
+ return this.isTargetedByRulesyncSkillDefault({
5186
+ rulesyncSkill,
5187
+ toolTarget: "geminicli"
5188
+ });
5189
+ }
5190
+ static forDeletion(params) {
5191
+ const baseParams = this.forDeletionDefault(params);
5192
+ return new _GeminiCliSkill(baseParams);
5193
+ }
5194
+ };
5195
+
5196
+ // src/features/skills/skills-processor.ts
5197
+ var import_node_path53 = require("path");
5198
+ var import_mini26 = require("zod/mini");
5199
+
5200
+ // src/types/dir-feature-processor.ts
5163
5201
  var import_node_path46 = require("path");
5202
+ var DirFeatureProcessor = class {
5203
+ baseDir;
5204
+ constructor({ baseDir = process.cwd() }) {
5205
+ this.baseDir = baseDir;
5206
+ }
5207
+ /**
5208
+ * Return tool targets that this feature supports.
5209
+ */
5210
+ static getToolTargets(_params = {}) {
5211
+ throw new Error("Not implemented");
5212
+ }
5213
+ /**
5214
+ * Once converted to rulesync/tool dirs, write them to the filesystem.
5215
+ * Returns the number of directories written.
5216
+ */
5217
+ async writeAiDirs(aiDirs) {
5218
+ for (const aiDir of aiDirs) {
5219
+ const dirPath = aiDir.getDirPath();
5220
+ await ensureDir(dirPath);
5221
+ const mainFile = aiDir.getMainFile();
5222
+ if (mainFile) {
5223
+ const mainFilePath = (0, import_node_path46.join)(dirPath, mainFile.name);
5224
+ const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
5225
+ const contentWithNewline = addTrailingNewline(content);
5226
+ await writeFileContent(mainFilePath, contentWithNewline);
5227
+ }
5228
+ const otherFiles = aiDir.getOtherFiles();
5229
+ for (const file of otherFiles) {
5230
+ const filePath = (0, import_node_path46.join)(dirPath, file.relativeFilePathToDirPath);
5231
+ const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
5232
+ await writeFileContent(filePath, contentWithNewline);
5233
+ }
5234
+ }
5235
+ return aiDirs.length;
5236
+ }
5237
+ async removeAiDirs(aiDirs) {
5238
+ for (const aiDir of aiDirs) {
5239
+ await removeDirectory(aiDir.getDirPath());
5240
+ }
5241
+ }
5242
+ };
5243
+
5244
+ // src/features/skills/claudecode-skill.ts
5245
+ var import_node_path48 = require("path");
5164
5246
  var import_mini21 = require("zod/mini");
5165
5247
 
5166
5248
  // src/features/skills/rulesync-skill.ts
5167
- var import_node_path45 = require("path");
5249
+ var import_node_path47 = require("path");
5168
5250
  var import_mini20 = require("zod/mini");
5169
5251
  var RulesyncSkillFrontmatterSchemaInternal = import_mini20.z.looseObject({
5170
5252
  name: import_mini20.z.string(),
@@ -5250,8 +5332,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
5250
5332
  dirName,
5251
5333
  global = false
5252
5334
  }) {
5253
- const skillDirPath = (0, import_node_path45.join)(baseDir, relativeDirPath, dirName);
5254
- const skillFilePath = (0, import_node_path45.join)(skillDirPath, SKILL_FILE_NAME);
5335
+ const skillDirPath = (0, import_node_path47.join)(baseDir, relativeDirPath, dirName);
5336
+ const skillFilePath = (0, import_node_path47.join)(skillDirPath, SKILL_FILE_NAME);
5255
5337
  if (!await fileExists(skillFilePath)) {
5256
5338
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
5257
5339
  }
@@ -5280,15 +5362,16 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
5280
5362
  }
5281
5363
  };
5282
5364
 
5283
- // src/features/skills/cursor-skill.ts
5284
- var CursorSkillFrontmatterSchema = import_mini21.z.looseObject({
5365
+ // src/features/skills/claudecode-skill.ts
5366
+ var ClaudecodeSkillFrontmatterSchema = import_mini21.z.looseObject({
5285
5367
  name: import_mini21.z.string(),
5286
- description: import_mini21.z.string()
5368
+ description: import_mini21.z.string(),
5369
+ "allowed-tools": import_mini21.z.optional(import_mini21.z.array(import_mini21.z.string()))
5287
5370
  });
5288
- var CursorSkill = class _CursorSkill extends ToolSkill {
5371
+ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5289
5372
  constructor({
5290
5373
  baseDir = process.cwd(),
5291
- relativeDirPath = (0, import_node_path46.join)(".cursor", "skills"),
5374
+ relativeDirPath = (0, import_node_path48.join)(".claude", "skills"),
5292
5375
  dirName,
5293
5376
  frontmatter,
5294
5377
  body,
@@ -5315,32 +5398,31 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5315
5398
  }
5316
5399
  }
5317
5400
  }
5318
- static getSettablePaths(options) {
5319
- if (options?.global) {
5320
- throw new Error("CursorSkill does not support global mode.");
5321
- }
5401
+ static getSettablePaths({
5402
+ global: _global = false
5403
+ } = {}) {
5322
5404
  return {
5323
- relativeDirPath: (0, import_node_path46.join)(".cursor", "skills")
5405
+ relativeDirPath: (0, import_node_path48.join)(".claude", "skills")
5324
5406
  };
5325
5407
  }
5326
5408
  getFrontmatter() {
5327
5409
  if (!this.mainFile?.frontmatter) {
5328
5410
  throw new Error("Frontmatter is not defined");
5329
5411
  }
5330
- const result = CursorSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5412
+ const result = ClaudecodeSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5331
5413
  return result;
5332
5414
  }
5333
5415
  getBody() {
5334
5416
  return this.mainFile?.body ?? "";
5335
5417
  }
5336
5418
  validate() {
5337
- if (!this.mainFile) {
5419
+ if (this.mainFile === void 0) {
5338
5420
  return {
5339
5421
  success: false,
5340
5422
  error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
5341
5423
  };
5342
5424
  }
5343
- const result = CursorSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5425
+ const result = ClaudecodeSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5344
5426
  if (!result.success) {
5345
5427
  return {
5346
5428
  success: false,
@@ -5356,7 +5438,12 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5356
5438
  const rulesyncFrontmatter = {
5357
5439
  name: frontmatter.name,
5358
5440
  description: frontmatter.description,
5359
- targets: ["*"]
5441
+ targets: ["*"],
5442
+ ...frontmatter["allowed-tools"] && {
5443
+ claudecode: {
5444
+ "allowed-tools": frontmatter["allowed-tools"]
5445
+ }
5446
+ }
5360
5447
  };
5361
5448
  return new RulesyncSkill({
5362
5449
  baseDir: this.baseDir,
@@ -5374,17 +5461,18 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5374
5461
  validate = true,
5375
5462
  global = false
5376
5463
  }) {
5377
- const settablePaths = _CursorSkill.getSettablePaths({ global });
5378
5464
  const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
5379
- const cursorFrontmatter = {
5465
+ const claudecodeFrontmatter = {
5380
5466
  name: rulesyncFrontmatter.name,
5381
- description: rulesyncFrontmatter.description
5467
+ description: rulesyncFrontmatter.description,
5468
+ "allowed-tools": rulesyncFrontmatter.claudecode?.["allowed-tools"]
5382
5469
  };
5383
- return new _CursorSkill({
5470
+ const settablePaths = _ClaudecodeSkill.getSettablePaths({ global });
5471
+ return new _ClaudecodeSkill({
5384
5472
  baseDir: rulesyncSkill.getBaseDir(),
5385
5473
  relativeDirPath: settablePaths.relativeDirPath,
5386
5474
  dirName: rulesyncSkill.getDirName(),
5387
- frontmatter: cursorFrontmatter,
5475
+ frontmatter: claudecodeFrontmatter,
5388
5476
  body: rulesyncSkill.getBody(),
5389
5477
  otherFiles: rulesyncSkill.getOtherFiles(),
5390
5478
  validate,
@@ -5393,21 +5481,21 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5393
5481
  }
5394
5482
  static isTargetedByRulesyncSkill(rulesyncSkill) {
5395
5483
  const targets = rulesyncSkill.getFrontmatter().targets;
5396
- return targets.includes("*") || targets.includes("cursor");
5484
+ return targets.includes("*") || targets.includes("claudecode");
5397
5485
  }
5398
5486
  static async fromDir(params) {
5399
5487
  const loaded = await this.loadSkillDirContent({
5400
5488
  ...params,
5401
- getSettablePaths: _CursorSkill.getSettablePaths
5489
+ getSettablePaths: _ClaudecodeSkill.getSettablePaths
5402
5490
  });
5403
- const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5491
+ const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5404
5492
  if (!result.success) {
5405
- const skillDirPath = (0, import_node_path46.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
5493
+ const skillDirPath = (0, import_node_path48.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
5406
5494
  throw new Error(
5407
- `Invalid frontmatter in ${(0, import_node_path46.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
5495
+ `Invalid frontmatter in ${(0, import_node_path48.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
5408
5496
  );
5409
5497
  }
5410
- return new _CursorSkill({
5498
+ return new _ClaudecodeSkill({
5411
5499
  baseDir: loaded.baseDir,
5412
5500
  relativeDirPath: loaded.relativeDirPath,
5413
5501
  dirName: loaded.dirName,
@@ -5424,10 +5512,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5424
5512
  dirName,
5425
5513
  global = false
5426
5514
  }) {
5427
- const settablePaths = _CursorSkill.getSettablePaths({ global });
5428
- return new _CursorSkill({
5515
+ return new _ClaudecodeSkill({
5429
5516
  baseDir,
5430
- relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
5517
+ relativeDirPath,
5431
5518
  dirName,
5432
5519
  frontmatter: { name: "", description: "" },
5433
5520
  body: "",
@@ -5438,100 +5525,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
5438
5525
  }
5439
5526
  };
5440
5527
 
5441
- // src/features/skills/geminicli-skill.ts
5442
- var import_node_path47 = require("path");
5443
- var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
5444
- static getSettablePaths(options) {
5445
- if (options?.global) {
5446
- throw new Error("GeminiCliSkill does not support global mode.");
5447
- }
5448
- return {
5449
- relativeDirPath: (0, import_node_path47.join)(".gemini", "skills")
5450
- };
5451
- }
5452
- static async fromDir(params) {
5453
- const baseParams = await this.fromDirDefault(params);
5454
- return new _GeminiCliSkill(baseParams);
5455
- }
5456
- static fromRulesyncSkill(params) {
5457
- const baseParams = {
5458
- ...this.fromRulesyncSkillDefault(params),
5459
- relativeDirPath: this.getSettablePaths().relativeDirPath
5460
- };
5461
- return new _GeminiCliSkill(baseParams);
5462
- }
5463
- static isTargetedByRulesyncSkill(rulesyncSkill) {
5464
- return this.isTargetedByRulesyncSkillDefault({
5465
- rulesyncSkill,
5466
- toolTarget: "geminicli"
5467
- });
5468
- }
5469
- static forDeletion(params) {
5470
- const baseParams = this.forDeletionDefault(params);
5471
- return new _GeminiCliSkill(baseParams);
5472
- }
5473
- };
5474
-
5475
- // src/features/skills/skills-processor.ts
5476
- var import_node_path53 = require("path");
5477
- var import_mini26 = require("zod/mini");
5478
-
5479
- // src/types/dir-feature-processor.ts
5480
- var import_node_path48 = require("path");
5481
- var DirFeatureProcessor = class {
5482
- baseDir;
5483
- constructor({ baseDir = process.cwd() }) {
5484
- this.baseDir = baseDir;
5485
- }
5486
- /**
5487
- * Return tool targets that this feature supports.
5488
- */
5489
- static getToolTargets(_params = {}) {
5490
- throw new Error("Not implemented");
5491
- }
5492
- /**
5493
- * Once converted to rulesync/tool dirs, write them to the filesystem.
5494
- * Returns the number of directories written.
5495
- */
5496
- async writeAiDirs(aiDirs) {
5497
- for (const aiDir of aiDirs) {
5498
- const dirPath = aiDir.getDirPath();
5499
- await ensureDir(dirPath);
5500
- const mainFile = aiDir.getMainFile();
5501
- if (mainFile) {
5502
- const mainFilePath = (0, import_node_path48.join)(dirPath, mainFile.name);
5503
- const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
5504
- const contentWithNewline = addTrailingNewline(content);
5505
- await writeFileContent(mainFilePath, contentWithNewline);
5506
- }
5507
- const otherFiles = aiDir.getOtherFiles();
5508
- for (const file of otherFiles) {
5509
- const filePath = (0, import_node_path48.join)(dirPath, file.relativeFilePathToDirPath);
5510
- const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
5511
- await writeFileContent(filePath, contentWithNewline);
5512
- }
5513
- }
5514
- return aiDirs.length;
5515
- }
5516
- async removeAiDirs(aiDirs) {
5517
- for (const aiDir of aiDirs) {
5518
- await removeDirectory(aiDir.getDirPath());
5519
- }
5520
- }
5521
- };
5522
-
5523
- // src/features/skills/claudecode-skill.ts
5528
+ // src/features/skills/codexcli-skill.ts
5524
5529
  var import_node_path49 = require("path");
5525
5530
  var import_mini22 = require("zod/mini");
5526
- var ClaudecodeSkillFrontmatterSchema = import_mini22.z.looseObject({
5531
+ var CodexCliSkillFrontmatterSchema = import_mini22.z.looseObject({
5527
5532
  name: import_mini22.z.string(),
5528
- description: import_mini22.z.string(),
5529
- "allowed-tools": import_mini22.z.optional(import_mini22.z.array(import_mini22.z.string()))
5533
+ description: import_mini22.z.string()
5530
5534
  });
5531
- var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5535
+ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5532
5536
  constructor({
5533
5537
  baseDir = process.cwd(),
5534
- relativeDirPath = (0, import_node_path49.join)(".claude", "skills"),
5538
+ relativeDirPath = (0, import_node_path49.join)(".codex", "skills"),
5535
5539
  dirName,
5536
5540
  frontmatter,
5537
5541
  body,
@@ -5558,31 +5562,32 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5558
5562
  }
5559
5563
  }
5560
5564
  }
5561
- static getSettablePaths({
5562
- global: _global = false
5563
- } = {}) {
5565
+ static getSettablePaths({ global = false } = {}) {
5566
+ if (!global) {
5567
+ throw new Error("CodexCliSkill only supports global mode. Please pass { global: true }.");
5568
+ }
5564
5569
  return {
5565
- relativeDirPath: (0, import_node_path49.join)(".claude", "skills")
5570
+ relativeDirPath: (0, import_node_path49.join)(".codex", "skills")
5566
5571
  };
5567
5572
  }
5568
5573
  getFrontmatter() {
5569
5574
  if (!this.mainFile?.frontmatter) {
5570
5575
  throw new Error("Frontmatter is not defined");
5571
5576
  }
5572
- const result = ClaudecodeSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5577
+ const result = CodexCliSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5573
5578
  return result;
5574
5579
  }
5575
5580
  getBody() {
5576
5581
  return this.mainFile?.body ?? "";
5577
5582
  }
5578
5583
  validate() {
5579
- if (this.mainFile === void 0) {
5584
+ if (!this.mainFile) {
5580
5585
  return {
5581
5586
  success: false,
5582
5587
  error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
5583
5588
  };
5584
5589
  }
5585
- const result = ClaudecodeSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5590
+ const result = CodexCliSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5586
5591
  if (!result.success) {
5587
5592
  return {
5588
5593
  success: false,
@@ -5598,12 +5603,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5598
5603
  const rulesyncFrontmatter = {
5599
5604
  name: frontmatter.name,
5600
5605
  description: frontmatter.description,
5601
- targets: ["*"],
5602
- ...frontmatter["allowed-tools"] && {
5603
- claudecode: {
5604
- "allowed-tools": frontmatter["allowed-tools"]
5605
- }
5606
- }
5606
+ targets: ["*"]
5607
5607
  };
5608
5608
  return new RulesyncSkill({
5609
5609
  baseDir: this.baseDir,
@@ -5621,18 +5621,17 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5621
5621
  validate = true,
5622
5622
  global = false
5623
5623
  }) {
5624
+ const settablePaths = _CodexCliSkill.getSettablePaths({ global });
5624
5625
  const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
5625
- const claudecodeFrontmatter = {
5626
+ const codexFrontmatter = {
5626
5627
  name: rulesyncFrontmatter.name,
5627
- description: rulesyncFrontmatter.description,
5628
- "allowed-tools": rulesyncFrontmatter.claudecode?.["allowed-tools"]
5628
+ description: rulesyncFrontmatter.description
5629
5629
  };
5630
- const settablePaths = _ClaudecodeSkill.getSettablePaths({ global });
5631
- return new _ClaudecodeSkill({
5630
+ return new _CodexCliSkill({
5632
5631
  baseDir: rulesyncSkill.getBaseDir(),
5633
5632
  relativeDirPath: settablePaths.relativeDirPath,
5634
5633
  dirName: rulesyncSkill.getDirName(),
5635
- frontmatter: claudecodeFrontmatter,
5634
+ frontmatter: codexFrontmatter,
5636
5635
  body: rulesyncSkill.getBody(),
5637
5636
  otherFiles: rulesyncSkill.getOtherFiles(),
5638
5637
  validate,
@@ -5641,21 +5640,21 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5641
5640
  }
5642
5641
  static isTargetedByRulesyncSkill(rulesyncSkill) {
5643
5642
  const targets = rulesyncSkill.getFrontmatter().targets;
5644
- return targets.includes("*") || targets.includes("claudecode");
5643
+ return targets.includes("*") || targets.includes("codexcli");
5645
5644
  }
5646
5645
  static async fromDir(params) {
5647
5646
  const loaded = await this.loadSkillDirContent({
5648
5647
  ...params,
5649
- getSettablePaths: _ClaudecodeSkill.getSettablePaths
5648
+ getSettablePaths: _CodexCliSkill.getSettablePaths
5650
5649
  });
5651
- const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5650
+ const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5652
5651
  if (!result.success) {
5653
5652
  const skillDirPath = (0, import_node_path49.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
5654
5653
  throw new Error(
5655
5654
  `Invalid frontmatter in ${(0, import_node_path49.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
5656
5655
  );
5657
5656
  }
5658
- return new _ClaudecodeSkill({
5657
+ return new _CodexCliSkill({
5659
5658
  baseDir: loaded.baseDir,
5660
5659
  relativeDirPath: loaded.relativeDirPath,
5661
5660
  dirName: loaded.dirName,
@@ -5672,7 +5671,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5672
5671
  dirName,
5673
5672
  global = false
5674
5673
  }) {
5675
- return new _ClaudecodeSkill({
5674
+ return new _CodexCliSkill({
5676
5675
  baseDir,
5677
5676
  relativeDirPath,
5678
5677
  dirName,
@@ -5685,17 +5684,18 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
5685
5684
  }
5686
5685
  };
5687
5686
 
5688
- // src/features/skills/codexcli-skill.ts
5687
+ // src/features/skills/copilot-skill.ts
5689
5688
  var import_node_path50 = require("path");
5690
5689
  var import_mini23 = require("zod/mini");
5691
- var CodexCliSkillFrontmatterSchema = import_mini23.z.looseObject({
5690
+ var CopilotSkillFrontmatterSchema = import_mini23.z.looseObject({
5692
5691
  name: import_mini23.z.string(),
5693
- description: import_mini23.z.string()
5692
+ description: import_mini23.z.string(),
5693
+ license: import_mini23.z.optional(import_mini23.z.string())
5694
5694
  });
5695
- var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5695
+ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5696
5696
  constructor({
5697
5697
  baseDir = process.cwd(),
5698
- relativeDirPath = (0, import_node_path50.join)(".codex", "skills"),
5698
+ relativeDirPath = (0, import_node_path50.join)(".github", "skills"),
5699
5699
  dirName,
5700
5700
  frontmatter,
5701
5701
  body,
@@ -5722,19 +5722,19 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5722
5722
  }
5723
5723
  }
5724
5724
  }
5725
- static getSettablePaths({ global = false } = {}) {
5726
- if (!global) {
5727
- throw new Error("CodexCliSkill only supports global mode. Please pass { global: true }.");
5725
+ static getSettablePaths(options) {
5726
+ if (options?.global) {
5727
+ throw new Error("CopilotSkill does not support global mode.");
5728
5728
  }
5729
5729
  return {
5730
- relativeDirPath: (0, import_node_path50.join)(".codex", "skills")
5730
+ relativeDirPath: (0, import_node_path50.join)(".github", "skills")
5731
5731
  };
5732
5732
  }
5733
5733
  getFrontmatter() {
5734
5734
  if (!this.mainFile?.frontmatter) {
5735
5735
  throw new Error("Frontmatter is not defined");
5736
5736
  }
5737
- const result = CodexCliSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5737
+ const result = CopilotSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5738
5738
  return result;
5739
5739
  }
5740
5740
  getBody() {
@@ -5747,7 +5747,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5747
5747
  error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
5748
5748
  };
5749
5749
  }
5750
- const result = CodexCliSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5750
+ const result = CopilotSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5751
5751
  if (!result.success) {
5752
5752
  return {
5753
5753
  success: false,
@@ -5763,7 +5763,12 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5763
5763
  const rulesyncFrontmatter = {
5764
5764
  name: frontmatter.name,
5765
5765
  description: frontmatter.description,
5766
- targets: ["*"]
5766
+ targets: ["*"],
5767
+ ...frontmatter.license && {
5768
+ copilot: {
5769
+ license: frontmatter.license
5770
+ }
5771
+ }
5767
5772
  };
5768
5773
  return new RulesyncSkill({
5769
5774
  baseDir: this.baseDir,
@@ -5781,17 +5786,18 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5781
5786
  validate = true,
5782
5787
  global = false
5783
5788
  }) {
5784
- const settablePaths = _CodexCliSkill.getSettablePaths({ global });
5789
+ const settablePaths = _CopilotSkill.getSettablePaths({ global });
5785
5790
  const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
5786
- const codexFrontmatter = {
5791
+ const copilotFrontmatter = {
5787
5792
  name: rulesyncFrontmatter.name,
5788
- description: rulesyncFrontmatter.description
5793
+ description: rulesyncFrontmatter.description,
5794
+ license: rulesyncFrontmatter.copilot?.license
5789
5795
  };
5790
- return new _CodexCliSkill({
5796
+ return new _CopilotSkill({
5791
5797
  baseDir: rulesyncSkill.getBaseDir(),
5792
5798
  relativeDirPath: settablePaths.relativeDirPath,
5793
5799
  dirName: rulesyncSkill.getDirName(),
5794
- frontmatter: codexFrontmatter,
5800
+ frontmatter: copilotFrontmatter,
5795
5801
  body: rulesyncSkill.getBody(),
5796
5802
  otherFiles: rulesyncSkill.getOtherFiles(),
5797
5803
  validate,
@@ -5800,21 +5806,21 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5800
5806
  }
5801
5807
  static isTargetedByRulesyncSkill(rulesyncSkill) {
5802
5808
  const targets = rulesyncSkill.getFrontmatter().targets;
5803
- return targets.includes("*") || targets.includes("codexcli");
5809
+ return targets.includes("*") || targets.includes("copilot");
5804
5810
  }
5805
5811
  static async fromDir(params) {
5806
5812
  const loaded = await this.loadSkillDirContent({
5807
5813
  ...params,
5808
- getSettablePaths: _CodexCliSkill.getSettablePaths
5814
+ getSettablePaths: _CopilotSkill.getSettablePaths
5809
5815
  });
5810
- const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5816
+ const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5811
5817
  if (!result.success) {
5812
5818
  const skillDirPath = (0, import_node_path50.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
5813
5819
  throw new Error(
5814
5820
  `Invalid frontmatter in ${(0, import_node_path50.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
5815
5821
  );
5816
5822
  }
5817
- return new _CodexCliSkill({
5823
+ return new _CopilotSkill({
5818
5824
  baseDir: loaded.baseDir,
5819
5825
  relativeDirPath: loaded.relativeDirPath,
5820
5826
  dirName: loaded.dirName,
@@ -5831,9 +5837,10 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5831
5837
  dirName,
5832
5838
  global = false
5833
5839
  }) {
5834
- return new _CodexCliSkill({
5840
+ const settablePaths = _CopilotSkill.getSettablePaths({ global });
5841
+ return new _CopilotSkill({
5835
5842
  baseDir,
5836
- relativeDirPath,
5843
+ relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
5837
5844
  dirName,
5838
5845
  frontmatter: { name: "", description: "" },
5839
5846
  body: "",
@@ -5844,18 +5851,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
5844
5851
  }
5845
5852
  };
5846
5853
 
5847
- // src/features/skills/copilot-skill.ts
5854
+ // src/features/skills/cursor-skill.ts
5848
5855
  var import_node_path51 = require("path");
5849
5856
  var import_mini24 = require("zod/mini");
5850
- var CopilotSkillFrontmatterSchema = import_mini24.z.looseObject({
5857
+ var CursorSkillFrontmatterSchema = import_mini24.z.looseObject({
5851
5858
  name: import_mini24.z.string(),
5852
- description: import_mini24.z.string(),
5853
- license: import_mini24.z.optional(import_mini24.z.string())
5859
+ description: import_mini24.z.string()
5854
5860
  });
5855
- var CopilotSkill = class _CopilotSkill extends ToolSkill {
5861
+ var CursorSkill = class _CursorSkill extends ToolSkill {
5856
5862
  constructor({
5857
5863
  baseDir = process.cwd(),
5858
- relativeDirPath = (0, import_node_path51.join)(".github", "skills"),
5864
+ relativeDirPath = (0, import_node_path51.join)(".cursor", "skills"),
5859
5865
  dirName,
5860
5866
  frontmatter,
5861
5867
  body,
@@ -5884,17 +5890,17 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5884
5890
  }
5885
5891
  static getSettablePaths(options) {
5886
5892
  if (options?.global) {
5887
- throw new Error("CopilotSkill does not support global mode.");
5893
+ throw new Error("CursorSkill does not support global mode.");
5888
5894
  }
5889
5895
  return {
5890
- relativeDirPath: (0, import_node_path51.join)(".github", "skills")
5896
+ relativeDirPath: (0, import_node_path51.join)(".cursor", "skills")
5891
5897
  };
5892
5898
  }
5893
5899
  getFrontmatter() {
5894
5900
  if (!this.mainFile?.frontmatter) {
5895
5901
  throw new Error("Frontmatter is not defined");
5896
5902
  }
5897
- const result = CopilotSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5903
+ const result = CursorSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
5898
5904
  return result;
5899
5905
  }
5900
5906
  getBody() {
@@ -5907,7 +5913,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5907
5913
  error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
5908
5914
  };
5909
5915
  }
5910
- const result = CopilotSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5916
+ const result = CursorSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
5911
5917
  if (!result.success) {
5912
5918
  return {
5913
5919
  success: false,
@@ -5923,12 +5929,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5923
5929
  const rulesyncFrontmatter = {
5924
5930
  name: frontmatter.name,
5925
5931
  description: frontmatter.description,
5926
- targets: ["*"],
5927
- ...frontmatter.license && {
5928
- copilot: {
5929
- license: frontmatter.license
5930
- }
5931
- }
5932
+ targets: ["*"]
5932
5933
  };
5933
5934
  return new RulesyncSkill({
5934
5935
  baseDir: this.baseDir,
@@ -5946,18 +5947,17 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5946
5947
  validate = true,
5947
5948
  global = false
5948
5949
  }) {
5949
- const settablePaths = _CopilotSkill.getSettablePaths({ global });
5950
+ const settablePaths = _CursorSkill.getSettablePaths({ global });
5950
5951
  const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
5951
- const copilotFrontmatter = {
5952
+ const cursorFrontmatter = {
5952
5953
  name: rulesyncFrontmatter.name,
5953
- description: rulesyncFrontmatter.description,
5954
- license: rulesyncFrontmatter.copilot?.license
5954
+ description: rulesyncFrontmatter.description
5955
5955
  };
5956
- return new _CopilotSkill({
5956
+ return new _CursorSkill({
5957
5957
  baseDir: rulesyncSkill.getBaseDir(),
5958
5958
  relativeDirPath: settablePaths.relativeDirPath,
5959
5959
  dirName: rulesyncSkill.getDirName(),
5960
- frontmatter: copilotFrontmatter,
5960
+ frontmatter: cursorFrontmatter,
5961
5961
  body: rulesyncSkill.getBody(),
5962
5962
  otherFiles: rulesyncSkill.getOtherFiles(),
5963
5963
  validate,
@@ -5966,21 +5966,21 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5966
5966
  }
5967
5967
  static isTargetedByRulesyncSkill(rulesyncSkill) {
5968
5968
  const targets = rulesyncSkill.getFrontmatter().targets;
5969
- return targets.includes("*") || targets.includes("copilot");
5969
+ return targets.includes("*") || targets.includes("cursor");
5970
5970
  }
5971
5971
  static async fromDir(params) {
5972
5972
  const loaded = await this.loadSkillDirContent({
5973
5973
  ...params,
5974
- getSettablePaths: _CopilotSkill.getSettablePaths
5974
+ getSettablePaths: _CursorSkill.getSettablePaths
5975
5975
  });
5976
- const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5976
+ const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
5977
5977
  if (!result.success) {
5978
5978
  const skillDirPath = (0, import_node_path51.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
5979
5979
  throw new Error(
5980
5980
  `Invalid frontmatter in ${(0, import_node_path51.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
5981
5981
  );
5982
5982
  }
5983
- return new _CopilotSkill({
5983
+ return new _CursorSkill({
5984
5984
  baseDir: loaded.baseDir,
5985
5985
  relativeDirPath: loaded.relativeDirPath,
5986
5986
  dirName: loaded.dirName,
@@ -5997,8 +5997,8 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
5997
5997
  dirName,
5998
5998
  global = false
5999
5999
  }) {
6000
- const settablePaths = _CopilotSkill.getSettablePaths({ global });
6001
- return new _CopilotSkill({
6000
+ const settablePaths = _CursorSkill.getSettablePaths({ global });
6001
+ return new _CursorSkill({
6002
6002
  baseDir,
6003
6003
  relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
6004
6004
  dirName,
@@ -10026,8 +10026,7 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
10026
10026
  supportsGlobal: false,
10027
10027
  ruleDiscoveryMode: "auto",
10028
10028
  additionalConventions: {
10029
- subagents: { subagentClass: CursorSubagent },
10030
- skills: { skillClass: CursorSkill }
10029
+ subagents: { subagentClass: CursorSubagent }
10031
10030
  },
10032
10031
  createsSeparateConventionsRule: true
10033
10032
  }
@@ -12491,7 +12490,7 @@ async function mcpCommand({ version }) {
12491
12490
  }
12492
12491
 
12493
12492
  // src/cli/index.ts
12494
- var getVersion = () => "4.3.0";
12493
+ var getVersion = () => "4.3.2";
12495
12494
  var main = async () => {
12496
12495
  const program = new import_commander.Command();
12497
12496
  const version = getVersion();