ad-merge
SkillProductivityad-merge lets your AI evaluate a GitHub pull request and merge it when it is safe to do so. It checks the test results, reviews the changes, and looks at open comments before deciding. Required checks must pass for a merge to happen, while softer concerns are reported to you for a final decision.
Available today. Use it from your connected AI after setup.
No other account needed.
After adding the skill, point your AI at a pull request and ask it to evaluate or merge it. It will report what it finds and only merge once the required checks are green.
Then ask your AI: use the ad-merge skill
What your AI can do with it
- Confirm whether a pull request is ready to merge
- Verify that required checks pass as a strict condition before merging
- Review the code changes with a fresh perspective and raise concerns
- Surface unresolved comments and check the linked task
- Tell you when a pull request cannot be merged yet
- Merge the pull request using the merge style that fits automatically
What this skill tells your AI
The instructions your AI receives, as published by alexandremendoncaalvaro/corridorkey-runtime in .agents/skills/ad-merge/SKILL.md and read by ahel’s review.
<background_information>
Implements ADR-0025. Evaluates a PR's mergeability and performs the merge via gh pr merge. CI green is the only hard gate; everything else surfaces as a warning the senior engineer decides on.
Codex auto-trigger on description keywords is less mature than Claude Code's. If auto-invocation does not fire when the user mentions merging a PR or evaluating mergeability, invoke this skill manually. </background_information>
Route elsewhere when:
- No PR exists yet →
ad-prfirst. - Commits are not on the branch yet →
ad-commitfirst.
Phase 1 — preflight. Check gh is installed and authenticated:
gh --version
gh auth status
If absent or not authed, surface the install / gh auth login hint and stop (same soft-fail rule as ad-pr).
Resolve the target PR:
- If the user passed a PR number / URL, use it.
- Else
gh pr view --json number,headRefName,baseRefNameagainst the current branch. If that fails, surface: "No PR found for branch<name>. Open one withad-prfirst."
Phase 2 — evaluate. Run the structured check and report each line:
gh pr checks <num>
gh pr view <num> --json mergeable,mergeStateStatus,reviews,number,title,headRefName,baseRefName
gh api repos/:owner/:repo/pulls/<num>/comments
Findings format (pass / warn / fail):
CI status: <pass | pending | fail>
Fresh-context review: <pass | warn — none found>
Linked task / ADR: <pass | warn — none>
Unresolved comments: <pass | warn — N unresolved>
Mergeability: <pass | dirty | blocked | behind>
Fresh-context review check — scan for either a file under .agentic/reviews/* whose name references the PR's commit range or number, or a gh pr view --json reviews entry with state: APPROVED.
Linked task / ADR — scan commit message bodies under <base>..HEAD and the PR body for task-NNNN, ADR-NNNN, spec-NNNN, #<issue>, Closes, Fixes.
Unresolved comments — count entries from gh api that lack a resolved flag or carry an in-progress thread state.
Phase 3 — decision. Apply the bar:
- CI failing → hard stop. Refuse to merge until CI is green, unless the user explicitly overrides ("merge anyway"). On override, log a loud warning that this is a deliberate CI-failing merge and the responsibility is the user's. Per ADR-0025 §3, even the hard gate yields to explicit user authorization, but the override is surfaced visibly.
- CI pending → ask the user: wait for CI, or proceed anyway? Default = wait.
- CI green + warnings (no fresh-context review / no linked task / unresolved comments) → surface each warning, ask the user to confirm the merge, proceed on confirm.
- All green → proceed.
State the decision back to the user before Phase 4 so they can interject.
Phase 4 — merge. Detect repo's allowed merge modes:
gh repo view --json mergeCommitAllowed,squashMergeAllowed,rebaseMergeAllowed
Decision tree:
- Exactly one mode allowed → use it.
- Multiple modes allowed → ask the user: "Repo allows squash / rebase / merge-commit. Pick one." Wait for their choice.
- None allowed (rare) → surface the policy error and stop.
Run the merge:
gh pr merge <num> --squash --delete-branch
(replace --squash with --rebase or --merge per the chosen mode).
--delete-branch by default for feature branches (feat/*, fix/*, chore/*, docs/*, refactor/*). Skip --delete-branch if the source branch is a long-lived integration branch (e.g., cli, develop, release/*).
Capture and report the merge commit URL.
<output_contract> The output is a merged PR. The skill returns:
- The merge commit URL.
- A one-line summary (
<count> commits merged into <base> via <mode>). - The list of warnings the user proceeded past (if any), for the audit trail. </output_contract>
Next
- After merge: pull the latest base locally (
git checkout <base> && git pull). - If the merge surfaced a recurring drift:
ad-driftfor systemic gaps, or updateWORKFLOW.md§10 / §11. - If the merge closed a task: confirm the task file's Status is
doneand the Notes log captures the merge commit URL. - If the merge shipped a binding decision worth recording:
ad-adr(three-criteria rule).
Signals
- GitHub stars
- 747
- Forks
- 20
- Last commit
- Aug 2026
Others that do the same job
Advanced
- Catalog kind
- skill
- Gateway key
ad-merge- Source
- github.com/alexandremendoncaalvaro/corridorkey-runtime