@intellectronica/ruler 0.3.12 → 0.3.13

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
@@ -61,7 +61,7 @@ Ruler solves this by providing a **single source of truth** for all your AI agen
61
61
  | Claude Code | `CLAUDE.md` | `.mcp.json` |
62
62
  | OpenAI Codex CLI | `AGENTS.md` | `.codex/config.toml` |
63
63
  | Jules | `AGENTS.md` | - |
64
- | Cursor | `.cursor/rules/ruler_cursor_instructions.mdc` | `.cursor/mcp.json` |
64
+ | Cursor | `AGENTS.md` | `.cursor/mcp.json` |
65
65
  | Windsurf | `AGENTS.md` | `.windsurf/mcp_config.json` |
66
66
  | Cline | `.clinerules` | - |
67
67
  | Crush | `CRUSH.md` | `.crush.json` |
@@ -712,11 +712,8 @@ node_modules/
712
712
  # START Ruler Generated Files
713
713
  .aider.conf.yml
714
714
  .clinerules
715
- .cursor/rules/ruler_cursor_instructions.mdc
716
- .windsurf/rules/ruler_windsurf_instructions.md
717
715
  AGENTS.md
718
716
  CLAUDE.md
719
- AGENTS.md
720
717
  # END Ruler Generated Files
721
718
 
722
719
  dist/
@@ -1,46 +1,13 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.CursorAgent = void 0;
37
- const path = __importStar(require("path"));
38
- const AbstractAgent_1 = require("./AbstractAgent");
39
- const FileSystemUtils_1 = require("../core/FileSystemUtils");
4
+ const AgentsMdAgent_1 = require("./AgentsMdAgent");
40
5
  /**
41
6
  * Cursor agent adapter.
7
+ * Leverages the standardized AGENTS.md approach supported natively by Cursor.
8
+ * See: https://docs.cursor.com/en/cli/using
42
9
  */
43
- class CursorAgent extends AbstractAgent_1.AbstractAgent {
10
+ class CursorAgent extends AgentsMdAgent_1.AgentsMdAgent {
44
11
  getIdentifier() {
45
12
  return 'cursor';
46
13
  }
@@ -48,20 +15,14 @@ class CursorAgent extends AbstractAgent_1.AbstractAgent {
48
15
  return 'Cursor';
49
16
  }
50
17
  async applyRulerConfig(concatenatedRules, projectRoot, _rulerMcpJson, agentConfig, backup = true) {
51
- const output = agentConfig?.outputPath ?? this.getDefaultOutputPath(projectRoot);
52
- const absolutePath = path.resolve(projectRoot, output);
53
- // Cursor expects a YAML front-matter block with an `alwaysApply` flag.
54
- // See: https://docs.cursor.com/context/rules#rule-anatomy
55
- const frontMatter = ['---', 'alwaysApply: true', '---', ''].join('\n');
56
- const content = `${frontMatter}${concatenatedRules.trimStart()}`;
57
- await (0, FileSystemUtils_1.ensureDirExists)(path.dirname(absolutePath));
58
- if (backup) {
59
- await (0, FileSystemUtils_1.backupFile)(absolutePath);
60
- }
61
- await (0, FileSystemUtils_1.writeGeneratedFile)(absolutePath, content);
18
+ // Write AGENTS.md via base class
19
+ // Cursor natively reads AGENTS.md from the project root
20
+ await super.applyRulerConfig(concatenatedRules, projectRoot, null, {
21
+ outputPath: agentConfig?.outputPath,
22
+ }, backup);
62
23
  }
63
- getDefaultOutputPath(projectRoot) {
64
- return path.join(projectRoot, '.cursor', 'rules', 'ruler_cursor_instructions.mdc');
24
+ getMcpServerKey() {
25
+ return 'mcpServers';
65
26
  }
66
27
  supportsMcpStdio() {
67
28
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intellectronica/ruler",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "Ruler — apply the same rules to all coding agents",
5
5
  "main": "dist/lib.js",
6
6
  "scripts": {