/git-hex:git-hex-pr-workflowfrom git-hex
Trigger whenever the user's message contains "PR", "pull request", or "review feedback" — regardless of what else they ask for. This includes: "open a PR", "create a PR", "prepare for PR", "update my PR", "clean up and open a pull request", "address review comments", "reviewer wants", "PR #number". Even if the request also involves squashing, rebasing, or fixing commits, trigger this skill as long as a PR or review is part of the goal. Do NOT trigger for local-only git work (squash, amend, cherry-pick, rebase, conflict resolution) where no pull request or code review is mentioned. Do NOT trigger for branch protection rules or repo settings.
Ships in git-hex. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill when the user wants to go from a messy feature branch to a clean, submitted (or updated) pull request. This skill combines git-hex for local commit shaping with GitHub tools or CLI for remote collaboration.
git-hex-getRebasePlan with onto set to the target branch (usually
main or origin/main) to see all commits that will be in the PR.git-hex-checkRebaseConflicts with the same onto to predict whether
rebasing will be smooth. If conflicts are predicted, warn the user before
proceeding — they may want to resolve upstream changes first.Use the git-hex-branch-cleanup skill techniques to craft a clean, logical commit sequence. Common PR prep patterns:
rebaseWithPlan with fixup actions to collapse
work-in-progress into meaningful commits.splitCommit to break a large commit into focused,
reviewable pieces (e.g., separate refactoring from feature work).rebaseWithPlan with reword actions to write
commit messages that tell the PR's story.rebaseWithPlan with onto: "origin/main"
and an empty plan to fast-forward the base.Push: git push --force-with-lease (safe force push — refuses if
the remote has commits you haven't seen).
git push -u origin <branch>.Create or update the PR:
gh pr create (or the GitHub plugin if installed).getRebasePlan to build a summary. Each well-crafted commit message
becomes a bullet point or section in the PR body.gh pr create --title "Short title" --body "$(cat <<'EOF'
## Summary
- First logical change (from commit 1 message)
- Second logical change (from commit 2 message)
## Test plan
- [ ] Verify X
- [ ] Check Y
EOF
)"
When the user gets review comments and wants to update the PR:
git-hex-createFixup pointing at the
commit the review comment refers to. This keeps the fix associated with
the original change.git-hex-rebaseWithPlan with autosquash: true to
absorb the fixup commit.git push --force-with-lease.This produces a clean history where each commit is correct, rather than a trail of "fix review comment" commits.
When working with dependent branches:
git-hex-rebaseWithPlan with onto set to the rebased parent.git-hex-checkRebaseConflicts to preview whether the child rebase
will conflict.--force-with-lease.gh CLIgit-hex handles the local craft — shaping commits into a clean, reviewable story. GitHub tools handle the remote collaboration — creating PRs, adding reviewers, responding to comments. Together they cover the full PR lifecycle.
git fetch origin first,
then use origin/main as the onto target.--force-with-lease not --force: The lease check prevents overwriting
teammates' pushes.createFixup requires staged
changes — remind the user to git add the fix first.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
3 skills in this plugin
/git-hex-branch-cleanupRewrite git branch history. Invoke for any commit manipulation: squash, reword, reorder, drop, split, fold fixups, amend, or rebase onto main. Handles "clean up my commits", "squash before PR", "fix commit message typo", "make branch reviewable", "fold in fixup commits", "drop a commit", "rebase my branch". Operates on existing commits using git-hex MCP tools — no interactive rebase needed. NOT for: merge conflicts, cherry-picks across branches, conflict checking, git concepts, or hooks setup.
/git-hex-conflict-resolutionUse whenever a git operation is mid-flight and needs help finishing. Triggers: "continue the rebase", "abort the rebase", "conflicts in files", "rebase stopped/stuck/paused", "cherry-pick conflict", "revert has conflicts", "merge conflict", git status showing unmerged paths, or any git-hex tool returning paused/conflict/conflictingFiles status. Helps resolve conflicting files one by one, then continue or abort the operation. Applies to rebase, merge, cherry-pick, and revert — but only when already in progress. NOT for starting new rebases, creating PRs, squashing, fixup commits, undoing completed operations, or git-hex setup.
npx claudepluginhub yaniv-golan/git-hex --plugin git-hex