git-merge-main/SKILL.md
Merge origin/main into the current branch and resolve all conflicts. Use when the user wants to sync their branch with main, pull in upstream changes, or says "merge in main", "sync with main", "rebase from main", or "update from main". Always invoke this skill for merge/sync workflows — don't just run git merge manually.
npx skillsauth add paulund/skills git-merge-mainInstall 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.
git fetch origin main && git merge origin/main --no-edit
If the merge succeeds cleanly, skip to step 4.
If there are conflicts, git diff --name-only --diff-filter=U lists the conflicted files. Resolve them all before continuing.
Read every conflicted file before editing. For each conflict, decide which strategy applies:
Lock files — always take theirs, then reinstall:
pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lockb: git checkout --theirs <file>, then run the package manager install (see step 3).Config/manifest files (package.json, pyproject.toml, etc.):
Read both sides of the conflict marker. Usually the right answer is to include both sides' additions (e.g. a new dependency from each branch). Resolve manually, keeping all new entries from both sides.
Source files — prefer the better pattern: Read the diff carefully. Take whichever side represents an improvement:
logger.error) over raw console.error/console.logtry/catch with error handling over bare async callsgetErrorMessage(err) over inline err instanceof Error ? err.message : String(err)When both sides are equally valid, prefer origin/main to stay aligned with the shared baseline.
After editing each file, verify no <<<<<<<, =======, or >>>>>>> markers remain.
If package.json or any lock file was part of the conflict resolution:
pnpm install --frozen-lockfile=false
git add <all resolved files>
git commit -m "Merge origin/main"
Use git commit without --no-edit so the default merge message is used. Don't amend — create the commit fresh.
pnpm test
If tests fail, fix the root cause before presenting the work as done.
git merge -X theirs — it blindly discards work from the current branch.git reset --hard to escape conflicts; investigate and resolve them.origin/main and flag it to the user.development
Use when the user wants to run the project's lint + types + build sequence as a gate before pushing, opening a PR, or merging. Invoked by chained dev skills between phases. Trigger phrases - "/quality-gate", "run the quality gate", "check it builds".
tools
Use when the user wants to verify a PR's feature works at runtime by booting the dev server, exercising the affected UI via Chrome DevTools MCP, and posting a screenshot summary back to the PR. Idempotent — skips if `verified` or `verify-failed` is already on the PR. Trigger phrases - "/pr-verify", "verify this PR", "runtime check the pr".
testing
Use when the user wants a security-focused review pass on a PR with findings actioned as commits on the same branch. Trigger phrases - "/pr-security-review", "security review and fix".
testing
Use when the user wants to open a pull request for an already-pushed branch that implements a specific issue. Idempotent — returns the existing PR if one is already open for the branch. Trigger phrases - "/pr-open", "open the pr", "create pr for this branch".