From ai-dev-extensions
Use when performing any git merge operation (direct merge, PR merge, or MR merge) - requires explicit user confirmation before executing the merge command
How this skill is triggered — by the user, by Claude, or both
Slash command
/ai-dev-extensions:git-mergeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Every git merge — whether a direct `git merge`, a GitHub PR merge via `gh pr merge`, or a GitLab MR merge — MUST be preceded by explicit user confirmation. Merges are hard to reverse cleanly and can affect shared branches. This skill ensures the user always makes the final call.
Every git merge — whether a direct git merge, a GitHub PR merge via gh pr merge, or a GitLab MR merge — MUST be preceded by explicit user confirmation. Merges are hard to reverse cleanly and can affect shared branches. This skill ensures the user always makes the final call.
git merge directly (any branch into any branch)gh pr merge or the GitHub APIglab mr merge or the GitLab APIgit log --merges, gh pr status)Note: Even if the user says "just merge it" or "merge without asking", always present the merge summary first. The user must explicitly confirm after seeing the summary. This is the core safety guarantee of the skill.
Before anything else, confirm you are on the correct target branch:
git branch --show-current
If the current branch is not the intended target, switch to it — but confirm with the user if the target is a protected branch (main, master, develop). Ensure the working tree is clean (git status) before proceeding, since the dry-run in §2 modifies the index.
Once on the correct target branch, present a summary and ask the user to confirm.
Required summary contents:
| Field | Description |
|---|---|
| Source | The branch or ref being merged in |
| Target | The branch receiving the merge |
| Strategy | Merge commit, squash, or fast-forward |
| Commits | Number of commits being merged |
| Conflicts | Whether conflicts are expected (run a dry-run first) |
# Dry-run to detect conflicts (requires clean working tree)
git merge --no-commit --no-ff <source-branch> 2>&1
git merge --abort 2>/dev/null
Present the summary, then ask a direct yes/no question. Do not proceed until the user explicitly confirms.
Merge summary:
Source: feat/oauth2-login
Target: main
Strategy: merge commit
Commits: 4
Conflicts: none detected
Proceed with merge? (yes/no)
If the user declines, stop. Do not retry, rephrase, or suggest alternatives unless the user asks for them.
When merging via gh pr merge or glab mr merge, the same confirmation is required:
PR merge summary:
PR: #42 — feat: add OAuth2 login flow
Target: main
Strategy: squash
CI status: all checks passed
Approved: 2/2 reviewers
Proceed with merge? (yes/no)
After a successful merge, report the result:
# Show the merge commit
git log --oneline -1
# Confirm current branch state
git branch --show-current
# BAD — merging without asking
git merge feat/new-api
# BAD — PR merge without confirmation
gh pr merge 42 --squash
# GOOD — verify branch, dry-run, summarize, confirm, then merge
git branch --show-current # confirm target branch
git status # confirm clean working tree
git merge --no-commit --no-ff feat/new-api
git merge --abort
# ... present summary and ask user ...
# user confirms
git merge feat/new-api
# GOOD — PR merge with confirmation
# ... present PR summary and ask user ...
# user confirms
gh pr merge 42 --squash
git merge or gh pr merge without having asked the user → stop and ask firstmain, master) without confirming the target → verify the branch firstnpx claudepluginhub using-system/ai-dev-extensions --plugin ai-dev-extensionsGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.