@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,
|
|
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');
|