packages/omo-codex/plugin/skills/git-master/SKILL.md
Use this skill when the user asks you to operate on Git history or answer a Git-history question. Be exact, conservative, and evidence-led. Read the repository state before you infer anything.
Classify the request first:
COMMIT: stage and commit local changes.REBASE: rebase, squash, fixup, autosquash, reorder, split, or otherwise rewrite branch history.HISTORY: answer when, where, who, why, or which commit changed something.STATUS: inspect branch, diff, or working-tree state without changing it.Do not commit, rebase, push, force-push, reset, stash-pop, or delete anything unless the user explicitly asked for that operation. If the request is only investigative, report findings and stop.
Gather independent facts in parallel when the tools allow it:
git status --short
git diff --stat
git diff --staged --stat
git branch --show-current
git log -30 --oneline
git log -30 --pretty=format:%s
git rev-parse --abbrev-ref @{upstream}
git merge-base HEAD origin/main
git merge-base HEAD origin/master
Missing upstream or missing main/master is normal. Fall back to the best available branch or report the missing fact. Never treat a failed lookup as proof.
Commit only the user's requested changes. Preserve unrelated dirty work.
git diff --staged --stat and enough staged diff to prove the group is right.git log -1 --oneline.Grouping rules:
Final report: list commit hashes, messages, and any remaining uncommitted files.
History rewriting is a shared-impact operation.
main, master, dev, release branches, or a protected branch unless the user explicitly named that exact operation.--force-with-lease, never plain --force.git commit --fixup=<hash> followed by GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash <base>.git rebase --abort first. Use reflog only after explaining the recovery path.After rewriting, run the relevant tests or at least the project's cheapest smoke check, then show the new branch log from base to HEAD.
Choose the Git tool by the question:
git log -S "text": when the count of an exact string changed.git log -G "regex": when diffs touched lines matching a pattern.git blame -L start,end -- file: who last changed specific lines.git log --follow -- file: history across renames for one file.git show <hash>: inspect the commit that appears relevant.git bisect: find the first bad commit when there is a deterministic pass/fail command and known good/bad bounds.git reflog: recover or explain recent local history movement.Always cite the exact command evidence in the answer: commit hash, subject, file path, and line or diff context when relevant. If the evidence is ambiguous, say what remains unproven.
Before any write to Git history:
rebase --abort, reflog hash, or untouched worktree).Before finishing: