repo-device-synclisted
Install: claude install-skill thefilesareinthecomputer/dotagents
# repo-device-sync
Keeps one repo consistent across devices that may commit concurrently. The
failure this prevents: starting work on stale state, or pushing over a commit
another machine landed mid-session. The discipline is always the same -
**fetch before trusting anything, diff before pulling, re-fetch before
pushing, verify after.**
## Phase 1 - Assess (always first)
```bash
git status --porcelain # uncommitted local work?
git fetch origin # never reason about origin without this
git status -sb # ahead/behind for current branch
git branch -vv # ahead/behind for all tracked branches
```
Report per tracked branch: in sync / ahead N / behind N / diverged (N and M).
Surface uncommitted changes before doing anything else - they change what is
safe below.
## Phase 2 - Reconcile inbound (behind)
1. Show what is coming: `git log --oneline HEAD..origin/<branch>` and a
summarized `git diff HEAD...origin/<branch> --stat`.
2. **Deletion pre-flight - run before every pull.** An incoming commit that
untracked newly-ignored paths arrives as a real working-tree deletion, and
afterwards those paths are ignored, so the loss leaves no trace anywhere the
default views look:
```bash
git diff --name-status HEAD origin/<branch> \
| awk '$1=="D"{print $2}' | git check-ignore --stdin
```
Any output means this pull deletes files that will then be invisible. Stop,
show the list, and ask before pulling. It is recovera