skills/git-sync/SKILL.md
Team synchronization for multi-machine collaboration. Provides pull/push protocols for keeping repos in sync across team members. Load this skill when git.teamSync.enabled is true in project.json.
npx skillsauth add mdmagnuson-creator/yo-go git-syncInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
⚠️ Team Sync Check
Before using this skill, check
project.json→git.teamSync.enabled.
- If
falseor missing: Skip this skill entirely — no team sync needed.- If
true: Continue with team synchronization protocols.
⛔ Auto-Commit Check
If
project.json→git.autoCommitisfalse, this skill must NOT run anygit commitcommands. When autoCommit is disabled, only performgit pullandgit pushoperations on user-committed changes.
This skill provides git pull/push protocols for teams working on the same repository from different machines.
When team sync is enabled, agents will:
In project.json → git.teamSync:
{
"git": {
"teamSync": {
"enabled": true,
"pullBeforeWork": true,
"pushAfterCommit": true,
"confirmBeforePush": true,
"pushRetries": 3,
"conflictBehavior": "stop-and-alert"
}
}
}
| Setting | Default | Description |
|---------|---------|-------------|
| enabled | false | Master switch for team sync |
| pullBeforeWork | true | Pull at session start and around commits |
| pushAfterCommit | true | Push after each commit |
| confirmBeforePush | true | Ask user before pushing |
| pushRetries | 3 | Retry count for network failures |
| conflictBehavior | stop-and-alert | How to handle conflicts |
| Agent | When to Pull | When to Push | |-------|--------------|--------------| | Planner | Session start, before PRD read | After PRD create/modify/move (auto-commit) | | Builder | Session start, before/after implementation commits | After implementation commits | | Toolkit | Session start | After toolkit changes |
Run this protocol at sync points. Returns one of: synced, conflict, error.
git fetch origin
# Get current branch
BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Count commits behind
BEHIND=$(git rev-list HEAD..origin/$BRANCH --count 2>/dev/null || echo "0")
# Check for local changes
LOCAL_CHANGES=$(git status --porcelain)
If BEHIND = 0:
→ Already up to date, return "synced"
If BEHIND > 0 AND LOCAL_CHANGES is empty:
→ Safe to fast-forward
→ Run: git pull --ff-only origin $BRANCH
→ Return "synced"
If BEHIND > 0 AND LOCAL_CHANGES is not empty:
→ Conflict scenario, check conflictBehavior setting
Based on git.teamSync.conflictBehavior:
stop-and-alert (default, safest):
⚠️ GIT SYNC CONFLICT
Your branch is behind origin by {BEHIND} commits, but you have local changes.
Local changes:
{git status --short}
Options:
1. Stash changes, pull, then reapply: git stash && git pull && git stash pop
2. Commit local changes first, then merge: git add -A && git commit -m "WIP" && git pull
3. Discard local changes and pull: git checkout . && git pull
Please resolve manually and restart the session.
Return conflict and STOP — do not continue the workflow.
auto-merge:
git stash
git pull --rebase origin $BRANCH
git stash pop
If merge conflict occurs during rebase or stash pop, fall back to stop-and-alert.
stash-and-alert:
git stash -m "Auto-stash before sync $(date +%Y%m%d-%H%M%S)"
git pull --ff-only origin $BRANCH
Alert user: "Local changes stashed. Run git stash pop to restore."
Return synced.
Run this protocol after commits. Returns one of: pushed, conflict, error.
Always pull before pushing to minimize conflicts:
git fetch origin
BEHIND=$(git rev-list HEAD..origin/$BRANCH --count 2>/dev/null || echo "0")
if [ "$BEHIND" -gt 0 ]; then
git pull --rebase origin $BRANCH
fi
If rebase conflicts occur:
⚠️ REBASE CONFLICT
Cannot automatically merge remote changes.
Please resolve manually:
1. Fix conflicts in the listed files
2. Run: git add . && git rebase --continue
3. Or abort: git rebase --abort
Then restart the session.
Return conflict and STOP.
If git.teamSync.confirmBeforePush is true:
Ready to push to origin/{BRANCH}:
{git log origin/$BRANCH..HEAD --oneline}
Push these commits? (y/n)
Wait for user confirmation. If n, return without pushing but don't treat as error.
RETRIES=3 # from git.teamSync.pushRetries
ATTEMPT=1
while [ $ATTEMPT -le $RETRIES ]; do
if git push origin $BRANCH; then
echo "✅ Pushed successfully"
return "pushed"
fi
echo "Push failed (attempt $ATTEMPT/$RETRIES), retrying in 5s..."
sleep 5
ATTEMPT=$((ATTEMPT + 1))
done
# All retries exhausted
echo "❌ Push failed after $RETRIES attempts"
After all retries exhausted:
⚠️ PUSH FAILED
Could not push to origin/{BRANCH} after {RETRIES} attempts.
Possible causes:
- Network connectivity issues
- Remote rejected the push (force push required?)
- Authentication expired
Your commits are saved locally. Please push manually when connectivity is restored:
git push origin {BRANCH}
Continuing with local work...
Return error but do not stop — the work is saved locally.
When Planner creates or modifies PRD artifacts, it should auto-commit and push.
| Path Pattern | Trigger |
|--------------|---------|
| docs/drafts/*.md | PRD draft created/modified |
| docs/drafts/*.json | PRD draft JSON created/modified |
| docs/prds/*.md | PRD moved to ready |
| docs/prds/*.json | PRD JSON moved to ready |
| docs/bugs/*.md | Bug PRD created/modified |
| docs/bugs/*.json | Bug PRD JSON created/modified |
| docs/completed/* | PRD archived |
| docs/abandoned/* | PRD abandoned |
| docs/prd-registry.json | Registry updated |
docs(prd): {action} {prd-name}
Examples:
- docs(prd): create draft user-authentication
- docs(prd): refine draft user-authentication
- docs(prd): move user-authentication to ready
- docs(prd): archive completed user-authentication
- docs(prd): create bug login-redirect-loop
1. Stage PRD files:
git add docs/drafts/ docs/prds/ docs/bugs/ docs/completed/ docs/abandoned/ docs/prd-registry.json
2. Check if anything staged:
git diff --cached --quiet && echo "Nothing to commit" && exit
3. Commit:
git commit -m "docs(prd): {action} {prd-name}"
4. Run Push Protocol (with confirmation if configured)
Builder should sync at these points:
conflict returned, stop and show resolution instructionssynced, continue to project selectionconflict, stop and alerterror (network), continue working (commits are local)conflict, stop and alertToolkit already pushes after changes. With team sync:
conflict, stop and alerterror, alert but changes are committed locallySafe to fast-forward:
git pull --ff-only
Branches have diverged (both local and remote have new commits):
# Option 1: Rebase local on top of remote
git pull --rebase
# Option 2: Merge (creates merge commit)
git pull
# Option 3: See what diverged
git log HEAD..origin/main --oneline # Remote commits
git log origin/main..HEAD --oneline # Local commits
Remote has commits you don't have:
git pull --rebase
git push
# For HTTPS with credential helper
git credential reject https://github.com
# For SSH, check agent
ssh-add -l
ssh-add ~/.ssh/id_ed25519
# Re-authenticate
git push # Will prompt for credentials
1. Session start
├─ git fetch origin
├─ Check: 2 commits behind, no local changes
├─ git pull --ff-only origin main
└─ ✅ Synced
2. User creates new PRD draft
├─ Write docs/drafts/prd-user-auth.md
├─ Update docs/prd-registry.json
├─ git add docs/drafts/ docs/prd-registry.json
├─ git commit -m "docs(prd): create draft user-auth"
├─ Confirm push? (y)
├─ git push origin main
└─ ✅ Pushed
3. User refines PRD
├─ Edit docs/drafts/prd-user-auth.md
├─ git add docs/drafts/prd-user-auth.md
├─ git commit -m "docs(prd): refine draft user-auth"
├─ Confirm push? (y)
├─ git push origin main
└─ ✅ Pushed
4. User moves PRD to ready
├─ git mv docs/drafts/prd-user-auth.md docs/prds/
├─ Update docs/prd-registry.json status
├─ git add -A
├─ git commit -m "docs(prd): move user-auth to ready"
├─ Confirm push? (y)
├─ git push origin main
└─ ✅ Pushed
data-ai
Generate verification contracts before delegating tasks to sub-agents, defining how success will be measured. Triggers on: verification contract, delegation contract, task verification, contract-first delegation.
testing
Verify that Vercel environment variables point to the correct Supabase project for each environment to prevent staging/production cross-wiring. Triggers on: vercel supabase check, environment alignment, env var check, supabase environment.
development
Manage codebase and database vectorization for semantic search. Use when initializing, refreshing, or querying the vector index. Triggers on: vectorize init, vectorize refresh, vectorize search, semantic search, vector index, enable vectorization.
testing
Patterns for XCUITest UI tests for native Apple apps (macOS/iOS). Use when writing or reviewing XCUITest tests for Swift apps. Triggers on: XCUITest, xcuitest, native app testing, Apple UI tests, SwiftUI tests, AppKit tests, UIKit tests.