rulesync 0.56.0 → 0.58.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 (5) hide show
  1. package/README.ja.md +173 -20
  2. package/README.md +67 -699
  3. package/dist/index.cjs +464 -213
  4. package/dist/index.js +464 -213
  5. package/package.json +19 -19
package/README.md CHANGED
@@ -7,22 +7,6 @@ A Node.js CLI tool that automatically generates configuration files for various
7
7
 
8
8
  **English** | [日本語](./README.ja.md)
9
9
 
10
- ## Supported Tools
11
-
12
- rulesync supports both **generation** and **import** for the following AI development tools:
13
-
14
- - **GitHub Copilot Custom Instructions** (`.github/copilot-instructions.md` + `.github/instructions/*.instructions.md`)
15
- - **Cursor Project Rules** (`.cursor/rules/*.mdc` + `.cursorrules`)
16
- - **Cline Rules** (`.clinerules/*.md` + `.cline/instructions.md`)
17
- - **Claude Code Memory** (`./CLAUDE.md` + `.claude/memories/*.md`)
18
- - **OpenAI Codex CLI** (`codex.md` + `.codex/mcp-config.json` + `.codexignore`)
19
- - **AugmentCode Rules** (`.augment/rules/*.md`)
20
- - **Roo Code Rules** (`.roo/rules/*.md` + `.roo/instructions.md`)
21
- - **Gemini CLI** (`GEMINI.md` + `.gemini/memories/*.md`)
22
- - **JetBrains Junie Guidelines** (`.junie/guidelines.md`)
23
- - **Kiro IDE Custom Steering Documents** (`.kiro/steering/*.md`) + **AI Ignore Files** (`.aiignore`)
24
- - **Windsurf AI Code Editor** (`.windsurf/rules/*.md` + `.windsurf/mcp.json` + `.codeiumignore`)
25
-
26
10
  ## Installation
27
11
 
28
12
  ```bash
@@ -43,49 +27,41 @@ yarn global add rulesync
43
27
  ```
44
28
 
45
29
  2. **Edit the generated rule files** in `.rulesync/` directory to match your project needs
46
-
47
- Or add new rule files:
48
- ```bash
49
- npx rulesync add my-custom-rules
50
- ```
51
30
 
52
31
  3. **Generate tool-specific configuration files:**
53
32
  ```bash
54
33
  npx rulesync generate
55
34
  ```
56
35
 
57
- 4. **Optional: Add generated files to .gitignore:**
58
- ```bash
59
- npx rulesync gitignore
60
- ```
36
+ ### Existing Project
61
37
 
62
- ### Existing Project with AI Tool Configurations
38
+ If you already have AI tool configurations:
63
39
 
64
- If you already have AI tool configurations, you can import them into rulesync format:
40
+ ```bash
41
+ # Import existing configurations
42
+ npx rulesync import --claudecode # From CLAUDE.md
43
+ npx rulesync import --cursor # From .cursorrules
44
+ npx rulesync import --copilot # From .github/copilot-instructions.md
65
45
 
66
- 1. **Import existing configurations:**
67
- ```bash
68
- # Import from specific tools (only one tool can be specified at a time)
69
- npx rulesync import --claudecode # From CLAUDE.md and .claude/memories/*.md
70
- npx rulesync import --cursor # From .cursorrules and .cursor/rules/*.mdc
71
- npx rulesync import --copilot # From .github/copilot-instructions.md
72
- npx rulesync import --cline # From .cline/instructions.md
73
- npx rulesync import --augmentcode # From .augment/rules/*.md
74
- npx rulesync import --augmentcode-legacy # From .augment-guidelines (legacy format)
75
- npx rulesync import --roo # From .roo/instructions.md
76
- npx rulesync import --geminicli # From GEMINI.md and .gemini/memories/*.md
77
- npx rulesync import --junie # From .junie/guidelines.md
78
- npx rulesync import --windsurf # From .windsurf/rules/*.md
79
- ```
46
+ # Generate unified configurations
47
+ npx rulesync generate
48
+ ```
80
49
 
81
- 2. **Review and edit** the imported rules in `.rulesync/` directory
50
+ ## Supported Tools
82
51
 
83
- 3. **Generate unified configurations:**
84
- ```bash
85
- npx rulesync generate
86
- ```
52
+ rulesync supports both **generation** and **import** for the following AI development tools:
87
53
 
