Agent skill

Merge Conflicts

by bikeindex in bikeindex/bike_index

How to bring a branch up to date and resolve git merge conflicts the way this repo expects — merge (never rebase or force-push), understand each side's intent before choosing, ask when a resolution…

AGPL-3.0Auto-check: notesDevelopment

Install Merge Conflicts

skills CLI
$ npx skills add bikeindex/bike_index --skill merge-conflicts -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bikeindex/bike_index merge-conflicts --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bikeindex/bike_index.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/merge-conflicts .claude/skills/merge-conflicts && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
merge-conflicts
GitHub stars
308
Token cost
~3.2k tokens
SKILL.md length
1,801 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
AGPL-3.0

At a glance

How to bring a branch up to date and resolve git merge conflicts the way this repo expects — merge (never rebase or force-push), understand each side's intent before choosing, ask when a resolution…

  • Works in 4 steps: A branch the user names — "update from… → An open PR's base — gh pr view --json… → The upstream tracking ref, if it names a… → …
  • Ever youre about to run git merge/git pull
  • SKILL.md covers Determine the base branch…, Bring a branch up to date, Keep the merge commit to just… and Resolving conflicts, plus 5 more sections
  • Calls git, gh and rails

What it does

Merge Conflicts is an agent skill from bikeindex/bike_index. How to bring a branch up to date and resolve git merge conflicts the way this repo expects — merge (never rebase or force-push), understand each side's intent before choosing, ask when a resolution isn't clear-cut, keep the merge commit to just the merge, and audit what merged cleanly before committing. Trigger whenever you're about to run git merge/git pull, sync a branch with main, "update from main", or resolve conflict markers left by a merge, cherry-pick, or interrupted pull — including bare phrasings like…

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git workflow. It works with Git. The repository describes itself as: All the code for Bike Index, because we love you. The licence is AGPL-3.0.

When your agent uses it

  • Ever youre about to run git merge/git pull
  • Sync a branch with main
  • Update from main
  • Resolve conflict markers left by a merge

Example prompts

  • “s intent before choosing, ask when a resolution isn”
  • “re about to run git merge/git pull, sync a branch with main,”
  • “fix the conflicts”
  • “/merge-conflicts”

Requirements

  • Pre-approved tools (allowed-tools): Bash, Read, Edit, Write, Glob, Grep

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. A branch the user names — "update from X" / "base is X" wins outright.
  2. An open PR's base — gh pr view --json baseRefName. Also check the base of any feature branch you recently merged into this one (gh pr view…
  3. The upstream tracking ref, if it names a branch other than this one's own remote mirror (git rev-parse --abbrev-ref @{u}).
  4. The Conductor workspace target branch (from the workspace/system instructions) — a default hint, not the last word.

What it can do on your machine

Read from SKILL.md and the folder at commit 62d654e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Edit
    • Write
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh
    • rails
    • bundle

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Merge Conflicts loads about 3.2k tokens when it runs. Until then it costs about 181 tokens; SKILL.md has 1,801 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~181
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Edit, Write, Glob, Grep

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from bikeindex/bike_index at commit 62d654e, republished under its AGPL-3.0 licence (© bikeindex). 1,801 words, ~3,182 tokens.

