github-pr-merge
Skill35 starsChanged 8 months agoMITView on GitHub
Merges GitHub Pull Requests after validating pre-merge checklist. Use when user wants to merge PR, close PR, finalize PR, complete merge, approve and merge, or execute merge. Runs pre-merge validation (tests, lint, CI, comments), confirms with user, merges with proper format, handles post-merge cleanup.
- Commits and pushes
In this repository56 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
- agent-protocolSkill
- context-health-checkSkill
- layered-contextSkill
- muse-commandsSkill
- semantic-searchSkill
- strategic-compactSkill
- using-superpowersSkill
- verification-before-completionSkill
- growth-distributionSkill
- api-design-principlesSkill
- architect-agentSkill
- brainstormingSkill
- build-error-resolverSkill
- changelog-generatorSkill
- code-documentationSkill
- code-refactoringSkill
- code-reviewer-agentSkill
- coding-standardsSkill
- context7-mcpSkill
- coordinator-modeSkill
- creating-skillsSkill
- deep-diveSkill
- dispatching-parallel-agentsSkill
- doc-coauthoringSkill
- doc-updaterSkill
- e2e-runnerSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- frontend-designSkill
- git-commitSkill
- github-pr-creationSkill
- github-pr-reviewSkill
- git-security-guardSkill
- iterative-retrievalSkill
- markitdownSkill
- planner-agentSkill
- ralph-wiggumSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- sciomcSkill
- security-reviewSkill
- skill-creatorSkill
- skills-updaterSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- tdd-workflowSkill
- theme-factorySkill
- traceSkill
- ui-ux-pro-maxSkill
- using-git-worktreesSkill
- webapp-testingSkill
- writing-plansSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 78
All original comments should have at least one reply.
- Distinctive: line 81
DO NOT reply from this skill
- Distinctive: line 82
STOP the merge process
- Very specific: line 140
Merge strategy: Always use --merge (merge commit), never squash or rebase per project guidelines.
- Very specific: line 152
Note: If you didn't use --delete-branch, manually delete:
- Distinctive: line 177
No headers (##), no verbose sections
- Distinctive: line 182
ALWAYS: run full pre-merge checklist before merging
- Distinctive: line 183
ALWAYS: verify all review comments have replies
- Distinctive: line 185
ALWAYS: use merge commit (--merge), never squash/rebase
- Distinctive: line 186
ALWAYS: delete feature branch after successful merge
- Distinctive: line 195
Tests failing: Stop and inform user. Do not merge.
- Distinctive: line 197
Lint errors: Stop and inform user. Do not merge.
- Distinctive: line 199
CI checks pending: Wait or inform user. Do not merge.
- Distinctive: line 204
Branch protection: If merge fails due to protection rules, inform user of required approvals.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub PR Merge
Merges Pull Requests after validating pre-merge checklist and handling post-merge cleanup.
Quick Start
# 1. Get PR info
PR=$(gh pr view --json number -q '.number')
REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
# 2. Run pre-merge checklist
make test && make lint && gh pr checks $PR
# 3. Verify all comments replied
gh api repos/$REPO/pulls/$PR/comments --jq '[.[] | select(.in_reply_to_id == null)] | length'
# 4. Merge with concise message (--delete-branch auto-deletes remote)
gh pr merge $PR --merge --delete-branch --body "- Change 1
- Change 2
Reviews: N/N addressed
Tests: X passed (Y% cov)
Refs: Task N"
# 5. Post-merge cleanup (local only, remote already deleted)
git checkout develop && git pull && git branch -d feature/<name>Pre-Merge Checklist
ALWAYS verify before merging:
| Check | Command | Required |
| Tests passing | make test | Yes |
| Linting passing | make lint or make check | Yes |
| CI checks green | gh pr checks $PR | Yes |
| All comments replied | Verify only, don't reply | Yes |
| No unresolved threads | Review PR page | Yes |
Core Workflow
1. Identify PR
PR=$(gh pr view --json number -q '.number')
REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
echo "PR #$PR in $REPO"2. Check Comments Status
# Count original comments (not replies)
ORIGINALS=$(gh api repos/$REPO/pulls/$PR/comments --jq '[.[] | select(.in_reply_to_id == null)] | length')
# Count comments that have at least one reply
REPLIED=$(gh api repos/$REPO/pulls/$PR/comments --jq '
[.[] | select(.in_reply_to_id)] | [.[].in_reply_to_id] | unique | length
')
echo "Original comments: $ORIGINALS, With replies: $REPLIED"
# Find unreplied comment IDs
UNREPLIED=$(gh api repos/$REPO/pulls/$PR/comments --jq '
[.[] | select(.in_reply_to_id) | .in_reply_to_id] as $replied_ids |
[.[] | select(.in_reply_to_id == null) | select(.id | IN($replied_ids[]) | not) | .id]
')
echo "Unreplied: $UNREPLIED"All original comments should have at least one reply.
If unreplied comments exist:
- DO NOT reply from this skill
- STOP the merge process
- Inform user: "Found unreplied comments: [IDs]. Run github-pr-review first."
- Show which comment IDs are missing replies
3. Run Validation
# Activate venv if Python project
source venv/bin/activate 2>/dev/null
# Run tests
make test
# Run linting
make lint # or: make check
# Check CI status
gh pr checks $PRAll checks MUST pass before proceeding.
4. Show PR Summary
gh pr view $PR --json title,body,commits,changedFiles --jq '
"Title: \(.title)\nCommits: \(.commits | length)\nFiles: \(.changedFiles)"
'5. Confirm with User
ALWAYS ask before merging:
Pre-merge checklist verified:
- Tests: passing
- Lint: passing
- CI: green
- Comments: all replied
Ready to merge PR #X. Proceed?6. Execute Merge
gh pr merge $PR --merge --delete-branch --body "$(cat <<'EOF'
- Key change 1
- Key change 2
- Key change 3
Reviews: N/N addressed
Tests: X passed (Y% cov)
Refs: Task N, Req M
EOF
)"Merge strategy: Always use --merge (merge commit), never squash or rebase per project guidelines.
Note: --delete-branch automatically deletes the remote branch after merge.
7. Post-Merge Cleanup
# Switch to develop and update (--delete-branch already deleted local+remote)
git checkout develop
git pull origin developNote: If you didn't use --delete-branch, manually delete:
git branch -d feature/<branch-name> # local
git push origin --delete feature/<branch-name> # remoteMerge Message Format
Concise format (recommended for clean git log):
- Key change 1 (what was added/fixed)
- Key change 2
- Key change 3
Reviews: 7/7 addressed (Gemini 5, Codex 2)
Tests: 628 passed (88% cov)
Refs: Task 8, Req 14-15Guidelines:
- 3-5 bullet points max for changes
- One line for reviews summary
- One line for test results
- One line for task/requirement references
- No headers (##), no verbose sections
- Total: ~10 lines max
Important Rules
- ALWAYS run full pre-merge checklist before merging
- ALWAYS verify all review comments have replies
- ALWAYS confirm with user before executing merge
- ALWAYS use merge commit (--merge), never squash/rebase
- ALWAYS delete feature branch after successful merge
- NEVER merge with failing tests or lint
- NEVER merge with unresolved CI checks
- NEVER skip user confirmation
- NEVER reply to PR comments from this skill - use github-pr-review instead
- STOP merge if unreplied comments exist and direct user to review skill
Error Handling
Tests failing: Stop and inform user. Do not merge.
Lint errors: Stop and inform user. Do not merge.
CI checks pending: Wait or inform user. Do not merge.
Unreplied comments: List unreplied comment IDs. DO NOT reply from this skill. Tell user: "Found N unreplied comments: [IDs]. Run github-pr-review to address them before merge."
Branch protection: If merge fails due to protection rules, inform user of required approvals.
Related Skills
- github-pr-review - For resolving review comments before merge
- github-pr-creation - For creating PRs (this skill handles the merge)
- git-commit - For commit message format during PR work
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

