ai-rulez 1.0.0-rc8 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +206 -28
  2. package/package.json +51 -8
package/README.md CHANGED
@@ -1,61 +1,239 @@
1
- # ai-rulez
1
+ # ai-rulez
2
2
 
3
- CLI tool for managing AI assistant rules across Claude, Cursor, Windsurf and other AI-powered development environments.
3
+ > **Lightning-fast CLI tool (written in Go) for managing AI assistant rules**
4
4
 
5
- This npm package provides the `ai-rulez` command-line tool, which is written in Go for optimal performance and distributed as platform-specific binaries.
5
+ Generate configuration files for Claude, Cursor, Windsurf, and other AI assistants from a single, centralized configuration.
6
6
 
7
- ## Installation
7
+ ## 🚀 Features
8
+
9
+ - ⚡ **Blazing Fast**: Written in Go for maximum performance
10
+ - 🔧 **Multi-Assistant Support**: Generate configs for Claude (CLAUDE.md), Cursor (.cursorrules), Windsurf (.windsurfrules), and more
11
+ - 📝 **Single Source of Truth**: Maintain all your AI rules in one YAML configuration
12
+ - 🎯 **Smart Templates**: Built-in templates with custom template support
13
+ - 🔍 **Validation**: Comprehensive configuration validation
14
+ - 🔄 **Git Integration**: Perfect for pre-commit hooks and CI/CD
15
+ - 📦 **Node.js Integration**: Easy installation via npm
16
+
17
+ ## 📦 Installation
18
+
19
+ ### npm (Recommended)
8
20
 
9
21
  ```bash
22
+ # Global installation
10
23
  npm install -g ai-rulez
24
+
25
+ # Local project installation
26
+ npm install --save-dev ai-rulez
11
27
  ```
12
28
 
13
- The package will automatically download the appropriate binary for your platform during installation.
29
+ The npm package automatically downloads and manages the Go binary for your platform.
14
30
 
15
- ## Usage
31
+ ### Other Installation Methods
16
32
 
