/dev-kit:merge-in-head [base branch | PR number]from dev-kit
Merges the base branch (PR base or parent branch) into the current branch, resolves conflicts by preserving intent from both sides, runs project checks, and commits the merge.
Ships in dev-kit. 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.
Arguments: $ARGUMENTS
Brings the current branch up to date with its base, the branch it will be merged into, by a merge commit. It never rebases, force-pushes or edits the PR: the branch's published history stays as it is, so anyone who pulled it can keep working.
Every run ends with the result block (last section), even an early stop.
Run each git and gh command as its own call, without ;, &&, $(…) or loops: the skill's pre-approved commands match single commands, and a compound one waits for the user's permission.
Read git status (it reports a rebase in progress) and git rev-parse -q --verify MERGE_HEAD / CHERRY_PICK_HEAD (each exits non-zero when that operation is not in progress):
MERGE_HEAD; go straight to step 4 and resolve what is left.blocked, naming which. Those changes are the user's; never stash, commit or discard them. Untracked files (??) do not block, and stay out of every commit.<remote> below is the remote of the repository the branch merges into (git remote -v): with an open PR, the one whose URL names the owner/repo in the PR's url; otherwise upstream when it exists (a fork's parent), else origin, else the only remote. In a fork, origin/<base> is the fork's own, often stale copy.
Take the first source that answers, and record which one it was for the result block:
Argument: a branch name is the base; a PR number means that PR's baseRefName (gh pr view <n> --json baseRefName,headRefName; when its headRefName is not the current branch, stop blocked).
Open PR for the current branch: gh pr view --json number,state,baseRefName,url. Use baseRefName when state is OPEN. No gh, no login, no PR, or a closed one: go on.
git config --get branch.<current>.gh-merge-base: the base gh pr create will use for this branch, set by the user or by gh.
Git's own traces, when none of the above answers:
git reflog show --format=%gs refs/heads/<current> reads branch: Created from <ref> when the branch was cut from a named ref. It names nothing when <ref> is HEAD, a SHA, or the branch's own remote copy (refs/remotes/origin/<current>, a branch checked out from the remote), or when the entry is clone: from …; the reflog may also have expired.git merge-base --is-ancestor HEAD <ref>), the one with the fewest commits in git rev-list --count <ref>..HEAD. Then drop each sibling: a branch other than the default one whose merge-base with HEAD equals the default branch's merge-base with HEAD adds nothing the default branch does not explain, unless it is an integration branch (develop, dev, staging, release/*, or the base of another open PR). Other feature branches cut from the same commit of main are siblings, not bases. A tie among what is left names no single branch.git symbolic-ref --short refs/remotes/<remote>/HEAD.The base is settled when the reflog names a branch that is nearest or tied for nearest (a branch cut from develop while develop still equalled main ties the two), or when the reflog names nothing and nearest is the default branch alone (a branch cut from main whose reflog has expired); develop and origin/develop count as the same branch. Otherwise ask the user with AskUserQuestion, one option per candidate with its evidence in the description (reflog: Created from origin/develop, 3 commits ahead of origin/main), the most likely first. Guessing wrong merges unrelated work into the branch, which is costly to undo once pushed, so ask rather than pick.
Normalise the base to a ref you can merge: with a remote, git fetch <remote> <branch> and use <remote>/<branch> (the base's latest pushed state, not a stale local copy); without one, the local branch. The base being the current branch itself, or a branch missing on the remote, is status blocked.
When git merge-base --is-ancestor <base> HEAD holds, the branch already contains the base: status up-to-date, nothing to commit.
Otherwise run git merge --no-edit <base>. A clean merge commits itself; go to step 5, since a merge without conflicts can still break the code. On conflicts, go to step 4.
git status, git diff --name-only --diff-filter=U, git log --merge --oneline).git log --merge -p -- <file>), check the PRs (gh pr list --search <sha> --state merged), check original issues/tickets.git merge --abort only when the user asks for it. No conflict marker (<<<<<<<, =======, >>>>>>>) may remain in a resolved file.git add <file>…), never -A or a directory, leaving untracked working files out, and git commit --no-edit to keep git's merge message.After every merge, clean or resolved, discover the project's automated checks and run them, typically typecheck, then tests, then format. Fix anything the merge broke, including code that merged cleanly but no longer fits (a renamed function still called by its old name, a test of behaviour the base deliberately changed). Commit each fix separately, with a message saying what the merge broke, never by amending the merge, and stage by explicit path as above. A check that already fails on the branch or the base without the merge is not the merge's to fix; name it in checks. A check you could not run (permission refused, missing tool) is not run: <why>, never a pass.
Read the setting ${user_config.merge_auto_push}:
true: push at once.${user_config. (the setting was never saved; it lives nowhere else, so don't look for it in git config or files): ask with AskUserQuestion, options Push now and Leave it local, naming the branch and remote in the question.Push with git push <push-remote> <current>, adding -u when the branch has no upstream, where <push-remote> is origin when it exists (in a fork, the fork) and otherwise <remote>. Never a bare git push: it follows the branch's upstream, which for a branch cut from origin/develop is develop itself. A repository without a remote skips this step (pushed: no: no remote). A rejected push (the remote moved meanwhile) is reported, never forced.
End with this block, exactly these keys, each on one line:
merge-in-head result
status: merged | resolved | up-to-date | blocked
base: <ref> (<source: argument | pr #<n> | gh-merge-base | reflog | nearest | default | asked | in-progress merge>) | none: <why>
conflicts: <file: how it was resolved>; ... | none
checks: <command: pass | fail: why | not run: why>; ... | none found
commit: <short SHA> <subject>, ... (the merge first, then each fix) | none
pushed: yes | no: <why> | n/a
next: <what the user must do, or none>
merged is a clean merge, resolved a merge whose conflicts this run resolved.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/ci-fixFix a failed CI pipeline at its root cause, verify locally, and commit. Use when the user pastes a GitHub Actions run, job, PR or commit-checks URL, says CI, a pipeline or a build is red, or another skill hands over a failing check./dep-upgrade-checkDependency upgrade compatibility and security check. Gates the target version on known vulnerabilities, malware, and release age, finds everything that changes between the version a codebase resolves today and the target, maps each change to where the code uses it, and returns a safe / safe with changes / breaking verdict with file:line evidence. Use when the user names a package and a target version, links a Renovate or Dependabot pull request, or asks whether bumping a dependency will break the build./pr-openPush the current branch and open a pull request whose body fills the repository's PR template as a short reviewer-first description with a before/after table, honest testing and deploy steps. Use when the user asks to open, create or raise a PR, to push a branch for review, or to refresh an existing PR's description./pr-shepherdShepherd the current branch's pull request, or a stack of pull requests named by number, in a self-paced loop until CI is green and every review thread is resolved, fixing failures and review comments with commits and pushes, and answering the unjustified ones in-thread. Use when the user asks to babysit, watch or drive a PR to green, or to keep fixing CI and review comments until the PR is clean.npx claudepluginhub grixu/cc-toolkit --plugin dev-kitOther plugins' skills for the same job