rulesync 5.1.1 → 5.2.1
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 +106 -95
- package/dist/index.cjs +454 -356
- package/dist/index.js +410 -312
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -98,6 +98,7 @@ Get-FileHash rulesync.exe -Algorithm SHA256 | ForEach-Object {
|
|
|
98
98
|
if ($actual -eq $expected) { "✓ Checksum verified" } else { "✗ Checksum mismatch" }
|
|
99
99
|
}
|
|
100
100
|
```
|
|
101
|
+
|
|
101
102
|
</details>
|
|
102
103
|
|
|
103
104
|
## Getting Started
|
|
@@ -126,52 +127,60 @@ npx rulesync generate --targets "*" --features "*"
|
|
|
126
127
|
|
|
127
128
|
Rulesync supports both **generation** and **import** for All of the major AI coding tools:
|
|
128
129
|
|
|
129
|
-
| Tool
|
|
130
|
-
|
|
131
|
-
| AGENTS.md
|
|
132
|
-
| Claude Code
|
|
133
|
-
| Codex CLI
|
|
134
|
-
| Gemini CLI
|
|
135
|
-
| GitHub Copilot
|
|
136
|
-
| Cursor
|
|
137
|
-
| OpenCode
|
|
138
|
-
| Cline
|
|
139
|
-
| Kilo Code
|
|
140
|
-
| Roo Code
|
|
141
|
-
| Qwen Code
|
|
142
|
-
| Kiro IDE
|
|
143
|
-
| Google Antigravity
|
|
144
|
-
| JetBrains Junie
|
|
145
|
-
| AugmentCode
|
|
146
|
-
| Windsurf
|
|
147
|
-
| Warp | ✅ | |
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
130
|
+
| Tool | rules | ignore | mcp | commands | subagents | skills |
|
|
131
|
+
| ------------------ | :---: | :----: | :------: | :------: | :-------: | :----: |
|
|
132
|
+
| AGENTS.md | ✅ | | | 🎮 | 🎮 | 🎮 |
|
|
133
|
+
| Claude Code | ✅ 🌏 | ✅ | ✅ 🌏 📦 | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 |
|
|
134
|
+
| Codex CLI | ✅ 🌏 | | 🌏 | 🌏 | 🎮 | 🌏 |
|
|
135
|
+
| Gemini CLI | ✅ 🌏 | ✅ | ✅ 🌏 | ✅ 🌏 | 🎮 | 🎮 |
|
|
136
|
+
| GitHub Copilot | ✅ | | ✅ | ✅ | ✅ | ✅ |
|
|
137
|
+
| Cursor | ✅ | ✅ | ✅ | ✅ 🌏 | 🎮 | ✅ |
|
|
138
|
+
| OpenCode | ✅ | | ✅ | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 |
|
|
139
|
+
| Cline | ✅ | ✅ | ✅ | ✅ 🌏 | | |
|
|
140
|
+
| Kilo Code | ✅ 🌏 | ✅ | ✅ | ✅ 🌏 | | |
|
|
141
|
+
| Roo Code | ✅ | ✅ | ✅ | ✅ | 🎮 | ✅ 🌏 |
|
|
142
|
+
| Qwen Code | ✅ | ✅ | | | | |
|
|
143
|
+
| Kiro IDE | ✅ | ✅ | | | | |
|
|
144
|
+
| Google Antigravity | ✅ | | | ✅ | | |
|
|
145
|
+
| JetBrains Junie | ✅ | ✅ | ✅ | | | |
|
|
146
|
+
| AugmentCode | ✅ | ✅ | | | | |
|
|
147
|
+
| Windsurf | ✅ | ✅ | | | | |
|
|
148
|
+
| Warp | ✅ | | | | | |
|
|
149
|
+
| Zed | | ✅ | | | | |
|
|
150
|
+
|
|
151
|
+
- ✅: Supports project mode
|
|
152
|
+
- 🌏: Supports global mode
|
|
153
|
+
- 🎮: Supports simulated commands/subagents/skills (Project mode only)
|
|
154
|
+
- 📦: Supports modular MCP (Experimental)
|
|
153
155
|
|
|
154
156
|
## Why Rulesync?
|
|
155
157
|
|
|
156
158
|
### 🔧 **Tool Flexibility**
|
|
159
|
+
|
|
157
160
|
Team members can freely choose their preferred AI coding tools. Whether it's GitHub Copilot, Cursor, Cline, or Claude Code, each developer can use the tool that maximizes their productivity.
|
|
158
161
|
|
|
159
162
|
### 📈 **Future-Proof Development**
|
|
163
|
+
|
|
160
164
|
AI development tools evolve rapidly with new tools emerging frequently. With Rulesync, switching between tools doesn't require redefining your rules from scratch.
|
|
161
165
|
|
|
162
166
|
### 🎯 **Multi-Tool Workflow**
|
|
167
|
+
|
|
163
168
|
Enable hybrid development workflows combining multiple AI tools.
|
|
164
169
|
|
|
165
170
|
### 🔓 **No Lock-in**
|
|
171
|
+
|
|
166
172
|
Avoid lock-in completely. If you decide to stop using Rulesync, you can continue using the generated rule files as-is.
|
|
167
173
|
|
|
168
174
|
### 🎯 **Consistency Across Tools**
|
|
175
|
+
|
|
169
176
|
Apply consistent rules across all AI tools, improving code quality and development experience for the entire team.
|
|
170
177
|
|
|
171
178
|
### 🌏 **Global Mode**
|
|
179
|
+
|
|
172
180
|
You can use global mode via Rulesync by enabling `--global` option.
|
|
173
181
|
|
|
174
182
|
### 🎮 **Simulate Commands and Subagents**
|
|
183
|
+
|
|
175
184
|
Simulated commands and subagents allow you to generate simulated commands and subagents for cursor and codexcli. This is useful for shortening your prompts.
|
|
176
185
|
|
|
177
186
|
## Case Studies
|
|
@@ -221,7 +230,7 @@ Rulesync provides a JSON Schema for editor validation and autocompletion. Add th
|
|
|
221
230
|
{
|
|
222
231
|
"$schema": "https://raw.githubusercontent.com/dyoshikawa/rulesync/refs/heads/main/config-schema.json",
|
|
223
232
|
"targets": ["claudecode"],
|
|
224
|
-
"features": ["rules"]
|
|
233
|
+
"features": ["rules"],
|
|
225
234
|
}
|
|
226
235
|
```
|
|
227
236
|
|
|
@@ -239,7 +248,7 @@ Example:
|
|
|
239
248
|
|
|
240
249
|
// Features to generate. You can specify "*" to generate all features.
|
|
241
250
|
"features": ["rules", "ignore", "mcp", "commands", "subagents"],
|
|
242
|
-
|
|
251
|
+
|
|
243
252
|
// Base directories for generation.
|
|
244
253
|
// Basically, you can specify a `["."]` only.
|
|
245
254
|
// However, for example, if your project is a monorepo and you have to launch the AI agent at each package directory, you can specify multiple base directories.
|
|
@@ -252,11 +261,11 @@ Example:
|
|
|
252
261
|
"verbose": false,
|
|
253
262
|
|
|
254
263
|
// Advanced options
|
|
255
|
-
"global": false,
|
|
256
|
-
"simulateCommands": false,
|
|
257
|
-
"simulateSubagents": false,
|
|
258
|
-
"simulateSkills": false,
|
|
259
|
-
"modularMcp": false
|
|
264
|
+
"global": false, // Generate for global(user scope) configuration files
|
|
265
|
+
"simulateCommands": false, // Generate simulated commands
|
|
266
|
+
"simulateSubagents": false, // Generate simulated subagents
|
|
267
|
+
"simulateSkills": false, // Generate simulated skills
|
|
268
|
+
"modularMcp": false, // Enable modular-mcp for context compression (experimental, Claude Code only)
|
|
260
269
|
}
|
|
261
270
|
```
|
|
262
271
|
|
|
@@ -270,11 +279,12 @@ For example, both `agentsmd` and `opencode` generate `AGENTS.md`:
|
|
|
270
279
|
{
|
|
271
280
|
// opencode wins because it comes last
|
|
272
281
|
"targets": ["agentsmd", "opencode"],
|
|
273
|
-
"features": ["rules"]
|
|
282
|
+
"features": ["rules"],
|
|
274
283
|
}
|
|
275
284
|
```
|
|
276
285
|
|
|
277
286
|
In this case:
|
|
287
|
+
|
|
278
288
|
1. `agentsmd` generates `AGENTS.md` first
|
|
279
289
|
2. `opencode` generates `AGENTS.md` second, overwriting the previous file
|
|
280
290
|
|
|
@@ -284,7 +294,7 @@ If you want `agentsmd`'s output instead, reverse the order:
|
|
|
284
294
|
{
|
|
285
295
|
// agentsmd wins because it comes last
|
|
286
296
|
"targets": ["opencode", "agentsmd"],
|
|
287
|
-
"features": ["rules"]
|
|
297
|
+
"features": ["rules"],
|
|
288
298
|
}
|
|
289
299
|
```
|
|
290
300
|
|
|
@@ -329,7 +339,7 @@ Example:
|
|
|
329
339
|
|
|
330
340
|
```md
|
|
331
341
|
---
|
|
332
|
-
description:
|
|
342
|
+
description: "Review a pull request" # command description
|
|
333
343
|
targets: ["*"] # * = all, or specific tools
|
|
334
344
|
copilot: # copilot specific parameters (optional)
|
|
335
345
|
description: "Review a pull request"
|
|
@@ -404,6 +414,7 @@ This is the skill body content.
|
|
|
404
414
|
You can provide instructions, context, or any information that helps the AI agent understand and execute this skill effectively.
|
|
405
415
|
|
|
406
416
|
The skill can include:
|
|
417
|
+
|
|
407
418
|
- Step-by-step instructions
|
|
408
419
|
- Code examples
|
|
409
420
|
- Best practices
|
|
@@ -441,10 +452,7 @@ Example:
|
|
|
441
452
|
"description": "Library documentation search server",
|
|
442
453
|
"type": "stdio",
|
|
443
454
|
"command": "npx",
|
|
444
|
-
"args": [
|
|
445
|
-
"-y",
|
|
446
|
-
"@upstash/context7-mcp"
|
|
447
|
-
],
|
|
455
|
+
"args": ["-y", "@upstash/context7-mcp"],
|
|
448
456
|
"env": {}
|
|
449
457
|
}
|
|
450
458
|
}
|
|
@@ -465,6 +473,7 @@ Rules and behavior:
|
|
|
465
473
|
- If neither file exists yet, Rulesync defaults to creating `.rulesync/.aiignore`.
|
|
466
474
|
|
|
467
475
|
Notes:
|
|
476
|
+
|
|
468
477
|
- Running `rulesync init` will create `.rulesync/.aiignore` if no ignore file is present.
|
|
469
478
|
|
|
470
479
|
Example:
|
|
@@ -481,39 +490,44 @@ You can use global mode via Rulesync by enabling `--global` option. It can also
|
|
|
481
490
|
Currently, supports rules and commands generation for Claude Code. Import for global files is supported for rules and commands.
|
|
482
491
|
|
|
483
492
|
1. Create an any name directory. For example, if you prefer `~/.aiglobal`, run the following command.
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
493
|
+
```bash
|
|
494
|
+
mkdir -p ~/.aiglobal
|
|
495
|
+
```
|
|
487
496
|
2. Initialize files for global files in the directory.
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
497
|
+
```bash
|
|
498
|
+
cd ~/.aiglobal
|
|
499
|
+
npx rulesync init
|
|
500
|
+
```
|
|
492
501
|
3. Edit `~/.aiglobal/rulesync.jsonc` to enable global mode.
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
502
|
+
```jsonc
|
|
503
|
+
{
|
|
504
|
+
"global": true,
|
|
505
|
+
}
|
|
506
|
+
```
|
|
498
507
|
4. Edit `~/.aiglobal/.rulesync/rules/overview.md` to your preferences.
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
508
|
+
|
|
509
|
+
```md
|
|
510
|
+
---
|
|
511
|
+
root: true
|
|
512
|
+
---
|
|
513
|
+
|
|
514
|
+
# The Project Overview
|
|
515
|
+
|
|
516
|
+
...
|
|
517
|
+
```
|
|
518
|
+
|
|
506
519
|
5. Generate rules for global settings.
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
520
|
+
```bash
|
|
521
|
+
# Run in the `~/.aiglobal` directory
|
|
522
|
+
npx rulesync generate
|
|
523
|
+
```
|
|
511
524
|
|
|
512
525
|
> [!NOTE]
|
|
513
526
|
> Currently, when in the directory enabled global mode:
|
|
514
|
-
>
|
|
515
|
-
>
|
|
516
|
-
>
|
|
527
|
+
>
|
|
528
|
+
> - `rulesync.jsonc` only supports `global`, `features`, `delete` and `verbose`. `Features` can be set `"rules"` and `"commands"`. Other parameters are ignored.
|
|
529
|
+
> - `rules/*.md` only supports single file has `root: true`, and frontmatter parameters without `root` are ignored.
|
|
530
|
+
> - Only Claude Code is supported for global mode commands.
|
|
517
531
|
|
|
518
532
|
## Simulate Commands, Subagents and Skills
|
|
519
533
|
|
|
@@ -521,26 +535,27 @@ Simulated commands, subagents and skills allow you to generate simulated feature
|
|
|
521
535
|
|
|
522
536
|
1. Prepare `.rulesync/commands/*.md`, `.rulesync/subagents/*.md` and `.rulesync/skills/*/SKILL.md` for your purposes.
|
|
523
537
|
2. Generate simulated commands, subagents and skills for specific tools that are included in cursor, codexcli and etc.
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
538
|
+
```bash
|
|
539
|
+
npx rulesync generate \
|
|
540
|
+
--targets copilot,cursor,codexcli \
|
|
541
|
+
--features commands,subagents,skills \
|
|
542
|
+
--simulate-commands \
|
|
543
|
+
--simulate-subagents \
|
|
544
|
+
--simulate-skills
|
|
545
|
+
```
|
|
532
546
|
3. Use simulated commands, subagents and skills in your prompts.
|
|
533
|
-
|
|
534
|
-
```txt
|
|
535
|
-
# Execute simulated commands. By the way, `s/` stands for `simulate/`.
|
|
536
|
-
s/your-command
|
|
547
|
+
- Prompt examples:
|
|
537
548
|
|
|
538
|
-
|
|
539
|
-
|
|
549
|
+
```txt
|
|
550
|
+
# Execute simulated commands. By the way, `s/` stands for `simulate/`.
|
|
551
|
+
s/your-command
|
|
540
552
|
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
553
|
+
# Execute simulated subagents
|
|
554
|
+
Call your-subagent to achieve something.
|
|
555
|
+
|
|
556
|
+
# Use simulated skills
|
|
557
|
+
Use the skill your-skill to achieve something.
|
|
558
|
+
```
|
|
544
559
|
|
|
545
560
|
## Modular MCP (Experimental)
|
|
546
561
|
|
|
@@ -630,19 +645,14 @@ When using following mcp servers:
|
|
|
630
645
|
"description": "Up-to-date documentation and code examples for libraries",
|
|
631
646
|
"type": "stdio",
|
|
632
647
|
"command": "npx",
|
|
633
|
-
"args": [
|
|
634
|
-
"-y",
|
|
635
|
-
"@upstash/context7-mcp"
|
|
636
|
-
],
|
|
648
|
+
"args": ["-y", "@upstash/context7-mcp"],
|
|
637
649
|
"env": {}
|
|
638
650
|
},
|
|
639
651
|
"fetch": {
|
|
640
652
|
"description": "This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.",
|
|
641
653
|
"type": "stdio",
|
|
642
654
|
"command": "uvx",
|
|
643
|
-
"args": [
|
|
644
|
-
"mcp-server-fetch"
|
|
645
|
-
],
|
|
655
|
+
"args": ["mcp-server-fetch"],
|
|
646
656
|
"env": {}
|
|
647
657
|
}
|
|
648
658
|
}
|
|
@@ -654,7 +664,7 @@ Once run `rulesync generate --targets claudecode --features mcp`, `/context` res
|
|
|
654
664
|
```
|
|
655
665
|
Context Usage
|
|
656
666
|
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ claude-sonnet-4-5-20250929 · 82k/200k tokens (41%)
|
|
657
|
-
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛀
|
|
667
|
+
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛀
|
|
658
668
|
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System prompt: 2.5k tokens (1.3%)
|
|
659
669
|
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System tools: 13.9k tokens (6.9%)
|
|
660
670
|
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ MCP tools: 15.7k tokens (7.9%)
|
|
@@ -667,10 +677,10 @@ Once run `rulesync generate --targets claudecode --features mcp`, `/context` res
|
|
|
667
677
|
|
|
668
678
|
On the other hand, once run `rulesync generate --targets claudecode --features mcp --modular-mcp`, `/context` result on Claude Code is as follows:
|
|
669
679
|
|
|
670
|
-
```
|
|
680
|
+
```
|
|
671
681
|
Context Usage
|
|
672
682
|
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛁ claude-sonnet-4-5-20250929 · 68k/200k tokens (34%)
|
|
673
|
-
⛁ ⛀ ⛀ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
|
|
683
|
+
⛁ ⛀ ⛀ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
|
|
674
684
|
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System prompt: 2.5k tokens (1.3%)
|
|
675
685
|
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System tools: 13.5k tokens (6.8%)
|
|
676
686
|
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ MCP tools: 1.3k tokens (0.6%)
|
|
@@ -683,12 +693,13 @@ On the other hand, once run `rulesync generate --targets claudecode --features m
|
|
|
683
693
|
|
|
684
694
|
Focus on the difference of MCP tools usage.
|
|
685
695
|
|
|
686
|
-
|
|
|
687
|
-
|
|
688
|
-
|Disabled Modular MCP| 15.7k tokens (7.9%) |
|
|
689
|
-
|Enabled Modular MCP| 1.3k tokens (0.6%)
|
|
696
|
+
| | Context Usage |
|
|
697
|
+
| -------------------- | ------------------- |
|
|
698
|
+
| Disabled Modular MCP | 15.7k tokens (7.9%) |
|
|
699
|
+
| Enabled Modular MCP | 1.3k tokens (0.6%) |
|
|
690
700
|
|
|
691
701
|
So, in this case, approximately 92% reduction in MCP tools consumption!
|
|
702
|
+
|
|
692
703
|
</details>
|
|
693
704
|
|
|
694
705
|
## Rulesync MCP Server
|