agent-rules-sync 1.0.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.0.0/LICENSE +21 -0
- agent_rules_sync-1.0.0/PKG-INFO +349 -0
- agent_rules_sync-1.0.0/README.md +318 -0
- agent_rules_sync-1.0.0/agent_rules_sync.egg-info/PKG-INFO +349 -0
- agent_rules_sync-1.0.0/agent_rules_sync.egg-info/SOURCES.txt +11 -0
- agent_rules_sync-1.0.0/agent_rules_sync.egg-info/dependency_links.txt +1 -0
- agent_rules_sync-1.0.0/agent_rules_sync.egg-info/entry_points.txt +2 -0
- agent_rules_sync-1.0.0/agent_rules_sync.egg-info/top_level.txt +2 -0
- agent_rules_sync-1.0.0/agent_rules_sync.py +463 -0
- agent_rules_sync-1.0.0/install_daemon.py +195 -0
- agent_rules_sync-1.0.0/pyproject.toml +41 -0
- agent_rules_sync-1.0.0/setup.cfg +4 -0
- agent_rules_sync-1.0.0/setup.py +55 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agent Rules Sync Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-rules-sync
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Synchronize rules across AI coding assistants (Claude Code, Cursor, Gemini, OpenCode)
|
|
5
|
+
Home-page: https://github.com/dhruv-anand-aintech/agent-rules-sync
|
|
6
|
+
Author: Agent Rules Sync Contributors
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/dhruv-anand-aintech/agent-rules-sync
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/dhruv-anand-aintech/agent-rules-sync/issues
|
|
10
|
+
Project-URL: Repository, https://github.com/dhruv-anand-aintech/agent-rules-sync.git
|
|
11
|
+
Project-URL: Changelog, https://github.com/dhruv-anand-aintech/agent-rules-sync/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: ai,rules,sync,claude,cursor,gemini,opencode
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
20
|
+
Classifier: Operating System :: OS Independent
|
|
21
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
22
|
+
Classifier: Intended Audience :: Developers
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
24
|
+
Classifier: Environment :: Console
|
|
25
|
+
Requires-Python: >=3.8
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Dynamic: home-page
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
Dynamic: requires-python
|
|
31
|
+
|
|
32
|
+
# Agent Rules Sync
|
|
33
|
+
|
|
34
|
+
**Synchronize your rules across Claude Code, Cursor, Gemini, and OpenCode in real-time.**
|
|
35
|
+
|
|
36
|
+
Edit rules in any AI agent → they automatically sync to all other agents.
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
Works on **macOS**, **Linux**, and **Windows** (native + WSL).
|
|
41
|
+
|
|
42
|
+
### Quick Install
|
|
43
|
+
|
|
44
|
+
**Using pip:**
|
|
45
|
+
```bash
|
|
46
|
+
pip install agent-rules-sync
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Using uv (faster):**
|
|
50
|
+
```bash
|
|
51
|
+
uv pip install agent-rules-sync
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**From source:**
|
|
55
|
+
```bash
|
|
56
|
+
pip install git+https://github.com/dhruv-anand-aintech/agent-rules-sync.git
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**That's it!** The daemon installs and starts automatically.
|
|
60
|
+
|
|
61
|
+
### What Happens During Installation
|
|
62
|
+
|
|
63
|
+
1. **Daemon is installed** as a system service (auto-starts on boot)
|
|
64
|
+
2. **Service starts immediately** and runs in the background
|
|
65
|
+
3. **Rules sync automatically** every 3 seconds
|
|
66
|
+
|
|
67
|
+
### Platform-Specific Installation
|
|
68
|
+
|
|
69
|
+
**macOS:**
|
|
70
|
+
- Installs as launchd service (`com.local.agent-rules-sync`)
|
|
71
|
+
- Auto-starts on login
|
|
72
|
+
- Logs to `~/.config/agent-rules-sync/`
|
|
73
|
+
- File: `~/Library/LaunchAgents/com.local.agent-rules-sync.plist`
|
|
74
|
+
|
|
75
|
+
**Linux:**
|
|
76
|
+
- Installs as systemd user service (`agent-rules-sync.service`)
|
|
77
|
+
- Auto-starts on login
|
|
78
|
+
- Logs to `~/.config/agent-rules-sync/daemon.log`
|
|
79
|
+
- File: `~/.config/systemd/user/agent-rules-sync.service`
|
|
80
|
+
|
|
81
|
+
**Windows:**
|
|
82
|
+
- Installs batch file to startup folder
|
|
83
|
+
- Auto-starts on next login
|
|
84
|
+
- Logs to `~/.config/agent-rules-sync/`
|
|
85
|
+
- File: `~/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/agent-rules-sync.bat`
|
|
86
|
+
|
|
87
|
+
## Usage
|
|
88
|
+
|
|
89
|
+
### The daemon is already running!
|
|
90
|
+
|
|
91
|
+
After installation, the daemon runs automatically in the background. Just start editing.
|
|
92
|
+
|
|
93
|
+
### 1. Edit Rules Anywhere
|
|
94
|
+
Pick any location and edit:
|
|
95
|
+
```bash
|
|
96
|
+
# Edit Claude Code rules
|
|
97
|
+
nano ~/.claude/CLAUDE.md
|
|
98
|
+
|
|
99
|
+
# Edit Cursor rules
|
|
100
|
+
nano ~/.cursor/rules/global.mdc
|
|
101
|
+
|
|
102
|
+
# Edit Gemini rules
|
|
103
|
+
nano ~/.gemini/GEMINI.md
|
|
104
|
+
|
|
105
|
+
# Edit OpenCode rules
|
|
106
|
+
nano ~/.config/opencode/AGENTS.md
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Just add or remove lines starting with `-`:
|
|
110
|
+
```markdown
|
|
111
|
+
- rule 1
|
|
112
|
+
- rule 2
|
|
113
|
+
- rule 3
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 2. Changes Sync Automatically
|
|
117
|
+
Within 3 seconds, your changes appear in all other agents! No manual sync needed.
|
|
118
|
+
|
|
119
|
+
## How It Works
|
|
120
|
+
|
|
121
|
+
1. **Daemon monitors** all agent config files every 3 seconds
|
|
122
|
+
2. **Detects changes** in any file (master or agents)
|
|
123
|
+
3. **Merges rules** from all sources
|
|
124
|
+
4. **Syncs to all agents** automatically
|
|
125
|
+
5. **Deduplicates** identical rules
|
|
126
|
+
|
|
127
|
+
### No User Master File
|
|
128
|
+
|
|
129
|
+
The master rules file is stored hidden in `~/.config/agent-rules-sync/RULES.md` — you never need to touch it. Just edit your agent files!
|
|
130
|
+
|
|
131
|
+
## Commands
|
|
132
|
+
|
|
133
|
+
The daemon runs automatically. These commands are for management:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Check daemon status
|
|
137
|
+
agent-rules-sync status
|
|
138
|
+
|
|
139
|
+
# Watch mode (foreground, useful for debugging)
|
|
140
|
+
agent-rules-sync watch
|
|
141
|
+
|
|
142
|
+
# Stop daemon (it will auto-restart on next login)
|
|
143
|
+
agent-rules-sync stop
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Backups
|
|
147
|
+
|
|
148
|
+
**Every file change is automatically backed up** with a timestamp.
|
|
149
|
+
|
|
150
|
+
View your backups:
|
|
151
|
+
```bash
|
|
152
|
+
ls -lah ~/.config/agent-rules-sync/backups/
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Restore a previous version:
|
|
156
|
+
```bash
|
|
157
|
+
cp ~/.config/agent-rules-sync/backups/claude_20260125_014532.md ~/.claude/CLAUDE.md
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
For detailed backup information, see [BACKUPS.md](BACKUPS.md)
|
|
161
|
+
|
|
162
|
+
To completely uninstall:
|
|
163
|
+
```bash
|
|
164
|
+
curl -fsSL https://raw.githubusercontent.com/dhruv-anand-aintech/agent-rules-sync/main/uninstall.sh | bash
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## When Changes Take Effect
|
|
168
|
+
|
|
169
|
+
**Important:** Different agents load configuration at different times. After Agent Rules Sync updates files, you may need to restart your agent for changes to take effect:
|
|
170
|
+
|
|
171
|
+
| Agent | What to Do |
|
|
172
|
+
|-------|-----------|
|
|
173
|
+
| **Claude Code** | Restart the application or start a new session |
|
|
174
|
+
| **Cursor** | Changes apply automatically in new conversations |
|
|
175
|
+
| **Gemini Antigravity** | Run `/memory refresh` command or restart |
|
|
176
|
+
| **OpenCode** | Restart or start a new session |
|
|
177
|
+
|
|
178
|
+
For detailed technical information, see [AGENT_FILE_RELOAD.md](AGENT_FILE_RELOAD.md)
|
|
179
|
+
|
|
180
|
+
## Example Workflow
|
|
181
|
+
|
|
182
|
+
**Terminal 1:**
|
|
183
|
+
```bash
|
|
184
|
+
$ agent-rules-sync
|
|
185
|
+
Starting Agent Rules Sync daemon...
|
|
186
|
+
✓ Daemon started (PID: 12345)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Terminal 2:**
|
|
190
|
+
```bash
|
|
191
|
+
$ echo "- use pydantic for validation" >> ~/.claude/CLAUDE.md
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Within 3 seconds, the rule appears in:**
|
|
195
|
+
- `~/.cursor/rules/global.mdc`
|
|
196
|
+
- `~/.gemini/GEMINI.md`
|
|
197
|
+
- `~/.config/opencode/AGENTS.md`
|
|
198
|
+
|
|
199
|
+
✓ Done! No manual sync needed.
|
|
200
|
+
|
|
201
|
+
## Features
|
|
202
|
+
|
|
203
|
+
✓ **Bidirectional sync** — rules can be added anywhere
|
|
204
|
+
✓ **Auto-deduplication** — same rule doesn't appear twice
|
|
205
|
+
✓ **Automatic backups** — timestamped backups before every change
|
|
206
|
+
✓ **Fire and forget** — daemon auto-starts and runs in background
|
|
207
|
+
✓ **Zero config** — works out of the box
|
|
208
|
+
✓ **Real-time** — syncs within 3 seconds
|
|
209
|
+
✓ **Safe recovery** — restore any previous version from backups
|
|
210
|
+
|
|
211
|
+
## Merging Behavior
|
|
212
|
+
|
|
213
|
+
Rules are **merged**, not replaced. If you have:
|
|
214
|
+
|
|
215
|
+
**Master:** `- rule A`, `- rule B`
|
|
216
|
+
**Claude:** `- rule A`, `- rule B`, `- rule C`
|
|
217
|
+
|
|
218
|
+
After sync, all agents get: `- rule A`, `- rule B`, `- rule C`
|
|
219
|
+
|
|
220
|
+
No rules are lost!
|
|
221
|
+
|
|
222
|
+
## Architecture
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
Your edits in any agent file
|
|
226
|
+
↓
|
|
227
|
+
Daemon detects change
|
|
228
|
+
↓
|
|
229
|
+
Merge all rules
|
|
230
|
+
↓
|
|
231
|
+
Update all agents
|
|
232
|
+
↓
|
|
233
|
+
Done! (rules synced everywhere)
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Monitoring
|
|
237
|
+
|
|
238
|
+
Check status anytime:
|
|
239
|
+
```bash
|
|
240
|
+
$ agent-rules-sync status
|
|
241
|
+
|
|
242
|
+
======================================================================
|
|
243
|
+
Agent Rules Sync Status
|
|
244
|
+
======================================================================
|
|
245
|
+
|
|
246
|
+
📂 Config directory: ~/.config/agent-rules-sync
|
|
247
|
+
|
|
248
|
+
📄 Master Rules: ~/.config/agent-rules-sync/RULES.md
|
|
249
|
+
Hash: acfa47839976...
|
|
250
|
+
|
|
251
|
+
🤖 Claude Code
|
|
252
|
+
Path: ~/.claude/CLAUDE.md
|
|
253
|
+
Status: ✓ In sync
|
|
254
|
+
|
|
255
|
+
🤖 Cursor
|
|
256
|
+
Path: ~/.cursor/rules/global.mdc
|
|
257
|
+
Status: ✓ In sync
|
|
258
|
+
|
|
259
|
+
🤖 Gemini Antigravity
|
|
260
|
+
Path: ~/.gemini/GEMINI.md
|
|
261
|
+
Status: ✓ In sync
|
|
262
|
+
|
|
263
|
+
🤖 OpenCode
|
|
264
|
+
Path: ~/.config/opencode/AGENTS.md
|
|
265
|
+
Status: ✓ In sync
|
|
266
|
+
|
|
267
|
+
======================================================================
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Logs
|
|
271
|
+
|
|
272
|
+
Daemon logs are stored in:
|
|
273
|
+
```
|
|
274
|
+
~/.config/agent-rules-sync/daemon.log
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
View recent activity:
|
|
278
|
+
```bash
|
|
279
|
+
tail -f ~/.config/agent-rules-sync/daemon.log
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Troubleshooting
|
|
283
|
+
|
|
284
|
+
### Daemon not syncing?
|
|
285
|
+
```bash
|
|
286
|
+
# Check status
|
|
287
|
+
agent-rules-sync status
|
|
288
|
+
|
|
289
|
+
# Check logs
|
|
290
|
+
tail ~/.config/agent-rules-sync/daemon.log
|
|
291
|
+
|
|
292
|
+
# Restart
|
|
293
|
+
agent-rules-sync stop
|
|
294
|
+
agent-rules-sync # Start again
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Want to debug in foreground?
|
|
298
|
+
```bash
|
|
299
|
+
# Run in foreground instead of daemon
|
|
300
|
+
agent-rules-sync watch
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Need to see what's backed up?
|
|
304
|
+
```bash
|
|
305
|
+
ls -la ~/.config/agent-rules-sync/backups/
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### How do I uninstall?
|
|
309
|
+
|
|
310
|
+
**One-liner:**
|
|
311
|
+
```bash
|
|
312
|
+
curl -fsSL https://raw.githubusercontent.com/dhruv-anand-aintech/agent-rules-sync/main/uninstall.sh | bash
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Or manually:
|
|
316
|
+
```bash
|
|
317
|
+
agent-rules-sync stop # Stop daemon
|
|
318
|
+
pip uninstall -y agent-rules-sync # Remove package
|
|
319
|
+
rm -rf ~/.config/agent-rules-sync # Clean up config
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Your agent rule files are preserved and not deleted!
|
|
323
|
+
|
|
324
|
+
## Requirements
|
|
325
|
+
|
|
326
|
+
- Python 3.8+
|
|
327
|
+
- Claude Code, Cursor, Gemini, or OpenCode installed (at least one)
|
|
328
|
+
|
|
329
|
+
## License
|
|
330
|
+
|
|
331
|
+
MIT License - see LICENSE file
|
|
332
|
+
|
|
333
|
+
## Contributing
|
|
334
|
+
|
|
335
|
+
Contributions welcome! Feel free to submit issues and pull requests.
|
|
336
|
+
|
|
337
|
+
## Support
|
|
338
|
+
|
|
339
|
+
- 🐛 Found a bug? [Open an issue](https://github.com/dhruv-anand-aintech/agent-rules-sync/issues)
|
|
340
|
+
- 💡 Have a feature idea? [Start a discussion](https://github.com/dhruv-anand-aintech/agent-rules-sync/discussions)
|
|
341
|
+
- ❓ Questions? Check existing issues or create a new one
|
|
342
|
+
|
|
343
|
+
## Repository
|
|
344
|
+
|
|
345
|
+
https://github.com/dhruv-anand-aintech/agent-rules-sync
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
**Keep your AI agent rules in sync. Edit anywhere. Sync everywhere.**
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# Agent Rules Sync
|
|
2
|
+
|
|
3
|
+
**Synchronize your rules across Claude Code, Cursor, Gemini, and OpenCode in real-time.**
|
|
4
|
+
|
|
5
|
+
Edit rules in any AI agent → they automatically sync to all other agents.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Works on **macOS**, **Linux**, and **Windows** (native + WSL).
|
|
10
|
+
|
|
11
|
+
### Quick Install
|
|
12
|
+
|
|
13
|
+
**Using pip:**
|
|
14
|
+
```bash
|
|
15
|
+
pip install agent-rules-sync
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Using uv (faster):**
|
|
19
|
+
```bash
|
|
20
|
+
uv pip install agent-rules-sync
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**From source:**
|
|
24
|
+
```bash
|
|
25
|
+
pip install git+https://github.com/dhruv-anand-aintech/agent-rules-sync.git
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**That's it!** The daemon installs and starts automatically.
|
|
29
|
+
|
|
30
|
+
### What Happens During Installation
|
|
31
|
+
|
|
32
|
+
1. **Daemon is installed** as a system service (auto-starts on boot)
|
|
33
|
+
2. **Service starts immediately** and runs in the background
|
|
34
|
+
3. **Rules sync automatically** every 3 seconds
|
|
35
|
+
|
|
36
|
+
### Platform-Specific Installation
|
|
37
|
+
|
|
38
|
+
**macOS:**
|
|
39
|
+
- Installs as launchd service (`com.local.agent-rules-sync`)
|
|
40
|
+
- Auto-starts on login
|
|
41
|
+
- Logs to `~/.config/agent-rules-sync/`
|
|
42
|
+
- File: `~/Library/LaunchAgents/com.local.agent-rules-sync.plist`
|
|
43
|
+
|
|
44
|
+
**Linux:**
|
|
45
|
+
- Installs as systemd user service (`agent-rules-sync.service`)
|
|
46
|
+
- Auto-starts on login
|
|
47
|
+
- Logs to `~/.config/agent-rules-sync/daemon.log`
|
|
48
|
+
- File: `~/.config/systemd/user/agent-rules-sync.service`
|
|
49
|
+
|
|
50
|
+
**Windows:**
|
|
51
|
+
- Installs batch file to startup folder
|
|
52
|
+
- Auto-starts on next login
|
|
53
|
+
- Logs to `~/.config/agent-rules-sync/`
|
|
54
|
+
- File: `~/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/agent-rules-sync.bat`
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
### The daemon is already running!
|
|
59
|
+
|
|
60
|
+
After installation, the daemon runs automatically in the background. Just start editing.
|
|
61
|
+
|
|
62
|
+
### 1. Edit Rules Anywhere
|
|
63
|
+
Pick any location and edit:
|
|
64
|
+
```bash
|
|
65
|
+
# Edit Claude Code rules
|
|
66
|
+
nano ~/.claude/CLAUDE.md
|
|
67
|
+
|
|
68
|
+
# Edit Cursor rules
|
|
69
|
+
nano ~/.cursor/rules/global.mdc
|
|
70
|
+
|
|
71
|
+
# Edit Gemini rules
|
|
72
|
+
nano ~/.gemini/GEMINI.md
|
|
73
|
+
|
|
74
|
+
# Edit OpenCode rules
|
|
75
|
+
nano ~/.config/opencode/AGENTS.md
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Just add or remove lines starting with `-`:
|
|
79
|
+
```markdown
|
|
80
|
+
- rule 1
|
|
81
|
+
- rule 2
|
|
82
|
+
- rule 3
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 2. Changes Sync Automatically
|
|
86
|
+
Within 3 seconds, your changes appear in all other agents! No manual sync needed.
|
|
87
|
+
|
|
88
|
+
## How It Works
|
|
89
|
+
|
|
90
|
+
1. **Daemon monitors** all agent config files every 3 seconds
|
|
91
|
+
2. **Detects changes** in any file (master or agents)
|
|
92
|
+
3. **Merges rules** from all sources
|
|
93
|
+
4. **Syncs to all agents** automatically
|
|
94
|
+
5. **Deduplicates** identical rules
|
|
95
|
+
|
|
96
|
+
### No User Master File
|
|
97
|
+
|
|
98
|
+
The master rules file is stored hidden in `~/.config/agent-rules-sync/RULES.md` — you never need to touch it. Just edit your agent files!
|
|
99
|
+
|
|
100
|
+
## Commands
|
|
101
|
+
|
|
102
|
+
The daemon runs automatically. These commands are for management:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Check daemon status
|
|
106
|
+
agent-rules-sync status
|
|
107
|
+
|
|
108
|
+
# Watch mode (foreground, useful for debugging)
|
|
109
|
+
agent-rules-sync watch
|
|
110
|
+
|
|
111
|
+
# Stop daemon (it will auto-restart on next login)
|
|
112
|
+
agent-rules-sync stop
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Backups
|
|
116
|
+
|
|
117
|
+
**Every file change is automatically backed up** with a timestamp.
|
|
118
|
+
|
|
119
|
+
View your backups:
|
|
120
|
+
```bash
|
|
121
|
+
ls -lah ~/.config/agent-rules-sync/backups/
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Restore a previous version:
|
|
125
|
+
```bash
|
|
126
|
+
cp ~/.config/agent-rules-sync/backups/claude_20260125_014532.md ~/.claude/CLAUDE.md
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
For detailed backup information, see [BACKUPS.md](BACKUPS.md)
|
|
130
|
+
|
|
131
|
+
To completely uninstall:
|
|
132
|
+
```bash
|
|
133
|
+
curl -fsSL https://raw.githubusercontent.com/dhruv-anand-aintech/agent-rules-sync/main/uninstall.sh | bash
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## When Changes Take Effect
|
|
137
|
+
|
|
138
|
+
**Important:** Different agents load configuration at different times. After Agent Rules Sync updates files, you may need to restart your agent for changes to take effect:
|
|
139
|
+
|
|
140
|
+
| Agent | What to Do |
|
|
141
|
+
|-------|-----------|
|
|
142
|
+
| **Claude Code** | Restart the application or start a new session |
|
|
143
|
+
| **Cursor** | Changes apply automatically in new conversations |
|
|
144
|
+
| **Gemini Antigravity** | Run `/memory refresh` command or restart |
|
|
145
|
+
| **OpenCode** | Restart or start a new session |
|
|
146
|
+
|
|
147
|
+
For detailed technical information, see [AGENT_FILE_RELOAD.md](AGENT_FILE_RELOAD.md)
|
|
148
|
+
|
|
149
|
+
## Example Workflow
|
|
150
|
+
|
|
151
|
+
**Terminal 1:**
|
|
152
|
+
```bash
|
|
153
|
+
$ agent-rules-sync
|
|
154
|
+
Starting Agent Rules Sync daemon...
|
|
155
|
+
✓ Daemon started (PID: 12345)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Terminal 2:**
|
|
159
|
+
```bash
|
|
160
|
+
$ echo "- use pydantic for validation" >> ~/.claude/CLAUDE.md
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Within 3 seconds, the rule appears in:**
|
|
164
|
+
- `~/.cursor/rules/global.mdc`
|
|
165
|
+
- `~/.gemini/GEMINI.md`
|
|
166
|
+
- `~/.config/opencode/AGENTS.md`
|
|
167
|
+
|
|
168
|
+
✓ Done! No manual sync needed.
|
|
169
|
+
|
|
170
|
+
## Features
|
|
171
|
+
|
|
172
|
+
✓ **Bidirectional sync** — rules can be added anywhere
|
|
173
|
+
✓ **Auto-deduplication** — same rule doesn't appear twice
|
|
174
|
+
✓ **Automatic backups** — timestamped backups before every change
|
|
175
|
+
✓ **Fire and forget** — daemon auto-starts and runs in background
|
|
176
|
+
✓ **Zero config** — works out of the box
|
|
177
|
+
✓ **Real-time** — syncs within 3 seconds
|
|
178
|
+
✓ **Safe recovery** — restore any previous version from backups
|
|
179
|
+
|
|
180
|
+
## Merging Behavior
|
|
181
|
+
|
|
182
|
+
Rules are **merged**, not replaced. If you have:
|
|
183
|
+
|
|
184
|
+
**Master:** `- rule A`, `- rule B`
|
|
185
|
+
**Claude:** `- rule A`, `- rule B`, `- rule C`
|
|
186
|
+
|
|
187
|
+
After sync, all agents get: `- rule A`, `- rule B`, `- rule C`
|
|
188
|
+
|
|
189
|
+
No rules are lost!
|
|
190
|
+
|
|
191
|
+
## Architecture
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
Your edits in any agent file
|
|
195
|
+
↓
|
|
196
|
+
Daemon detects change
|
|
197
|
+
↓
|
|
198
|
+
Merge all rules
|
|
199
|
+
↓
|
|
200
|
+
Update all agents
|
|
201
|
+
↓
|
|
202
|
+
Done! (rules synced everywhere)
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Monitoring
|
|
206
|
+
|
|
207
|
+
Check status anytime:
|
|
208
|
+
```bash
|
|
209
|
+
$ agent-rules-sync status
|
|
210
|
+
|
|
211
|
+
======================================================================
|
|
212
|
+
Agent Rules Sync Status
|
|
213
|
+
======================================================================
|
|
214
|
+
|
|
215
|
+
📂 Config directory: ~/.config/agent-rules-sync
|
|
216
|
+
|
|
217
|
+
📄 Master Rules: ~/.config/agent-rules-sync/RULES.md
|
|
218
|
+
Hash: acfa47839976...
|
|
219
|
+
|
|
220
|
+
🤖 Claude Code
|
|
221
|
+
Path: ~/.claude/CLAUDE.md
|
|
222
|
+
Status: ✓ In sync
|
|
223
|
+
|
|
224
|
+
🤖 Cursor
|
|
225
|
+
Path: ~/.cursor/rules/global.mdc
|
|
226
|
+
Status: ✓ In sync
|
|
227
|
+
|
|
228
|
+
🤖 Gemini Antigravity
|
|
229
|
+
Path: ~/.gemini/GEMINI.md
|
|
230
|
+
Status: ✓ In sync
|
|
231
|
+
|
|
232
|
+
🤖 OpenCode
|
|
233
|
+
Path: ~/.config/opencode/AGENTS.md
|
|
234
|
+
Status: ✓ In sync
|
|
235
|
+
|
|
236
|
+
======================================================================
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Logs
|
|
240
|
+
|
|
241
|
+
Daemon logs are stored in:
|
|
242
|
+
```
|
|
243
|
+
~/.config/agent-rules-sync/daemon.log
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
View recent activity:
|
|
247
|
+
```bash
|
|
248
|
+
tail -f ~/.config/agent-rules-sync/daemon.log
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Troubleshooting
|
|
252
|
+
|
|
253
|
+
### Daemon not syncing?
|
|
254
|
+
```bash
|
|
255
|
+
# Check status
|
|
256
|
+
agent-rules-sync status
|
|
257
|
+
|
|
258
|
+
# Check logs
|
|
259
|
+
tail ~/.config/agent-rules-sync/daemon.log
|
|
260
|
+
|
|
261
|
+
# Restart
|
|
262
|
+
agent-rules-sync stop
|
|
263
|
+
agent-rules-sync # Start again
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Want to debug in foreground?
|
|
267
|
+
```bash
|
|
268
|
+
# Run in foreground instead of daemon
|
|
269
|
+
agent-rules-sync watch
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Need to see what's backed up?
|
|
273
|
+
```bash
|
|
274
|
+
ls -la ~/.config/agent-rules-sync/backups/
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### How do I uninstall?
|
|
278
|
+
|
|
279
|
+
**One-liner:**
|
|
280
|
+
```bash
|
|
281
|
+
curl -fsSL https://raw.githubusercontent.com/dhruv-anand-aintech/agent-rules-sync/main/uninstall.sh | bash
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Or manually:
|
|
285
|
+
```bash
|
|
286
|
+
agent-rules-sync stop # Stop daemon
|
|
287
|
+
pip uninstall -y agent-rules-sync # Remove package
|
|
288
|
+
rm -rf ~/.config/agent-rules-sync # Clean up config
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Your agent rule files are preserved and not deleted!
|
|
292
|
+
|
|
293
|
+
## Requirements
|
|
294
|
+
|
|
295
|
+
- Python 3.8+
|
|
296
|
+
- Claude Code, Cursor, Gemini, or OpenCode installed (at least one)
|
|
297
|
+
|
|
298
|
+
## License
|
|
299
|
+
|
|
300
|
+
MIT License - see LICENSE file
|
|
301
|
+
|
|
302
|
+
## Contributing
|
|
303
|
+
|
|
304
|
+
Contributions welcome! Feel free to submit issues and pull requests.
|
|
305
|
+
|
|
306
|
+
## Support
|
|
307
|
+
|
|
308
|
+
- 🐛 Found a bug? [Open an issue](https://github.com/dhruv-anand-aintech/agent-rules-sync/issues)
|
|
309
|
+
- 💡 Have a feature idea? [Start a discussion](https://github.com/dhruv-anand-aintech/agent-rules-sync/discussions)
|
|
310
|
+
- ❓ Questions? Check existing issues or create a new one
|
|
311
|
+
|
|
312
|
+
## Repository
|
|
313
|
+
|
|
314
|
+
https://github.com/dhruv-anand-aintech/agent-rules-sync
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
**Keep your AI agent rules in sync. Edit anywhere. Sync everywhere.**
|