merge
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
Merge
Merge branches intelligently by understanding feature context and resolving conflicts efficiently.
Context
- Current branch: !
git branch --show-current - Working tree status: !
git status --short - Target branch: $1
- Recent commits: !
git log --oneline -5
Workflow
-
CONTEXT GATHERING:
git branch --show-currentto identify current branchgit statusto ensure clean working tree- CRITICAL: Abort if uncommitted changes exist
-
FEATURE ANALYSIS:
- Search PR with
gh pr list --head <branch-name> - Get PR details with
gh pr view <number> --json title,body,files - Use Task agents to gather context from PR/issue descriptions
- Search PR with
-
MERGE ATTEMPT:
git fetch origin <branch-name>git merge origin/<branch-name> --no-commit- Check status with
git status --porcelain
-
CONFLICT DETECTION:
- Clean merge:
git commitwith descriptive message - Conflicts: Parse
git diff --name-only --diff-filter=U
- Clean merge:
-
SMART RESOLUTION: For each conflicted file:
- Read file to understand conflict markers
- Apply resolution based on context:
- Feature additions: Keep both if non-overlapping
- Bug fixes: Prefer incoming if fixing known issue
- Refactors: Analyze intent and merge carefully
- Use MultiEdit to resolve all conflicts
- STOP: If >10 files conflicted, ask user
-
VERIFICATION:
git diff --cachedto review changes- Check no conflict markers remain:
grep -r "<<<<<<< HEAD" git add -Aand commit
Conflict Resolution by Type
- package.json: Merge dependencies, prefer higher versions
- Config files: Combine settings unless mutually exclusive
- Source code: Use PR/issue context to understand intent
- Tests: Keep all tests unless duplicates
- Imports: Merge all, deduplicate
Rules
- ALWAYS gather context before merging
- NEVER blindly accept theirs/ours without analysis
- ABORT if conflicts exceed 10 files
- Max 3 resolution attempts per file
- If stuck:
git merge --abortand report blockers
More from melvynx/aiblueprint
claude-memory
Create and optimize CLAUDE.md memory files or .claude/rules/ modular rules for Claude Code projects. Comprehensive guidance on file hierarchy, content structure, path-scoped rules, best practices, and anti-patterns. Use when working with CLAUDE.md files, .claude/rules directories, setting up new projects, or improving Claude Code's context awareness.
124ultrathink
Deep thinking mode - approach problems like a craftsman, obsess over details, and create elegant solutions
23apex
Systematic implementation using APEX methodology (Analyze-Plan-Execute-Validate) with parallel agents and self-validation. Use when implementing features, fixing bugs, or making code changes that benefit from structured workflow.
18fix-errors
Fix all ESLint and TypeScript errors with parallel processing using snipper agents
16prompt-creator
Expert prompt engineering for creating effective prompts for Claude, GPT, and other LLMs. Use when writing system prompts, user prompts, few-shot examples, or optimizing existing prompts for better performance.
15oneshot
Ultra-fast feature implementation using Explore → Code → Test workflow. Use when implementing focused features, single tasks, or when speed over completeness is priority.
14