rulesync 3.0.0 → 3.1.1

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
@@ -95,7 +95,7 @@ var logger = new Logger();
95
95
  var import_es_toolkit2 = require("es-toolkit");
96
96
 
97
97
  // src/commands/commands-processor.ts
98
- var import_node_path11 = require("path");
98
+ var import_node_path12 = require("path");
99
99
  var import_mini8 = require("zod/mini");
100
100
 
101
101
  // src/utils/file.ts
@@ -122,6 +122,12 @@ async function readFileContent(filepath) {
122
122
  logger.debug(`Reading file: ${filepath}`);
123
123
  return (0, import_promises.readFile)(filepath, "utf-8");
124
124
  }
125
+ function addTrailingNewline(content) {
126
+ if (!content) {
127
+ return "\n";
128
+ }
129
+ return content.trimEnd() + "\n";
130
+ }
125
131
  async function writeFileContent(filepath, content) {
126
132
  logger.debug(`Writing file: ${filepath}`);
127
133
  await ensureDir((0, import_node_path.dirname)(filepath));
@@ -199,7 +205,8 @@ var FeatureProcessor = class {
199
205
  */
200
206
  async writeAiFiles(aiFiles) {
201
207
  for (const aiFile of aiFiles) {
202
- await writeFileContent(aiFile.getFilePath(), aiFile.getFileContent());
208
+ const contentWithNewline = addTrailingNewline(aiFile.getFileContent());
209
+ await writeFileContent(aiFile.getFilePath(), contentWithNewline);
203
210
  }
204
211
  return aiFiles.length;
205
212
  }
@@ -210,9 +217,8 @@ var FeatureProcessor = class {
210
217
  }
211
218
  };
212
219
 
213
- // src/commands/claudecode-command.ts
220
+ // src/commands/agentsmd-command.ts
214
221
  var import_node_path4 = require("path");
215
- var import_mini4 = require("zod/mini");
216
222
 
217
223
  // src/utils/frontmatter.ts
218
224
  var import_gray_matter = __toESM(require("gray-matter"), 1);
@@ -263,9 +269,9 @@ function parseFrontmatter(content) {
263
269
  return { frontmatter, body };
264
270
  }
265
271
 
266
- // src/commands/rulesync-command.ts
272
+ // src/commands/simulated-command.ts
267
273
  var import_node_path3 = require("path");
268
- var import_mini3 = require("zod/mini");
274
+ var import_mini2 = require("zod/mini");
269
275
 
270
276
  // src/types/ai-file.ts
271
277
  var import_node_path2 = __toESM(require("path"), 1);
@@ -345,6 +351,220 @@ var AiFile = class {
345
351
  }
346
352
  };
347
353
 
354
+ // src/commands/tool-command.ts
355
+ var ToolCommand = class extends AiFile {
356
+ static getSettablePaths() {
357
+ throw new Error("Please implement this method in the subclass.");
358
+ }
359
+ /**
360
+ * Load a command from a tool-specific file path.
361
+ *
362
+ * This method should:
363
+ * 1. Read the file content
364
+ * 2. Parse tool-specific frontmatter format
365
+ * 3. Validate the parsed data
366
+ * 4. Return a concrete ToolCommand instance
367
+ *
368
+ * @param params - Parameters including the file path to load
369
+ * @returns Promise resolving to a concrete ToolCommand instance
370
+ */
371
+ static async fromFile(_params) {
372
+ throw new Error("Please implement this method in the subclass.");
373
+ }
374
+ /**
375
+ * Convert a RulesyncCommand to the tool-specific command format.
376
+ *
377
+ * This method should:
378
+ * 1. Extract relevant data from the RulesyncCommand
379
+ * 2. Transform frontmatter to tool-specific format
380
+ * 3. Transform body content if needed
381
+ * 4. Return a concrete ToolCommand instance
382
+ *
383
+ * @param params - Parameters including the RulesyncCommand to convert
384
+ * @returns A concrete ToolCommand instance
385
+ */
386
+ static fromRulesyncCommand(_params) {
387
+ throw new Error("Please implement this method in the subclass.");
388
+ }
389
+ /**
390
+ * Check if this tool is targeted by a RulesyncCommand based on its targets field.
391
+ * Subclasses should override this to provide specific targeting logic.
392
+ *
393
+ * @param rulesyncCommand - The RulesyncCommand to check
394
+ * @returns True if this tool is targeted by the command
395
+ */
396
+ static isTargetedByRulesyncCommand(_rulesyncCommand) {
397
+ throw new Error("Please implement this method in the subclass.");
398
+ }
399
+ /**
400
+ * Default implementation for checking if a tool is targeted by a RulesyncCommand.
401
+ * Checks if the command's targets include the tool target or a wildcard.
402
+ *
403
+ * @param params - Parameters including the RulesyncCommand and tool target
404
+ * @returns True if the tool target is included in the command's targets
405
+ */
406
+ static isTargetedByRulesyncCommandDefault({
407
+ rulesyncCommand,
408
+ toolTarget
409
+ }) {
410
+ const targets = rulesyncCommand.getFrontmatter().targets;
411
+ if (!targets) {
412
+ return true;
413
+ }
414
+ if (targets.includes("*")) {
415
+ return true;
416
+ }
417
+ if (targets.includes(toolTarget)) {
418
+ return true;
419
+ }
420
+ return false;
421
+ }
422
+ };
423
+
424
+ // src/commands/simulated-command.ts
425
+ var SimulatedCommandFrontmatterSchema = import_mini2.z.object({
426
+ description: import_mini2.z.string()
427
+ });
428
+ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
429
+ frontmatter;
430
+ body;
431
+ constructor({ frontmatter, body, ...rest }) {
432
+ if (rest.validate) {
433
+ const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
434
+ if (!result.success) {
435
+ throw result.error;
436
+ }
437
+ }
438
+ super({
439
+ ...rest,
440
+ fileContent: stringifyFrontmatter(body, frontmatter)
441
+ });
442
+ this.frontmatter = frontmatter;
443
+ this.body = body;
444
+ }
445
+ getBody() {
446
+ return this.body;
447
+ }
448
+ getFrontmatter() {
449
+ return this.frontmatter;
450
+ }
451
+ toRulesyncCommand() {
452
+ throw new Error("Not implemented because it is a SIMULATED file.");
453
+ }
454
+ static fromRulesyncCommandDefault({
455
+ baseDir = ".",
456
+ rulesyncCommand,
457
+ validate = true
458
+ }) {
459
+ const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
460
+ const claudecodeFrontmatter = {
461
+ description: rulesyncFrontmatter.description
462
+ };
463
+ const body = rulesyncCommand.getBody();
464
+ return {
465
+ baseDir,
466
+ frontmatter: claudecodeFrontmatter,
467
+ body,
468
+ relativeDirPath: this.getSettablePaths().relativeDirPath,
469
+ relativeFilePath: rulesyncCommand.getRelativeFilePath(),
470
+ validate
471
+ };
472
+ }
473
+ validate() {
474
+ if (!this.frontmatter) {
475
+ return { success: true, error: null };
476
+ }
477
+ const result = SimulatedCommandFrontmatterSchema.safeParse(this.frontmatter);
478
+ if (result.success) {
479
+ return { success: true, error: null };
480
+ } else {
481
+ return { success: false, error: result.error };
482
+ }
483
+ }
484
+ static async fromFileDefault({
485
+ baseDir = ".",
486
+ relativeFilePath,
487
+ validate = true
488
+ }) {
489
+ const filePath = (0, import_node_path3.join)(
490
+ baseDir,
491
+ _SimulatedCommand.getSettablePaths().relativeDirPath,
492
+ relativeFilePath
493
+ );
494
+ const fileContent = await readFileContent(filePath);
495
+ const { frontmatter, body: content } = parseFrontmatter(fileContent);
496
+ const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
497
+ if (!result.success) {
498
+ throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
499
+ }
500
+ return {
501
+ baseDir,
502
+ relativeDirPath: _SimulatedCommand.getSettablePaths().relativeDirPath,
503
+ relativeFilePath: (0, import_node_path3.basename)(relativeFilePath),
504
+ frontmatter: result.data,
505
+ body: content.trim(),
506
+ validate
507
+ };
508
+ }
509
+ };
510
+
511
+ // src/commands/agentsmd-command.ts
512
+ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
513
+ static getSettablePaths() {
514
+ return {
515
+ relativeDirPath: ".agents/commands"
516
+ };
517
+ }
518
+ static fromRulesyncCommand({
519
+ baseDir = ".",
520
+ rulesyncCommand,
521
+ validate = true
522
+ }) {
523
+ return new _AgentsmdCommand(
524
+ this.fromRulesyncCommandDefault({ baseDir, rulesyncCommand, validate })
525
+ );
526
+ }
527
+ static async fromFile({
528
+ baseDir = ".",
529
+ relativeFilePath,
530
+ validate = true
531
+ }) {
532
+ const filePath = (0, import_node_path4.join)(
533
+ baseDir,
534
+ _AgentsmdCommand.getSettablePaths().relativeDirPath,
535
+ relativeFilePath
536
+ );
537
+ const fileContent = await readFileContent(filePath);
538
+ const { frontmatter, body: content } = parseFrontmatter(fileContent);
539
+ const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
540
+ if (!result.success) {
541
+ throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
542
+ }
543
+ return new _AgentsmdCommand({
544
+ baseDir,
545
+ relativeDirPath: _AgentsmdCommand.getSettablePaths().relativeDirPath,
546
+ relativeFilePath: (0, import_node_path4.basename)(relativeFilePath),
547
+ frontmatter: result.data,
548
+ body: content.trim(),
549
+ validate
550
+ });
551
+ }
552
+ static isTargetedByRulesyncCommand(rulesyncCommand) {
553
+ return this.isTargetedByRulesyncCommandDefault({
554
+ rulesyncCommand,
555
+ toolTarget: "agentsmd"
556
+ });
557
+ }
558
+ };
559
+
560
+ // src/commands/claudecode-command.ts
561
+ var import_node_path6 = require("path");
562
+ var import_mini5 = require("zod/mini");
563
+
564
+ // src/commands/rulesync-command.ts
565
+ var import_node_path5 = require("path");
566
+ var import_mini4 = require("zod/mini");
567
+
348
568
  // src/types/rulesync-file.ts
