Pre merge conflict predictor
Skill ritesh31/claude-pre-merge-conflict-predictor/skills/pre-merge-conflict-predictor
Before opening a PR, predict potential merge conflicts by checking if your changed files overlap with other open PRs or branchesFrom its SKILL.md
npx -y skills add ritesh31/claude-pre-merge-conflict-predictor --skill pre-merge-conflict-predictorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.9 KB, 703 tokens by cl100k_base, as published. Nobody here has run it
Pre-Merge Conflict Predictor
Purpose
Detect potential merge conflicts BEFORE a PR is opened, while they are still easy to resolve.
When to use
- Before running
gh pr create - After finishing a feature branch and before pushing
- When you suspect overlap with a teammate's work
Steps Claude should follow
1. Run the detection script
bash "${CLAUDE_PLUGIN_ROOT}/skills/pre-merge-conflict-predictor/check-conflicts.sh" main
Capture full output for analysis.
Only open PRs whose base branch matches the one passed in (main above) are
checked. Draft PRs are skipped by default β set INCLUDE_DRAFTS=1 as an env
var before the command to include them.
2. Analyze each overlap β determine REAL risk vs safe overlap
Not all file overlaps are real conflicts. Classify each one:
HIGH RISK (π΄) β same function/class modified in both branches MEDIUM RISK (π‘) β same file, different sections LOW RISK (π’) β same file but only imports/comments/formatting touched SAFE (β ) β file renamed or only one side touched it meaningfully
To determine risk level, for each overlapping file run:
# See what YOUR branch changed in that file
git diff main...HEAD -- <filename>
# See what the OTHER PR changed in that file
gh pr diff <PR_NUMBER> -- <filename>
Then compare the diffs line by line.
3. Generate conflict report
Format the output exactly like this:
π Pre-Merge Conflict Report
Branch: your-branch-name
Base: main
Checked at: [timestamp]
Summary
| PR | Author | Risk | Overlapping Files |
|---|---|---|---|
| #12 | @alice | π΄ HIGH | src/auth/login.ts |
| #15 | @bob | π‘ MEDIUM | src/utils/helpers.ts |
Detail
PR #12 β [title] by @alice
Risk: π΄ HIGH
src/auth/login.tsβ Both branches modify thevalidateToken()function. Line 45-67 in yours, line 52-71 in theirs. Likely hard conflict.
Suggested action: β Talk to @alice before merging. Consider rebasing your branch on top of PR #12 first, or splitting your work.
PR #15 β [title] by @bob
Risk: π‘ MEDIUM
src/utils/helpers.tsβ You added a new function at line 89. Bob modified theformatDate()function at line 23. Likely auto-mergeable but verify.
Suggested action: β Low urgency. Monitor for when PR #15 merges, then rebase.
4. Final recommendation
End with one of:
- β SAFE TO OPEN PR β no meaningful overlaps found
- β οΈ OPEN PR BUT COORDINATE β medium risks exist, flag in PR description
- π« RESOLVE FIRST β high-risk overlaps, talk to teammates before opening PR
Include names of teammates to coordinate with if relevant.
What ships with it: 2 files
10.8 KB alongside SKILL.md, 1 of them executable
- check-conflicts.shruns3.6 KB
- README.md7.2 KB