Download SKILL.mdSave it as .claude/skills/merge-conflicts/SKILL.md (or your agent's skills folder).
name
merge-conflicts
description
How to bring a branch up to date and resolve git merge conflicts the way this repo expects — merge (never rebase or force-push), understand each side's intent before choosing, ask when a resolution isn't clear-cut, keep the merge commit to just the merge, and audit what merged *cleanly* before committing. Trigger whenever you're about to run `git merge`/`git pull`, sync a branch with `main`, "update from main", or resolve conflict markers left by a merge, cherry-pick, or interrupted pull — including bare phrasings like "fix the conflicts", "merge main in", or "this branch is behind". Not for merging data/files (PDFs, CSVs) or algorithms (merge sort) — this is strictly about git branch integration.
allowed-tools
Bash, Read, Edit, Write, Glob, Grep

Resolving merge conflicts

Determine the base branch first — don't assume main

Re-read git branch --show-current rather than trusting the branch from earlier in the session. Conductor runs sessions concurrently, so another one can check this worktree out onto a different branch and commit to it while your conversation is open — and the base you resolved for the branch you were on is then the wrong base, merged into work you haven't read.

"Update from base", "sync with main", "this branch is behind", "merge the base in" all need a base branch to merge from. Don't default to main. A branch is often stacked on another feature branch, and merging main instead silently pulls the wrong history — the diff looks "already up to date" against main while the real base has commits you're missing. Resolve the base in this order:

  1. A branch the user names — "update from X" / "base is X" wins outright.
  2. An open PR's base — gh pr view <branch> --json baseRefName. Also check the base of any feature branch you recently merged into this one (gh pr view <that-branch> --json baseRefName); a stack's branches usually share the same base.
  3. The upstream tracking ref, if it names a branch other than this one's own remote mirror (git rev-parse --abbrev-ref @{u}).
  4. The Conductor workspace target branch (from the workspace/system instructions) — a default hint, not the last word.

Re-resolve the base every time — it moves. When a base branch's PR merges, GitHub retargets the child PR (usually to main), so what you merged from last time may no longer be the base. Check gh pr view <branch> --json baseRefName, and gh pr list for whether the old base still has an open PR. A base whose PR has merged often keeps accumulating commits behind no PR at all; those aren't yours to integrate.

If 1–3 turn up nothing and the branch clearly builds on another feature branch — it was created by merging one in, was cut from main but layers work that lives on an unmerged branch, or the user talks about it as part of a stack — ask which branch to update from (offer the likely candidate) rather than merging main. Confirm before running the merge; a wrong base is expensive to unwind.

Bring a branch up to date

  • git fetch origin, then git merge --no-edit origin/<base> (the base resolved above, not reflexively main).
  • Read what the merge brought in from the merge itself, not from an earlier ahead/behind count — git log --oneline <pre-merge-HEAD>..<merge-commit>^2. Conductor worktrees share one .git, so refs/remotes/origin/* is shared too: another session's git fetch advances your base mid-conversation, and a count taken before the merge under-reports it. Telling the user "1 commit behind" and then merging 2 is how that surfaces.
  • Merge, never rebase. Republishing a rebased branch needs a force-push, and we never force-push.
  • If uncommitted work blocks the merge, commit that work first (it belongs to the branch anyway), then merge.
  • Already up to date → nothing to do.
Base already merged? Merge its final commit before main

This repo squash-merges, so a merged base lands on main as one commit sharing no ancestry with the base's real commits. Merge main straight into the stacked branch and every file the base added comes back as an add/add conflict — git has no common ancestor to three-way merge against, so it hands you files you never touched.

Merge the base's tip first, then main:

bash
gh pr view <base-pr> --json headRefOid --jq .headRefOid  # tip survives branch deletion
git fetch origin <sha>                                   # or refs/pull/<base-pr>/head
git merge --no-edit <sha>
git merge --no-edit origin/main

That makes your side byte-identical to what the squash put on main, so the add/add conflicts collapse and you're left only with files this branch actually changed.

The branch is usually deleted locally and on the remote by then, so don't look for origin/<base>; headRefOid and refs/pull/<n>/head are how you reach the commit.

Part of this branch already shipped as its own PR

Same cause the other way round: work split off this branch into its own PR lands on main as one squash commit, so every file both touched conflicts. main's side is the reviewed version of your own change — take it, then check that git diff origin/main lists only the work that PR left out.

Keep the merge commit to just the merge

A merge commit should contain only the reconciliation of the two histories — nothing else. Don't fold in lint fixes, refactors, renames, or "while I'm here" cleanups; buried inside a merge they're invisible in most diff views. Land them as separate commits after the merge.

Resolving conflicts

When git leaves <<<<<<< / ======= / >>>>>>> markers:

  • Understand each side before choosing. The version on main and the version on the branch each exist for a reason. Read enough of both to know what each is trying to do — don't mechanically keep "ours" or "theirs." The correct resolution is often a combination, not one side wholesale.
  • Consider the branch's purpose. What is this branch trying to accomplish? A conflict resolution that quietly drops the branch's intent (or reverts something main deliberately changed) is a bug, even if it compiles.
  • Ask when it isn't clear-cut. If you can't confidently tell which side should win, or the two changes are semantically entangled, stop and ask the user rather than guessing. A wrong silent resolution is worse than a question.
  • Both sides added at the same spot? Order matters. Keeping both isn't enough when either block has side effects. If the incoming block ends by reloading the page, anything of yours that depends on unsaved state has to come after it — concatenated the other way it still passes while testing nothing.
  • Taking one side resolves the marked blocks, not the file. git checkout --ours/--theirs replaces the whole file, discarding the other side's hunks that merged cleanly around the conflict. Delete the unwanted half of each <<<<<<< block instead; git checkout -m -- <file> restores the markers if you already reached for it.
  • Don't blanket-replace a renamed string. Two call sites that shared a string can have legitimately diverged; sed-ing the whole file changes the one that shouldn't move.
  • A conflicted schema_migrations list takes both versions. Each side appended its own migration, so keep both lines in descending order — in db/structure.sql and db/primary_replica_structure.sql alike — then bin/rails db:migrate to re-dump. Never hand-edit the structure files.
  • After resolving, verify the result actually makes sense — the merged code should reflect both intents, not just parse. Run the relevant tests if the conflict touched logic.
Show full SKILL.md (748 more words)Show less

The dangerous part is what merged cleanly

Conflict markers are the easy case — git is asking for help. The silent breakages come from hunks it merged without asking, because a three-way merge keeps your side of any line it can't attribute to a common ancestor. A base that arrived as a squash-merge has history unrelated to yours, so git will cheerfully resurrect code that base deliberately deleted, in files it reports as auto-merged.

After every merge, before committing:

bash
git diff origin/<base> -- app/ lib/ config/   # then account for every file listed

Every differing file must be explainable as this branch's work (or a sibling branch you're intentionally stacked on). Anything else is a resurrection or a stray. For a file that's mostly wrong, don't hand-patch hunks — git checkout origin/<base> -- <file> and re-apply your change on top.

Reverting a file to the base's version before you've merged that base takes whatever the base has gained since — commits your branch doesn't have, landing in your diff as your own work, and breaking against the code around them. git checkout $(git merge-base origin/main HEAD) -- <file> is the version your branch actually forked from.

Resolving two files to opposite sides breaks the interface between them, and neither looks wrong on its own. Taking the base's version of a component while the helper that calls it auto-merges keeping your argument is an unknown-keyword error on every render, past an audit that reports both files as expected. Whenever you reset a file that has callers, grep the arguments you dropped: git grep -n '<kwarg>' -- app should come back empty, or only where the base still accepts it.

What it catches:

  • Deleted code coming back. A constant, predicate, or callback the base removed reappears, along with the call sites that reference it — reintroducing behavior the base decided against.
  • Another branch's change riding along. A retention window, a flag, a tweak that came in when you merged a sibling branch and the base never took. Not yours to carry; reset it.
  • Committed churn in generated files. git checkout -- reverts to HEAD, not to the base — so once churn is committed it survives every later revert. Check VCR cassettes and lockfiles specifically; a diff that's only timestamps/nonces should be reset to the base.
  • Your side calling an API the base deleted. Nothing conflicts: your file is untouched by the merge and the base's deletion lands cleanly, so the break is a NoMethodError at load. Fix it in the commit after the merge, never in it.

Extracting a slice of another branch: git checkout <branch> -- <file> overwrites, it doesn't merge

Pulling part of a feature branch into a fresh one takes the file whole, so for anything main has moved since that branch last merged, you silently revert the newer work — no conflict, no warning. List the overlap first, and hand-apply those hunks:

bash
MB=$(git merge-base origin/main origin/<branch>)
comm -12 <(git diff --name-only $MB origin/main | sort) <(git diff --name-only $MB origin/<branch> | sort)

A merged Gemfile.lock needs bundle install before anything else runs

A dependency bump arriving in the merge leaves the lockfile ahead of what's installed, and every bin/ script and spec then dies at boot with Could not find <gem> in locally installed gems (Bundler::GemNotFound). That reads like a broken script rather than a missing gem — bundle install is the whole fix, and it should leave the lockfile untouched (if it rewrites it, the merge resolved it wrong). A bin/dev already running keeps its old gems until it restarts — bin/rails restart is enough, and leaves its watchers up.

Run the linter, not just the specs

bin/lint after every merge. A bad auto-merge that duplicates a method or strands a constant parses fine and passes its specs — Lint/DuplicateMethods is what catches it.

Then run specs for the merged area, including the browser ones. The base renaming or moving something your branch calls produces no conflict marker at all: a method that moved to a service, a route reshaped into a query param, copy your specs assert on. Those only surface at runtime.

bin/rails db:migrate too, when the merge brought migrations — the test database is maintained from the schema, so the specs stay green while every page in the browser is an ActiveRecord::PendingMigrationError.

bin/rails tailwindcss:build when the merge brought app/assets/tailwind/**, before the browser specs — they read app/assets/builds/tailwind.css, so a rule the base added is missing until it's rebuilt and the failure names the assertion (a border width, a radius) rather than the build.

Never force-push

No exceptions, even on a personal branch. If history has already diverged from the remote and you're tempted to force-push, stop and merge origin/<branch> back in — then add follow-up work as new commits and push normally.

© bikeindex, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/merge-conflicts of bikeindex/bike_index.

Open the folder on GitHubat commit 62d654e

Compare with similar skills

Merge Conflicts next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Merge Conflicts compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Merge Conflicts this skillbikeindex/bike_index308—~3.2kAutomated safety check: NotesAGPL-3.0
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Migrate Internal Package into GhostTryGhost/Ghost56k—~3.8kAutomated safety check: PassMIT
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0
Git Merge Conflict Resolvertailcallhq/forgecode7.6k1 repos~4.5kAutomated safety check: PassApache-2.0

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    56k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Git Merge Conflict Resolver

    tailcallhq/forgecode

    Resolves Git merge conflicts with a plan-first workflow that keeps both sides' intent, regenerates lock files and backs up deleted-but-modified files.

    7.6k GitHub starsUsed in 1 repo~4.5k tokens
    DevelopmentAuto-check passed
  • Git Branch Naming

    makeplane/plane

    Names a new Git branch with a type prefix, the lowercased work item ID and a short kebab-case description, so the ID can be extracted later from the branch name.

    61k GitHub stars~594 tokensUpdated yesterday
    DevelopmentAuto-check passed

More from bikeindex/bike_index

All 11 skills in this repo
  • Admin Data API

    bikeindex/bike_index

    Read live production data from Bike Index through the admin OAuth token — Sidekiq and PgHero status, and the user-submitted bug reports — the same data as the cookie-gated dashboards, but…

    308 GitHub stars~1.9k tokensUpdated today
    Auto-check: notes
  • GitHub PR Images

    bikeindex/bike_index

    Embed a local image file into an existing GitHub PR — either in the PR body or as a comment.

    308 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Manufacturers

    bikeindex/bike_index

    Add a manufacturer to Bike Index in production through the admin OAuth token (POST /admin/manufacturers).

    308 GitHub stars~452 tokensUpdated today
    Auto-check passed
  • PR

    bikeindex/bike_index

    Create or update a pull request for the current branch. An agent skill from bikeindex/bike_index.

    308 GitHub stars~4.3k tokensUpdated today
    Auto-check passed
  • Fixing Flaky Failures

    bikeindex/bike_index

    How to fix a test that fails intermittently in Bike Index — one that passes locally but fails on CI, fails on one shard, passes on re-run, or is already tagged :flaky.

    308 GitHub stars~5k tokensUpdated today
    Auto-check passed
  • Honeybadger Debugging

    bikeindex/bike_index

    Investigate and fix a specific Honeybadger exception in the Bike Index app — pull the fault, read its backtrace, find the offending code, write the fix.

    308 GitHub stars~1k tokensUpdated today
    Auto-check: notes

Works with

Categories

Questions about Merge Conflicts

What does Merge Conflicts do?

How to bring a branch up to date and resolve git merge conflicts the way this repo expects — merge (never rebase or force-push), understand each side's intent before choosing, ask when a resolution…. Merge Conflicts is an agent skill from bikeindex/bike_index. How to bring a branch up to date and resolve git merge conflicts the way this repo expects — merge (never rebase or force-push), understand each side's intent before choosing, ask when a resolution isn't clear-cut, keep the merge commit to just the merge, and audit what merged cleanly before committing.

When should I use Merge Conflicts?

Merge Conflicts fits situations like: ever youre about to run git merge/git pull; sync a branch with main; update from main; resolve conflict markers left by a merge.

How do I install Merge Conflicts in Claude Code?

Run `npx skills add bikeindex/bike_index --skill merge-conflicts -a claude-code`. Or copy the skill folder (.claude/skills/merge-conflicts in bikeindex/bike_index) into .claude/skills/merge-conflicts in your project. Claude Code loads it when a task matches its description.

How do I install Merge Conflicts in Codex?

Run `npx skills add bikeindex/bike_index --skill merge-conflicts -a codex`. Or copy the skill folder (.claude/skills/merge-conflicts in bikeindex/bike_index) into .agents/skills/merge-conflicts in your project. Codex loads it when a task matches its description.

Can I use Merge Conflicts in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bikeindex/bike_index --skill merge-conflicts -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/merge-conflicts, .gemini/skills/merge-conflicts, .github/skills/merge-conflicts and .opencode/skills/merge-conflicts in your project.

What does Merge Conflicts need to run?

Going by SKILL.md and its folder, Merge Conflicts needs the command-line tools its instructions call (git, gh, rails and bundle). Its frontmatter pre-approves these tools: Bash, Read, Edit, Write, Glob, Grep.

Does Merge Conflicts access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Merge Conflicts safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Merge Conflicts use?

Merge Conflicts is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Merge Conflicts use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Merge Conflicts?

Skills that share tags, products or a category with Merge Conflicts: Finishing a Development Branch (obra/superpowers, 297k stars), Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars), Migrate Internal Package into Ghost (TryGhost/Ghost, 56k stars) and Create Pull Request (cline/cline, 70k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Merge Conflicts?

bikeindex (a GitHub organization) maintains it in bikeindex/bike_index, which has 308 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 11, 2026.

Source: bikeindex/bike_index on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.