88
- That's it! Your AI coding assistants will now use the generated configuration files automatically.
54
+ - **GitHub Copilot Custom Instructions** (`.github/copilot-instructions.md` + `.github/instructions/*.instructions.md`)
55
+ - **Cursor Project Rules** (`.cursor/rules/*.mdc` + `.cursorrules`)
56
+ - **Cline Rules** (`.clinerules/*.md` + `.cline/instructions.md`)
57
+ - **Claude Code Memory** (`./CLAUDE.md` + `.claude/memories/*.md` + **Custom Slash Commands** `.claude/commands/*.md`)
58
+ - **OpenAI Codex CLI** (`codex.md` + `.codex/mcp-config.json` + `.codexignore`)
59
+ - **AugmentCode Rules** (`.augment/rules/*.md`)
60
+ - **Roo Code Rules** (`.roo/rules/*.md` + `.roo/instructions.md`)
61
+ - **Gemini CLI** (`GEMINI.md` + `.gemini/memories/*.md` + **Custom Slash Commands** `.gemini/commands/*.md`)
62
+ - **JetBrains Junie Guidelines** (`.junie/guidelines.md`)
63
+ - **Kiro IDE Custom Steering Documents** (`.kiro/steering/*.md`) + **AI Ignore Files** (`.aiignore`)
64
+ - **Windsurf AI Code Editor** (`.windsurf/rules/*.md` + `.windsurf/mcp.json` + `.codeiumignore`)
89
65
 
90
66
  ## Why rulesync?
91
67
 
@@ -101,681 +77,73 @@ Enable hybrid development workflows combining multiple AI tools:
101
77
  - Cursor for refactoring
102
78
  - Claude Code for architecture design
103
79
  - Cline for debugging assistance
104
- - OpenAI Codex CLI for GPT-4 powered development
105
- - Gemini CLI for intelligent code analysis
106
- - JetBrains Junie for autonomous AI coding
107
- - Windsurf for comprehensive AI-assisted editing with Cascade AI
80
+ - Windsurf for comprehensive AI-assisted editing
108
81
 
109
82
  ### 🔓 **No Vendor Lock-in**
110
- Avoid vendor lock-in completely. If you decide to stop using rulesync, you can continue using the generated rule files (`.github/instructions/`, `.cursor/rules/`, `.clinerules/`, `CLAUDE.md`, `codex.md`, `GEMINI.md`, `.junie/guidelines.md`, `.windsurf/rules/`, etc.) as-is.
83
+ Avoid vendor lock-in completely. If you decide to stop using rulesync, you can continue using the generated rule files as-is.
111
84
 
112
85
  ### 🎯 **Consistency Across Tools**
113
86
  Apply consistent rules across all AI tools, improving code quality and development experience for the entire team.
114
87
 
