.opencode/skills/graphite-is-being-a-piece-of-shit-just-merge-my-stack/SKILL.md
Merge a stacked PR chain when Graphite automation is failing.
Input: A target branch in the stack (usually the top branch to merge through).
Goal: Merge all PRs from the bottom of that stack up to the target branch.
Resolve the target PR
gh pr list --state open --head "<target-branch>" --json number,headRefName,baseRefName,urlBuild the stack chain down to main
headRefName equals the current PR baseRefName.main or no parent PR exists.Determine merge order
[bottom, ..., target].For each PR in order
main before merge:
gh pr edit <pr-number> --base maingh pr merge <pr-number> --squash --delete-branch=falsegh pr checkout <pr-number>git fetch origin maingit rebase origin/maingit rebase --skip.GIT_EDITOR=true git rebase --continue when needed.git push --force-with-lease origin <head-branch>gh pr merge ... --squash.Verify completion
gh pr view <pr-number> --json state,mergedAt,url--force-with-lease, never --force.