ai-rulez 3.4.1 → 3.6.0
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 +146 -589
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,108 +1,53 @@
|
|
|
1
1
|
# ai-rulez
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Write AI assistant rules once. Generate configs for 18 different tools.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Every AI coding tool wants its own config format. Claude needs `CLAUDE.md`, Cursor wants `.cursor/rules/`, Copilot expects `.github/copilot-instructions.md`. Keeping them in sync is tedious and error-prone.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Quick Start
|
|
7
|
+
ai-rulez solves this: define rules and context in `.ai-rulez/`, run `generate`, and get native configs for all your tools.
|
|
10
8
|
|
|
11
9
|
```bash
|
|
12
|
-
|
|
13
|
-
npx ai-rulez@latest init
|
|
14
|
-
# or
|
|
15
|
-
uvx ai-rulez init
|
|
16
|
-
|
|
17
|
-
# Edit your configuration in .ai-rulez/
|
|
18
|
-
# Then generate tool-specific configs
|
|
19
|
-
npx ai-rulez@latest generate
|
|
20
|
-
# or
|
|
21
|
-
uvx ai-rulez generate
|
|
10
|
+
npx ai-rulez@latest init && npx ai-rulez@latest generate
|
|
22
11
|
```
|
|
23
12
|
|
|
24
|
-
|
|
25
|
-
<summary>Installation Methods</summary>
|
|
26
|
-
|
|
27
|
-
### Global Installation
|
|
28
|
-
|
|
29
|
-
**Homebrew (macOS/Linux):**
|
|
30
|
-
```bash
|
|
31
|
-
brew install goldziher/tap/ai-rulez
|
|
32
|
-
```
|
|
13
|
+
**[Documentation](https://goldziher.github.io/ai-rulez/)**
|
|
33
14
|
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
go install github.com/Goldziher/ai-rulez/cmd@latest
|
|
37
|
-
```
|
|
15
|
+
## What You Get
|
|
38
16
|
|
|
39
|
-
**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
17
|
+
- **18 preset generators**: Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Continue.dev, Amp, Junie, Codex, OpenCode, and custom presets
|
|
18
|
+
- **Commands system**: Define slash commands once, use them across tools that support it
|
|
19
|
+
- **Context compression**: 34% size reduction with smart whitespace optimization
|
|
20
|
+
- **Remote includes**: Pull shared rules from git repos (company standards, team configs)
|
|
21
|
+
- **Profile system**: Generate different configs for backend/frontend/QA teams
|
|
22
|
+
- **MCP server**: Let AI assistants manage their own rules via Model Context Protocol
|
|
23
|
+
- **Type-safe schemas**: JSON Schema validation for all config files
|
|
43
24
|
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
pip install ai-rulez
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
**Python (uv):**
|
|
50
|
-
```bash
|
|
51
|
-
uv tool install ai-rulez
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
</details>
|
|
55
|
-
|
|
56
|
-
## How It Works
|
|
57
|
-
|
|
58
|
-
### 1. Initialize Your Project
|
|
25
|
+
## Quick Start
|
|
59
26
|
|
|
60
27
|
```bash
|
|
61
|
-
|
|
28
|
+
# No install required
|
|
29
|
+
npx ai-rulez@latest init "My Project"
|
|
30
|
+
npx ai-rulez@latest generate
|
|
62
31
|
```
|
|
63
32
|
|
|
64
|
-
This creates
|
|
33
|
+
This creates:
|
|
65
34
|
|
|
66
35
|
```
|
|
67
36
|
.ai-rulez/
|
|
68
|
-
├── config.yaml
|
|
69
|
-
├── rules/
|
|
70
|
-
|
|
71
|
-
├──
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
│ └── code-reviewer/
|
|
75
|
-
│ └── SKILL.md
|
|
76
|
-
├── agents/ # Agent prompt files
|
|
77
|
-
├── domains/ # Optional domain-specific organization
|
|
78
|
-
└── mcp.yaml # Model Context Protocol servers
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
<details>
|
|
82
|
-
<summary>Init Command Options</summary>
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
# Create with specific domains
|
|
86
|
-
ai-rulez init --domains backend,frontend,qa
|
|
87
|
-
|
|
88
|
-
# Skip example content
|
|
89
|
-
ai-rulez init --skip-content
|
|
90
|
-
|
|
91
|
-
# Use JSON instead of YAML
|
|
92
|
-
ai-rulez init --format json
|
|
93
|
-
|
|
94
|
-
# Import from existing tool files
|
|
95
|
-
ai-rulez init --from auto
|
|
96
|
-
ai-rulez init --from .cursorrules,CLAUDE.md
|
|
37
|
+
├── config.yaml # Which tools to generate for
|
|
38
|
+
├── rules/ # Guidelines AI must follow
|
|
39
|
+
├── context/ # Project background info
|
|
40
|
+
├── skills/ # Specialized AI roles
|
|
41
|
+
├── agents/ # Agent-specific prompts
|
|
42
|
+
└── commands/ # Slash commands
|
|
97
43
|
```
|
|
98
44
|
|
|
99
|
-
|
|
45
|
+
And generates native configs for each tool you specify.
|
|
100
46
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
Edit `.ai-rulez/config.yaml` to specify which AI tools you want to support:
|
|
47
|
+
## Configuration
|
|
104
48
|
|
|
105
49
|
```yaml
|
|
50
|
+
# .ai-rulez/config.yaml
|
|
106
51
|
version: "3.0"
|
|
107
52
|
name: "My Project"
|
|
108
53
|
|
|
@@ -110,608 +55,220 @@ presets:
|
|
|
110
55
|
- claude
|
|
111
56
|
- cursor
|
|
112
57
|
- copilot
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
<details>
|
|
116
|
-
<summary>Available Presets</summary>
|
|
117
|
-
|
|
118
|
-
- **claude** - Claude Desktop and Claude Code
|
|
119
|
-
- **cursor** - Cursor IDE
|
|
120
|
-
- **windsurf** - Windsurf IDE
|
|
121
|
-
- **copilot** - GitHub Copilot
|
|
122
|
-
- **gemini** - Google Gemini
|
|
123
|
-
- **cline** - Cline extension
|
|
124
|
-
- **continue-dev** - Continue.dev
|
|
125
|
-
- **junie** - Junie AI
|
|
126
|
-
- **amp** - AMP
|
|
127
|
-
- **codex** - OpenAI Codex
|
|
128
|
-
- **opencode** - OpenCode
|
|
129
|
-
|
|
130
|
-
</details>
|
|
131
|
-
|
|
132
|
-
### 3. Add Your Rules and Context
|
|
58
|
+
- windsurf
|
|
133
59
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
priority: high
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
# Code Quality Standards
|
|
60
|
+
# Optional: team-specific profiles
|
|
61
|
+
profiles:
|
|
62
|
+
backend: [backend, database]
|
|
63
|
+
frontend: [frontend, ui]
|
|
142
64
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
-
|
|
65
|
+
# Optional: share rules across repos
|
|
66
|
+
includes:
|
|
67
|
+
- name: company-standards
|
|
68
|
+
source: https://github.com/company/ai-rules.git
|
|
69
|
+
ref: main
|
|
146
70
|
```
|
|
147
71
|
|
|
148
|
-
|
|
149
|
-
<summary>Content Types Explained</summary>
|
|
150
|
-
|
|
151
|
-
**Rules** (`.ai-rulez/rules/`)
|
|
152
|
-
|
|
153
|
-
Strict guidelines that AI assistants must follow. These are prescriptive and enforce behavior.
|
|
72
|
+
## Content Structure
|
|
154
73
|
|
|
74
|
+
**Rules** - What AI must do:
|
|
155
75
|
```markdown
|
|
156
76
|
---
|
|
157
77
|
priority: critical
|
|
158
78
|
---
|
|
159
|
-
|
|
160
79
|
# Security Standards
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
**Context** (`.ai-rulez/context/`)
|
|
167
|
-
|
|
168
|
-
Background information about your project that helps AI understand your codebase.
|
|
169
|
-
|
|
170
|
-
```markdown
|
|
171
|
-
---
|
|
172
|
-
priority: medium
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
# Project Architecture
|
|
176
|
-
|
|
177
|
-
This project uses microservices architecture:
|
|
178
|
-
- API Gateway (port 8080)
|
|
179
|
-
- Auth Service (port 8081)
|
|
180
|
-
- Database: PostgreSQL 15
|
|
80
|
+
- Never commit credentials
|
|
81
|
+
- Use environment variables for secrets
|
|
82
|
+
- Sanitize all user input
|
|
181
83
|
```
|
|
182
84
|
|
|
183
|
-
**
|
|
184
|
-
|
|
185
|
-
Specialized AI agent configurations for specific tasks. Each skill creates a focused agent with access to all project rules and context.
|
|
186
|
-
|
|
85
|
+
**Context** - What AI should know:
|
|
187
86
|
```markdown
|
|
188
87
|
---
|
|
189
|
-
name: database-expert
|
|
190
|
-
description: PostgreSQL optimization specialist
|
|
191
88
|
priority: high
|
|
192
89
|
---
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
90
|
+
# Architecture
|
|
91
|
+
This is a microservices app:
|
|
92
|
+
- API Gateway (Go, port 8080)
|
|
93
|
+
- Auth Service (Go, port 8081)
|
|
94
|
+
- PostgreSQL 15
|
|
198
95
|
```
|
|
199
96
|
|
|
200
|
-
**
|
|
201
|
-
|
|
202
|
-
Agent prompt files used by tools that support agent-specific instructions.
|
|
203
|
-
|
|
97
|
+
**Commands** - Slash commands across tools:
|
|
204
98
|
```markdown
|
|
205
99
|
---
|
|
206
|
-
|
|
100
|
+
name: review
|
|
101
|
+
aliases: [r, pr-review]
|
|
102
|
+
targets: [claude, cursor, continue-dev]
|
|
207
103
|
---
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
104
|
+
# Code Review
|
|
105
|
+
Review the current PR for:
|
|
106
|
+
1. Logic errors
|
|
107
|
+
2. Security issues
|
|
108
|
+
3. Performance problems
|
|
212
109
|
```
|
|
213
110
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
### 4. Generate Tool Configurations
|
|
111
|
+
## Installation
|
|
217
112
|
|
|
113
|
+
**No install required:**
|
|
218
114
|
```bash
|
|
219
|
-
ai-rulez
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
This creates native configuration files for each preset you specified.
|
|
223
|
-
|
|
224
|
-
<details>
|
|
225
|
-
<summary>What Gets Generated - Detailed Output Structure</summary>
|
|
226
|
-
|
|
227
|
-
### Claude Preset
|
|
228
|
-
|
|
229
|
-
Generates a structured directory with skills and agents:
|
|
230
|
-
|
|
231
|
-
```
|
|
232
|
-
.claude/
|
|
233
|
-
├── skills/
|
|
234
|
-
│ └── {skill-id}/
|
|
235
|
-
│ └── SKILL.md # Skill with embedded rules and context
|
|
236
|
-
└── agents/
|
|
237
|
-
└── {skill-id}.md # Agent file (backward compatibility)
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
Each skill file contains:
|
|
241
|
-
- Skill-specific instructions
|
|
242
|
-
- All project rules
|
|
243
|
-
- All project context
|
|
244
|
-
|
|
245
|
-
### Cursor Preset
|
|
246
|
-
|
|
247
|
-
Generates individual rule files:
|
|
248
|
-
|
|
249
|
-
```
|
|
250
|
-
.cursor/
|
|
251
|
-
└── rules/
|
|
252
|
-
├── code-quality.mdc
|
|
253
|
-
├── security.mdc
|
|
254
|
-
└── architecture.mdc
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
Each rule is a separate `.mdc` file with priority and content.
|
|
258
|
-
|
|
259
|
-
### Windsurf Preset
|
|
260
|
-
|
|
261
|
-
Generates individual rule files:
|
|
262
|
-
|
|
263
|
-
```
|
|
264
|
-
.windsurf/
|
|
265
|
-
├── code-quality.md
|
|
266
|
-
├── security.md
|
|
267
|
-
└── architecture.md
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
Each rule is a separate markdown file.
|
|
271
|
-
|
|
272
|
-
### Copilot Preset
|
|
273
|
-
|
|
274
|
-
Generates a single consolidated file:
|
|
275
|
-
|
|
276
|
-
```
|
|
277
|
-
.github/
|
|
278
|
-
└── copilot-instructions.md
|
|
115
|
+
npx ai-rulez@latest <command>
|
|
116
|
+
# or
|
|
117
|
+
uvx ai-rulez <command>
|
|
279
118
|
```
|
|
280
119
|
|
|
281
|
-
|
|
120
|
+
**Global install:**
|
|
121
|
+
```bash
|
|
122
|
+
# Homebrew
|
|
123
|
+
brew install goldziher/tap/ai-rulez
|
|
282
124
|
|
|
283
|
-
|
|
125
|
+
# npm
|
|
126
|
+
npm install -g ai-rulez
|
|
284
127
|
|
|
285
|
-
|
|
128
|
+
# pip
|
|
129
|
+
pip install ai-rulez
|
|
286
130
|
|
|
131
|
+
# Go
|
|
132
|
+
go install github.com/Goldziher/ai-rulez/cmd@latest
|
|
287
133
|
```
|
|
288
|
-
.gemini/
|
|
289
|
-
└── config.yaml
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
### MCP Preset (Auto-generated)
|
|
293
134
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
</details>
|
|
297
|
-
|
|
298
|
-
## Features
|
|
299
|
-
|
|
300
|
-
### Multi-Tool Support
|
|
301
|
-
Generate native configuration files for all major AI coding assistants from a single source of truth.
|
|
302
|
-
|
|
303
|
-
### Domain-Based Organization
|
|
304
|
-
Separate rules and context by domain (backend, frontend, QA, etc.) to keep large codebases organized.
|
|
305
|
-
|
|
306
|
-
<details>
|
|
307
|
-
<summary>Using Domains</summary>
|
|
308
|
-
|
|
309
|
-
Create domain-specific organization:
|
|
135
|
+
## CLI Reference
|
|
310
136
|
|
|
311
137
|
```bash
|
|
312
|
-
#
|
|
138
|
+
# Initialize project
|
|
139
|
+
ai-rulez init "Project Name"
|
|
313
140
|
ai-rulez init --domains backend,frontend,qa
|
|
314
141
|
|
|
315
|
-
#
|
|
316
|
-
ai-rulez
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
Directory structure:
|
|
320
|
-
|
|
321
|
-
```
|
|
322
|
-
.ai-rulez/domains/
|
|
323
|
-
├── backend/
|
|
324
|
-
│ ├── rules/
|
|
325
|
-
│ ├── context/
|
|
326
|
-
│ └── skills/
|
|
327
|
-
└── frontend/
|
|
328
|
-
├── rules/
|
|
329
|
-
├── context/
|
|
330
|
-
└── skills/
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
Configure in `config.yaml`:
|
|
334
|
-
|
|
335
|
-
```yaml
|
|
336
|
-
profiles:
|
|
337
|
-
backend: [backend, database]
|
|
338
|
-
frontend: [frontend, ui]
|
|
339
|
-
full: [backend, frontend, database, ui]
|
|
340
|
-
|
|
341
|
-
default: full
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
Generate for specific domain:
|
|
345
|
-
|
|
346
|
-
```bash
|
|
142
|
+
# Generate configs
|
|
143
|
+
ai-rulez generate
|
|
347
144
|
ai-rulez generate --profile backend
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
</details>
|
|
351
|
-
|
|
352
|
-
### Profiles
|
|
353
|
-
Define multiple profiles for different teams or use cases. Generate only the rules relevant to each context.
|
|
145
|
+
ai-rulez generate --dry-run
|
|
354
146
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
name: "My Project"
|
|
361
|
-
|
|
362
|
-
presets:
|
|
363
|
-
- claude
|
|
364
|
-
- cursor
|
|
147
|
+
# Content management
|
|
148
|
+
ai-rulez add rule security-standards --priority critical
|
|
149
|
+
ai-rulez add context api-docs
|
|
150
|
+
ai-rulez add skill database-expert
|
|
151
|
+
ai-rulez add command review-pr
|
|
365
152
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
frontend: [frontend, ui]
|
|
369
|
-
full: [backend, frontend, database, ui]
|
|
153
|
+
ai-rulez list rules
|
|
154
|
+
ai-rulez remove rule outdated-rule
|
|
370
155
|
|
|
371
|
-
|
|
372
|
-
|
|
156
|
+
# Validation
|
|
157
|
+
ai-rulez validate
|
|
373
158
|
|
|
374
|
-
|
|
159
|
+
# MCP server (for AI assistants)
|
|
160
|
+
npx ai-rulez@latest mcp
|
|
375
161
|
|
|
376
|
-
|
|
377
|
-
ai-rulez
|
|
162
|
+
# Migrate from V2
|
|
163
|
+
ai-rulez migrate v3
|
|
378
164
|
```
|
|
379
165
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
### Priority System
|
|
383
|
-
Mark rules and context with priority levels (critical, high, medium, low) to control their importance and ordering.
|
|
384
|
-
|
|
385
|
-
### Includes
|
|
386
|
-
Compose configurations from multiple sources including local paths, Git repositories, and shared rule packages.
|
|
387
|
-
|
|
388
|
-
<details>
|
|
389
|
-
<summary>Using Includes</summary>
|
|
166
|
+
## Remote Includes
|
|
390
167
|
|
|
391
|
-
|
|
168
|
+
Share rules across repositories:
|
|
392
169
|
|
|
393
170
|
```yaml
|
|
394
171
|
includes:
|
|
395
|
-
#
|
|
172
|
+
# HTTPS
|
|
396
173
|
- name: company-standards
|
|
397
174
|
source: https://github.com/company/ai-rules.git
|
|
398
175
|
ref: main
|
|
399
|
-
include:
|
|
400
|
-
- rules
|
|
401
|
-
- context
|
|
402
|
-
- skills
|
|
403
|
-
- agents
|
|
176
|
+
include: [rules, context]
|
|
404
177
|
merge_strategy: local-override
|
|
405
178
|
|
|
406
|
-
#
|
|
179
|
+
# SSH
|
|
407
180
|
- name: shared-configs
|
|
408
|
-
source: git@github.com:
|
|
409
|
-
ref:
|
|
410
|
-
include:
|
|
411
|
-
- rules
|
|
412
|
-
- context
|
|
413
|
-
merge_strategy: local-override
|
|
181
|
+
source: git@github.com:org/shared-ai-rulez.git
|
|
182
|
+
ref: v2.0.0
|
|
183
|
+
include: [rules, skills]
|
|
414
184
|
|
|
415
|
-
# Local
|
|
185
|
+
# Local path
|
|
416
186
|
- name: local-standards
|
|
417
187
|
source: ../shared-rules
|
|
418
|
-
include:
|
|
419
|
-
- rules
|
|
420
|
-
- skills
|
|
421
|
-
merge_strategy: local-override
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
**Supported Git URL formats:**
|
|
425
|
-
- HTTPS: `https://github.com/owner/repo.git`
|
|
426
|
-
- SSH: `git@github.com:owner/repo.git`
|
|
427
|
-
- SSH protocol: `ssh://git@github.com/owner/repo.git`
|
|
428
|
-
|
|
429
|
-
**Include options:**
|
|
430
|
-
- `include`: List of content types to fetch (`rules`, `context`, `skills`, `agents`)
|
|
431
|
-
- `merge_strategy`: How to handle conflicts (`local-override`, `remote-override`)
|
|
432
|
-
- `ref`: Branch, tag, or commit SHA
|
|
433
|
-
|
|
434
|
-
**Authenticating to Private Repositories:**
|
|
435
|
-
|
|
436
|
-
When including rules from private Git repositories, you can provide an access token for authentication:
|
|
437
|
-
|
|
438
|
-
```bash
|
|
439
|
-
# Using environment variable (recommended for CI/CD)
|
|
440
|
-
export AI_RULEZ_GIT_TOKEN="ghp_your_github_token_here"
|
|
441
|
-
ai-rulez generate
|
|
442
|
-
|
|
443
|
-
# Using CLI flag
|
|
444
|
-
ai-rulez generate --token "ghp_your_github_token_here"
|
|
188
|
+
include: [rules]
|
|
445
189
|
```
|
|
446
190
|
|
|
447
|
-
|
|
191
|
+
Private repos use `AI_RULEZ_GIT_TOKEN` environment variable or `--token` flag.
|
|
448
192
|
|
|
449
|
-
|
|
450
|
-
- Required scope: `repo` (for private repositories)
|
|
451
|
-
- **GitLab**: Settings → Access Tokens → Add new token
|
|
452
|
-
- Required scope: `read_repository`
|
|
193
|
+
## Generated Output
|
|
453
194
|
|
|
454
|
-
|
|
455
|
-
- Never commit tokens to your repository
|
|
456
|
-
- Use environment variables in CI/CD pipelines
|
|
457
|
-
- Store tokens in secure secret management systems
|
|
458
|
-
- Rotate tokens regularly
|
|
459
|
-
- Use tokens with minimal required permissions
|
|
195
|
+
Running `ai-rulez generate` creates:
|
|
460
196
|
|
|
461
|
-
|
|
197
|
+
| Preset | Output |
|
|
198
|
+
|--------|--------|
|
|
199
|
+
| Claude | `CLAUDE.md` + `.claude/skills/` + `.claude/agents/` |
|
|
200
|
+
| Cursor | `.cursor/rules/*.mdc` |
|
|
201
|
+
| Windsurf | `.windsurf/*.md` |
|
|
202
|
+
| Copilot | `.github/copilot-instructions.md` |
|
|
203
|
+
| Gemini | `.gemini/config.yaml` |
|
|
204
|
+
| Continue.dev | `.continue/prompts/ai_rulez_prompts.yaml` |
|
|
205
|
+
| Cline | `.cline/rules/*.md` |
|
|
206
|
+
| Custom | Any path with markdown, JSON, or directory output |
|
|
462
207
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
### MCP Server Integration
|
|
466
|
-
Configure Model Context Protocol servers that extend AI assistant capabilities with external tools and data sources.
|
|
467
|
-
|
|
468
|
-
<details>
|
|
469
|
-
<summary>MCP Configuration</summary>
|
|
470
|
-
|
|
471
|
-
Configure MCP servers in `.ai-rulez/mcp.yaml`:
|
|
472
|
-
|
|
473
|
-
```yaml
|
|
474
|
-
version: "3.0"
|
|
475
|
-
|
|
476
|
-
mcp_servers:
|
|
477
|
-
- name: ai-rulez
|
|
478
|
-
description: AI-Rulez MCP server for configuration management
|
|
479
|
-
command: npx
|
|
480
|
-
args:
|
|
481
|
-
- "-y"
|
|
482
|
-
- "ai-rulez@latest"
|
|
483
|
-
- "mcp"
|
|
484
|
-
transport: stdio
|
|
485
|
-
enabled: true
|
|
486
|
-
|
|
487
|
-
- name: github
|
|
488
|
-
description: GitHub integration
|
|
489
|
-
command: npx
|
|
490
|
-
args:
|
|
491
|
-
- "-y"
|
|
492
|
-
- "@modelcontextprotocol/server-github"
|
|
493
|
-
env:
|
|
494
|
-
GITHUB_PERSONAL_ACCESS_TOKEN: "${GITHUB_TOKEN}"
|
|
495
|
-
transport: stdio
|
|
496
|
-
enabled: true
|
|
497
|
-
```
|
|
498
|
-
|
|
499
|
-
MCP servers can also be domain-specific. See the [MCP documentation](https://goldziher.github.io/ai-rulez/mcp-server/) for details.
|
|
500
|
-
|
|
501
|
-
</details>
|
|
502
|
-
|
|
503
|
-
### Import from Existing Tools
|
|
504
|
-
Migrate from existing tool-specific configurations.
|
|
505
|
-
|
|
506
|
-
<details>
|
|
507
|
-
<summary>Import Options</summary>
|
|
508
|
-
|
|
509
|
-
```bash
|
|
510
|
-
# Auto-detect existing configs
|
|
511
|
-
ai-rulez init --from auto
|
|
512
|
-
|
|
513
|
-
# Import specific files
|
|
514
|
-
ai-rulez init --from .cursorrules,CLAUDE.md
|
|
515
|
-
|
|
516
|
-
# Import from multiple sources
|
|
517
|
-
ai-rulez init --from .cursorrules,.windsurfrules
|
|
518
|
-
```
|
|
519
|
-
|
|
520
|
-
</details>
|
|
521
|
-
|
|
522
|
-
### Monorepo Support
|
|
523
|
-
Generate configurations recursively for multiple projects.
|
|
524
|
-
|
|
525
|
-
<details>
|
|
526
|
-
<summary>Recursive Generation</summary>
|
|
208
|
+
## Use Cases
|
|
527
209
|
|
|
210
|
+
**Monorepo**: Generate configs for multiple packages
|
|
528
211
|
```bash
|
|
529
212
|
ai-rulez generate --recursive
|
|
530
213
|
```
|
|
531
214
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
</details>
|
|
535
|
-
|
|
536
|
-
### Git Hook Integration
|
|
537
|
-
Automatically validate your AI rules configuration on commit.
|
|
538
|
-
|
|
539
|
-
<details>
|
|
540
|
-
<summary>Git Hooks Setup</summary>
|
|
541
|
-
|
|
215
|
+
**Team profiles**: Different rules for different teams
|
|
542
216
|
```bash
|
|
543
|
-
ai-rulez
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
Supports:
|
|
547
|
-
- lefthook
|
|
548
|
-
- pre-commit
|
|
549
|
-
- husky
|
|
550
|
-
|
|
551
|
-
Automatically detects your git hook manager and configures validation.
|
|
552
|
-
|
|
553
|
-
</details>
|
|
554
|
-
|
|
555
|
-
### CLI Management
|
|
556
|
-
Full CRUD operations for managing your configuration programmatically.
|
|
557
|
-
|
|
558
|
-
<details>
|
|
559
|
-
<summary>CLI Commands Reference</summary>
|
|
560
|
-
|
|
561
|
-
**Add Content:**
|
|
562
|
-
```bash
|
|
563
|
-
ai-rulez add rule security-standards --priority critical
|
|
564
|
-
ai-rulez add context api-endpoints
|
|
565
|
-
ai-rulez add skill test-engineer
|
|
566
|
-
ai-rulez add domain backend
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
**List Content:**
|
|
570
|
-
```bash
|
|
571
|
-
ai-rulez list rules
|
|
572
|
-
ai-rulez list context
|
|
573
|
-
ai-rulez list skills
|
|
574
|
-
ai-rulez list domains
|
|
575
|
-
```
|
|
576
|
-
|
|
577
|
-
**Remove Content:**
|
|
578
|
-
```bash
|
|
579
|
-
ai-rulez remove rule outdated-rule
|
|
580
|
-
ai-rulez remove domain legacy
|
|
581
|
-
```
|
|
582
|
-
|
|
583
|
-
**Validation:**
|
|
584
|
-
```bash
|
|
585
|
-
ai-rulez validate
|
|
586
|
-
```
|
|
587
|
-
|
|
588
|
-
**MCP Server:**
|
|
589
|
-
```bash
|
|
590
|
-
npx ai-rulez@latest mcp
|
|
591
|
-
# or
|
|
592
|
-
uvx ai-rulez mcp
|
|
593
|
-
```
|
|
594
|
-
|
|
595
|
-
Configure in your AI assistant's MCP settings to enable direct management of your AI rules.
|
|
596
|
-
|
|
597
|
-
</details>
|
|
598
|
-
|
|
599
|
-
### Migration from V2
|
|
600
|
-
Migrate from older ai-rulez V2 configurations to the new V3 directory-based structure.
|
|
601
|
-
|
|
602
|
-
<details>
|
|
603
|
-
<summary>Migration Guide</summary>
|
|
604
|
-
|
|
605
|
-
```bash
|
|
606
|
-
# Auto-detect V2 config and migrate
|
|
607
|
-
ai-rulez migrate v3
|
|
608
|
-
|
|
609
|
-
# Specify config file
|
|
610
|
-
ai-rulez migrate v3 ai-rulez.yaml
|
|
611
|
-
|
|
612
|
-
# Preview migration without writing files
|
|
613
|
-
ai-rulez migrate v3 --dry-run
|
|
614
|
-
|
|
615
|
-
# Force migration if .ai-rulez exists (creates backup)
|
|
616
|
-
ai-rulez migrate v3 --force
|
|
217
|
+
ai-rulez generate --profile backend
|
|
218
|
+
ai-rulez generate --profile frontend
|
|
617
219
|
```
|
|
618
220
|
|
|
619
|
-
|
|
620
|
-
- Converts your V2 `ai-rulez.yaml` to the new `.ai-rulez/` directory structure
|
|
621
|
-
- Preserves all rules, context, and configuration
|
|
622
|
-
- Creates timestamped backups when using `--force`
|
|
623
|
-
- Validates the migration automatically
|
|
624
|
-
|
|
625
|
-
</details>
|
|
626
|
-
|
|
627
|
-
## Example Workflows
|
|
628
|
-
|
|
629
|
-
<details>
|
|
630
|
-
<summary>Start a New Project</summary>
|
|
631
|
-
|
|
221
|
+
**CI validation**: Ensure configs stay in sync
|
|
632
222
|
```bash
|
|
633
|
-
|
|
634
|
-
ai-rulez init "My API" --domains backend,frontend,qa
|
|
635
|
-
|
|
636
|
-
# Edit .ai-rulez/config.yaml and add your presets
|
|
637
|
-
# Add project-specific rules
|
|
638
|
-
ai-rulez add rule api-standards --priority high
|
|
639
|
-
|
|
640
|
-
# Generate configs for all tools
|
|
641
|
-
ai-rulez generate
|
|
223
|
+
ai-rulez validate && ai-rulez generate --dry-run
|
|
642
224
|
```
|
|
643
225
|
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
<details>
|
|
647
|
-
<summary>Migrate from Existing Configs</summary>
|
|
648
|
-
|
|
226
|
+
**Import existing configs**: Migrate from tool-specific files
|
|
649
227
|
```bash
|
|
650
|
-
# Import your existing configs
|
|
651
228
|
ai-rulez init --from auto
|
|
652
|
-
|
|
653
|
-
# Review the imported content
|
|
654
|
-
ls .ai-rulez/rules/
|
|
655
|
-
|
|
656
|
-
# Add more presets to config.yaml
|
|
657
|
-
# Then regenerate
|
|
658
|
-
ai-rulez generate
|
|
229
|
+
ai-rulez init --from .cursorrules,CLAUDE.md
|
|
659
230
|
```
|
|
660
231
|
|
|
661
|
-
|
|
232
|
+
## MCP Server
|
|
662
233
|
|
|
663
|
-
|
|
664
|
-
<summary>Team-Specific Profiles</summary>
|
|
234
|
+
Let AI assistants manage rules directly:
|
|
665
235
|
|
|
666
|
-
```
|
|
667
|
-
#
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
# Frontend team generates their config
|
|
676
|
-
ai-rulez generate --profile frontend
|
|
236
|
+
```yaml
|
|
237
|
+
# .ai-rulez/mcp.yaml
|
|
238
|
+
version: "3.0"
|
|
239
|
+
mcp_servers:
|
|
240
|
+
- name: ai-rulez
|
|
241
|
+
command: npx
|
|
242
|
+
args: ["-y", "ai-rulez@latest", "mcp"]
|
|
243
|
+
transport: stdio
|
|
244
|
+
enabled: true
|
|
677
245
|
```
|
|
678
246
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
<details>
|
|
682
|
-
<summary>Monorepo with Multiple Projects</summary>
|
|
247
|
+
The MCP server exposes CRUD operations, validation, and generation to AI assistants.
|
|
683
248
|
|
|
684
|
-
|
|
685
|
-
# Initialize in each project subdirectory
|
|
686
|
-
cd packages/api
|
|
687
|
-
ai-rulez init "API Service" --domains backend
|
|
249
|
+
## Compression
|
|
688
250
|
|
|
689
|
-
|
|
690
|
-
ai-rulez init "Web App" --domains frontend
|
|
251
|
+
Reduce context size for token-constrained tools:
|
|
691
252
|
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
253
|
+
```yaml
|
|
254
|
+
compression:
|
|
255
|
+
level: standard # none, minimal, standard, aggressive
|
|
695
256
|
```
|
|
696
257
|
|
|
697
|
-
|
|
258
|
+
At `standard` level, output is ~34% smaller through whitespace optimization and duplicate removal.
|
|
698
259
|
|
|
699
260
|
## Documentation
|
|
700
261
|
|
|
701
|
-
Full documentation is available at https://goldziher.github.io/ai-rulez/
|
|
702
|
-
|
|
703
|
-
Key topics:
|
|
704
262
|
- [Configuration Reference](https://goldziher.github.io/ai-rulez/configuration/)
|
|
705
|
-
- [
|
|
706
|
-
- [
|
|
707
|
-
- [MCP Server
|
|
708
|
-
- [Includes and Composition](https://goldziher.github.io/ai-rulez/includes/)
|
|
709
|
-
- [Monorepo Usage](https://goldziher.github.io/ai-rulez/monorepo/)
|
|
263
|
+
- [Domains & Profiles](https://goldziher.github.io/ai-rulez/domains/)
|
|
264
|
+
- [Remote Includes](https://goldziher.github.io/ai-rulez/includes/)
|
|
265
|
+
- [MCP Server](https://goldziher.github.io/ai-rulez/mcp-server/)
|
|
710
266
|
- [Schema Validation](https://goldziher.github.io/ai-rulez/schema/)
|
|
267
|
+
- [Migration Guide](https://goldziher.github.io/ai-rulez/migration/)
|
|
711
268
|
|
|
712
269
|
## Contributing
|
|
713
270
|
|
|
714
|
-
Contributions
|
|
271
|
+
Contributions welcome. See [CONTRIBUTING.md](https://github.com/Goldziher/ai-rulez/blob/main/CONTRIBUTING.md).
|
|
715
272
|
|
|
716
273
|
## License
|
|
717
274
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-rulez",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "⚡ One config to rule them all. Centralized AI assistant configuration management - generate rules for Claude, Cursor, Copilot, Windsurf and more from a single YAML file.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|