115
- ## Kiro IDE Integration
116
-
117
- ### Custom Steering Documents and AI Ignore Files
118
-
119
- rulesync supports **Custom Steering Documents** and **AI Ignore Files** for Kiro IDE, complementing Kiro's built-in project management system.
120
-
121
- **Important**: rulesync does NOT generate the core steering files (`product.md`, `structure.md`, `tech.md`) as these are better managed directly by Kiro IDE itself. Instead, rulesync focuses on generating additional custom steering documents and AI-specific ignore files.
122
-
123
- ### What rulesync provides for Kiro:
124
- - **Custom steering documents**: Additional `.md` files in `.kiro/steering/` directory
125
- - **AI ignore files**: `.aiignore` file for excluding files from AI access
126
- - **Project-specific rules**: Team coding standards, security guidelines, deployment processes
127
- - **Rule synchronization**: Keep custom rules consistent across team members
128
- - **Intelligent pattern extraction**: Automatically identifies AI-sensitive patterns from rule globs
129
-
130
- ### AI Ignore File Features:
131
- - **Security-first exclusions**: Automatically excludes sensitive files (`.pem`, `.key`, `.env*`)
132
- - **Data file exclusions**: Excludes large data files that might confuse AI (`.csv`, `.sqlite`, `.zip`)
133
- - **Sensitive documentation**: Excludes internal documentation and confidential directories
134
- - **Pattern-based exclusions**: Analyzes rule globs to identify AI-sensitive patterns
135
- - **Explicit ignore patterns**: Supports manual ignore patterns in rule content (`# IGNORE:`, `# aiignore:`)
136
-
137
- ### What Kiro IDE handles directly:
138
- - **Core steering files**: `product.md` (user requirements), `structure.md` (architecture), `tech.md` (tech stack)
139
- - **Spec management**: Feature specifications in `.kiro/specs/`
140
- - **Agent hooks**: Automated context application
141
-
142
- This division of responsibility ensures that rulesync enhances Kiro's capabilities without duplicating its core functionality.
143
-
144
- ## OpenAI Codex CLI Integration
145
-
146
- ### Hierarchical Memory System
147
-
148
- rulesync supports **OpenAI Codex CLI**'s hierarchical memory system, which provides persistent context and project-specific rules to GPT-4 powered development workflows.
149
-
150
- **Key Features**:
151
- - **Hierarchical Instructions**: Global user instructions → Project-level instructions → Directory-specific instructions
152
- - **MCP Integration**: Model Context Protocol support through wrapper servers for extended functionality
153
- - **GPT-4 Models**: Support for GPT-4, GPT-4 Turbo, o1-mini, and other OpenAI models
154
- - **Plain Markdown Format**: Clean, readable instruction files without complex frontmatter
155
- - **Community Ignore Support**: Optional `.codexignore` file for excluding sensitive files from AI access
156
-
157
- ### File Structure
158
-
159
- rulesync generates the following files for OpenAI Codex CLI:
160
-
161
- - **`codex.md`**: Main project-level instructions (generated from root rules)
162
- - **`<filename>.md`**: Additional instruction files (generated from non-root rules)
163
- - **`.codex/mcp-config.json`**: MCP server configuration for wrapper servers
164
- - **`.codexignore`**: Optional ignore file for community tools and enhanced privacy
165
-
166
- ### Usage with OpenAI Models
167
-
168
- OpenAI Codex CLI works with various OpenAI models:
169
- - **GPT-4**: Best for complex reasoning and architecture decisions
170
- - **GPT-4 Turbo**: Optimized for performance and cost efficiency
171
- - **o1-mini**: Specialized for coding tasks and problem-solving
172
- - **GPT-4o-mini**: Balanced performance for everyday development tasks
173
-
174
- The hierarchical memory system ensures consistent coding standards and project context across all model interactions.
175
-
176
- ### Example Usage
177
-
178
- Generate OpenAI Codex CLI configuration files:
179
-
180
- ```bash
181
- # Generate only for OpenAI Codex CLI
182
- npx rulesync generate --codexcli
183
-
184
- # Generate with MCP configuration for wrapper servers
185
- npx rulesync generate --codexcli --verbose
186
-
187
- # Generate in specific directory (useful for monorepos)
188
- npx rulesync generate --codexcli --base-dir ./packages/frontend
189
- ```
190
-
191
- This will create:
192
- - `codex.md` with your project-level instructions
193
- - Additional `.md` files for specific rule categories
194
- - `.codex/mcp-config.json` for MCP wrapper server integration
195
- - `.codexignore` for enhanced privacy control (if `.rulesyncignore` exists)
196
-
197
- ## Windsurf AI Code Editor Integration
198
-
199
- ### Comprehensive AI-Assisted Development
200
-
201
- rulesync provides full integration with **Windsurf AI Code Editor**, supporting its complete ecosystem of features including rules/memories, MCP servers, and ignore file patterns.
202
-
203
- **Key Features**:
204
- - **Unified Rule System**: Supports both workspace rules and global rules with automatic memory integration
205
- - **Cascade AI Enhancement**: Provides persistent context to Windsurf's Cascade AI for better code understanding
206
- - **MCP Integration**: Model Context Protocol support for extended functionality through external services
207
- - **Privacy Controls**: Advanced ignore file generation for sensitive data protection
208
-
209
- ### File Structure
210
-
211
- rulesync generates the following files for Windsurf:
212
-
213
- - **`.windsurf/rules/*.md`**: Project-specific rules (generated from both root and detail rules)
214
- - **`.windsurf/mcp.json`**: MCP server configuration for external tool integration
215
- - **`.codeiumignore`**: Ignore file for excluding sensitive files from Cascade AI analysis
216
-
217
- ### Rule Integration Options
218
-
219
- Windsurf supports multiple rule placement strategies:
220
-
221
- #### Directory Variant (Recommended)
222
- - **Location**: `.windsurf/rules/` directory
223
- - **Files**: Multiple Markdown files for organized rule categorization
224
- - **Benefits**: Better organization, team collaboration, version control friendly
225
-
226
- #### Single-File Alternative
227
- - **Location**: `.windsurf-rules` file at project root
228
- - **Format**: Single Markdown file with all rules
229
- - **Use Case**: Simple projects or minimal rule sets
230
-
231
- ### Cascade AI Memory System
232
-
233
- Windsurf's Cascade AI automatically integrates with both:
234
- - **Workspace Rules**: Project-specific guidelines in `.windsurf/rules/`
235
- - **Auto-generated Memories**: Context learned from development patterns
236
- - **Global Rules**: User-wide preferences (not managed by rulesync)
237
-
238
- The combination provides comprehensive context for AI-assisted development.
239
-
240
- ### Example Usage
241
-
242
- Generate Windsurf configuration files:
243
-
244
- ```bash
245
- # Generate only for Windsurf
246
- npx rulesync generate --windsurf
247
-
248
- # Generate with verbose output
249
- npx rulesync generate --windsurf --verbose
250
-
251
- # Generate in specific directory (useful for monorepos)
252
- npx rulesync generate --windsurf --base-dir ./packages/frontend
253
- ```
254
-
255
- This will create:
256
- - `.windsurf/rules/*.md` with your project rules organized by category
257
- - `.windsurf/mcp.json` for MCP server integration
258
- - `.codeiumignore` for enhanced privacy control (if `.rulesyncignore` exists)
259
-
260
- ## Claude Code Integration
261
-
262
- ### Creating Custom Slash Commands
263
-
264
- Instead of using Claude Code's built-in `/init` command, we recommend creating a custom slash command specifically for rulesync.
265
-
266
- Refer to the [Claude Code slash commands documentation](https://docs.anthropic.com/en/docs/claude-code/slash-commands) and add the following custom command:
267
-
268
- **`.claude/commands/init-rulesync.md`**
269
-
270
- ```markdown
271
- Analyze this project's codebase and update .rulesync/overview.md files as needed.
272
-
273
- Please ensure the following frontmatter is defined in .rulesync/overview.md:
274
-
275
- ---
276
- root: true | false # Required: Rule level (true for overview, false for details)
277
- targets: ["*"] # Required: Target tools (* = all, or specific tools)
278
- description: "" # Required: Rule description
279
- globs: ["**/*"] # Required: File patterns
280
- cursorRuleType: "always" # Optional: Cursor-specific rule type (always, manual, specificFiles, intelligently)
281
- ---
282
-
283
- In .rulesync/overview.md, root should be set to true. Please write an appropriate description in the description field.
284
- ```
285
-
286
- ### Integration Benefits
287
-
288
- - **Project-Specific Initialization**: Optimized rule configuration for each project
289
- - **Automatic Rule Updates**: Rules adapt to project changes automatically
290
- - **Team Standardization**: All members use the same rule set
291
- - **Continuous Improvement**: Rules evolve with project growth
292
-
293
- ## Usage
294
-
295
- ### 1. Initialize
88
+ ## Quick Commands
296
89
 
297
90
  ```bash
91
+ # Initialize new project
298
92
  npx rulesync init
299
- ```
300
-
301
- This creates a `.rulesync/` directory with sample rule files.
302
-
303
- ### 2. Edit Rule Files
304
-
305
- Define metadata in front matter for each Markdown file in the `.rulesync/` directory. See the [Example Files](#example-files) section below for detailed examples.
306
-
307
- ### Rule Levels
308
-
309
- rulesync uses a two-level rule system:
310
93
 
311
- - **root: true**: Project-wide overview and policies
312
- - Only **one** root file is allowed per project
313
- - Contains high-level guidelines and project context
314
- - **root: false**: Specific implementation rules and detailed guidelines
315
- - Multiple non-root files are allowed
316
- - Contains specific coding rules, naming conventions, etc.
317
-
318
- #### Tool-Specific Behavior
319
-
320
- Each AI tool handles rule levels differently:
321
-
322
- | Tool | Root Rules | Non-Root Rules | Special Behavior |
323
- |------|------------|----------------|------------------|
324
- | **Claude Code** | `./CLAUDE.md` | `.claude/memories/*.md` | CLAUDE.md includes `@filename` references to detail files |
325
- | **Cursor** | `cursorRuleType: always` | `cursorRuleType: specificFiles` (with globs)<br>`cursorRuleType: intelligently` (with description)<br>`cursorRuleType: manual` (default) | Advanced rule type system based on content analysis |
326
- | **GitHub Copilot** | Standard format | Standard format | All rules use same format with frontmatter |
327
- | **Cline** | Standard format | Standard format | All rules use plain Markdown format |
328
- | **Roo Code** | Standard format | Standard format | All rules use plain Markdown format with description header |
329
- | **Gemini CLI** | `GEMINI.md` | `.gemini/memories/*.md` | GEMINI.md includes `@filename` references to memory files |
94
+ # Add new rule file
95
+ npx rulesync add typescript-rules
330
96
 
331
- ### 3. Generate Configuration Files
97
+ # Validate rules
98
+ npx rulesync validate
332
99
 
333
- ```bash
334
- # Generate for all tools
100
+ # Generate configurations
335
101
  npx rulesync generate
336
102
 
337
- # Generate for specific tools
338
- npx rulesync generate --copilot
339
- npx rulesync generate --cursor
340
- npx rulesync generate --cline
341
- npx rulesync generate --claudecode
342
- npx rulesync generate --codexcli
343
- npx rulesync generate --augmentcode
344
- npx rulesync generate --roo
345
- npx rulesync generate --geminicli
346
- npx rulesync generate --junie
347
- npx rulesync generate --kiro
348
- npx rulesync generate --windsurf
349
-
350
- # Clean build (delete existing files first)
351
- npx rulesync generate --delete
352
-
353
- # Clean build for specific tools
354
- npx rulesync generate --copilot --cursor --codexcli --windsurf --delete
355
-
356
- # Verbose output
357
- npx rulesync generate --verbose
358
- npx rulesync generate --delete --verbose
359
-
360
- # Generate in specific base directories (monorepo support)
361
- npx rulesync generate --base-dir ./packages/frontend
362
- npx rulesync generate --base-dir ./packages/frontend,./packages/backend
363
- npx rulesync generate --base-dir ./apps/web,./apps/api,./packages/shared
364
- ```
365
-
366
- #### Generate Options
367
-
368
- - `--delete`: Remove all existing generated files before creating new ones
369
- - `--verbose`: Show detailed output during generation process
370
- - `--copilot`, `--cursor`, `--cline`, `--claudecode`, `--codexcli`, `--augmentcode`, `--roo`, `--geminicli`, `--junie`, `--kiro`, `--windsurf`: Generate only for specified tools
371
- - `--base-dir <paths>`: Generate configuration files in specified base directories (comma-separated for multiple paths). Useful for monorepo setups where you want to generate tool-specific configurations in different project directories.
372
- - `--config <path>`: Use a specific configuration file
373
- - `--no-config`: Disable configuration file loading
374
-
375
- ### Configuration Files
376
-
377
- rulesync supports configuration files to avoid repetitive command-line arguments. The configuration is loaded from (in order of precedence):
378
-
379
- 1. Path specified with `--config` flag
380
- 2. `rulesync.jsonc` (JSONC format with comments)
381
- 3. `rulesync.ts` (TypeScript format)
382
- 4. `rulesync.config.ts`
383
- 5. `rulesync.config.jsonc`
384
- 6. `package.json` (in a `"rulesync"` field)
385
-
386
- #### Configuration File Examples
387
-
388
- **JSONC format (`rulesync.jsonc`):**
389
- ```jsonc
390
- {
391
- // List of tools to generate configurations for
392
- "targets": ["copilot", "cursor", "claudecode", "codexcli", "windsurf"],
393
-
394
- // Tools to exclude from generation (overrides targets)
395
- "exclude": ["roo"],
396
-
397
- // Custom output paths for specific tools
398
- "outputPaths": {
399
- "copilot": ".github/copilot-instructions.md"
400
- },
401
-
402
- // Base directory or directories for generation
403
- "baseDir": "./packages",
404
-
405
- // Delete existing files before generating
406
- "delete": false,
407
-
408
- // Enable verbose output
409
- "verbose": true,
410
-
411
- // Directory containing rule files
412
- "aiRulesDir": ".rulesync",
413
-
414
- // Watch configuration
415
- "watch": {
416
- "enabled": false,
417
- "interval": 1000,
418
- "ignore": ["node_modules/**", ".git/**", "dist/**", "build/**"]
419
- }
420
- }
421
- ```
422
-
423
- **TypeScript format (`rulesync.ts`):**
424
- ```typescript
425
- import type { ConfigOptions } from "rulesync";
426
-
427
- const config: ConfigOptions = {
428
- targets: ["copilot", "cursor", "claudecode", "codexcli", "windsurf"],
429
- exclude: ["roo"],
430
- outputPaths: {
431
- copilot: ".github/copilot-instructions.md"
432
- },
433
- baseDir: "./packages",
434
- delete: false,
435
- verbose: true
436
- };
437
-
438
- export default config;
439
- ```
440
-
441
- #### Configuration Options
442
-
443
- - `targets`: Array of tools to generate configurations for (overrides default targets)
444
- - `exclude`: Array of tools to exclude from generation
445
- - `outputPaths`: Custom output paths for specific tools
446
- - `baseDir`: Base directory or array of directories for generation
447
- - `delete`: Delete existing files before generating (default: false)
448
- - `verbose`: Enable verbose output (default: false)
449
- - `aiRulesDir`: Directory containing rule files (default: ".rulesync")
450
- - `watch`: Watch configuration with `enabled`, `interval`, and `ignore` options
451
- - `enabled`: Enable file watching (default: false)
452
- - `interval`: Watch interval in milliseconds (default: 1000)
453
- - `ignore`: Array of patterns to ignore during watching
454
-
455
- #### Managing Configuration
456
-
457
- ```bash
458
- # Show current configuration
459
- npx rulesync config
460
-
461
- # Initialize a configuration file
462
- npx rulesync config --init
463
-
464
- # Initialize with specific format
465
- npx rulesync config --init --format jsonc # Default, supports comments
466
- npx rulesync config --init --format ts # TypeScript with type safety
467
- ```
468
-
469
- ### 4. Import Existing Configurations
470
-
471
- If you already have AI tool configurations in your project, you can import them to rulesync format:
472
-
473
- ```bash
474
- # Import from existing AI tool configurations
475
- npx rulesync import --claudecode # Import from CLAUDE.md and .claude/memories/*.md
476
- npx rulesync import --cursor # Import from .cursorrules and .cursor/rules/*.md
477
- npx rulesync import --copilot # Import from .github/copilot-instructions.md and .github/instructions/*.instructions.md
478
- npx rulesync import --cline # Import from .cline/instructions.md
479
- npx rulesync import --augmentcode # Import from .augment/rules/*.md
480
- npx rulesync import --roo # Import from .roo/instructions.md
481
- npx rulesync import --geminicli # Import from GEMINI.md and .gemini/memories/*.md
482
- npx rulesync import --junie # Import from .junie/guidelines.md
483
- npx rulesync import --windsurf # Import from .windsurf/rules/*.md
484
-
485
- # Import each tool individually
486
- npx rulesync import --claudecode
103
+ # Import from existing tools
487
104
  npx rulesync import --cursor
488
- npx rulesync import --copilot
489
-
490
- # Verbose output during import
491
- npx rulesync import --claudecode --verbose
492
- ```
493
-
494
- The import command will:
495
- - Parse existing configuration files from each AI tool using custom parsers
496
- - Convert them to rulesync format with appropriate frontmatter metadata
497
- - Create new `.rulesync/*.md` files with imported content and proper rule categorization
498
- - Use tool-specific prefixes to avoid filename conflicts (e.g., `claudecode-overview.md`, `cursor-custom-rules.md`)
499
- - Generate unique filenames if conflicts occur
500
- - Support complex formats like Cursor's MDC files with YAML frontmatter
501
- - Handle multiple file imports (e.g., all files from `.claude/memories/` directory)
502
-
503
- ### Cursor Import Details
504
-
505
- When importing from Cursor, the following four rule types are automatically identified:
506
-
507
- 1. **always** (`cursorRuleType: always`)
508
- - Condition: `alwaysApply: true` is set
509
- - Conversion: Imported as root rule (`root: false`), with `globs: ["**/*"]` set
510
-
511
- 2. **manual** (`cursorRuleType: manual`)
512
- - Condition: empty description + empty globs + `alwaysApply: false`
513
- - Conversion: Imported with empty globs patterns (manual application rule)
514
105
 
515
- 3. **specificFiles** (`cursorRuleType: specificFiles`)
516
- - Condition: globs specified (regardless of description)
517
- - Conversion: Specified globs patterns preserved as array, description set to empty string
518
-
519
- 4. **intelligently** (`cursorRuleType: intelligently`)
520
- - Condition: description specified + empty globs
521
- - Conversion: Description preserved, empty globs patterns set
522
-
523
- #### Edge Case Handling
524
- - **Non-empty description + non-empty globs**: Processed as `specificFiles` (globs patterns take priority)
525
- - **No matching conditions**: Processed as `manual` (default)
526
-
527
- #### Supported Files
528
- - `.cursorrules` (legacy format)
529
- - `.cursor/rules/*.mdc` (modern MDC format)
530
- - `.cursorignore` (ignore patterns)
531
- - `.cursor/mcp.json` (MCP server configuration)
532
-
533
- ### 5. Other Commands
534
-
535
- ```bash
536
- # Initialize project with sample files
537
- npx rulesync init
538
-
539
- # Add a new rule file
540
- npx rulesync add <filename>
541
- npx rulesync add typescript-rules
542
- npx rulesync add security.md # .md extension is automatically handled
543
-
544
- # Validate rule files
545
- npx rulesync validate
106
+ # Watch for changes
107
+ npx rulesync watch
546
108
 
547
- # Check current status
109
+ # Show project status
548
110
  npx rulesync status
549
111
 
550
- # Watch files and auto-generate
551
- npx rulesync watch
552
-
553
112
  # Add generated files to .gitignore
554
113
  npx rulesync gitignore
555
-
556
- # Show or manage configuration
557
- npx rulesync config
558
- npx rulesync config --init # Create configuration file
559
- ```
560
-
561
- ## Configuration File Structure
562
-
563
- ```
564
- .rulesync/
565
- ├── overview.md # Project overview (root: true, only one)
566
- ├── coding-rules.md # Coding rules (root: false)
567
- ├── naming-conventions.md # Naming conventions (root: false)
568
- ├── architecture.md # Architecture guidelines (root: false)
569
- ├── security.md # Security rules (root: false)
570
- └── custom.md # Project-specific rules (root: false)
571
- ```
572
-
573
- ### Excluding Files with .rulesyncignore
574
-
575
- You can exclude specific rule files from being processed by creating a `.rulesyncignore` file in your project root. This file uses gitignore-style patterns.
576
-
577
- Example `.rulesyncignore`:
578
- ```
579
- # Ignore test rule files
580
- **/*.test.md
581
-
582
- # Ignore temporary files
583
- tmp/**/*
584
-
585
- # Ignore draft rules
586
- draft-*.md
587
- *-draft.md
588
- ```
589
-
590
- When `.rulesyncignore` exists, rulesync will:
591
- 1. Skip matching files during rule processing
592
- 2. Generate tool-specific ignore files:
593
- - `.cursorignore` for Cursor
594
- - `.clineignore` for Cline
595
- - `.rooignore` for Roo Code
596
- - `.copilotignore` for GitHub Copilot (community tools)
597
- - `.aiexclude` for Gemini CLI
598
- - `.aiignore` for Kiro IDE
599
- - `.codeiumignore` for Windsurf
600
- - Update `.claude/settings.json` permissions.deny with `Read()` rules for Claude Code
601
-
602
- ### Frontmatter Schema
603
-
604
- Each rule file must include frontmatter with the following fields:
605
-
606
- ```yaml
607
- ---
608
- root: true | false # Required: Rule level (true for overview, false for details)
609
- targets: ["*"] # Required: Target tools (* = all, or specific tools)
610
- description: "Brief description" # Required: Rule description
611
- globs: ["**/*"] # Required: File patterns (array format)
612
- cursorRuleType: "always" # Optional: Cursor-specific rule type (always, manual, specificFiles, intelligently)
613
- ---
614
- ```
615
-
616
- #### cursorRuleType Field (Optional)
617
-
618
- Additional metadata field for Cursor tool:
619
-
620
- - **`always`**: Rules applied to the entire project constantly
621
- - **`manual`**: Rules applied manually (default)
622
- - **`specificFiles`**: Rules automatically applied to specific file patterns
623
- - **`intelligently`**: Rules applied by AI judgment
624
-
625
- ### Example Files
626
-
627
- **Root file** (`.rulesync/overview.md`):
628
- ```markdown
629
- ---
630
- root: true
631
- targets: ["*"]
632
- description: "Project overview and development philosophy"
633
- globs: ["src/**/*.ts"]
634
- ---
635
-
636
- # Project Development Guidelines
637
-
638
- This project follows TypeScript-first development with clean architecture principles.
639
- ```
640
-
641
- **Non-root file** (`.rulesync/coding-rules.md`):
642
- ```markdown
643
- ---
644
- root: false
645
- targets: ["copilot", "cursor", "roo"]
646
- description: "TypeScript coding standards"
647
- globs: ["**/*.ts", "**/*.tsx"]
648
- ---
649
-
650
- # TypeScript Coding Rules
651
-
652
- - Use strict TypeScript configuration
653
- - Prefer interfaces over types for object shapes
654
- - Use meaningful variable names
655
- ```
656
-
657
- ## Generated Configuration Files
658
-
659
- | Tool | Output Path | Format | Rule Level Handling |
660
- |------|------------|--------|-------------------|
661
- | **GitHub Copilot** | `.github/instructions/*.instructions.md` | Front Matter + Markdown | Both levels use same format |
662
- | **Cursor** | `.cursor/rules/*.mdc` | MDC (YAML header + Markdown) | Root: `cursorRuleType: always`<br>Non-root: `cursorRuleType: specificFiles` (with globs)<br>Non-root: `cursorRuleType: intelligently` (with description)<br>Non-root: `cursorRuleType: manual` (default) |
663
- | **Cline** | `.clinerules/*.md` | Plain Markdown | Both levels use same format |
664
- | **Claude Code** | `./CLAUDE.md` (root)<br>`.claude/memories/*.md` (non-root) | Plain Markdown | Root goes to CLAUDE.md<br>Non-root go to separate memory files<br>CLAUDE.md includes `@filename` references |
665
- | **OpenAI Codex CLI** | `codex.md` (root)<br>`<filename>.md` (non-root) | Plain Markdown | Root goes to codex.md<br>Non-root go to separate instruction files<br>Hierarchical memory system |
666
- | **AugmentCode** | `.augment/rules/*.md` | Markdown with YAML frontmatter | Root: `type: always`<br>Non-root: `type: auto` (with description) or `type: manual` (default) |
667
- | **Roo Code** | `.roo/rules/*.md` | Plain Markdown | Both levels use same format with description header |
668
- | **Gemini CLI** | `GEMINI.md` (root)<br>`.gemini/memories/*.md` (non-root) | Plain Markdown | Root goes to GEMINI.md<br>Non-root go to separate memory files<br>GEMINI.md includes `@filename` references |
669
- | **JetBrains Junie** | `.junie/guidelines.md` | Plain Markdown | All rules combined into single guidelines file |
670
- | **Kiro IDE** | `.kiro/steering/*.md` + `.aiignore` | Plain Markdown + Ignore patterns | Both levels use same format for custom steering docs<br>AI ignore file excludes sensitive patterns |
671
- | **Windsurf** | `.windsurf/rules/*.md` | Plain Markdown | Both levels use same format with auto-generated memory integration |
672
-
673
- ## Validation
674
-
675
- rulesync validates your rule files and provides helpful error messages:
676
-
677
- ```bash
678
- npx rulesync validate
679
- ```
680
-
681
- Common validation rules:
682
- - Only one root file (root: true) is allowed per project
683
- - All frontmatter fields are required and properly formatted
684
- - File patterns (globs) use valid syntax
685
- - Target tools are recognized values
686
-
687
- ## MCP (Model Context Protocol) Support
688
-
689
- rulesync can also manage MCP server configurations for supported AI tools. This allows you to configure language servers and other MCP-compatible services once and deploy them across multiple AI coding assistants.
690
-
691
- ### Supported MCP Tools
692
-
693
- - **Claude Code** (`.mcp.json`)
694
- - **GitHub Copilot** (`.vscode/mcp.json`)
695
- - **Cursor** (`.cursor/mcp.json`)
696
- - **Cline** (`.cline/mcp.json`)
697
- - **OpenAI Codex CLI** (`.codex/mcp-config.json`)
698
- - **Gemini CLI** (`.gemini/settings.json`)
699
- - **JetBrains Junie** (`.junie/mcp.json`)
700
- - **Kiro IDE** (`.kiro/mcp.json`)
701
- - **Roo Code** (`.roo/mcp.json`)
702
- - **Windsurf** (`.windsurf/mcp.json`)
703
-
704
- ### MCP Configuration
705
-
706
- Create a `.rulesync/.mcp.json` file in your project:
707
-
708
- ```json
709
- {
710
- "mcpServers": {
711
- "github": {
712
- "command": "docker",
713
- "args": [
714
- "run", "-i", "--rm",
715
- "-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
716
- "ghcr.io/github/github-mcp-server"
717
- ],
718
- "env": {},
719
- "targets": ["*"]
720
- }
721
- }
722
- }
723
- ```
724
-
725
- ### MCP Configuration Fields
726
-
727
- - **`mcpServers`**: Object containing MCP server configurations
728
- - **`command`**: Executable command for stdio-based servers
729
- - **`args`**: Command arguments
730
- - **`url`**: URL for HTTP/SSE-based servers
731
- - **`env`**: Environment variables to pass to the server
732
- - **`targets`**: Array of tool names to deploy this server to
733
- - Use specific tool names: `["claude", "cursor", "copilot"]`
734
- - Use `["*"]` to deploy to all supported tools
735
- - If omitted, server is deployed to all tools by default
736
-
737
- ### Kiro IDE-Specific MCP Fields
738
-
739
- For Kiro IDE, you can use additional configuration fields:
740
-
741
- - **`kiroAutoApprove`**: Array of tool names to automatically approve without user prompts
742
- - **`kiroAutoBlock`**: Array of tool names to automatically block
743
-
744
- Example with Kiro-specific fields:
745
- ```json
746
- {
747
- "mcpServers": {
748
- "aws-tools": {
749
- "command": "python",
750
- "args": ["-m", "aws_mcp_server"],
751
- "env": {
752
- "AWS_PROFILE": "dev",
753
- "AWS_REGION": "us-east-1"
754
- },
755
- "kiroAutoApprove": ["describe_instances", "list_buckets"],
756
- "kiroAutoBlock": ["delete_bucket", "terminate_instances"],
757
- "targets": ["kiro"]
758
- }
759
- }
760
- }
761
- ```
762
-
763
- ### Generating MCP Configurations
764
-
765
- MCP configurations are generated alongside rule files:
766
-
767
- ```bash
768
- # Generate both rules and MCP configurations
769
- npx rulesync generate
770
-
771
- # Generate only for specific tools
772
- npx rulesync generate --claudecode --cursor --codexcli --junie --kiro --windsurf
773
-
774
- # Generate in specific directories (monorepo)
775
- npx rulesync generate --base-dir ./packages/frontend
776
114
  ```
777
115
 
778
- The MCP configurations will be generated in the appropriate locations for each tool, and the tools will automatically load them when started.
116
+ ## Documentation
117
+
118
+ ### 📖 Core Documentation
119
+ - **[Commands Reference](./docs/commands.md)** - Complete CLI commands guide
120
+ - **[Configuration Guide](./docs/configuration.md)** - Rule files and configuration options
121
+
122
+ ### 🛠️ Tool Integrations
123
+ - **[Claude Code](./docs/tools/claudecode.md)** - Memory system and custom commands
124
+ - **[Cursor](./docs/tools/cursor.md)** - Rule types and MDC format
125
+ - **[GitHub Copilot](./docs/tools/copilot.md)** - Custom instructions
126
+ - **[Cline](./docs/tools/cline.md)** - Plain Markdown rules
127
+ - **[OpenAI Codex CLI](./docs/tools/codexcli.md)** - Hierarchical memory system
128
+ - **[Gemini CLI](./docs/tools/geminicli.md)** - Memory and commands
129
+ - **[Windsurf](./docs/tools/windsurf.md)** - Rules and Cascade AI
130
+ - **[JetBrains Junie](./docs/tools/junie.md)** - Guidelines and IDE integration
131
+ - **[Kiro IDE](./docs/tools/kiro.md)** - Custom steering documents
132
+ - **[AugmentCode](./docs/tools/augmentcode.md)** - Rule types and configuration
133
+ - **[Roo Code](./docs/tools/roo.md)** - Instructions and rules
134
+
135
+ ### ⚡ Features
136
+ - **[Custom Slash Commands](./docs/features/custom-commands.md)** - Create unified commands for Claude Code and Gemini CLI
137
+ - **[MCP Integration](./docs/features/mcp.md)** - Model Context Protocol server configuration
138
+ - **[Import System](./docs/features/import.md)** - Import existing AI tool configurations
139
+ - **[Rule Validation](./docs/features/validation.md)** - Validate rule files and configuration
140
+
141
+ ### 📚 Guides
142
+ - **[Getting Started](./docs/guides/getting-started.md)** - Comprehensive setup guide
143
+ - **[Best Practices](./docs/guides/best-practices.md)** - Proven strategies and patterns
144
+ - **[Migration Guide](./docs/guides/migration.md)** - Migrate from existing AI tool configurations
145
+ - **[Troubleshooting](./docs/guides/troubleshooting.md)** - Common issues and solutions
146
+ - **[Real-World Examples](./docs/guides/examples.md)** - Practical implementation examples
779
147
 
780
148
  ## License
781
149