rulesync 6.8.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.
Files changed (4) hide show
  1. package/README.md +57 -175
  2. package/dist/index.cjs +1404 -1135
  3. package/dist/index.js +1394 -1125
  4. 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 | 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 | | โœ… | | | | | |
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
- - **Shared (Cursor and Claude):** `sessionStart`, `sessionEnd`, `preToolUse`, `postToolUse`, `beforeSubmitPrompt`, `stop`, `subagentStop`, `preCompact`
503
- - **Cursor-only:** `postToolUseFailure`, `subagentStart`, `beforeShellExecution`, `afterShellExecution`, `beforeMCPExecution`, `afterMCPExecution`, `beforeReadFile`, `afterFileEdit`, `afterAgentResponse`, `afterAgentThought`, `beforeTabFileRead`, `afterTabFileEdit`
504
- - **Claude-only:** `permissionRequest`, `notification`, `setup`
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
- Use optional **override keys** so tool-specific events and config live in one file without leaking to the other: `cursor.hooks` for Cursor-only events, `claudecode.hooks` for Claude-only. Events in shared `hooks` that a tool does not support are skipped for that tool (and a warning is logged at generate time).
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