@intellectronica/ruler 0.2.0 → 0.2.2
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 +10 -0
- package/dist/agents/FirebaseAgent.js +58 -0
- package/dist/cli/commands.js +5 -1
- package/dist/constants.js +1 -1
- package/dist/lib.js +2 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ Ruler solves this by providing a **single source of truth** for all your AI agen
|
|
|
44
44
|
| Windsurf | `.windsurf/rules/ruler_windsurf_instructions.md` |
|
|
45
45
|
| Cline | `.clinerules` |
|
|
46
46
|
| Aider | `ruler_aider_instructions.md` and `.aider.conf.yml` |
|
|
47
|
+
| Firebase Studio | `.idx/airules.md` |
|
|
47
48
|
|
|
48
49
|
## Getting Started
|
|
49
50
|
|
|
@@ -143,6 +144,11 @@ ruler apply
|
|
|
143
144
|
ruler apply --agents copilot,claude
|
|
144
145
|
```
|
|
145
146
|
|
|
147
|
+
**Apply rules only to Firebase Studio:**
|
|
148
|
+
```bash
|
|
149
|
+
ruler apply --agents firebase
|
|
150
|
+
```
|
|
151
|
+
|
|
146
152
|
**Use a specific configuration file:**
|
|
147
153
|
```bash
|
|
148
154
|
ruler apply --config ./team-configs/ruler.frontend.toml
|
|
@@ -195,6 +201,10 @@ enabled = true
|
|
|
195
201
|
output_path_instructions = "ruler_aider_instructions.md"
|
|
196
202
|
output_path_config = ".aider.conf.yml"
|
|
197
203
|
|
|
204
|
+
[agents.firebase]
|
|
205
|
+
enabled = true
|
|
206
|
+
output_path = ".idx/airules.md"
|
|
207
|
+
|
|
198
208
|
# Agent-specific MCP configuration
|
|
199
209
|
[agents.cursor.mcp]
|
|
200
210
|
enabled = true
|
|
@@ -0,0 +1,58 @@
|
|
|
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.FirebaseAgent = void 0;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const FileSystemUtils_1 = require("../core/FileSystemUtils");
|
|
39
|
+
/**
|
|
40
|
+
* Firebase Studio agent adapter.
|
|
41
|
+
*/
|
|
42
|
+
class FirebaseAgent {
|
|
43
|
+
getIdentifier() {
|
|
44
|
+
return 'firebase';
|
|
45
|
+
}
|
|
46
|
+
getName() {
|
|
47
|
+
return 'Firebase Studio';
|
|
48
|
+
}
|
|
49
|
+
async applyRulerConfig(concatenatedRules, projectRoot, agentConfig) {
|
|
50
|
+
const output = agentConfig?.outputPath ?? this.getDefaultOutputPath(projectRoot);
|
|
51
|
+
await (0, FileSystemUtils_1.backupFile)(output);
|
|
52
|
+
await (0, FileSystemUtils_1.writeGeneratedFile)(output, concatenatedRules);
|
|
53
|
+
}
|
|
54
|
+
getDefaultOutputPath(projectRoot) {
|
|
55
|
+
return path.join(projectRoot, '.idx', 'airules.md');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.FirebaseAgent = FirebaseAgent;
|
package/dist/cli/commands.js
CHANGED
|
@@ -58,7 +58,7 @@ function run() {
|
|
|
58
58
|
});
|
|
59
59
|
y.option('agents', {
|
|
60
60
|
type: 'string',
|
|
61
|
-
description: 'Comma-separated list of agent identifiers: copilot, claude, codex, cursor, windsurf, cline, aider',
|
|
61
|
+
description: 'Comma-separated list of agent identifiers: copilot, claude, codex, cursor, windsurf, cline, aider, firebase',
|
|
62
62
|
});
|
|
63
63
|
y.option('config', {
|
|
64
64
|
type: 'string',
|
|
@@ -189,6 +189,10 @@ and apply them to your configured AI coding agents.
|
|
|
189
189
|
# enabled = true
|
|
190
190
|
# output_path_instructions = "ruler_aider_instructions.md"
|
|
191
191
|
# output_path_config = ".aider.conf.yml"
|
|
192
|
+
|
|
193
|
+
# [agents.firebase]
|
|
194
|
+
# enabled = true
|
|
195
|
+
# output_path = ".idx/airules.md"
|
|
192
196
|
`;
|
|
193
197
|
if (!(await exists(instructionsPath))) {
|
|
194
198
|
await fs_1.promises.writeFile(instructionsPath, DEFAULT_INSTRUCTIONS);
|
package/dist/constants.js
CHANGED
package/dist/lib.js
CHANGED
|
@@ -47,6 +47,7 @@ const CursorAgent_1 = require("./agents/CursorAgent");
|
|
|
47
47
|
const WindsurfAgent_1 = require("./agents/WindsurfAgent");
|
|
48
48
|
const ClineAgent_1 = require("./agents/ClineAgent");
|
|
49
49
|
const AiderAgent_1 = require("./agents/AiderAgent");
|
|
50
|
+
const FirebaseAgent_1 = require("./agents/FirebaseAgent");
|
|
50
51
|
const merge_1 = require("./mcp/merge");
|
|
51
52
|
const validate_1 = require("./mcp/validate");
|
|
52
53
|
const mcp_1 = require("./paths/mcp");
|
|
@@ -93,6 +94,7 @@ const agents = [
|
|
|
93
94
|
new WindsurfAgent_1.WindsurfAgent(),
|
|
94
95
|
new ClineAgent_1.ClineAgent(),
|
|
95
96
|
new AiderAgent_1.AiderAgent(),
|
|
97
|
+
new FirebaseAgent_1.FirebaseAgent(),
|
|
96
98
|
];
|
|
97
99
|
/**
|
|
98
100
|
* Applies ruler configurations for all supported AI agents.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intellectronica/ruler",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Ruler — apply the same rules to all coding agents",
|
|
5
5
|
"main": "dist/lib.js",
|
|
6
6
|
"scripts": {
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/jest": "^29.5.14",
|
|
47
47
|
"@types/js-yaml": "^4.0.9",
|
|
48
|
+
"@types/node": "^22.15.24",
|
|
48
49
|
"@types/yargs": "^17.0.33",
|
|
49
50
|
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
50
51
|
"@typescript-eslint/parser": "^8.32.1",
|