Assist with merging the commits from upstream into this branch starting from the provided GitHub tag or commit.
Provide the following when you invoke this prompt:
- Start ref (tag or commit) — REQUIRED (e.g.,
upstream/V_9_8_P1or a commit SHA) - End ref (commit) — OPTIONAL (default: HEAD - most recent upstream commit)
- CI grouping mode — REQUIRED (
presenceorsuccess): controls howGet-CommitGroupsdetermines batch boundaries.presence: Batches end at any commit that has CI runs (passing or failing). Smaller batches, faster iteration, recommended for most merges.success: Batches end only at commits with successful CI. Larger batches, fewer checkpoints, useful when upstream CI is mostly green and you want to minimize batch count.
- Upstream remote — optional (default:
upstream) - Windows fork remote — optional (default:
upstream-pwsh) - Target branch — optional (default: current branch)
Operating guidance:
- Use and follow merge-upstream.agent.md. Treat it as the primary operating guide.
- Rely on the provided for repository overview, setup, build, merge strategy, and testing. Do not re-fetch or re-search them; assume they are already attached in context.
- Use the two-phase merge workflow: (1) do ALL work on a scratch branch — incremental
git mergeat batch boundaries, conflict resolution, build fixes, and validation; (2) create the real merge branch from the same starting commit as the scratch branch, perform a singlegit mergeof the final upstream target, and resolve any conflicts by copying the already-resolved files from the scratch branch (git checkout scratch-branch -- <file>). Nogit rerere, no Save/Replay merge resolution tooling is needed. - Build using the MCP tools:
mcp_openssh-server_Start_OpenSSHBuild(Release; architecture defaults to the host machine — do not forcex64, and pass-AllowArchMismatchonly to intentionally cross-build). If the build fails, analyze withmcp_openssh-server_Test_OpenSSHBuild. - For validation, use
mcp_openssh-server_Test_OpenSSHFunctionality. - Track remaining work with
mcp_openssh-server_Get_RemainingCommitCount(commits from the current position to the end ref/HEAD). - After resolving each batch's conflicts, run
mcp_openssh-server_Test_MergeConflictMarkers(no leftover markers), hunt for silently auto-merged changes needing Windows work, runmcp_openssh-server_Sync_VersionResourceifversion.hchanged, then delegate the resolved diff to theconflict-reviewagent before continuing. - Read the
resolve-merge-conflictskill for conflict-resolution procedure and PR-summary structure; after the PR lands, run themerge-retrospectiveskill. - Apply Windows compatibility strategies as documented (prefer upstream changes and adapt for Windows — win32compat layer first, guard with
#ifdef WINDOWSonly when necessary; do not drag upstream's relocated logic back to its old location; update VS projects for build system changes). - Summarize a plan, request approval between batches, and clearly list conflict resolutions and rationale.
Expected outputs per batch:
- Planned commit range and rationale for the batch boundary
- Conflict resolutions (what, why, how), especially Windows-specific handling
- Build result summary and, on failure, parsed errors with applied fixes
- Next-step proposal and explicit ask to proceed
Quick start examples:
- "Merge from tag
upstream/V_9_8_P1into my current branch." - "Merge from tag
upstream/V_9_8_P1to commita1b2c3dinto my current branch." - "Merge starting at commit
3a1b2c3, upstream remoteupstream, target current branch." - "Merge from tag
upstream/V_10_0_P2toupstream/V_10_3_P1."
If the Start ref is not provided, ask for it before proceeding.
If the End ref is not provided, merging will continue to HEAD (most recent upstream commit).
If the CI grouping mode is not provided, ask the user to choose between presence (default recommendation) and success before invoking Get-CommitGroups.