git-master
Allows your agent to manage version history with Git. Useful for making commits, reorganizing history, and investigating past code changes.
What it does
This agent helps manage your code's version history using Git. It can do things like save your changes with clear descriptions (commits), organize the change history, and answer questions about who changed what and when.
When to use it
- ✓When you need to save a set of code changes.
- ✓When you want to understand or reorganize the history of how the code has changed.
- ✓When you need to find out who made a specific change to the code.
Example of what to ask your AI
“Save my recent changes into a commit with the message 'Add login functionality'.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It analyzes your commands and uses Git tools to perform actions like creating commits, reorganizing history, or retrieving information about past changes. It checks the current code state before acting.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add code-yeongyu/oh-my-openagent --skill git-masterOr download just the file:
curl -L https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/dev/packages/shared-skills/skills/git-master/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Git Master
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.
Mode Gate
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.
Ground Truth
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.
PR Body Evidence Attachments
When a PR body needs screenshots or terminal PNGs, use the repo reference at docs/reference/github-attachment-upload.md. The allowed hosting path is GitHub user attachments from the authenticated web attachment flow; never commit temporary images, never use GitHub Releases for PR evidence, and never use external image hosts. Do not log browser cookies, CSRF tokens, S3 form fields, or upload headers.
Commit Mode
Commit only the user's requested changes. Preserve unrelated dirty work.
- Detect message style from recent history. Use the dominant local pattern, language, and casing. Do not default to Conventional Commits unless the repo uses them.
- Inspect the full diff, not only filenames. Separate unrelated user edits from the requested commit.
- Build atomic groups by behavior, module, and revertability. Keep implementation and its direct tests together.
- Prefer multiple commits for unrelated concerns. A single commit is acceptable only when the changed files form one indivisible behavior or the user explicitly asks for one commit.
- Stage by path or hunk so each commit contains only its atomic group.
- Before each commit, verify
git diff --staged --statand enough staged diff to prove the group is right. - Commit with the detected style. After each commit, verify
git log -1 --oneline.
Grouping rules:
- Split different features, modules, generated artifacts, config, docs, and test-only changes unless they are inseparable.
- Keep generated files with the source change that produced them when omitting them would leave the repo inconsistent.
- Never hide failing or unrelated changes inside a broad commit.
Final report: list commit hashes, messages, and any remaining uncommitted files.
Rebase Mode
History rewriting is a shared-impact operation.
- Never rebase or rewrite
main,master,dev, release branches, or a protected branch unless the user explicitly named that exact operation. - If commits may already be pushed, ask before force-pushing. Use
--force-with-lease, never plain--force. - If the worktree is dirty, preserve it intentionally before rebasing. Do not stash-pop over conflicts without checking what changed.
- For fixups, prefer
git commit --fixup=<hash>followed byGIT_SEQUENCE_EDITOR=: git rebase -i --autosquash <base>. - For conflicts, read the conflicting files and resolve by intent. Do not choose ours/theirs blindly.
- If a rebase goes wrong, use
git rebase --abortfirst. 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.
History Mode
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.
…
FAQ
What is an 'atomic commit'?
It's a save of changes that focuses on a single task or fix, making the history easier to understand and manage.
What does 'rewriting history' mean?
It means altering commits that have already been made, like combining several commits into one or changing their order. This should be done carefully.
What does Git do if I don't ask to save?
If you only ask questions about history or request a status check, it will only provide information without making any changes.
Details
Original description by the author
Handles git work: atomic commits, rebase, squash, blame, bisect, reflog, and history questions. Use whenever a task needs a commit or a git-history investigation; skip for ordinary code edits.
Popularity
- GitHub stars
- 70k
- Ranking position
- #1739
- License
- NOASSERTION
- Updated
- 10/16/2026
Comments
- …
More skills from this repository
comment-checker
Helps your agent understand and respond to feedback from automatic comment checkers. It's useful when the agent needs to process information from tools that automatically review code or content.
code-yeongyu/oh-my-openagent
lcx-contribute-bug-fix
Helps your agent contribute bug fixes for LazyCodex-related projects. It creates issues or pull requests to ensure code quality.
code-yeongyu/oh-my-openagent
lcx-doctor
Lets your agent check the health of LazyCodex and Codex CLI installations. It's useful when the system behaves oddly after updates or changes.
code-yeongyu/oh-my-openagent
lcx-report-bug
Helps your agent report bugs in detail for LazyCodex projects. It creates issues with useful information for developers to fix the problem.
code-yeongyu/oh-my-openagent
Similar skills
benchmark-optimization-loop
Has your agent improve something's speed in a measured way. It tests multiple versions and chooses the fastest one that still works correctly.
affaan-m/ECC
change-impact
Helps your agent analyze the impact of code changes before making them. It compares the planned vs. actual results afterward, covering paths, data, tests, and documentation. Useful for risky or system-wide changes.
affaan-m/ECC
click-path-audit
Lets your agent trace all user buttons and interactions to find bugs. It finds issues where functions seem to work alone but fail together. Useful when bugs persist even after debugging.
affaan-m/ECC