Ported from oh-my-codex git-master. OMX runtime conventions ($macro invocation,
omx CLI, .omx/ state directory) are replaced with WorkBuddy idioms
(Skill tool, Agent tool, task list, .workbuddy/memory).
Git Master
Git operations expert. Use this skill whenever the user needs precise, safe git
work: atomic commits, interactive rebasing, branch management, history cleanup, or
style-consistent commit messages.
Usage
Invoke the git-master skill and describe the git task, e.g.:
"rebase my feature branch onto main", "squash these 5 commits", "write a conventional
commit for these changes".
Capabilities
- Atomic commits with conventional-commit format
(
feat:, fix:, refactor:, docs:, test:, chore:).
- Interactive rebasing (
rebase -i) for reordering, squashing, fixing up.
- Branch management: create/rename/delete, branch-point detection, divergence check.
- History cleanup: prune stray commits, rewrite messages, split/join commits.
- Style detection: read the repo's existing commit history to match its convention
before writing new commits.
Workflow
Assess the working tree. Run read-only checks first:
git status
git log --oneline -10
git diff --stat
Detect the repo's commit style from recent history before composing messages.
Plan the operation. For anything destructive (rebase, reset, branch delete,
amend of already-pushed commits), use the task list (TaskCreate) to outline steps,
and surface a short plan to the user. If the operation rewrites shared/pushed
history, ask for explicit confirmation before proceeding (use AskUserQuestion for
a clean yes/no).
Execute safely.
- Prefer
--autosquash when queuing fixups.
- For atomic commits, stage narrowly:
git add -p or stage specific paths rather
than git add -A.
- Write messages that match the detected style; default to Conventional Commits
when the repo has no clear convention.
Verify. After the operation:
git status
git log --oneline -5
Confirm the tree matches intent and there are no leftover staged/unstaged changes
unless expected.
Safety rules
- Never rewrite history that has already been pushed to a shared branch without
explicit user confirmation.
- Always check
git status and git log before mutating.
- For large/risky history rewrites, suggest creating a backup branch first
(
git branch backup/<name>).
- If unsure about intent, ask the user rather than guessing.
Handoff
When the git task is part of a larger flow (e.g. a ralph/ultrawork loop or a
PR prep), record the resulting commit range and branch state in the task list and/or
append a short note to .workbuddy/memory/YYYY-MM-DD.md so downstream steps can pick
up where this left off.
1---2name: git-master3description: Git expert for atomic commits, interactive rebasing, branch management, and history cleanup. Trigger "git rebase", "atomic commits", "clean git history", "squash commits", "branch strategy".4---56> Ported from oh-my-codex `git-master`. OMX runtime conventions (`$macro` invocation,7> `omx` CLI, `.omx/` state directory) are replaced with WorkBuddy idioms8> (Skill tool, Agent tool, task list, `.workbuddy/memory`).910# Git Master1112Git operations expert. Use this skill whenever the user needs precise, safe git13work: atomic commits, interactive rebasing, branch management, history cleanup, or14style-consistent commit messages.1516## Usage1718Invoke the `git-master` skill and describe the git task, e.g.:19"rebase my feature branch onto main", "squash these 5 commits", "write a conventional20commit for these changes".2122## Capabilities2324- **Atomic commits** with conventional-commit format25 (`feat:`, `fix:`, `refactor:`, `docs:`, `test:`, `chore:`).26- **Interactive rebasing** (`rebase -i`) for reordering, squashing, fixing up.27- **Branch management**: create/rename/delete, branch-point detection, divergence check.28- **History cleanup**: prune stray commits, rewrite messages, split/join commits.29- **Style detection**: read the repo's existing commit history to match its convention30 before writing new commits.3132## Workflow33341. **Assess the working tree.** Run read-only checks first:35 ```bash36 git status37 git log --oneline -1038 git diff --stat39 ```40 Detect the repo's commit style from recent history before composing messages.41422. **Plan the operation.** For anything destructive (rebase, reset, branch delete,43 amend of already-pushed commits), use the task list (TaskCreate) to outline steps,44 and surface a short plan to the user. If the operation rewrites shared/pushed45 history, ask for explicit confirmation before proceeding (use AskUserQuestion for46 a clean yes/no).47483. **Execute safely.**49 - Prefer `--autosquash` when queuing fixups.50 - For atomic commits, stage narrowly: `git add -p` or stage specific paths rather51 than `git add -A`.52 - Write messages that match the detected style; default to Conventional Commits53 when the repo has no clear convention.54554. **Verify.** After the operation:56 ```bash57 git status58 git log --oneline -559 ```60 Confirm the tree matches intent and there are no leftover staged/unstaged changes61 unless expected.6263## Safety rules6465- Never rewrite history that has already been pushed to a shared branch without66 explicit user confirmation.67- Always check `git status` and `git log` before mutating.68- For large/risky history rewrites, suggest creating a backup branch first69 (`git branch backup/<name>`).70- If unsure about intent, ask the user rather than guessing.7172## Handoff7374When the git task is part of a larger flow (e.g. a `ralph`/`ultrawork` loop or a75PR prep), record the resulting commit range and branch state in the task list and/or76append a short note to `.workbuddy/memory/YYYY-MM-DD.md` so downstream steps can pick77up where this left off.