17
- Create an `ai_rules.yaml` configuration file in your project:
33
+ - **pip**: `pip install ai-rulez`
34
+ - **Go**: `go install github.com/Goldziher/ai-rulez@latest`
35
+ - **Homebrew**: `brew install goldziher/tap/ai-rulez` *(coming soon)*
36
+ - **Direct Download**: Download from [GitHub Releases](https://github.com/Goldziher/ai-rulez/releases)
37
+
38
+ ## 🎯 Quick Start
39
+
40
+ 1. **Create a configuration file** (`ai-rulez.yaml`):
18
41
 
19
42
  ```yaml
20
43
  metadata:
21
- name: my-project
22
- version: 1.0.0
44
+ name: "My AI Rules"
45
+ version: "1.0.0"
23
46
 
24
47
  rules:
25
- - name: code-style
26
- content: Follow the project's established coding conventions
27
- - name: testing
28
- content: Write comprehensive tests for all new features
48
+ - name: "Code Style"
49
+ priority: 10
50
+ content: |
51
+ - Use TypeScript strict mode
52
+ - Prefer functional components
53
+ - Use meaningful variable names
54
+
55
+ - name: "Testing"
56
+ priority: 5
57
+ content: |
58
+ - Write unit tests for all functions
59
+ - Use describe/it pattern
60
+ - Aim for 80% code coverage
29
61
 
30
62
  outputs:
31
- - file: .cursorrules
32
- - file: CLAUDE.md
63
+ - file: "CLAUDE.md"
64
+ template: "claude"
65
+ - file: ".cursorrules"
66
+ template: "cursor"
67
+ - file: ".windsurfrules"
68
+ template: "windsurf"
69
+ ```
70
+
71
+ 2. **Generate configuration files**:
72
+
73
+ ```bash
74
+ ai-rulez generate
33
75
  ```
34
76
 
35
- Then generate your AI assistant configuration files:
77
+ This creates `CLAUDE.md`, `.cursorrules`, and `.windsurfrules` with your rules properly formatted for each AI assistant.
78
+
79
+ ## 🛠️ Commands
36
80
 
37
81
  ```bash
38
- # Generate files
82
+ # Generate all configuration files
39
83
  ai-rulez generate
40
84
 
41
85
  # Validate configuration
42
86
  ai-rulez validate
43
87
 
44
- # Initialize a new configuration
45
- ai-rulez init
88
+ # Generate recursively in subdirectories
89
+ ai-rulez generate --recursive
90
+
91
+ # Preview output without writing files
92
+ ai-rulez generate --dry-run
93
+
94
+ # Show help
95
+ ai-rulez --help
46
96
  ```
47
97
 
48
- ## Platform Support
98
+ ## 🔄 Git Integration
99
+
100
+ ### Pre-commit Hook
101
+
102
+ Add to your `.pre-commit-config.yaml`:
103
+
104
+ ```yaml
105
+ repos:
106
+ - repo: https://github.com/Goldziher/ai-rulez
107
+ rev: v1.0.0
108
+ hooks:
109
+ - id: ai-rulez-generate
110
+ ```
111
+
112
+ ### Lefthook
113
+
114
+ Add to your `lefthook.yml`:
115
+
116
+ ```yaml
117
+ pre-commit:
118
+ commands:
119
+ ai-rulez:
120
+ run: ai-rulez generate
121
+ files: git diff --cached --name-only
122
+ glob: "*.{ai-rulez,ai_rulez}.{yml,yaml}"
123
+ ```
124
+
125
+ ### npm Scripts
126
+
127
+ Add to your `package.json`:
128
+
129
+ ```json
130
+ {
131
+ "scripts": {
132
+ "ai-rulez": "ai-rulez generate",
133
+ "ai-rulez:validate": "ai-rulez validate",
134
+ "ai-rulez:watch": "ai-rulez generate --recursive"
135
+ }
136
+ }
137
+ ```
138
+
139
+ ## 📚 Configuration
140
+
141
+ The tool looks for configuration files in this order:
142
+ - `.ai-rulez.yaml`
143
+ - `ai-rulez.yaml`
144
+ - `.ai_rulez.yaml`
145
+ - `ai_rulez.yaml`
146
+
147
+ ### Configuration Schema
148
+
149
+ ```yaml
150
+ metadata:
151
+ name: string # Required: Project name
152
+ version: string # Required: Version
153
+ description: string # Optional: Description
154
+
155
+ rules:
156
+ - name: string # Required: Rule name
157
+ priority: number # Required: Priority (1-10)
158
+ content: string # Required: Rule content
159
+
160
+ sections: # Optional: Organize rules into sections
161
+ - title: string # Required: Section title
162
+ priority: number # Required: Section priority
163
+ content: string # Required: Section content
164
+
165
+ outputs: # Required: At least one output
166
+ - file: string # Required: Output filename
167
+ template: string # Required: Template name or path
168
+
169
+ includes: # Optional: Include other config files
170
+ - path/to/other.yaml
171
+ ```
172
+
173
+ ## 🎨 Templates
174
+
175
+ Built-in templates:
176
+ - `claude` - CLAUDE.md format
177
+ - `cursor` - .cursorrules format
178
+ - `windsurf` - .windsurfrules format
179
+ - `default` - Generic format
180
+
181
+ Custom templates use Go template syntax with access to `.Rules`, `.Sections`, `.Metadata`, etc.
182
+
183
+ ## 🔧 Advanced Usage
184
+
185
+ ### Environment Variables
186
+
187
+ - `AI_RULEZ_CONFIG` - Override config file path
188
+ - `AI_RULEZ_DEBUG` - Enable debug output
189
+
190
+ ### Node.js API
191
+
192
+ ```javascript
193
+ const { execSync } = require('child_process');
194
+
195
+ // Run ai-rulez programmatically
196
+ try {
197
+ const output = execSync('ai-rulez generate --dry-run', { encoding: 'utf8' });
198
+ console.log(output);
199
+ } catch (error) {
200
+ console.error('ai-rulez failed:', error.message);
201
+ }
202
+ ```
203
+
204
+ ### npm Scripts Integration
205
+
206
+ ```json
207
+ {
208
+ "scripts": {
209
+ "precommit": "ai-rulez generate",
210
+ "lint": "eslint . && ai-rulez validate",
211
+ "build": "npm run ai-rulez && npm run compile"
212
+ },
213
+ "husky": {
214
+ "hooks": {
215
+ "pre-commit": "ai-rulez generate"
216
+ }
217
+ }
218
+ }
219
+ ```
220
+
221
+ ## 🤝 Contributing
222
+
223
+ Contributions are welcome! Please see our [Contributing Guide](https://github.com/Goldziher/ai-rulez/blob/main/CONTRIBUTING.md).
224
+
225
+ ## 📄 License
49
226
 
50
- Pre-built binaries are available for:
51
- - macOS (Intel and Apple Silicon)
52
- - Linux (x64, ARM64, and x86)
53
- - Windows (x64 and x86)
227
+ MIT License - see [LICENSE](https://github.com/Goldziher/ai-rulez/blob/main/LICENSE)
54
228
 
55
- ## Documentation
229
+ ## 🔗 Links
56
230
 
57
- For complete documentation, examples, and source code, visit the [GitHub repository](https://github.com/Goldziher/ai-rulez).
231
+ - [GitHub Repository](https://github.com/Goldziher/ai-rulez)
232
+ - [Documentation](https://github.com/Goldziher/ai-rulez#readme)
233
+ - [Issues](https://github.com/Goldziher/ai-rulez/issues)
234
+ - [Releases](https://github.com/Goldziher/ai-rulez/releases)
235
+ - [PyPI Package](https://pypi.org/project/ai-rulez/)
58
236
 
59
- ## License
237
+ ---
60
238
 
61
- MIT
239
+ **Note**: This npm package is a wrapper around the Go binary. The actual tool is written in Go for maximum performance and cross-platform compatibility.
package/package.json CHANGED
@@ -1,18 +1,51 @@
1
1
  {
2
2
  "name": "ai-rulez",
3
- "version": "1.0.0-rc8",
4
- "description": "CLI tool for managing AI assistant rules - generate configuration files for Claude, Cursor, Windsurf and more",
5
- "keywords": ["ai", "rules", "configuration", "claude", "cursor", "windsurf", "cli", "assistant", "copilot", "generator"],
3
+ "version": "1.0.0",
4
+ "description": "⚡ Lightning-fast CLI tool (written in Go) for managing AI assistant rules - generate configuration files for Claude, Cursor, Windsurf and more",
5
+ "keywords": [
6
+ "ai",
7
+ "ai-assistant",
8
+ "ai-rules",
9
+ "claude",
10
+ "cursor",
11
+ "windsurf",
12
+ "codeium",
13
+ "copilot",
14
+ "cli",
15
+ "cli-tool",
16
+ "configuration",
17
+ "config",
18
+ "rules",
19
+ "generator",
20
+ "golang",
21
+ "go",
22
+ "fast",
23
+ "development",
24
+ "developer-tools",
25
+ "automation",
26
+ "workflow",
27
+ "productivity",
28
+ "pre-commit",
29
+ "git-hooks",
30
+ "lefthook",
31
+ "code-generation",
32
+ "ai-development",
33
+ "assistant-configuration"
34
+ ],
6
35
  "repository": {
7
36
  "type": "git",
8
- "url": "https://github.com/Goldziher/ai-rulez"
37
+ "url": "https://github.com/Goldziher/ai-rulez.git"
9
38
  },
10
- "homepage": "https://github.com/Goldziher/ai-rulez",
39
+ "homepage": "https://github.com/Goldziher/ai-rulez#readme",
11
40
  "bugs": {
12
41
  "url": "https://github.com/Goldziher/ai-rulez/issues"
13
42
  },
14
43
  "license": "MIT",
15
- "author": "Na'aman Hirschfeld <nhirschfeld@gmail.com>",
44
+ "author": {
45
+ "name": "Na'aman Hirschfeld",
46
+ "email": "nhirschfeld@gmail.com",
47
+ "url": "https://github.com/Goldziher"
48
+ },
16
49
  "bin": {
17
50
  "ai-rulez": "./bin/ai-rulez"
18
51
  },
@@ -21,10 +54,20 @@
21
54
  },
22
55
  "files": [
23
56
  "bin",
24
- "install.js",
57
+ "install.js",
25
58
  "README.md"
26
59
  ],
27
60
  "engines": {
28
61
  "node": ">=14.0.0"
29
- }
62
+ },
63
+ "os": [
64
+ "darwin",
65
+ "linux",
66
+ "win32"
67
+ ],
68
+ "cpu": [
69
+ "x64",
70
+ "arm64",
71
+ "ia32"
72
+ ]
30
73
  }