rulesync 6.2.0 → 6.4.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 +59 -21
  2. package/dist/index.cjs +2108 -914
  3. package/dist/index.js +2112 -918
  4. package/package.json +17 -17
package/README.md CHANGED
@@ -130,27 +130,28 @@ npx rulesync generate --targets "*" --features "*"
130
130
 
131
131
  Rulesync supports both **generation** and **import** for All of the major AI coding tools:
132
132
 
133
- | Tool | rules | ignore | mcp | commands | subagents | skills |
134
- | ------------------ | :---: | :----: | :------: | :------: | :-------: | :----: |
135
- | AGENTS.md | ✅ | | | 🎮 | 🎮 | 🎮 |
136
- | Claude Code | ✅ 🌏 | ✅ | ✅ 🌏 📦 | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 |
137
- | Codex CLI | ✅ 🌏 | | 🌏 | 🌏 | 🎮 | ✅ 🌏 |
138
- | Gemini CLI | ✅ 🌏 | ✅ | ✅ 🌏 | ✅ 🌏 | 🎮 | 🎮 |
139
- | GitHub Copilot | ✅ | | ✅ | ✅ | ✅ | ✅ |
140
- | Cursor | ✅ | ✅ | ✅ | ✅ 🌏 | | ✅ |
141
- | OpenCode | | | | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 |
142
- | Cline | ✅ || ✅ | ✅ 🌏 | | |
143
- | Kilo Code | 🌏 | ✅ | ✅ | ✅ 🌏 | | ✅ 🌏 |
144
- | Roo Code | | ✅ | ✅ | | 🎮 | ✅ 🌏 |
145
- | Qwen Code | ✅ | ✅ | | | | |
146
- | Kiro | ✅ | ✅ |||||
147
- | Google Antigravity | ✅ | | | ✅ | | 🌏 |
148
- | JetBrains Junie | ✅ || ✅ | | | |
149
- | AugmentCode | ✅ | ✅ | | | | |
150
- | Windsurf | ✅ | ✅ | | | | |
151
- | Warp | ✅ | | | | | |
152
- | Replit | ✅ | | | | | |
153
- | Zed | | ✅ | | | | |
133
+ | Tool | rules | ignore | mcp | commands | subagents | skills | hooks |
134
+ | ------------------ | :---: | :----: | :------: | :------: | :-------: | :----: | :---: |
135
+ | AGENTS.md | ✅ | | | 🎮 | 🎮 | 🎮 | |
136
+ | Claude Code | ✅ 🌏 | ✅ | ✅ 🌏 📦 | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 | ✅ |
137
+ | Codex CLI | ✅ 🌏 | | 🌏 | 🌏 | 🎮 | ✅ 🌏 | |
138
+ | Gemini CLI | ✅ 🌏 | ✅ | ✅ 🌏 | ✅ 🌏 | 🎮 | 🎮 | |
139
+ | GitHub Copilot | ✅ | | ✅ | ✅ | ✅ | ✅ | |
140
+ | Cursor | ✅ | ✅ | ✅ | ✅ 🌏 | 🌏 | 🌏 | ✅ |
141
+ | Factory Droid | 🌏 | | 🌏 | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 | |
142
+ | OpenCode | ✅ | | ✅ | ✅ 🌏 | ✅ 🌏 | ✅ 🌏 | |
143
+ | Cline | | ✅ | ✅ | ✅ 🌏 | | | |
144
+ | Kilo Code | 🌏 | ✅ | ✅ | 🌏 | | ✅ 🌏 | |
145
+ | Roo Code | ✅ | ✅ ||| 🎮 | ✅ 🌏 | |
146
+ | Qwen Code | ✅ | ✅ | | | | | |
147
+ | Kiro | ✅ ||| ✅ || | |
148
+ | Google Antigravity | ✅ | | | ✅ | | ✅ 🌏 | |
149
+ | JetBrains Junie | ✅ | ✅ || | | | |
150
+ | AugmentCode | ✅ | ✅ | | | | | |
151
+ | Windsurf | ✅ || | | | | |
152
+ | Warp | ✅ | | | | | | |
153
+ | Replit | ✅ | | | | || |
154
+ | Zed | | ✅ | | | | | |
154
155
 
155
156
  - ✅: Supports project mode
156
157
  - 🌏: Supports global mode
@@ -361,6 +362,43 @@ This is Rulesync, a Node.js CLI tool that automatically generates configuration
361
362
  ...
362
363
  ```
363
364
 
365
+ ### `.rulesync/hooks.json`
366
+
367
+ 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`.
368
+
369
+ **Event support:**
370
+
371
+ - **Shared (Cursor and Claude):** `sessionStart`, `sessionEnd`, `preToolUse`, `postToolUse`, `beforeSubmitPrompt`, `stop`, `subagentStop`, `preCompact`
372
+ - **Cursor-only:** `postToolUseFailure`, `subagentStart`, `beforeShellExecution`, `afterShellExecution`, `beforeMCPExecution`, `afterMCPExecution`, `beforeReadFile`, `afterFileEdit`, `afterAgentResponse`, `afterAgentThought`, `beforeTabFileRead`, `afterTabFileEdit`
373
+ - **Claude-only:** `permissionRequest`, `notification`, `setup`
374
+
375
+ 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).
376
+
377
+ Example:
378
+
379
+ ```json
380
+ {
381
+ "version": 1,
382
+ "hooks": {
383
+ "sessionStart": [{ "type": "command", "command": ".rulesync/hooks/session-start.sh" }],
384
+ "postToolUse": [{ "matcher": "Write|Edit", "command": ".rulesync/hooks/format.sh" }],
385
+ "stop": [{ "command": ".rulesync/hooks/audit.sh" }]
386
+ },
387
+ "cursor": {
388
+ "hooks": {
389
+ "afterFileEdit": [{ "command": ".cursor/hooks/format.sh" }]
390
+ }
391
+ },
392
+ "claudecode": {
393
+ "hooks": {
394
+ "notification": [
395
+ { "matcher": "permission_prompt", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/notify.sh" }
396
+ ]
397
+ }
398
+ }
399
+ }
400
+ ```
401
+
364
402
  ### `rulesync/commands/*.md`
365
403
 
366
404
  Example: