rulesync 3.12.1 → 3.12.3

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/README.md CHANGED
@@ -281,37 +281,6 @@ Example:
281
281
  }
282
282
  ```
283
283
 
284
- #### Modular MCP Support (Experimental)
285
-
286
- Rulesync supports [modular-mcp](https://github.com/d-kimuson/modular-mcp) for context compression. When enabled with `--modular-mcp`, it generates both `.mcp.json` and `modular-mcp.json` files for Claude Code.
287
-
288
- **Benefits:**
289
- - Reduces context usage by loading tool schemas on-demand
290
- - Better scalability when using many MCP servers
291
- - Improved performance with large tool collections
292
-
293
- **Requirements:**
294
- - Each MCP server must have a `description` field (required when `modularMcp` is enabled)
295
- - Currently only supported for Claude Code
296
-
297
- **Usage:**
298
-
299
- ```bash
300
- # Enable modular-mcp via CLI
301
- npx rulesync generate --targets claudecode --features mcp --modular-mcp
302
-
303
- # Or via configuration file
304
- {
305
- "modularMcp": true
306
- }
307
- ```
308
-
309
- **Generated files:**
310
- - `.mcp.json` - Contains modular-mcp proxy configuration
311
- - `modular-mcp.json` - Contains actual MCP server configurations
312
-
313
- For more information, see the [modular-mcp documentation](https://github.com/d-kimuson/modular-mcp).
314
-
315
284
  ### `.rulesyncignore`
316
285
 
317
286
  Example:
@@ -385,6 +354,136 @@ Simulated commands and subagents allow you to generate simulated commands and su
385
354
  Call your-subagent to achieve something.
386
355
  ```
387
356
 
357
+ #### Modular MCP (Experimental)
358
+
359
+ Rulesync supports compressing tokens consumed by MCP servers [d-kimuson/modular-mcp](https://github.com/d-kimuson/modular-mcp) for context saving. When enabled with `--modular-mcp`, it additionally generates `modular-mcp.json`.
360
+
361
+ ```bash
362
+ # Enable modular-mcp via CLI
363
+ npx rulesync generate --targets claudecode --features mcp --modular-mcp
364
+
365
+ # Or via configuration file
366
+ {
367
+ "modularMcp": true
368
+ }
369
+ ```
370
+
371
+ When enabling modular-mcp, each MCP server must have a `description` field. Example:
372
+
373
+ ```diff
374
+ // .rulesync/mcp.json
375
+ {
376
+ "mcpServers": {
377
+ "context7": {
378
+ + "description": "Up-to-date documentation and code examples for libraries",
379
+ "type": "stdio",
380
+ "command": "npx",
381
+ "args": [
382
+ "-y",
383
+ "@upstash/context7-mcp"
384
+ ],
385
+ "env": {}
386
+ }
387
+ }
388
+ ```
389
+
390
+ To demonstrate the effect of modular-mcp, please see the following example:
391
+
392
+ <details>
393
+ <summary>Example of effect</summary>
394
+
395
+ Please see examples using Claude Code.
396
+
397
+ When using following mcp servers:
398
+
399
+ ```json
400
+ // .rulesync/mcp.json
401
+
402
+ {
403
+ "mcpServers": {
404
+ "serena": {
405
+ "description": "Semantic coding tools for intelligent codebase exploration and manipulation",
406
+ "type": "stdio",
407
+ "command": "uvx",
408
+ "args": [
409
+ "--from",
410
+ "git+https://github.com/oraios/serena",
411
+ "serena",
412
+ "start-mcp-server",
413
+ "--context",
414
+ "ide-assistant",
415
+ "--enable-web-dashboard",
416
+ "false",
417
+ "--project",
418
+ "."
419
+ ],
420
+ "env": {}
421
+ },
422
+ "context7": {
423
+ "description": "Up-to-date documentation and code examples for libraries",
424
+ "type": "stdio",
425
+ "command": "npx",
426
+ "args": [
427
+ "-y",
428
+ "@upstash/context7-mcp"
429
+ ],
430
+ "env": {}
431
+ },
432
+ "fetch": {
433
+ "description": "This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.",
434
+ "type": "stdio",
435
+ "command": "uvx",
436
+ "args": [
437
+ "mcp-server-fetch"
438
+ ],
439
+ "env": {}
440
+ }
441
+ }
442
+ }
443
+ ```
444
+
445
+ Once run `rulesync generate --targets claudecode --features mcp`, `/context` result on Claude Code is as follows:
446
+
447
+ ```
448
+ Context Usage
449
+ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ claude-sonnet-4-5-20250929 · 82k/200k tokens (41%)
450
+ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛀
451
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System prompt: 2.5k tokens (1.3%)
452
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System tools: 13.9k tokens (6.9%)
453
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ MCP tools: 15.7k tokens (7.9%)
454
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Memory files: 5.2k tokens (2.6%)
455
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Messages: 8 tokens (0.0%)
456
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛝ ⛝ ⛝ ⛶ Free space: 118k (58.8%)
457
+ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ Autocompact buffer: 45.0k tokens (22.5%)
458
+ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝
459
+ ```
460
+
461
+ On the other hand, once run `rulesync generate --targets claudecode --features mcp --modular-mcp`, `/context` result on Claude Code is as follows:
462
+
463
+ ```
464
+ Context Usage
465
+ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛁ claude-sonnet-4-5-20250929 · 68k/200k tokens (34%)
466
+ ⛁ ⛀ ⛀ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
467
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System prompt: 2.5k tokens (1.3%)
468
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System tools: 13.5k tokens (6.8%)
469
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ MCP tools: 1.3k tokens (0.6%)
470
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Memory files: 5.2k tokens (2.6%)
471
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Messages: 8 tokens (0.0%)
472
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛝ ⛝ ⛝ ⛶ Free space: 132k (66.2%)
473
+ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ Autocompact buffer: 45.0k tokens (22.5%)
474
+ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝
475
+ ```
476
+
477
+ Focus on the difference of MCP tools usage.
478
+
479
+ | | Context Usage|
480
+ |---|---|
481
+ |Disabled Modular MCP| 15.7k tokens (7.9%) |
482
+ |Enabled Modular MCP| 1.3k tokens (0.6%) |
483
+
484
+ So, in this case, approximately 92% reduction in token usage!
485
+ </details>
486
+
388
487
  ## Contributing
389
488
 
390
489
  Issues and Pull Requests are welcome!
package/dist/index.cjs CHANGED
@@ -226,6 +226,14 @@ var FeatureProcessor = class {
226
226
  }
227
227
  };
