@intellectronica/ruler 0.2.11 → 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.
@@ -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');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intellectronica/ruler",
3
- "version": "0.2.11",
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": {