rulesync 3.28.0 → 3.28.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/README.md CHANGED
@@ -203,7 +203,7 @@ npx rulesync generate --targets claudecode --features rules,subagents
203
203
  npx rulesync generate --targets "*" --features rules
204
204
 
205
205
  # Generate simulated commands and subagents
206
- npx rulesync generate --targets copilot,cursor,codexcli --features commands,subagents --simulated-commands --simulated-subagents
206
+ npx rulesync generate --targets copilot,cursor,codexcli --features commands,subagents --simulate-commands --simulate-subagents
207
207
 
208
208
  # Add generated files to .gitignore
209
209
  npx rulesync gitignore
@@ -466,9 +466,9 @@ Simulated commands, subagents and skills allow you to generate simulated feature
466
466
  npx rulesync generate \
467
467
  --targets copilot,cursor,codexcli \
468
468
  --features commands,subagents,skills \
469
- --simulated-commands \
470
- --simulated-subagents \
471
- --simulated-skills
469
+ --simulate-commands \
470
+ --simulate-subagents \
471
+ --simulate-skills
472
472
  ```
473
473
  3. Use simulated commands, subagents and skills in your prompts.
474
474
  - Prompt examples:
package/dist/index.cjs CHANGED
@@ -899,7 +899,7 @@ var RulesyncFile = class extends AiFile {
899
899
  };
900
900
 
901
901
  // src/features/commands/rulesync-command.ts
902
- var RulesyncCommandFrontmatterSchema = import_mini5.z.object({
902
+ var RulesyncCommandFrontmatterSchema = import_mini5.z.looseObject({
903
903
  targets: RulesyncTargetsSchema,
904
904
  description: import_mini5.z.string()
905
905
  });
@@ -1100,7 +1100,7 @@ var AntigravityCommand = class _AntigravityCommand extends ToolCommand {
1100
1100
  // src/features/commands/claudecode-command.ts
1101
1101
  var import_node_path9 = require("path");
1102
1102
  var import_mini7 = require("zod/mini");
1103
- var ClaudecodeCommandFrontmatterSchema = import_mini7.z.object({
1103
+ var ClaudecodeCommandFrontmatterSchema = import_mini7.z.looseObject({
1104
1104
  description: import_mini7.z.string()
1105
1105
  });
1106
1106
  var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
@@ -1134,9 +1134,12 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
1134
1134
  return this.frontmatter;
1135
1135
  }
1136
1136
  toRulesyncCommand() {
1137
+ const { description, ...restFields } = this.frontmatter;
1137
1138
  const rulesyncFrontmatter = {
1138
1139
  targets: ["*"],
1139
- description: this.frontmatter.description
1140
+ description,
1141
+ // Preserve extra fields in claudecode section
1142
+ ...Object.keys(restFields).length > 0 && { claudecode: restFields }
1140
1143
  };
1141
1144
  const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
1142
1145
  return new RulesyncCommand({
@@ -1157,8 +1160,10 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
1157
1160
  global = false
1158
1161
  }) {
1159
1162
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
1163
+ const claudecodeFields = rulesyncFrontmatter.claudecode ?? {};
1160
1164
  const claudecodeFrontmatter = {
1161
- description: rulesyncFrontmatter.description
1165
+ description: rulesyncFrontmatter.description,
1166
+ ...claudecodeFields
1162
1167
  };
1163
1168
  const body = rulesyncCommand.getBody();
1164
1169
  const paths = this.getSettablePaths({ global });
@@ -1295,7 +1300,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
1295
1300
  // src/features/commands/copilot-command.ts
1296
1301
  var import_node_path11 = require("path");
1297
1302
  var import_mini8 = require("zod/mini");
1298
- var CopilotCommandFrontmatterSchema = import_mini8.z.object({
1303
+ var CopilotCommandFrontmatterSchema = import_mini8.z.looseObject({
1299
1304
  mode: import_mini8.z.literal("agent"),
1300
1305
  description: import_mini8.z.string()
1301
1306
  });
@@ -1330,9 +1335,12 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
1330
1335
  return this.frontmatter;
1331
1336
  }
1332
1337
  toRulesyncCommand() {
1338
+ const { mode: _mode, description, ...restFields } = this.frontmatter;
1333
1339
  const rulesyncFrontmatter = {
1334
1340
  targets: ["*"],
1335
- description: this.frontmatter.description
1341
+ description,
1342
+ // Preserve extra fields in copilot section (excluding mode which is fixed)
1343
+ ...Object.keys(restFields).length > 0 && { copilot: restFields }
1336
1344
  };
1337
1345
  const originalFilePath = this.relativeFilePath;
1338
1346
  const relativeFilePath = originalFilePath.replace(/\.prompt\.md$/, ".md");
@@ -1369,9 +1377,11 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
1369
1377
  }) {
1370
1378
  const paths = this.getSettablePaths();
1371
1379
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
1380
+ const copilotFields = rulesyncFrontmatter.copilot ?? {};
1372
1381
  const copilotFrontmatter = {
1373
1382
  mode: "agent",
1374
- description: rulesyncFrontmatter.description
1383
+ description: rulesyncFrontmatter.description,
1384
+ ...copilotFields
1375
1385
  };
1376
1386
  const body = rulesyncCommand.getBody();
1377
1387
  const originalFilePath = rulesyncCommand.getRelativeFilePath();
@@ -1490,7 +1500,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
1490
1500
  var import_node_path13 = require("path");
1491
1501
  var import_smol_toml = require("smol-toml");
1492
1502
  var import_mini9 = require("zod/mini");
1493
- var GeminiCliCommandFrontmatterSchema = import_mini9.z.object({
1503
+ var GeminiCliCommandFrontmatterSchema = import_mini9.z.looseObject({
1494
1504
  description: import_mini9.z.optional(import_mini9.z.string()),
1495
1505
  prompt: import_mini9.z.string()
1496
1506
  });
@@ -1518,8 +1528,8 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1518
1528
  );
1519
1529
  }
1520
1530
  return {
1521
- description: result.data.description || "",
1522
- prompt: result.data.prompt
1531
+ ...result.data,
1532
+ description: result.data.description || ""
1523
1533
  };
1524
1534
  } catch (error) {
1525
1535
  throw new Error(`Failed to parse TOML command file: ${error}`, { cause: error });
@@ -1535,9 +1545,12 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1535
1545
  };
1536
1546
  }
1537
1547
  toRulesyncCommand() {
1548
+ const { description, prompt: _prompt, ...restFields } = this.frontmatter;
1538
1549
  const rulesyncFrontmatter = {
1539
1550
  targets: ["geminicli"],
1540
- description: this.frontmatter.description
1551
+ description: description ?? "",
1552
+ // Preserve extra fields in geminicli section (excluding prompt which is the body)
1553
+ ...Object.keys(restFields).length > 0 && { geminicli: restFields }
1541
1554
  };
1542
1555
  const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
1543
1556
  return new RulesyncCommand({
@@ -1558,9 +1571,11 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1558
1571
  global = false
1559
1572
  }) {
1560
1573
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
1574
+ const geminicliFields = rulesyncFrontmatter.geminicli ?? {};
1561
1575
  const geminiFrontmatter = {
1562
1576
  description: rulesyncFrontmatter.description,
1563
- prompt: rulesyncCommand.getBody()
1577
+ prompt: rulesyncCommand.getBody(),
1578
+ ...geminicliFields
1564
1579
  };
1565
1580
  const tomlContent = `description = "${geminiFrontmatter.description}"
