@intellectronica/ruler 0.2.10 → 0.2.12

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
@@ -50,6 +50,7 @@ Ruler solves this by providing a **single source of truth** for all your AI agen
50
50
  | Gemini CLI | `GEMINI.md` | `.gemini/settings.json` |
51
51
  | Junie | `.junie/guidelines.md` | - |
52
52
  | AugmentCode | `.augment/rules/ruler_augment_instructions.md` | `.vscode/settings.json` |
53
+ | Kilo Code | `.kilocode/rules/ruler_kilocode_instructions.md` | `.kilocode/mcp.json` |
53
54
 
54
55
  ## Getting Started
55
56
 
@@ -145,7 +146,7 @@ The `apply` command looks for `.ruler/` in the current directory tree, reading t
145
146
  | Option | Description |
146
147
  | ------------------------------ | --------------------------------------------------------- |
147
148
  | `--project-root <path>` | Path to your project's root (default: current directory) |
148
- | `--agents <agent1,agent2,...>` | Comma-separated list of agent names to target (copilot, claude, codex, cursor, windsurf, cline, aider, firebase, gemini-cli, junie, augmentcode) |
149
+ | `--agents <agent1,agent2,...>` | Comma-separated list of agent names to target (copilot, claude, codex, cursor, windsurf, cline, aider, firebase, gemini-cli, junie, augmentcode, kilocode) |
149
150
  | `--config <path>` | Path to a custom `ruler.toml` configuration file |
150
151
  | `--mcp` / `--with-mcp` | Enable applying MCP server configurations (default: true) |
151
152
  | `--no-mcp` | Disable applying MCP server configurations |
@@ -216,7 +217,7 @@ ruler revert [options]
216
217
  | Option | Description |
217
218
  | ------------------------------ | --------------------------------------------------------- |
218
219
  | `--project-root <path>` | Path to your project's root (default: current directory) |
219
- | `--agents <agent1,agent2,...>` | Comma-separated list of agent names to revert (copilot, claude, codex, cursor, windsurf, cline, aider, firebase, gemini-cli, junie) |
220
+ | `--agents <agent1,agent2,...>` | Comma-separated list of agent names to revert (copilot, claude, codex, cursor, windsurf, cline, aider, firebase, gemini-cli, junie, kilocode) |
220
221
  | `--config <path>` | Path to a custom `ruler.toml` configuration file |
221
222
  | `--keep-backups` | Keep backup files (.bak) after restoration (default: false) |
222
223
  | `--dry-run` | Preview changes without actually reverting files |
@@ -316,6 +317,10 @@ merge_strategy = "merge"
316
317
  # Disable specific agents
317
318
  [agents.windsurf]
318
319
  enabled = false
320
+
321
+ [agents.kilocode]
322
+ enabled = true
323
+ output_path = ".kilocode/rules/ruler_kilocode_instructions.md"
319
324
  ```
320
325
 
321
326
  ### Configuration Precedence
@@ -49,9 +49,13 @@ class CursorAgent {
49
49
  async applyRulerConfig(concatenatedRules, projectRoot, rulerMcpJson, // eslint-disable-line @typescript-eslint/no-unused-vars
50
50
  agentConfig) {
51
51
  const output = agentConfig?.outputPath ?? this.getDefaultOutputPath(projectRoot);
52
+ // Cursor expects a YAML front-matter block with an `alwaysApply` flag.
53
+ // See: https://docs.cursor.com/context/rules#rule-anatomy
54
+ const frontMatter = ['---', 'alwaysApply: true', '---', ''].join('\n');
55
+ const content = `${frontMatter}${concatenatedRules.trimStart()}`;
52
56
  await (0, FileSystemUtils_1.ensureDirExists)(path.dirname(output));
53
57
  await (0, FileSystemUtils_1.backupFile)(output);
54
- await (0, FileSystemUtils_1.writeGeneratedFile)(output, concatenatedRules);
58
+ await (0, FileSystemUtils_1.writeGeneratedFile)(output, content);
55
59
  }
56
60
  getDefaultOutputPath(projectRoot) {
57
61
  return path.join(projectRoot, '.cursor', 'rules', 'ruler_cursor_instructions.mdc');
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.KiloCodeAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const FileSystemUtils_1 = require("../core/FileSystemUtils");
39
+ /**
40
+ * Kilo Code agent adapter.
41
+ * Generates ruler_kilocode_instructions.md configuration file in .kilocode/rules/ directory.
42
+ */
43
+ class KiloCodeAgent {
44
+ getIdentifier() {
45
+ return 'kilocode';
46
+ }
47
+ getName() {
48
+ return 'Kilo Code';
49
+ }
50
+ async applyRulerConfig(concatenatedRules, projectRoot, rulerMcpJson, // eslint-disable-line @typescript-eslint/no-unused-vars
51
+ agentConfig) {
52
+ const output = agentConfig?.outputPath ?? this.getDefaultOutputPath(projectRoot);
53
+ await (0, FileSystemUtils_1.ensureDirExists)(path.dirname(output));
54
+ await (0, FileSystemUtils_1.backupFile)(output);
55
+ await (0, FileSystemUtils_1.writeGeneratedFile)(output, concatenatedRules);
56
+ }
57
+ getDefaultOutputPath(projectRoot) {
58
+ return path.join(projectRoot, '.kilocode', 'rules', 'ruler_kilocode_instructions.md');
59
+ }
60
+ getMcpServerKey() {
61
+ return 'mcpServers';
62
+ }
63
+ }
64
+ exports.KiloCodeAgent = KiloCodeAgent;
@@ -60,7 +60,7 @@ function run() {
60
60
  });
61
61
  y.option('agents', {
62
62
  type: 'string',
63
- description: 'Comma-separated list of agent identifiers: copilot, claude, codex, cursor, windsurf, cline, aider, firebase, gemini-cli, junie',
63
+ description: 'Comma-separated list of agent identifiers: copilot, claude, codex, cursor, windsurf, cline, aider, firebase, gemini-cli, junie, kilocode',
64
64
  });
65
65
  y.option('config', {
66
66
  type: 'string',
@@ -174,7 +174,7 @@ and apply them to your configured AI coding agents.
174
174
 
175
175
  # --- Agent Specific Configurations ---
176
176
  # You can enable/disable agents and override their default output paths here.
177
- # Use lowercase agent identifiers: copilot, claude, codex, cursor, windsurf, cline, aider
177
+ # Use lowercase agent identifiers: copilot, claude, codex, cursor, windsurf, cline, aider, kilocode
178
178
 
179
179
  # [agents.copilot]
180
180
  # enabled = true
@@ -211,6 +211,10 @@ and apply them to your configured AI coding agents.
211
211
 
212
212
  # [agents.gemini-cli]
213
213
  # enabled = true
214
+
215
+ # [agents.kilocode]
216
+ # enabled = true
217
+ # output_path = ".kilocode/rules/ruler_kilocode_instructions.md"
214
218
  `;
