git-master
できること
このエージェントは、Gitを使ってコードのバージョン履歴を管理するのに役立ちます。変更内容を分かりやすい説明とともにコミットとして保存したり、変更履歴を整理したり、誰がいつ何を変更したかの質問に答えたりできます。
使う場面
- ✓一連のコードの変更を保存したいとき。
- ✓コードの変更履歴を理解したり、整理し直したりしたいとき。
- ✓特定のコードの変更を誰が行ったかを調べたいとき。
スキルのリンク
https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/git-master/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“最近の変更を、メッセージ'Add login functionality'でコミットして保存して。”
毎週5つの新しいスキル。1分で読めます。
仕組み
依頼内容を分析し、Gitのツールを使ってコミットの作成、履歴の整理、過去の変更情報の取得などの操作を行います。操作の前に、現在のコードの状態を確認します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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.
…
よくある質問
「アトミックコミット」とは何ですか?
1つの作業や修正だけに絞って変更を保存することです。履歴が分かりやすくなり、管理もしやすくなります。
「履歴の書き換え」とは何ですか?
すでに作成されたコミットを変更することです。複数のコミットを1つにまとめたり、順番を入れ替えたりする操作が含まれます。慎重に行う必要があります。
保存を依頼しなかった場合、Gitはどうなりますか?
履歴についての質問や状態の確認だけを依頼した場合は、情報を提供するだけで、何も変更しません。
詳細
作者による元の説明
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.
人気
- GitHubのスター
- 70k
- ランキング
- #3134
- ライセンス
- NOASSERTION
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
comment-checker
70kエージェントが自動コメントチェッカーからのフィードバックを理解し、それに対応するのを支援します。自動化されたコードやコンテンツのレビュー結果の処理に役立ちます。
lcx-contribute-bug-fix
70kエージェントがLazyCodex関連プロジェクトのバグ修正に貢献するのを支援します。Issueやプルリクエストを作成し、コードの品質を保ちます。
lcx-doctor
70kエージェントがLazyCodexとCodex CLIのインストール状態を確認できるようにします。更新や変更の後に動作がおかしいときに役立ちます。
lcx-report-bug
70kエージェントがLazyCodexプロジェクトのバグを詳しく報告するのを支援します。開発者が問題を修正するのに役立つ情報を含むIssueを作成します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。