1566
1581
  prompt = """
@@ -1611,7 +1626,7 @@ ${geminiFrontmatter.prompt}
1611
1626
  // src/features/commands/roo-command.ts
1612
1627
  var import_node_path14 = require("path");
1613
1628
  var import_mini10 = require("zod/mini");
1614
- var RooCommandFrontmatterSchema = import_mini10.z.object({
1629
+ var RooCommandFrontmatterSchema = import_mini10.z.looseObject({
1615
1630
  description: import_mini10.z.string(),
1616
1631
  "argument-hint": (0, import_mini10.optional)(import_mini10.z.string())
1617
1632
  });
@@ -1646,9 +1661,12 @@ var RooCommand = class _RooCommand extends ToolCommand {
1646
1661
  return this.frontmatter;
1647
1662
  }
1648
1663
  toRulesyncCommand() {
1664
+ const { description, ...restFields } = this.frontmatter;
1649
1665
  const rulesyncFrontmatter = {
1650
1666
  targets: ["roo"],
1651
- description: this.frontmatter.description
1667
+ description,
1668
+ // Preserve extra fields in roo section
1669
+ ...Object.keys(restFields).length > 0 && { roo: restFields }
1652
1670
  };
1653
1671
  const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
1654
1672
  return new RulesyncCommand({
@@ -1668,8 +1686,10 @@ var RooCommand = class _RooCommand extends ToolCommand {
1668
1686
  validate = true
1669
1687
  }) {
1670
1688
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
1689
+ const rooFields = rulesyncFrontmatter.roo ?? {};
1671
1690
  const rooFrontmatter = {
1672
- description: rulesyncFrontmatter.description
1691
+ description: rulesyncFrontmatter.description,
1692
+ ...rooFields
1673
1693
  };
1674
1694
  const body = rulesyncCommand.getBody();
1675
1695
  const fileContent = stringifyFrontmatter(body, rooFrontmatter);
@@ -5603,16 +5623,10 @@ var import_mini24 = require("zod/mini");
5603
5623
  // src/features/subagents/rulesync-subagent.ts
5604
5624
  var import_node_path58 = require("path");
5605
5625
  var import_mini23 = require("zod/mini");
5606
- var RulesyncSubagentModelSchema = import_mini23.z.enum(["opus", "sonnet", "haiku", "inherit"]);
5607
- var RulesyncSubagentFrontmatterSchema = import_mini23.z.object({
5626
+ var RulesyncSubagentFrontmatterSchema = import_mini23.z.looseObject({
5608
5627
  targets: RulesyncTargetsSchema,
5609
5628
  name: import_mini23.z.string(),
5610
- description: import_mini23.z.string(),
5611
- claudecode: import_mini23.z.optional(
5612
- import_mini23.z.object({
5613
- model: RulesyncSubagentModelSchema
5614
- })
5615
- )
5629
+ description: import_mini23.z.string()
5616
5630
  });
5617
5631
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
5618
5632
  frontmatter;
@@ -5683,7 +5697,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
5683
5697
  };
5684
5698
 
5685
5699
  // src/features/subagents/claudecode-subagent.ts
5686
- var ClaudecodeSubagentFrontmatterSchema = import_mini24.z.object({
5700
+ var ClaudecodeSubagentFrontmatterSchema = import_mini24.z.looseObject({
5687
5701
  name: import_mini24.z.string(),
5688
5702
  description: import_mini24.z.string(),
5689
5703
  model: import_mini24.z.optional(import_mini24.z.enum(["opus", "sonnet", "haiku", "inherit"]))
@@ -5718,15 +5732,17 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
5718
5732
  return this.body;
5719
5733
  }
5720
5734
  toRulesyncSubagent() {
5735
+ const { name, description, model, ...restFields } = this.frontmatter;
5736
+ const claudecodeSection = {
5737
+ ...model && { model },
5738
+ ...restFields
5739
+ };
5721
5740
  const rulesyncFrontmatter = {
5722
5741
  targets: ["claudecode"],
5723
- name: this.frontmatter.name,
5724
- description: this.frontmatter.description,
5725
- ...this.frontmatter.model && {
5726
- claudecode: {
5727
- model: this.frontmatter.model
5728
- }
5729
- }
5742
+ name,
5743
+ description,
5744
+ // Only include claudecode section if there are fields
5745
+ ...Object.keys(claudecodeSection).length > 0 && { claudecode: claudecodeSection }
5730
5746
  };
5731
5747
  return new RulesyncSubagent({
5732
5748
  baseDir: ".",
@@ -5745,11 +5761,17 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
5745
5761
  global = false
5746
5762
  }) {
5747
5763
  const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
5748
- const claudecodeFrontmatter = {
5764
+ const claudecodeSection = rulesyncFrontmatter.claudecode ?? {};
5765
+ const rawClaudecodeFrontmatter = {
5749
5766
  name: rulesyncFrontmatter.name,
5750
5767
  description: rulesyncFrontmatter.description,
5751
- model: rulesyncFrontmatter.claudecode?.model
5768
+ ...claudecodeSection
5752
5769
  };
5770
+ const result = ClaudecodeSubagentFrontmatterSchema.safeParse(rawClaudecodeFrontmatter);
5771
+ if (!result.success) {
5772
+ throw new Error(`Invalid claudecode subagent frontmatter: ${formatError(result.error)}`);
5773
+ }
5774
+ const claudecodeFrontmatter = result.data;
5753
5775
  const body = rulesyncSubagent.getBody();
5754
5776
  const fileContent = stringifyFrontmatter(body, claudecodeFrontmatter);
5755
5777
  const paths = this.getSettablePaths({ global });
@@ -8638,7 +8660,7 @@ var RulesProcessor = class extends FeatureProcessor {
8638
8660
  `@${rule.getRelativePathFromCwd()} description: "${escapedDescription}" globs: "${globsText}"`
8639
8661
  );
8640
8662
  }
8641
- return lines.join("\n") + "\n";
8663
+ return lines.join("\n") + "\n\n";
8642
8664
  }
8643
8665
  generateAdditionalConventionsSection({
8644
8666
  commands,
@@ -10218,7 +10240,7 @@ async function mcpCommand({ version }) {
10218
10240
  }
10219
10241
 
10220
10242
  // src/cli/index.ts
10221
- var getVersion = () => "3.28.0";
10243
+ var getVersion = () => "3.28.1";
10222
10244
  var main = async () => {
10223
10245
  const program = new import_commander.Command();
10224
10246
  const version = getVersion();
package/dist/index.js CHANGED
@@ -876,7 +876,7 @@ var RulesyncFile = class extends AiFile {
876
876
  };
877
877
 
878
878
  // src/features/commands/rulesync-command.ts
879
- var RulesyncCommandFrontmatterSchema = z5.object({
879
+ var RulesyncCommandFrontmatterSchema = z5.looseObject({
880
880
  targets: RulesyncTargetsSchema,
881
881
  description: z5.string()
882
882
  });
@@ -1077,7 +1077,7 @@ var AntigravityCommand = class _AntigravityCommand extends ToolCommand {
1077
1077
  // src/features/commands/claudecode-command.ts
1078
1078
  import { basename as basename6, join as join7 } from "path";
1079
1079
  import { z as z7 } from "zod/mini";
1080
- var ClaudecodeCommandFrontmatterSchema = z7.object({
1080
+ var ClaudecodeCommandFrontmatterSchema = z7.looseObject({
1081
1081
  description: z7.string()
1082
1082
  });
1083
1083
  var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
@@ -1111,9 +1111,12 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
1111
1111
  return this.frontmatter;
1112
1112
  }
1113
1113
  toRulesyncCommand() {
1114
+ const { description, ...restFields } = this.frontmatter;
1114
1115
  const rulesyncFrontmatter = {
1115
1116
  targets: ["*"],
1116
- description: this.frontmatter.description
1117
+ description,
1118
+ // Preserve extra fields in claudecode section
1119
+ ...Object.keys(restFields).length > 0 && { claudecode: restFields }
1117
1120
  };
1118
1121
  const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
1119
1122
  return new RulesyncCommand({
@@ -1134,8 +1137,10 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
1134
1137
  global = false
1135
1138
  }) {
1136
1139
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
1140
+ const claudecodeFields = rulesyncFrontmatter.claudecode ?? {};
1137
1141
  const claudecodeFrontmatter = {
1138
- description: rulesyncFrontmatter.description
1142
+ description: rulesyncFrontmatter.description,
1143
+ ...claudecodeFields
1139
1144
  };
1140
1145
  const body = rulesyncCommand.getBody();
1141
1146
  const paths = this.getSettablePaths({ global });
@@ -1272,7 +1277,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
1272
1277
  // src/features/commands/copilot-command.ts
1273
1278
  import { basename as basename8, join as join9 } from "path";
1274
1279
  import { z as z8 } from "zod/mini";
1275
- var CopilotCommandFrontmatterSchema = z8.object({
1280
+ var CopilotCommandFrontmatterSchema = z8.looseObject({
1276
1281
  mode: z8.literal("agent"),
1277
1282
  description: z8.string()
1278
1283
  });
@@ -1307,9 +1312,12 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
1307
1312
  return this.frontmatter;
1308
1313
  }
1309
1314
  toRulesyncCommand() {
1315
+ const { mode: _mode, description, ...restFields } = this.frontmatter;
1310
1316
  const rulesyncFrontmatter = {
1311
1317
  targets: ["*"],
1312
- description: this.frontmatter.description
1318
+ description,
1319
+ // Preserve extra fields in copilot section (excluding mode which is fixed)
1320
+ ...Object.keys(restFields).length > 0 && { copilot: restFields }
1313
1321
  };
1314
1322
  const originalFilePath = this.relativeFilePath;
1315
1323
  const relativeFilePath = originalFilePath.replace(/\.prompt\.md$/, ".md");
@@ -1346,9 +1354,11 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
1346
1354
  }) {
1347
1355
  const paths = this.getSettablePaths();
1348
1356
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
1357
+ const copilotFields = rulesyncFrontmatter.copilot ?? {};
1349
1358
  const copilotFrontmatter = {
1350
1359
  mode: "agent",
1351
- description: rulesyncFrontmatter.description
1360
+ description: rulesyncFrontmatter.description,
1361
+ ...copilotFields
1352
1362
  };
1353
1363
  const body = rulesyncCommand.getBody();
1354
1364
  const originalFilePath = rulesyncCommand.getRelativeFilePath();
@@ -1467,7 +1477,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
1467
1477
  import { basename as basename10, join as join11 } from "path";
1468
1478
  import { parse as parseToml } from "smol-toml";
1469
1479
  import { z as z9 } from "zod/mini";
1470
- var GeminiCliCommandFrontmatterSchema = z9.object({
1480
+ var GeminiCliCommandFrontmatterSchema = z9.looseObject({
1471
1481
  description: z9.optional(z9.string()),
1472
1482
  prompt: z9.string()
1473
1483
  });
@@ -1495,8 +1505,8 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1495
1505
  );
1496
1506
  }
1497
1507
  return {
1498
- description: result.data.description || "",
1499
- prompt: result.data.prompt
1508
+ ...result.data,
1509
+ description: result.data.description || ""
1500
1510
  };
1501
1511
  } catch (error) {
1502
1512
  throw new Error(`Failed to parse TOML command file: ${error}`, { cause: error });
@@ -1512,9 +1522,12 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1512
1522
  };
1513
1523
  }
1514
1524
  toRulesyncCommand() {
1525
+ const { description, prompt: _prompt, ...restFields } = this.frontmatter;
1515
1526
  const rulesyncFrontmatter = {
1516
1527
  targets: ["geminicli"],
1517
- description: this.frontmatter.description
1528
+ description: description ?? "",
1529
+ // Preserve extra fields in geminicli section (excluding prompt which is the body)
1530
+ ...Object.keys(restFields).length > 0 && { geminicli: restFields }
1518
1531
  };
1519
1532
  const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
1520
1533
  return new RulesyncCommand({
@@ -1535,9 +1548,11 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1535
1548
  global = false
1536
1549
  }) {
1537
1550
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
1551
+ const geminicliFields = rulesyncFrontmatter.geminicli ?? {};
1538
1552
  const geminiFrontmatter = {
1539
1553
  description: rulesyncFrontmatter.description,
1540
- prompt: rulesyncCommand.getBody()
1554
+ prompt: rulesyncCommand.getBody(),
1555
+ ...geminicliFields
1541
1556
  };
1542
1557
  const tomlContent = `description = "${geminiFrontmatter.description}"
1543
1558
  prompt = """
