rulesync 6.7.1 โ 7.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.
- package/README.md +57 -175
- package/dist/index.cjs +1505 -1075
- package/dist/index.js +1471 -1041
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -147,34 +147,33 @@ rulesync generate --targets "*" --features "*"
|
|
|
147
147
|
|
|
148
148
|
Rulesync supports both **generation** and **import** for All of the major AI coding tools:
|
|
149
149
|
|
|
150
|
-
| Tool | rules | ignore |
|
|
151
|
-
| ------------------ | :---: | :----: |
|
|
152
|
-
| AGENTS.md | โ
| |
|
|
153
|
-
| AgentsSkills | | |
|
|
154
|
-
| Claude Code | โ
๐ | โ
| โ
๐
|
|
155
|
-
| Codex CLI | โ
๐ | |
|
|
156
|
-
| Gemini CLI | โ
๐ | โ
|
|
|
157
|
-
| GitHub Copilot | โ
| |
|
|
158
|
-
| Cursor | โ
| โ
|
|
|
159
|
-
| Factory Droid | โ
๐ | |
|
|
160
|
-
| OpenCode | โ
| |
|
|
161
|
-
| Cline | โ
| โ
|
|
|
162
|
-
| Kilo Code | โ
๐ | โ
|
|
|
163
|
-
| Roo Code | โ
| โ
|
|
|
164
|
-
| Qwen Code | โ
| โ
|
|
|
165
|
-
| Kiro | โ
| โ
|
|
|
166
|
-
| Google Antigravity | โ
| |
|
|
167
|
-
| JetBrains Junie | โ
| โ
|
|
|
168
|
-
| AugmentCode | โ
| โ
|
|
|
169
|
-
| Windsurf | โ
| โ
|
|
|
170
|
-
| Warp | โ
| |
|
|
171
|
-
| Replit | โ
| |
|
|
172
|
-
| Zed | | โ
|
|
|
150
|
+
| Tool | rules | ignore | mcp | commands | subagents | skills | hooks |
|
|
151
|
+
| ------------------ | :---: | :----: | :---: | :------: | :-------: | :----: | :---: |
|
|
152
|
+
| AGENTS.md | โ
| | | ๐ฎ | ๐ฎ | ๐ฎ | |
|
|
153
|
+
| AgentsSkills | | | | | | โ
| |
|
|
154
|
+
| Claude Code | โ
๐ | โ
| โ
๐ | โ
๐ | โ
๐ | โ
๐ | โ
|
|
|
155
|
+
| Codex CLI | โ
๐ | | ๐ | ๐ | ๐ฎ | โ
๐ | |
|
|
156
|
+
| Gemini CLI | โ
๐ | โ
| โ
๐ | โ
๐ | ๐ฎ | โ
๐ | |
|
|
157
|
+
| GitHub Copilot | โ
| | โ
| โ
| โ
| โ
| |
|
|
158
|
+
| Cursor | โ
| โ
| โ
| โ
๐ | โ
๐ | โ
๐ | โ
|
|
|
159
|
+
| Factory Droid | โ
๐ | | โ
๐ | โ
๐ | โ
๐ | โ
๐ | |
|
|
160
|
+
| OpenCode | โ
| | โ
| โ
๐ | โ
๐ | โ
๐ | โ
๐ |
|
|
161
|
+
| Cline | โ
| โ
| โ
| โ
๐ | | | |
|
|
162
|
+
| Kilo Code | โ
๐ | โ
| โ
| โ
๐ | | โ
๐ | |
|
|
163
|
+
| Roo Code | โ
| โ
| โ
| โ
| ๐ฎ | โ
๐ | |
|
|
164
|
+
| Qwen Code | โ
| โ
| | | | | |
|
|
165
|
+
| Kiro | โ
| โ
| โ
| โ
| โ
| โ
| |
|
|
166
|
+
| Google Antigravity | โ
| | | โ
| | โ
๐ | |
|
|
167
|
+
| JetBrains Junie | โ
| โ
| โ
| | | | |
|
|
168
|
+
| AugmentCode | โ
| โ
| | | | | |
|
|
169
|
+
| Windsurf | โ
| โ
| | | | | |
|
|
170
|
+
| Warp | โ
| | | | | | |
|
|
171
|
+
| Replit | โ
| | | | | โ
| |
|
|
172
|
+
| Zed | | โ
| | | | | |
|
|
173
173
|
|
|
174
174
|
- โ
: Supports project mode
|
|
175
175
|
- ๐: Supports global mode
|
|
176
176
|
- ๐ฎ: Supports simulated commands/subagents/skills (Project mode only)
|
|
177
|
-
- ๐ฆ: Supports modular MCP (Experimental)
|
|
178
177
|
|
|
179
178
|
## Why Rulesync?
|
|
180
179
|
|
|
@@ -400,7 +399,6 @@ Example:
|
|
|
400
399
|
"simulateCommands": false, // Generate simulated commands
|
|
401
400
|
"simulateSubagents": false, // Generate simulated subagents
|
|
402
401
|
"simulateSkills": false, // Generate simulated skills
|
|
403
|
-
"modularMcp": false, // Enable modular-mcp for context compression (experimental, Claude Code only)
|
|
404
402
|
}
|
|
405
403
|
```
|
|
406
404
|
|
|
@@ -495,15 +493,17 @@ This is Rulesync, a Node.js CLI tool that automatically generates configuration
|
|
|
495
493
|
|
|
496
494
|
### `.rulesync/hooks.json`
|
|
497
495
|
|
|
498
|
-
Hooks run scripts at lifecycle events (e.g. session start, before tool use). Events use **canonical camelCase** in this file; Cursor uses them as-is; Claude Code gets PascalCase in `.claude/settings.json`.
|
|
496
|
+
Hooks run scripts at lifecycle events (e.g. session start, before tool use). Events use **canonical camelCase** in this file; Cursor uses them as-is; Claude Code gets PascalCase in `.claude/settings.json`; OpenCode hooks are generated as a JavaScript plugin at `.opencode/plugins/rulesync-hooks.js`.
|
|
499
497
|
|
|
500
498
|
**Event support:**
|
|
501
499
|
|
|
502
|
-
- **
|
|
503
|
-
- **
|
|
504
|
-
- **
|
|
500
|
+
- **Cursor:** `sessionStart`, `preToolUse`, `postToolUse`, `stop`, `sessionEnd`, `beforeSubmitPrompt`, `subagentStop`, `preCompact`, `afterFileEdit`, `afterShellExecution`, `postToolUseFailure`, `subagentStart`, `beforeShellExecution`, `beforeMCPExecution`, `afterMCPExecution`, `beforeReadFile`, `afterAgentResponse`, `afterAgentThought`, `beforeTabFileRead`, `afterTabFileEdit`
|
|
501
|
+
- **Claude Code:** `sessionStart`, `preToolUse`, `postToolUse`, `stop`, `sessionEnd`, `beforeSubmitPrompt`, `subagentStop`, `preCompact`, `permissionRequest`, `notification`, `setup`
|
|
502
|
+
- **OpenCode:** `sessionStart`, `preToolUse`, `postToolUse`, `stop`, `afterFileEdit`, `afterShellExecution`, `permissionRequest`
|
|
505
503
|
|
|
506
|
-
|
|
504
|
+
> **Note:** Rulesync implements OpenCode hooks as a plugin, so importing from OpenCode to rulesync is not supported. OpenCode only supports command-type hooks (not prompt-type).
|
|
505
|
+
|
|
506
|
+
Use optional **override keys** so tool-specific events and config live in one file without leaking to others: `cursor.hooks` for Cursor-only events, `claudecode.hooks` for Claude-only, `opencode.hooks` for OpenCode-only. Events in shared `hooks` that a tool does not support are skipped for that tool (and a warning is logged at generate time).
|
|
507
507
|
|
|
508
508
|
Example:
|
|
509
509
|
|
|
@@ -526,6 +526,11 @@ Example:
|
|
|
526
526
|
{ "matcher": "permission_prompt", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/notify.sh" }
|
|
527
527
|
]
|
|
528
528
|
}
|
|
529
|
+
},
|
|
530
|
+
"opencode": {
|
|
531
|
+
"hooks": {
|
|
532
|
+
"afterShellExecution": [{ "command": ".rulesync/hooks/post-shell.sh" }]
|
|
533
|
+
}
|
|
529
534
|
}
|
|
530
535
|
}
|
|
531
536
|
```
|
|
@@ -759,151 +764,6 @@ Simulated commands, subagents and skills allow you to generate simulated feature
|
|
|
759
764
|
Use the skill your-skill to achieve something.
|
|
760
765
|
```
|
|
761
766
|
|
|
762
|
-
## Modular MCP (Deprecated)
|
|
763
|
-
|
|
764
|
-
Rulesync supports compressing tokens consumed by MCP servers [d-kimuson/modular-mcp](https://github.com/d-kimuson/modular-mcp) for context saving. When enabled with `--modular-mcp`, it additionally generates `modular-mcp.json`.
|
|
765
|
-
|
|
766
|
-
```bash
|
|
767
|
-
# Enable modular-mcp via CLI
|
|
768
|
-
rulesync generate --targets claudecode --features mcp --modular-mcp
|
|
769
|
-
|
|
770
|
-
# Or via configuration file
|
|
771
|
-
{
|
|
772
|
-
"modularMcp": true
|
|
773
|
-
}
|
|
774
|
-
```
|
|
775
|
-
|
|
776
|
-
When enabling modular-mcp, each MCP server must have a `description` field. Example:
|
|
777
|
-
|
|
778
|
-
```diff
|
|
779
|
-
// .rulesync/mcp.json
|
|
780
|
-
{
|
|
781
|
-
"mcpServers": {
|
|
782
|
-
"context7": {
|
|
783
|
-
+ "description": "Up-to-date documentation and code examples for libraries",
|
|
784
|
-
"type": "stdio",
|
|
785
|
-
"command": "npx",
|
|
786
|
-
"args": [
|
|
787
|
-
"-y",
|
|
788
|
-
"@upstash/context7-mcp"
|
|
789
|
-
],
|
|
790
|
-
"env": {}
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
```
|
|
794
|
-
|
|
795
|
-
You can also configure `exposed` to exclude specific MCP servers from modular-mcp. It is optional and default to `false`. If you specify `exposed: true`, the MCP server is always loaded in the initial context.
|
|
796
|
-
|
|
797
|
-
```diff
|
|
798
|
-
// .rulesync/mcp.json
|
|
799
|
-
{
|
|
800
|
-
"mcpServers": {
|
|
801
|
-
"context7": {
|
|
802
|
-
+ "exposed": true,
|
|
803
|
-
"type": "stdio",
|
|
804
|
-
"command": "npx",
|
|
805
|
-
"args": [
|
|
806
|
-
"-y",
|
|
807
|
-
"@upstash/context7-mcp"
|
|
808
|
-
],
|
|
809
|
-
"env": {}
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
```
|
|
813
|
-
|
|
814
|
-
To demonstrate the effect of modular-mcp, please see the following example:
|
|
815
|
-
|
|
816
|
-
<details>
|
|
817
|
-
<summary>Example of effect</summary>
|
|
818
|
-
|
|
819
|
-
Please see examples using Claude Code.
|
|
820
|
-
|
|
821
|
-
When using following mcp servers:
|
|
822
|
-
|
|
823
|
-
```json
|
|
824
|
-
// .rulesync/mcp.json
|
|
825
|
-
|
|
826
|
-
{
|
|
827
|
-
"mcpServers": {
|
|
828
|
-
"serena": {
|
|
829
|
-
"description": "Semantic coding tools for intelligent codebase exploration and manipulation",
|
|
830
|
-
"type": "stdio",
|
|
831
|
-
"command": "uvx",
|
|
832
|
-
"args": [
|
|
833
|
-
"--from",
|
|
834
|
-
"git+https://github.com/oraios/serena",
|
|
835
|
-
"serena",
|
|
836
|
-
"start-mcp-server",
|
|
837
|
-
"--context",
|
|
838
|
-
"ide-assistant",
|
|
839
|
-
"--enable-web-dashboard",
|
|
840
|
-
"false",
|
|
841
|
-
"--project",
|
|
842
|
-
"."
|
|
843
|
-
],
|
|
844
|
-
"env": {}
|
|
845
|
-
},
|
|
846
|
-
"context7": {
|
|
847
|
-
"description": "Up-to-date documentation and code examples for libraries",
|
|
848
|
-
"type": "stdio",
|
|
849
|
-
"command": "npx",
|
|
850
|
-
"args": ["-y", "@upstash/context7-mcp"],
|
|
851
|
-
"env": {}
|
|
852
|
-
},
|
|
853
|
-
"fetch": {
|
|
854
|
-
"description": "This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.",
|
|
855
|
-
"type": "stdio",
|
|
856
|
-
"command": "uvx",
|
|
857
|
-
"args": ["mcp-server-fetch"],
|
|
858
|
-
"env": {}
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
```
|
|
863
|
-
|
|
864
|
-
Once run `rulesync generate --targets claudecode --features mcp`, `/context` result on Claude Code is as follows:
|
|
865
|
-
|
|
866
|
-
```
|
|
867
|
-
Context Usage
|
|
868
|
-
โ โ โ โ โ โ โ โ โ โ claude-sonnet-4-5-20250929 ยท 82k/200k tokens (41%)
|
|
869
|
-
โ โ โ โ โ โ โ โ โ โ
|
|
870
|
-
โถ โถ โถ โถ โถ โถ โถ โถ โถ โถ โ System prompt: 2.5k tokens (1.3%)
|
|
871
|
-
โถ โถ โถ โถ โถ โถ โถ โถ โถ โถ โ System tools: 13.9k tokens (6.9%)
|
|
872
|
-
โถ โถ โถ โถ โถ โถ โถ โถ โถ โถ โ MCP tools: 15.7k tokens (7.9%)
|
|
873
|
-
โถ โถ โถ โถ โถ โถ โถ โถ โถ โถ โ Memory files: 5.2k tokens (2.6%)
|
|
874
|
-
โถ โถ โถ โถ โถ โถ โถ โถ โถ โถ โ Messages: 8 tokens (0.0%)
|
|
875
|
-
โถ โถ โถ โถ โถ โถ โถ โ โ โ โถ Free space: 118k (58.8%)
|
|
876
|
-
โ โ โ โ โ โ โ โ โ โ โ Autocompact buffer: 45.0k tokens (22.5%)
|
|
877
|
-
โ โ โ โ โ โ โ โ โ โ
|
|
878
|
-
```
|
|
879
|
-
|
|
880
|
-
On the other hand, once run `rulesync generate --targets claudecode --features mcp --modular-mcp`, `/context` result on Claude Code is as follows:
|
|
881
|
-
|
|
882
|
-
```
|
|
883
|
-
Context Usage
|
|
884
|
-
โ โ โ โ โ โ โ โ โ โ claude-sonnet-4-5-20250929 ยท 68k/200k tokens (34%)
|
|
885
|
-
โ โ โ โถ โถ โถ โถ โถ โถ โถ
|
|
886
|
-
โถ โถ โถ โถ โถ โถ โถ โถ โถ โถ โ System prompt: 2.5k tokens (1.3%)
|
|
887
|
-
โถ โถ โถ โถ โถ โถ โถ โถ โถ โถ โ System tools: 13.5k tokens (6.8%)
|
|
888
|
-
โถ โถ โถ โถ โถ โถ โถ โถ โถ โถ โ MCP tools: 1.3k tokens (0.6%)
|
|
889
|
-
โถ โถ โถ โถ โถ โถ โถ โถ โถ โถ โ Memory files: 5.2k tokens (2.6%)
|
|
890
|
-
โถ โถ โถ โถ โถ โถ โถ โถ โถ โถ โ Messages: 8 tokens (0.0%)
|
|
891
|
-
โถ โถ โถ โถ โถ โถ โถ โ โ โ โถ Free space: 132k (66.2%)
|
|
892
|
-
โ โ โ โ โ โ โ โ โ โ โ Autocompact buffer: 45.0k tokens (22.5%)
|
|
893
|
-
โ โ โ โ โ โ โ โ โ โ
|
|
894
|
-
```
|
|
895
|
-
|
|
896
|
-
Focus on the difference of MCP tools usage.
|
|
897
|
-
|
|
898
|
-
| | Context Usage |
|
|
899
|
-
| -------------------- | ------------------- |
|
|
900
|
-
| Disabled Modular MCP | 15.7k tokens (7.9%) |
|
|
901
|
-
| Enabled Modular MCP | 1.3k tokens (0.6%) |
|
|
902
|
-
|
|
903
|
-
So, in this case, approximately 92% reduction in MCP tools consumption!
|
|
904
|
-
|
|
905
|
-
</details>
|
|
906
|
-
|
|
907
767
|
## Official Skills
|
|
908
768
|
|
|
909
769
|
Rulesync provides official skills that you can install using the fetch command:
|
|
@@ -964,6 +824,28 @@ According to [the documentation](https://code.claude.com/docs/en/settings), this
|
|
|
964
824
|
|
|
965
825
|
> Automatically approve all MCP servers defined in project .mcp.json files
|
|
966
826
|
|
|
827
|
+
### Q. Google Antigravity doesn't load rules when `.agent` directories are in `.gitignore`
|
|
828
|
+
|
|
829
|
+
Google Antigravity has a known limitation where it won't load rules, workflows, and skills if the `.agent/rules/`, `.agent/workflows/`, and `.agent/skills/` directories are listed in `.gitignore`, even with "Agent Gitignore Access" enabled.
|
|
830
|
+
|
|
831
|
+
**Workaround:** Instead of adding these directories to `.gitignore`, add them to `.git/info/exclude`:
|
|
832
|
+
|
|
833
|
+
```bash
|
|
834
|
+
# Remove from .gitignore (if present)
|
|
835
|
+
# **/.agent/rules/
|
|
836
|
+
# **/.agent/workflows/
|
|
837
|
+
# **/.agent/skills/
|
|
838
|
+
|
|
839
|
+
# Add to .git/info/exclude
|
|
840
|
+
echo "**/.agent/rules/" >> .git/info/exclude
|
|
841
|
+
echo "**/.agent/workflows/" >> .git/info/exclude
|
|
842
|
+
echo "**/.agent/skills/" >> .git/info/exclude
|
|
843
|
+
```
|
|
844
|
+
|
|
845
|
+
`.git/info/exclude` works like `.gitignore` but is local-only, so it won't affect Antigravity's ability to load the rules while still excluding these directories from Git.
|
|
846
|
+
|
|
847
|
+
Note: `.git/info/exclude` can't be shared with your team since it's not committed to the repository.
|
|
848
|
+
|
|
967
849
|
## License
|
|
968
850
|
|
|
969
851
|
MIT License
|