Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
The command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
File Explorer
2 files
Showing SKILL.md
SKILL.md
Source instructions · Read-only preview
name
eia-github-pr-merge
description
Use when merging pull requests, checking merge status, or configuring auto-merge. Trigger with merge, auto-merge, or readiness verification requests.
license
Apache-2.0
compatibility
Requires AI Maestro installed.
metadata
{"version":"1.0.0","author":"Emasoft","category":"github-workflow","tags":"github, pull-request, merge, graphql, automation","triggers":"merge PR, check if merged, auto-merge, merge readiness, squash merge, rebase merge"}
agent
api-coordinator
context
fork
workflow-instruction
Step 21
procedure
proc-evaluate-pr
user-invocable
false
GitHub PR Merge Operations
Overview
This skill provides comprehensive guidance for merging pull requests, checking merge status, verifying merge readiness, and configuring auto-merge using the GitHub API.
Prerequisites
GitHub CLI (gh) installed and authenticated
Python 3.8+ for running automation scripts
Repository write access for merge operations
GraphQL API access (included with standard GitHub authentication)
Output
Output Type
Format
Description
Merge status
JSON
Contains merged (boolean), state (OPEN/CLOSED/MERGED)
Identify the operation needed (check merged status, verify readiness, execute merge, or configure auto-merge)
Consult the decision tree below to select the appropriate script
Run the selected script with required parameters (--pr, --repo, strategy/method as applicable)
Parse the JSON output to determine success or blocking conditions
If blocked, resolve the issue indicated by the exit code and JSON details
For merge operations, verify completion using eia_test_pr_merged.py
Checklist
Copy this checklist and track your progress:
Identify the operation needed (check/verify/merge/auto-merge)
Check if PR is already merged using eia_test_pr_merged.py
Verify merge readiness using
eia_test_pr_merge_ready.py
Resolve any blocking conditions (CI, conflicts, reviews, threads)
Execute merge with appropriate strategy (merge/squash/rebase)
Or enable auto-merge if waiting for CI/reviews
Verify merge completion using eia_test_pr_merged.py
Handle any errors based on exit codes
CRITICAL: GraphQL is the Source of Truth
NEVER trust gh pr view --json state for merge state verification.
The REST API and gh pr view can return stale data. GraphQL queries against the GitHub API provide the authoritative, real-time merge state. Always use GraphQL for:
Checking if a PR is already merged
Verifying merge eligibility (MergeStateStatus)
Confirming merge completion
Overview of Operations
Operation
Script
Purpose
Check if merged
eia_test_pr_merged.py
Verify PR merge status via GraphQL
Check readiness
eia_test_pr_merge_ready.py
Verify all merge requirements met
Execute merge
eia_merge_pr.py
Merge with specified strategy
Auto-merge
eia_set_auto_merge.py
Enable/disable auto-merge
Decision Tree for PR Merge Operations
START: Need to merge a PR
│
├─► Is PR already merged?
│ Run: eia_test_pr_merged.py --pr <number> --repo <owner/repo>
│ │
│ ├─► Exit 1 (merged) → STOP: PR already merged
│ │
│ └─► Exit 0 (not merged) → Continue
│
├─► Is PR ready to merge?
│ Run: eia_test_pr_merge_ready.py --pr <number> --repo <owner/repo>
│ │
│ ├─► Exit 0 (ready) → Proceed to merge
│ │
│ ├─► Exit 1 (CI failing) → Fix CI or use --ignore-ci
│ │
│ ├─► Exit 2 (conflicts) → Resolve conflicts first
│ │
│ ├─► Exit 3 (threads) → Resolve threads or use --ignore-threads
│ │
│ └─► Exit 4 (reviews) → Get required approvals
│
├─► Should merge now or auto-merge?
│ │
│ ├─► Merge now:
│ │ Run: eia_merge_pr.py --pr <number> --repo <owner/repo> \
│ │ --strategy <merge|squash|rebase> [--delete-branch]
│ │
│ └─► Auto-merge when ready:
│ Run: eia_set_auto_merge.py --pr <number> --repo <owner/repo> \
│ --enable --merge-method <MERGE|SQUASH|REBASE>
│
└─► Verify merge completed:
Run: eia_test_pr_merged.py --pr <number> --repo <owner/repo>
When to Use Each Script
eia_test_pr_merged.py
Use BEFORE attempting any merge operation to avoid:
Duplicate merge attempts
Confusing error messages
Wasted API calls
# Check if PR #123 in owner/repo is merged
python scripts/eia_test_pr_merged.py --pr 123 --repo owner/repo