rulesync 7.5.0 → 7.6.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.
@@ -112,6 +112,7 @@ var ALL_TOOL_TARGETS = [
112
112
  "cursor",
113
113
  "factorydroid",
114
114
  "geminicli",
115
+ "goose",
115
116
  "junie",
116
117
  "kilo",
117
118
  "kiro",
@@ -602,7 +603,7 @@ function getBaseDirsInLightOfGlobal({
602
603
 
603
604
  // src/lib/generate.ts
604
605
  import { intersection } from "es-toolkit";
605
- import { join as join109 } from "path";
606
+ import { join as join110 } from "path";
606
607
 
607
608
  // src/features/commands/commands-processor.ts
608
609
  import { basename as basename2, join as join19, relative as relative3 } from "path";
@@ -3846,7 +3847,7 @@ var HooksProcessor = class extends FeatureProcessor {
3846
3847
  try {
3847
3848
  return [
3848
3849
  await RulesyncHooks.fromFile({
3849
- baseDir: this.baseDir,
3850
+ baseDir: process.cwd(),
3850
3851
  validate: true
3851
3852
  })
3852
3853
  ];
@@ -5448,24 +5449,25 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5448
5449
  getToml() {
5449
5450
  return this.toml;
5450
5451
  }
5451
- static getSettablePaths({ global } = {}) {
5452
- if (!global) {
5453
- throw new Error("CodexcliMcp only supports global mode. Please pass { global: true }.");
5454
- }
5452
+ static getSettablePaths(_options = {}) {
5455
5453
  return {
5456
5454
  relativeDirPath: ".codex",
5457
5455
  relativeFilePath: "config.toml"
5458
5456
  };
5459
5457
  }
5458
+ /**
5459
+ * config.toml may contain other Codex settings, so it should not be deleted.
5460
+ */
5461
+ isDeletable() {
5462
+ return false;
5463
+ }
5460
5464
  static async fromFile({
5461
5465
  baseDir = process.cwd(),
5462
5466
  validate = true,
5463
5467
  global = false
5464
5468
  }) {
5465
5469
  const paths = this.getSettablePaths({ global });
5466
- const fileContent = await readFileContent(
5467
- join41(baseDir, paths.relativeDirPath, paths.relativeFilePath)
5468
- );
5470
+ const fileContent = await readFileContentOrNull(join41(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
5469
5471
  return new _CodexcliMcp({
5470
5472
  baseDir,
5471
5473
  relativeDirPath: paths.relativeDirPath,
@@ -6521,7 +6523,7 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
6521
6523
  {
6522
6524
  class: CodexcliMcp,
6523
6525
  meta: {
6524
- supportsProject: false,
6526
+ supportsProject: true,
6525
6527
  supportsGlobal: true,
6526
6528
  supportsEnabledTools: true,
6527
6529
  supportsDisabledTools: true
@@ -6781,8 +6783,8 @@ var McpProcessor = class extends FeatureProcessor {
6781
6783
 
6782
6784
  // src/features/rules/rules-processor.ts
6783
6785
  import { encode } from "@toon-format/toon";
6784
- import { basename as basename10, join as join108, relative as relative5 } from "path";
6785
- import { z as z49 } from "zod/mini";
6786
+ import { basename as basename10, join as join109, relative as relative5 } from "path";
6787
+ import { z as z50 } from "zod/mini";
6786
6788
 
6787
6789
  // src/constants/general.ts
6788
6790
  var SKILL_FILE_NAME = "SKILL.md";
@@ -9678,14 +9680,14 @@ var SkillsProcessor = class extends DirFeatureProcessor {
9678
9680
  * Local skills take precedence over curated skills with the same name.
9679
9681
  */
9680
9682
  async loadRulesyncDirs() {
9681
- const localDirNames = [...await getLocalSkillDirNames(this.baseDir)];
9683
+ const localDirNames = [...await getLocalSkillDirNames(process.cwd())];
9682
9684
  const localSkills = await Promise.all(
9683
9685
  localDirNames.map(
9684
- (dirName) => RulesyncSkill.fromDir({ baseDir: this.baseDir, dirName, global: this.global })
9686
+ (dirName) => RulesyncSkill.fromDir({ baseDir: process.cwd(), dirName, global: this.global })
9685
9687
  )
9686
9688
  );
9687
9689
  const localSkillNames = new Set(localDirNames);
9688
- const curatedDirPath = join71(this.baseDir, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
9690
+ const curatedDirPath = join71(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
9689
9691
  let curatedSkills = [];
9690
9692
  if (await directoryExists(curatedDirPath)) {
9691
9693
  const curatedDirPaths = await findFilesByGlobs(join71(curatedDirPath, "*"), { type: "dir" });
@@ -9701,7 +9703,7 @@ var SkillsProcessor = class extends DirFeatureProcessor {
9701
9703
  curatedSkills = await Promise.all(
9702
9704
  nonConflicting.map(
9703
9705
  (dirName) => RulesyncSkill.fromDir({
9704
- baseDir: this.baseDir,
9706
+ baseDir: process.cwd(),
9705
9707
  relativeDirPath: curatedRelativeDirPath,
9706
9708
  dirName,
9707
9709
  global: this.global
@@ -9981,39 +9983,12 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
9981
9983
  }
9982
9984
  };
9983
9985
 
9984
- // src/features/subagents/codexcli-subagent.ts
9985
- import { join as join74 } from "path";
9986
- var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
9987
- static getSettablePaths() {
9988
- return {
9989
- relativeDirPath: join74(".codex", "subagents")
9990
- };
9991
- }
9992
- static async fromFile(params) {
9993
- const baseParams = await this.fromFileDefault(params);
9994
- return new _CodexCliSubagent(baseParams);
9995
- }
9996
- static fromRulesyncSubagent(params) {
9997
- const baseParams = this.fromRulesyncSubagentDefault(params);
9998
- return new _CodexCliSubagent(baseParams);
9999
- }
10000
- static isTargetedByRulesyncSubagent(rulesyncSubagent) {
10001
- return this.isTargetedByRulesyncSubagentDefault({
10002
- rulesyncSubagent,
10003
- toolTarget: "codexcli"
10004
- });
10005
- }
10006
- static forDeletion(params) {
10007
- return new _CodexCliSubagent(this.forDeletionDefault(params));
10008
- }
10009
- };
10010
-
10011
9986
  // src/features/subagents/factorydroid-subagent.ts
10012
- import { join as join75 } from "path";
9987
+ import { join as join74 } from "path";
10013
9988
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
10014
9989
  static getSettablePaths(_options) {
10015
9990
  return {
10016
- relativeDirPath: join75(".factory", "droids")
9991
+ relativeDirPath: join74(".factory", "droids")
10017
9992
  };
10018
9993
  }
10019
9994
  static async fromFile(params) {
@@ -10036,11 +10011,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
10036
10011
  };
10037
10012
 
10038
10013
  // src/features/subagents/geminicli-subagent.ts
10039
- import { join as join76 } from "path";
10014
+ import { join as join75 } from "path";
10040
10015
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10041
10016
  static getSettablePaths() {
10042
10017
  return {
10043
- relativeDirPath: join76(".gemini", "subagents")
10018
+ relativeDirPath: join75(".gemini", "subagents")
10044
10019
  };
10045
10020
  }
10046
10021
  static async fromFile(params) {
@@ -10063,11 +10038,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10063
10038
  };
10064
10039
 
10065
10040
  // src/features/subagents/roo-subagent.ts
10066
- import { join as join77 } from "path";
10041
+ import { join as join76 } from "path";
10067
10042
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10068
10043
  static getSettablePaths() {
10069
10044
  return {
10070
- relativeDirPath: join77(".roo", "subagents")
10045
+ relativeDirPath: join76(".roo", "subagents")
10071
10046
  };
10072
10047
  }
10073
10048
  static async fromFile(params) {
@@ -10091,14 +10066,14 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10091
10066
 
10092
10067
  // src/features/subagents/subagents-processor.ts
10093
10068
  import { basename as basename9, join as join84 } from "path";
10094
- import { z as z42 } from "zod/mini";
10069
+ import { z as z43 } from "zod/mini";
10095
10070
 
10096
10071
  // src/features/subagents/claudecode-subagent.ts
10097
- import { join as join79 } from "path";
10072
+ import { join as join78 } from "path";
10098
10073
  import { z as z37 } from "zod/mini";
10099
10074
 
10100
10075
  // src/features/subagents/rulesync-subagent.ts
10101
- import { basename as basename7, join as join78 } from "path";
10076
+ import { basename as basename7, join as join77 } from "path";
10102
10077
  import { z as z36 } from "zod/mini";
10103
10078
  var RulesyncSubagentFrontmatterSchema = z36.looseObject({
10104
10079
  targets: z36._default(RulesyncTargetsSchema, ["*"]),
@@ -10112,7 +10087,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10112
10087
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10113
10088
  if (!parseResult.success && rest.validate !== false) {
10114
10089
  throw new Error(
10115
- `Invalid frontmatter in ${join78(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10090
+ `Invalid frontmatter in ${join77(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10116
10091
  );
10117
10092
  }
10118
10093
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -10145,7 +10120,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10145
10120
  return {
10146
10121
  success: false,
10147
10122
  error: new Error(
10148
- `Invalid frontmatter in ${join78(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10123
+ `Invalid frontmatter in ${join77(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10149
10124
  )
10150
10125
  };
10151
10126
  }
@@ -10154,7 +10129,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10154
10129
  relativeFilePath
10155
10130
  }) {
10156
10131
  const fileContent = await readFileContent(
10157
- join78(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
10132
+ join77(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
10158
10133
  );
10159
10134
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
10160
10135
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10189,7 +10164,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10189
10164
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
10190
10165
  if (!result.success) {
10191
10166
  throw new Error(
10192
- `Invalid frontmatter in ${join79(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10167
+ `Invalid frontmatter in ${join78(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10193
10168
  );
10194
10169
  }
10195
10170
  }
@@ -10201,7 +10176,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10201
10176
  }
10202
10177
  static getSettablePaths(_options = {}) {
10203
10178
  return {
10204
- relativeDirPath: join79(".claude", "agents")
10179
+ relativeDirPath: join78(".claude", "agents")
10205
10180
  };
10206
10181
  }
10207
10182
  getFrontmatter() {
@@ -10277,7 +10252,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10277
10252
  return {
10278
10253
  success: false,
10279
10254
  error: new Error(
10280
- `Invalid frontmatter in ${join79(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10255
+ `Invalid frontmatter in ${join78(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10281
10256
  )
10282
10257
  };
10283
10258
  }
@@ -10295,7 +10270,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10295
10270
  global = false
10296
10271
  }) {
10297
10272
  const paths = this.getSettablePaths({ global });
10298
- const filePath = join79(baseDir, paths.relativeDirPath, relativeFilePath);
10273
+ const filePath = join78(baseDir, paths.relativeDirPath, relativeFilePath);
10299
10274
  const fileContent = await readFileContent(filePath);
10300
10275
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
10301
10276
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10329,14 +10304,158 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10329
10304
  }
10330
10305
  };
10331
10306
 
10307
+ // src/features/subagents/codexcli-subagent.ts
10308
+ import { join as join79 } from "path";
10309
+ import * as smolToml2 from "smol-toml";
10310
+ import { z as z38 } from "zod/mini";
10311
+ var CodexCliSubagentTomlSchema = z38.looseObject({
10312
+ name: z38.string(),
10313
+ description: z38.optional(z38.string()),
10314
+ developer_instructions: z38.optional(z38.string()),
10315
+ model: z38.optional(z38.string()),
10316
+ model_reasoning_effort: z38.optional(z38.string()),
10317
+ sandbox_mode: z38.optional(z38.string())
10318
+ });
10319
+ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10320
+ body;
10321
+ constructor({ body, ...rest }) {
10322
+ super({
10323
+ ...rest
10324
+ });
10325
+ this.body = body;
10326
+ }
10327
+ static getSettablePaths(_options = {}) {
10328
+ return {
10329
+ relativeDirPath: join79(".codex", "agents")
10330
+ };
10331
+ }
10332
+ getBody() {
10333
+ return this.body;
10334
+ }
10335
+ toRulesyncSubagent() {
10336
+ let parsed;
10337
+ try {
10338
+ parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
10339
+ } catch (error) {
10340
+ throw new Error(
10341
+ `Failed to parse TOML in ${join79(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
10342
+ { cause: error }
10343
+ );
10344
+ }
10345
+ const { name, description, developer_instructions, ...restFields } = parsed;
10346
+ const codexcliSection = {
10347
+ ...restFields
10348
+ };
10349
+ const rulesyncFrontmatter = {
10350
+ targets: ["codexcli"],
10351
+ name,
10352
+ description: description ?? "",
10353
+ // Only include codexcli section if there are fields
10354
+ ...Object.keys(codexcliSection).length > 0 && { codexcli: codexcliSection }
10355
+ };
10356
+ return new RulesyncSubagent({
10357
+ baseDir: ".",
10358
+ frontmatter: rulesyncFrontmatter,
10359
+ body: developer_instructions ?? "",
10360
+ relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
10361
+ relativeFilePath: this.getRelativeFilePath().replace(/\.toml$/, ".md"),
10362
+ validate: true
10363
+ });
10364
+ }
10365
+ static fromRulesyncSubagent({
10366
+ baseDir = process.cwd(),
10367
+ rulesyncSubagent,
10368
+ validate = true,
10369
+ global = false
10370
+ }) {
10371
+ const frontmatter = rulesyncSubagent.getFrontmatter();
10372
+ const rawSection = frontmatter.codexcli ?? {};
10373
+ const {
10374
+ name: _n,
10375
+ description: _d,
10376
+ developer_instructions: _di,
10377
+ ...codexcliSection
10378
+ } = rawSection;
10379
+ const tomlObj = {
10380
+ name: frontmatter.name,
10381
+ ...frontmatter.description ? { description: frontmatter.description } : {},
10382
+ ...rulesyncSubagent.getBody() ? { developer_instructions: rulesyncSubagent.getBody() } : {},
10383
+ ...codexcliSection
10384
+ };
10385
+ const body = smolToml2.stringify(tomlObj);
10386
+ const paths = this.getSettablePaths({ global });
10387
+ const relativeFilePath = rulesyncSubagent.getRelativeFilePath().replace(/\.md$/, ".toml");
10388
+ return new _CodexCliSubagent({
10389
+ baseDir,
10390
+ body,
10391
+ relativeDirPath: paths.relativeDirPath,
10392
+ relativeFilePath,
10393
+ fileContent: body,
10394
+ validate,
10395
+ global
10396
+ });
10397
+ }
10398
+ validate() {
10399
+ try {
10400
+ const parsed = smolToml2.parse(this.body);
10401
+ CodexCliSubagentTomlSchema.parse(parsed);
10402
+ return { success: true, error: null };
10403
+ } catch (error) {
10404
+ return {
10405
+ success: false,
10406
+ error: error instanceof Error ? error : new Error(String(error))
10407
+ };
10408
+ }
10409
+ }
10410
+ static isTargetedByRulesyncSubagent(rulesyncSubagent) {
10411
+ return this.isTargetedByRulesyncSubagentDefault({
10412
+ rulesyncSubagent,
10413
+ toolTarget: "codexcli"
10414
+ });
10415
+ }
10416
+ static async fromFile({
10417
+ baseDir = process.cwd(),
10418
+ relativeFilePath,
10419
+ validate = true,
10420
+ global = false
10421
+ }) {
10422
+ const paths = this.getSettablePaths({ global });
10423
+ const filePath = join79(baseDir, paths.relativeDirPath, relativeFilePath);
10424
+ const fileContent = await readFileContent(filePath);
10425
+ return new _CodexCliSubagent({
10426
+ baseDir,
10427
+ relativeDirPath: paths.relativeDirPath,
10428
+ relativeFilePath,
10429
+ body: fileContent.trim(),
10430
+ fileContent,
10431
+ validate,
10432
+ global
10433
+ });
10434
+ }
10435
+ static forDeletion({
10436
+ baseDir = process.cwd(),
10437
+ relativeDirPath,
10438
+ relativeFilePath
10439
+ }) {
10440
+ return new _CodexCliSubagent({
10441
+ baseDir,
10442
+ relativeDirPath,
10443
+ relativeFilePath,
10444
+ body: "",
10445
+ fileContent: "",
10446
+ validate: false
10447
+ });
10448
+ }
10449
+ };
10450
+
10332
10451
  // src/features/subagents/copilot-subagent.ts
10333
10452
  import { join as join80 } from "path";
10334
- import { z as z38 } from "zod/mini";
10453
+ import { z as z39 } from "zod/mini";
10335
10454
  var REQUIRED_TOOL = "agent/runSubagent";
10336
- var CopilotSubagentFrontmatterSchema = z38.looseObject({
10337
- name: z38.string(),
10338
- description: z38.string(),
10339
- tools: z38.optional(z38.union([z38.string(), z38.array(z38.string())]))
10455
+ var CopilotSubagentFrontmatterSchema = z39.looseObject({
10456
+ name: z39.string(),
10457
+ description: z39.string(),
10458
+ tools: z39.optional(z39.union([z39.string(), z39.array(z39.string())]))
10340
10459
  });
10341
10460
  var normalizeTools = (tools) => {
10342
10461
  if (!tools) {
@@ -10497,10 +10616,10 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10497
10616
 
10498
10617
  // src/features/subagents/cursor-subagent.ts
10499
10618
  import { join as join81 } from "path";
10500
- import { z as z39 } from "zod/mini";
10501
- var CursorSubagentFrontmatterSchema = z39.looseObject({
10502
- name: z39.string(),
10503
- description: z39.string()
10619
+ import { z as z40 } from "zod/mini";
10620
+ var CursorSubagentFrontmatterSchema = z40.looseObject({
10621
+ name: z40.string(),
10622
+ description: z40.string()
10504
10623
  });
10505
10624
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
10506
10625
  frontmatter;
@@ -10644,22 +10763,22 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
10644
10763
 
10645
10764
  // src/features/subagents/kiro-subagent.ts
10646
10765
  import { join as join82 } from "path";
10647
- import { z as z40 } from "zod/mini";
10648
- var KiroCliSubagentJsonSchema = z40.looseObject({
10649
- name: z40.string(),
10650
- description: z40.optional(z40.nullable(z40.string())),
10651
- prompt: z40.optional(z40.nullable(z40.string())),
10652
- tools: z40.optional(z40.nullable(z40.array(z40.string()))),
10653
- toolAliases: z40.optional(z40.nullable(z40.record(z40.string(), z40.string()))),
10654
- toolSettings: z40.optional(z40.nullable(z40.unknown())),
10655
- toolSchema: z40.optional(z40.nullable(z40.unknown())),
10656
- hooks: z40.optional(z40.nullable(z40.record(z40.string(), z40.array(z40.unknown())))),
10657
- model: z40.optional(z40.nullable(z40.string())),
10658
- mcpServers: z40.optional(z40.nullable(z40.record(z40.string(), z40.unknown()))),
10659
- useLegacyMcpJson: z40.optional(z40.nullable(z40.boolean())),
10660
- resources: z40.optional(z40.nullable(z40.array(z40.string()))),
10661
- allowedTools: z40.optional(z40.nullable(z40.array(z40.string()))),
10662
- includeMcpJson: z40.optional(z40.nullable(z40.boolean()))
10766
+ import { z as z41 } from "zod/mini";
10767
+ var KiroCliSubagentJsonSchema = z41.looseObject({
10768
+ name: z41.string(),
10769
+ description: z41.optional(z41.nullable(z41.string())),
10770
+ prompt: z41.optional(z41.nullable(z41.string())),
10771
+ tools: z41.optional(z41.nullable(z41.array(z41.string()))),
10772
+ toolAliases: z41.optional(z41.nullable(z41.record(z41.string(), z41.string()))),
10773
+ toolSettings: z41.optional(z41.nullable(z41.unknown())),
10774
+ toolSchema: z41.optional(z41.nullable(z41.unknown())),
10775
+ hooks: z41.optional(z41.nullable(z41.record(z41.string(), z41.array(z41.unknown())))),
10776
+ model: z41.optional(z41.nullable(z41.string())),
10777
+ mcpServers: z41.optional(z41.nullable(z41.record(z41.string(), z41.unknown()))),
10778
+ useLegacyMcpJson: z41.optional(z41.nullable(z41.boolean())),
10779
+ resources: z41.optional(z41.nullable(z41.array(z41.string()))),
10780
+ allowedTools: z41.optional(z41.nullable(z41.array(z41.string()))),
10781
+ includeMcpJson: z41.optional(z41.nullable(z41.boolean()))
10663
10782
  });
10664
10783
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
10665
10784
  body;
@@ -10781,11 +10900,11 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
10781
10900
 
10782
10901
  // src/features/subagents/opencode-subagent.ts
10783
10902
  import { basename as basename8, join as join83 } from "path";
10784
- import { z as z41 } from "zod/mini";
10785
- var OpenCodeSubagentFrontmatterSchema = z41.looseObject({
10786
- description: z41.string(),
10787
- mode: z41._default(z41.string(), "subagent"),
10788
- name: z41.optional(z41.string())
10903
+ import { z as z42 } from "zod/mini";
10904
+ var OpenCodeSubagentFrontmatterSchema = z42.looseObject({
10905
+ description: z42.string(),
10906
+ mode: z42._default(z42.string(), "subagent"),
10907
+ name: z42.optional(z42.string())
10789
10908
  });
10790
10909
  var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
10791
10910
  frontmatter;
@@ -10941,7 +11060,7 @@ var subagentsProcessorToolTargetTuple = [
10941
11060
  "opencode",
10942
11061
  "roo"
10943
11062
  ];
10944
- var SubagentsProcessorToolTargetSchema = z42.enum(subagentsProcessorToolTargetTuple);
11063
+ var SubagentsProcessorToolTargetSchema = z43.enum(subagentsProcessorToolTargetTuple);
10945
11064
  var toolSubagentFactories = /* @__PURE__ */ new Map([
10946
11065
  [
10947
11066
  "agentsmd",
@@ -10968,7 +11087,7 @@ var toolSubagentFactories = /* @__PURE__ */ new Map([
10968
11087
  "codexcli",
10969
11088
  {
10970
11089
  class: CodexCliSubagent,
10971
- meta: { supportsSimulated: true, supportsGlobal: false, filePattern: "*.md" }
11090
+ meta: { supportsSimulated: false, supportsGlobal: false, filePattern: "*.toml" }
10972
11091
  }
10973
11092
  ],
10974
11093
  [
@@ -11103,7 +11222,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
11103
11222
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
11104
11223
  */
11105
11224
  async loadRulesyncFiles() {
11106
- const subagentsDir = join84(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
11225
+ const subagentsDir = join84(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
11107
11226
  const dirExists = await directoryExists(subagentsDir);
11108
11227
  if (!dirExists) {
11109
11228
  logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -11220,42 +11339,42 @@ import { join as join86 } from "path";
11220
11339
 
11221
11340
  // src/features/rules/rulesync-rule.ts
11222
11341
  import { join as join85 } from "path";
11223
- import { z as z43 } from "zod/mini";
11224
- var RulesyncRuleFrontmatterSchema = z43.object({
11225
- root: z43.optional(z43.boolean()),
11226
- localRoot: z43.optional(z43.boolean()),
11227
- targets: z43._default(RulesyncTargetsSchema, ["*"]),
11228
- description: z43.optional(z43.string()),
11229
- globs: z43.optional(z43.array(z43.string())),
11230
- agentsmd: z43.optional(
11231
- z43.object({
11342
+ import { z as z44 } from "zod/mini";
11343
+ var RulesyncRuleFrontmatterSchema = z44.object({
11344
+ root: z44.optional(z44.boolean()),
11345
+ localRoot: z44.optional(z44.boolean()),
11346
+ targets: z44._default(RulesyncTargetsSchema, ["*"]),
11347
+ description: z44.optional(z44.string()),
11348
+ globs: z44.optional(z44.array(z44.string())),
11349
+ agentsmd: z44.optional(
11350
+ z44.object({
11232
11351
  // @example "path/to/subproject"
11233
- subprojectPath: z43.optional(z43.string())
11352
+ subprojectPath: z44.optional(z44.string())
11234
11353
  })
11235
11354
  ),
11236
- claudecode: z43.optional(
11237
- z43.object({
11355
+ claudecode: z44.optional(
11356
+ z44.object({
11238
11357
  // Glob patterns for conditional rules (takes precedence over globs)
11239
11358
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
11240
- paths: z43.optional(z43.array(z43.string()))
11359
+ paths: z44.optional(z44.array(z44.string()))
11241
11360
  })
11242
11361
  ),
11243
- cursor: z43.optional(
11244
- z43.object({
11245
- alwaysApply: z43.optional(z43.boolean()),
11246
- description: z43.optional(z43.string()),
11247
- globs: z43.optional(z43.array(z43.string()))
11362
+ cursor: z44.optional(
11363
+ z44.object({
11364
+ alwaysApply: z44.optional(z44.boolean()),
11365
+ description: z44.optional(z44.string()),
11366
+ globs: z44.optional(z44.array(z44.string()))
11248
11367
  })
11249
11368
  ),
11250
- copilot: z43.optional(
11251
- z43.object({
11252
- excludeAgent: z43.optional(z43.union([z43.literal("code-review"), z43.literal("coding-agent")]))
11369
+ copilot: z44.optional(
11370
+ z44.object({
11371
+ excludeAgent: z44.optional(z44.union([z44.literal("code-review"), z44.literal("coding-agent")]))
11253
11372
  })
11254
11373
  ),
11255
- antigravity: z43.optional(
11256
- z43.looseObject({
11257
- trigger: z43.optional(z43.string()),
11258
- globs: z43.optional(z43.array(z43.string()))
11374
+ antigravity: z44.optional(
11375
+ z44.looseObject({
11376
+ trigger: z44.optional(z44.string()),
11377
+ globs: z44.optional(z44.array(z44.string()))
11259
11378
  })
11260
11379
  )
11261
11380
  });
@@ -11558,20 +11677,20 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
11558
11677
 
11559
11678
  // src/features/rules/antigravity-rule.ts
11560
11679
  import { join as join88 } from "path";
11561
- import { z as z44 } from "zod/mini";
11562
- var AntigravityRuleFrontmatterSchema = z44.looseObject({
11563
- trigger: z44.optional(
11564
- z44.union([
11565
- z44.literal("always_on"),
11566
- z44.literal("glob"),
11567
- z44.literal("manual"),
11568
- z44.literal("model_decision"),
11569
- z44.string()
11680
+ import { z as z45 } from "zod/mini";
11681
+ var AntigravityRuleFrontmatterSchema = z45.looseObject({
11682
+ trigger: z45.optional(
11683
+ z45.union([
11684
+ z45.literal("always_on"),
11685
+ z45.literal("glob"),
11686
+ z45.literal("manual"),
11687
+ z45.literal("model_decision"),
11688
+ z45.string()
11570
11689
  // accepts any string for forward compatibility
11571
11690
  ])
11572
11691
  ),
11573
- globs: z44.optional(z44.string()),
11574
- description: z44.optional(z44.string())
11692
+ globs: z45.optional(z45.string()),
11693
+ description: z45.optional(z45.string())
11575
11694
  });
11576
11695
  function parseGlobsString(globs) {
11577
11696
  if (!globs) {
@@ -12150,9 +12269,9 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12150
12269
 
12151
12270
  // src/features/rules/claudecode-rule.ts
12152
12271
  import { join as join92 } from "path";
12153
- import { z as z45 } from "zod/mini";
12154
- var ClaudecodeRuleFrontmatterSchema = z45.object({
12155
- paths: z45.optional(z45.array(z45.string()))
12272
+ import { z as z46 } from "zod/mini";
12273
+ var ClaudecodeRuleFrontmatterSchema = z46.object({
12274
+ paths: z46.optional(z46.array(z46.string()))
12156
12275
  });
12157
12276
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12158
12277
  frontmatter;
@@ -12361,9 +12480,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12361
12480
 
12362
12481
  // src/features/rules/cline-rule.ts
12363
12482
  import { join as join93 } from "path";
12364
- import { z as z46 } from "zod/mini";
12365
- var ClineRuleFrontmatterSchema = z46.object({
12366
- description: z46.string()
12483
+ import { z as z47 } from "zod/mini";
12484
+ var ClineRuleFrontmatterSchema = z47.object({
12485
+ description: z47.string()
12367
12486
  });
12368
12487
  var ClineRule = class _ClineRule extends ToolRule {
12369
12488
  static getSettablePaths(_options = {}) {
@@ -12542,11 +12661,11 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
12542
12661
 
12543
12662
  // src/features/rules/copilot-rule.ts
12544
12663
  import { join as join95 } from "path";
12545
- import { z as z47 } from "zod/mini";
12546
- var CopilotRuleFrontmatterSchema = z47.object({
12547
- description: z47.optional(z47.string()),
12548
- applyTo: z47.optional(z47.string()),
12549
- excludeAgent: z47.optional(z47.union([z47.literal("code-review"), z47.literal("coding-agent")]))
12664
+ import { z as z48 } from "zod/mini";
12665
+ var CopilotRuleFrontmatterSchema = z48.object({
12666
+ description: z48.optional(z48.string()),
12667
+ applyTo: z48.optional(z48.string()),
12668
+ excludeAgent: z48.optional(z48.union([z48.literal("code-review"), z48.literal("coding-agent")]))
12550
12669
  });
12551
12670
  var CopilotRule = class _CopilotRule extends ToolRule {
12552
12671
  frontmatter;
@@ -12749,11 +12868,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
12749
12868
 
12750
12869
  // src/features/rules/cursor-rule.ts
12751
12870
  import { join as join96 } from "path";
12752
- import { z as z48 } from "zod/mini";
12753
- var CursorRuleFrontmatterSchema = z48.object({
12754
- description: z48.optional(z48.string()),
12755
- globs: z48.optional(z48.string()),
12756
- alwaysApply: z48.optional(z48.boolean())
12871
+ import { z as z49 } from "zod/mini";
12872
+ var CursorRuleFrontmatterSchema = z49.object({
12873
+ description: z49.optional(z49.string()),
12874
+ globs: z49.optional(z49.string()),
12875
+ alwaysApply: z49.optional(z49.boolean())
12757
12876
  });
12758
12877
  var CursorRule = class _CursorRule extends ToolRule {
12759
12878
  frontmatter;
@@ -13172,8 +13291,117 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13172
13291
  }
13173
13292
  };
13174
13293
 
13175
- // src/features/rules/junie-rule.ts
13294
+ // src/features/rules/goose-rule.ts
13176
13295
  import { join as join99 } from "path";
13296
+ var GooseRule = class _GooseRule extends ToolRule {
13297
+ static getSettablePaths({
13298
+ global,
13299
+ excludeToolDir
13300
+ } = {}) {
13301
+ if (global) {
13302
+ return {
13303
+ root: {
13304
+ relativeDirPath: ".",
13305
+ relativeFilePath: ".goosehints"
13306
+ }
13307
+ };
13308
+ }
13309
+ return {
13310
+ root: {
13311
+ relativeDirPath: ".",
13312
+ relativeFilePath: ".goosehints"
13313
+ },
13314
+ nonRoot: {
13315
+ relativeDirPath: buildToolPath(".goose", "memories", excludeToolDir)
13316
+ }
13317
+ };
13318
+ }
13319
+ static async fromFile({
13320
+ baseDir = process.cwd(),
13321
+ relativeFilePath,
13322
+ validate = true,
13323
+ global = false
13324
+ }) {
13325
+ const paths = this.getSettablePaths({ global });
13326
+ const isRoot = relativeFilePath === paths.root.relativeFilePath;
13327
+ if (isRoot) {
13328
+ const relativePath2 = paths.root.relativeFilePath;
13329
+ const fileContent2 = await readFileContent(
13330
+ join99(baseDir, paths.root.relativeDirPath, relativePath2)
13331
+ );
13332
+ return new _GooseRule({
13333
+ baseDir,
13334
+ relativeDirPath: paths.root.relativeDirPath,
13335
+ relativeFilePath: paths.root.relativeFilePath,
13336
+ fileContent: fileContent2,
13337
+ validate,
13338
+ root: true
13339
+ });
13340
+ }
13341
+ if (!paths.nonRoot) {
13342
+ throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13343
+ }
13344
+ const relativePath = join99(paths.nonRoot.relativeDirPath, relativeFilePath);
13345
+ const fileContent = await readFileContent(join99(baseDir, relativePath));
13346
+ return new _GooseRule({
13347
+ baseDir,
13348
+ relativeDirPath: paths.nonRoot.relativeDirPath,
13349
+ relativeFilePath,
13350
+ fileContent,
13351
+ validate,
13352
+ root: false
13353
+ });
13354
+ }
13355
+ static fromRulesyncRule({
13356
+ baseDir = process.cwd(),
13357
+ rulesyncRule,
13358
+ validate = true,
13359
+ global = false
13360
+ }) {
13361
+ const paths = this.getSettablePaths({ global });
13362
+ return new _GooseRule(
13363
+ this.buildToolRuleParamsDefault({
13364
+ baseDir,
13365
+ rulesyncRule,
13366
+ validate,
13367
+ rootPath: paths.root,
13368
+ nonRootPath: paths.nonRoot
13369
+ })
13370
+ );
13371
+ }
13372
+ toRulesyncRule() {
13373
+ return this.toRulesyncRuleDefault();
13374
+ }
13375
+ validate() {
13376
+ return { success: true, error: null };
13377
+ }
13378
+ static forDeletion({
13379
+ baseDir = process.cwd(),
13380
+ relativeDirPath,
13381
+ relativeFilePath,
13382
+ global = false
13383
+ }) {
13384
+ const paths = this.getSettablePaths({ global });
13385
+ const isRoot = relativeFilePath === paths.root.relativeFilePath;
13386
+ return new _GooseRule({
13387
+ baseDir,
13388
+ relativeDirPath,
13389
+ relativeFilePath,
13390
+ fileContent: "",
13391
+ validate: false,
13392
+ root: isRoot
13393
+ });
13394
+ }
13395
+ static isTargetedByRulesyncRule(rulesyncRule) {
13396
+ return this.isTargetedByRulesyncRuleDefault({
13397
+ rulesyncRule,
13398
+ toolTarget: "goose"
13399
+ });
13400
+ }
13401
+ };
13402
+
13403
+ // src/features/rules/junie-rule.ts
13404
+ import { join as join100 } from "path";
13177
13405
  var JunieRule = class _JunieRule extends ToolRule {
13178
13406
  static getSettablePaths(_options = {}) {
13179
13407
  return {
@@ -13192,8 +13420,8 @@ var JunieRule = class _JunieRule extends ToolRule {
13192
13420
  validate = true
13193
13421
  }) {
13194
13422
  const isRoot = relativeFilePath === "guidelines.md";
13195
- const relativePath = isRoot ? "guidelines.md" : join99(".junie", "memories", relativeFilePath);
13196
- const fileContent = await readFileContent(join99(baseDir, relativePath));
13423
+ const relativePath = isRoot ? "guidelines.md" : join100(".junie", "memories", relativeFilePath);
13424
+ const fileContent = await readFileContent(join100(baseDir, relativePath));
13197
13425
  return new _JunieRule({
13198
13426
  baseDir,
13199
13427
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -13248,7 +13476,7 @@ var JunieRule = class _JunieRule extends ToolRule {
13248
13476
  };
13249
13477
 
13250
13478
  // src/features/rules/kilo-rule.ts
13251
- import { join as join100 } from "path";
13479
+ import { join as join101 } from "path";
13252
13480
  var KiloRule = class _KiloRule extends ToolRule {
13253
13481
  static getSettablePaths(_options = {}) {
13254
13482
  return {
@@ -13263,7 +13491,7 @@ var KiloRule = class _KiloRule extends ToolRule {
13263
13491
  validate = true
13264
13492
  }) {
13265
13493
  const fileContent = await readFileContent(
13266
- join100(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13494
+ join101(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13267
13495
  );
13268
13496
  return new _KiloRule({
13269
13497
  baseDir,
@@ -13315,7 +13543,7 @@ var KiloRule = class _KiloRule extends ToolRule {
13315
13543
  };
13316
13544
 
13317
13545
  // src/features/rules/kiro-rule.ts
13318
- import { join as join101 } from "path";
13546
+ import { join as join102 } from "path";
13319
13547
  var KiroRule = class _KiroRule extends ToolRule {
13320
13548
  static getSettablePaths(_options = {}) {
13321
13549
  return {
@@ -13330,7 +13558,7 @@ var KiroRule = class _KiroRule extends ToolRule {
13330
13558
  validate = true
13331
13559
  }) {
13332
13560
  const fileContent = await readFileContent(
13333
- join101(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13561
+ join102(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13334
13562
  );
13335
13563
  return new _KiroRule({
13336
13564
  baseDir,
@@ -13384,7 +13612,7 @@ var KiroRule = class _KiroRule extends ToolRule {
13384
13612
  };
13385
13613
 
13386
13614
  // src/features/rules/opencode-rule.ts
13387
- import { join as join102 } from "path";
13615
+ import { join as join103 } from "path";
13388
13616
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13389
13617
  static getSettablePaths({
13390
13618
  global,
@@ -13419,7 +13647,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13419
13647
  if (isRoot) {
13420
13648
  const relativePath2 = paths.root.relativeFilePath;
13421
13649
  const fileContent2 = await readFileContent(
13422
- join102(baseDir, paths.root.relativeDirPath, relativePath2)
13650
+ join103(baseDir, paths.root.relativeDirPath, relativePath2)
13423
13651
  );
13424
13652
  return new _OpenCodeRule({
13425
13653
  baseDir,
@@ -13433,8 +13661,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13433
13661
  if (!paths.nonRoot) {
13434
13662
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13435
13663
  }
13436
- const relativePath = join102(paths.nonRoot.relativeDirPath, relativeFilePath);
13437
- const fileContent = await readFileContent(join102(baseDir, relativePath));
13664
+ const relativePath = join103(paths.nonRoot.relativeDirPath, relativeFilePath);
13665
+ const fileContent = await readFileContent(join103(baseDir, relativePath));
13438
13666
  return new _OpenCodeRule({
13439
13667
  baseDir,
13440
13668
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13493,7 +13721,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13493
13721
  };
13494
13722
 
13495
13723
  // src/features/rules/qwencode-rule.ts
13496
- import { join as join103 } from "path";
13724
+ import { join as join104 } from "path";
13497
13725
  var QwencodeRule = class _QwencodeRule extends ToolRule {
13498
13726
  static getSettablePaths(_options = {}) {
13499
13727
  return {
@@ -13512,8 +13740,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
13512
13740
  validate = true
13513
13741
  }) {
13514
13742
  const isRoot = relativeFilePath === "QWEN.md";
13515
- const relativePath = isRoot ? "QWEN.md" : join103(".qwen", "memories", relativeFilePath);
13516
- const fileContent = await readFileContent(join103(baseDir, relativePath));
13743
+ const relativePath = isRoot ? "QWEN.md" : join104(".qwen", "memories", relativeFilePath);
13744
+ const fileContent = await readFileContent(join104(baseDir, relativePath));
13517
13745
  return new _QwencodeRule({
13518
13746
  baseDir,
13519
13747
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -13565,7 +13793,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
13565
13793
  };
13566
13794
 
13567
13795
  // src/features/rules/replit-rule.ts
13568
- import { join as join104 } from "path";
13796
+ import { join as join105 } from "path";
13569
13797
  var ReplitRule = class _ReplitRule extends ToolRule {
13570
13798
  static getSettablePaths(_options = {}) {
13571
13799
  return {
@@ -13587,7 +13815,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
13587
13815
  }
13588
13816
  const relativePath = paths.root.relativeFilePath;
13589
13817
  const fileContent = await readFileContent(
13590
- join104(baseDir, paths.root.relativeDirPath, relativePath)
13818
+ join105(baseDir, paths.root.relativeDirPath, relativePath)
13591
13819
  );
13592
13820
  return new _ReplitRule({
13593
13821
  baseDir,
@@ -13653,7 +13881,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
13653
13881
  };
13654
13882
 
13655
13883
  // src/features/rules/roo-rule.ts
13656
- import { join as join105 } from "path";
13884
+ import { join as join106 } from "path";
13657
13885
  var RooRule = class _RooRule extends ToolRule {
13658
13886
  static getSettablePaths(_options = {}) {
13659
13887
  return {
@@ -13668,7 +13896,7 @@ var RooRule = class _RooRule extends ToolRule {
13668
13896
  validate = true
13669
13897
  }) {
13670
13898
  const fileContent = await readFileContent(
13671
- join105(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13899
+ join106(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13672
13900
  );
13673
13901
  return new _RooRule({
13674
13902
  baseDir,
@@ -13737,7 +13965,7 @@ var RooRule = class _RooRule extends ToolRule {
13737
13965
  };
13738
13966
 
13739
13967
  // src/features/rules/warp-rule.ts
13740
- import { join as join106 } from "path";
13968
+ import { join as join107 } from "path";
13741
13969
  var WarpRule = class _WarpRule extends ToolRule {
13742
13970
  constructor({ fileContent, root, ...rest }) {
13743
13971
  super({
@@ -13763,8 +13991,8 @@ var WarpRule = class _WarpRule extends ToolRule {
13763
13991
  validate = true
13764
13992
  }) {
13765
13993
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
13766
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join106(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
13767
- const fileContent = await readFileContent(join106(baseDir, relativePath));
13994
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join107(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
13995
+ const fileContent = await readFileContent(join107(baseDir, relativePath));
13768
13996
  return new _WarpRule({
13769
13997
  baseDir,
13770
13998
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -13819,7 +14047,7 @@ var WarpRule = class _WarpRule extends ToolRule {
13819
14047
  };
13820
14048
 
13821
14049
  // src/features/rules/windsurf-rule.ts
13822
- import { join as join107 } from "path";
14050
+ import { join as join108 } from "path";
13823
14051
  var WindsurfRule = class _WindsurfRule extends ToolRule {
13824
14052
  static getSettablePaths(_options = {}) {
13825
14053
  return {
@@ -13834,7 +14062,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
13834
14062
  validate = true
13835
14063
  }) {
13836
14064
  const fileContent = await readFileContent(
13837
- join107(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14065
+ join108(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13838
14066
  );
13839
14067
  return new _WindsurfRule({
13840
14068
  baseDir,
@@ -13899,6 +14127,7 @@ var rulesProcessorToolTargets = [
13899
14127
  "cursor",
13900
14128
  "factorydroid",
13901
14129
  "geminicli",
14130
+ "goose",
13902
14131
  "junie",
13903
14132
  "kilo",
13904
14133
  "kiro",
@@ -13909,8 +14138,8 @@ var rulesProcessorToolTargets = [
13909
14138
  "warp",
13910
14139
  "windsurf"
13911
14140
  ];
13912
- var RulesProcessorToolTargetSchema = z49.enum(rulesProcessorToolTargets);
13913
- var formatRulePaths = (rules) => rules.map((r) => join108(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
14141
+ var RulesProcessorToolTargetSchema = z50.enum(rulesProcessorToolTargets);
14142
+ var formatRulePaths = (rules) => rules.map((r) => join109(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
13914
14143
  var toolRuleFactories = /* @__PURE__ */ new Map([
13915
14144
  [
13916
14145
  "agentsmd",
@@ -14001,10 +14230,7 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
14001
14230
  meta: {
14002
14231
  extension: "md",
14003
14232
  supportsGlobal: true,
14004
- ruleDiscoveryMode: "toon",
14005
- additionalConventions: {
14006
- subagents: { subagentClass: CodexCliSubagent }
14007
- }
14233
+ ruleDiscoveryMode: "toon"
14008
14234
  }
14009
14235
  }
14010
14236
  ],
@@ -14060,6 +14286,17 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
14060
14286
  }
14061
14287
  }
14062
14288
  ],
14289
+ [
14290
+ "goose",
14291
+ {
14292
+ class: GooseRule,
14293
+ meta: {
14294
+ extension: "md",
14295
+ supportsGlobal: true,
14296
+ ruleDiscoveryMode: "toon"
14297
+ }
14298
+ }
14299
+ ],
14063
14300
  [
14064
14301
  "junie",
14065
14302
  {
@@ -14277,7 +14514,7 @@ var RulesProcessor = class extends FeatureProcessor {
14277
14514
  }).relativeDirPath;
14278
14515
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
14279
14516
  const frontmatter = skill.getFrontmatter();
14280
- const relativePath = join108(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
14517
+ const relativePath = join109(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
14281
14518
  return {
14282
14519
  name: frontmatter.name,
14283
14520
  description: frontmatter.description,
@@ -14390,8 +14627,8 @@ var RulesProcessor = class extends FeatureProcessor {
14390
14627
  * Load and parse rulesync rule files from .rulesync/rules/ directory
14391
14628
  */
14392
14629
  async loadRulesyncFiles() {
14393
- const rulesyncBaseDir = join108(this.baseDir, RULESYNC_RULES_RELATIVE_DIR_PATH);
14394
- const files = await findFilesByGlobs(join108(rulesyncBaseDir, "**", "*.md"));
14630
+ const rulesyncBaseDir = join109(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
14631
+ const files = await findFilesByGlobs(join109(rulesyncBaseDir, "**", "*.md"));
14395
14632
  logger.debug(`Found ${files.length} rulesync files`);
14396
14633
  const rulesyncRules = await Promise.all(
14397
14634
  files.map((file) => {
@@ -14458,7 +14695,7 @@ var RulesProcessor = class extends FeatureProcessor {
14458
14695
  return [];
14459
14696
  }
14460
14697
  const rootFilePaths = await findFilesByGlobs(
14461
- join108(
14698
+ join109(
14462
14699
  this.baseDir,
14463
14700
  settablePaths.root.relativeDirPath ?? ".",
14464
14701
  settablePaths.root.relativeFilePath
@@ -14496,7 +14733,7 @@ var RulesProcessor = class extends FeatureProcessor {
14496
14733
  return [];
14497
14734
  }
14498
14735
  const localRootFilePaths = await findFilesByGlobs(
14499
- join108(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
14736
+ join109(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
14500
14737
  );
14501
14738
  return localRootFilePaths.map(
14502
14739
  (filePath) => factory.class.forDeletion({
@@ -14512,9 +14749,9 @@ var RulesProcessor = class extends FeatureProcessor {
14512
14749
  if (!settablePaths.nonRoot) {
14513
14750
  return [];
14514
14751
  }
14515
- const nonRootBaseDir = join108(this.baseDir, settablePaths.nonRoot.relativeDirPath);
14752
+ const nonRootBaseDir = join109(this.baseDir, settablePaths.nonRoot.relativeDirPath);
14516
14753
  const nonRootFilePaths = await findFilesByGlobs(
14517
- join108(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
14754
+ join109(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
14518
14755
  );
14519
14756
  if (forDeletion) {
14520
14757
  return nonRootFilePaths.map((filePath) => {
@@ -14646,14 +14883,14 @@ s/<command> [arguments]
14646
14883
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
14647
14884
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
14648
14885
 
14649
- When users call a custom slash command, you have to look for the markdown file, \`${join108(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
14886
+ When users call a custom slash command, you have to look for the markdown file, \`${join109(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
14650
14887
  const subagentsSection = subagents ? `## Simulated Subagents
14651
14888
 
14652
14889
  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.
14653
14890
 
14654
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${join108(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
14891
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${join109(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
14655
14892
 
14656
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join108(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
14893
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join109(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
14657
14894
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
14658
14895
  const result = [
14659
14896
  overview,
@@ -14725,7 +14962,7 @@ async function processEmptyFeatureGeneration(params) {
14725
14962
  return { count: totalCount, paths: [], hasDiff };
14726
14963
  }
14727
14964
  async function checkRulesyncDirExists(params) {
14728
- return fileExists(join109(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
14965
+ return fileExists(join110(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
14729
14966
  }
14730
14967
  async function generate(params) {
14731
14968
  const { config } = params;