Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Summary
Port the verified personal global command
~/.config/opencode/commands/resolve-branch-conflict.md into the
UF command set as .opencode/commands/uf.rebase-pr.md, invoked
as /uf.rebase-pr <PR_NUMBER>: rebases a conflicted PR's head
branch onto its base branch, resolves conflicts, and
force-pushes with lease so the PR can be merged with a rebase
once approved.
Why
- The capability lives only in a personal global command;
scaffolded UF repos do not receive it. /uf.finaleonly syncs the current feature branch pre-PR
(its step 4). Nothing addresses an already-open PR reporting
conflicts.- The source command is verified in daily use: takes a PR
number, rebases head onto base, handles fork remotes.
Command behavior (from the verified source)
- Arguments: PR number required, validated
^[1-9][0-9]*$
before any tool call; invalid → STOP. - Prerequisites:
which gh,gh auth status; repo detected
viagh repo view— never hardcoded. - Fetch PR:
gh pr view <N> --json number,title,state, headRefName,baseRefName,mergeable,mergeStateStatus, baseRepository,headRepository; STOP if CLOSED/MERGED or
already conflict-free (MERGEABLE+CLEAN). Record
HEAD_BRANCH,BASE_BRANCH,BASE_REPO,HEAD_REPO. - Checkout:
gh pr checkout <N>, with fallback to fetching
the head ref directly fromHEAD_REPO. - Remotes: resolve
BASE_REMOTE/HEAD_REMOTEby matching
git remote -vURLs against the PR's base/head repos — never
assumeoriginis the base repo. - Rebase:
git fetch <BASE_REMOTE>then
git rebase <BASE_REMOTE>/<BASE_BRANCH>. - Conflicts: resolve flagged files only, preserving the PR
author's intent; no guessing — STOP and offer
git rebase --aborton ambiguity. - Push:
git push --force-with-lease <HEAD_REMOTE> <HEAD_BRANCH>only; MUST NOT push to base or protected
branches. - Verify: re-check
mergeable/mergeStateStatus; report.
MUST NOT merge, approve, or close the PR.
Scope
-
.opencode/commands/uf.rebase-pr.md— full port following
uf.review-pr.mdconventions (frontmatter,<protect>,
session-resume guard) - Prefer existing git plugin tools (
git_fetch,git_rebase,
git_rebase_abort,git_push_force_with_lease) over raw
bash where available (determinism pack DE-001) - Scaffold mirror
internal/scaffold/assets/opencode/commands/uf.rebase-pr.md
(tool-owned asset; drift tests must stay green) -
AGENTS.mdPR Review Commands table:/uf.rebase-pr [N]—
Post-PR — rebase conflicted PR head onto base -
docs/usage.mdcommand reference entry -
make checkgreen
Notes
- Distinct from
/uf.finalestep 4: finale syncs the current
branch before creating its own PR; this command operates on
any open PR by number, fork-aware. - Source of truth for the port: the global command file
(personal config, not in any repo).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Type
Projects
- StatusShow more project fieldsNo status
Activity
spec(port-uf-rebase-pr): add opsx change artifacts
feat(rebase-pr): port resolve-branch-conflict command as uf.rebase-pr
docs(rebase-pr): document uf.rebase-pr command across surfaces
spec(port-uf-rebase-pr): add opsx change artifacts
feat(rebase-pr): port resolve-branch-conflict command as uf.rebase-pr
docs(rebase-pr): document uf.rebase-pr command across surfaces
spec(port-uf-rebase-pr): add opsx change artifacts
feat(rebase-pr): port resolve-branch-conflict command as uf.rebase-pr
docs(rebase-pr): document uf.rebase-pr command across surfaces