
dx-devops-conflict-resolve
Use this skill to diagnose and resolve what blocks a DevOps Center promotion of a work item's feature branch: Git merge conflicts and deployment failures. DevOps Center is Git-backed, so overlapping metadata changes surface as merge conflicts against the target stage branch, resolved with git (detect, resolve markers, commit, push). Deploy failures often cite a missing dependency a full promotion can fix when the component already exists on the branch. TRIGGER when the user wants to check a work item for conflicts before promoting, resolve merge conflicts or leftover conflict markers in metadata files (.xml, .object-meta.xml, .cls), reconcile a feature branch with its target stage branch, or diagnose why a DevOps Center promotion or deployment failed and whether a full promotion or a missing-dependency fix will resolve it. DO NOT TRIGGER for running the promotion itself (use dx-devops-promote), creating or updating work items (use dx-devops-work-item-manage), or deploying metadata dire
- Installs
- 835
- Last 24h
- +11
- Trending rank
- #8141
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/forcedotcom/sf-skills --skill dx-devops-conflict-resolve- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads dx-devops-conflict-resolve automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
DevOps Center Conflict & Deploy-Failure Resolution
Diagnoses and resolves what blocks a DevOps Center promotion of a work item's feature branch. DevOps Center is Git-backed: each work item is a feature branch and each pipeline stage has a target branch. A promotion can fail two ways — a Git merge conflict (two work items changed the same metadata) or a deployment failure (the deploy itself errors, often on a missing dependency). There is no sf devops conflict CLI command; both cases are diagnosed and resolved with standard git against the connected repository. This skill runs in a local clone of that repo.
Scope
- In scope: (a) Detect merge conflicts between a work item's feature branch and the target stage branch (non-destructively), resolve conflicted files (choose a side or manually merge conflict markers), commit, and push the feature branch DevOps Center tracks; (b) Diagnose a promotion deploy failure — classify it as a merge conflict vs. a deploy error, parse a missing dependency, and determine whether a full promotion can fix it (the component exists on the feature branch) or the component must be added first
- Out of scope: Running the promotion, full promotion, or combine (use
dx-devops-promote), creating/updating work items or their status (usedx-devops-work-item-manage), deploying metadata directly to an org, pipeline or project setup (separate skills)
Required Inputs
Gather or infer before proceeding:
- Local clone of the DevOps Center connected Git repository (the agent runs git commands here). Confirm the working tree is clean before starting.
- Feature branch name — the branch backing the work item. If the user gives a work item ID/subject instead, resolve it to its branch (see the Reference File Index for the
sf devops work-itemlookup). - Target stage branch name — the branch of the pipeline stage the work item promotes into (e.g. the integration/UAT branch).
- Remote name — defaults to
origin. - Deploy error text (deploy-failure track only) — the promotion's error output/summary. Needed to classify the failure and parse a missing dependency. Capture it to a file or pipe it into the diagnosis script.
Defaults unless specified:
- Remote:
origin - Merge direction: merge the target stage branch into the feature branch (reconcile the work item with where it is going)
If the user names both branches ("resolve conflicts on feature/WI-101 against uat"), proceed. If they give a work item, resolve its branch first.
Workflow
DevOps Center promotion blockers are Git-level. Detection and diagnosis are deterministic (scripts); resolving each conflicted file requires judgment (prose). Never resolve without first detecting on a clean tree.
Route first. Pick the track from the user's situation:
- Merge conflict track — the user wants a pre-promotion conflict check, or a promotion failed and the cause is (or is suspected to be) a merge conflict → Phases 1–4 below.
- Deploy-failure track — a promotion's deploy failed with an error message and the user wants to know why and how to fix it → Phase D below. If Phase D classifies the failure as a merge conflict, fall through to the merge-conflict track.
Phase 1 — Authenticate and orient
- Confirm the local repo and clean tree. Run in the repo clone:
git rev-parse --is-inside-work-tree && git status --porcelain- If
git status --porcelainprints anything, the tree is dirty — instruct the user to commit or stash first. A trial merge on a dirty tree is unsafe.
- If
- Resolve a work item to its branch (only if the user gave a work item, not a branch). Verify org auth with
sf org display --json; if it fails, tell the user to runsf org login web --set-default --alias <alias>. Then look up the branch — seereferences/git-conflict-resolution.md.
Phase 2 — Detect (non-destructive)
- Run the detection script. It fetches, trial-merges the target branch into the feature branch without committing, lists conflicted files, and aborts the trial so the tree is left untouched:
scripts/detect-conflicts.sh <feature-branch> <target-branch> [remote]- Exit
0= clean merge (no conflicts) → report "safe to promote" and STOP. - Exit
2= conflicts found → the script prints the conflicting file list; proceed to Phase 3. - Exit
1= error (dirty tree, unknown branch, fetch failure) → report the error and STOP; do not treat an error as "no conflicts".
- Exit
Phase 3 — Resolve
- Start the real merge to bring conflict markers into the working tree:
List the conflicted files deterministically:
git checkout <feature-branch> git merge --no-ff <remote>/<target-branch>git diff --name-only --diff-filter=U - Resolve each conflicted file — this is the judgment step:
- When one side is unambiguously correct, take it:
git checkout --ours -- <file>(keep the feature branch's version) orgit checkout --theirs -- <file>(take the target branch's version). For DevOps Center, "ours" is the feature branch, "theirs" is the target stage branch. - When both sides contain needed changes (divergent edits to the same component), open the file and manually merge — reconcile the
<<<<<<</=======/>>>>>>>regions into a single correct version, preserving both intents. Be especially careful with XML metadata (.xml,.object-meta.xml,.field-meta.xml): keep the file well-formed and do not duplicate elements. - Stage each resolved file:
git add <file>.
- When one side is unambiguously correct, take it:
- Confirm no markers remain before committing:
git diff --check git diff --name-only --diff-filter=Ugit diff --checkmust report nothing, and the unmerged-file list must be empty. If either shows leftovers, keep resolving — do not commit.
Phase 4 — Finalize and report
- Commit and push the resolution to the tracked feature branch so DevOps Center picks it up:
git commit --no-edit # completes the merge with the default merge message git push <remote> <feature-branch> - Report the outcome:
- No conflicts: "No merge conflicts between
<feature>and<target>. Safe to promote." - Resolved: list the files resolved and how (took a side vs. manual merge), and state that the feature branch was pushed. Then hand off: "Re-validate and promote via
dx-devops-promote."
- No conflicts: "No merge conflicts between
Phase D — Diagnose a deployment failure
Use this track when a promotion's deploy failed with an error and the user wants to know why and how to fix it. Diagnosis is deterministic (a script); do not eyeball the error.
D1. Capture the deploy error text to a file, or pipe it directly into the diagnosis script.
D2. Run the diagnosis script from the repo clone. It classifies the failure, parses any missing dependency, and checks whether that component exists on the feature branch (via git show):
scripts/diagnose-deploy-failure.sh <error-file|-> <feature-branch> [target-branch] [remote]
# or: <deploy command> 2>&1 | scripts/diagnose-deploy-failure.sh - <feature-branch> <target-branch>
Act on the exit code and the printed REASON / RECOMMENDATION:
- Exit
0(dependency_in_feature_branch) → the missing component exists on the feature branch but was left out of the deployed set. A full promotion should fix it. Report this, confirm with the user, and hand off todx-devops-promoteto run a full promotion. This skill does not promote. - Exit
2(merge_conflict) → the failure is a merge conflict, not a deploy error. Fall through to the merge-conflict track (Phase 1 onward). - Exit
3(dependency_not_in_feature_branch) → the missing component is not on the feature branch, so promoting cannot supply it. Report that the component must be added and committed to the feature branch (or the owning work item included) before promoting. - Exit
4(no_dependency_parsed) → the error is not a recognizable missing dependency. Report the raw error and advise fixing the underlying issue (e.g. test coverage, invalid metadata); a full promotion will not help. - Exit
1→ environment/usage error (not in a git repo, unreadable error file) → report and stop.
D3. Report the diagnosis with the REASON, whether a full promotion can fix it, the missing component (if any) and where it lives, and the concrete next step. Never re-promote blindly — only recommend a full promotion when the diagnosis is dependency_in_feature_branch.
Rules / Constraints
| Constraint | Rationale |
|---|---|
| Never trial-merge or merge on a dirty working tree | An in-progress merge on uncommitted changes can clobber the user's work irrecoverably |
| Always detect (Phase 2) before resolving (Phase 3) | Detection is non-destructive; jumping to a live merge without knowing the conflict set risks a messy half-merge |
| Detect conflicts with the script, not by eyeballing | scripts/detect-conflicts.sh produces a deterministic, reproducible conflict list and always cleans up its trial merge |
| A non-zero detection error is NOT "no conflicts" | Only exit 0 (clean) means safe to promote; exit 1 means the check failed and must be reported |
| Merge the target stage branch INTO the feature branch | Reconciles the work item with its destination; DevOps Center promotes the feature branch, so the resolution must live there |
Verify no conflict markers remain (git diff --check) before committing | Committing unresolved markers corrupts the metadata and the promotion |
| Preserve XML well-formedness when manually merging metadata | Malformed -meta.xml breaks deployment; never leave duplicated or truncated elements |
| Push only the work item's feature branch | The resolution belongs to the work item's branch; never push to a stage/integration branch directly |
| This skill does not promote or deploy | Resolution ends at a pushed, conflict-free branch or a diagnosis; promotion (including full promotion) is dx-devops-promote |
| Diagnose deploy failures with the script, not by eyeballing | scripts/diagnose-deploy-failure.sh deterministically classifies the failure and verifies branch presence with git show |
| Recommend a full promotion ONLY when the missing component is on the feature branch | If the component is absent, promoting the branch cannot supply it — a re-promote just fails again |
Gotchas
| Issue | Resolution |
|---|---|
No sf devops conflict CLI command exists | DevOps Center conflicts are Git conflicts — resolve them with git, not a sf devops subcommand. This skill is git-based by design |
| Dirty working tree | git status --porcelain must be empty; instruct the user to commit or stash before detecting/resolving |
| User gave a work item, not a branch | Resolve the work item to its feature branch first via sf devops work-item — see references/git-conflict-resolution.md |
| Non-zero script exit treated as clean | Exit 2 = conflicts, exit 1 = error. Only exit 0 is "safe to promote" |
| Committing with markers still present | Run git diff --check and confirm the --diff-filter=U list is empty before git commit; leftover <<<<<<</>>>>>>> markers corrupt metadata |
--ours / --theirs reversed | When merging the target INTO the feature branch, --ours = feature branch, --theirs = target stage branch |
| Manually merged XML is malformed | Keep -meta.xml well-formed; do not duplicate elements. Re-check the file parses before staging |
| Detached HEAD / stale branch | git fetch first; check out the feature branch as a tracking branch before merging (the script fetches for you) |
| Conflict reappears after promotion still fails | The target branch moved; re-run detection against the current target branch and resolve again |
| Re-promoting a deploy failure without diagnosing | Run scripts/diagnose-deploy-failure.sh first: exit 0 = component on the branch, a full promotion fixes it; exit 2 = it's a merge conflict (switch tracks); exit 3 = component absent, add and commit it (or include the owning work item) before promoting — promotion alone cannot supply it |
Output Expectations
This skill produces a conflict-free feature branch or a deploy-failure diagnosis, not org changes:
- No conflicts: confirmation that the feature branch merges cleanly into the target stage branch — safe to promote
- Conflicts resolved: a merge commit on the work item's feature branch reconciling it with the target stage branch, pushed to the remote, plus a report of which files were resolved and how (took a side vs. manual merge)
- Deploy-failure diagnosis: a report stating the failure reason (merge conflict / missing dependency in-branch / missing dependency not-in-branch / unrecognized), whether a full promotion can fix it, the missing component and where it lives, and the concrete next step
No metadata is deployed and no org state is mutated. The deliverable is the pushed, conflict-free branch or the diagnosis and recommended next step.
Cross-Skill Integration
| When | Action |
|---|---|
| The branch is conflict-free (or resolved and pushed) and ready to advance | Delegate to dx-devops-promote to validate and promote |
| A work item name/ID must be resolved to its feature branch, or candidate work items listed | Use dx-devops-work-item-manage |
| Work items share metadata and could promote as one unit instead of resolving separately | Consider combining via dx-devops-promote's combine step rather than a manual merge |
| A promote deploy already failed on a conflict | Re-detect against the current target branch, resolve, push, then re-promote via dx-devops-promote |
Diagnosis says a full promotion can fix the failure (dependency_in_feature_branch) | Hand off to dx-devops-promote to run the full promotion — this skill does not promote |
| Missing component must be added to the feature branch before promoting | Author/commit the component (or include the owning work item) — for metadata generation use the relevant domain skill, then re-promote via dx-devops-promote |
Reference File Index
| File | When to read |
|---|---|
scripts/detect-conflicts.sh | Phase 2 — run it to non-destructively detect merge conflicts between the feature branch and the target stage branch |
scripts/diagnose-deploy-failure.sh | Phase D — run it to classify a promotion deploy failure and decide whether a full promotion (or a missing-dependency fix) resolves it |
references/git-conflict-resolution.md | When you need the full git command reference, the sf devops work-item-to-branch lookup, or --ours/--theirs and XML-merge guidance |
references/deploy-failure-resolution.md | Phase D — when you need the deploy-failure decision tree, the error-parsing patterns, or the full-promotion reasoning behind the diagnosis script |
examples/conflict-workflows.md | When the user's request matches a common pattern (pre-promotion conflict check, take-a-side resolution, manual XML merge, troubleshooting a failed promotion, or diagnosing a deploy failure) |
FAQ
What does the dx-devops-conflict-resolve skill do?
Use this skill to diagnose and resolve what blocks a DevOps Center promotion of a work item's feature branch: Git merge conflicts and deployment failures. DevOps Center is Git-backed, so overlapping metadata changes surface as merge conflicts against the target stage branch, resolved with git (detect, resolve markers, commit, push). Deploy failures often cite a missing dependency a full promotion can fix when the component already exists on the branch. TRIGGER when the user wants to check a work item for conflicts before promoting, resolve merge conflicts or leftover conflict markers in metadata files (.xml, .object-meta.xml, .cls), reconcile a feature branch with its target stage branch, or diagnose why a DevOps Center promotion or deployment failed and whether a full promotion or a missing-dependency fix will resolve it. DO NOT TRIGGER for running the promotion itself (use dx-devops-promote), creating or updating work items (use dx-devops-work-item-manage), or deploying metadata dire
How do I install dx-devops-conflict-resolve?
Run npx skills add https://github.com/forcedotcom/sf-skills --skill dx-devops-conflict-resolve in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/dx-devops-conflict-resolve/ (personal) or .claude/skills/dx-devops-conflict-resolve/ (project).
Which AI agents can use dx-devops-conflict-resolve?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is dx-devops-conflict-resolve safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains dx-devops-conflict-resolve?
It is published by forcedotcom in forcedotcom/sf-skills. It has 835 recorded installs.
More from forcedotcom/sf-skills
platform-apex-generate
forcedotcom/sf-skills
Primary Apex authoring skill for class generation, refactoring, and review. ALWAYS ACTIVATE when the user mentions Apex, .cls, triggers, or asks to create/refactor a class (service, selector, domain, batch, queueable, schedulable, invocable, DTO, utility, interface, abstract, exception, REST resource). Use this skill for requests involving SObject CRUD, mapping collections, fetching related records, scheduled jobs, batch jobs, trigger design, @AuraEnabled controllers, @RestResource endpoints, custom REST APIs, or code review of existing Apex.
platform-apex-test-generate
forcedotcom/sf-skills
Use to generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking, assertions, and disciplined test-fix loops. Use when creating Apex test classes (for triggers, services, controllers, batch jobs, queueables, and callouts), improving coverage, debugging or fixing failing Apex tests, or running test/coverage analysis. Triggers on Test.cls files, sf apex run test, coverage reports. Do NOT trigger for production Apex (use platform-apex-generate) or Jest/LWC tests.
platform-apex-test-run
forcedotcom/sf-skills
Apex test execution, coverage analysis, and test-fix loops with 120-point scoring. Use when the user runs Apex tests, checks code coverage, fixes failing tests, or touches Test.cls / Test.cls files. DO NOT TRIGGER when writing Apex production code (use platform-apex-generate), Agentforce agent testing (use agentforce-test), or Jest/LWC tests (use experience-lwc-generate).
platform-apex-logs-debug
forcedotcom/sf-skills
Salesforce debug log analysis and troubleshooting with 100-point scoring. TRIGGER when: user analyzes debug logs, hits governor limits, reads stack traces, or touches .log files from Salesforce orgs. DO NOT TRIGGER when: running Apex tests (use platform-apex-test-run), generating or fixing Apex code (use platform-apex-generate), or Agentforce session tracing (use agentforce-observe).
platform-soql-query
forcedotcom/sf-skills
Use when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan/selectivity analysis, and performance or safety improvements. TRIGGER when the user writes, optimizes, or debugs SOQL/SOSL, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER for bulk data operations (use platform-data-manage), Apex DML logic (use platform-apex-generate), or report/dashboard queries.
platform-metadata-deploy
forcedotcom/sf-skills
Salesforce DevOps automation using sf CLI v2. TRIGGER when: user deploys metadata, validates a deploy or does a dry-run, deploys to a Production org, quick-deploys a validated job ID, ships/promotes to prod, creates/manages scratch orgs or sandboxes, sets up CI/CD pipelines, or troubleshoots deployment errors with sf project deploy. DO NOT TRIGGER when: writing Apex code, building LWC components (use experience-lwc-generate), creating metadata definitions (use platform-custom-object-generate), deleting metadata from an org (use platform-destructive-deploy), or querying org data (use platform-data-manage).
Popular devops & cloud skills
microsoft-foundry
microsoft/azure-skills
Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, managed harness agent create, GitHub Copilot harness agent, create agent, update agent, add tool to agent, invoke agent, agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure
azure-diagnostics
microsoft/azure-skills
Debug Azure production issues on Azure using AppLens, Azure Monitor, resource health, and safe triage. WHEN: debug production issues, troubleshoot app service, app service high CPU, app service deployment failure, troubleshoot container apps, container app 503 or target port mismatch, troubleshoot functions, function telemetry missing or stopped after a config/connection-string change, troubleshoot AKS, VM RDP, Linux SSH, VM black screen, can't connect to VM, reset VM password, NSG or firewall blocking, kubectl cannot connect, kube-system/CoreDNS failures, pod pending, crashloop, node not ready, upgrade failures, analyze logs, KQL, insights, image pull failures, cold start issues, health probe failures, resource health, root cause of errors, troubleshoot event hubs, troubleshoot service bus, messaging SDK error, AMQP connection failure, message lock lost, lock renewal during long-running processing, service bus dead letter.
azure-prepare
microsoft/azure-skills
Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow. USE ONLY when the user explicitly wants to use azd as the deployment tool, or the project already has an azure.yaml file. DO NOT USE FOR: non-azd deployments, Python App Service code-only deploys (use python-appservice-deploy), or cross-cloud migration (use azure-cloud-migrate). WHEN: prepare app for azd, create azure.yaml, set up azd infrastructure, modernize app for Azure with azd, deploy with azd, function app, timer trigger, service bus trigger, event-driven function, managed identity, generate Bicep, generate Terraform, create and deploy to Azure.
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
azure-deploy
microsoft/azure-skills
Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files. DO NOT use this skill when the user asks to CREATE a new application — use azure-prepare instead. This skill runs azd up, azd deploy, terraform apply, and az deployment commands with built-in error recovery. Requires .azure/deployment-plan.md from azure-prepare and validated status from azure-validate. WHEN: "run azd up", "run azd deploy", "execute deployment", "push to production", "push to cloud", "go live", "ship it", "bicep deploy", "terraform apply", "publish to Azure", "launch on Azure". DO NOT USE WHEN: "create and deploy", "build and deploy", "create a new app", "set up infrastructure", "create and deploy to Azure using Terraform" — use azure-prepare for these.
azure-validate
microsoft/azure-skills
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.