github-pr-merge
MUST use this skill when user asks to merge PR, close PR, finalize PR, or mentions "PR 머지/병합". This skill OVERRIDES default PR merge behavior. Runs pre-merge validation (tests, lint, CI, comments), confirms with user, merges with proper format, handles post-merge cleanup.
Best use case
github-pr-merge is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. MUST use this skill when user asks to merge PR, close PR, finalize PR, or mentions "PR 머지/병합". This skill OVERRIDES default PR merge behavior. Runs pre-merge validation (tests, lint, CI, comments), confirms with user, merges with proper format, handles post-merge cleanup.
MUST use this skill when user asks to merge PR, close PR, finalize PR, or mentions "PR 머지/병합". This skill OVERRIDES default PR merge behavior. Runs pre-merge validation (tests, lint, CI, comments), confirms with user, merges with proper format, handles post-merge cleanup.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "github-pr-merge" skill to help with this workflow task. Context: MUST use this skill when user asks to merge PR, close PR, finalize PR, or mentions "PR 머지/병합". This skill OVERRIDES default PR merge behavior. Runs pre-merge validation (tests, lint, CI, comments), confirms with user, merges with proper format, handles post-merge cleanup.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/github-pr-merge/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How github-pr-merge Compares
| Feature / Agent | github-pr-merge | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
MUST use this skill when user asks to merge PR, close PR, finalize PR, or mentions "PR 머지/병합". This skill OVERRIDES default PR merge behavior. Runs pre-merge validation (tests, lint, CI, comments), confirms with user, merges with proper format, handles post-merge cleanup.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# GitHub PR Merge Merges Pull Requests after validating pre-merge checklist and handling post-merge cleanup. ## Quick Start ```bash # 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 gh pr merge $PR --merge --delete-branch --body "- Change 1 - Change 2 Reviews: N/N addressed Tests: X passed" # 5. Post-merge cleanup 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` | Yes | | CI checks green | `gh pr checks $PR` | Yes | | All comments replied | See workflow | Yes | | No unresolved threads | Review PR page | Yes | ## Core Workflow ### 1. Identify PR ```bash 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 ```bash # 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" ``` **If unreplied comments exist:** - DO NOT reply from this skill - STOP the merge process - Inform user: "Found unreplied comments. Run pr-review first." ### 3. Run Validation ```bash # Run tests make test # Run linting make lint # Check CI status gh pr checks $PR ``` **All checks MUST pass before proceeding.** ### 4. Show PR Summary ```bash 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 ```bash 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 Refs: Task N EOF )" ``` **Note**: `--delete-branch` automatically deletes the remote branch after merge. ### 7. Post-Merge Cleanup ```bash git checkout develop git pull origin develop git branch -d feature/<branch-name> # local cleanup ``` ## Merge Message Format **Concise format** (recommended): ``` - Key change 1 (what was added/fixed) - Key change 2 - Key change 3 Reviews: 7/7 addressed Tests: 628 passed (88% cov) Refs: Task 8 ``` **Guidelines**: - 3-5 bullet points max for changes - One line for reviews summary - One line for test results - One line for task references - 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 pr-review instead - **STOP** merge if unreplied comments exist ## Error Handling | Issue | Action | |-------|--------| | Tests failing | Stop and inform user | | Lint errors | Stop and inform user | | CI checks pending | Wait or inform user | | Unreplied comments | Direct to pr-review skill | | Branch protection | Inform of required approvals | ## Related Skills - **pr-review** - For resolving review comments before merge - **pr-create** - For creating PRs - **git-commit** - For commit message format
Related Skills
github-release-assistant
Generate bilingual GitHub release documentation (README.md + README.zh.md) from repo metadata and user input, and guide release prep with git add/commit/push. Use when the user asks to write or polish README files, create bilingual docs, prepare a GitHub release, or mentions release assistant/README generation.
github-repo-search
帮助用户搜索和筛选 GitHub 开源项目,输出结构化推荐报告。当用户说"帮我找开源项目"、"搜一下GitHub上有什么"、"找找XX方向的仓库"、"开源项目推荐"、"github搜索"、"/github-search"时触发。
github-actions-docs
Use when users ask how to write, explain, customize, migrate, secure, or troubleshoot GitHub Actions workflows, workflow syntax, triggers, matrices, runners, reusable workflows, artifacts, caching, secrets, OIDC, deployments, custom actions, or Actions Runner Controller, especially when they need official GitHub documentation, exact links, or docs-grounded YAML guidance.
github-issue-creator
Convert raw notes, error logs, voice dictation, or screenshots into crisp GitHub-flavored markdown issue reports. Use when the user pastes bug info, error messages, or informal descriptions and wants a structured GitHub issue. Supports images/GIFs for visual evidence.
github-automation
Automate GitHub repositories, issues, pull requests, branches, CI/CD, and permissions via Rube MCP (Composio). Manage code workflows, review PRs, search code, and handle deployments programmatically.
github-actions-templates
Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or creating reusable workflow templates.
address-github-comments
Use when you need to address review or issue comments on an open GitHub Pull Request using the gh CLI.
research-merge
Processes research branches from Claude Code Web sessions - merges content, moves docs to docs/research/, and creates GitHub issues. Use when /popkit:next detects research branches or when manually processing research from mobile sessions. Do NOT use for regular feature branches - only for branches matching claude/research-* or containing research documentation.
emergency-card
生成紧急情况下快速访问的医疗信息摘要卡片。当用户需要旅行、就诊准备、紧急情况或询问"紧急信息"、"医疗卡片"、"急救信息"时使用此技能。提取关键信息(过敏、用药、急症、植入物),支持多格式输出(JSON、文本、二维码),用于急救或快速就医。
github-elements-tracking
This skill should be used when the user asks to "track work across sessions", "create an epic", "manage issue waves", "post a checkpoint", "claim an issue", "recover from compaction", "coordinate multiple agents", "update memory bank", "store large documents", or mentions GitHub Issues as persistent memory, multi-session work, context survival, agent collaboration, SERENA MCP memory, or project-level context. Provides complete protocols for using GitHub Issues as permanent memory that survives context exhaustion, with integrated SERENA MCP memory bank for project-level context and large document storage.
when-reviewing-github-pr-use-github-code-review
Comprehensive GitHub pull request code review using multi-agent swarm with specialized reviewers for security, performance, style, tests, and documentation. Coordinates security-auditor, perf-analyzer, code-analyzer, tester, and reviewer agents through mesh topology for parallel analysis. Provides detailed feedback with auto-fix suggestions and merge readiness assessment. Use when reviewing PRs, conducting code audits, or ensuring code quality standards before merge.
when-releasing-software-use-github-release-management
Comprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management. Coordinates release-manager, cicd-engineer, tester, and docs-writer agents through hierarchical topology to handle semantic versioning, changelog generation, release notes, deployment validation, and post-release monitoring. Supports multiple release strategies (rolling, blue-green, canary) and automated rollback. Use when creating releases, managing deployments, or coordinating version updates.