rulesync 6.3.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 +105 -64
  2. package/dist/index.cjs +3057 -1135
  3. package/dist/index.js +3002 -1080
  4. package/package.json +4 -1
package/README.md CHANGED
@@ -133,11 +133,13 @@ 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 | ✅ 🌏 | ✅ | ✅ 🌏 | ✅ 🌏 | 🎮 | 🎮 | |
139
140
  | GitHub Copilot | ✅ | | ✅ | ✅ | ✅ | ✅ | |
140
141
  | Cursor | ✅ | ✅ | ✅ | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 | ✅ |
142
+ | Factory Droid | ✅ 🌏 | | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 | |
141
143
  | OpenCode | ✅ | | ✅ | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 | |
142
144
  | Cline | ✅ | ✅ | ✅ | ✅ 🌏 | | | |
143
145
  | Kilo Code | ✅ 🌏 | ✅ | ✅ | ✅ 🌏 | | ✅ 🌏 | |
@@ -200,6 +202,11 @@ npx rulesync init
200
202
  # Import existing configurations (to .rulesync/rules/ by default)
201
203
  npx rulesync import --targets claudecode --features rules,ignore,mcp,commands,subagents,skills
202
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
+
203
210
  # Generate all features for all tools (new preferred syntax)
204
211
  npx rulesync generate --targets "*" --features "*"
205
212
 
@@ -213,10 +220,106 @@ npx rulesync generate --targets "*" --features rules
213
220
  # Generate simulated commands and subagents
214
221
  npx rulesync generate --targets copilot,cursor,codexcli --features commands,subagents --simulate-commands --simulate-subagents
215
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
+
216
229
  # Add generated files to .gitignore
217
230
  npx rulesync gitignore
218
231
  ```
219
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
+
220
323
  ## Configuration
221
324
 
222
325
  You can configure Rulesync by creating a `rulesync.jsonc` file in the root of your project.
@@ -247,7 +350,7 @@ Example:
247
350
  "targets": ["cursor", "claudecode", "geminicli", "opencode", "codexcli"],
248
351
 
249
352
  // Features to generate. You can specify "*" to generate all features.
250
- "features": ["rules", "ignore", "mcp", "commands", "subagents"],
353
+ "features": ["rules", "ignore", "mcp", "commands", "subagents", "hooks"],
251
354
 
252
355
  // Base directories for generation.
253
356
  // Basically, you can specify a `["."]` only.
@@ -627,7 +730,7 @@ Simulated commands, subagents and skills allow you to generate simulated feature
627
730
  Use the skill your-skill to achieve something.
628
731
  ```
629
732
 
630
- ## Modular MCP (Experimental)
733
+ ## Modular MCP (Deprecated)
631
734
 
632
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`.
633
736
 
@@ -779,68 +882,6 @@ Rulesync provides an MCP (Model Context Protocol) server that enables AI agents
779
882
  > [!NOTE]
780
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.
781
884
 
782
- ### Available Tools
783
-
784
- The Rulesync MCP server provides the following tools:
785
-
786
- <details>
787
- <summary>Rules Management</summary>
788
-
789
- - `list` - List all rule files
790
- - `get` - Get a specific rule file
791
- - `put` - Create or update a rule file
792
- - `delete` - Delete a rule file
793
-
794
- </details>
795
-
796
- <details>
797
- <summary>Commands Management</summary>
798
-
799
- - `list` - List all command files
800
- - `get` - Get a specific command file
801
- - `put` - Create or update a command file
802
- - `delete` - Delete a command file
803
-
804
- </details>
805
-
806
- <details>
807
- <summary>Subagents Management</summary>
808
-
809
- - `list` - List all subagent files
810
- - `get` - Get a specific subagent file
811
- - `put` - Create or update a subagent file
812
- - `delete` - Delete a subagent file
813
-
814
- </details>
815
-
816
- <details>
817
- <summary>Skills Management</summary>
818
-
819
- - `list` - List all skill directories
820
- - `get` - Get a specific skill (SKILL.md and other files)
821
- - `put` - Create or update a skill directory
822
- - `delete` - Delete a skill directory
823
-
824
- </details>
825
-
826
- <details>
827
- <summary>Ignore Files Management</summary>
828
-
829
- - `getIgnoreFile` - Get the ignore file
830
- - `putIgnoreFile` - Create or update the ignore file
831
- - `deleteIgnoreFile` - Delete the ignore file
832
-
833
- </details>
834
-
835
- <details>
836
- <summary>MCP Configuration Management</summary>
837
-
838
- - `getMcpFile` - Get the MCP configuration file
839
- - `putMcpFile` - Create or update the MCP configuration file
840
- - `deleteMcpFile` - Delete the MCP configuration file
841
-
842
- </details>
843
-
844
885
  ### Usage
845
886
 
846
887
  #### Starting the MCP Server