pull-changes-resolve-conflicts
cognitedata/builder-skills
Safely integrate branch changes by analyzing conflicts before resolving, preserving intentional work.
What is pull-changes-resolve-conflicts?
Guides you through pulling updates from another branch (usually main) and resolving merge conflicts without silently discarding work. Use this whenever integrating branches or git status shows unmerged paths. Applies to any Git-based team workflow, especially multi-contributor projects like Flows/React apps.
- Fetches and merges (or rebases) the target branch, then pauses to report all unmerged files explicitly
- Analyzes conflicts using conversation history, repo context, and diff hunks to classify changes as orthogonal, overlapping, or corruption risks
- Prioritizes conflicts by impact: structural/product changes (P0) before behavior (P1), UI structure (P2), and presentation (P3)
- Presents a prioritized recommendation table with one-line reasoning for each conflicted file before any edits
- Requires explicit user confirmation of the resolution plan before applying changes or running git add
- Prevents silent resolution—conflict markers remain until you approve the strategy
How to install pull-changes-resolve-conflicts
npx skills add https://github.com/cognitedata/builder-skills --skill pull-changes-resolve-conflicts- Git repository with at least one remote (e.g., origin)
- Current branch with uncommitted changes or a merge/rebase already in progress
How to use pull-changes-resolve-conflicts
- 1.Run the skill when you want to pull updates from another branch or when git status shows unmerged paths
- 2.Review the reported list of conflicted files and the one-line summary of what diverged in each
- 3.Read the prioritized recommendations (P0 structural first, then P1 behavior, P2 UI, P3 presentation)
- 4.Answer the explicit questions posed about ambiguous conflicts (e.g., which variant to keep)
- 5.Confirm your resolution strategy (follow recommendations, keep branch for file X, keep main for file Y, or abort)
- 6.The skill applies the approved changes, removes conflict markers, and completes the merge or rebase
Use cases
- Merging main into a feature branch on a multi-contributor project without losing intentional work
- Rebasing a feature branch and discovering conflicts that need careful analysis before resolution
- Integrating changes in a Flows or React app where conflicts cluster in app shells and shared libraries
- Reviewing what changed on main vs your branch before deciding which side to keep or how to manually merge
- Aborting a merge or rebase if the conflicts are too complex or the timing is wrong
- Team developers working on shared Git repositories with multiple contributors
- Feature branch owners integrating upstream changes without clobbering their work
- Full-stack or React/Flows app developers managing conflicts in app shells and shared libraries
- Anyone who wants explicit visibility into merge trade-offs before committing to a resolution
pull-changes-resolve-conflicts FAQ
Tell the skill to abort. It will run git merge --abort or git rebase --abort as appropriate and confirm you lose the in-progress integration state.
It analyzes conversation history, repo context (docs, recent commits, file ownership), and conflict hunks to classify changes as orthogonal (safe to combine), overlapping (must choose), or corruption risks. Recommendations prioritize impact: structural/product changes first, then behavior, UI, and presentation.
No. The skill requires explicit user confirmation before editing any conflict markers or running git add. It presents recommendations and asks questions, but you must approve the plan.
The skill is designed for this case. Conflicts often cluster in app shells, top navigation, route modules, and shared lib/ or hooks/. The skill will analyze and prioritize these high-touch paths by impact.
During a merge, 'ours' (stage 2) is your current branch (HEAD), and 'theirs' (stage 3) is the incoming branch (MERGE_HEAD). The skill uses this to compare what changed on each side.
Full instructions (SKILL.md)
Source of truth, from cognitedata/builder-skills.
name: pull-changes-resolve-conflicts description: >- 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 paths, both modified, integrate branch, sync with main, git merge abort, resolve conflicts, UU status, theirs vs ours, feat branch update. allowed-tools: Read, Glob, Grep, Shell, Write metadata: argument-hint: ""
Pull changes & resolve merge conflicts
Use 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.
Related skills
More from cognitedata/builder-skills and the wider catalog.

reveal-3d
Embed interactive Cognite Reveal 3D CAD viewer in Flows apps with local bundled source.

security
Find and fix security issues in Flows apps before shipping—handles credentials, input validation, XSS, injection, and auth gaps.

setup-flows-auth
Wire a React app for Flows authentication to connect to CDF inside Fusion.

setup-python-tools
Add client-side Python tool execution via Pyodide to Flows apps with automatic hook setup and chat integration.

skill-creator
Create, improve, and evaluate AI agent skills with iterative testing and performance benchmarking.

test-coverage
Find and fix test coverage gaps to meet the 80% line coverage hard gate for Flows apps.