ai-resolve-conflicts
$
npx mdskill add arcasilesgroup/ai-engineering/ai-resolve-conflictsResolve git conflicts by categorizing and applying intent-aware strategies.
- Handles lock files, migrations, generated code, configs, and source code.
- Depends on git status checks and conflict detection mechanisms.
- Categorizes files to apply specific regeneration or merge strategies.
- Outputs resolved file states without executing commit commands.
SKILL.md
.github/skills/ai-resolve-conflictsView on GitHub ↗
--- name: ai-resolve-conflicts description: "Resolves git conflicts intent-aware: categorizes by type (lock files, migrations, generated, config, code), regenerates or merges per category, never blindly accepts. Trigger for 'I have conflicts', 'rebase failed', 'merge conflict', 'cherry-pick failed', 'unmerged paths'. Not for branch hygiene; use /ai-branch-cleanup instead. Not for committing the resolution; use /ai-commit instead." effort: cheap argument-hint: mode: agent model_tier: haiku mirror_family: copilot-skills generated_by: ai-eng sync canonical_source: .claude/skills/ai-resolve-conflicts/SKILL.md edit_policy: generated-do-not-edit --- # Resolve Conflicts ## Purpose Intelligent git conflict resolution. Detects conflict type, categorizes files by resolution strategy, and resolves conflicts with awareness of both sides' intent. Handles lock files, migrations, and code conflicts differently. ## Trigger - Command: `/ai-resolve-conflicts` - Context: git operation resulted in conflicts (rebase, merge, cherry-pick, revert). - Auto-detect: `git status` shows "Unmerged paths" or "both modified". ## Workflow 1. **Detect conflict type** -- determine the operation that caused conflicts: ```bash # Check which operation is in progress test -d .git/rebase-merge || test -d .git/rebase-apply # rebase test -f .git/MERGE_HEAD # merge test -f .git/CHERRY_PICK_HEAD # cherry-pick test -f .git/REVERT_HEAD # revert ``` 2. **List conflicted files** -- `git diff --name-only --diff-filter=U` 3. **Categorize each file** by resolution strategy: | Category | File patterns | Strategy | |----------|--------------|----------| | Lock files | `*.lock`, `poetry.lock`, `Cargo.lock`, `package-lock.json`, `uv.lock` | Accept theirs, regenerate | | Migrations | `migrations/`, `alembic/versions/` | Ask user (order matters) | | Generated | `*.min.js`, `*.min.css`, `dist/`, `build/` | Accept theirs, rebuild | | Config | `*.yml`, `*.toml`, `*.json` (non-lock) | AI merge with validation | | Code | everything else | AI analysis | 4. **Resolve by category** (per the strategy column above): **Lock files** — `git checkout --theirs <lockfile>` then regenerate (`npm install` / `cargo generate-lockfile` / `uv lock` / etc.). **Migrations** — present both sides with the migration graph; ask which order to apply (never auto-resolve — ordering is semantic). **Config files** — merge intelligently preserving both sides' additions; validate against schema if available. **Code conflicts** — for each hunk: (a) read 50 lines context each side, (b) identify intent per side, (c) check commit messages, (d) propose resolution preserving both intents, (e) if intents conflict, present options to user. 5. **Stacked PR detection** -- if resolving conflicts between branches in a stack: a. Compare base, HEAD, and incoming for similarity b. If high overlap, likely a stacked PR rebase -- prefer incoming (later branch) c. Warn user about potential cascade to downstream branches 6. **Validate resolution**: - Run `git diff` to review all resolutions - Run stack-specific checks (build, lint, test) - Present summary before continuing the operation 7. **Continue operation**: ```bash git add <resolved-files> git rebase --continue # or git merge --continue / git revert --continue / git cherry-pick --continue ``` If the continue operation produces new conflicts (common during multi-commit rebases), loop back to the conflict detection step and resolve the next round. Repeat until the operation completes. ## Quick Reference ``` /ai-resolve-conflicts # auto-detect and resolve current conflicts ``` No arguments needed -- the skill reads git state directly. ## Examples ### Example 1 — rebase that hit a lock-file conflict User: "rebase failed on package-lock.json" ``` /ai-resolve-conflicts ``` Detects the rebase-in-progress, classifies `package-lock.json` as a generated file, regenerates via `npm install`, stages the result, runs `git rebase --continue`. ### Example 2 — merge with code conflict needing intent-aware resolution User: "merge conflict in src/auth.ts, both branches changed the token validator" ``` /ai-resolve-conflicts ``` Reads both sides, detects category = code, applies intent-aware resolution (preserves both validators if non-overlapping; otherwise asks the user with a unified diff). ## Integration Called by: `/ai-pr` watch-and-fix loop (CI repair), user directly. Calls: git (rebase / merge / cherry-pick continuation), package managers (lock-file regeneration). See also: `/ai-branch-cleanup` (after resolution), `/ai-commit` (commit the resolved state). $ARGUMENTS
More from arcasilesgroup/ai-engineering
- ai-adviseProactive governance advisor — checks standards, decisions, and quality trends during development. Always advisory, NEVER blocks. Three modes: `advise` (post-edit), `gate` (pre-dispatch), `drift` (on-demand decision audit). Trigger for 'governance check', 'advise on this change', 'check for drift', 'is this aligned with active decisions', 'shift-left advisory'. Not for blocking gates — use /ai-verify. Not for narrative code review — use /ai-review.
- ai-analyze-permissionsUse when Claude Code keeps asking to approve commands you have already approved, when settings.local.json has grown large, or when you want to consolidate permission grants into wildcard patterns. Trigger for 'too many permission prompts', 'clean up permissions', 'audit my settings', 'consolidate allow rules'. Claude Code only — not available in GitHub Copilot, Antigravity, or Codex.
- ai-animationDesigns motion, transitions, and micro-interactions for UI components: spring animations, gestures, easing, staggers — taste-driven detail compounding. Trigger for 'animate this', 'add transitions', 'micro-interactions for', 'gesture design', 'swipe to dismiss', 'easing for this', 'stagger the'. Not for design systems; use /ai-design instead. Not for visual art; use /ai-visual instead. Not for testing animation code; use /ai-test instead.
- ai-autopilotDelivers large multi-concern specs and backlog runs autonomously: decomposes specs into sub-specs (or normalizes work items into a backlog DAG), deep-plans with parallel agents, builds a dependency DAG, implements in waves, runs a single final quality loop with one bounded quality-remediation pass (verify+guard+review on full changeset), delivers via PR. Trigger for 'implement spec-NNN end to end', 'autopilot this', 'autonomous delivery', 'decompose and ship', 'run the backlog', 'execute these GitHub issues', 'process the sprint backlog'. Invocation is the approval gate. Not for small or single-concern tasks; use /ai-build instead. Not for ambiguous requirements; use /ai-brainstorm first.
- ai-boardOperates the project board (GitHub Projects v2 or Azure DevOps): discovers configuration after install (fields, state mappings, process templates) and syncs work-item state at lifecycle transitions. Trigger for 'set up the board', 'configure our ADO board', 'discover board fields', 'move this issue to in-review', 'update the board', 'mark as in progress', 'sync the work item state'. Two subcommands: `discover` (post-install configuration write) and `sync` (lifecycle state transitions). Auto-invoked via `sync` by /ai-brainstorm, /ai-build, and /ai-pr; fail-open. Not for backlog execution; use /ai-autopilot --backlog instead.
- ai-brainstormForces rigorous design interrogation BEFORE any code: explores approaches, surfaces ambiguity, gathers evidence, produces an approved spec that becomes the contract for /ai-plan. Trigger for 'lets add X', 'how should we handle Y', 'whats the best approach', 'I am thinking about', 'what should we build for'. Not for existing approved specs; use /ai-plan instead. Not for execution; use /ai-build instead.
- ai-branch-cleanupCleans branches safely: switches to the default branch, prunes merged and squash-merged branches, syncs to remote, sweeps stale specs, rotates `.ai-engineering/runtime/` per retention policy. Trigger for 'tidy up', 'tidy branches', 'sync to main', 'delete old branches', 'start fresh', 'rotate runtime'. Auto-invoked by /ai-pr after merge. Not for committing changes; use /ai-commit instead. Not for code-level dead-code removal; use /ai-simplify instead.
- ai-buildCanonical implementation gateway: reads approved plan.md, resolves stack from manifest, deterministic-routes each task to its adapter, dispatches the build agent in an isolated worktree, runs TDD self-validation per task, then a single final quality loop with one bounded quality-remediation pass on the full changeset before /ai-pr. Trigger for 'go', 'start building', 'execute the plan', 'implement it', 'lets do this', 'build the plan', 'resume', 'continue'. Not without an approved plan; run /ai-plan first. Not for multi-concern specs needing decomposition; use /ai-autopilot instead. Not for a single function or subcomponent; use /ai-code.
- ai-codeWrites production code that satisfies stack-context standards on the first pass: interface-first design, backward-compatibility checks, lightweight self-review. Trigger for 'implement this', 'write the code for', 'add X to Y', 'build this function', 'make this work'. Not for tests; use /ai-test instead. Not for debugging; use /ai-debug instead. Not for refactoring; use /ai-simplify instead. Not for executing an approved plan end-to-end; use /ai-build (the gateway).
- ai-commitRuns the governed commit pipeline: auto-branches from protected, stages selectively, formats and lints, scans for secrets, gates docs, composes a conventional message, pushes. Trigger for 'commit my changes', 'save my work', 'push this to remote', 'stage these files', 'ship it'. Not for opening a PR; use /ai-pr instead. Not for branch hygiene; use /ai-branch-cleanup instead.