rulesync 6.8.1 โ†’ 7.1.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 +187 -152
  2. package/dist/index.cjs +2403 -1525
  3. package/dist/index.js +2392 -1514
  4. package/package.json +3 -1
package/README.md CHANGED
@@ -126,6 +126,8 @@ rulesync init
126
126
 
127
127
  # Install official skills (recommended)
128
128
  rulesync fetch dyoshikawa/rulesync --features skills
129
+
130
+ # Or add skill sources to rulesync.jsonc and run 'rulesync install' (see "Declarative Skill Sources")
129
131
  ```
130
132
 
131
133
  On the other hand, if you already have AI tool configurations:
@@ -147,34 +149,33 @@ rulesync generate --targets "*" --features "*"
147
149
 
148
150
  Rulesync supports both **generation** and **import** for All of the major AI coding tools:
149
151
 
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 | | โœ… | | | | | |
152
+ | Tool | rules | ignore | mcp | commands | subagents | skills | hooks |
153
+ | ------------------ | :---: | :----: | :---: | :------: | :-------: | :----: | :---: |
154
+ | AGENTS.md | โœ… | | | ๐ŸŽฎ | ๐ŸŽฎ | ๐ŸŽฎ | |
155
+ | AgentsSkills | | | | | | โœ… | |
156
+ | Claude Code | โœ… ๐ŸŒ | โœ… | โœ… ๐ŸŒ | โœ… ๐ŸŒ | โœ… ๐ŸŒ | โœ… ๐ŸŒ | โœ… |
157
+ | Codex CLI | โœ… ๐ŸŒ | | ๐ŸŒ | ๐ŸŒ | ๐ŸŽฎ | โœ… ๐ŸŒ | |
158
+ | Gemini CLI | โœ… ๐ŸŒ | โœ… | โœ… ๐ŸŒ | โœ… ๐ŸŒ | ๐ŸŽฎ | โœ… ๐ŸŒ | |
159
+ | GitHub Copilot | โœ… | | โœ… | โœ… | โœ… | โœ… | |
160
+ | Cursor | โœ… | โœ… | โœ… | โœ… ๐ŸŒ | โœ… ๐ŸŒ | โœ… ๐ŸŒ | โœ… |
161
+ | Factory Droid | โœ… ๐ŸŒ | | โœ… ๐ŸŒ | โœ… ๐ŸŒ | โœ… ๐ŸŒ | โœ… ๐ŸŒ | |
162
+ | OpenCode | โœ… | | โœ… | โœ… ๐ŸŒ | โœ… ๐ŸŒ | โœ… ๐ŸŒ | โœ… ๐ŸŒ |
163
+ | Cline | โœ… | โœ… | โœ… | โœ… ๐ŸŒ | | | |
164
+ | Kilo Code | โœ… ๐ŸŒ | โœ… | โœ… | โœ… ๐ŸŒ | | โœ… ๐ŸŒ | |
165
+ | Roo Code | โœ… | โœ… | โœ… | โœ… | ๐ŸŽฎ | โœ… ๐ŸŒ | |
166
+ | Qwen Code | โœ… | โœ… | | | | | |
167
+ | Kiro | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | |
168
+ | Google Antigravity | โœ… | | | โœ… | | โœ… ๐ŸŒ | |
169
+ | JetBrains Junie | โœ… | โœ… | โœ… | | | | |
170
+ | AugmentCode | โœ… | โœ… | | | | | |
171
+ | Windsurf | โœ… | โœ… | | | | | |
172
+ | Warp | โœ… | | | | | | |
173
+ | Replit | โœ… | | | | | โœ… | |
174
+ | Zed | | โœ… | | | | | |
173
175
 
174
176
  - โœ…: Supports project mode
175
177
  - ๐ŸŒ: Supports global mode
176
178
  - ๐ŸŽฎ: Supports simulated commands/subagents/skills (Project mode only)
177
- - ๐Ÿ“ฆ: Supports modular MCP (Experimental)
178
179
 
179
180
  ## Why Rulesync?
180
181
 
@@ -243,6 +244,18 @@ rulesync generate --dry-run --targets claudecode --features rules
243
244
  # Check if files are up to date (for CI/CD pipelines)
244
245
  rulesync generate --check --targets "*" --features "*"
245
246
 
247
+ # Install skills from declarative sources in rulesync.jsonc
248
+ rulesync install
249
+
250
+ # Force re-resolve all source refs (ignore lockfile)
251
+ rulesync install --update
252
+
253
+ # Fail if lockfile is missing or out of sync (for CI)
254
+ rulesync install --frozen
255
+
256
+ # Install then generate (typical workflow)
257
+ rulesync install && rulesync generate
258
+
246
259
  # Add generated files to .gitignore
247
260
  rulesync gitignore
248
261
 
@@ -400,7 +413,13 @@ Example:
400
413
  "simulateCommands": false, // Generate simulated commands
401
414
  "simulateSubagents": false, // Generate simulated subagents
402
415
  "simulateSkills": false, // Generate simulated skills
403
- "modularMcp": false, // Enable modular-mcp for context compression (experimental, Claude Code only)
416
+
417
+ // Declarative skill sources โ€” installed via 'rulesync install'
418
+ // See the "Declarative Skill Sources" section for details.
419
+ // "sources": [
420
+ // { "source": "owner/repo" },
421
+ // { "source": "org/repo", "skills": ["specific-skill"] },
422
+ // ],
404
423
  }
405
424
  ```
