Add Roo Code context sync: .clinerules symlink and sync script

- Add .clinerules symlink → CLAUDE.md so Roo Code reads same project context
- Add sync-context.sh: copies global context to ~/.claude/ for Claude Code
  and prints content for manual paste into Roo Code Custom Instructions
- Update CLAUDE.md: note .clinerules symlink, add sync-context.sh to file list
- Update CONTEXT.md: add AI context file mapping table, update file structure
- Update README.md: rewrite AI Context Files section to cover both tools,
  document symlink strategy and sync workflow
This commit is contained in:
William Stuckey
2026-03-26 18:56:01 -05:00
parent d628b65b18
commit 38c1b78e68
5 changed files with 91 additions and 17 deletions
+31 -16
View File
@@ -212,31 +212,44 @@ To route additional models, add entries to the `MODEL_ROUTES` object in `proxy.m
## AI Context Files
This repo includes context files for AI coding agents (Claude Code CLI and Roo Code). There are three levels:
This repo includes context files for both **Claude Code CLI** and **Roo Code** (VS Code). The two tools use different file conventions, so we keep them in sync:
| File | Scope | Loaded when... |
### Project-level context
| Claude Code reads | Roo Code reads | Source of truth |
|---|---|---|
| `CLAUDE.md` | Project-level | AI agent is working inside this repo |
| `CONTEXT.md` | Project-level | Referenced from CLAUDE.md; agent reads on demand |
| `global-claude-md/CLAUDE.md` | User-level | Every AI session, regardless of project |
| `CLAUDE.md` | `.clinerules` | `CLAUDE.md` |
| `CONTEXT.md` | `CONTEXT.md` | `CONTEXT.md` |
**`global-claude-md/CLAUDE.md`** is the source of truth for the global file. It gets copied to `~/.claude/CLAUDE.md` on each machine. To update it:
`.clinerules` is a **git-tracked symlink** pointing to `CLAUDE.md`. Both tools read the same content from the same source — edit `CLAUDE.md` and both stay in sync automatically.
`CONTEXT.md` is the detailed infrastructure reference. Both tools can read it directly when needed.
### Global context
| Claude Code | Roo Code |
|---|---|
| `~/.claude/CLAUDE.md` (file on disk) | Custom Instructions setting (in Roo Code UI) |
The source of truth is `global-claude-md/CLAUDE.md` in this repo. To update both tools, run the sync script:
```bash
# 1. Edit the source in this repo
# 1. Edit the source
vim global-claude-md/CLAUDE.md
# 2. Commit and push
git add -A && git commit -m "Update global CLAUDE.md" && git push
git add -A && git commit -m "Update global context" && git push
# 3. Copy to work laptop
cp global-claude-md/CLAUDE.md ~/.claude/CLAUDE.md
# 4. Copy to mini-server
scp global-claude-md/CLAUDE.md mini-server:~/.claude/CLAUDE.md
# 3. Sync to both tools
./sync-context.sh
```
The project-level files (`CLAUDE.md` and `CONTEXT.md`) are picked up automatically when an AI agent opens this repo — no copying needed.
The script copies the file to `~/.claude/CLAUDE.md` (for Claude Code) and prints the content for you to paste into Roo Code's Custom Instructions (Roo sidebar → gear icon → Custom Instructions).
To also update mini-server's Claude Code:
```bash
scp global-claude-md/CLAUDE.md mini-server:~/.claude/CLAUDE.md
```
## Files
@@ -247,10 +260,12 @@ The project-level files (`CLAUDE.md` and `CONTEXT.md`) are picked up automatical
| `config.example.json` | Template config — copy to `config.json` and fill in |
| `ein-ai-proxy.service` | Systemd unit file for running as a service |
| `deploy.sh` | Deployment script — validates config, tests proxy, installs service |
| `sync-context.sh` | Syncs global AI context to Claude Code and Roo Code |
| `package.json` | Package metadata (no dependencies) |
| `CLAUDE.md` | Project-level context loaded by AI coding agents |
| `CLAUDE.md` | Project-level context for Claude Code |
| `.clinerules` | Symlink → `CLAUDE.md` — project-level context for Roo Code |
| `CONTEXT.md` | Full infrastructure documentation (network, servers, operations) |
| `global-claude-md/CLAUDE.md` | User-level context to copy to `~/.claude/CLAUDE.md` |
| `global-claude-md/CLAUDE.md` | Source of truth for global context (both tools) |
## License