skills/merge-base/SKILL.md
Use for merging base into feature branch with conflict resolution.
npx skillsauth add lklimek/claudius merge-baseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Merge the remote base branch into the current feature branch with pre-merge analysis, intelligent conflict resolution, and a behavioral change report.
Output philosophy: Be concise. Show summaries, not diffs or source code. The user will ask for details if they want them. Never dump raw diffs, full file contents, or initial state unless explicitly requested.
Fetch all remotes and pull tracked branch changes (merge mode, never rebase).
CURRENT_BRANCH=$(git branch --show-current)
TRACKING=$(git rev-parse --abbrev-ref @{upstream} 2>/dev/null || echo "")
git fetch --all --prune
if [ -n "$TRACKING" ]; then
git pull --no-rebase
fi
If the pull produces conflicts, resolve them (see Phase 4) before continuing.
Determine the base branch from PR metadata using the git-and-github skill:
BASE_BRANCH=$(gh pr view --json baseRefName -q .baseRefName 2>/dev/null)
If no PR exists, fall back to the repo default branch:
BASE_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
If neither works, ask the user.
Use origin/$BASE_BRANCH (the remote-tracking ref, already updated by fetch) for the merge — not
the local base branch, which may be stale.
Understand both sides of the merge internally. Read the diffs and logs to build context for conflict resolution and behavioral analysis. Do NOT output diffs or source — only summaries.
MERGE_BASE=$(git merge-base origin/$BASE_BRANCH HEAD)
# Our changes
git log --oneline $MERGE_BASE..HEAD
git diff --stat $MERGE_BASE..HEAD
git diff $MERGE_BASE..HEAD
# Their changes
git log --oneline $MERGE_BASE..origin/$BASE_BRANCH
git diff --stat $MERGE_BASE..origin/$BASE_BRANCH
git diff $MERGE_BASE..origin/$BASE_BRANCH
Identify files modified on both sides:
comm -12 \
<(git diff --name-only $MERGE_BASE..HEAD | sort) \
<(git diff --name-only $MERGE_BASE..origin/$BASE_BRANCH | sort)
Also look for semantic overlaps — cases where there's no textual conflict but behavior changes (e.g., upstream changed a function signature or default value that local code relies on).
Report a brief summary to the user:
git merge origin/$BASE_BRANCH --no-edit
The merge commits automatically. Proceed to Phase 5.
Git will list conflicted files. For each one:
git add <file>| Area | Ours | Theirs | Resolution |
|---|---|---|---|
| function_name() | Added X | Changed Y | Combined: X + Y |
Ask for approval before continuing.
After all conflicts are resolved and the user approves:
git commit --no-edit
If the user rejects a resolution, apply their feedback and re-present.
This is the most important deliverable. Analyze the merge result for anything that could change runtime behavior. Read the merged files internally — do not dump diffs to the user.
Assign an overall Risk Factor (0-100%) reflecting the likelihood that the merge introduced unintended behavioral changes:
For conflicted files and files flagged under "Changes Requiring Attention", identify which upstream authors introduced the problematic changes. Only include authors whose changes directly caused conflicts or semantic issues — not every upstream contributor.
## Behavioral Change Report — Risk: <N>%
### Safe Changes
- <file> — <what changed, why it's safe>
### Changes Requiring Attention
- <file> — <what changed, potential impact>
### Relevant Upstream Contributors
| Author | Key Changes |
|---|---|
| @<github-handle> | <PR(s) that caused conflicts or semantic issues> |
### Recommended Follow-up
- [ ] <action items, if any>
Show safe changes first so the user can quickly confirm the routine stuff and focus attention on what matters. If the report is clean (risk ~0%), say so in one line and skip the sections. Only list contributors whose changes caused conflicts or semantic issues — skip unrelated authors.
If anything goes wrong mid-merge:
git merge --abort
Then report what happened and let the user decide how to proceed.
testing
Coordinator-only LLM validation pass. Adds ai_assessment / ai_verdict / ai_verdict_confidence and, in the rare partial-producer case, re-estimates absent risk/impact/scope on a consolidated v3 report.
testing
Use for typos or single-line fixes (≤20 lines). Same mandatory phase order (Planning→Impl→QA→LL), minimal ceremony. Auto-retry on failure.
testing
Use for bug fixes or small changes (≤200 lines). Same phase order as workflow-feature (Planning→Impl→QA→LL) with lighter ceremony. Auto-retry on failure, unattended.
development
Use for new projects, features, or major refactoring. Phases: Planning (Req→UX→Test Spec→Dev Plan) → Implementation → QA → Lessons Learned. Auto-retry on failure, unattended.