406
425
 
@@ -495,15 +514,17 @@ This is Rulesync, a Node.js CLI tool that automatically generates configuration
495
514
 
496
515
  ### `.rulesync/hooks.json`
497
516
 
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`.
517
+ 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
518
 
500
519
  **Event support:**
501
520
 
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`
521
+ - **Cursor:** `sessionStart`, `preToolUse`, `postToolUse`, `stop`, `sessionEnd`, `beforeSubmitPrompt`, `subagentStop`, `preCompact`, `afterFileEdit`, `afterShellExecution`, `postToolUseFailure`, `subagentStart`, `beforeShellExecution`, `beforeMCPExecution`, `afterMCPExecution`, `beforeReadFile`, `afterAgentResponse`, `afterAgentThought`, `beforeTabFileRead`, `afterTabFileEdit`
522
+ - **Claude Code:** `sessionStart`, `preToolUse`, `postToolUse`, `stop`, `sessionEnd`, `beforeSubmitPrompt`, `subagentStop`, `preCompact`, `permissionRequest`, `notification`, `setup`
523
+ - **OpenCode:** `sessionStart`, `preToolUse`, `postToolUse`, `stop`, `afterFileEdit`, `afterShellExecution`, `permissionRequest`
505
524
 
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).
525
+ > **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).
526
+
527
+ 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
528
 
508
529
  Example:
509
530
 
@@ -526,6 +547,11 @@ Example:
526
547
  { "matcher": "permission_prompt", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/notify.sh" }
527
548
  ]
528
549
  }
550
+ },
551
+ "opencode": {
552
+ "hooks": {
553
+ "afterShellExecution": [{ "command": ".rulesync/hooks/post-shell.sh" }]
554
+ }
529
555
  }
530
556
  }
531
557
  ```
@@ -692,20 +718,26 @@ You can use global mode via Rulesync by enabling `--global` option. It can also
692
718
  Currently, supports rules and commands generation for Claude Code. Import for global files is supported for rules and commands.
693
719
 
694
720
  1. Create an any name directory. For example, if you prefer `~/.aiglobal`, run the following command.
721
+
695
722
  ```bash
696
723
  mkdir -p ~/.aiglobal
697
724
  ```
725
+
698
726
  2. Initialize files for global files in the directory.
727
+
699
728
  ```bash
700
729
  cd ~/.aiglobal
701
730
  rulesync init
702
731
  ```
732
+
703
733
  3. Edit `~/.aiglobal/rulesync.jsonc` to enable global mode.
734
+
704
735
  ```jsonc
705
736
  {
706
737
  "global": true,
707
738
  }
708
739
  ```
740
+
709
741
  4. Edit `~/.aiglobal/.rulesync/rules/overview.md` to your preferences.
710
742
 
711
743
  ```md
@@ -719,6 +751,7 @@ Currently, supports rules and commands generation for Claude Code. Import for gl
719
751
  ```
720
752
 
721
753
  5. Generate rules for global settings.
754
+
722
755
  ```bash
723
756
  # Run in the `~/.aiglobal` directory
724
757
  rulesync generate
@@ -737,6 +770,7 @@ Simulated commands, subagents and skills allow you to generate simulated feature
737
770
 
738
771
  1. Prepare `.rulesync/commands/*.md`, `.rulesync/subagents/*.md` and `.rulesync/skills/*/SKILL.md` for your purposes.
739
772
  2. Generate simulated commands, subagents and skills for specific tools that are included in cursor, codexcli and etc.
773
+
740
774
  ```bash
741
775
  rulesync generate \
742
776
  --targets copilot,cursor,codexcli \
@@ -745,6 +779,7 @@ Simulated commands, subagents and skills allow you to generate simulated feature
745
779
  --simulate-subagents \
746
780
  --simulate-skills
747
781
  ```
782
+
748
783
  3. Use simulated commands, subagents and skills in your prompts.
749
784
  - Prompt examples:
750
785
 
@@ -759,160 +794,138 @@ Simulated commands, subagents and skills allow you to generate simulated feature
759
794
  Use the skill your-skill to achieve something.
