repo-sync
Skill4 starsChanged 12 days agoMITView on GitHub
Use when the user wants to confirm a local git repo matches its GitHub remote and pull the latest before working — phrasings like "check if local has the latest from GitHub", "is this repo up to date with the remote", "sync this repo", "pull Lovable's changes first", or at the start of local work on a repo that's also edited in the cloud (Lovable / Supabase projects like videomatic). Detects up-to-date / behind / ahead / diverged, fast-forwards when lossless, and can overwrite the local copy with the remote — always backing up first — when they've diverged.
- Reads credentials
- Deletes or force-pushes
8 other projects use a version of this.
Adopted by
Most recently taken up by
- davidondrej/skillstheir own version, first seen Oct 29, 2026
- avtak/divantheir own version, first seen Oct 25, 2026
- aberson/skill-meshtheir own version, first seen Oct 24, 2026
- tomwangowa/agent-skillstheir own version, first seen Oct 21, 2026
- GoogleCloudPlatform/magic-modulestheir own version, first seen Oct 13, 2026
- Jasons-impart/Create-Delight-Remaketheir own version, first seen Oct 8, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- davidondrej/skills★ 4.3ksame name
- GoogleCloudPlatform/magic-modules★ 975same name
- Jasons-impart/Create-Delight-Remake★ 313same name
- avtak/divan★ 4same name
- aberson/skill-mesh★ 2same name
- navikt/hovmester★ 2same name
- tomwangowa/agent-skills★ 2same name
- rossoctl/agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository131 other files it gives its agents.
- agent-contractSkill
- brand-chrome-loginSkill
- contexto-aristasSkill
- crear-bot-nicoSkill
- daily-standupSkill
- design-a-grok-botSkill
- drift-hunt-rosterSkill
- explain-grokbotSkill
- exportar-botSkill
- govern-agentic-osSkill
- grok-bot-project-opsSkill
- hallazgoSkill
- handoff-local-hermesSkill
- identity-pipelineSkill
- loop-corpSkill
- no-devSkill
- orca-handoffSkill
- panorama-de-flujoSkill
- reporte-gmSkill
- routine-healthcheckSkill
- sprint-parallelSkill
- transcript-healthcheckSkill
- getting-started-brandySkill
- getting-started-calendario-contenidoSkill
- getting-started-cazador-de-canalesSkill
- getting-started-cazador-de-vuelosSkill
- getting-started-cazador-gangasSkill
- getting-started-cazador-inmobiliarioSkill
- getting-started-cazador-programasSkill
- getting-started-cazador-sponsorsSkill
- getting-started-cazador-viviendaSkill
- getting-started-content-drafterSkill
- getting-started-data-scienceSkill
- getting-started-demand-hunterSkill
- getting-started-digital-storesSkill
- getting-started-directory-builderSkill
- getting-started-enrichment-deskSkill
- getting-started-event-hunterSkill
- getting-started-expense-managerSkill
- getting-started-gm-operacionesSkill
- getting-started-inbox-managerSkill
- getting-started-intake-intelSkill
- getting-started-intelligence-gmSkill
- getting-started-join-a-startupSkill
- getting-started-last30daysSkill
- getting-started-life-opsSkill
- getting-started-luma-taggingSkill
- getting-started-market-watcherSkill
- getting-started-meta-vaultSkill
- getting-started-musa-designerSkill
- getting-started-plantillas-notionSkill
- getting-started-product-hunterSkill
- getting-started-publisherSkill
- getting-started-pulso-brandSkill
- getting-started-pulso-diaSkill
- getting-started-renewals-hunterSkill
- getting-started-saves-archivistSkill
- getting-started-scraping-deskSkill
- getting-started-seo-deskSkill
- getting-started-sliderSkill
- The first 60 shown.
The file
Files
repo-sync
Make the local working copy reflect GitHub's latest before you start editing.
Why this exists
Some repos are edited in two places: the cloud (e.g. Lovable committing to GitHub for the videomatic / pixel-orchestrator-ui project) and locally with Claude Code. GitHub holds the newest cloud changes, so the local clone silently drifts behind. Starting local work on a stale clone means editing old code and creating avoidable conflicts. This skill checks the gap first and brings local up to GitHub's state — overwriting local when needed, but never without a recoverable backup.
Tool
A single script does all the git plumbing so you don't re-derive it each time. Run it from inside the target repo (the current working directory's repo). Resolve its path relative to this SKILL.md: scripts/repo-sync.sh.
bash <skill-dir>/scripts/repo-sync.sh check # READ-ONLY: fetch + report state
bash <skill-dir>/scripts/repo-sync.sh sync # apply the safe action
bash <skill-dir>/scripts/repo-sync.sh sync --force # also allow overwriting local (with backup)The script reports state: as one of:
| State | Meaning | What sync does |
up-to-date | local == remote | nothing |
behind | remote has commits local lacks | fast-forward (lossless) |
ahead | local has commits not on remote | refuses unless --force; then backs up + hard-resets to remote |
diverged | both have unique commits | refuses unless --force; then backs up + hard-resets to remote |
Workflow
- Always start with
check. It's read-only — itfetches and prints the state, the ahead/behind counts, and a recommended action. Show the user that line. - Decide based on state:
up-to-date→ nothing to do. Say so and proceed with the real work.behind→ runsync. This is a plain fast-forward, lossless. Safe to do without asking (it's exactly what "pull the latest" means). If the tree is dirty the script will ask for--forceso it can stash first — mention the stash to the user.aheadordiverged→ stop and confirm with the user before overwriting. Local commits exist that aren't on GitHub. The user's intent for this skill is "let GitHub win and start from there," but that discards local commits, so surface exactly what would be lost (git log @{u}..@ --oneline) and confirm. Only then runsync --force.
- Report what happened — the resulting state and, for any overwrite, the backup branch name and stash the script created.
Safety — nothing is lost
sync --force never destroys silently. Before any git reset --hard or fast-forward over a dirty tree, the script:
- creates a
backup/pre-sync-<timestamp>branch at the current commit (recovers committed work), and - runs
git stash push -u(recovers uncommitted and untracked files).
So even a "wrong" overwrite is reversible: git checkout backup/pre-sync-<ts> or git stash list → git stash pop. Tell the user these exist rather than assuming they'll read the script output.
This script wraps git reset --hard deliberately, so the vault's PreToolUse guardrail (which blocks bare git reset --hard) won't fire — the backups are what make that acceptable. Don't work around the guardrail by other means; route destructive syncs through this script so the backup always happens.
Notes for the videomatic repo specifically
- Remote:
pixel-orchestrator-ui.git, branchmain, upstreamorigin/main. - It's a standalone git repo nested under the vault; the vault's auto-commit daemon does not commit it, so its uncommitted changes are real local work — don't assume a clean tree.
- Untracked files ending in
2(e.g.Editor 2.tsx,.env 2.example) are Google Drive sync-conflict duplicates, not real source. A force-sync stashes them away (recoverable), which is usually the desired cleanup.
After many syncs
Backup branches accumulate. To prune old ones once you're sure they're not needed:
git branch --list 'backup/pre-sync-*' then delete the stale ones with git branch -D <name>.
Lane (Grok Bot fleet)
- Canonical copy lives on Ignacio's Mac (Hermes / Claude Code):
~/.hermes/skills/repo-sync/and vault.claude/skills/repo-sync/. - Overnight or Cloud Agent work that touches a Mac clone → SWE briefs Hermes to run repo-sync first (SWE does not clone on the Grok box).
- Pure Cloud Agent on the GitHub remote → no local clone; skip this skill (the remote is the source of truth for the agent).
- Matching Lovable projects ↔ local folders: list Lovable via MCP, list local
02_Programs/3-Software/(or named paths) via Hermes/Mac; for each matched git remote, runcheckthensync. - Local execution = Hermes. SWE orchestrates (names repo, goal, whether the night uses Cloud vs Hermes/OmniRouter).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

