skills/git-sync/SKILL.md
Sync local git state to the latest remote branch state (`main`, current branch, or explicit target branch) with safe fast-forward behavior and clear verification.
npx skillsauth add olliecrow/codex 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.
rg -> find/grep, python -> python3, alternate repo-native scripts).plan/, ensure required plan directories exist before reading/writing them (create when edits are allowed; otherwise use an in-memory fallback and call it out).investigate -> plan -> fix -> verify -> battletest -> organise-docs -> git-commit -> re-review; cleanup scan -> prioritize -> clean -> verify -> re-scan; docs audit -> update -> verify -> re-audit.organise-docs frequently during execution to capture durable decisions and learnings, not only at the end.git-commit when changes are commit-eligible, checks are green, and repo policy permits commits.docs/ accurate and up to date, and promote durable learnings and decisions from work into docs.git-commit to create a small logical checkpoint commit once relevant checks are green and repo policy permits commits.organise-docs whenever durable learnings/decisions appear, and prune stale plan/ scratch artifacts.The skill is complete only when all of the following are true:
blocked with concrete blocker evidence.done, blocked, or not-applicable, with brief evidence or rationale.Stop only after this terminal contract is satisfied; otherwise continue iterating.
done: requested outcome is delivered and required checks are completed (for example expected artifact/report produced and required validation command(s) passed).blocked: progress cannot continue after bounded retries because of a concrete dependency or access issue; blocker evidence and exact unblock action are reported.not-applicable: an optional step is explicitly skipped with reason (for example no remote configured, so push step is marked not-applicable).Safely sync local git state with the most recent remote state for one of:
main/master), orDefault behavior is fast-forward only. Do not introduce merge commits during sync.
Use this skill when the user intent matches phrases like:
git pullpull branchpull most recent remote mainsync with upstreamswitch to most recent version of branchIf the request is only synchronization and branch-state verification, prefer git-sync over broader git skills.
Use these copy-paste templates:
[$git-sync] sync current branch with upstream (ff-only) and verify branch/upstream/ahead-behind.[$git-sync] pull most recent remote main (ff-only) and report new HEAD commit.[$git-sync] sync explicit branch olliecrow/<branch-name> to latest remote state (ff-only).[$git-sync] verify we are on most recent remote <branch-name>; if blocked, return exact unblock commands.git with command -v, and confirm remote availability.git fetch + explicit fast-forward operations over implicit merges.git rebase, git commit --amend, git reset --hard, git reset --soft, git reset --mixed, git push --force, git push --force-with-lease, or git filter-branch, or git clean -fdx.--ff-only for pull/sync operations.Preflight:
git rev-parse --show-toplevel, git status -sb, git remote -v.origin/main, fallback origin/master).Determine sync target mode:
current-branch when user says git pull or pull branch.mainline when user says pull most recent remote main or equivalent.explicit-branch when user names a remote branch.mainline, distinguish the user's actual need:
literal-mainline: they need this worktree on the local mainline branch itself.content-parity-only: they only need the current worktree content to match origin/<mainline>.current-branch and state the assumption.Fetch fresh remote state:
git fetch --prune origin (bounded retries on transient failure).Apply sync safely:
current-branch: if tracking branch exists, run git pull --ff-only.mainline + literal-mainline: switch to detected mainline branch if needed, then run git pull --ff-only origin <mainline>.literal-mainline is blocked because the mainline branch is checked out in another worktree, do not fast-forward the current feature branch as a silent substitute; report the block and give exact safe options (for example use another worktree that can check out mainline).mainline + content-parity-only: only when the working tree is clean and the user does not require literal branch identity, fast-forward the current branch to origin/<mainline> and report explicitly that content now matches mainline while branch identity did not change.explicit-branch: fetch branch, switch/create local tracking branch if needed, then pull with --ff-only.Verify sync outcome:
git status -sb).git log --oneline -n 1) and whether local is aligned with upstream.Output contract:
mainline, state whether the result achieved literal-mainline or only content-parity-only.data-ai
Use automatically for Sentinel repo sessions, trading research questions, market/company/ticker/source questions, or any request that should use Sentinel's read-only data sources and reference context. Enforces Sentinel's high-confidence, read-only, no-local-query-trace research posture.
documentation
Compact the current conversation into a handoff document for another agent to pick up.
tools
Run the Codex custom review feature from the CLI for arbitrary review instructions. Use when the user asks to use /review, custom review, or Codex review without tying the review to commits, uncommitted changes, or a base branch; prefer multicodex exec review with no explicit account and fall back to codex exec review only when multicodex is unavailable.
tools
Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).