omh-git-workflow
できること
マージ競合の解決計画を立て、bisectで問題のあるコミットを見つけ、履歴を修復します。書き換えの前に、すでにプッシュ済みの内容を確認します。gitの問題で困っている開発者が対象です。
使う場面
- ✓マージやリベースの競合が起き、安全に解決したいとき。
- ✓あるコミットで不具合が起きたため、どのコミットかを特定したいとき。
- ✓レビューの前に、ブランチの履歴を整理したいとき。
スキルのリンク
https://github.com/rlaope/oh-my-hermes/blob/main/agent-skills/omh-git-workflow/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“レビューの前にこのブランチの履歴を整理してください。作業内容は失わないようにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントはまず、すでにプッシュされている内容を確認し、書き換えの前にバックアップ用の地点を設定します。そのうえで、書き換えや解決の手順を一つずつ計画します。強制プッシュは、より安全な--force-with-lease形式でのみ行います。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Git Workflow
This is an OMH git-workflow workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).
Why This Exists
git-workflow exists because conflict resolution, bisect, and history repair had no owner: "resolve this merge conflict" reached a file operator and "clean up this branch's history" a live-information lane, while this repository's own incidents -- a stack that replayed its base commits, a commit landing on another session's branch -- each had a known correct procedure.
First Steps
- Name what is already pushed: each branch involved with its local head, its remote head, and whether others may have fetched it.
- Before any step that rewrites history, name its recovery point.
Do Not Use When
- The request is to write the commit message or the PR body for a finished change; use
omh-commit-pr-authoring. - The request is to find defects in a diff before merging it; use
omh-code-review. - The build or CI job fails and the question is why; use
omh-build-failure-triage. - The request is a code change to deliver rather than branch or history repair; use
ulw-work.
Examples
Good example:
- Prompt: clean up this branch's history before review
- Expected behavior: Prepare pushed_state_inventory/v1 first, then history_rewrite_plan/v1 with a backup branch before the interactive rebase and
--force-with-leasefor the push, naming who must re-fetch. - Why: Whether the branch is pushed decides whether the cleanup is local or shared.
Bad example:
- Prompt: just force push my rebased branch over main
- Expected behavior: Refuse the bare force-push: inventory what is pushed on main, and plan
--force-with-leaseonto the feature branch only. - Why: A bare force-push over a shared branch discards other people's commits without a check.
Completion Checklist
- The pushed-state inventory names every branch the plan touches.
- Every rewriting step has a recovery point in front of it.
- Every force-push in the plan uses
--force-with-lease. - Generated and counted files in a conflict are re-derived, not picked.
- Resolution, bisect verdict, and push are reported only from observed output.
Recovery Notes
- If the remote state is unknown, plan
git fetchand the inventory first and rewrite nothing until it is observed. - If a rewrite went wrong, recover from the recovery point or the reflog entry before trying anything else.
When to Use
Use when a git branch needs repair rather than new code: a merge or rebase conflict to resolve, a regression to bisect to the commit that introduced it, or history to rewrite, squash, recover, or rebase -- including a stack of branches. The work is a plan that names what is already pushed, what each step rewrites, and how to get back.
Strong routing signals: `git-workflow`, `git workflow`, `merge conflict`, `merge conflicts`, `rebase conflict`, `resolve the conflict`, `resolve this conflict`, `conflict markers`, `git bisect`, `bisect`, `which commit broke`, `find the commit that broke`, `rewrite history`, `rewrite the history`, `branch history`, `branch's history`, `clean up the history`, `interactive rebase`, `squash commits`, `squash the commits`, `force push`, `force-push`, `force-with-lease`, `reflog`, `git reset`, `lost commit`, `recover the commit`, `undo the last commit`, `cherry-pick`, `stacked prs`, `stacked branches`, `rebase the stack`, `detached head`
Catalog Metadata
Category: verification
Phase: git-repair
Quality tier: history-safety-gated
Reasoning demand: standard
Quality bar:
- Start with the pushed-state inventory; a plan without it cannot say which steps are safe.
- Mark every step that rewrites history and put its recovery point in front of it.
- Load
references/git-repair-method.mdfor the conflict, bisect, rewrite, and stacked-branch procedures instead of improvising them. - For a stack of branches, rebase each onto the new head of the one below with
--ontoand the old base, never with a merge-base computed after the base moved. - Report each step's observed output, and keep resolved, verified, and pushed as separate states.
Required inputs:
- the branch or branches involved and their upstreams
- what is already pushed, and who else may have fetched it
- the conflict, the regression, or the history problem as observed
- for a bisect: a known good commit, a known bad commit, and the command that tells them apart
- the repository's merge policy: merge com
よくある質問
履歴の書き換えで作業内容を失いませんか?
書き換えの前にバックアップ用のブランチを設定し、プッシュ済みの内容も確認します。
強制プッシュしますか?
より安全な--force-with-lease形式を使う場合に限り、プッシュ済みの状態を確認した後に行います。
コードの不具合をレビューしてくれますか?
いいえ。不具合のレビューは、別のコードレビュー用のスキルで行います。
詳細
作者による元の説明
[omh] Git branch in trouble -- a merge conflict, a commit that broke something, history to repair: plan the resolution, the bisect, or the rewrite, name what is already pushed first, and force-push only with `--force-with-lease`. Use when the user says: git-workflow, git workflow, merge conflict, merge conflicts, rebase conflict, resolve the conflict, resolve this conflict, conflict markers.
repo: rlaope/oh-my-hermes
人気
- GitHubのスター
- 5.1k
- ランキング
- #15112
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
omh-accessibility-audit
5.1kエージェントが、画面やフローのアクセシビリティ上の不足(キーボードでの操作、スクリーンリーダーのラベル、コントラスト、タッチの対象の大きさなど)を確認できるよう支援します。
omh-adversarial-consensus
5.1kエージェントが、技術的な提案を、いくつかの独立した視点から攻撃して、それに踏み切る前に検証し、生き残った点を要約できるよう支援します。
omh-agent-debug
5.1kエージェントが、ほかのAIエージェントがなぜ止まっているか、ループしているか、方向を外れているかを突き止め、最も小さく安全な回復方法を提案できるよう支援します。
omh-agent-instructions
5.1kエージェントが、AIツールにプロジェクトでの作業方法を伝える指示ファイル(AGENTS.mdやCLAUDE.mdなど)を書いたり更新したりできるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。