@@ -1588,7 +1603,7 @@ ${geminiFrontmatter.prompt}
1588
1603
  // src/features/commands/roo-command.ts
1589
1604
  import { basename as basename11, join as join12 } from "path";
1590
1605
  import { optional as optional2, z as z10 } from "zod/mini";
1591
- var RooCommandFrontmatterSchema = z10.object({
1606
+ var RooCommandFrontmatterSchema = z10.looseObject({
1592
1607
  description: z10.string(),
1593
1608
  "argument-hint": optional2(z10.string())
1594
1609
  });
@@ -1623,9 +1638,12 @@ var RooCommand = class _RooCommand extends ToolCommand {
1623
1638
  return this.frontmatter;
1624
1639
  }
1625
1640
  toRulesyncCommand() {
1641
+ const { description, ...restFields } = this.frontmatter;
1626
1642
  const rulesyncFrontmatter = {
1627
1643
  targets: ["roo"],
1628
- description: this.frontmatter.description
1644
+ description,
1645
+ // Preserve extra fields in roo section
1646
+ ...Object.keys(restFields).length > 0 && { roo: restFields }
1629
1647
  };
1630
1648
  const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
1631
1649
  return new RulesyncCommand({
@@ -1645,8 +1663,10 @@ var RooCommand = class _RooCommand extends ToolCommand {
1645
1663
  validate = true
1646
1664
  }) {
1647
1665
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
1666
+ const rooFields = rulesyncFrontmatter.roo ?? {};
1648
1667
  const rooFrontmatter = {
1649
- description: rulesyncFrontmatter.description
1668
+ description: rulesyncFrontmatter.description,
1669
+ ...rooFields
1650
1670
  };
1651
1671
  const body = rulesyncCommand.getBody();
1652
1672
  const fileContent = stringifyFrontmatter(body, rooFrontmatter);
@@ -5580,16 +5600,10 @@ import { z as z24 } from "zod/mini";
5580
5600
  // src/features/subagents/rulesync-subagent.ts
5581
5601
  import { basename as basename16, join as join56 } from "path";
5582
5602
  import { z as z23 } from "zod/mini";
5583
- var RulesyncSubagentModelSchema = z23.enum(["opus", "sonnet", "haiku", "inherit"]);
5584
- var RulesyncSubagentFrontmatterSchema = z23.object({
5603
+ var RulesyncSubagentFrontmatterSchema = z23.looseObject({
5585
5604
  targets: RulesyncTargetsSchema,
5586
5605
  name: z23.string(),
5587
- description: z23.string(),
5588
- claudecode: z23.optional(
5589
- z23.object({
5590
- model: RulesyncSubagentModelSchema
5591
- })
5592
- )
5606
+ description: z23.string()
5593
5607
  });
5594
5608
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
5595
5609
  frontmatter;
@@ -5660,7 +5674,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
5660
5674
  };
5661
5675
 
5662
5676
  // src/features/subagents/claudecode-subagent.ts
5663
- var ClaudecodeSubagentFrontmatterSchema = z24.object({
5677
+ var ClaudecodeSubagentFrontmatterSchema = z24.looseObject({
5664
5678
  name: z24.string(),
5665
5679
  description: z24.string(),
5666
5680
  model: z24.optional(z24.enum(["opus", "sonnet", "haiku", "inherit"]))
@@ -5695,15 +5709,17 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
5695
5709
  return this.body;
5696
5710
  }
5697
5711
  toRulesyncSubagent() {
5712
+ const { name, description, model, ...restFields } = this.frontmatter;
5713
+ const claudecodeSection = {
5714
+ ...model && { model },
5715
+ ...restFields
5716
+ };
5698
5717
  const rulesyncFrontmatter = {
5699
5718
  targets: ["claudecode"],
5700
- name: this.frontmatter.name,
5701
- description: this.frontmatter.description,
5702
- ...this.frontmatter.model && {
5703
- claudecode: {
5704
- model: this.frontmatter.model
5705
- }
5706
- }
5719
+ name,
5720
+ description,
5721
+ // Only include claudecode section if there are fields
5722
+ ...Object.keys(claudecodeSection).length > 0 && { claudecode: claudecodeSection }
5707
5723
  };
5708
5724
  return new RulesyncSubagent({
5709
5725
  baseDir: ".",
@@ -5722,11 +5738,17 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
5722
5738
  global = false
5723
5739
  }) {
5724
5740
  const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
5725
- const claudecodeFrontmatter = {
5741
+ const claudecodeSection = rulesyncFrontmatter.claudecode ?? {};
5742
+ const rawClaudecodeFrontmatter = {
5726
5743
  name: rulesyncFrontmatter.name,
5727
5744
  description: rulesyncFrontmatter.description,
5728
- model: rulesyncFrontmatter.claudecode?.model
5745
+ ...claudecodeSection
5729
5746
  };
5747
+ const result = ClaudecodeSubagentFrontmatterSchema.safeParse(rawClaudecodeFrontmatter);
5748
+ if (!result.success) {
5749
+ throw new Error(`Invalid claudecode subagent frontmatter: ${formatError(result.error)}`);
5750
+ }
5751
+ const claudecodeFrontmatter = result.data;
5730
5752
  const body = rulesyncSubagent.getBody();
5731
5753
  const fileContent = stringifyFrontmatter(body, claudecodeFrontmatter);
5732
5754
  const paths = this.getSettablePaths({ global });
@@ -8615,7 +8637,7 @@ var RulesProcessor = class extends FeatureProcessor {
8615
8637
  `@${rule.getRelativePathFromCwd()} description: "${escapedDescription}" globs: "${globsText}"`
8616
8638
  );
8617
8639
  }
8618
- return lines.join("\n") + "\n";
8640
+ return lines.join("\n") + "\n\n";
8619
8641
  }
8620
8642
  generateAdditionalConventionsSection({
8621
8643
  commands,
@@ -10195,7 +10217,7 @@ async function mcpCommand({ version }) {
10195
10217
  }
10196
10218
 
10197
10219
  // src/cli/index.ts
10198
- var getVersion = () => "3.28.0";
10220
+ var getVersion = () => "3.28.1";
10199
10221
  var main = async () => {
10200
10222
  const program = new Command();
10201
10223
  const version = getVersion();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "3.28.0",
3
+ "version": "3.28.1",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",