rulesync 6.4.0 → 6.5.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 +104 -64
  2. package/dist/index.cjs +2549 -980
  3. package/dist/index.js +2518 -949
  4. package/package.json +4 -1
package/README.md CHANGED
@@ -133,6 +133,7 @@ Rulesync supports both **generation** and **import** for All of the major AI cod
133
133
  | Tool | rules | ignore | mcp | commands | subagents | skills | hooks |
134
134
  | ------------------ | :---: | :----: | :------: | :------: | :-------: | :----: | :---: |
135
135
  | AGENTS.md | ✅ | | | 🎮 | 🎮 | 🎮 | |
136
+ | AgentsSkills | | | | | | ✅ | |
136
137
  | Claude Code | ✅ 🌏 | ✅ | ✅ 🌏 📦 | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 | ✅ |
137
138
  | Codex CLI | ✅ 🌏 | | 🌏 | 🌏 | 🎮 | ✅ 🌏 | |
138
139
  | Gemini CLI | ✅ 🌏 | ✅ | ✅ 🌏 | ✅ 🌏 | 🎮 | 🎮 | |
@@ -201,6 +202,11 @@ npx rulesync init
201
202
  # Import existing configurations (to .rulesync/rules/ by default)
202
203
  npx rulesync import --targets claudecode --features rules,ignore,mcp,commands,subagents,skills
203
204
 
205
+ # Fetch configurations from a Git repository
206
+ npx rulesync fetch owner/repo
207
+ npx rulesync fetch owner/repo@v1.0.0 --features rules,commands
208
+ npx rulesync fetch https://github.com/owner/repo --conflict skip
209
+
204
210
  # Generate all features for all tools (new preferred syntax)
205
211
  npx rulesync generate --targets "*" --features "*"
206
212
 
@@ -214,10 +220,106 @@ npx rulesync generate --targets "*" --features rules
214
220
  # Generate simulated commands and subagents
215
221
  npx rulesync generate --targets copilot,cursor,codexcli --features commands,subagents --simulate-commands --simulate-subagents
216
222
 
223
+ # Preview changes without writing files (dry-run mode)
224
+ npx rulesync generate --dry-run --targets claudecode --features rules
225
+
226
+ # Check if files are up to date (for CI/CD pipelines)
227
+ npx rulesync generate --check --targets "*" --features "*"
228
+
217
229
  # Add generated files to .gitignore
218
230
  npx rulesync gitignore