349
569
  var RulesyncFile = class extends AiFile {
350
570
  static async fromFile(_params) {
@@ -356,7 +576,7 @@ var RulesyncFile = class extends AiFile {
356
576
  };
357
577
 
358
578
  // src/types/tool-targets.ts
359
- var import_mini2 = require("zod/mini");
579
+ var import_mini3 = require("zod/mini");
360
580
  var ALL_TOOL_TARGETS = [
361
581
  "agentsmd",
362
582
  "amazonqcli",
@@ -377,14 +597,14 @@ var ALL_TOOL_TARGETS = [
377
597
  "windsurf"
378
598
  ];
379
599
  var ALL_TOOL_TARGETS_WITH_WILDCARD = [...ALL_TOOL_TARGETS, "*"];
380
- var ToolTargetSchema = import_mini2.z.enum(ALL_TOOL_TARGETS);
381
- var ToolTargetsSchema = import_mini2.z.array(ToolTargetSchema);
382
- var RulesyncTargetsSchema = import_mini2.z.array(import_mini2.z.enum(ALL_TOOL_TARGETS_WITH_WILDCARD));
600
+ var ToolTargetSchema = import_mini3.z.enum(ALL_TOOL_TARGETS);
601
+ var ToolTargetsSchema = import_mini3.z.array(ToolTargetSchema);
602
+ var RulesyncTargetsSchema = import_mini3.z.array(import_mini3.z.enum(ALL_TOOL_TARGETS_WITH_WILDCARD));
383
603
 
384
604
  // src/commands/rulesync-command.ts
385
- var RulesyncCommandFrontmatterSchema = import_mini3.z.object({
605
+ var RulesyncCommandFrontmatterSchema = import_mini4.z.object({
386
606
  targets: RulesyncTargetsSchema,
387
- description: import_mini3.z.string()
607
+ description: import_mini4.z.string()
388
608
  });
389
609
  var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
390
610
  frontmatter;
@@ -429,14 +649,14 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
429
649
  relativeFilePath
430
650
  }) {
431
651
  const fileContent = await readFileContent(
432
- (0, import_node_path3.join)(_RulesyncCommand.getSettablePaths().relativeDirPath, relativeFilePath)
652
+ (0, import_node_path5.join)(_RulesyncCommand.getSettablePaths().relativeDirPath, relativeFilePath)
433
653
  );
434
654
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
435
655
  const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
436
656
  if (!result.success) {
437
657
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
438
658
  }
439
- const filename = (0, import_node_path3.basename)(relativeFilePath);
659
+ const filename = (0, import_node_path5.basename)(relativeFilePath);
440
660
  return new _RulesyncCommand({
441
661
  baseDir: ".",
442
662
  relativeDirPath: _RulesyncCommand.getSettablePaths().relativeDirPath,
@@ -448,79 +668,9 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
448
668
  }
449
669
  };
450
670
 
451
- // src/commands/tool-command.ts
452
- var ToolCommand = class extends AiFile {
453
- static getSettablePaths() {
454
- throw new Error("Please implement this method in the subclass.");
455
- }
456
- /**
457
- * Load a command from a tool-specific file path.
458
- *
459
- * This method should:
460
- * 1. Read the file content
461
- * 2. Parse tool-specific frontmatter format
462
- * 3. Validate the parsed data
463
- * 4. Return a concrete ToolCommand instance
464
- *
465
- * @param params - Parameters including the file path to load
466
- * @returns Promise resolving to a concrete ToolCommand instance
467
- */
468
- static async fromFile(_params) {
469
- throw new Error("Please implement this method in the subclass.");
470
- }
471
- /**
472
- * Convert a RulesyncCommand to the tool-specific command format.
473
- *
474
- * This method should:
475
- * 1. Extract relevant data from the RulesyncCommand
476
- * 2. Transform frontmatter to tool-specific format
477
- * 3. Transform body content if needed
478
- * 4. Return a concrete ToolCommand instance
479
- *
480
- * @param params - Parameters including the RulesyncCommand to convert
481
- * @returns A concrete ToolCommand instance
482
- */
483
- static fromRulesyncCommand(_params) {
484
- throw new Error("Please implement this method in the subclass.");
485
- }
486
- /**
487
- * Check if this tool is targeted by a RulesyncCommand based on its targets field.
488
- * Subclasses should override this to provide specific targeting logic.
489
- *
490
- * @param rulesyncCommand - The RulesyncCommand to check
491
- * @returns True if this tool is targeted by the command
492
- */
493
- static isTargetedByRulesyncCommand(_rulesyncCommand) {
494
- throw new Error("Please implement this method in the subclass.");
495
- }
496
- /**
497
- * Default implementation for checking if a tool is targeted by a RulesyncCommand.
498
- * Checks if the command's targets include the tool target or a wildcard.
499
- *
500
- * @param params - Parameters including the RulesyncCommand and tool target
501
- * @returns True if the tool target is included in the command's targets
502
- */
503
- static isTargetedByRulesyncCommandDefault({
504
- rulesyncCommand,
505
- toolTarget
506
- }) {
507
- const targets = rulesyncCommand.getFrontmatter().targets;
508
- if (!targets) {
509
- return true;
510
- }
511
- if (targets.includes("*")) {
512
- return true;
513
- }
514
- if (targets.includes(toolTarget)) {
515
- return true;
516
- }
517
- return false;
518
- }
519
- };
520
-
521
671
  // src/commands/claudecode-command.ts
522
- var ClaudecodeCommandFrontmatterSchema = import_mini4.z.object({
523
- description: import_mini4.z.string()
672
+ var ClaudecodeCommandFrontmatterSchema = import_mini5.z.object({
673
+ description: import_mini5.z.string()
524
674
  });
525
675
  var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
526
676
  frontmatter;
@@ -546,7 +696,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
546
696
  }
547
697
  static getSettablePathsGlobal() {
548
698
  return {
549
- relativeDirPath: (0, import_node_path4.join)(".claude", "commands")
699
+ relativeDirPath: (0, import_node_path6.join)(".claude", "commands")
550
700
  };
551
701
  }
552
702
  getBody() {
@@ -617,7 +767,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
617
767
  global = false
618
768
  }) {
619
769
  const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
620
- const filePath = (0, import_node_path4.join)(baseDir, paths.relativeDirPath, relativeFilePath);
770
+ const filePath = (0, import_node_path6.join)(baseDir, paths.relativeDirPath, relativeFilePath);
621
771
  const fileContent = await readFileContent(filePath);
622
772
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
623
773
  const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
@@ -627,7 +777,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
627
777
  return new _ClaudecodeCommand({
628
778
  baseDir,
629
779
  relativeDirPath: paths.relativeDirPath,
630
- relativeFilePath: (0, import_node_path4.basename)(relativeFilePath),
780
+ relativeFilePath: (0, import_node_path6.basename)(relativeFilePath),
631
781
  frontmatter: result.data,
632
782
  body: content.trim(),
633
783
  validate
@@ -636,14 +786,14 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
636
786
  };
637
787
 
638
788
  // src/commands/codexcli-command.ts
639
- var import_node_path5 = require("path");
789
+ var import_node_path7 = require("path");
640
790
  var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
641
791
  static getSettablePaths() {
642
792
  throw new Error("getSettablePaths is not supported for CodexcliCommand");
643
793
  }
644
794
  static getSettablePathsGlobal() {
645
795
  return {
646
- relativeDirPath: (0, import_node_path5.join)(".codex", "prompts")
796
+ relativeDirPath: (0, import_node_path7.join)(".codex", "prompts")
647
797
  };
648
798
  }
649
799
  toRulesyncCommand() {
@@ -663,145 +813,54 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
663
813
  });
664
814
  }
665
815
  static fromRulesyncCommand({
666
- baseDir = ".",
667
- rulesyncCommand,
668
- validate = true,
669
- global = false
670
- }) {
671
- const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
672
- return new _CodexcliCommand({
673
- baseDir,
674
- fileContent: rulesyncCommand.getBody(),
675
- relativeDirPath: paths.relativeDirPath,
676
- relativeFilePath: rulesyncCommand.getRelativeFilePath(),
677
- validate
678
- });
679
- }
680
- validate() {
681
- return { success: true, error: null };
682
- }
683
- getBody() {
684
- return this.getFileContent();
685
- }
686
- static isTargetedByRulesyncCommand(rulesyncCommand) {
687
- return this.isTargetedByRulesyncCommandDefault({
688
- rulesyncCommand,
689
- toolTarget: "codexcli"
690
- });
691
- }
692
- static async fromFile({
693
- baseDir = ".",
694
- relativeFilePath,
695
- validate = true,
696
- global = false
697
- }) {
698
- const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
699
- const filePath = (0, import_node_path5.join)(baseDir, paths.relativeDirPath, relativeFilePath);
700
- const fileContent = await readFileContent(filePath);
701
- const { body: content } = parseFrontmatter(fileContent);
702
- return new _CodexcliCommand({
703
- baseDir,
704
- relativeDirPath: paths.relativeDirPath,
705
- relativeFilePath: (0, import_node_path5.basename)(relativeFilePath),
706
- fileContent: content.trim(),
707
- validate
708
- });
709
- }
710
- };
711
-
712
- // src/commands/copilot-command.ts
713
- var import_node_path7 = require("path");
714
-
715
- // src/commands/simulated-command.ts
716
- var import_node_path6 = require("path");
717
- var import_mini5 = require("zod/mini");
718
- var SimulatedCommandFrontmatterSchema = import_mini5.z.object({
719
- description: import_mini5.z.string()
720
- });
721
- var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
722
- frontmatter;
723
- body;
724
- constructor({ frontmatter, body, ...rest }) {
725
- if (rest.validate) {
726
- const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
727
- if (!result.success) {
728
- throw result.error;
729
- }
730
- }
731
- super({
732
- ...rest,
733
- fileContent: stringifyFrontmatter(body, frontmatter)
734
- });
735
- this.frontmatter = frontmatter;
736
- this.body = body;
737
- }
738
- getBody() {
739
- return this.body;
740
- }
741
- getFrontmatter() {
742
- return this.frontmatter;
743
- }
744
- toRulesyncCommand() {
745
- throw new Error("Not implemented because it is a SIMULATED file.");
746
- }
747
- static fromRulesyncCommandDefault({
748
- baseDir = ".",
749
- rulesyncCommand,
750
- validate = true
751
- }) {
752
- const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
753
- const claudecodeFrontmatter = {
754
- description: rulesyncFrontmatter.description
755
- };
756
- const body = rulesyncCommand.getBody();
757
- return {
816
+ baseDir = ".",
817
+ rulesyncCommand,
818
+ validate = true,
819
+ global = false
820
+ }) {
821
+ const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
822
+ return new _CodexcliCommand({
758
823
  baseDir,
759
- frontmatter: claudecodeFrontmatter,
760
- body,
761
- relativeDirPath: this.getSettablePaths().relativeDirPath,
824
+ fileContent: rulesyncCommand.getBody(),
825
+ relativeDirPath: paths.relativeDirPath,
762
826
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
763
827
  validate
764
- };
828
+ });
765
829
  }
766
830
  validate() {
767
- if (!this.frontmatter) {
768
- return { success: true, error: null };
769
- }
770
- const result = SimulatedCommandFrontmatterSchema.safeParse(this.frontmatter);
771
- if (result.success) {
772
- return { success: true, error: null };
773
- } else {
774
- return { success: false, error: result.error };
775
- }
831
+ return { success: true, error: null };
776
832
  }
777
- static async fromFileDefault({
833
+ getBody() {
834
+ return this.getFileContent();
835
+ }
836
+ static isTargetedByRulesyncCommand(rulesyncCommand) {
837
+ return this.isTargetedByRulesyncCommandDefault({
838
+ rulesyncCommand,
839
+ toolTarget: "codexcli"
840
+ });
841
+ }
842
+ static async fromFile({
778
843
  baseDir = ".",
779
844
  relativeFilePath,
780
- validate = true
845
+ validate = true,
846
+ global = false
781
847
  }) {
782
- const filePath = (0, import_node_path6.join)(
783
- baseDir,
784
- _SimulatedCommand.getSettablePaths().relativeDirPath,
785
- relativeFilePath
786
- );
848
+ const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
849
+ const filePath = (0, import_node_path7.join)(baseDir, paths.relativeDirPath, relativeFilePath);
787
850
  const fileContent = await readFileContent(filePath);
788
- const { frontmatter, body: content } = parseFrontmatter(fileContent);
789
- const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
790
- if (!result.success) {
791
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
792
- }
793
- return {
851
+ const { body: content } = parseFrontmatter(fileContent);
852
+ return new _CodexcliCommand({
794
853
  baseDir,
795
- relativeDirPath: _SimulatedCommand.getSettablePaths().relativeDirPath,
796
- relativeFilePath: (0, import_node_path6.basename)(relativeFilePath),
797
- frontmatter: result.data,
798
- body: content.trim(),
854
+ relativeDirPath: paths.relativeDirPath,
855
+ relativeFilePath: (0, import_node_path7.basename)(relativeFilePath),
856
+ fileContent: content.trim(),
799
857
  validate
800
- };
858
+ });
801
859
  }
802
860
  };
803
861
 
804
862
  // src/commands/copilot-command.ts
863
+ var import_node_path8 = require("path");
805
864
  var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
806
865
  static getSettablePaths() {
807
866
  return {
@@ -822,7 +881,7 @@ var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
822
881
  relativeFilePath,
823
882
  validate = true
824
883
  }) {
825
- const filePath = (0, import_node_path7.join)(
884
+ const filePath = (0, import_node_path8.join)(
826
885
  baseDir,
827
886
  _CopilotCommand.getSettablePaths().relativeDirPath,
828
887
  relativeFilePath
@@ -836,7 +895,7 @@ var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
836
895
  return new _CopilotCommand({
837
896
  baseDir,
838
897
  relativeDirPath: _CopilotCommand.getSettablePaths().relativeDirPath,
839
- relativeFilePath: (0, import_node_path7.basename)(relativeFilePath),
898
+ relativeFilePath: (0, import_node_path8.basename)(relativeFilePath),
840
899
  frontmatter: result.data,
841
900
  body: content.trim(),
842
901
  validate
@@ -851,16 +910,16 @@ var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
851
910
  };
852
911
 
853
912
  // src/commands/cursor-command.ts
854
- var import_node_path8 = require("path");
913
+ var import_node_path9 = require("path");
855
914
  var CursorCommand = class _CursorCommand extends ToolCommand {
856
915
  static getSettablePaths() {
857
916
  return {
858
- relativeDirPath: (0, import_node_path8.join)(".cursor", "commands")
917
+ relativeDirPath: (0, import_node_path9.join)(".cursor", "commands")
859
918
  };
860
919
  }
861
920
  static getSettablePathsGlobal() {
862
921
  return {
863
- relativeDirPath: (0, import_node_path8.join)(".cursor", "commands")
922
+ relativeDirPath: (0, import_node_path9.join)(".cursor", "commands")
864
923
  };
865
924
  }
866
925
  toRulesyncCommand() {
@@ -913,13 +972,13 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
913
972
  global = false
914
973
  }) {
915
974
  const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
916
- const filePath = (0, import_node_path8.join)(baseDir, paths.relativeDirPath, relativeFilePath);
975
+ const filePath = (0, import_node_path9.join)(baseDir, paths.relativeDirPath, relativeFilePath);
917
976
  const fileContent = await readFileContent(filePath);
918
977
  const { body: content } = parseFrontmatter(fileContent);
919
978
  return new _CursorCommand({
920
979
  baseDir,
921
980
  relativeDirPath: paths.relativeDirPath,
922
- relativeFilePath: (0, import_node_path8.basename)(relativeFilePath),
981
+ relativeFilePath: (0, import_node_path9.basename)(relativeFilePath),
923
982
  fileContent: content.trim(),
924
983
  validate
925
984
  });
@@ -927,7 +986,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
927
986
  };
928
987
 
929
988
  // src/commands/geminicli-command.ts
930
- var import_node_path9 = require("path");
989
+ var import_node_path10 = require("path");
931
990
  var import_smol_toml = require("smol-toml");
932
991
  var import_mini6 = require("zod/mini");
933
992
  var GeminiCliCommandFrontmatterSchema = import_mini6.z.object({
@@ -950,7 +1009,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
950
1009
  }
951
1010
  static getSettablePathsGlobal() {
952
1011
  return {
953
- relativeDirPath: (0, import_node_path9.join)(".gemini", "commands")
1012
+ relativeDirPath: (0, import_node_path10.join)(".gemini", "commands")
954
1013
  };
955
1014
  }
956
1015
  parseTomlContent(content) {
@@ -1022,12 +1081,12 @@ ${geminiFrontmatter.prompt}
1022
1081
  global = false
1023
1082
  }) {
1024
1083
  const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
1025
- const filePath = (0, import_node_path9.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1084
+ const filePath = (0, import_node_path10.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1026
1085
  const fileContent = await readFileContent(filePath);
1027
1086
  return new _GeminiCliCommand({
1028
1087
  baseDir,
1029
1088
  relativeDirPath: paths.relativeDirPath,
1030
- relativeFilePath: (0, import_node_path9.basename)(relativeFilePath),
1089
+ relativeFilePath: (0, import_node_path10.basename)(relativeFilePath),
1031
1090
  fileContent,
1032
1091
  validate
1033
1092
  });
@@ -1049,7 +1108,7 @@ ${geminiFrontmatter.prompt}
1049
1108
  };
1050
1109
 
1051
1110
  // src/commands/roo-command.ts
1052
- var import_node_path10 = require("path");
1111
+ var import_node_path11 = require("path");
1053
1112
  var import_mini7 = require("zod/mini");
1054
1113
  var RooCommandFrontmatterSchema = import_mini7.z.object({
1055
1114
  description: import_mini7.z.string(),
@@ -1143,7 +1202,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1143
1202
  relativeFilePath,
1144
1203
  validate = true
1145
1204
  }) {
1146
- const filePath = (0, import_node_path10.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
1205
+ const filePath = (0, import_node_path11.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
1147
1206
  const fileContent = await readFileContent(filePath);
1148
1207
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
1149
1208
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
@@ -1153,7 +1212,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1153
1212
  return new _RooCommand({
1154
1213
  baseDir,
1155
1214
  relativeDirPath: _RooCommand.getSettablePaths().relativeDirPath,
1156
- relativeFilePath: (0, import_node_path10.basename)(relativeFilePath),
1215
+ relativeFilePath: (0, import_node_path11.basename)(relativeFilePath),
1157
1216
  frontmatter: result.data,
1158
1217
  body: content.trim(),
1159
1218
  fileContent,
@@ -1164,6 +1223,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1164
1223
 
1165
1224
  // src/commands/commands-processor.ts
1166
1225
  var commandsProcessorToolTargets = [
1226
+ "agentsmd",
1167
1227
  "claudecode",
1168
1228
  "geminicli",
1169
1229
  "roo",
@@ -1174,7 +1234,7 @@ var CommandsProcessorToolTargetSchema = import_mini8.z.enum(
1174
1234
  // codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
1175
1235
  commandsProcessorToolTargets.concat("codexcli")
1176
1236
  );
1177
- var commandsProcessorToolTargetsSimulated = ["copilot"];
1237
+ var commandsProcessorToolTargetsSimulated = ["agentsmd", "copilot"];
1178
1238
  var commandsProcessorToolTargetsGlobal = [
1179
1239
  "claudecode",
1180
1240
  "cursor",
@@ -1199,6 +1259,14 @@ var CommandsProcessor = class extends FeatureProcessor {
1199
1259
  );
1200
1260
  const toolCommands = rulesyncCommands.map((rulesyncCommand) => {
1201
1261
  switch (this.toolTarget) {
1262
+ case "agentsmd":
1263
+ if (!AgentsmdCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
1264
+ return null;
1265
+ }
1266
+ return AgentsmdCommand.fromRulesyncCommand({
1267
+ baseDir: this.baseDir,
1268
+ rulesyncCommand
1269
+ });
1202
1270
  case "claudecode":
1203
1271
  if (!ClaudecodeCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
1204
1272
  return null;
@@ -1274,11 +1342,11 @@ var CommandsProcessor = class extends FeatureProcessor {
1274
1342
  */
1275
1343
  async loadRulesyncFiles() {
1276
1344
  const rulesyncCommandPaths = await findFilesByGlobs(
1277
- (0, import_node_path11.join)(RulesyncCommand.getSettablePaths().relativeDirPath, "*.md")
1345
+ (0, import_node_path12.join)(RulesyncCommand.getSettablePaths().relativeDirPath, "*.md")
1278
1346
  );
1279
1347
  const rulesyncCommands = (await Promise.allSettled(
1280
1348
  rulesyncCommandPaths.map(
1281
- (path2) => RulesyncCommand.fromFile({ relativeFilePath: (0, import_node_path11.basename)(path2) })
1349
+ (path2) => RulesyncCommand.fromFile({ relativeFilePath: (0, import_node_path12.basename)(path2) })
1282
1350
  )
1283
1351
  )).filter((result) => result.status === "fulfilled").map((result) => result.value);
1284
1352
  logger.info(`Successfully loaded ${rulesyncCommands.length} rulesync commands`);
@@ -1290,6 +1358,8 @@ var CommandsProcessor = class extends FeatureProcessor {
1290
1358
  */
1291
1359
  async loadToolFiles() {
1292
1360
  switch (this.toolTarget) {
1361
+ case "agentsmd":
1362
+ return await this.loadAgentsmdCommands();
1293
1363
  case "claudecode":
1294
1364
  return await this.loadClaudecodeCommands();
1295
1365
  case "geminicli":
@@ -1315,43 +1385,48 @@ var CommandsProcessor = class extends FeatureProcessor {
1315
1385
  extension
1316
1386
  }) {
1317
1387
  const commandFilePaths = await findFilesByGlobs(
1318
- (0, import_node_path11.join)(this.baseDir, relativeDirPath, `*.${extension}`)
1388
+ (0, import_node_path12.join)(this.baseDir, relativeDirPath, `*.${extension}`)
1319
1389
  );
1320
1390
  const toolCommands = (await Promise.allSettled(
1321
1391
  commandFilePaths.map((path2) => {
1322
1392
  switch (toolTarget) {
1393
+ case "agentsmd":
1394
+ return AgentsmdCommand.fromFile({
1395
+ baseDir: this.baseDir,
1396
+ relativeFilePath: (0, import_node_path12.basename)(path2)
1397
+ });
1323
1398
  case "claudecode":
1324
1399
  return ClaudecodeCommand.fromFile({
1325
1400
  baseDir: this.baseDir,
1326
- relativeFilePath: (0, import_node_path11.basename)(path2),
1401
+ relativeFilePath: (0, import_node_path12.basename)(path2),
1327
1402
  global: this.global
1328
1403
  });
1329
1404
  case "geminicli":
1330
1405
  return GeminiCliCommand.fromFile({
1331
1406
  baseDir: this.baseDir,
1332
- relativeFilePath: (0, import_node_path11.basename)(path2),
1407
+ relativeFilePath: (0, import_node_path12.basename)(path2),
1333
1408
  global: this.global
1334
1409
  });
1335
1410
  case "roo":
1336
1411
  return RooCommand.fromFile({
1337
1412
  baseDir: this.baseDir,
1338
- relativeFilePath: (0, import_node_path11.basename)(path2)
1413
+ relativeFilePath: (0, import_node_path12.basename)(path2)
1339
1414
  });
1340
1415
  case "copilot":
1341
1416
  return CopilotCommand.fromFile({
1342
1417
  baseDir: this.baseDir,
1343
- relativeFilePath: (0, import_node_path11.basename)(path2)
1418
+ relativeFilePath: (0, import_node_path12.basename)(path2)
1344
1419
  });
1345
1420
  case "cursor":
1346
1421
  return CursorCommand.fromFile({
1347
1422
  baseDir: this.baseDir,
1348
- relativeFilePath: (0, import_node_path11.basename)(path2),
1423
+ relativeFilePath: (0, import_node_path12.basename)(path2),
1349
1424
  global: this.global
1350
1425
  });
1351
1426
  case "codexcli":
1352
1427
  return CodexcliCommand.fromFile({
1353
1428
  baseDir: this.baseDir,
1354
- relativeFilePath: (0, import_node_path11.basename)(path2),
1429
+ relativeFilePath: (0, import_node_path12.basename)(path2),
1355
1430
  global: this.global
1356
1431
  });
1357
1432
  default:
@@ -1363,7 +1438,17 @@ var CommandsProcessor = class extends FeatureProcessor {
1363
1438
  return toolCommands;
1364
1439
  }
1365
1440
  /**
1366
- * Load Claude Code command configurations from .claude/commands/ directory
1441
+ * Load Agents.md command configurations from .agents/commands/ directory
1442
+ */
1443
+ async loadAgentsmdCommands() {
1444
+ return await this.loadToolCommandDefault({
1445
+ toolTarget: "agentsmd",
1446
+ relativeDirPath: AgentsmdCommand.getSettablePaths().relativeDirPath,
1447
+ extension: "md"
1448
+ });
1449
+ }
1450
+ /**
1451
+ * Load Copilot command configurations from .github/commands/ directory
1367
1452
  */
1368
1453
  async loadCopilotCommands() {
1369
1454
  return await this.loadToolCommandDefault({
@@ -1449,7 +1534,7 @@ var CommandsProcessor = class extends FeatureProcessor {
1449
1534
  };
1450
1535
 
1451
1536
  // src/config/config-resolver.ts
1452
- var import_node_path12 = require("path");
1537
+ var import_node_path13 = require("path");
1453
1538
  var import_c12 = require("c12");
1454
1539
 
1455
1540
  // src/config/config.ts
@@ -1585,7 +1670,7 @@ function getBaseDirsInLightOfGlobal({
1585
1670
  global
1586
1671
  }) {
1587
1672
  if (isEnvTest) {
1588
- return baseDirs.map((baseDir) => (0, import_node_path12.join)(".", baseDir));
1673
+ return baseDirs.map((baseDir) => (0, import_node_path13.join)(".", baseDir));
1589
1674
  }
1590
1675
  if (global) {
1591
1676
  return [getHomeDirectory()];
@@ -1600,7 +1685,7 @@ function getBaseDirsInLightOfGlobal({
1600
1685
  var import_mini9 = require("zod/mini");
1601
1686
 
1602
1687
  // src/ignore/amazonqcli-ignore.ts
1603
- var import_node_path13 = require("path");
1688
+ var import_node_path14 = require("path");
1604
1689
 
1605
1690
  // src/types/tool-file.ts
1606
1691
  var ToolFile = class extends AiFile {
@@ -1708,7 +1793,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
1708
1793
  validate = true
1709
1794
  }) {
1710
1795
  const fileContent = await readFileContent(
1711
- (0, import_node_path13.join)(
1796
+ (0, import_node_path14.join)(
1712
1797
  baseDir,
1713
1798
  this.getSettablePaths().relativeDirPath,
1714
1799
  this.getSettablePaths().relativeFilePath
@@ -1725,7 +1810,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
1725
1810
  };
1726
1811
 
1727
1812
  // src/ignore/augmentcode-ignore.ts
1728
- var import_node_path14 = require("path");
1813
+ var import_node_path15 = require("path");
1729
1814
  var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
1730
1815
  static getSettablePaths() {
1731
1816
  return {
@@ -1763,7 +1848,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
1763
1848
  validate = true
1764
1849
  }) {
1765
1850
  const fileContent = await readFileContent(
1766
- (0, import_node_path14.join)(
1851
+ (0, import_node_path15.join)(
1767
1852
  baseDir,
1768
1853
  this.getSettablePaths().relativeDirPath,
1769
1854
  this.getSettablePaths().relativeFilePath
@@ -1780,7 +1865,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
1780
1865
  };
1781
1866
 
1782
1867
  // src/ignore/claudecode-ignore.ts
1783
- var import_node_path15 = require("path");
1868
+ var import_node_path16 = require("path");
1784
1869
  var import_es_toolkit = require("es-toolkit");
1785
1870
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
1786
1871
  constructor(params) {
@@ -1816,7 +1901,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
1816
1901
  const fileContent = rulesyncIgnore.getFileContent();
1817
1902
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
1818
1903
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
1819
- const filePath = (0, import_node_path15.join)(
1904
+ const filePath = (0, import_node_path16.join)(
1820
1905
  baseDir,
1821
1906
  this.getSettablePaths().relativeDirPath,
1822
1907
  this.getSettablePaths().relativeFilePath
@@ -1844,7 +1929,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
1844
1929
  validate = true
1845
1930
  }) {
1846
1931
  const fileContent = await readFileContent(
1847
- (0, import_node_path15.join)(
1932
+ (0, import_node_path16.join)(
1848
1933
  baseDir,
1849
1934
  this.getSettablePaths().relativeDirPath,
1850
1935
  this.getSettablePaths().relativeFilePath
@@ -1861,7 +1946,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
1861
1946
  };
1862
1947
 
1863
1948
  // src/ignore/cline-ignore.ts
1864
- var import_node_path16 = require("path");
1949
+ var import_node_path17 = require("path");
1865
1950
  var ClineIgnore = class _ClineIgnore extends ToolIgnore {
1866
1951
  static getSettablePaths() {
1867
1952
  return {
@@ -1898,7 +1983,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
1898
1983
  validate = true
1899
1984
  }) {
1900
1985
  const fileContent = await readFileContent(
1901
- (0, import_node_path16.join)(
1986
+ (0, import_node_path17.join)(
1902
1987
  baseDir,
1903
1988
  this.getSettablePaths().relativeDirPath,
1904
1989
  this.getSettablePaths().relativeFilePath
@@ -1915,7 +2000,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
1915
2000
  };
1916
2001
 
1917
2002
  // src/ignore/cursor-ignore.ts
1918
- var import_node_path17 = require("path");
2003
+ var import_node_path18 = require("path");
1919
2004
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
1920
2005
  static getSettablePaths() {
1921
2006
  return {
@@ -1948,7 +2033,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
1948
2033
  validate = true
1949
2034
  }) {
1950
2035
  const fileContent = await readFileContent(
1951
- (0, import_node_path17.join)(
2036
+ (0, import_node_path18.join)(
1952
2037
  baseDir,
1953
2038
  this.getSettablePaths().relativeDirPath,
1954
2039
  this.getSettablePaths().relativeFilePath
@@ -1965,7 +2050,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
1965
2050
  };
1966
2051
 
1967
2052
  // src/ignore/geminicli-ignore.ts
1968
- var import_node_path18 = require("path");
2053
+ var import_node_path19 = require("path");
1969
2054
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
1970
2055
  static getSettablePaths() {
1971
2056
  return {
@@ -1992,7 +2077,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
1992
2077
  validate = true
1993
2078
  }) {
1994
2079
  const fileContent = await readFileContent(
1995
- (0, import_node_path18.join)(
2080
+ (0, import_node_path19.join)(
1996
2081
  baseDir,
1997
2082
  this.getSettablePaths().relativeDirPath,
1998
2083
  this.getSettablePaths().relativeFilePath
@@ -2009,7 +2094,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
2009
2094
  };
2010
2095
 
2011
2096
  // src/ignore/junie-ignore.ts
2012
- var import_node_path19 = require("path");
2097
+ var import_node_path20 = require("path");
2013
2098
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
2014
2099
  static getSettablePaths() {
2015
2100
  return {
@@ -2036,7 +2121,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
2036
2121
  validate = true
2037
2122
  }) {
2038
2123
  const fileContent = await readFileContent(
2039
- (0, import_node_path19.join)(
2124
+ (0, import_node_path20.join)(
2040
2125
  baseDir,
2041
2126
  this.getSettablePaths().relativeDirPath,
2042
2127
  this.getSettablePaths().relativeFilePath
@@ -2053,7 +2138,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
2053
2138
  };
2054
2139
 
2055
2140
  // src/ignore/kiro-ignore.ts
2056
- var import_node_path20 = require("path");
2141
+ var import_node_path21 = require("path");
2057
2142
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
2058
2143
  static getSettablePaths() {
2059
2144
  return {
@@ -2080,7 +2165,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
2080
2165
  validate = true
2081
2166
  }) {
2082
2167
  const fileContent = await readFileContent(
2083
- (0, import_node_path20.join)(
2168
+ (0, import_node_path21.join)(
2084
2169
  baseDir,
2085
2170
  this.getSettablePaths().relativeDirPath,
2086
2171
  this.getSettablePaths().relativeFilePath
@@ -2097,7 +2182,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
2097
2182
  };
2098
2183
 
2099
2184
  // src/ignore/qwencode-ignore.ts
2100
- var import_node_path21 = require("path");
2185
+ var import_node_path22 = require("path");
2101
2186
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
2102
2187
  static getSettablePaths() {
2103
2188
  return {
@@ -2124,7 +2209,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
2124
2209
  validate = true
2125
2210
  }) {
2126
2211
  const fileContent = await readFileContent(
2127
- (0, import_node_path21.join)(
2212
+ (0, import_node_path22.join)(
2128
2213
  baseDir,
2129
2214
  this.getSettablePaths().relativeDirPath,
2130
2215
  this.getSettablePaths().relativeFilePath
@@ -2141,7 +2226,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
2141
2226
  };
2142
2227
 
2143
2228
  // src/ignore/roo-ignore.ts
2144
- var import_node_path22 = require("path");
2229
+ var import_node_path23 = require("path");
2145
2230
  var RooIgnore = class _RooIgnore extends ToolIgnore {
2146
2231
  static getSettablePaths() {
2147
2232
  return {
@@ -2168,7 +2253,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
2168
2253
  validate = true
2169
2254
  }) {
2170
2255
  const fileContent = await readFileContent(
2171
- (0, import_node_path22.join)(
2256
+ (0, import_node_path23.join)(
2172
2257
  baseDir,
2173
2258
  this.getSettablePaths().relativeDirPath,
2174
2259
  this.getSettablePaths().relativeFilePath
@@ -2185,7 +2270,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
2185
2270
  };
2186
2271
 
2187
2272
  // src/ignore/windsurf-ignore.ts
2188
- var import_node_path23 = require("path");
2273
+ var import_node_path24 = require("path");
2189
2274
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
2190
2275
  static getSettablePaths() {
2191
2276
  return {
@@ -2212,7 +2297,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
2212
2297
  validate = true
2213
2298
  }) {
2214
2299
  const fileContent = await readFileContent(
2215
- (0, import_node_path23.join)(
2300
+ (0, import_node_path24.join)(
2216
2301
  baseDir,
2217
2302
  this.getSettablePaths().relativeDirPath,
2218
2303
  this.getSettablePaths().relativeFilePath
@@ -2414,10 +2499,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
2414
2499
  var import_mini11 = require("zod/mini");
2415
2500
 
2416
2501
  // src/mcp/amazonqcli-mcp.ts
2417
- var import_node_path25 = require("path");
2502
+ var import_node_path26 = require("path");
2418
2503
 
2419
2504
  // src/mcp/rulesync-mcp.ts
2420
- var import_node_path24 = require("path");
2505
+ var import_node_path25 = require("path");
2421
2506
  var import_mini10 = require("zod/mini");
2422
2507
  var McpTransportTypeSchema = import_mini10.z.enum(["stdio", "sse", "http"]);
2423
2508
  var McpServerBaseSchema = import_mini10.z.object({
@@ -2468,7 +2553,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2468
2553
  }
2469
2554
  static async fromFile({ validate = true }) {
2470
2555
  const fileContent = await readFileContent(
2471
- (0, import_node_path24.join)(this.getSettablePaths().relativeDirPath, this.getSettablePaths().relativeFilePath)
2556
+ (0, import_node_path25.join)(this.getSettablePaths().relativeDirPath, this.getSettablePaths().relativeFilePath)
2472
2557
  );
2473
2558
  return new _RulesyncMcp({
2474
2559
  baseDir: ".",
@@ -2535,7 +2620,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
2535
2620
  validate = true
2536
2621
  }) {
2537
2622
  const fileContent = await readFileContent(
2538
- (0, import_node_path25.join)(
2623
+ (0, import_node_path26.join)(
2539
2624
  baseDir,
2540
2625
  this.getSettablePaths().relativeDirPath,
2541
2626
  this.getSettablePaths().relativeFilePath
@@ -2571,7 +2656,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
2571
2656
  };
2572
2657
 
2573
2658
  // src/mcp/claudecode-mcp.ts
2574
- var import_node_path26 = require("path");
2659
+ var import_node_path27 = require("path");
2575
2660
  var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
2576
2661
  static getSettablePaths() {
2577
2662
  return {
@@ -2584,7 +2669,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
2584
2669
  validate = true
2585
2670
  }) {
2586
2671
  const fileContent = await readFileContent(
2587
- (0, import_node_path26.join)(
2672
+ (0, import_node_path27.join)(
2588
2673
  baseDir,
2589
2674
  this.getSettablePaths().relativeDirPath,
2590
2675
  this.getSettablePaths().relativeFilePath
@@ -2620,7 +2705,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
2620
2705
  };
2621
2706
 
2622
2707
  // src/mcp/cline-mcp.ts
2623
- var import_node_path27 = require("path");
2708
+ var import_node_path28 = require("path");
2624
2709
  var ClineMcp = class _ClineMcp extends ToolMcp {
2625
2710
  static getSettablePaths() {
2626
2711
  return {
@@ -2633,7 +2718,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
2633
2718
  validate = true
2634
2719
  }) {
2635
2720
  const fileContent = await readFileContent(
2636
- (0, import_node_path27.join)(
2721
+ (0, import_node_path28.join)(
2637
2722
  baseDir,
2638
2723
  this.getSettablePaths().relativeDirPath,
2639
2724
  this.getSettablePaths().relativeFilePath
@@ -2669,7 +2754,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
2669
2754
  };
2670
2755
 
2671
2756
  // src/mcp/copilot-mcp.ts
2672
- var import_node_path28 = require("path");
2757
+ var import_node_path29 = require("path");
2673
2758
  var CopilotMcp = class _CopilotMcp extends ToolMcp {
2674
2759
  static getSettablePaths() {
2675
2760
  return {
@@ -2682,7 +2767,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
2682
2767
  validate = true
2683
2768
  }) {
2684
2769
  const fileContent = await readFileContent(
2685
- (0, import_node_path28.join)(
2770
+ (0, import_node_path29.join)(
2686
2771
  baseDir,
2687
2772
  this.getSettablePaths().relativeDirPath,
2688
2773
  this.getSettablePaths().relativeFilePath
@@ -2718,7 +2803,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
2718
2803
  };
2719
2804
 
2720
2805
  // src/mcp/cursor-mcp.ts
2721
- var import_node_path29 = require("path");
2806
+ var import_node_path30 = require("path");
2722
2807
  var CursorMcp = class _CursorMcp extends ToolMcp {
2723
2808
  static getSettablePaths() {
2724
2809
  return {
@@ -2731,7 +2816,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
2731
2816
  validate = true
2732
2817
  }) {
2733
2818
  const fileContent = await readFileContent(
2734
- (0, import_node_path29.join)(
2819
+ (0, import_node_path30.join)(
2735
2820
  baseDir,
2736
2821
  this.getSettablePaths().relativeDirPath,
2737
2822
  this.getSettablePaths().relativeFilePath
@@ -2778,7 +2863,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
2778
2863
  };
2779
2864
 
2780
2865
  // src/mcp/roo-mcp.ts
2781
- var import_node_path30 = require("path");
2866
+ var import_node_path31 = require("path");
2782
2867
  var RooMcp = class _RooMcp extends ToolMcp {
2783
2868
  static getSettablePaths() {
2784
2869
  return {
@@ -2791,7 +2876,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
2791
2876
  validate = true
2792
2877
  }) {
2793
2878
  const fileContent = await readFileContent(
2794
- (0, import_node_path30.join)(
2879
+ (0, import_node_path31.join)(
2795
2880
  baseDir,
2796
2881
  this.getSettablePaths().relativeDirPath,
2797
2882
  this.getSettablePaths().relativeFilePath
@@ -2998,12 +3083,12 @@ var McpProcessor = class extends FeatureProcessor {
2998
3083
  };
2999
3084
 
3000
3085
  // src/rules/rules-processor.ts
3001
- var import_node_path54 = require("path");
3086
+ var import_node_path55 = require("path");
3002
3087
  var import_fast_xml_parser = require("fast-xml-parser");
3003
3088
  var import_mini20 = require("zod/mini");
3004
3089
 
3005
3090
  // src/subagents/simulated-subagent.ts
3006
- var import_node_path31 = require("path");
3091
+ var import_node_path32 = require("path");
3007
3092
  var import_mini12 = require("zod/mini");
3008
3093
 
3009
3094
  // src/subagents/tool-subagent.ts
@@ -3105,7 +3190,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3105
3190
  relativeFilePath,
3106
3191
  validate = true
3107
3192
  }) {
3108
- const filePath = (0, import_node_path31.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
3193
+ const filePath = (0, import_node_path32.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
3109
3194
  const fileContent = await readFileContent(filePath);
3110
3195
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3111
3196
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -3115,7 +3200,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3115
3200
  return {
3116
3201
  baseDir,
3117
3202
  relativeDirPath: this.getSettablePaths().relativeDirPath,
3118
- relativeFilePath: (0, import_node_path31.basename)(relativeFilePath),
3203
+ relativeFilePath: (0, import_node_path32.basename)(relativeFilePath),
3119
3204
  frontmatter: result.data,
3120
3205
  body: content.trim(),
3121
3206
  validate
@@ -3123,6 +3208,29 @@ var SimulatedSubagent = class extends ToolSubagent {
3123
3208
  }
3124
3209
  };
3125
3210
 
3211
+ // src/subagents/agentsmd-subagent.ts
3212
+ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
3213
+ static getSettablePaths() {
3214
+ return {
3215
+ relativeDirPath: ".agents/subagents"
3216
+ };
3217
+ }
3218
+ static async fromFile(params) {
3219
+ const baseParams = await this.fromFileDefault(params);
3220
+ return new _AgentsmdSubagent(baseParams);
3221
+ }
3222
+ static fromRulesyncSubagent(params) {
3223
+ const baseParams = this.fromRulesyncSubagentDefault(params);
3224
+ return new _AgentsmdSubagent(baseParams);
3225
+ }
3226
+ static isTargetedByRulesyncSubagent(rulesyncSubagent) {
3227
+ return this.isTargetedByRulesyncSubagentDefault({
3228
+ rulesyncSubagent,
3229
+ toolTarget: "agentsmd"
3230
+ });
3231
+ }
3232
+ };
3233
+
3126
3234
  // src/subagents/codexcli-subagent.ts
3127
3235
  var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
3128
3236
  static getSettablePaths() {
@@ -3239,15 +3347,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
3239
3347
  };
3240
3348
 
3241
3349
  // src/subagents/subagents-processor.ts
3242
- var import_node_path34 = require("path");
3350
+ var import_node_path35 = require("path");
3243
3351
  var import_mini15 = require("zod/mini");
3244
3352
 
3245
3353
  // src/subagents/claudecode-subagent.ts
3246
- var import_node_path33 = require("path");
3354
+ var import_node_path34 = require("path");
3247
3355
  var import_mini14 = require("zod/mini");
3248
3356
 
3249
3357
  // src/subagents/rulesync-subagent.ts
3250
- var import_node_path32 = require("path");
3358
+ var import_node_path33 = require("path");
3251
3359
  var import_mini13 = require("zod/mini");
3252
3360
  var RulesyncSubagentModelSchema = import_mini13.z.enum(["opus", "sonnet", "haiku", "inherit"]);
3253
3361
  var RulesyncSubagentFrontmatterSchema = import_mini13.z.object({
@@ -3301,13 +3409,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
3301
3409
  static async fromFile({
3302
3410
  relativeFilePath
3303
3411
  }) {
3304
- const fileContent = await readFileContent((0, import_node_path32.join)(".rulesync/subagents", relativeFilePath));
3412
+ const fileContent = await readFileContent((0, import_node_path33.join)(".rulesync/subagents", relativeFilePath));
3305
3413
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3306
3414
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
3307
3415
  if (!result.success) {
3308
3416
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
3309
3417
  }
3310
- const filename = (0, import_node_path32.basename)(relativeFilePath);
3418
+ const filename = (0, import_node_path33.basename)(relativeFilePath);
3311
3419
  return new _RulesyncSubagent({
3312
3420
  baseDir: ".",
3313
3421
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -3419,7 +3527,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
3419
3527
  relativeFilePath,
3420
3528
  validate = true
3421
3529
  }) {
3422
- const fileContent = await readFileContent((0, import_node_path33.join)(baseDir, ".claude/agents", relativeFilePath));
3530
+ const fileContent = await readFileContent((0, import_node_path34.join)(baseDir, ".claude/agents", relativeFilePath));
3423
3531
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3424
3532
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
3425
3533
  if (!result.success) {
@@ -3439,6 +3547,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
3439
3547
 
3440
3548
  // src/subagents/subagents-processor.ts
3441
3549
  var subagentsProcessorToolTargets = [
3550
+ "agentsmd",
3442
3551
  "claudecode",
3443
3552
  "copilot",
3444
3553
  "cursor",
@@ -3447,6 +3556,7 @@ var subagentsProcessorToolTargets = [
3447
3556
  "roo"
3448
3557
  ];
3449
3558
  var subagentsProcessorToolTargetsSimulated = [
3559
+ "agentsmd",
3450
3560
  "copilot",
3451
3561
  "cursor",
3452
3562
  "codexcli",
@@ -3469,6 +3579,15 @@ var SubagentsProcessor = class extends FeatureProcessor {
3469
3579
  );
3470
3580
  const toolSubagents = rulesyncSubagents.map((rulesyncSubagent) => {
3471
3581
  switch (this.toolTarget) {
3582
+ case "agentsmd":
3583
+ if (!AgentsmdSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
3584
+ return null;
3585
+ }
3586
+ return AgentsmdSubagent.fromRulesyncSubagent({
3587
+ baseDir: this.baseDir,
3588
+ relativeDirPath: RulesyncSubagent.getSettablePaths().relativeDirPath,
3589
+ rulesyncSubagent
3590
+ });
3472
3591
  case "claudecode":
3473
3592
  if (!ClaudecodeSubagent.isTargetedByRulesyncSubagent(rulesyncSubagent)) {
3474
3593
  return null;
@@ -3550,7 +3669,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
3550
3669
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
3551
3670
  */
3552
3671
  async loadRulesyncFiles() {
3553
- const subagentsDir = (0, import_node_path34.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
3672
+ const subagentsDir = (0, import_node_path35.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
3554
3673
  const dirExists = await directoryExists(subagentsDir);
3555
3674
  if (!dirExists) {
3556
3675
  logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -3565,7 +3684,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
3565
3684
  logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
3566
3685
  const rulesyncSubagents = [];
3567
3686
  for (const mdFile of mdFiles) {
3568
- const filepath = (0, import_node_path34.join)(subagentsDir, mdFile);
3687
+ const filepath = (0, import_node_path35.join)(subagentsDir, mdFile);
3569
3688
  try {
3570
3689
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
3571
3690
  relativeFilePath: mdFile,
@@ -3591,6 +3710,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
3591
3710
  */
3592
3711
  async loadToolFiles() {
3593
3712
  switch (this.toolTarget) {
3713
+ case "agentsmd":
3714
+ return await this.loadAgentsmdSubagents();
3594
3715
  case "claudecode":
3595
3716
  return await this.loadClaudecodeSubagents();
3596
3717
  case "copilot":
@@ -3610,6 +3731,15 @@ var SubagentsProcessor = class extends FeatureProcessor {
3610
3731
  async loadToolFilesToDelete() {
3611
3732
  return this.loadToolFiles();
3612
3733
  }
3734
+ /**
3735
+ * Load Agents.md subagent configurations from .agents/subagents/ directory
3736
+ */
3737
+ async loadAgentsmdSubagents() {
3738
+ return await this.loadToolSubagentsDefault({
3739
+ relativeDirPath: AgentsmdSubagent.getSettablePaths().relativeDirPath,
3740
+ fromFile: (relativeFilePath) => AgentsmdSubagent.fromFile({ relativeFilePath })
3741
+ });
3742
+ }
3613
3743
  /**
3614
3744
  * Load Claude Code subagent configurations from .claude/agents/ directory
3615
3745
  */
@@ -3668,8 +3798,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
3668
3798
  relativeDirPath,
3669
3799
  fromFile
3670
3800
  }) {
3671
- const paths = await findFilesByGlobs((0, import_node_path34.join)(this.baseDir, relativeDirPath, "*.md"));
3672
- const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0, import_node_path34.basename)(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
3801
+ const paths = await findFilesByGlobs((0, import_node_path35.join)(this.baseDir, relativeDirPath, "*.md"));
3802
+ const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0, import_node_path35.basename)(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
3673
3803
  logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
3674
3804
  return subagents;
3675
3805
  }
@@ -3693,13 +3823,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
3693
3823
  };
3694
3824
 
3695
3825
  // src/rules/agentsmd-rule.ts
3696
- var import_node_path37 = require("path");
3826
+ var import_node_path38 = require("path");
3697
3827
 
3698
3828
  // src/rules/tool-rule.ts
3699
- var import_node_path36 = require("path");
3829
+ var import_node_path37 = require("path");
3700
3830
 
3701
3831
  // src/rules/rulesync-rule.ts
3702
- var import_node_path35 = require("path");
3832
+ var import_node_path36 = require("path");
3703
3833
  var import_mini16 = require("zod/mini");
3704
3834
  var RulesyncRuleFrontmatterSchema = import_mini16.z.object({
3705
3835
  root: import_mini16.z.optional(import_mini16.z.optional(import_mini16.z.boolean())),
@@ -3765,7 +3895,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
3765
3895
  relativeFilePath,
3766
3896
  validate = true
3767
3897
  }) {
3768
- const filePath = (0, import_node_path35.join)(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
3898
+ const filePath = (0, import_node_path36.join)(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
3769
3899
  const fileContent = await readFileContent(filePath);
3770
3900
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3771
3901
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
@@ -3780,7 +3910,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
3780
3910
  agentsmd: result.data.agentsmd,
3781
3911
  cursor: result.data.cursor
3782
3912
  };
3783
- const filename = (0, import_node_path35.basename)(filePath);
3913
+ const filename = (0, import_node_path36.basename)(filePath);
3784
3914
  return new _RulesyncRule({
3785
3915
  baseDir: ".",
3786
3916
  relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
@@ -3794,7 +3924,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
3794
3924
  relativeFilePath,
3795
3925
  validate = true
3796
3926
  }) {
3797
- const filePath = (0, import_node_path35.join)(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
3927
+ const filePath = (0, import_node_path36.join)(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
3798
3928
  const fileContent = await readFileContent(filePath);
3799
3929
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3800
3930
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
@@ -3809,7 +3939,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
3809
3939
  agentsmd: result.data.agentsmd,
3810
3940
  cursor: result.data.cursor
3811
3941
  };
3812
- const filename = (0, import_node_path35.basename)(filePath);
3942
+ const filename = (0, import_node_path36.basename)(filePath);
3813
3943
  return new _RulesyncRule({
3814
3944
  baseDir: ".",
3815
3945
  relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
@@ -3898,7 +4028,7 @@ var ToolRule = class extends ToolFile {
3898
4028
  });
3899
4029
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
3900
4030
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
3901
- params.relativeDirPath = (0, import_node_path36.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
4031
+ params.relativeDirPath = (0, import_node_path37.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
3902
4032
  params.relativeFilePath = "AGENTS.md";
3903
4033
  }
3904
4034
  return params;
@@ -3974,8 +4104,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
3974
4104
  validate = true
3975
4105
  }) {
3976
4106
  const isRoot = relativeFilePath === "AGENTS.md";
3977
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path37.join)(".agents/memories", relativeFilePath);
3978
- const fileContent = await readFileContent((0, import_node_path37.join)(baseDir, relativePath));
4107
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path38.join)(".agents/memories", relativeFilePath);
4108
+ const fileContent = await readFileContent((0, import_node_path38.join)(baseDir, relativePath));
3979
4109
  return new _AgentsMdRule({
3980
4110
  baseDir,
3981
4111
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -4015,7 +4145,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
4015
4145
  };
4016
4146
 
4017
4147
  // src/rules/amazonqcli-rule.ts
4018
- var import_node_path38 = require("path");
4148
+ var import_node_path39 = require("path");
4019
4149
  var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
4020
4150
  static getSettablePaths() {
4021
4151
  return {
@@ -4030,7 +4160,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
4030
4160
  validate = true
4031
4161
  }) {
4032
4162
  const fileContent = await readFileContent(
4033
- (0, import_node_path38.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4163
+ (0, import_node_path39.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4034
4164
  );
4035
4165
  return new _AmazonQCliRule({
4036
4166
  baseDir,
@@ -4070,7 +4200,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
4070
4200
  };
4071
4201
 
4072
4202
  // src/rules/augmentcode-legacy-rule.ts
4073
- var import_node_path39 = require("path");
4203
+ var import_node_path40 = require("path");
4074
4204
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
4075
4205
  toRulesyncRule() {
4076
4206
  const rulesyncFrontmatter = {
@@ -4131,8 +4261,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
4131
4261
  }) {
4132
4262
  const settablePaths = this.getSettablePaths();
4133
4263
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
4134
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path39.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
4135
- const fileContent = await readFileContent((0, import_node_path39.join)(baseDir, relativePath));
4264
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path40.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
4265
+ const fileContent = await readFileContent((0, import_node_path40.join)(baseDir, relativePath));
4136
4266
  return new _AugmentcodeLegacyRule({
4137
4267
  baseDir,
4138
4268
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -4145,7 +4275,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
4145
4275
  };
4146
4276
 
4147
4277
  // src/rules/augmentcode-rule.ts
4148
- var import_node_path40 = require("path");
4278
+ var import_node_path41 = require("path");
4149
4279
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
4150
4280
  toRulesyncRule() {
4151
4281
  return this.toRulesyncRuleDefault();
@@ -4177,7 +4307,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
4177
4307
  validate = true
4178
4308
  }) {
4179
4309
  const fileContent = await readFileContent(
4180
- (0, import_node_path40.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4310
+ (0, import_node_path41.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4181
4311
  );
4182
4312
  const { body: content } = parseFrontmatter(fileContent);
4183
4313
  return new _AugmentcodeRule({
@@ -4200,7 +4330,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
4200
4330
  };
4201
4331
 
4202
4332
  // src/rules/claudecode-rule.ts
4203
- var import_node_path41 = require("path");
4333
+ var import_node_path42 = require("path");
4204
4334
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
4205
4335
  static getSettablePaths() {
4206
4336
  return {
@@ -4209,7 +4339,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
4209
4339
  relativeFilePath: "CLAUDE.md"
4210
4340
  },
4211
4341
  nonRoot: {
4212
- relativeDirPath: (0, import_node_path41.join)(".claude", "memories")
4342
+ relativeDirPath: (0, import_node_path42.join)(".claude", "memories")
4213
4343
  }
4214
4344
  };
4215
4345
  }
@@ -4232,7 +4362,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
4232
4362
  if (isRoot) {
4233
4363
  const relativePath2 = paths.root.relativeFilePath;
4234
4364
  const fileContent2 = await readFileContent(
4235
- (0, import_node_path41.join)(baseDir, paths.root.relativeDirPath, relativePath2)
4365
+ (0, import_node_path42.join)(baseDir, paths.root.relativeDirPath, relativePath2)
4236
4366
  );
4237
4367
  return new _ClaudecodeRule({
4238
4368
  baseDir,
@@ -4246,8 +4376,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
4246
4376
  if (!paths.nonRoot) {
4247
4377
  throw new Error("nonRoot path is not set");
4248
4378
  }
4249
- const relativePath = (0, import_node_path41.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
4250
- const fileContent = await readFileContent((0, import_node_path41.join)(baseDir, relativePath));
4379
+ const relativePath = (0, import_node_path42.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
4380
+ const fileContent = await readFileContent((0, import_node_path42.join)(baseDir, relativePath));
4251
4381
  return new _ClaudecodeRule({
4252
4382
  baseDir,
4253
4383
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -4289,7 +4419,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
4289
4419
  };
4290
4420
 
4291
4421
  // src/rules/cline-rule.ts
4292
- var import_node_path42 = require("path");
4422
+ var import_node_path43 = require("path");
4293
4423
  var import_mini17 = require("zod/mini");
4294
4424
  var ClineRuleFrontmatterSchema = import_mini17.z.object({
4295
4425
  description: import_mini17.z.string()
@@ -4334,7 +4464,7 @@ var ClineRule = class _ClineRule extends ToolRule {
4334
4464
  validate = true
4335
4465
  }) {
4336
4466
  const fileContent = await readFileContent(
4337
- (0, import_node_path42.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4467
+ (0, import_node_path43.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4338
4468
  );
4339
4469
  return new _ClineRule({
4340
4470
  baseDir,
@@ -4347,7 +4477,7 @@ var ClineRule = class _ClineRule extends ToolRule {
4347
4477
  };
4348
4478
 
4349
4479
  // src/rules/codexcli-rule.ts
4350
- var import_node_path43 = require("path");
4480
+ var import_node_path44 = require("path");
4351
4481
  var CodexcliRule = class _CodexcliRule extends ToolRule {
4352
4482
  static getSettablePaths() {
4353
4483
  return {
@@ -4379,7 +4509,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
4379
4509
  if (isRoot) {
4380
4510
  const relativePath2 = paths.root.relativeFilePath;
4381
4511
  const fileContent2 = await readFileContent(
4382
- (0, import_node_path43.join)(baseDir, paths.root.relativeDirPath, relativePath2)
4512
+ (0, import_node_path44.join)(baseDir, paths.root.relativeDirPath, relativePath2)
4383
4513
  );
4384
4514
  return new _CodexcliRule({
4385
4515
  baseDir,
@@ -4393,8 +4523,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
4393
4523
  if (!paths.nonRoot) {
4394
4524
  throw new Error("nonRoot path is not set");
4395
4525
  }
4396
- const relativePath = (0, import_node_path43.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
4397
- const fileContent = await readFileContent((0, import_node_path43.join)(baseDir, relativePath));
4526
+ const relativePath = (0, import_node_path44.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
4527
+ const fileContent = await readFileContent((0, import_node_path44.join)(baseDir, relativePath));
4398
4528
  return new _CodexcliRule({
4399
4529
  baseDir,
4400
4530
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -4436,7 +4566,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
4436
4566
  };
4437
4567
 
4438
4568
  // src/rules/copilot-rule.ts
4439
- var import_node_path44 = require("path");
4569
+ var import_node_path45 = require("path");
4440
4570
  var import_mini18 = require("zod/mini");
4441
4571
  var CopilotRuleFrontmatterSchema = import_mini18.z.object({
4442
4572
  description: import_mini18.z.optional(import_mini18.z.string()),
@@ -4529,11 +4659,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
4529
4659
  validate = true
4530
4660
  }) {
4531
4661
  const isRoot = relativeFilePath === "copilot-instructions.md";
4532
- const relativePath = isRoot ? (0, import_node_path44.join)(
4662
+ const relativePath = isRoot ? (0, import_node_path45.join)(
4533
4663
  this.getSettablePaths().root.relativeDirPath,
4534
4664
  this.getSettablePaths().root.relativeFilePath
4535
- ) : (0, import_node_path44.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
4536
- const fileContent = await readFileContent((0, import_node_path44.join)(baseDir, relativePath));
4665
+ ) : (0, import_node_path45.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
4666
+ const fileContent = await readFileContent((0, import_node_path45.join)(baseDir, relativePath));
4537
4667
  if (isRoot) {
4538
4668
  return new _CopilotRule({
4539
4669
  baseDir,
@@ -4552,7 +4682,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
4552
4682
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
4553
4683
  if (!result.success) {
4554
4684
  throw new Error(
4555
- `Invalid frontmatter in ${(0, import_node_path44.join)(baseDir, relativeFilePath)}: ${result.error.message}`
4685
+ `Invalid frontmatter in ${(0, import_node_path45.join)(baseDir, relativeFilePath)}: ${result.error.message}`
4556
4686
  );
4557
4687
  }
4558
4688
  return new _CopilotRule({
@@ -4591,7 +4721,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
4591
4721
  };
4592
4722
 
4593
4723
  // src/rules/cursor-rule.ts
4594
- var import_node_path45 = require("path");
4724
+ var import_node_path46 = require("path");
4595
4725
  var import_mini19 = require("zod/mini");
4596
4726
  var CursorRuleFrontmatterSchema = import_mini19.z.object({
4597
4727
  description: import_mini19.z.optional(import_mini19.z.string()),
@@ -4718,19 +4848,19 @@ var CursorRule = class _CursorRule extends ToolRule {
4718
4848
  validate = true
4719
4849
  }) {
4720
4850
  const fileContent = await readFileContent(
4721
- (0, import_node_path45.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4851
+ (0, import_node_path46.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4722
4852
  );
4723
4853
  const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
4724
4854
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
4725
4855
  if (!result.success) {
4726
4856
  throw new Error(
4727
- `Invalid frontmatter in ${(0, import_node_path45.join)(baseDir, relativeFilePath)}: ${result.error.message}`
4857
+ `Invalid frontmatter in ${(0, import_node_path46.join)(baseDir, relativeFilePath)}: ${result.error.message}`
4728
4858
  );
4729
4859
  }
4730
4860
  return new _CursorRule({
4731
4861
  baseDir,
4732
4862
  relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
4733
- relativeFilePath: (0, import_node_path45.basename)(relativeFilePath),
4863
+ relativeFilePath: (0, import_node_path46.basename)(relativeFilePath),
4734
4864
  frontmatter: result.data,
4735
4865
  body: content.trim(),
4736
4866
  validate
@@ -4762,7 +4892,7 @@ var CursorRule = class _CursorRule extends ToolRule {
4762
4892
  };
4763
4893
 
4764
4894
  // src/rules/geminicli-rule.ts
4765
- var import_node_path46 = require("path");
4895
+ var import_node_path47 = require("path");
4766
4896
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
4767
4897
  static getSettablePaths() {
4768
4898
  return {
@@ -4794,7 +4924,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
4794
4924
  if (isRoot) {
4795
4925
  const relativePath2 = paths.root.relativeFilePath;
4796
4926
  const fileContent2 = await readFileContent(
4797
- (0, import_node_path46.join)(baseDir, paths.root.relativeDirPath, relativePath2)
4927
+ (0, import_node_path47.join)(baseDir, paths.root.relativeDirPath, relativePath2)
4798
4928
  );
4799
4929
  return new _GeminiCliRule({
4800
4930
  baseDir,
@@ -4808,8 +4938,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
4808
4938
  if (!paths.nonRoot) {
4809
4939
  throw new Error("nonRoot path is not set");
4810
4940
  }
4811
- const relativePath = (0, import_node_path46.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
4812
- const fileContent = await readFileContent((0, import_node_path46.join)(baseDir, relativePath));
4941
+ const relativePath = (0, import_node_path47.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
4942
+ const fileContent = await readFileContent((0, import_node_path47.join)(baseDir, relativePath));
4813
4943
  return new _GeminiCliRule({
4814
4944
  baseDir,
4815
4945
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -4851,7 +4981,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
4851
4981
  };
4852
4982
 
4853
4983
  // src/rules/junie-rule.ts
4854
- var import_node_path47 = require("path");
4984
+ var import_node_path48 = require("path");
4855
4985
  var JunieRule = class _JunieRule extends ToolRule {
4856
4986
  static getSettablePaths() {
4857
4987
  return {
@@ -4870,8 +5000,8 @@ var JunieRule = class _JunieRule extends ToolRule {
4870
5000
  validate = true
4871
5001
  }) {
4872
5002
  const isRoot = relativeFilePath === "guidelines.md";
4873
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path47.join)(".junie/memories", relativeFilePath);
4874
- const fileContent = await readFileContent((0, import_node_path47.join)(baseDir, relativePath));
5003
+ const relativePath = isRoot ? "guidelines.md" : (0, import_node_path48.join)(".junie/memories", relativeFilePath);
5004
+ const fileContent = await readFileContent((0, import_node_path48.join)(baseDir, relativePath));
4875
5005
  return new _JunieRule({
4876
5006
  baseDir,
4877
5007
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -4911,7 +5041,7 @@ var JunieRule = class _JunieRule extends ToolRule {
4911
5041
  };
4912
5042
 
4913
5043
  // src/rules/kiro-rule.ts
4914
- var import_node_path48 = require("path");
5044
+ var import_node_path49 = require("path");
4915
5045
  var KiroRule = class _KiroRule extends ToolRule {
4916
5046
  static getSettablePaths() {
4917
5047
  return {
@@ -4926,7 +5056,7 @@ var KiroRule = class _KiroRule extends ToolRule {
4926
5056
  validate = true
4927
5057
  }) {
4928
5058
  const fileContent = await readFileContent(
4929
- (0, import_node_path48.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5059
+ (0, import_node_path49.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4930
5060
  );
4931
5061
  return new _KiroRule({
4932
5062
  baseDir,
@@ -4966,7 +5096,7 @@ var KiroRule = class _KiroRule extends ToolRule {
4966
5096
  };
4967
5097
 
4968
5098
  // src/rules/opencode-rule.ts
4969
- var import_node_path49 = require("path");
5099
+ var import_node_path50 = require("path");
4970
5100
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
4971
5101
  static getSettablePaths() {
4972
5102
  return {
@@ -4985,8 +5115,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
4985
5115
  validate = true
4986
5116
  }) {
4987
5117
  const isRoot = relativeFilePath === "AGENTS.md";
4988
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path49.join)(".opencode/memories", relativeFilePath);
4989
- const fileContent = await readFileContent((0, import_node_path49.join)(baseDir, relativePath));
5118
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path50.join)(".opencode/memories", relativeFilePath);
5119
+ const fileContent = await readFileContent((0, import_node_path50.join)(baseDir, relativePath));
4990
5120
  return new _OpenCodeRule({
4991
5121
  baseDir,
4992
5122
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -5026,7 +5156,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
5026
5156
  };
5027
5157
 
5028
5158
  // src/rules/qwencode-rule.ts
5029
- var import_node_path50 = require("path");
5159
+ var import_node_path51 = require("path");
5030
5160
  var QwencodeRule = class _QwencodeRule extends ToolRule {
5031
5161
  static getSettablePaths() {
5032
5162
  return {
@@ -5045,8 +5175,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
5045
5175
  validate = true
5046
5176
  }) {
5047
5177
  const isRoot = relativeFilePath === "QWEN.md";
5048
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path50.join)(".qwen/memories", relativeFilePath);
5049
- const fileContent = await readFileContent((0, import_node_path50.join)(baseDir, relativePath));
5178
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path51.join)(".qwen/memories", relativeFilePath);
5179
+ const fileContent = await readFileContent((0, import_node_path51.join)(baseDir, relativePath));
5050
5180
  return new _QwencodeRule({
5051
5181
  baseDir,
5052
5182
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -5083,7 +5213,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
5083
5213
  };
5084
5214
 
5085
5215
  // src/rules/roo-rule.ts
5086
- var import_node_path51 = require("path");
5216
+ var import_node_path52 = require("path");
5087
5217
  var RooRule = class _RooRule extends ToolRule {
5088
5218
  static getSettablePaths() {
5089
5219
  return {
@@ -5098,7 +5228,7 @@ var RooRule = class _RooRule extends ToolRule {
5098
5228
  validate = true
5099
5229
  }) {
5100
5230
  const fileContent = await readFileContent(
5101
- (0, import_node_path51.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5231
+ (0, import_node_path52.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5102
5232
  );
5103
5233
  return new _RooRule({
5104
5234
  baseDir,
@@ -5153,7 +5283,7 @@ var RooRule = class _RooRule extends ToolRule {
5153
5283
  };
5154
5284
 
5155
5285
  // src/rules/warp-rule.ts
5156
- var import_node_path52 = require("path");
5286
+ var import_node_path53 = require("path");
5157
5287
  var WarpRule = class _WarpRule extends ToolRule {
5158
5288
  constructor({ fileContent, root, ...rest }) {
5159
5289
  super({
@@ -5179,8 +5309,8 @@ var WarpRule = class _WarpRule extends ToolRule {
5179
5309
  validate = true
5180
5310
  }) {
5181
5311
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
5182
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path52.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
5183
- const fileContent = await readFileContent((0, import_node_path52.join)(baseDir, relativePath));
5312
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path53.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
5313
+ const fileContent = await readFileContent((0, import_node_path53.join)(baseDir, relativePath));
5184
5314
  return new _WarpRule({
5185
5315
  baseDir,
5186
5316
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -5220,7 +5350,7 @@ var WarpRule = class _WarpRule extends ToolRule {
5220
5350
  };
5221
5351
 
5222
5352
  // src/rules/windsurf-rule.ts
5223
- var import_node_path53 = require("path");
5353
+ var import_node_path54 = require("path");
5224
5354
  var WindsurfRule = class _WindsurfRule extends ToolRule {
5225
5355
  static getSettablePaths() {
5226
5356
  return {
@@ -5235,7 +5365,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
5235
5365
  validate = true
5236
5366
  }) {
5237
5367
  const fileContent = await readFileContent(
5238
- (0, import_node_path53.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5368
+ (0, import_node_path54.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5239
5369
  );
5240
5370
  return new _WindsurfRule({
5241
5371
  baseDir,
@@ -5527,7 +5657,12 @@ var RulesProcessor = class extends FeatureProcessor {
5527
5657
  case "agentsmd": {
5528
5658
  const rootRule = toolRules[rootRuleIndex];
5529
5659
  rootRule?.setFileContent(
5530
- this.generateXmlReferencesSection(toolRules) + rootRule.getFileContent()
5660
+ this.generateXmlReferencesSection(toolRules) + this.generateAdditionalConventionsSection({
5661
+ commands: { relativeDirPath: AgentsmdCommand.getSettablePaths().relativeDirPath },
5662
+ subagents: {
5663
+ relativeDirPath: AgentsmdSubagent.getSettablePaths().relativeDirPath
5664
+ }
5665
+ }) + rootRule.getFileContent()
5531
5666
  );
5532
5667
  return toolRules;
5533
5668
  }
@@ -5624,10 +5759,10 @@ var RulesProcessor = class extends FeatureProcessor {
5624
5759
  * Load and parse rulesync rule files from .rulesync/rules/ directory
5625
5760
  */
5626
5761
  async loadRulesyncFiles() {
5627
- const files = await findFilesByGlobs((0, import_node_path54.join)(".rulesync/rules", "*.md"));
5762
+ const files = await findFilesByGlobs((0, import_node_path55.join)(".rulesync/rules", "*.md"));
5628
5763
  logger.debug(`Found ${files.length} rulesync files`);
5629
5764
  const rulesyncRules = await Promise.all(
5630
- files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path54.basename)(file) }))
5765
+ files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path55.basename)(file) }))
5631
5766
  );
5632
5767
  const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
5633
5768
  if (rootRules.length > 1) {
@@ -5645,10 +5780,10 @@ var RulesProcessor = class extends FeatureProcessor {
5645
5780
  return rulesyncRules;
5646
5781
  }
5647
5782
  async loadRulesyncFilesLegacy() {
5648
- const legacyFiles = await findFilesByGlobs((0, import_node_path54.join)(".rulesync", "*.md"));
5783
+ const legacyFiles = await findFilesByGlobs((0, import_node_path55.join)(".rulesync", "*.md"));
5649
5784
  logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
5650
5785
  return Promise.all(
5651
- legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path54.basename)(file) }))
5786
+ legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path55.basename)(file) }))
5652
5787
  );
5653
5788
  }
5654
5789
  /**
@@ -5712,13 +5847,13 @@ var RulesProcessor = class extends FeatureProcessor {
5712
5847
  return [];
5713
5848
  }
5714
5849
  const rootFilePaths = await findFilesByGlobs(
5715
- (0, import_node_path54.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
5850
+ (0, import_node_path55.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
5716
5851
  );
5717
5852
  return await Promise.all(
5718
5853
  rootFilePaths.map(
5719
5854
  (filePath) => root.fromFile({
5720
5855
  baseDir: this.baseDir,
5721
- relativeFilePath: (0, import_node_path54.basename)(filePath),
5856
+ relativeFilePath: (0, import_node_path55.basename)(filePath),
5722
5857
  global: this.global
5723
5858
  })
5724
5859
  )
@@ -5730,13 +5865,13 @@ var RulesProcessor = class extends FeatureProcessor {
5730
5865
  return [];
5731
5866
  }
5732
5867
  const nonRootFilePaths = await findFilesByGlobs(
5733
- (0, import_node_path54.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
5868
+ (0, import_node_path55.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
5734
5869
  );
5735
5870
  return await Promise.all(
5736
5871
  nonRootFilePaths.map(
5737
5872
  (filePath) => nonRoot.fromFile({
5738
5873
  baseDir: this.baseDir,
5739
- relativeFilePath: (0, import_node_path54.basename)(filePath),
5874
+ relativeFilePath: (0, import_node_path55.basename)(filePath),
5740
5875
  global: this.global
5741
5876
  })
5742
5877
  )
@@ -6106,14 +6241,14 @@ s/<command> [arguments]
6106
6241
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
6107
6242
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
6108
6243
 
6109
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path54.join)(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
6244
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path55.join)(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
6110
6245
  const subagentsSection = subagents ? `## Simulated Subagents
6111
6246
 
6112
6247
  Simulated subagents are specialized AI assistants that can be invoked to handle specific types of tasks. In this case, it can be appear something like custom slash commands simply. Simulated subagents can be called by custom slash commands.
6113
6248
 
6114
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path54.join)(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
6249
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path55.join)(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
6115
6250
 
6116
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path54.join)(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.` : "";
6251
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path55.join)(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.` : "";
6117
6252
  const result = [
6118
6253
  overview,
6119
6254
  ...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
@@ -6338,9 +6473,9 @@ async function generateSubagents(config) {
6338
6473
  }
6339
6474
 
6340
6475
  // src/cli/commands/gitignore.ts
6341
- var import_node_path55 = require("path");
6476
+ var import_node_path56 = require("path");
6342
6477
  var gitignoreCommand = async () => {
6343
- const gitignorePath = (0, import_node_path55.join)(process.cwd(), ".gitignore");
6478
+ const gitignorePath = (0, import_node_path56.join)(process.cwd(), ".gitignore");
6344
6479
  const rulesFilesToIgnore = [
6345
6480
  "# Generated by rulesync - AI tool configuration files",
6346
6481
  "**/.amazonq/",
@@ -6577,7 +6712,7 @@ async function importSubagents(config, tool) {
6577
6712
  }
6578
6713
 
6579
6714
  // src/cli/commands/init.ts
6580
- var import_node_path56 = require("path");
6715
+ var import_node_path57 = require("path");
6581
6716
  async function initCommand() {
6582
6717
  logger.info("Initializing rulesync...");
6583
6718
  await ensureDir(".rulesync");
@@ -6648,7 +6783,7 @@ globs: ["**/*"]
6648
6783
  - Follow single responsibility principle
6649
6784
  `
6650
6785
  };
6651
- const filepath = (0, import_node_path56.join)(".rulesync/rules", sampleFile.filename);
6786
+ const filepath = (0, import_node_path57.join)(".rulesync/rules", sampleFile.filename);
6652
6787
  await ensureDir(".rulesync/rules");
6653
6788
  await ensureDir(RulesyncCommand.getSettablePaths().relativeDirPath);
6654
6789
  await ensureDir(".rulesync/subagents");
@@ -6661,7 +6796,7 @@ globs: ["**/*"]
6661
6796
  }
6662
6797
 
6663
6798
  // src/cli/index.ts
6664
- var getVersion = () => "3.0.0";
6799
+ var getVersion = () => "3.1.1";
6665
6800
  var main = async () => {
6666
6801
  const program = new import_commander.Command();
6667
6802
  const version = getVersion();