760
795
  ```
761
796
 
762
- ## Modular MCP (Deprecated)
797
+ ## Official Skills
763
798
 
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`.
799
+ Rulesync provides official skills that you can install using the fetch command or declarative sources:
765
800
 
766
801
  ```bash
767
- # Enable modular-mcp via CLI
768
- rulesync generate --targets claudecode --features mcp --modular-mcp
802
+ # One-time fetch
803
+ rulesync fetch dyoshikawa/rulesync --features skills
769
804
 
770
- # Or via configuration file
771
- {
772
- "modularMcp": true
773
- }
805
+ # Or declare in rulesync.jsonc and run 'rulesync install'
774
806
  ```
775
807
 
776
- When enabling modular-mcp, each MCP server must have a `description` field. Example:
808
+ This will install the Rulesync documentation skill to your project.
777
809
 
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
- ```
810
+ ## Declarative Skill Sources
794
811
 
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.
812
+ Rulesync can fetch skills from external GitHub repositories using the `install` command. Instead of manually running `fetch` for each skill source, declare them in your `rulesync.jsonc` and run `rulesync install` to resolve and fetch them. Then `rulesync generate` picks them up as local curated skills. Typical workflow: `rulesync install && rulesync generate`.
796
813
 
797
- ```diff
798
- // .rulesync/mcp.json
814
+ ### Configuration
815
+
816
+ Add a `sources` array to your `rulesync.jsonc`:
817
+
818
+ ```jsonc
799
819
  {
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
- }
820
+ "$schema": "https://raw.githubusercontent.com/dyoshikawa/rulesync/refs/heads/main/config-schema.json",
821
+ "targets": ["copilot", "claudecode"],
822
+ "features": ["rules", "skills"],
823
+ "sources": [
824
+ // Fetch all skills from a repository
825
+ { "source": "owner/repo" },
826
+
827
+ // Fetch only specific skills by name
828
+ { "source": "anthropics/skills", "skills": ["skill-creator"] },
829
+
830
+ // With ref pinning and subdirectory path (same syntax as fetch command)
831
+ { "source": "owner/repo@v1.0.0:path/to/skills" },
832
+ ],
811
833
  }
812
834
  ```
813
835
 
814
- To demonstrate the effect of modular-mcp, please see the following example:
836
+ Each entry in `sources` accepts:
815
837
 
816
- <details>
817
- <summary>Example of effect</summary>
838
+ | Property | Type | Description |
839
+ | -------- | ---------- | ----------------------------------------------------------------------------------------------------------- |
840
+ | `source` | `string` | Repository source using the same format as the `fetch` command (`owner/repo`, `owner/repo@ref:path`, etc.). |
841
+ | `skills` | `string[]` | Optional list of skill names to fetch. If omitted, all skills are fetched. |
818
842
 
819
- Please see examples using Claude Code.
843
+ ### How It Works
820
844
 
821
- When using following mcp servers:
845
+ When `rulesync install` runs and `sources` is configured:
822
846
 
823
- ```json
824
- // .rulesync/mcp.json
847
+ 1. **Lockfile resolution** โ€” Each source's ref is resolved to a commit SHA and stored in `rulesync.lock` (at the project root). On subsequent runs the locked SHA is reused for deterministic builds.
848
+ 2. **Remote skill listing** โ€” The `skills/` directory (or the path specified in the source URL) is listed from the remote repository.
849
+ 3. **Filtering** โ€” If `skills` is specified, only matching skill directories are fetched.
850
+ 4. **Precedence rules**:
851
+ - **Local skills always win** โ€” Skills in `.rulesync/skills/` (not in `.curated/`) take precedence; a remote skill with the same name is skipped.
852
+ - **First-declared source wins** โ€” If two sources provide a skill with the same name, the one declared first in the `sources` array is used.
853
+ 5. **Output** โ€” Fetched skills are written to `.rulesync/skills/.curated/<skill-name>/`. This directory is automatically added to `.gitignore` by `rulesync gitignore`.
825
854
 
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
- ```
855
+ ### CLI Options
863
856
 