215
219
  if (!(await exists(instructionsPath))) {
216
220
  await fs_1.promises.writeFile(instructionsPath, DEFAULT_INSTRUCTIONS);
@@ -250,7 +254,7 @@ and apply them to your configured AI coding agents.
250
254
  });
251
255
  y.option('agents', {
252
256
  type: 'string',
253
- description: 'Comma-separated list of agent identifiers: copilot, claude, codex, cursor, windsurf, cline, aider, firebase, gemini-cli, junie',
257
+ description: 'Comma-separated list of agent identifiers: copilot, claude, codex, cursor, windsurf, cline, aider, firebase, gemini-cli, junie, kilocode',
254
258
  });
255
259
  y.option('config', {
256
260
  type: 'string',
package/dist/lib.js CHANGED
@@ -53,6 +53,7 @@ const GeminiCliAgent_1 = require("./agents/GeminiCliAgent");
53
53
  const JulesAgent_1 = require("./agents/JulesAgent");
54
54
  const JunieAgent_1 = require("./agents/JunieAgent");
55
55
  const AugmentCodeAgent_1 = require("./agents/AugmentCodeAgent");
56
+ const KiloCodeAgent_1 = require("./agents/KiloCodeAgent");
56
57
  const merge_1 = require("./mcp/merge");
57
58
  const validate_1 = require("./mcp/validate");
58
59
  const mcp_1 = require("./paths/mcp");
@@ -106,6 +107,7 @@ const agents = [
106
107
  new JulesAgent_1.JulesAgent(),
107
108
  new JunieAgent_1.JunieAgent(),
108
109
  new AugmentCodeAgent_1.AugmentCodeAgent(),
110
+ new KiloCodeAgent_1.KiloCodeAgent(),
109
111
  ];
110
112
  /**
111
113
  * Applies ruler configurations for all supported AI agents.
package/dist/paths/mcp.js CHANGED
@@ -77,6 +77,9 @@ async function getNativeMcpPath(adapterName, projectRoot) {
77
77
  case 'AugmentCode':
78
78
  candidates.push(path.join(projectRoot, '.vscode', 'settings.json'));
79
79
  break;
80
+ case 'Kilo Code':
81
+ candidates.push(path.join(projectRoot, '.kilocode', 'mcp.json'));
82
+ break;
80
83
  default:
81
84
  return null;
82
85
  }
package/dist/revert.js CHANGED
@@ -51,6 +51,7 @@ const GeminiCliAgent_1 = require("./agents/GeminiCliAgent");
51
51
  const JulesAgent_1 = require("./agents/JulesAgent");
52
52
  const JunieAgent_1 = require("./agents/JunieAgent");
53
53
  const AugmentCodeAgent_1 = require("./agents/AugmentCodeAgent");
54
+ const KiloCodeAgent_1 = require("./agents/KiloCodeAgent");
54
55
  const mcp_1 = require("./paths/mcp");
55
56
  const constants_1 = require("./constants");
56
57
  const settings_1 = require("./vscode/settings");
@@ -68,6 +69,7 @@ const agents = [
68
69
  new JulesAgent_1.JulesAgent(),
69
70
  new JunieAgent_1.JunieAgent(),
70
71
  new AugmentCodeAgent_1.AugmentCodeAgent(),
72
+ new KiloCodeAgent_1.KiloCodeAgent(),
71
73
  ];
72
74
  /**
73
75
  * Gets all output paths for an agent, taking into account any config overrides.
@@ -280,6 +282,7 @@ async function removeEmptyDirectories(projectRoot, verbose, dryRun) {
280
282
  '.gemini',
281
283
  '.vscode',
282
284
  '.augmentcode',
285
+ '.kilocode',
283
286
  ];
284
287
  let directoriesRemoved = 0;
285
288
  // Handle .augment directory with special logic
@@ -304,6 +307,7 @@ async function removeAdditionalAgentFiles(projectRoot, verbose, dryRun) {
304
307
  '.mcp.json',
305
308
  '.vscode/mcp.json',
306
309
  '.cursor/mcp.json',
310
+ '.kilocode/mcp.json',
307
311
  '.openhands/config.toml',
308
312
  ];
309
313
  let filesRemoved = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intellectronica/ruler",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "Ruler — apply the same rules to all coding agents",
5
5
  "main": "dist/lib.js",
6
6
  "scripts": {