pull-changes-resolve-conflicts
cognitedata/builder-skills
Standard workflow for pulling updates from main or other branches on multi-contributor projects (including Flows apps) without silently discarding work. Guides fetching/merging, requires listing merge conflicts explicitly, analyzing ours vs theirs using conversation history and repo context, presenting prioritized recommendations, and obtaining user answers before editing conflict markers or completing the merge. Triggers: pull main, merge main, merge origin, rebase, merge conflict, unmerged pat
...Expand allAbout pull-changes-resolve-conflicts
A guided workflow for integrating one branch into another (typically pulling or merging main into a feature branch) on multi-contributor projects without silently discarding intentional work. It applies to any Git-based team workflow, with Flows/React apps called out as a common case where conflicts tend to cluster in app shells, top navigation, route modules, and shared lib/ or hooks/ directories. The central principle is that conflict resolution should never assume "main wins" or "ours wins" before analysis, and that trade-offs must be made visible to the user before any conflict markers are edited.
The workflow proceeds in stages: fetch and integrate (preferring git fetch followed by git merge origin/main unless rebase was requested), then explicitly report every unmerged file with a short note on what diverged, then analyze using conversation history, repo signals (such as a PRD.md or recent commits), and the conflict hunks themselves via git show :2:path (ours) versus git show :3:path (theirs). Conflicts are classified as orthogonal (safe to combine), overlapping (must choose or merge by hand), or corruption risk (duplicated blocks from bad merges). Findings are then presented as prioritized recommendations and explicit questions, ordered P0 (structural/product changes like removed routes, dropped features, changed data or API contracts) through P3 (presentation tweaks like spacing and class names).
Hard rules enforce no silent resolution: conflict markers are not removed and git add is not run until the user agrees to the plan or explicitly defers to the recommendations. The skill stops at conflicts rather than bulldozing through large files, and supports aborting via git merge --abort or git rebase --abort. It also lists anti-patterns to avoid, such as picking --ours or --theirs across the whole repo, or hiding a conflict list inside a long code dump without a short executive summary. Optional command snippets and a merge message template live in an accompanying reference.md.
FAQ
When should I use this skill?
Whenever you integrate another branch (usually main) into your current feature branch, or when git status shows unmerged paths after a merge or rebase. It applies to any Git-based team workflow, with Flows/React apps being a common case.
Will it resolve conflicts automatically without asking me?
No. A hard rule prohibits silent resolution: it will not remove conflict markers or run git add until you agree to the plan or explicitly say to use its recommendations. It pauses at conflicts and reports them first.
How does it decide which conflicts to discuss first?
Conflicts are ordered by impact, from P0 (structural/product changes such as removed routes, dropped features, or changed data and API contracts) down to P3 (presentation tweaks like spacing, class names, and copy).
What information does it use to analyze a conflict before editing?
It uses conversation history about what the branch was shipping, repo signals such as a PRD.md or recent commits and file ownership, and the conflict hunks themselves via git show :2:path for ours and git show :3:path for theirs.
What if I just want to abort the merge?
The skill supports running git merge --abort or git rebase --abort as appropriate, and confirms that you lose the in-progress integration state for that operation.
All Files
2 filesreference.md0.7 KBViewSKILL.md5.5 KBViewUse this skill whenever integrating another branch (usually main) into the current feature branch, or when git status shows unmerged paths after a merge or rebase. Applies to any Git-based team workflow; Flows/React apps are a common case where conflicts cluster in app shells and shared libraries.
Goals
- Preserve intentional work on the current branch; do not assume “main wins” or “ours wins” without analysis.
- Make trade-offs visible to the user before any conflict resolution edits.
- Order discussion by impact: structural / feature / API / data-model changes before styling, copy, or spacing.
Hard rules
- No silent resolution — Do not remove
<<<<<<</=======/>>>>>>>or rungit addon conflicted files until the user has agreed to the plan (or explicitly says “use your recommendations”). - Stop at conflicts — If a merge or rebase introduces conflicts, pause and report; do not bulldoze through large files by picking one side wholesale unless the user explicitly requests that.
- Prioritize impact — When presenting conflicts, group and order roughly as:
- P0 — Structural / product: removed routes, deleted modules, dropped features, changed data or API contracts, SDK or schema changes, auth or routing shell.
- P1 — Behavior: logic, hooks, queries, filters, error handling, loading states.
- P2 — UI structure: layout regions, new or removed sections, navigation.
- P3 — Presentation: tokens, spacing, class names, copy tweaks.
Workflow
1. Fetch and integrate (or diagnose)
- Prefer
git fetchthengit merge origin/main(or the named branch) unless the user asked for rebase. - If merge is already in progress, run
git statusand list every unmerged file.
2. Report conflicts to the user (explicit)
Output a clear list:
- Branch state: current branch, target branch (e.g.
origin/main), merge vs rebase. - Unmerged files: paths only, then optionally
git diff --name-only --diff-filter=U. - Per file (short): one line on what diverged (e.g. “
AlertsPage— layout + new data scope”) if inferable from paths andgit diffwithout resolving.
3. Analyze before editing
Use all of:
- Conversation history — What was the user or team trying to ship on this branch?
- Repo signals — Product or architecture docs if present (e.g.
PRD.md), recent commits on the current branch, file ownership (e.g. large feature module vs sharedlib/). - Conflict hunks —
git show :2:path(ours) vsgit show :3:path(theirs) during merge, or read conflict markers; identify duplicated vs orthogonal changes.
Classify each conflicted area as:
- Orthogonal — safe to combine (e.g. import sort + new prop).
- Overlapping — must choose or manually merge (same lines).
- Corruption risk — duplicated blocks (common after bad merges); flag and recommend reconstructing from one side then re-applying the other side’s intent manually.
4. Recommendations + questions (required)
Present to the user:
- Summary table or bullets — file → recommended side or “manual merge” → one-line why.
- Ordered by P0 → P3 — call out anything that removes a feature or changes public behavior first.
- Explicit questions — anything ambiguous (e.g. “Keep main’s global behavior or the branch’s scoped variant?”).
- Ask for direction — e.g. “Reply with: (a) follow recommendations, (b) keep branch for file X, (c) keep main for file Y, (d) abort merge.”
Only after the user confirms (or gives a precise mapping), apply resolutions:
- Prefer small, surgical edits; preserve both sides’ intent when possible.
- Re-run
git status; ensure no conflict markers remain; run tests or lint the user cares about for touched areas.
5. If the user wants to abort
git merge --abortorgit rebase --abortas appropriate; confirm they lose in-progress integration state for that operation.
Anti-patterns (do not do)
- Picking
--ours/--theirson the whole repo without user approval. - “Resolving” by deleting a feature branch’s work because main touched the same file.
- Hiding conflict lists inside a long code dump without a short executive summary.
- Fixing low-impact style conflicts first while leaving P0 decisions implicit.
Quick reference
- Ours vs theirs (merge): stage 2 = current branch (
HEAD), stage 3 = incoming (MERGE_HEAD). Verify withgit checkout --conflict=merge <file>if needed. - Typical high-touch paths in full-stack or Flows apps: root app shell, top navigation, route modules, and shared
lib/orhooks/.
For optional command snippets and a merge message template, see reference.md.
All Files
0 filesInstall pull-changes-resolve-conflicts
Download and extract the skill files to your .claude/skills/ directory.
Download ZIPClone the repository and copy the skill files to your project.
git clone https://github.com/cognitedata/builder-skills/blob/main/skills/pull-changes-resolve-conflicts/SKILL.md # Copy SKILL.md to your .claude/skills/ directory
Copy





Home