864
- Once run `rulesync generate --targets claudecode --features mcp`, `/context` result on Claude Code is as follows:
857
+ The `install` command accepts these flags:
865
858
 
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
- ```
859
+ | Flag | Description |
860
+ | ----------------- | ------------------------------------------------------------------------------------- |
861
+ | `--update` | Force re-resolve all source refs, ignoring the lockfile (useful to pull new updates). |
862
+ | `--frozen` | Fail if lockfile is missing or out of sync. Useful for CI to ensure reproducibility. |
863
+ | `--token <token>` | GitHub token for private repositories. |
879
864
 
880
- On the other hand, once run `rulesync generate --targets claudecode --features mcp --modular-mcp`, `/context` result on Claude Code is as follows:
865
+ ```bash
866
+ # Install skills using locked refs
867
+ rulesync install
881
868
 
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
- โ› โ› โ› โ› โ› โ› โ› โ› โ› โ›
869
+ # Force update to latest refs
870
+ rulesync install --update
871
+
872
+ # Strict CI mode โ€” fail if lockfile doesn't cover all sources
873
+ rulesync install --frozen
874
+
875
+ # Install then generate
876
+ rulesync install && rulesync generate
877
+
878
+ # Skip source installation โ€” just don't run install
879
+ rulesync generate
894
880
  ```
895
881
 
896
- Focus on the difference of MCP tools usage.
882
+ ### Lockfile
897
883
 
898
- | | Context Usage |
899
- | -------------------- | ------------------- |
900
- | Disabled Modular MCP | 15.7k tokens (7.9%) |
901
- | Enabled Modular MCP | 1.3k tokens (0.6%) |
884
+ The lockfile at `rulesync.lock` (at the project root) records the resolved commit SHA and per-skill integrity hashes for each source so that builds are reproducible. It is safe to commit this file. An example:
902
885
 
903
- So, in this case, approximately 92% reduction in MCP tools consumption!
886
+ ```json
887
+ {
888
+ "lockfileVersion": 1,
889
+ "sources": {
890
+ "owner/skill-repo": {
891
+ "requestedRef": "main",
892
+ "resolvedRef": "abc123def456...",
893
+ "resolvedAt": "2025-01-15T12:00:00.000Z",
894
+ "skills": {
895
+ "my-skill": { "integrity": "sha256-abcdef..." },
896
+ "another-skill": { "integrity": "sha256-123456..." }
897
+ }
898
+ }
899
+ }
900
+ }
901
+ ```
904
902
 
905
- </details>
903
+ To update locked refs, run `rulesync install --update`.
906
904
 
907
- ## Official Skills
905
+ ### Authentication
908
906
 
909
- Rulesync provides official skills that you can install using the fetch command:
907
+ Source fetching uses the `GITHUB_TOKEN` or `GH_TOKEN` environment variable for authentication. This is required for private repositories and recommended for better rate limits.
910
908
 
911
909
  ```bash
912
- rulesync fetch dyoshikawa/rulesync --features skills
910
+ # Using environment variable
911
+ export GITHUB_TOKEN=ghp_xxxx
912
+ npx rulesync install
913
+
914
+ # Or using GitHub CLI
915
+ GITHUB_TOKEN=$(gh auth token) npx rulesync install
913
916
  ```
914
917
 
915
- This will install the Rulesync documentation skill to your project.
918
+ > [!TIP]
919
+ > The `install` command also accepts a `--token` flag for explicit authentication: `rulesync install --token ghp_xxxx`.
920
+
921
+ ### Curated vs Local Skills
922
+
923
+ | Location | Type | Precedence | Committed to Git |
924
+ | ----------------------------------- | ------- | ---------- | ---------------- |
925
+ | `.rulesync/skills/<name>/` | Local | Highest | Yes |
926
+ | `.rulesync/skills/.curated/<name>/` | Curated | Lower | No (gitignored) |
927
+
928
+ When both a local and a curated skill share the same name, the local skill is used and the remote one is not fetched.
916
929
 
917
930
  ## Rulesync MCP Server
918
931
 
@@ -950,7 +963,7 @@ Add the Rulesync MCP server to your `.rulesync/mcp.json`:
950
963
 
951
964
  ## FAQ
952
965
 
953
- ### Q. The generated `.mcp.json` doesn't work properly in Claude Code.
966
+ ### Q. The generated `.mcp.json` doesn't work properly in Claude Code
954
967
 
955
968
  You can try adding the following to `.claude/settings.json` or `.claude/settings.local.json`:
956
969
 
@@ -964,6 +977,28 @@ According to [the documentation](https://code.claude.com/docs/en/settings), this
964
977
 
965
978
  > Automatically approve all MCP servers defined in project .mcp.json files
966
979
 
980
+ ### Q. Google Antigravity doesn't load rules when `.agent` directories are in `.gitignore`
981
+
982
+ 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.
983
+
984
+ **Workaround:** Instead of adding these directories to `.gitignore`, add them to `.git/info/exclude`:
985
+
986
+ ```bash
987
+ # Remove from .gitignore (if present)
988
+ # **/.agent/rules/
989
+ # **/.agent/workflows/
990
+ # **/.agent/skills/
991
+
992
+ # Add to .git/info/exclude
993
+ echo "**/.agent/rules/" >> .git/info/exclude
994
+ echo "**/.agent/workflows/" >> .git/info/exclude
995
+ echo "**/.agent/skills/" >> .git/info/exclude
996
+ ```
997
+
998
+ `.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.
999
+
1000
+ Note: `.git/info/exclude` can't be shared with your team since it's not committed to the repository.
1001
+
967
1002
  ## License
968
1003
 
969
1004
  MIT License