rulesync 8.30.0 → 8.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -4,28 +4,29 @@ import {
4
4
  ALL_FEATURES_WITH_WILDCARD,
5
5
  ALL_TOOL_TARGETS,
6
6
  ALL_TOOL_TARGETS_WITH_WILDCARD,
7
- CLAUDECODE_AGENTS_DIR_PATH,
8
- CLAUDECODE_COMMANDS_DIR_PATH,
9
7
  CLAUDECODE_DIR,
10
8
  CLAUDECODE_LOCAL_RULE_FILE_NAME,
11
- CLAUDECODE_MCP_FILE_NAME,
12
9
  CLAUDECODE_MEMORIES_DIR_NAME,
13
- CLAUDECODE_RULES_DIR_NAME,
14
- CLAUDECODE_RULE_FILE_NAME,
15
10
  CLAUDECODE_SETTINGS_LOCAL_FILE_NAME,
16
11
  CLAUDECODE_SKILLS_DIR_PATH,
17
12
  CLIError,
18
13
  CommandsProcessor,
14
+ CommandsProcessorToolTargetSchema,
19
15
  ConfigResolver,
20
16
  ConsoleLogger,
21
17
  ErrorCodes,
22
18
  FETCH_CONCURRENCY_LIMIT,
23
19
  GITIGNORE_DESTINATION_KEY,
24
20
  HooksProcessor,
21
+ HooksProcessorToolTargetSchema,
25
22
  IgnoreProcessor,
23
+ IgnoreProcessorToolTargetSchema,
26
24
  JsonLogger,
27
25
  MAX_FILE_SIZE,
28
26
  McpProcessor,
27
+ McpProcessorToolTargetSchema,
28
+ PermissionsProcessor,
29
+ PermissionsProcessorToolTargetSchema,
29
30
  RULESYNC_AIIGNORE_FILE_NAME,
30
31
  RULESYNC_AIIGNORE_RELATIVE_FILE_PATH,
31
32
  RULESYNC_COMMANDS_RELATIVE_DIR_PATH,
@@ -48,6 +49,7 @@ import {
48
49
  RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH,
49
50
  RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
50
51
  RulesProcessor,
52
+ RulesProcessorToolTargetSchema,
51
53
  RulesyncCommand,
52
54
  RulesyncCommandFrontmatterSchema,
53
55
  RulesyncHooks,
@@ -62,7 +64,9 @@ import {
62
64
  RulesyncSubagentFrontmatterSchema,
63
65
  SKILL_FILE_NAME,
64
66
  SkillsProcessor,
67
+ SkillsProcessorToolTargetSchema,
65
68
  SubagentsProcessor,
69
+ SubagentsProcessorToolTargetSchema,
66
70
  ToolTargetSchema,
67
71
  checkPathTraversal,
68
72
  checkRulesyncDirExists,
@@ -88,8 +92,16 @@ import {
88
92
  removeTempDirectory,
89
93
  stringifyFrontmatter,
90
94
  toPosixPath,
95
+ toolCommandFactories,
96
+ toolHooksFactories,
97
+ toolIgnoreFactories,
98
+ toolMcpFactories,
99
+ toolPermissionsFactories,
100
+ toolRuleFactories,
101
+ toolSkillFactories,
102
+ toolSubagentFactories,
91
103
  writeFileContent
92
- } from "../chunk-BD7XWNHZ.js";
104
+ } from "../chunk-NAO27T2K.js";
93
105
 
94
106
  // src/cli/index.ts
95
107
  import { Command } from "commander";
@@ -1263,371 +1275,230 @@ async function generateCommand(logger5, options) {
1263
1275
  // src/cli/commands/gitignore.ts
1264
1276
  import { join as join2 } from "path";
1265
1277
 
1266
- // src/cli/commands/gitignore-entries.ts
1267
- var normalizeGitignoreEntryTargets = (target) => {
1268
- return typeof target === "string" ? [target] : target;
1269
- };
1270
- var GITIGNORE_ENTRY_REGISTRY = [
1271
- // Common / general
1272
- {
1273
- target: "common",
1274
- feature: "general",
1275
- entry: `${RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH}/`
1276
- },
1277
- { target: "common", feature: "general", entry: ".rulesync/rules/*.local.md" },
1278
- { target: "common", feature: "general", entry: "rulesync.local.jsonc" },
1279
- // AGENTS.local.md is placed in common scope (not rovodev-only) so that
1280
- // local rule files are always gitignored regardless of which targets are enabled.
1281
- // This prevents accidental commits when a user disables the rovodev target.
1282
- { target: "common", feature: "general", entry: "**/AGENTS.local.md" },
1283
- // AGENTS.md
1284
- {
1285
- target: ["agentsmd", "amp", "antigravity-cli", "antigravity-ide", "pi", "vibe", "warp"],
1286
- feature: "rules",
1287
- entry: "**/AGENTS.md"
1288
- },
1289
- { target: "agentsmd", feature: "rules", entry: "**/.agents/" },
1290
- // Amp
1291
- // Amp reads project rules from a root `AGENTS.md` (handled by the shared
1292
- // AGENTS.md entry above) plus `.agents/memories/*.md` non-root rules. Agent
1293
- // Skills come from the shared `.agents/skills/` project tree. The
1294
- // `.amp/settings.json` permissions file is a user-managed file (like other
1295
- // tools' settings.json), so it is intentionally not gitignored.
1296
- { target: "amp", feature: "rules", entry: "**/.agents/memories/" },
1297
- { target: "amp", feature: "skills", entry: "**/.agents/skills/" },
1298
- // Antigravity (IDE + CLI, Antigravity 2.0)
1299
- // Both targets share the `.agents/` project tree and both write a root
1300
- // `AGENTS.md` (handled by the shared AGENTS.md entry above). Global-scope
1301
- // paths (under the home directory, e.g. `~/.gemini/GEMINI.md`) are
1302
- // intentionally not gitignored.
1278
+ // src/types/processor-registry.ts
1279
+ var PROCESSOR_REGISTRY = [
1303
1280
  {
1304
- target: ["antigravity-ide", "antigravity-cli"],
1305
1281
  feature: "rules",
1306
- entry: "**/.agents/rules/"
1307
- },
1308
- { target: "antigravity-cli", feature: "ignore", entry: "**/.geminiignore" },
1309
- {
1310
- target: "antigravity-ide",
1311
- feature: "commands",
1312
- entry: "**/.agents/workflows/"
1282
+ processor: RulesProcessor,
1283
+ schema: RulesProcessorToolTargetSchema,
1284
+ factory: toolRuleFactories
1313
1285
  },
1314
1286
  {
1315
- target: ["antigravity-ide", "antigravity-cli"],
1316
- feature: "skills",
1317
- entry: "**/.agents/skills/"
1287
+ feature: "ignore",
1288
+ processor: IgnoreProcessor,
1289
+ schema: IgnoreProcessorToolTargetSchema,
1290
+ factory: toolIgnoreFactories
1318
1291
  },
1319
1292
  {
1320
- target: ["antigravity-ide", "antigravity-cli"],
1321
1293
  feature: "mcp",
1322
- entry: "**/.agents/mcp_config.json"
1323
- },
1324
- {
1325
- target: ["antigravity-ide", "antigravity-cli"],
1326
- feature: "hooks",
1327
- entry: "**/.agents/hooks.json"
1328
- },
1329
- // Augment Code
1330
- { target: "augmentcode", feature: "rules", entry: "**/.augment/rules/" },
1331
- { target: "augmentcode", feature: "rules", entry: "**/.augment-guidelines" },
1332
- { target: "augmentcode", feature: "commands", entry: "**/.augment/commands/" },
1333
- { target: "augmentcode", feature: "subagents", entry: "**/.augment/agents/" },
1334
- { target: "augmentcode", feature: "skills", entry: "**/.augment/skills/" },
1335
- { target: "augmentcode", feature: "ignore", entry: "**/.augmentignore" },
1336
- { target: "augmentcode", feature: "permissions", entry: "**/.augment/settings.json" },
1337
- { target: "augmentcode", feature: "hooks", entry: "**/.augment/settings.json" },
1338
- // settings.json is shared with permissions/hooks; re-tag it under `mcp` so
1339
- // target+feature filtering still resolves the file for MCP runs.
1340
- { target: "augmentcode", feature: "mcp", entry: "**/.augment/settings.json" },
1341
- // Claude Code
1342
- { target: "claudecode", feature: "rules", entry: `**/${CLAUDECODE_RULE_FILE_NAME}` },
1343
- { target: "claudecode", feature: "rules", entry: `**/${CLAUDECODE_LOCAL_RULE_FILE_NAME}` },
1344
- {
1345
- target: "claudecode",
1346
- feature: "rules",
1347
- entry: `**/${CLAUDECODE_DIR}/${CLAUDECODE_RULE_FILE_NAME}`
1294
+ processor: McpProcessor,
1295
+ schema: McpProcessorToolTargetSchema,
1296
+ factory: toolMcpFactories
1348
1297
  },
1349
1298
  {
1350
- target: "claudecode",
1351
- feature: "rules",
1352
- entry: `**/${CLAUDECODE_DIR}/${CLAUDECODE_LOCAL_RULE_FILE_NAME}`
1353
- },
1354
- {
1355
- target: "claudecode",
1356
- feature: "rules",
1357
- entry: `**/${CLAUDECODE_DIR}/${CLAUDECODE_RULES_DIR_NAME}/`
1358
- },
1359
- {
1360
- target: "claudecode",
1361
1299
  feature: "commands",
1362
- entry: `**/${toPosixPath(CLAUDECODE_COMMANDS_DIR_PATH)}/`
1300
+ processor: CommandsProcessor,
1301
+ schema: CommandsProcessorToolTargetSchema,
1302
+ factory: toolCommandFactories
1363
1303
  },
1364
1304
  {
1365
- target: "claudecode",
1366
1305
  feature: "subagents",
1367
- entry: `**/${toPosixPath(CLAUDECODE_AGENTS_DIR_PATH)}/`
1306
+ processor: SubagentsProcessor,
1307
+ schema: SubagentsProcessorToolTargetSchema,
1308
+ factory: toolSubagentFactories
1368
1309
  },
1369
1310
  {
1370
- target: "claudecode",
1371
1311
  feature: "skills",
1372
- entry: `**/${toPosixPath(CLAUDECODE_SKILLS_DIR_PATH)}/`
1373
- },
1374
- { target: "claudecode", feature: "mcp", entry: `**/${CLAUDECODE_MCP_FILE_NAME}` },
1375
- {
1376
- target: "claudecode",
1377
- feature: "general",
1378
- entry: `**/${CLAUDECODE_DIR}/${CLAUDECODE_MEMORIES_DIR_NAME}/`
1312
+ processor: SkillsProcessor,
1313
+ schema: SkillsProcessorToolTargetSchema,
1314
+ factory: toolSkillFactories
1379
1315
  },
1380
1316
  {
1381
- target: "claudecode",
1382
- feature: "general",
1383
- entry: `**/${CLAUDECODE_DIR}/${CLAUDECODE_SETTINGS_LOCAL_FILE_NAME}`
1384
- },
1385
- { target: "claudecode", feature: "general", entry: `**/${CLAUDECODE_DIR}/*.lock` },
1386
- // Cline
1387
- { target: "cline", feature: "rules", entry: "**/.clinerules/" },
1388
- { target: "cline", feature: "commands", entry: "**/.clinerules/workflows/" },
1389
- { target: "cline", feature: "ignore", entry: "**/.clineignore" },
1390
- // Cline reads MCP only from a global settings file
1391
- // (`~/.cline/data/settings/cline_mcp_settings.json`), which lives under the
1392
- // home directory and is not gitignored at the project level.
1393
- { target: "cline", feature: "subagents", entry: "**/.cline/agents/" },
1394
- { target: "cline", feature: "permissions", entry: "**/.cline/command-permissions.json" },
1395
- // Codex CLI
1396
- { target: "codexcli", feature: "ignore", entry: "**/.codexignore" },
1397
- { target: "codexcli", feature: "skills", entry: "**/.agents/skills/" },
1398
- { target: "codexcli", feature: "subagents", entry: "**/.codex/agents/" },
1399
- { target: "codexcli", feature: "general", entry: "**/.codex/memories/" },
1400
- { target: "codexcli", feature: "general", entry: "**/.codex/config.toml" },
1401
- { target: "codexcli", feature: "hooks", entry: "**/.codex/hooks.json" },
1402
- // Cursor
1403
- { target: "cursor", feature: "rules", entry: "**/.cursor/" },
1404
- { target: "cursor", feature: "ignore", entry: "**/.cursorignore" },
1405
- // .cursor/cli.json (project) and .cursor/cli-config.json (global) are
1406
- // already covered by the broader **/.cursor/ entry above; the additional
1407
- // `permissions` and `hooks` tags below register the same prefix under the
1408
- // matching feature so target+feature filtering still resolves correctly.
1409
- { target: "cursor", feature: "permissions", entry: "**/.cursor/" },
1410
- { target: "cursor", feature: "hooks", entry: "**/.cursor/" },
1411
- // deepagents-cli
1412
- // All rule content is folded into the single `.deepagents/AGENTS.md`; there is
1413
- // no `.deepagents/memories/` directory.
1414
- { target: "deepagents", feature: "rules", entry: "**/.deepagents/AGENTS.md" },
1415
- { target: "deepagents", feature: "mcp", entry: "**/.deepagents/.mcp.json" },
1416
- { target: "deepagents", feature: "skills", entry: "**/.deepagents/skills/" },
1417
- {
1418
- target: "deepagents",
1419
- feature: "subagents",
1420
- entry: "**/.deepagents/agents/"
1421
- },
1422
- {
1423
- target: "deepagents",
1424
1317
  feature: "hooks",
1425
- entry: "**/.deepagents/hooks.json"
1426
- },
1427
- // Factory Droid
1428
- { target: "factorydroid", feature: "rules", entry: "**/.factory/rules/" },
1429
- {
1430
- target: "factorydroid",
1431
- feature: "commands",
1432
- entry: "**/.factory/commands/"
1433
- },
1434
- {
1435
- target: "factorydroid",
1436
- feature: "subagents",
1437
- entry: "**/.factory/droids/"
1318
+ processor: HooksProcessor,
1319
+ schema: HooksProcessorToolTargetSchema,
1320
+ factory: toolHooksFactories
1438
1321
  },
1439
- { target: "factorydroid", feature: "skills", entry: "**/.factory/skills/" },
1440
- { target: "factorydroid", feature: "mcp", entry: "**/.factory/mcp.json" },
1441
1322
  {
1442
- target: "factorydroid",
1443
- feature: "hooks",
1444
- entry: "**/.factory/hooks.json"
1445
- },
1446
- // Gemini CLI
1447
- { target: "geminicli", feature: "rules", entry: "**/GEMINI.md" },
1448
- { target: "geminicli", feature: "commands", entry: "**/.gemini/commands/" },
1449
- { target: "geminicli", feature: "subagents", entry: "**/.gemini/agents/" },
1450
- { target: "geminicli", feature: "skills", entry: "**/.gemini/skills/" },
1451
- { target: "geminicli", feature: "ignore", entry: "**/.geminiignore" },
1452
- { target: "geminicli", feature: "general", entry: "**/.gemini/memories/" },
1453
- // Goose
1454
- { target: "goose", feature: "rules", entry: "**/.goosehints" },
1455
- { target: "goose", feature: "rules", entry: "**/.goose/" },
1456
- { target: "goose", feature: "ignore", entry: "**/.gooseignore" },
1457
- // Goose recipes: commands map to top-level recipes (`.goose/recipes/*.yaml`)
1458
- // and subagents to sub-recipes (`.goose/recipes/subagents/*.yaml`). These are
1459
- // already covered by the broad `**/.goose/` rules entry above, but tagging
1460
- // them per-feature keeps coverage correct under feature-filtered gitignore.
1461
- { target: "goose", feature: "commands", entry: "**/.goose/recipes/" },
1462
- { target: "goose", feature: "subagents", entry: "**/.goose/recipes/subagents/" },
1463
- // Goose lifecycle hooks plugin (.agents/plugins/<name>/hooks/hooks.json)
1464
- { target: "goose", feature: "hooks", entry: "**/.agents/plugins/" },
1465
- // Goose reads MCP "extensions" only from the global user config
1466
- // (`~/.config/goose/config.yaml`), which lives under the home directory and is
1467
- // not gitignored at the project level (mirrors Cline's global-only MCP).
1468
- // Grok Build
1469
- { target: "grokcli", feature: "general", entry: "**/.grok/config.toml" },
1470
- // GitHub Copilot
1323
+ feature: "permissions",
1324
+ processor: PermissionsProcessor,
1325
+ schema: PermissionsProcessorToolTargetSchema,
1326
+ factory: toolPermissionsFactories
1327
+ }
1328
+ ];
1329
+ var getProcessorRegistryEntry = (feature) => {
1330
+ const entry = PROCESSOR_REGISTRY.find((e) => e.feature === feature);
1331
+ if (!entry) {
1332
+ throw new Error(`No processor registered for feature: ${feature}`);
1333
+ }
1334
+ return entry;
1335
+ };
1336
+
1337
+ // src/cli/commands/gitignore-derive.ts
1338
+ var TARGETS_NOT_DERIVED = /* @__PURE__ */ new Set([
1339
+ "agentsskills",
1340
+ "antigravity",
1341
+ "augmentcode-legacy",
1342
+ "claudecode-legacy"
1343
+ ]);
1344
+ var DERIVED_PATHS_NOT_GITIGNORED = /* @__PURE__ */ new Set([
1345
+ "**/.amp/settings.json",
1346
+ "**/.amp/settings.jsonc",
1347
+ "**/.antigravity/settings.json",
1348
+ "**/.claude/settings.json",
1349
+ "**/.claude/settings.local.json",
1350
+ "**/.factory/settings.json",
1351
+ "**/.gemini/settings.json",
1352
+ "**/.zed/settings.json",
1353
+ "**/.warp/settings.toml",
1354
+ "**/kilo.json",
1355
+ "**/kilo.jsonc",
1356
+ "**/opencode.json"
1357
+ ]);
1358
+ var toPosix = (path2) => path2.replace(/\\/g, "/");
1359
+ var dirToGlob = (relativeDirPath) => `**/${toPosix(relativeDirPath).replace(/\/$/, "")}/`;
1360
+ var fileToGlob = (relativeDirPath, relativeFilePath) => {
1361
+ const hasDir = relativeDirPath && relativeDirPath !== ".";
1362
+ return `**/${toPosix(hasDir ? `${relativeDirPath}/${relativeFilePath}` : relativeFilePath)}`;
1363
+ };
1364
+ var supportsProject = (factory) => {
1365
+ if (typeof factory !== "object" || factory === null || !("meta" in factory)) return true;
1366
+ const meta = factory.meta;
1367
+ return meta?.supportsProject !== false;
1368
+ };
1369
+ var getProjectPaths = (factory) => factory.class.getSettablePaths({ global: false });
1370
+ var pushEntry = (entries, target, feature, entry) => {
1371
+ if (DERIVED_PATHS_NOT_GITIGNORED.has(entry)) return;
1372
+ entries.push({ target, feature, entry });
1373
+ };
1374
+ var deriveDirEntries = (factories, feature) => {
1375
+ const entries = [];
1376
+ for (const [target, factory] of factories) {
1377
+ if (TARGETS_NOT_DERIVED.has(target)) continue;
1378
+ if (!supportsProject(factory)) continue;
1379
+ const paths = getProjectPaths(factory);
1380
+ const dir = paths.relativeDirPath;
1381
+ if (!dir || dir === ".") continue;
1382
+ pushEntry(entries, target, feature, dirToGlob(dir));
1383
+ }
1384
+ return entries;
1385
+ };
1386
+ var deriveFileEntries = (factories, feature) => {
1387
+ const entries = [];
1388
+ for (const [target, factory] of factories) {
1389
+ if (TARGETS_NOT_DERIVED.has(target)) continue;
1390
+ if (!supportsProject(factory)) continue;
1391
+ const paths = getProjectPaths(factory);
1392
+ if (!paths.relativeFilePath) continue;
1393
+ pushEntry(entries, target, feature, fileToGlob(paths.relativeDirPath, paths.relativeFilePath));
1394
+ }
1395
+ return entries;
1396
+ };
1397
+ var deriveRulesEntries = () => {
1398
+ const entries = [];
1399
+ const factories = getProcessorRegistryEntry("rules").factory;
1400
+ for (const [target, factory] of factories) {
1401
+ if (TARGETS_NOT_DERIVED.has(target)) continue;
1402
+ const paths = getProjectPaths(factory);
1403
+ for (const root of [paths.root, ...paths.alternativeRoots ?? []]) {
1404
+ if (root)
1405
+ pushEntry(
1406
+ entries,
1407
+ target,
1408
+ "rules",
1409
+ fileToGlob(root.relativeDirPath, root.relativeFilePath)
1410
+ );
1411
+ }
1412
+ const nonRootDir = paths.nonRoot?.relativeDirPath;
1413
+ if (nonRootDir && nonRootDir !== ".") {
1414
+ pushEntry(entries, target, "rules", dirToGlob(nonRootDir));
1415
+ }
1416
+ }
1417
+ return entries;
1418
+ };
1419
+ var DIR_FEATURES = /* @__PURE__ */ new Set(["commands", "skills", "subagents"]);
1420
+ var FILE_FEATURES = /* @__PURE__ */ new Set(["mcp", "hooks", "permissions", "ignore"]);
1421
+ var deriveFeatureGitignoreEntries = (feature) => {
1422
+ if (feature === "rules") return deriveRulesEntries();
1423
+ const factory = getProcessorRegistryEntry(feature).factory;
1424
+ if (DIR_FEATURES.has(feature)) return deriveDirEntries(factory, feature);
1425
+ if (FILE_FEATURES.has(feature)) return deriveFileEntries(factory, feature);
1426
+ return [];
1427
+ };
1428
+ var DERIVED_FEATURES = [
1429
+ "rules",
1430
+ "commands",
1431
+ "skills",
1432
+ "subagents",
1433
+ "mcp",
1434
+ "hooks",
1435
+ "permissions",
1436
+ "ignore"
1437
+ ];
1438
+ var deriveAllGitignoreEntries = () => DERIVED_FEATURES.flatMap((feature) => deriveFeatureGitignoreEntries(feature));
1439
+
1440
+ // src/cli/commands/gitignore-entries.ts
1441
+ var normalizeGitignoreEntryTargets = (target) => {
1442
+ return typeof target === "string" ? [target] : target;
1443
+ };
1444
+ var HAND_MAINTAINED_GITIGNORE_ENTRIES = [
1445
+ // rulesync's own meta files (common scope).
1471
1446
  {
1472
- target: ["copilot", "copilotcli"],
1473
- feature: "rules",
1474
- entry: "**/.github/copilot-instructions.md"
1447
+ target: "common",
1448
+ feature: "general",
1449
+ entry: `${RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH}/`
1475
1450
  },
1451
+ { target: "common", feature: "general", entry: ".rulesync/rules/*.local.md" },
1452
+ { target: "common", feature: "general", entry: "rulesync.local.jsonc" },
1453
+ // AGENTS.local.md is placed in common scope (not rovodev-only) so that
1454
+ // local rule files are always gitignored regardless of which targets are enabled.
1455
+ { target: "common", feature: "general", entry: "**/AGENTS.local.md" },
1456
+ // Local-root rule files: materialized outside getSettablePaths.
1457
+ { target: "claudecode", feature: "rules", entry: `**/${CLAUDECODE_LOCAL_RULE_FILE_NAME}` },
1476
1458
  {
1477
- target: ["copilot", "copilotcli"],
1459
+ target: "claudecode",
1478
1460
  feature: "rules",
1479
- entry: "**/.github/instructions/"
1480
- },
1481
- { target: "copilot", feature: "commands", entry: "**/.github/prompts/" },
1482
- { target: "copilot", feature: "subagents", entry: "**/.github/agents/" },
1483
- // Copilot CLI shares the project `.github/skills/` location with the Copilot
1484
- // IDE target; its personal skills live under `~/.copilot/skills/` (home dir,
1485
- // not gitignored at the project level).
1486
- { target: ["copilot", "copilotcli"], feature: "skills", entry: "**/.github/skills/" },
1487
- { target: "copilot", feature: "hooks", entry: "**/.github/hooks/" },
1488
- { target: "copilot", feature: "mcp", entry: "**/.vscode/mcp.json" },
1489
- // GitHub Copilot CLI
1490
- {
1491
- target: "copilotcli",
1492
- feature: "mcp",
1493
- entry: "**/.copilot/mcp-config.json"
1494
- },
1495
- // Project: <project>/.github/agents/*.agent.md
1496
- // Global: ~/.copilot/agents/
1497
- { target: "copilotcli", feature: "subagents", entry: "**/.github/agents/" },
1498
- { target: "copilotcli", feature: "subagents", entry: "**/.copilot/agents/" },
1499
- // Project: <project>/.github/hooks/copilotcli-hooks.json
1500
- // Global: ~/.copilot/hooks/copilot-hooks.json (rulesync convention pending
1501
- // official documentation of a global hooks location)
1502
- { target: "copilotcli", feature: "hooks", entry: "**/.github/hooks/" },
1503
- { target: "copilotcli", feature: "hooks", entry: "**/.copilot/hooks/" },
1504
- // Junie
1505
- { target: "junie", feature: "rules", entry: "**/.junie/guidelines.md" },
1506
- { target: "junie", feature: "mcp", entry: "**/.junie/mcp/mcp.json" },
1507
- { target: "junie", feature: "skills", entry: "**/.junie/skills/" },
1508
- { target: "junie", feature: "subagents", entry: "**/.junie/agents/" },
1509
- // Kilo Code
1510
- { target: "kilo", feature: "rules", entry: "**/.kilo/rules/" },
1511
- { target: "kilo", feature: "skills", entry: "**/.kilo/skills/" },
1512
- { target: "kilo", feature: "commands", entry: "**/.kilo/workflows/" },
1513
- { target: "kilo", feature: "mcp", entry: "**/.kilo/mcp.json" },
1514
- { target: "kilo", feature: "ignore", entry: "**/.kilocodeignore" },
1515
- // No `**/kilo.jsonc` entry: structurally identical to `opencode.jsonc` (no
1516
- // entry). The Kilo translator preserves non-permissions Kilo settings on
1517
- // round-trip, so the file is intended to be checked in by the user — adding
1518
- // `**/kilo.jsonc` would be too aggressive.
1519
- // Kiro
1520
- { target: "kiro", feature: "rules", entry: "**/.kiro/steering/" },
1521
- { target: "kiro", feature: "commands", entry: "**/.kiro/prompts/" },
1522
- { target: "kiro", feature: "skills", entry: "**/.kiro/skills/" },
1523
- { target: "kiro", feature: "subagents", entry: "**/.kiro/agents/" },
1524
- { target: "kiro", feature: "mcp", entry: "**/.kiro/settings/mcp.json" },
1525
- { target: "kiro", feature: "ignore", entry: "**/.aiignore" },
1526
- // Kiro IDE and CLI write to the same `.kiro/` tree as the legacy `kiro` alias.
1527
- // (Kiro IDE subagents are Markdown under `.kiro/agents/`, the CLI's are JSON —
1528
- // both covered by the shared `**/.kiro/agents/` entry.)
1529
- { target: ["kiro-cli", "kiro-ide"], feature: "rules", entry: "**/.kiro/steering/" },
1530
- { target: ["kiro-cli", "kiro-ide"], feature: "commands", entry: "**/.kiro/prompts/" },
1531
- { target: ["kiro-cli", "kiro-ide"], feature: "skills", entry: "**/.kiro/skills/" },
1532
- { target: ["kiro-cli", "kiro-ide"], feature: "subagents", entry: "**/.kiro/agents/" },
1533
- { target: ["kiro-cli", "kiro-ide"], feature: "mcp", entry: "**/.kiro/settings/mcp.json" },
1534
- { target: ["kiro-cli", "kiro-ide"], feature: "ignore", entry: "**/.aiignore" },
1535
- // Keep this after ignore entries like "**/.aiignore" so the exception remains effective.
1536
- { target: "common", feature: "general", entry: "!.rulesync/.aiignore" },
1537
- // OpenCode
1538
- { target: "opencode", feature: "commands", entry: "**/.opencode/commands/" },
1539
- { target: "opencode", feature: "subagents", entry: "**/.opencode/agents/" },
1540
- { target: "opencode", feature: "skills", entry: "**/.opencode/skills/" },
1541
- { target: "opencode", feature: "mcp", entry: "**/.opencode/plugins/" },
1542
- { target: "opencode", feature: "general", entry: "**/.opencode/memories/" },
1543
- {
1544
- target: "opencode",
1545
- feature: "general",
1546
- entry: "**/.opencode/package-lock.json"
1461
+ entry: `**/${CLAUDECODE_DIR}/${CLAUDECODE_LOCAL_RULE_FILE_NAME}`
1547
1462
  },
1548
- // Pi Coding Agent
1549
- { target: "pi", feature: "rules", entry: "**/.agents/memories/" },
1550
- { target: "pi", feature: "commands", entry: "**/.pi/prompts/" },
1551
- { target: "pi", feature: "skills", entry: "**/.pi/skills/" },
1552
- // Qwen Code
1553
- { target: "qwencode", feature: "rules", entry: "**/QWEN.md" },
1554
- { target: "qwencode", feature: "commands", entry: "**/.qwen/commands/" },
1555
- { target: "qwencode", feature: "subagents", entry: "**/.qwen/agents/" },
1556
- { target: "qwencode", feature: "skills", entry: "**/.qwen/skills/" },
1557
- { target: "qwencode", feature: "ignore", entry: "**/.qwenignore" },
1558
- { target: "qwencode", feature: "general", entry: "**/.qwen/memories/" },
1559
- // mcp + hooks both write to `.qwen/settings.json`, shared with permissions.
1560
- { target: "qwencode", feature: "permissions", entry: "**/.qwen/settings.json" },
1561
- // Replit
1562
- { target: "replit", feature: "rules", entry: "**/replit.md" },
1563
- // Roo
1564
- { target: "roo", feature: "rules", entry: "**/.roo/rules/" },
1565
- { target: "roo", feature: "skills", entry: "**/.roo/skills/" },
1566
- { target: "roo", feature: "ignore", entry: "**/.rooignore" },
1567
- { target: "roo", feature: "mcp", entry: "**/.roo/mcp.json" },
1568
- { target: "roo", feature: "subagents", entry: "**/.roomodes" },
1569
- // Rovodev
1463
+ // Third-party tool by-products rulesync gitignores but never writes itself.
1464
+ { target: "claudecode", feature: "general", entry: `**/${CLAUDECODE_DIR}/*.lock` },
1570
1465
  {
1571
- target: "rovodev",
1466
+ target: "claudecode",
1572
1467
  feature: "general",
1573
- entry: "**/.rovodev/AGENTS.md"
1468
+ entry: `**/${CLAUDECODE_DIR}/${CLAUDECODE_SETTINGS_LOCAL_FILE_NAME}`
1574
1469
  },
1575
- { target: "rovodev", feature: "subagents", entry: "**/.rovodev/subagents/" },
1576
- { target: "rovodev", feature: "skills", entry: "**/.rovodev/skills/" },
1577
1470
  {
1578
- target: "rovodev",
1471
+ target: "claudecode",
1579
1472
  feature: "general",
1580
- entry: "**/.rovodev/.rulesync/"
1473
+ entry: `**/${CLAUDECODE_DIR}/${CLAUDECODE_MEMORIES_DIR_NAME}/`
1581
1474
  },
1582
- { target: "rovodev", feature: "skills", entry: "**/.agents/skills/" },
1583
- // TAKT
1584
- // Each rulesync feature maps one-to-one onto a TAKT facet directory.
1585
- { target: "takt", feature: "rules", entry: "**/.takt/facets/policies/" },
1586
- { target: "takt", feature: "skills", entry: "**/.takt/facets/knowledge/" },
1587
- { target: "takt", feature: "subagents", entry: "**/.takt/facets/personas/" },
1588
- { target: "takt", feature: "commands", entry: "**/.takt/facets/instructions/" },
1475
+ { target: "opencode", feature: "general", entry: "**/.opencode/package-lock.json" },
1476
+ { target: "rovodev", feature: "general", entry: "**/.rovodev/.rulesync/" },
1589
1477
  { target: "takt", feature: "general", entry: "**/.takt/runs/" },
1590
1478
  { target: "takt", feature: "general", entry: "**/.takt/tasks/" },
1591
1479
  { target: "takt", feature: "general", entry: "**/.takt/.cache/" },
1592
1480
  { target: "takt", feature: "general", entry: "**/.takt/config.yaml" },
1593
- // Devin (Devin Desktop). Since the rebrand (v3.0.12, 2026-06-02), project
1594
- // rules/workflows/skills live under `.devin/`; MCP and hooks keep their
1595
- // `.devin/` paths and the global skills path is unchanged.
1596
- { target: "devin", feature: "rules", entry: "**/.devin/rules/" },
1597
- { target: "devin", feature: "commands", entry: "**/.devin/workflows/" },
1598
- { target: "devin", feature: "ignore", entry: "**/.devinignore" },
1599
- { target: "devin", feature: "mcp", entry: "**/.windsurf/mcp_config.json" },
1600
- { target: "devin", feature: "hooks", entry: "**/.windsurf/hooks.json" },
1601
- { target: "devin", feature: "skills", entry: "**/.devin/skills/" },
1481
+ // Augment Code's legacy single-file rules path: accepted on import but never
1482
+ // generated (so not in getSettablePaths), gitignored as a convenience.
1483
+ { target: "augmentcode", feature: "rules", entry: "**/.augment-guidelines" },
1484
+ // Shared trees and global-scope outputs not produced via project getSettablePaths.
1485
+ { target: "rovodev", feature: "skills", entry: "**/.agents/skills/" },
1602
1486
  { target: "devin", feature: "skills", entry: "**/.codeium/windsurf/skills/" },
1603
- // Devin Local custom subagent profiles: `.devin/agents/<name>/AGENT.md`
1604
- // (project). The global path `~/.config/devin/agents/` lives under the home
1605
- // directory and is not gitignored at the project level.
1606
- { target: "devin", feature: "subagents", entry: "**/.devin/agents/" },
1607
- // Vibe
1608
- { target: "vibe", feature: "ignore", entry: "**/.vibeignore" },
1609
- { target: "vibe", feature: "skills", entry: "**/.vibe/skills/" },
1610
- { target: "vibe", feature: "subagents", entry: "**/.vibe/agents/" },
1611
- { target: "vibe", feature: "mcp", entry: "**/.vibe/config.toml" },
1612
- { target: "vibe", feature: "permissions", entry: "**/.vibe/config.toml" },
1613
- // Experimental hooks live in `.vibe/hooks.toml`; the `enable_experimental_hooks`
1614
- // flag is merged into the shared `.vibe/config.toml` (already covered above).
1615
- { target: "vibe", feature: "hooks", entry: "**/.vibe/hooks.toml" },
1616
- { target: "vibe", feature: "hooks", entry: "**/.vibe/config.toml" },
1617
- // Warp
1618
- // Warp reads project rules only from the root `AGENTS.md` (handled by the
1619
- // shared AGENTS.md entry above); it does not read `.warp/memories/`, so no
1620
- // rules entry under `.warp/` is emitted.
1621
- { target: "warp", feature: "mcp", entry: "**/.warp/.mcp.json" },
1622
- { target: "warp", feature: "skills", entry: "**/.warp/skills/" },
1623
- // Zed
1624
- // `.rules` is the project rules file. `.agents/skills/` is shared with the
1625
- // antigravity targets (already registered above); re-tagging it for `zed`
1626
- // ensures target-filtered gitignore runs still include it.
1627
- // No entry for `.zed/settings.json` (MCP / ignore): it is a user-managed
1628
- // file, like other tools' settings.json, so it is intentionally not ignored.
1629
- { target: "zed", feature: "rules", entry: "**/.rules" },
1630
- { target: "zed", feature: "skills", entry: "**/.agents/skills/" }
1487
+ { target: "copilotcli", feature: "subagents", entry: "**/.copilot/agents/" },
1488
+ { target: "copilotcli", feature: "mcp", entry: "**/.copilot/mcp-config.json" },
1489
+ { target: "copilotcli", feature: "hooks", entry: "**/.copilot/hooks/" },
1490
+ { target: "deepagents", feature: "hooks", entry: "**/.deepagents/hooks.json" },
1491
+ // Roo aggregates subagents into a single `.roomodes` file (no settable path).
1492
+ { target: "roo", feature: "subagents", entry: "**/.roomodes" },
1493
+ // codexcli has no ignore processor; its `.codexignore` is a ghost entry.
1494
+ { target: "codexcli", feature: "ignore", entry: "**/.codexignore" }
1495
+ ];
1496
+ var GITIGNORE_ENTRY_REGISTRY = [
1497
+ ...HAND_MAINTAINED_GITIGNORE_ENTRIES,
1498
+ // Every entry a tool actually emits, derived from its getSettablePaths.
1499
+ ...deriveAllGitignoreEntries(),
1500
+ // Keep this after ignore entries like Junie's "**/.aiignore" so the exception remains effective.
1501
+ { target: "common", feature: "general", entry: "!.rulesync/.aiignore" }
1631
1502
  ];
1632
1503
  var ALL_GITIGNORE_ENTRIES = (() => {
1633
1504
  const seen = /* @__PURE__ */ new Set();
@@ -6644,7 +6515,7 @@ function wrapCommand({
6644
6515
  }
6645
6516
 
6646
6517
  // src/cli/index.ts
6647
- var getVersion = () => "8.30.0";
6518
+ var getVersion = () => "8.31.0";
6648
6519
  function wrapCommand2(name, errorCode, handler) {
6649
6520
  return wrapCommand({ name, errorCode, handler, getVersion });
6650
6521
  }