agent-rules-sync 1.2.4__tar.gz → 1.4.0__tar.gz
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.
- agent_rules_sync-1.4.0/PKG-INFO +280 -0
- agent_rules_sync-1.4.0/README.md +252 -0
- agent_rules_sync-1.4.0/agent_rules_sync.egg-info/PKG-INFO +280 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/agent_rules_sync.egg-info/SOURCES.txt +4 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/agent_rules_sync.egg-info/entry_points.txt +1 -0
- agent_rules_sync-1.4.0/agent_rules_sync.egg-info/top_level.txt +5 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/agent_rules_sync.py +205 -44
- agent_rules_sync-1.4.0/agent_settings_sync.py +278 -0
- agent_rules_sync-1.4.0/agent_skills_sync.py +289 -0
- agent_rules_sync-1.4.0/agent_sync_config.py +238 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/pyproject.toml +5 -4
- agent_rules_sync-1.4.0/tests/test_agent_skills_sync.py +168 -0
- agent_rules_sync-1.2.4/PKG-INFO +0 -465
- agent_rules_sync-1.2.4/README.md +0 -437
- agent_rules_sync-1.2.4/agent_rules_sync.egg-info/PKG-INFO +0 -465
- agent_rules_sync-1.2.4/agent_rules_sync.egg-info/top_level.txt +0 -2
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/LICENSE +0 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/agent_rules_sync.egg-info/dependency_links.txt +0 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/install_daemon.py +0 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/setup.cfg +0 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/setup.py +0 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/tests/test_agent_rules_sync.py +0 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/tests/test_agent_rules_sync_integration.py +0 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/tests/test_migration.py +0 -0
- {agent_rules_sync-1.2.4 → agent_rules_sync-1.4.0}/tests/test_windows_daemon.py +0 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-rules-sync
|
|
3
|
+
Version: 1.4.0
|
|
4
|
+
Summary: Synchronize rules and skills across AI coding assistants (Claude Code, Cursor, Gemini, OpenCode, Codex)
|
|
5
|
+
Author: Agent Rules Sync Contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/dhruv-anand-aintech/agent-rules-sync
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/dhruv-anand-aintech/agent-rules-sync/issues
|
|
9
|
+
Project-URL: Repository, https://github.com/dhruv-anand-aintech/agent-rules-sync.git
|
|
10
|
+
Project-URL: Changelog, https://github.com/dhruv-anand-aintech/agent-rules-sync/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: ai,rules,skills,sync,claude,cursor,gemini,opencode,codex
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
21
|
+
Classifier: Intended Audience :: Developers
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
23
|
+
Classifier: Environment :: Console
|
|
24
|
+
Requires-Python: >=3.8
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# agent-sync
|
|
30
|
+
|
|
31
|
+
**Synchronize rules, skills, and settings across Claude Code, Cursor, Gemini, OpenCode, and Codex — in real-time.**
|
|
32
|
+
|
|
33
|
+
Edit rules or skills in any AI agent → they automatically sync to all others. Global Claude settings propagate to configured repos for Claude Code web access.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
Works on **macOS**, **Linux**, and **Windows** (native + WSL).
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install agent-rules-sync
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
uv pip install agent-rules-sync # faster
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The daemon installs and starts automatically as a system service.
|
|
48
|
+
|
|
49
|
+
## CLI
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
agent-sync # start/ensure daemon is running
|
|
53
|
+
agent-sync sync # one-shot sync: rules + skills + settings
|
|
54
|
+
agent-sync sync rules # sync only CLAUDE.md / rules files
|
|
55
|
+
agent-sync sync skills # sync only skills directories
|
|
56
|
+
agent-sync sync settings # sync only .claude/settings.json + hooks
|
|
57
|
+
agent-sync sync rules skills # multiple scopes
|
|
58
|
+
agent-sync setup # TUI wizard to configure sync directions
|
|
59
|
+
agent-sync status # daemon and sync status
|
|
60
|
+
agent-sync stop # stop daemon
|
|
61
|
+
agent-sync watch # watch in foreground (debugging)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`agent-rules-sync` also works as an alias for backwards compatibility.
|
|
65
|
+
|
|
66
|
+
## What Gets Synced
|
|
67
|
+
|
|
68
|
+
### 1. Rules (`CLAUDE.md`, `GEMINI.md`, etc.)
|
|
69
|
+
|
|
70
|
+
Rules sync **bidirectionally** across all agent config files. Changes from any agent propagate to all others within 3 seconds.
|
|
71
|
+
|
|
72
|
+
```markdown
|
|
73
|
+
# Shared Rules
|
|
74
|
+
- use pydantic for validation ← syncs to all agents
|
|
75
|
+
|
|
76
|
+
## Claude Code Specific
|
|
77
|
+
- claude-specific rule ← stays in Claude only
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Monitored locations:
|
|
81
|
+
| Agent | Path |
|
|
82
|
+
|-------|------|
|
|
83
|
+
| Claude Code | `~/.claude/CLAUDE.md` |
|
|
84
|
+
| Cursor | `~/.cursor/rules/global.mdc` |
|
|
85
|
+
| Gemini Antigravity | `~/.gemini/GEMINI.md` |
|
|
86
|
+
| OpenCode | `~/.config/opencode/AGENTS.md` |
|
|
87
|
+
| Codex | `~/.codex/AGENTS.md` |
|
|
88
|
+
| + 4 more | `~/.config/agents/AGENTS.md`, `~/.config/AGENTS.md`, `~/.agent/AGENTS.md`, `~/.agent/AGENT.md` |
|
|
89
|
+
|
|
90
|
+
Repo-specific `CLAUDE.md` files can be added via `repo_paths.json` (see [Configuration](#configuration)).
|
|
91
|
+
|
|
92
|
+
### 2. Skills
|
|
93
|
+
|
|
94
|
+
Skills are directories containing a `SKILL.md` file. Synced across all frameworks:
|
|
95
|
+
|
|
96
|
+
| Framework | Path |
|
|
97
|
+
|-----------|------|
|
|
98
|
+
| Claude Code | `~/.claude/skills/` |
|
|
99
|
+
| Cursor | `~/.cursor/skills/`, `~/.cursor/skills-cursor/` |
|
|
100
|
+
| Codex | `~/.codex/skills/` |
|
|
101
|
+
| Gemini Antigravity | `~/.gemini/antigravity/skills/` |
|
|
102
|
+
| OpenCode | `~/.config/opencode/skills/` |
|
|
103
|
+
| Shared | `~/.agents/skills/` |
|
|
104
|
+
|
|
105
|
+
Newest version wins. Add a skill anywhere and it appears everywhere within 3 seconds.
|
|
106
|
+
|
|
107
|
+
### 3. Settings & Hooks (Claude Code)
|
|
108
|
+
|
|
109
|
+
Syncs a **portable version** of `~/.claude/settings.json` to configured repos' `.claude/settings.json`:
|
|
110
|
+
|
|
111
|
+
- Strips machine-specific keys (`statusLine`, `spinnerVerbs`, `remote`, etc.)
|
|
112
|
+
- Strips permission rules with absolute paths
|
|
113
|
+
- **Rewrites hook commands** from `~/.claude/hooks/foo.sh` → `.claude/hooks/foo.sh`
|
|
114
|
+
- **Copies hook scripts** into the repo's `.claude/hooks/`
|
|
115
|
+
|
|
116
|
+
This enables full tool permissions and hooks when using **Claude Code web** on those repos.
|
|
117
|
+
|
|
118
|
+
## Configuration
|
|
119
|
+
|
|
120
|
+
### Repo Paths
|
|
121
|
+
|
|
122
|
+
Add repos to sync rules, skills, and settings into:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
~/.config/agent-rules-sync/repo_paths.json
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
["~/Code/my-project", "~/Code/another-repo"]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Each repo gets:
|
|
133
|
+
- `<repo>/CLAUDE.md` — synced from global rules
|
|
134
|
+
- `<repo>/.claude/skills/` — synced from master skills
|
|
135
|
+
- `<repo>/.claude/settings.json` — portable settings (auto-generated)
|
|
136
|
+
- `<repo>/.claude/hooks/` — hook scripts (copied from `~/.claude/hooks/`)
|
|
137
|
+
|
|
138
|
+
### Sync Directions
|
|
139
|
+
|
|
140
|
+
Configure per-component direction via `agent-sync setup` (TUI wizard) or edit directly:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
~/.config/agent-rules-sync/sync_config.json
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"mode": "default",
|
|
149
|
+
"components": {
|
|
150
|
+
"rules": { "direction": "bidirectional", "enabled": true },
|
|
151
|
+
"skills": { "direction": "bidirectional", "enabled": true },
|
|
152
|
+
"settings": { "direction": "push", "enabled": true },
|
|
153
|
+
"hooks": { "direction": "push", "enabled": true }
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Directions:**
|
|
159
|
+
|
|
160
|
+
| Direction | Behavior |
|
|
161
|
+
|-----------|----------|
|
|
162
|
+
| `bidirectional` | Newest version wins, syncs everywhere (default for rules/skills) |
|
|
163
|
+
| `push` | Master → agents only (master is source of truth) |
|
|
164
|
+
| `pull` | Agents → master only (aggregate, don't push back) |
|
|
165
|
+
|
|
166
|
+
Settings and hooks only support `push` (they are generated from global config).
|
|
167
|
+
|
|
168
|
+
### Settings Strip Rules
|
|
169
|
+
|
|
170
|
+
Customize which keys/paths are stripped when generating portable settings:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
~/.config/agent-rules-sync/settings_sync.json
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"strip_keys": ["statusLine", "spinnerVerbs", "remote"],
|
|
179
|
+
"strip_path_prefixes": ["/Users/", "/home/", "/opt/homebrew/"],
|
|
180
|
+
"sync_hooks": true,
|
|
181
|
+
"hook_script_dir": ".claude/hooks"
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Setup Wizard
|
|
186
|
+
|
|
187
|
+
Run `agent-sync setup` for a guided TUI to configure sync directions:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
┌──────────────────────────────────────────────────────────┐
|
|
191
|
+
│ agent-sync · Setup Wizard │
|
|
192
|
+
└──────────────────────────────────────────────────────────┘
|
|
193
|
+
|
|
194
|
+
── Sync Mode ───────────────────────────────────────────
|
|
195
|
+
|
|
196
|
+
default Rules/skills are bidirectional (newest wins).
|
|
197
|
+
Settings/hooks push from global → repos.
|
|
198
|
+
|
|
199
|
+
per_component Configure each component independently.
|
|
200
|
+
|
|
201
|
+
Choice [1-2] (Enter = default):
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Commands Reference
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
agent-sync sync [rules] [skills] [settings] [all]
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
| Scope | What it syncs |
|
|
211
|
+
|-------|--------------|
|
|
212
|
+
| `rules` | Rules files (`CLAUDE.md`, `GEMINI.md`, etc.) across all agents |
|
|
213
|
+
| `skills` | Skill directories across all frameworks + configured repos |
|
|
214
|
+
| `settings` | `~/.claude/settings.json` → repo `.claude/settings.json` + hooks |
|
|
215
|
+
| `all` | All of the above (default when no scope given) |
|
|
216
|
+
|
|
217
|
+
## How It Works
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
~/.claude/settings.json ~/.claude/CLAUDE.md ~/.claude/skills/
|
|
221
|
+
│ │ │
|
|
222
|
+
│ strip machine-specific │ merge shared + │ newest
|
|
223
|
+
│ rewrite hook paths │ agent-specific │ version
|
|
224
|
+
▼ ▼ ▼
|
|
225
|
+
repo/.claude/ all agent CLAUDE.md all framework
|
|
226
|
+
settings.json GEMINI.md AGENTS.md skills/ dirs
|
|
227
|
+
hooks/ (9+ locations) (6+ locations)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Daemon watches all locations every 3 seconds. Changes trigger immediate sync.
|
|
231
|
+
|
|
232
|
+
## Backups
|
|
233
|
+
|
|
234
|
+
Every file change is backed up with a timestamp:
|
|
235
|
+
```
|
|
236
|
+
~/.config/agent-rules-sync/backups/ ← rules backups
|
|
237
|
+
~/.config/agent-rules-sync/skill_backups/ ← skills backups
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Restore any version:
|
|
241
|
+
```bash
|
|
242
|
+
cp ~/.config/agent-rules-sync/backups/claude_20260125_014532.md ~/.claude/CLAUDE.md
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Troubleshooting
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
agent-sync status # check daemon + sync status
|
|
249
|
+
tail -f ~/.config/agent-rules-sync/daemon.log # live logs
|
|
250
|
+
agent-sync stop && agent-sync # restart daemon
|
|
251
|
+
agent-sync watch # run in foreground for debugging
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## Uninstall
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
curl -fsSL https://raw.githubusercontent.com/dhruv-anand-aintech/agent-rules-sync/main/uninstall.sh | bash
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Or manually:
|
|
261
|
+
```bash
|
|
262
|
+
agent-sync stop
|
|
263
|
+
pip uninstall -y agent-rules-sync
|
|
264
|
+
rm -rf ~/.config/agent-rules-sync
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Agent rule files and repos are not touched.
|
|
268
|
+
|
|
269
|
+
## Requirements
|
|
270
|
+
|
|
271
|
+
- Python 3.8+
|
|
272
|
+
- macOS, Linux, or Windows
|
|
273
|
+
|
|
274
|
+
## License
|
|
275
|
+
|
|
276
|
+
MIT — see [LICENSE](LICENSE)
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
**Edit anywhere. Sync everywhere.**
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# agent-sync
|
|
2
|
+
|
|
3
|
+
**Synchronize rules, skills, and settings across Claude Code, Cursor, Gemini, OpenCode, and Codex — in real-time.**
|
|
4
|
+
|
|
5
|
+
Edit rules or skills in any AI agent → they automatically sync to all others. Global Claude settings propagate to configured repos for Claude Code web access.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Works on **macOS**, **Linux**, and **Windows** (native + WSL).
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install agent-rules-sync
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
uv pip install agent-rules-sync # faster
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The daemon installs and starts automatically as a system service.
|
|
20
|
+
|
|
21
|
+
## CLI
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
agent-sync # start/ensure daemon is running
|
|
25
|
+
agent-sync sync # one-shot sync: rules + skills + settings
|
|
26
|
+
agent-sync sync rules # sync only CLAUDE.md / rules files
|
|
27
|
+
agent-sync sync skills # sync only skills directories
|
|
28
|
+
agent-sync sync settings # sync only .claude/settings.json + hooks
|
|
29
|
+
agent-sync sync rules skills # multiple scopes
|
|
30
|
+
agent-sync setup # TUI wizard to configure sync directions
|
|
31
|
+
agent-sync status # daemon and sync status
|
|
32
|
+
agent-sync stop # stop daemon
|
|
33
|
+
agent-sync watch # watch in foreground (debugging)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`agent-rules-sync` also works as an alias for backwards compatibility.
|
|
37
|
+
|
|
38
|
+
## What Gets Synced
|
|
39
|
+
|
|
40
|
+
### 1. Rules (`CLAUDE.md`, `GEMINI.md`, etc.)
|
|
41
|
+
|
|
42
|
+
Rules sync **bidirectionally** across all agent config files. Changes from any agent propagate to all others within 3 seconds.
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
# Shared Rules
|
|
46
|
+
- use pydantic for validation ← syncs to all agents
|
|
47
|
+
|
|
48
|
+
## Claude Code Specific
|
|
49
|
+
- claude-specific rule ← stays in Claude only
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Monitored locations:
|
|
53
|
+
| Agent | Path |
|
|
54
|
+
|-------|------|
|
|
55
|
+
| Claude Code | `~/.claude/CLAUDE.md` |
|
|
56
|
+
| Cursor | `~/.cursor/rules/global.mdc` |
|
|
57
|
+
| Gemini Antigravity | `~/.gemini/GEMINI.md` |
|
|
58
|
+
| OpenCode | `~/.config/opencode/AGENTS.md` |
|
|
59
|
+
| Codex | `~/.codex/AGENTS.md` |
|
|
60
|
+
| + 4 more | `~/.config/agents/AGENTS.md`, `~/.config/AGENTS.md`, `~/.agent/AGENTS.md`, `~/.agent/AGENT.md` |
|
|
61
|
+
|
|
62
|
+
Repo-specific `CLAUDE.md` files can be added via `repo_paths.json` (see [Configuration](#configuration)).
|
|
63
|
+
|
|
64
|
+
### 2. Skills
|
|
65
|
+
|
|
66
|
+
Skills are directories containing a `SKILL.md` file. Synced across all frameworks:
|
|
67
|
+
|
|
68
|
+
| Framework | Path |
|
|
69
|
+
|-----------|------|
|
|
70
|
+
| Claude Code | `~/.claude/skills/` |
|
|
71
|
+
| Cursor | `~/.cursor/skills/`, `~/.cursor/skills-cursor/` |
|
|
72
|
+
| Codex | `~/.codex/skills/` |
|
|
73
|
+
| Gemini Antigravity | `~/.gemini/antigravity/skills/` |
|
|
74
|
+
| OpenCode | `~/.config/opencode/skills/` |
|
|
75
|
+
| Shared | `~/.agents/skills/` |
|
|
76
|
+
|
|
77
|
+
Newest version wins. Add a skill anywhere and it appears everywhere within 3 seconds.
|
|
78
|
+
|
|
79
|
+
### 3. Settings & Hooks (Claude Code)
|
|
80
|
+
|
|
81
|
+
Syncs a **portable version** of `~/.claude/settings.json` to configured repos' `.claude/settings.json`:
|
|
82
|
+
|
|
83
|
+
- Strips machine-specific keys (`statusLine`, `spinnerVerbs`, `remote`, etc.)
|
|
84
|
+
- Strips permission rules with absolute paths
|
|
85
|
+
- **Rewrites hook commands** from `~/.claude/hooks/foo.sh` → `.claude/hooks/foo.sh`
|
|
86
|
+
- **Copies hook scripts** into the repo's `.claude/hooks/`
|
|
87
|
+
|
|
88
|
+
This enables full tool permissions and hooks when using **Claude Code web** on those repos.
|
|
89
|
+
|
|
90
|
+
## Configuration
|
|
91
|
+
|
|
92
|
+
### Repo Paths
|
|
93
|
+
|
|
94
|
+
Add repos to sync rules, skills, and settings into:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
~/.config/agent-rules-sync/repo_paths.json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
["~/Code/my-project", "~/Code/another-repo"]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Each repo gets:
|
|
105
|
+
- `<repo>/CLAUDE.md` — synced from global rules
|
|
106
|
+
- `<repo>/.claude/skills/` — synced from master skills
|
|
107
|
+
- `<repo>/.claude/settings.json` — portable settings (auto-generated)
|
|
108
|
+
- `<repo>/.claude/hooks/` — hook scripts (copied from `~/.claude/hooks/`)
|
|
109
|
+
|
|
110
|
+
### Sync Directions
|
|
111
|
+
|
|
112
|
+
Configure per-component direction via `agent-sync setup` (TUI wizard) or edit directly:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
~/.config/agent-rules-sync/sync_config.json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"mode": "default",
|
|
121
|
+
"components": {
|
|
122
|
+
"rules": { "direction": "bidirectional", "enabled": true },
|
|
123
|
+
"skills": { "direction": "bidirectional", "enabled": true },
|
|
124
|
+
"settings": { "direction": "push", "enabled": true },
|
|
125
|
+
"hooks": { "direction": "push", "enabled": true }
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Directions:**
|
|
131
|
+
|
|
132
|
+
| Direction | Behavior |
|
|
133
|
+
|-----------|----------|
|
|
134
|
+
| `bidirectional` | Newest version wins, syncs everywhere (default for rules/skills) |
|
|
135
|
+
| `push` | Master → agents only (master is source of truth) |
|
|
136
|
+
| `pull` | Agents → master only (aggregate, don't push back) |
|
|
137
|
+
|
|
138
|
+
Settings and hooks only support `push` (they are generated from global config).
|
|
139
|
+
|
|
140
|
+
### Settings Strip Rules
|
|
141
|
+
|
|
142
|
+
Customize which keys/paths are stripped when generating portable settings:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
~/.config/agent-rules-sync/settings_sync.json
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"strip_keys": ["statusLine", "spinnerVerbs", "remote"],
|
|
151
|
+
"strip_path_prefixes": ["/Users/", "/home/", "/opt/homebrew/"],
|
|
152
|
+
"sync_hooks": true,
|
|
153
|
+
"hook_script_dir": ".claude/hooks"
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Setup Wizard
|
|
158
|
+
|
|
159
|
+
Run `agent-sync setup` for a guided TUI to configure sync directions:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
┌──────────────────────────────────────────────────────────┐
|
|
163
|
+
│ agent-sync · Setup Wizard │
|
|
164
|
+
└──────────────────────────────────────────────────────────┘
|
|
165
|
+
|
|
166
|
+
── Sync Mode ───────────────────────────────────────────
|
|
167
|
+
|
|
168
|
+
default Rules/skills are bidirectional (newest wins).
|
|
169
|
+
Settings/hooks push from global → repos.
|
|
170
|
+
|
|
171
|
+
per_component Configure each component independently.
|
|
172
|
+
|
|
173
|
+
Choice [1-2] (Enter = default):
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Commands Reference
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
agent-sync sync [rules] [skills] [settings] [all]
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
| Scope | What it syncs |
|
|
183
|
+
|-------|--------------|
|
|
184
|
+
| `rules` | Rules files (`CLAUDE.md`, `GEMINI.md`, etc.) across all agents |
|
|
185
|
+
| `skills` | Skill directories across all frameworks + configured repos |
|
|
186
|
+
| `settings` | `~/.claude/settings.json` → repo `.claude/settings.json` + hooks |
|
|
187
|
+
| `all` | All of the above (default when no scope given) |
|
|
188
|
+
|
|
189
|
+
## How It Works
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
~/.claude/settings.json ~/.claude/CLAUDE.md ~/.claude/skills/
|
|
193
|
+
│ │ │
|
|
194
|
+
│ strip machine-specific │ merge shared + │ newest
|
|
195
|
+
│ rewrite hook paths │ agent-specific │ version
|
|
196
|
+
▼ ▼ ▼
|
|
197
|
+
repo/.claude/ all agent CLAUDE.md all framework
|
|
198
|
+
settings.json GEMINI.md AGENTS.md skills/ dirs
|
|
199
|
+
hooks/ (9+ locations) (6+ locations)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Daemon watches all locations every 3 seconds. Changes trigger immediate sync.
|
|
203
|
+
|
|
204
|
+
## Backups
|
|
205
|
+
|
|
206
|
+
Every file change is backed up with a timestamp:
|
|
207
|
+
```
|
|
208
|
+
~/.config/agent-rules-sync/backups/ ← rules backups
|
|
209
|
+
~/.config/agent-rules-sync/skill_backups/ ← skills backups
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Restore any version:
|
|
213
|
+
```bash
|
|
214
|
+
cp ~/.config/agent-rules-sync/backups/claude_20260125_014532.md ~/.claude/CLAUDE.md
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Troubleshooting
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
agent-sync status # check daemon + sync status
|
|
221
|
+
tail -f ~/.config/agent-rules-sync/daemon.log # live logs
|
|
222
|
+
agent-sync stop && agent-sync # restart daemon
|
|
223
|
+
agent-sync watch # run in foreground for debugging
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Uninstall
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
curl -fsSL https://raw.githubusercontent.com/dhruv-anand-aintech/agent-rules-sync/main/uninstall.sh | bash
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Or manually:
|
|
233
|
+
```bash
|
|
234
|
+
agent-sync stop
|
|
235
|
+
pip uninstall -y agent-rules-sync
|
|
236
|
+
rm -rf ~/.config/agent-rules-sync
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Agent rule files and repos are not touched.
|
|
240
|
+
|
|
241
|
+
## Requirements
|
|
242
|
+
|
|
243
|
+
- Python 3.8+
|
|
244
|
+
- macOS, Linux, or Windows
|
|
245
|
+
|
|
246
|
+
## License
|
|
247
|
+
|
|
248
|
+
MIT — see [LICENSE](LICENSE)
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
**Edit anywhere. Sync everywhere.**
|