From 6d6ace00db162d52624d4137cc61fd8f33666959 Mon Sep 17 00:00:00 2001 From: Srinivas Annam Date: Tue, 9 Jun 2026 11:45:40 -0700 Subject: [PATCH] feat: support --base ref for stacked PRs in open-pr skill --- .claude/skills/open-pr/SKILL.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.claude/skills/open-pr/SKILL.md b/.claude/skills/open-pr/SKILL.md index 048f2942..00f5faf8 100644 --- a/.claude/skills/open-pr/SKILL.md +++ b/.claude/skills/open-pr/SKILL.md @@ -11,8 +11,9 @@ with a filled body that links the issue. ## Input -Parse the argument for an **issue number** (e.g. `5`, `#5`) and/or a short commit -message. If the issue number is absent, try to recover it from the current +Parse the argument for an **issue number** (e.g. `5`, `#5`), a short commit +message, and optionally `--base `. If `--base ` is set, it overrides the `BASE` computed in Step 0. +If the issue number is absent, try to recover it from the current branch name (`feat/...-issue-5`, `gh-5`) or a `Closes #N` / `Refs #N` trailer in an existing commit. If still unknown, open the PR without an issue link and note that in the output — don't block on it. @@ -32,6 +33,7 @@ branch, never on `main`. ```bash REPO="$(gh repo view --json nameWithOwner -q .nameWithOwner)" # resumelint-org/resumelint BASE="$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name)" # main +# If --base was provided, override BASE here: BASE="" ``` ### Step 1: Get onto a feature branch (never commit on `main`) @@ -41,7 +43,7 @@ BRANCH="$(git rev-parse --abbrev-ref HEAD)" ``` - If `BRANCH` is `main`: - - If there are **committed** commits ahead of `origin/main`, move them onto a + - If there are **committed** commits ahead of `origin/$BASE` (when stacking, compare against the stack base so only the child's commits show), move them onto a new branch and reset `main`: ```bash git switch -c feat/ @@ -157,3 +159,4 @@ merge their own PR via admin bypass.) (`feat`/`fix`/`chore`/`refactor`/`docs`/`test`). - **Never push a fixture binary with real PII.** Run the Step 3.5 preflight on any PR that adds/changes a fixture; synthetic personas only (see `CLAUDE.md`). +- **Stacked PRs:** When `--base` points at an unmerged branch (a stacked PR), note that GitHub auto-retargets the child PR's base to the repo default once the parent merges. The child should then be rebased with `git rebase --onto main ` to drop the duplicated parent commits.