From miranda
Resolves merge conflicts on GitHub PRs by merging base into head in an isolated worktree, understanding both sides' intents, verifying with typechecks/tests, and pushing.
How this skill is triggered — by the user, by Claude, or both
Slash command
/miranda:oh-conflictThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Resolve merge conflicts on a pull request. Work in an isolated worktree, merge the base branch into the PR head, resolve conflicts with understanding of both sides' intent, verify, and push.
Resolve merge conflicts on a pull request. Work in an isolated worktree, merge the base branch into the PR head, resolve conflicts with understanding of both sides' intent, verify, and push.
/oh-conflict <pr-number>
<pr-number> - the pull request number with merge conflictsissue/<number>)Read dive context (if available) for project background:
cat .wm/dive_context.md 2>/dev/null || echo "No dive context"
Get PR branch info:
# Save original directory for cleanup
ORIGINAL_DIR=$(pwd)
# Get head and base branch names
PR_INFO=$(gh pr view <pr-number> --json headRefName,baseRefName)
BRANCH=$(echo "$PR_INFO" | jq -r .headRefName)
BASE=$(echo "$PR_INFO" | jq -r .baseRefName)
Create worktree and set up:
git fetch origin
git worktree add .worktrees/conflict-<pr-number> -B $BRANCH origin/$BRANCH
cd .worktrees/conflict-<pr-number>
sg init
Understand the PR's intent before merging:
# Read the linked issue to understand what this PR is trying to do
PARENT_ISSUE=${BRANCH#issue/}
gh issue view $PARENT_ISSUE
# See the PR's own changes (what this branch introduced)
git log --oneline origin/$BASE..$BRANCH
git diff origin/$BASE...$BRANCH --stat
Attempt the merge:
git merge origin/$BASE --no-edit
This will fail with conflict markers in affected files.
Resolve conflicts file by file:
git diff --name-only --diff-filter=U # List conflicted files
git add <file>After all conflicts resolved, verify:
# Ensure no remaining conflict markers
grep -rn '<<<<<<< ' --include='*.ts' --include='*.js' --include='*.rs' . || echo "No conflict markers"
# Run project checks
# For TypeScript projects:
pnpm typecheck 2>&1 || true
pnpm test 2>&1 || true
# For Rust projects:
cargo check 2>&1 || true
cargo test 2>&1 || true
Adapt commands to the project's build system.
If verification fails (e.g., type errors from merged code):
sg review on staged changesComplete the merge commit:
git commit --no-edit # Uses the auto-generated merge commit message
Push:
git push
Cleanup worktree:
cd $ORIGINAL_DIR
git worktree remove .worktrees/conflict-<pr-number>
Exit and report:
# Accept theirs for lockfiles
git checkout --theirs pnpm-lock.yaml
pnpm install
git add pnpm-lock.yaml
If sg review finds non-trivial issues during resolution:
PARENT_ISSUE=${BRANCH#issue/}
NEW_ISSUE=$(gh issue create \
--title "Fix: <brief description>" \
--body "Spawned from #${PARENT_ISSUE} during conflict resolution on PR #<pr-number>.
## Context
<what was found>
## Acceptance
- [ ] Fix applied
- [ ] Tests pass" \
--assignee @me | grep -oE '[0-9]+$')
Complete ALL descendant issues before the final push.
CRITICAL: You MUST signal completion when done. Call the signal_completion tool as your FINAL action.
Signal based on outcome:
| Outcome | Call |
|---|---|
| Conflicts resolved, pushed | signal_completion(status: "success", pr: "<pr-url>") |
| Needs human decision | signal_completion(status: "blocked", blocker: "<reason>") |
| Unrecoverable failure | signal_completion(status: "error", error: "<reason>") |
| If you do not signal, the orchestrator will not know you are done and the session becomes orphaned. |
Fallback: If the signal_completion tool is not available, output your completion status as your final message in the format: COMPLETION: status=<status> pr=<url> or COMPLETION: status=<status> error=<reason>.
npx claudepluginhub open-horizon-labs/mirandaResolves Git merge conflicts in pull requests by merging JSON/YAML configs (e.g., higher versions) and Markdown. Use for PR-base conflicts, rebasing issues, or failed automated merges.
Automates GitHub PR fast-closure for OSS maintainers: synthesizes PR threads into action items, resolves conflicts semantically prioritizing contributor intent, implements fixes as attributed commits, pushes to fork.
Resolves in-progress git merge or rebase conflicts by understanding intent, preserving both sides where possible, and running automated checks.