fix-merge-conflicts

fix-merge-conflicts is a skill for Claude Code from saffron-health/libretto. It costs 55 tokens per session (1,028 once invoked), scanned A, original, MIT.

Instructions for resolving Git conflicts during a merge, rebase, or cherry-pick while considering the purpose of the changes on both sides. Git conflicts happen when competing edits cannot be combined automatically.

In plain words
What is it for?
Use it to inspect conflicted files and related pull requests, preserve compatible intent, identify disagreements that need a decision, and run targeted checks.
Why use it?
It helps prevent a conflict resolution from silently discarding one change or choosing code based only on line order.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: installed under .agents/ (shared by several agents).

Part of the libretto plugin — 24 skills shipped together

Good fit Use it to inspect conflicted files and related pull requests, preserve compatible intent, identify disagreements that need a decision, and run targeted checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/saffron-health/libretto/fix-merge-conflicts
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add saffron-health/libretto --skill fix-merge-conflicts
Clone the repo
git clone --depth 1 https://github.com/saffron-health/libretto

Made for: Claude Code.

Or install libretto, the plugin that ships this one along with the rest of its 24 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fix-merge-conflicts

README.md
[![agentmods](https://agentmods.dev/badge/skills/saffron-health/libretto/fix-merge-conflicts/github.svg)](https://agentmods.dev/skills/saffron-health/libretto/fix-merge-conflicts)
Your own site
<a href="https://agentmods.dev/skills/saffron-health/libretto/fix-merge-conflicts"><img src="https://agentmods.dev/badge/skills/saffron-health/libretto/fix-merge-conflicts/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fix-merge-conflicts

Your own site · 80×15
<a href="https://agentmods.dev/skills/saffron-health/libretto/fix-merge-conflicts"><img src="https://agentmods.dev/badge/skills/saffron-health/libretto/fix-merge-conflicts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,028 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.01028
Opus 5 $0.00028 $0.00514
Sonnet 5 $0.00011 $0.00206
Haiku 4.5 $0.00006 $0.00103

Measured 11d ago against content hash dfc02f30890b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

fix-merge-conflicts scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/fix-merge-conflicts/SKILL.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Resolve conflicts by intent, not by line order.

Workflow

  1. Run preflight conflict detection. If no local merge/rebase/cherry-pick conflicts are present, automatically fetch and merge origin/main.
  2. Identify conflicted files and candidate commits.
  3. Map each conflicting commit to its PR.
  4. Read PR title and description to extract intent.
  5. Detect intent divergence and request user intervention.
  6. Resolve conflicts to preserve both intents when compatible.
  7. Validate behavior with targeted checks.
  8. Summarize decisions and any tradeoffs.

0) Preflight: Ensure a Conflict Exists

If there are no active unmerged paths, proactively merge latest origin/main to surface conflicts:

git status --porcelain
git diff --name-only --diff-filter=U

Decision rule:

  • If git diff --name-only --diff-filter=U returns files, skip auto-merge and continue to conflict analysis.
  • If it returns nothing, run:
git fetch origin
git merge origin/main

Then re-check:

git diff --name-only --diff-filter=U
  • If conflicts now exist, continue with the rest of this workflow.
  • If still no conflicts, report that no merge conflicts were detected and stop.

1) Identify Conflict Scope

Run:

git status --porcelain
git diff --name-only --diff-filter=U
git log --left-right --merge --oneline

Use git log --left-right --merge as the starting set of commits that influenced the conflicted hunks.

2) Map Commits to PRs

Prefer GitHub metadata when available.

  1. Parse owner/repo from origin.
  2. For each conflicting commit SHA, query associated PRs.
gh api graphql \
  -f query='query($owner:String!,$repo:String!,$sha:GitObjectID!){repository(owner:$owner,name:$repo){object(oid:$sha){... on Commit{associatedPullRequests(first:5){nodes{number title body url mergedAt baseRefName headRefName}}}}}}' \
  -F owner=OWNER -F repo=REPO -F sha=COMMIT_SHA

If no associated PR is found, fall back to git show --stat COMMIT_SHA and commit message context.

Read the full file on GitHub · 145 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 145 lines · 55 tokens per session scan A dfc02f30890b

Subscribe to this mod's changes

fix-merge-conflicts is a skill published in the GitHub repository saffron-health/libretto (889 stars, last pushed 21d ago), licensed MIT. It adds 55 tokens to every session and 1,028 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

magpie-issue-deduplicate

Merge two open issues that describe the same root cause, preserving both reporters' context. Proposes a closing comment on the duplicate and a cross-reference comment on the kept issue. Waits for maintainer confirmation before posting anything or closing anything.

apache/magpie · 65 tokens

magpie-setup-upstream-fix

Turn a framework bug or quirk the agent hit while running a Magpie skill or tool into a fix PR against apache/magpie — one PR per issue. First confirms the problem is a framework defect (not a local misconfiguration or a stale snapshot), then searches apache/magpie for an existing issue or PR that already covers it…

apache/magpie · 110 tokens

docs-release-notes

Use when a change needs a user-visible release-note, changelog, or changeset entry — "add a release note", "add a changeset for this", "what goes in the changelog?", "write up what shipped", "note this for the next release" — or when finalizing a branch whose customer-visible features, bug fixes, or UI changes should…

The01Geek/prflow · 106 tokens

retrospective-audit

Stage B of /prflow:retrospective-weekly: given a most-recent-first subset of one recurring pattern's occurrence-PR context bundles (bounded by auditbundlecap), re-derive the root cause and return one JSON object carrying a ranked findings array (one to three sub-patterns) — no edits, no worktree. Invoked as a subagent…

The01Geek/prflow · 91 tokens

debug-systematic

Systematic 4-phase debugging methodology for complex, intermittent, or mysterious issues. Use when investigating bugs, race conditions, or unexplained failures.

travisjneuman/.claude · 33 tokens

magpie-issue-fix-workflow

For a single triaged issue confirmed as a bug or feature, draft a fix against on . Produces the failing test, the smallest production change, the targeted+module test runs, and the commit. The PR is NOT opened on autopilot; the human committer reviews, signs, and pushes. Hand-back artefact summarises branch, commits…

apache/magpie · 108 tokens