219
231
  ```
220
232
 
233
+ ## Preview Modes
234
+
235
+ Rulesync provides two preview modes for the `generate` command that allow you to see what changes would be made without actually writing files:
236
+
237
+ ### `--dry-run`
238
+
239
+ Preview changes without writing any files. Shows what would be written or deleted with a `[PREVIEW]` prefix.
240
+
241
+ ```bash
242
+ npx rulesync generate --dry-run --targets claudecode --features rules
243
+ ```
244
+
245
+ ### `--check`
246
+
247
+ Same as `--dry-run`, but exits with code 1 if files are not up to date. This is useful for CI/CD pipelines to verify that generated files are committed.
248
+
249
+ ```bash
250
+ # In your CI pipeline
251
+ npx rulesync generate --check --targets "*" --features "*"
252
+ echo $? # 0 if up to date, 1 if changes needed
253
+ ```
254
+
255
+ > [!NOTE]
256
+ > `--dry-run` and `--check` cannot be used together.
257
+
258
+ ## Fetch Command (Experimental)
259
+
260
+ The `fetch` command allows you to fetch configuration files directly from a Git repository (GitHub/GitLab).
261
+
262
+ > [!WARNING]
263
+ > This feature is experimental and may change in future releases.
264
+
265
+ **Note:** The fetch command searches for feature directories (`rules/`, `commands/`, `skills/`, `subagents/`, etc.) directly at the specified path, without requiring a `.rulesync/` directory structure. This allows fetching from external repositories like `vercel-labs/agent-skills` or `anthropics/skills`.
266
+
267
+ ### Source Formats
268
+
269
+ ```bash
270
+ # Full URL format
271
+ npx rulesync fetch https://github.com/owner/repo
272
+ npx rulesync fetch https://github.com/owner/repo/tree/branch
273
+ npx rulesync fetch https://github.com/owner/repo/tree/branch/path/to/subdir
274
+ npx rulesync fetch https://gitlab.com/owner/repo # GitLab (planned)
275
+
276
+ # Prefix format
277
+ npx rulesync fetch github:owner/repo
278
+ npx rulesync fetch gitlab:owner/repo # GitLab (planned)
279
+
280
+ # Shorthand format (defaults to GitHub)
281
+ npx rulesync fetch owner/repo
282
+ npx rulesync fetch owner/repo@ref # Specify branch/tag/commit
283
+ npx rulesync fetch owner/repo:path # Specify subdirectory
284
+ npx rulesync fetch owner/repo@ref:path # Both ref and path
285
+ ```
286
+
287
+ ### Options
288
+
289
+ | Option | Description | Default |
290
+ | ----------------------- | ------------------------------------------------------------------------------------------ | -------------------------------- |
291
+ | `--target, -t <target>` | Target format to interpret files as (e.g., 'rulesync', 'claudecode') | `rulesync` |
292
+ | `--features <features>` | Comma-separated features to fetch (rules, commands, subagents, skills, ignore, mcp, hooks) | `*` (all) |
293
+ | `--output <dir>` | Output directory relative to project root | `.rulesync` |
294
+ | `--conflict <strategy>` | Conflict resolution: `overwrite` or `skip` | `overwrite` |
295
+ | `--ref <ref>` | Git ref (branch/tag/commit) to fetch from | Default branch |
296
+ | `--path <path>` | Subdirectory in the repository | `.` (root) |
297
+ | `--token <token>` | Git provider token for private repositories | `GITHUB_TOKEN` or `GH_TOKEN` env |
298
+
299
+ ### Examples
300
+
301
+ ```bash
302
+ # Fetch skills from external repositories
303
+ npx rulesync fetch vercel-labs/agent-skills --features skills
304
+ npx rulesync fetch anthropics/skills --features skills
305
+
306
+ # Fetch all features from a public repository
307
+ npx rulesync fetch dyoshikawa/rulesync --path .rulesync
308
+
309
+ # Fetch only rules and commands from a specific tag
310
+ npx rulesync fetch owner/repo@v1.0.0 --features rules,commands
311
+
312
+ # Fetch from a private repository (uses GITHUB_TOKEN env var)
313
+ export GITHUB_TOKEN=ghp_xxxx
314
+ npx rulesync fetch owner/private-repo
315
+
316
+ # Preserve existing files (skip conflicts)
317
+ npx rulesync fetch owner/repo --conflict skip
318
+
319
+ # Fetch from a monorepo subdirectory
320
+ npx rulesync fetch owner/repo:packages/my-package
321
+ ```
322
+
221
323
  ## Configuration
222
324
 
223
325
  You can configure Rulesync by creating a `rulesync.jsonc` file in the root of your project.
@@ -248,7 +350,7 @@ Example:
248
350
  "targets": ["cursor", "claudecode", "geminicli", "opencode", "codexcli"],
249
351
 
250
352
  // Features to generate. You can specify "*" to generate all features.
251
- "features": ["rules", "ignore", "mcp", "commands", "subagents"],
353
+ "features": ["rules", "ignore", "mcp", "commands", "subagents", "hooks"],
252
354
 
253
355
  // Base directories for generation.
254
356
  // Basically, you can specify a `["."]` only.
@@ -628,7 +730,7 @@ Simulated commands, subagents and skills allow you to generate simulated feature
628
730
  Use the skill your-skill to achieve something.
629
731
  ```
630
732
 
631
- ## Modular MCP (Experimental)
733
+ ## Modular MCP (Deprecated)
632
734
 
633
735
  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`.
634
736
 
@@ -780,68 +882,6 @@ Rulesync provides an MCP (Model Context Protocol) server that enables AI agents
780
882
  > [!NOTE]
781
883
  > The MCP server exposes the only one tool to minimize your agent's token usage. Approximately less than 1k tokens for the tool definition.
782
884
 
783
- ### Available Tools
784
-
785
- The Rulesync MCP server provides the following tools:
786
-
787
- <details>
788
- <summary>Rules Management</summary>
789
-
790
- - `list` - List all rule files
791
- - `get` - Get a specific rule file
792
- - `put` - Create or update a rule file
793
- - `delete` - Delete a rule file
794
-
795
- </details>
796
-
797
- <details>
798
- <summary>Commands Management</summary>
799
-
800
- - `list` - List all command files
801
- - `get` - Get a specific command file
802
- - `put` - Create or update a command file
803
- - `delete` - Delete a command file
804
-
805
- </details>
806
-
807
- <details>
808
- <summary>Subagents Management</summary>
809
-
810
- - `list` - List all subagent files
811
- - `get` - Get a specific subagent file
812
- - `put` - Create or update a subagent file
813
- - `delete` - Delete a subagent file
814
-
815
- </details>
816
-
817
- <details>
818
- <summary>Skills Management</summary>
819
-
820
- - `list` - List all skill directories
821
- - `get` - Get a specific skill (SKILL.md and other files)
822
- - `put` - Create or update a skill directory
823
- - `delete` - Delete a skill directory
824
-
825
- </details>
826
-
827
- <details>
828
- <summary>Ignore Files Management</summary>
829
-
830
- - `getIgnoreFile` - Get the ignore file
831
- - `putIgnoreFile` - Create or update the ignore file
832
- - `deleteIgnoreFile` - Delete the ignore file
833
-
834
- </details>
835
-
836
- <details>
837
- <summary>MCP Configuration Management</summary>
838
-
839
- - `getMcpFile` - Get the MCP configuration file
840
- - `putMcpFile` - Create or update the MCP configuration file
841
- - `deleteMcpFile` - Delete the MCP configuration file
842
-
843
- </details>
844
-
845
885
  ### Usage
846
886
 
847
887
  #### Starting the MCP Server