| name | main-merge |
| description | Sync latest main into current branch with onboarding, safe merge, conflict resolution, and doc refresh. |
Main Merge
Overview
Run a predictable integration workflow that keeps branch intent intact while absorbing main updates.
Always gather onboarding evidence first, then merge, resolve conflicts, validate behavior, and refresh docs.
flowchart LR
A["Onboard Branch"] --> B["Preflight"]
B --> C["Merge origin/main"]
C --> D{"Conflicts?"}
D -- "No" --> E["Validate"]
D -- "Yes" --> F["Resolve Conflicts"]
F --> E
E --> G["Refresh Docs"]
G --> H["Delivery Brief"]
Workflow
-
Run branch onboarding first (required).
Delegate branch diff collection and risk briefing to branch-onboarding-brief.
Do not duplicate onboarding collection logic in this skill.
-
Run preflight checks.
Confirm repository state and block unsafe merges.
git rev-parse --is-inside-work-tree
git branch --show-current
git status --porcelain
git fetch origin main
If git status --porcelain is non-empty, stop and ask one targeted question before proceeding.
Do not auto-stash, reset, or discard changes.
- Merge
origin/main into the current branch.
git merge origin/main
- Resolve conflicts when merge reports
CONFLICT.
List unresolved files:
git diff --name-only --diff-filter=U
Follow references/conflict_playbook.md for resolution patterns.
If conflict intent spans multiple modules or boundaries are unclear, delegate localization to rpg-loop-reasoning in hybrid mode before editing files.
Use rg -n and focused tests to verify each resolved symbol.
When all conflicts are resolved:
git add <resolved-files>
git merge --continue
If git merge --continue fails in non-interactive shells with editor-related errors,
retry with:
GIT_EDITOR=true git merge --continue
-
Validate post-merge behavior.
Run the smallest meaningful checks first, then expand only for touched risk areas.
Prefer project commands when available (for example make test, targeted pytest, or lint).
Report only commands actually executed.
-
Refresh docs after code is stable.
Delegate documentation impact mapping and rewrite to refresh-branch-docs.
Apply the checklist in references/doc_refresh_checklist.md after delegation output is produced.
-
Deliver integration brief.
Include:
- merge result (clean/conflicted/resolved)
- resolved conflict files and strategy
- validation commands + results
- updated doc list with evidence anchors
Output Contract (chat)
- Put merge outcome first.
- Separate
Confirmed and Open Risks.
- Ask exactly one question only when blocked.
Cross-Skill Usage
branch-onboarding-brief: mandatory before merge.
refresh-branch-docs: mandatory after merge succeeds.
rpg-loop-reasoning: preferred when conflict intent spans multiple modules or needs dual-view (semantic + topology) resolution.
code-health: use when merge introduces large non-test churn or quality regressions.
Resources
references/conflict_playbook.md
references/doc_refresh_checklist.md