home / skills / openclaw / skills / merge-check
This skill analyzes a GitHub PR to predict mergeability and guide improvements across technical, process, and social factors.
npx playbooks add skill openclaw/skills --skill merge-checkReview the files below or copy the command above to add this skill to your agents.
---
name: merge-check
description: Analyze a GitHub pull request for mergeability â predict whether it will get merged based on technical, architectural, process, social, and compliance factors. Use when asked to review a PR, check if a PR will be merged, assess PR quality, or predict PR acceptance. Works with any GitHub PR via `owner/repo#number` or URL.
---
# Merge Check
Predicts whether a GitHub PR will get merged by analyzing it against a comprehensive rejection vector taxonomy. Not a generic code quality tool â this answers: **"Will this PR get merged by the maintainer?"**
## Quick Start
1. Run the data gathering script:
```bash
bash skills/merge-check/scripts/merge-check.sh owner/repo#123
# or
bash skills/merge-check/scripts/merge-check.sh https://github.com/owner/repo/pull/123
```
2. Parse the JSON output
3. Analyze against the dimensions below
4. Produce the mergeability report
## Analysis Dimensions
After gathering data, analyze across ALL of these dimensions. Load `skills/merge-check/references/rejection-taxonomy.md` for the detailed rejection vector framework.
### 1. Technical Signals (Automated Gates)
- **CI status**: Are all checks passing? Any failed or pending?
- **Build status**: Does it compile/build?
- **Coverage**: Any coverage regression indicated?
### 2. PR Hygiene
- **Size** (most predictive single factor):
- đĸ <400 LOC changed â ideal, easy to review
- đĄ 400â1000 LOC â risky, reviewer fatigue
- đ´ >1000 LOC â danger zone, likely to stall or get rejected
- **File spread**: Concentrated in one area or scattered across directories?
- **Single concern**: Does it do one thing, or is it a kitchen-sink PR?
- **Title & description**: Clear, descriptive? Or vague/empty?
- **Linked issue**: Does it reference an issue? (Signals intentionality)
- **Commit hygiene**: Clean messages? Reasonable count? Squash-ready?
### 3. Architectural Fit
- **Pattern consistency**: Does it follow repo conventions? (language, directory structure, naming)
- **Dependencies**: New dependencies introduced? (High friction signal)
- **Scope creep**: Does it touch things outside its stated purpose?
- **File types**: Consistent with repo's tech stack?
### 4. Review Status
- **Approvals**: Any already? How many required?
- **Changes requested**: Outstanding and unaddressed? (Strong rejection signal)
- **Reviewer assignment**: Are required reviewers assigned?
- **Review comment sentiment**: Positive, neutral, or adversarial?
- **CODEOWNERS**: Does the PR touch files with code owners? Are they reviewing?
### 5. Process Compliance
- **Draft status**: Draft PRs won't merge
- **Blocking labels**: WIP, do-not-merge, needs-work, etc.
- **PR template**: Was it followed? (Empty template = red flag)
- **CLA/DCO**: If repo requires it, is it signed?
### 6. Social/Meta Signals
- **Author merge history**: What % of this author's recent PRs were merged in this repo?
- **Staleness**: How long has it been open? (>2 weeks = concern, >30 days = likely abandoned)
- **Activity level**: Recent comments/updates, or radio silence?
- **First-time contributor**: Higher rejection rate for newcomers
## Output Format
Produce a structured report:
### Mergeability Score
- đĸ **High** (>80% likely to merge) â No blockers, reviews positive, CI green
- đĄ **Medium** (40â80%) â Some concerns but addressable
- đ´ **Low** (<40%) â Significant blockers present
### Report Sections
1. **Mergeability Score**: đĸ/đĄ/đ´ with percentage estimate
2. **Risk Factors**: Bullet list of specific concerns, ordered by severity
3. **Strengths**: What's working in the PR's favor
4. **Recommendations**: Actionable steps to improve mergeability (if not already đĸ)
5. **Verdict**: One-sentence summary
### Example Output
```
## PR Mergeability Report: owner/repo#123
**Score: đĄ Medium (~55%)**
### Risk Factors
- â ī¸ 847 lines changed â approaching reviewer fatigue threshold
- â ī¸ Changes requested by @maintainer not yet addressed
- â ī¸ Touches 12 files across 6 directories â scattered scope
- âšī¸ No linked issue
### Strengths
- â
All 14 CI checks passing
- â
Clear title and detailed description
- â
Author has 73% merge rate in this repo (8/11 recent PRs)
- â
Active discussion â last update 2 hours ago
### Recommendations
1. Address @maintainer's review comments before requesting re-review
2. Consider splitting into smaller PRs (config changes vs logic changes)
3. Link the relevant issue for traceability
### Verdict
Solid PR with passing CI and an active author, but stalled on unaddressed review feedback â resolving those comments is the critical path to merge.
```
## Script Reference
The script (`scripts/merge-check.sh`) gathers all data via `gh` CLI and outputs a single JSON object with these keys:
| Key | Contents |
|-----|----------|
| `pr` | Full PR metadata (title, body, author, state, draft, labels, reviewers) |
| `files` | List of changed files with patch stats |
| `diff_stats` | Total additions, deletions, changed files count |
| `checks` | CI/check run results for the head commit |
| `reviews` | All reviews (approved, changes_requested, commented) |
| `review_comments` | Inline review comments |
| `issue_comments` | PR conversation comments |
| `commits` | Commit list with messages |
| `repo` | Repository metadata (language, size, defaults) |
| `author_history` | Author's recent closed PRs and merge rate |
| `has_codeowners` | Boolean |
| `has_contributing` | Boolean |
## Error Handling
The script outputs `"error"` fields when individual API calls fail (e.g., rate limits, 404s). Analyze what's available and note any missing data in the report.
This skill predicts whether a GitHub pull request will be merged by analyzing technical, process, social, and architectural signals. It inspects a PR given as owner/repo#number or URL and produces a scored, actionable mergeability report. Use it to prioritize reviews, coach contributors, or triage incoming PRs.
The skill gathers PR metadata, file diffs, CI/check run results, commit history, reviews, comments, and repository signals via the GitHub API output JSON. It evaluates the PR against a rejection-vector taxonomy across technical gates, PR hygiene, architectural fit, review status, process compliance, and social signals, then produces a mergeability score, risk factors, strengths, and recommendations. Missing or errored API data is noted and factored into confidence.
What inputs does the tool require?
A GitHub pull request reference (owner/repo#number or full PR URL). The script collects PR metadata, files, checks, reviews, commits, and repo signals via the GitHub API.
How reliable is the mergeability score?
The score is a probabilistic estimate based on many signals. It is most reliable when all data (CI checks, reviews, author history) is available; API errors reduce confidence and should be called out in the report.
Can it detect architectural fit or only surface-level issues?
It flags architectural fit signals (conventions, added dependencies, scope creep) using repo metadata and file patterns, but nuanced design judgments still require a human reviewer.