docs: add git sync policy to AGENTS.md

This commit is contained in:
nikola
2026-05-19 14:36:21 +02:00
parent 8bf362ffbb
commit 367141bd6d
+22
View File
@@ -85,6 +85,28 @@ THIS RULE APPLIES TO ALL MODELS (codex, deepseek, opencode).
``` ```
2. This automatically generates HANDOFF.md for the next session. 2. This automatically generates HANDOFF.md for the next session.
3. If you cannot run the script, at minimum update the HANDOFF.md manually. 3. If you cannot run the script, at minimum update the HANDOFF.md manually.
4. AFTER saving the session, sync HANDOFF.md and updated files to the shared git repo.
5. If the shared repo is available, include the sync commands in the save-session flow.
### Git Sync Policy (Every Session)
**Central repo**: `https://git.dzonicasa.xyz/dzoni/codex-cli-shared.git`
**On session START** (before any work):
```
cd ~/codex-cli-shared && git pull --ff-only 2>/dev/null || git clone https://git.dzonicasa.xyz/dzoni/codex-cli-shared.git ~/codex-cli-shared
```
Then read `AGENTS.md`, `network-topology.md`, and relevant `HANDOFF*.md` from the repo.
**On session END** (after saving session):
```
cd ~/codex-cli-shared
cp ~/codex-cli/projects/*/HANDOFF.md HANDOFF_*.md 2>/dev/null
cp ~/codex-cli/_shared/contexts/network-topology.md _shared_contexts_network-topology.md 2>/dev/null
git add -A && git commit -m "session: $(date +%Y-%m-%d_%H%M%S) — <project>" && git push
```
**No cron, no daemons** — just two git commands per session. Zero overhead when idle.
### Handoff protocol (when switching models mid-project): ### Handoff protocol (when switching models mid-project):
- Example: codex started building an API, then crashed. User opens deepseek. - Example: codex started building an API, then crashed. User opens deepseek.