/blake-os:git-syncfrom blake-os
Syncs a local git branch with origin via fast-forward or merge commit. Never rebases or force-pushes. Invoked by blake-os:git-ops router or directly on 'git pull'/'git sync' requests.
Ships in blake-os. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Bring the local branch current with origin. Fast-forward when the branch is only behind; merge to integrate when local and remote have both moved. Never rebase, never force-push, never resolve conflicts automatically.
blake-os:git-ops) sends a "get the latest" requestgit-commit — a clean working
tree is required (Step 3), which is why the router commits firstgit rev-parse --is-inside-work-tree >/dev/null 2>&1 && echo "in_repo: yes"
git remote get-url origin
git branch --show-current
If not a git repo, stop: "This directory is not a git repository."
If no origin remote, stop: "No remote configured." Do not invent one.
git fetch origin
git rev-list --left-right --count @{u}...HEAD # output: "<behind> <ahead>"
git status --porcelain # any output = dirty working tree
If git fetch fails (network, auth), report the error verbatim and stop. Do not pull.
The rev-list line prints two numbers: behind (commits the remote has that the local branch doesn't) and ahead (local commits the remote doesn't have). These two numbers drive the decision in Step 3 — not error-message text. (If @{u} errors because no upstream is set, the branch has never been pushed; there is nothing to sync — tell the user to git-push to publish it.)
behind = 0 — already current. If ahead > 0, note there are unpushed commits (run git-push). Done.
behind > 0 and ahead = 0 — simple fast-forward:
git pull --ff-only
On success, report how many commits were pulled. If it fails because the working tree is dirty (local changes would be overwritten), stop — list the blocking files and tell the user to commit them with git-commit or set them aside, then sync again. Do not stash.
behind > 0 and ahead > 0 — diverged; both sides committed. Integrate with a merge:
The working tree must be clean first. If git status --porcelain printed anything, stop: "You have uncommitted changes — commit them with git-commit, then sync to integrate." Do not stash, do not merge over a dirty tree.
With a clean tree, merge:
git pull --no-rebase --no-edit
--no-edit accepts the default merge-commit message so the command never stalls waiting on an editor.
Clean merge: report the merge commit and how many remote commits were integrated. Local is now ahead N / behind 0 — tell the user to run git-push.
Conflict (the command exits non-zero, or git status shows unmerged UU paths): abort immediately and hand off —
git merge --abort
Then stop: list the conflicted files and report "Automatic merge hit conflicts; reverted to the pre-merge state. These need to be resolved by hand." Never edit files to resolve a conflict.
git rev-list --left-right --count @{u}...HEAD
git status --short --branch
Report: branch, behind/ahead after sync, whether a merge commit was created, clean or dirty tree.
git rebase, never git reset --hard, never force-push.git merge --abort and hand off to a human.Ordering across operations is owned by blake-os:git-ops.
What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/feedbackFiles a GitHub issue on this repo to tell Brent about anything worth his attention — confusion, something that didn't work, an idea or wish, or a new way the user phrased a request. Brent is a collaborator on this private repo and uses these issues to fix and improve the tools. Use this whenever the user sounds confused or frustrated, says something is broken or didn't work as expected, wishes something worked differently, or asks to tell Brent something — even if they never say "feedback" or "issue". Also invoked by blake-os:git-ops to log a request it could not cleanly route./git-commitInternal commit step for the blake-os git-ops router. Stages explicit file paths and creates atomic commits on the current branch, matching the repo's existing message style and scanning for secrets before staging. Invoked by blake-os:git-ops — not a direct entry point. Trigger directly only on the exact request "git commit"./git-opsSingle front door for everything git and GitHub — saving work, getting the latest, backing up, and putting changes online. Routes plain-language requests to the right operation in the correct order, even when the user does not use git terms. Use whenever the user wants to save, back up, update, sync, upload, publish, or check on their project's files — phrases like "save my work", "back it up", "I'm done", "get the latest", "put it online", "did it save?"./git-pushInternal push step for the blake-os git-ops router. Publishes local commits to origin only when the branch is current, after verifying it is not behind; never force-pushes. Invoked by blake-os:git-ops — not a direct entry point. Trigger directly only on the exact request "git push".npx claudepluginhub basher83/lunar-claude --plugin blake-osOther plugins' skills for the same job