228
228
 
229
+ // src/utils/zod-error.ts
230
+ function formatZodError(error) {
231
+ return error.issues.map((issue) => {
232
+ const path2 = issue.path.length > 0 ? `${issue.path.join(".")}: ` : "";
233
+ return `${path2}${issue.message}`;
234
+ }).join("; ");
235
+ }
236
+
229
237
  // src/commands/agentsmd-command.ts
230
238
  var import_node_path4 = require("path");
231
239
 
@@ -442,7 +450,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
442
450
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
443
451
  if (!result.success) {
444
452
  throw new Error(
445
- `Invalid frontmatter in ${(0, import_node_path3.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
453
+ `Invalid frontmatter in ${(0, import_node_path3.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
446
454
  );
447
455
  }
448
456
  }
@@ -492,7 +500,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
492
500
  return {
493
501
  success: false,
494
502
  error: new Error(
495
- `Invalid frontmatter in ${(0, import_node_path3.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
503
+ `Invalid frontmatter in ${(0, import_node_path3.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
496
504
  )
497
505
  };
498
506
  }
@@ -511,7 +519,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
511
519
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
512
520
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
513
521
  if (!result.success) {
514
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
522
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
515
523
  }
516
524
  return {
517
525
  baseDir,
@@ -554,7 +562,7 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
554
562
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
555
563
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
556
564
  if (!result.success) {
557
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
565
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
558
566
  }
559
567
  return new _AgentsmdCommand({
560
568
  baseDir,
@@ -630,7 +638,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
630
638
  const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
631
639
  if (!result.success) {
632
640
  throw new Error(
633
- `Invalid frontmatter in ${(0, import_node_path5.join)(rest.baseDir ?? ".", rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
641
+ `Invalid frontmatter in ${(0, import_node_path5.join)(rest.baseDir ?? ".", rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
634
642
  );
635
643
  }
636
644
  }
@@ -663,7 +671,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
663
671
  return {
664
672
  success: false,
665
673
  error: new Error(
666
- `Invalid frontmatter in ${(0, import_node_path5.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
674
+ `Invalid frontmatter in ${(0, import_node_path5.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
667
675
  )
668
676
  };
669
677
  }
@@ -677,7 +685,9 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
677
685
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
678
686
  const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
679
687
  if (!result.success) {
680
- throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
688
+ throw new Error(
689
+ `Invalid frontmatter in ${relativeFilePath}: ${formatZodError(result.error)}`
690
+ );
681
691
  }
682
692
  const filename = (0, import_node_path5.basename)(relativeFilePath);
683
693
  return new _RulesyncCommand({
@@ -703,7 +713,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
703
713
  const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
704
714
  if (!result.success) {
705
715
  throw new Error(
706
- `Invalid frontmatter in ${(0, import_node_path6.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
716
+ `Invalid frontmatter in ${(0, import_node_path6.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
707
717
  );
708
718
  }
709
719
  }
@@ -774,7 +784,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
774
784
  return {
775
785
  success: false,
776
786
  error: new Error(
777
- `Invalid frontmatter in ${(0, import_node_path6.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
787
+ `Invalid frontmatter in ${(0, import_node_path6.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
778
788
  )
779
789
  };
780
790
  }
@@ -797,7 +807,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
797
807
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
798
808
  const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
799
809
  if (!result.success) {
800
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
810
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
801
811
  }
802
812
  return new _ClaudecodeCommand({
803
813
  baseDir,
@@ -899,7 +909,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
899
909
  const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
900
910
  if (!result.success) {
901
911
  throw new Error(
902
- `Invalid frontmatter in ${(0, import_node_path8.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
912
+ `Invalid frontmatter in ${(0, import_node_path8.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
903
913
  );
904
914
  }
905
915
  }
@@ -949,7 +959,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
949
959
  return {
950
960
  success: false,
951
961
  error: new Error(
952
- `Invalid frontmatter in ${(0, import_node_path8.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
962
+ `Invalid frontmatter in ${(0, import_node_path8.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
953
963
  )
954
964
  };
955
965
  }
@@ -988,7 +998,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
988
998
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
989
999
  const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
990
1000
  if (!result.success) {
991
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
1001
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
992
1002
  }
993
1003
  return new _CopilotCommand({
994
1004
  baseDir,
@@ -1105,7 +1115,9 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1105
1115
  const parsed = (0, import_smol_toml.parse)(content);
1106
1116
  const result = GeminiCliCommandFrontmatterSchema.safeParse(parsed);
1107
1117
  if (!result.success) {
1108
- throw new Error(`Invalid frontmatter in Gemini CLI command file: ${result.error.message}`);
1118
+ throw new Error(
1119
+ `Invalid frontmatter in Gemini CLI command file: ${formatZodError(result.error)}`
1120
+ );
1109
1121
  }
1110
1122
  return {
1111
1123
  description: result.data.description || "",
@@ -1218,7 +1230,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1218
1230
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
1219
1231
  if (!result.success) {
1220
1232
  throw new Error(
1221
- `Invalid frontmatter in ${(0, import_node_path11.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
1233
+ `Invalid frontmatter in ${(0, import_node_path11.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
1222
1234
  );
1223
1235
  }
1224
1236
  }
@@ -1284,7 +1296,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1284
1296
  return {
1285
1297
  success: false,
1286
1298
  error: new Error(
1287
- `Invalid frontmatter in ${(0, import_node_path11.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
1299
+ `Invalid frontmatter in ${(0, import_node_path11.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
1288
1300
  )
1289
1301
  };
1290
1302
  }
@@ -1305,7 +1317,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1305
1317
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
1306
1318
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
1307
1319
  if (!result.success) {
1308
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
1320
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
1309
1321
  }
1310
1322
  return new _RooCommand({
1311
1323
  baseDir,
@@ -1351,7 +1363,7 @@ var CommandsProcessor = class extends FeatureProcessor {
1351
1363
  const result = CommandsProcessorToolTargetSchema.safeParse(toolTarget);
1352
1364
  if (!result.success) {
1353
1365
  throw new Error(
1354
- `Invalid tool target for CommandsProcessor: ${toolTarget}. ${result.error.message}`
1366
+ `Invalid tool target for CommandsProcessor: ${toolTarget}. ${formatZodError(result.error)}`
1355
1367
  );
1356
1368
  }
1357
1369
  this.toolTarget = result.data;
@@ -2520,7 +2532,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
2520
2532
  const result = IgnoreProcessorToolTargetSchema.safeParse(toolTarget);
2521
2533
  if (!result.success) {
2522
2534
  throw new Error(
2523
- `Invalid tool target for IgnoreProcessor: ${toolTarget}. ${result.error.message}`
2535
+ `Invalid tool target for IgnoreProcessor: ${toolTarget}. ${formatZodError(result.error)}`
2524
2536
  );
2525
2537
  }
2526
2538
  this.toolTarget = result.data;
@@ -2757,7 +2769,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2757
2769
  return {
2758
2770
  success: false,
2759
2771
  error: new Error(
2760
- `Invalid MCP server configuration for modular-mcp: ${result.error.message}`
2772
+ `Invalid MCP server configuration for modular-mcp: ${formatZodError(result.error)}`
2761
2773
  )
2762
2774
  };
2763
2775
  }
@@ -3537,7 +3549,7 @@ var McpProcessor = class extends FeatureProcessor {
3537
3549
  const result = McpProcessorToolTargetSchema.safeParse(toolTarget);
3538
3550
  if (!result.success) {
3539
3551
  throw new Error(
3540
- `Invalid tool target for McpProcessor: ${toolTarget}. ${result.error.message}`
3552
+ `Invalid tool target for McpProcessor: ${toolTarget}. ${formatZodError(result.error)}`
3541
3553
  );
3542
3554
  }
3543
3555
  this.toolTarget = result.data;
@@ -3803,7 +3815,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3803
3815
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
3804
3816
  if (!result.success) {
3805
3817
  throw new Error(
3806
- `Invalid frontmatter in ${(0, import_node_path35.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
3818
+ `Invalid frontmatter in ${(0, import_node_path35.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
3807
3819
  );
3808
3820
  }
3809
3821
  }
@@ -3854,7 +3866,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3854
3866
  return {
3855
3867
  success: false,
3856
3868
  error: new Error(
3857
- `Invalid frontmatter in ${(0, import_node_path35.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
3869
+ `Invalid frontmatter in ${(0, import_node_path35.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
3858
3870
  )
3859
3871
  };
3860
3872
  }
@@ -3869,7 +3881,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3869
3881
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3870
3882
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
3871
3883
  if (!result.success) {
3872
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
3884
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
3873
3885
  }
3874
3886
  return {
3875
3887
  baseDir,
@@ -4050,7 +4062,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4050
4062
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
4051
4063
  if (!result.success) {
4052
4064
  throw new Error(
4053
- `Invalid frontmatter in ${(0, import_node_path36.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
4065
+ `Invalid frontmatter in ${(0, import_node_path36.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4054
4066
  );
4055
4067
  }
4056
4068
  }
@@ -4082,7 +4094,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4082
4094
  return {
4083
4095
  success: false,
4084
4096
  error: new Error(
4085
- `Invalid frontmatter in ${(0, import_node_path36.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
4097
+ `Invalid frontmatter in ${(0, import_node_path36.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4086
4098
  )
4087
4099
  };
4088
4100
  }
@@ -4094,7 +4106,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4094
4106
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4095
4107
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
4096
4108
  if (!result.success) {
4097
- throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
4109
+ throw new Error(
4110
+ `Invalid frontmatter in ${relativeFilePath}: ${formatZodError(result.error)}`
4111
+ );
4098
4112
  }
4099
4113
  const filename = (0, import_node_path36.basename)(relativeFilePath);
4100
4114
  return new _RulesyncSubagent({
@@ -4122,7 +4136,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4122
4136
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
4123
4137
  if (!result.success) {
4124
4138
  throw new Error(
4125
- `Invalid frontmatter in ${(0, import_node_path37.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
4139
+ `Invalid frontmatter in ${(0, import_node_path37.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4126
4140
  );
4127
4141
  }
4128
4142
  }
@@ -4202,7 +4216,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4202
4216
  return {
4203
4217
  success: false,
4204
4218
  error: new Error(
4205
- `Invalid frontmatter in ${(0, import_node_path37.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
4219
+ `Invalid frontmatter in ${(0, import_node_path37.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4206
4220
  )
4207
4221
  };
4208
4222
  }
@@ -4225,7 +4239,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4225
4239
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4226
4240
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
4227
4241
  if (!result.success) {
4228
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
4242
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
4229
4243
  }
4230
4244
  return new _ClaudecodeSubagent({
4231
4245
  baseDir,
@@ -4271,7 +4285,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
4271
4285
  const result = SubagentsProcessorToolTargetSchema.safeParse(toolTarget);
4272
4286
  if (!result.success) {
4273
4287
  throw new Error(
4274
- `Invalid tool target for SubagentsProcessor: ${toolTarget}. ${result.error.message}`
4288
+ `Invalid tool target for SubagentsProcessor: ${toolTarget}. ${formatZodError(result.error)}`
4275
4289
  );
4276
4290
  }
4277
4291
  this.toolTarget = result.data;
@@ -4571,7 +4585,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4571
4585
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4572
4586
  if (!result.success) {
4573
4587
  throw new Error(
4574
- `Invalid frontmatter in ${(0, import_node_path39.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
4588
+ `Invalid frontmatter in ${(0, import_node_path39.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4575
4589
  );
4576
4590
  }
4577
4591
  }
@@ -4606,7 +4620,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4606
4620
  return {
4607
4621
  success: false,
4608
4622
  error: new Error(
4609
- `Invalid frontmatter in ${(0, import_node_path39.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
4623
+ `Invalid frontmatter in ${(0, import_node_path39.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4610
4624
  )
4611
4625
  };
4612
4626
  }
@@ -4625,7 +4639,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4625
4639
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4626
4640
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4627
4641
  if (!result.success) {
4628
- throw new Error(`Invalid frontmatter in ${legacyPath}: ${result.error.message}`);
4642
+ throw new Error(`Invalid frontmatter in ${legacyPath}: ${formatZodError(result.error)}`);
4629
4643
  }
4630
4644
  const validatedFrontmatter = {
4631
4645
  root: result.data.root ?? false,
@@ -4654,7 +4668,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4654
4668
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4655
4669
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4656
4670
  if (!result.success) {
4657
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
4671
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
4658
4672
  }
4659
4673
  const validatedFrontmatter = {
4660
4674
  root: result.data.root ?? false,
@@ -5317,7 +5331,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5317
5331
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
5318
5332
  if (!result.success) {
5319
5333
  throw new Error(
5320
- `Invalid frontmatter in ${(0, import_node_path48.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
5334
+ `Invalid frontmatter in ${(0, import_node_path48.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
5321
5335
  );
5322
5336
  }
5323
5337
  }
@@ -5412,7 +5426,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5412
5426
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
5413
5427
  if (!result.success) {
5414
5428
  throw new Error(
5415
- `Invalid frontmatter in ${(0, import_node_path48.join)(baseDir, relativeFilePath)}: ${result.error.message}`
5429
+ `Invalid frontmatter in ${(0, import_node_path48.join)(baseDir, relativeFilePath)}: ${formatZodError(result.error)}`
5416
5430
  );
5417
5431
  }
5418
5432
  return new _CopilotRule({
@@ -5436,7 +5450,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5436
5450
  return {
5437
5451
  success: false,
5438
5452
  error: new Error(
5439
- `Invalid frontmatter in ${(0, import_node_path48.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
5453
+ `Invalid frontmatter in ${(0, import_node_path48.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
5440
5454
  )
5441
5455
  };
5442
5456
  }
@@ -5478,7 +5492,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5478
5492
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
5479
5493
  if (!result.success) {
5480
5494
  throw new Error(
5481
- `Invalid frontmatter in ${(0, import_node_path49.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
5495
+ `Invalid frontmatter in ${(0, import_node_path49.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
5482
5496
  );
5483
5497
  }
5484
5498
  }
@@ -5601,7 +5615,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5601
5615
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
5602
5616
  if (!result.success) {
5603
5617
  throw new Error(
5604
- `Invalid frontmatter in ${(0, import_node_path49.join)(baseDir, relativeFilePath)}: ${result.error.message}`
5618
+ `Invalid frontmatter in ${(0, import_node_path49.join)(baseDir, relativeFilePath)}: ${formatZodError(result.error)}`
5605
5619
  );
5606
5620
  }
5607
5621
  return new _CursorRule({
@@ -5624,7 +5638,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5624
5638
  return {
5625
5639
  success: false,
5626
5640
  error: new Error(
5627
- `Invalid frontmatter in ${(0, import_node_path49.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
5641
+ `Invalid frontmatter in ${(0, import_node_path49.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
5628
5642
  )
5629
5643
  };
5630
5644
  }
@@ -6199,7 +6213,7 @@ var RulesProcessor = class extends FeatureProcessor {
6199
6213
  const result = RulesProcessorToolTargetSchema.safeParse(toolTarget);
6200
6214
  if (!result.success) {
6201
6215
  throw new Error(
6202
- `Invalid tool target for RulesProcessor: ${toolTarget}. ${result.error.message}`
6216
+ `Invalid tool target for RulesProcessor: ${toolTarget}. ${formatZodError(result.error)}`
6203
6217
  );
6204
6218
  }
6205
6219
  this.toolTarget = result.data;
@@ -7667,7 +7681,7 @@ Attention, again, you are just the planner, so though you can read any files and
7667
7681
  }
7668
7682
 
7669
7683
  // src/cli/index.ts
7670
- var getVersion = () => "3.12.1";
7684
+ var getVersion = () => "3.12.3";
7671
7685
  var main = async () => {
7672
7686
  const program = new import_commander.Command();
7673
7687
  const version = getVersion();
package/dist/index.js CHANGED
@@ -203,6 +203,14 @@ var FeatureProcessor = class {
203
203
  }
204
204
  };
205
205
 
206
+ // src/utils/zod-error.ts
207
+ function formatZodError(error) {
208
+ return error.issues.map((issue) => {
209
+ const path2 = issue.path.length > 0 ? `${issue.path.join(".")}: ` : "";
210
+ return `${path2}${issue.message}`;
211
+ }).join("; ");
212
+ }
213
+
206
214
  // src/commands/agentsmd-command.ts
207
215
  import { basename as basename3, join as join3 } from "path";
208
216
 
@@ -419,7 +427,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
419
427
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
420
428
  if (!result.success) {
421
429
  throw new Error(
422
- `Invalid frontmatter in ${join2(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
430
+ `Invalid frontmatter in ${join2(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
423
431
  );
424
432
  }
425
433
  }
@@ -469,7 +477,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
469
477
  return {
470
478
  success: false,
471
479
  error: new Error(
472
- `Invalid frontmatter in ${join2(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
480
+ `Invalid frontmatter in ${join2(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
473
481
  )
474
482
  };
475
483
  }
@@ -488,7 +496,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
488
496
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
489
497
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
490
498
  if (!result.success) {
491
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
499
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
492
500
  }
493
501
  return {
494
502
  baseDir,
@@ -531,7 +539,7 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
531
539
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
532
540
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
533
541
  if (!result.success) {
534
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
542
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
535
543
  }
536
544
  return new _AgentsmdCommand({
537
545
  baseDir,
@@ -607,7 +615,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
607
615
  const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
608
616
  if (!result.success) {
609
617
  throw new Error(
610
- `Invalid frontmatter in ${join4(rest.baseDir ?? ".", rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
618
+ `Invalid frontmatter in ${join4(rest.baseDir ?? ".", rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
611
619
  );
612
620
  }
613
621
  }
@@ -640,7 +648,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
640
648
  return {
641
649
  success: false,
642
650
  error: new Error(
643
- `Invalid frontmatter in ${join4(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
651
+ `Invalid frontmatter in ${join4(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
644
652
  )
645
653
  };
646
654
  }
@@ -654,7 +662,9 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
654
662
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
655
663
  const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
656
664
  if (!result.success) {
657
- throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
665
+ throw new Error(
666
+ `Invalid frontmatter in ${relativeFilePath}: ${formatZodError(result.error)}`
667
+ );
658
668
  }
659
669
  const filename = basename4(relativeFilePath);
660
670
  return new _RulesyncCommand({
@@ -680,7 +690,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
680
690
  const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
681
691
  if (!result.success) {
682
692
  throw new Error(
683
- `Invalid frontmatter in ${join5(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
693
+ `Invalid frontmatter in ${join5(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
684
694
  );
685
695
  }
686
696
  }
@@ -751,7 +761,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
751
761
  return {
752
762
  success: false,
753
763
  error: new Error(
754
- `Invalid frontmatter in ${join5(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
764
+ `Invalid frontmatter in ${join5(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
755
765
  )
756
766
  };
757
767
  }
@@ -774,7 +784,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
774
784
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
775
785
  const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
776
786
  if (!result.success) {
777
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
787
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
778
788
  }
779
789
  return new _ClaudecodeCommand({
780
790
  baseDir,
@@ -876,7 +886,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
876
886
  const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
877
887
  if (!result.success) {
878
888
  throw new Error(
879
- `Invalid frontmatter in ${join7(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
889
+ `Invalid frontmatter in ${join7(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
880
890
  );
881
891
  }
882
892
  }
@@ -926,7 +936,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
926
936
  return {
927
937
  success: false,
928
938
  error: new Error(
929
- `Invalid frontmatter in ${join7(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
939
+ `Invalid frontmatter in ${join7(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
930
940
  )
931
941
  };
932
942
  }
@@ -965,7 +975,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
965
975
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
966
976
  const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
967
977
  if (!result.success) {
968
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
978
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
969
979
  }
970
980
  return new _CopilotCommand({
971
981
  baseDir,
@@ -1082,7 +1092,9 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1082
1092
  const parsed = parseToml(content);
1083
1093
  const result = GeminiCliCommandFrontmatterSchema.safeParse(parsed);
1084
1094
  if (!result.success) {
1085
- throw new Error(`Invalid frontmatter in Gemini CLI command file: ${result.error.message}`);
1095
+ throw new Error(
1096
+ `Invalid frontmatter in Gemini CLI command file: ${formatZodError(result.error)}`
1097
+ );
1086
1098
  }
1087
1099
  return {
1088
1100
  description: result.data.description || "",
@@ -1195,7 +1207,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1195
1207
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
1196
1208
  if (!result.success) {
1197
1209
  throw new Error(
1198
- `Invalid frontmatter in ${join10(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
1210
+ `Invalid frontmatter in ${join10(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
1199
1211
  );
1200
1212
  }
1201
1213
  }
@@ -1261,7 +1273,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1261
1273
  return {
1262
1274
  success: false,
1263
1275
  error: new Error(
1264
- `Invalid frontmatter in ${join10(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
1276
+ `Invalid frontmatter in ${join10(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
1265
1277
  )
1266
1278
  };
1267
1279
  }
@@ -1282,7 +1294,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1282
1294
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
1283
1295
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
1284
1296
  if (!result.success) {
1285
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
1297
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
1286
1298
  }
1287
1299
  return new _RooCommand({
1288
1300
  baseDir,
@@ -1328,7 +1340,7 @@ var CommandsProcessor = class extends FeatureProcessor {
1328
1340
  const result = CommandsProcessorToolTargetSchema.safeParse(toolTarget);
1329
1341
  if (!result.success) {
1330
1342
  throw new Error(
1331
- `Invalid tool target for CommandsProcessor: ${toolTarget}. ${result.error.message}`
1343
+ `Invalid tool target for CommandsProcessor: ${toolTarget}. ${formatZodError(result.error)}`
1332
1344
  );
1333
1345
  }
1334
1346
  this.toolTarget = result.data;
@@ -2497,7 +2509,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
2497
2509
  const result = IgnoreProcessorToolTargetSchema.safeParse(toolTarget);
2498
2510
  if (!result.success) {
2499
2511
  throw new Error(
2500
- `Invalid tool target for IgnoreProcessor: ${toolTarget}. ${result.error.message}`
2512
+ `Invalid tool target for IgnoreProcessor: ${toolTarget}. ${formatZodError(result.error)}`
2501
2513
  );
2502
2514
  }
2503
2515
  this.toolTarget = result.data;
@@ -2734,7 +2746,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2734
2746
  return {
2735
2747
  success: false,
2736
2748
  error: new Error(
2737
- `Invalid MCP server configuration for modular-mcp: ${result.error.message}`
2749
+ `Invalid MCP server configuration for modular-mcp: ${formatZodError(result.error)}`
2738
2750
  )
2739
2751
  };
2740
2752
  }
@@ -3514,7 +3526,7 @@ var McpProcessor = class extends FeatureProcessor {
3514
3526
  const result = McpProcessorToolTargetSchema.safeParse(toolTarget);
3515
3527
  if (!result.success) {
3516
3528
  throw new Error(
3517
- `Invalid tool target for McpProcessor: ${toolTarget}. ${result.error.message}`
3529
+ `Invalid tool target for McpProcessor: ${toolTarget}. ${formatZodError(result.error)}`
3518
3530
  );
3519
3531
  }
3520
3532
  this.toolTarget = result.data;
@@ -3780,7 +3792,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3780
3792
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
3781
3793
  if (!result.success) {
3782
3794
  throw new Error(
3783
- `Invalid frontmatter in ${join34(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
3795
+ `Invalid frontmatter in ${join34(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
3784
3796
  );
3785
3797
  }
3786
3798
  }
@@ -3831,7 +3843,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3831
3843
  return {
3832
3844
  success: false,
3833
3845
  error: new Error(
3834
- `Invalid frontmatter in ${join34(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
3846
+ `Invalid frontmatter in ${join34(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
3835
3847
  )
3836
3848
  };
3837
3849
  }
@@ -3846,7 +3858,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3846
3858
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3847
3859
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
3848
3860
  if (!result.success) {
3849
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
3861
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
3850
3862
  }
3851
3863
  return {
3852
3864
  baseDir,
@@ -4027,7 +4039,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4027
4039
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
4028
4040
  if (!result.success) {
4029
4041
  throw new Error(
4030
- `Invalid frontmatter in ${join35(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
4042
+ `Invalid frontmatter in ${join35(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4031
4043
  );
4032
4044
  }
4033
4045
  }
@@ -4059,7 +4071,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4059
4071
  return {
4060
4072
  success: false,
4061
4073
  error: new Error(
4062
- `Invalid frontmatter in ${join35(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
4074
+ `Invalid frontmatter in ${join35(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4063
4075
  )
4064
4076
  };
4065
4077
  }
@@ -4071,7 +4083,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4071
4083
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4072
4084
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
4073
4085
  if (!result.success) {
4074
- throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
4086
+ throw new Error(
4087
+ `Invalid frontmatter in ${relativeFilePath}: ${formatZodError(result.error)}`
4088
+ );
4075
4089
  }
4076
4090
  const filename = basename13(relativeFilePath);
4077
4091
  return new _RulesyncSubagent({
@@ -4099,7 +4113,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4099
4113
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
4100
4114
  if (!result.success) {
4101
4115
  throw new Error(
4102
- `Invalid frontmatter in ${join36(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
4116
+ `Invalid frontmatter in ${join36(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4103
4117
  );
4104
4118
  }
4105
4119
  }
@@ -4179,7 +4193,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4179
4193
  return {
4180
4194
  success: false,
4181
4195
  error: new Error(
4182
- `Invalid frontmatter in ${join36(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
4196
+ `Invalid frontmatter in ${join36(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4183
4197
  )
4184
4198
  };
4185
4199
  }
@@ -4202,7 +4216,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4202
4216
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4203
4217
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
4204
4218
  if (!result.success) {
4205
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
4219
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
4206
4220
  }
4207
4221
  return new _ClaudecodeSubagent({
4208
4222
  baseDir,
@@ -4248,7 +4262,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
4248
4262
  const result = SubagentsProcessorToolTargetSchema.safeParse(toolTarget);
4249
4263
  if (!result.success) {
4250
4264
  throw new Error(
4251
- `Invalid tool target for SubagentsProcessor: ${toolTarget}. ${result.error.message}`
4265
+ `Invalid tool target for SubagentsProcessor: ${toolTarget}. ${formatZodError(result.error)}`
4252
4266
  );
4253
4267
  }
4254
4268
  this.toolTarget = result.data;
@@ -4548,7 +4562,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4548
4562
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4549
4563
  if (!result.success) {
4550
4564
  throw new Error(
4551
- `Invalid frontmatter in ${join38(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
4565
+ `Invalid frontmatter in ${join38(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
4552
4566
  );
4553
4567
  }
4554
4568
  }
@@ -4583,7 +4597,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4583
4597
  return {
4584
4598
  success: false,
4585
4599
  error: new Error(
4586
- `Invalid frontmatter in ${join38(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
4600
+ `Invalid frontmatter in ${join38(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
4587
4601
  )
4588
4602
  };
4589
4603
  }
@@ -4602,7 +4616,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4602
4616
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4603
4617
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4604
4618
  if (!result.success) {
4605
- throw new Error(`Invalid frontmatter in ${legacyPath}: ${result.error.message}`);
4619
+ throw new Error(`Invalid frontmatter in ${legacyPath}: ${formatZodError(result.error)}`);
4606
4620
  }
4607
4621
  const validatedFrontmatter = {
4608
4622
  root: result.data.root ?? false,
@@ -4631,7 +4645,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4631
4645
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4632
4646
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4633
4647
  if (!result.success) {
4634
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
4648
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatZodError(result.error)}`);
4635
4649
  }
4636
4650
  const validatedFrontmatter = {
4637
4651
  root: result.data.root ?? false,
@@ -5294,7 +5308,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5294
5308
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
5295
5309
  if (!result.success) {
5296
5310
  throw new Error(
5297
- `Invalid frontmatter in ${join47(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
5311
+ `Invalid frontmatter in ${join47(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
5298
5312
  );
5299
5313
  }
5300
5314
  }
@@ -5389,7 +5403,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5389
5403
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
5390
5404
  if (!result.success) {
5391
5405
  throw new Error(
5392
- `Invalid frontmatter in ${join47(baseDir, relativeFilePath)}: ${result.error.message}`
5406
+ `Invalid frontmatter in ${join47(baseDir, relativeFilePath)}: ${formatZodError(result.error)}`
5393
5407
  );
5394
5408
  }
5395
5409
  return new _CopilotRule({
@@ -5413,7 +5427,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5413
5427
  return {
5414
5428
  success: false,
5415
5429
  error: new Error(
5416
- `Invalid frontmatter in ${join47(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
5430
+ `Invalid frontmatter in ${join47(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
5417
5431
  )
5418
5432
  };
5419
5433
  }
@@ -5455,7 +5469,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5455
5469
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
5456
5470
  if (!result.success) {
5457
5471
  throw new Error(
5458
- `Invalid frontmatter in ${join48(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
5472
+ `Invalid frontmatter in ${join48(rest.relativeDirPath, rest.relativeFilePath)}: ${formatZodError(result.error)}`
5459
5473
  );
5460
5474
  }
5461
5475
  }
@@ -5578,7 +5592,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5578
5592
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
5579
5593
  if (!result.success) {
5580
5594
  throw new Error(
5581
- `Invalid frontmatter in ${join48(baseDir, relativeFilePath)}: ${result.error.message}`
5595
+ `Invalid frontmatter in ${join48(baseDir, relativeFilePath)}: ${formatZodError(result.error)}`
5582
5596
  );
5583
5597
  }
5584
5598
  return new _CursorRule({
@@ -5601,7 +5615,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5601
5615
  return {
5602
5616
  success: false,
5603
5617
  error: new Error(
5604
- `Invalid frontmatter in ${join48(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
5618
+ `Invalid frontmatter in ${join48(this.relativeDirPath, this.relativeFilePath)}: ${formatZodError(result.error)}`
5605
5619
  )
5606
5620
  };
5607
5621
  }
@@ -6176,7 +6190,7 @@ var RulesProcessor = class extends FeatureProcessor {
6176
6190
  const result = RulesProcessorToolTargetSchema.safeParse(toolTarget);
6177
6191
  if (!result.success) {
6178
6192
  throw new Error(
6179
- `Invalid tool target for RulesProcessor: ${toolTarget}. ${result.error.message}`
6193
+ `Invalid tool target for RulesProcessor: ${toolTarget}. ${formatZodError(result.error)}`
6180
6194
  );
6181
6195
  }
6182
6196
  this.toolTarget = result.data;
@@ -7644,7 +7658,7 @@ Attention, again, you are just the planner, so though you can read any files and
7644
7658
  }
7645
7659
 
7646
7660
  // src/cli/index.ts
7647
- var getVersion = () => "3.12.1";
7661
+ var getVersion = () => "3.12.3";
7648
7662
  var main = async () => {
7649
7663
  const program = new Command();
7650
7664
  const version = getVersion();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "3.12.1",
3
+ "version": "3.12.3",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@anthropic-ai/claude-agent-sdk": "0.1.27",
54
- "@biomejs/biome": "2.3.0",
54
+ "@biomejs/biome": "2.3.1",
55
55
  "@eslint/js": "9.38.0",
56
56
  "@secretlint/secretlint-rule-preset-recommend": "11.2.5",
57
57
  "@tsconfig/node24": "24.0.1",