create-pr · git:20260926.f1d668c · 2026-09-26 · sha256 255a0b5c882478cd
create-pr git:20260926.f1d668cA
Immutable. This exact content never changes and is served at /api/v1/blob/255a0b5c882478cd.
--- name: create-pr description: >- Open a pull request for a finished feature branch — or a fix left on the default branch itself (debug-issue's hand-off), which this skill branches off first: push it through the guard, link its issue, gate the title, and open it ready when the full test passes (a draft when asked, or when the test is red). Triggers: "open a PR for this branch", "create a pull request for my fix", "turn this branch into a PR", "I just fixed the flaky test on main, open a PR for it", « ouvre une PR pour ce correctif », « crée la pull request », « le correctif est commité, ouvre la PR ». Does NOT apply to merging a PR (merge-pr), building a planned issue (implement-issue), reviewing a diff (code-review), or filing an issue (create-issue). license: MIT compatibility: >- Requires an authenticated gh CLI with push rights, and git. Reads the committed repo profile (.claude/skills/repo-profile.md) generated by profile-repo. Commits leftover changes and pushes through implement-issue's guarded-commit.sh / guarded-push.sh, opens the PR through skills/_shared/open-pr.md, and — when the work came off the default branch — rewinds it through its own scripts/rewind-default.sh. metadata: author: Philippe Matray suite: tagout --- # Open a pull request for a finished branch ## What this does `implement-issue` opens its draft PR before any work lands. A branch built any other way — a fix committed by hand, a spike that turned out right, or a fix `debug-issue` left sitting on the default branch itself — needs a way to become a PR the way the kit expects. This skill is that way: `/create-pr [#<issue>] [--draft]` takes the work off the default branch first when that's where it sits, pushes it through the guard, decides ready or draft, and opens the PR through [`../_shared/open-pr.md`](../_shared/open-pr.md) — the one home of the existence lookup, the title gate and the create call. Then it hands off to `merge-pr`. ## Autonomy contract Run **hands-off** once started. See [ADR 0005](../../docs/adr/0005-the-lifecycle-skills-run-hands-off-triage-backlog-does-not.md) for the decision scope: pick the reasonable default, state the assumption, keep going. Stop only for a genuine blocker: - `gh` not authenticated, or no push rights. - A Step 2 refusal — a detached HEAD, a leftover `[DEBUG-` probe on the default branch, nothing ahead of it, a closed issue. Each one refuses before any write. A dirty tree no longer refuses — Step 2 commits it, through the guard. - A PR already open for this branch or its issue: report it, open none. - A guard exit that is not a success, or a readback that does not match — including `rewind-default.sh`'s exit 3 (the default is left ahead of `origin/$DEFAULT`, reported, never retried). A red *Full test* is not a blocker. It opens a draft and says why, so nobody merges it by mistake. ## Checklist Create a task per item and work them in order. 1. **Preconditions** — profile, `gh` auth, commit identity. 2. **Locate the work** — off the default branch first when that's where it sits, its issue, the refusals and the existing-PR lookup. 3. **Open** — guarded push, ready or draft, the body, the shared PR-open recipe, then rewind the default when Step 2 branched off it. 4. **Recap** — the shared closing shape ([`../_shared/recap.md`](../_shared/recap.md)), Next `/merge-pr #<pr>`. Resume-safe: a re-run finds the PR an earlier run opened (the recipe's §1) and stops on it. --- ## How to read this skill **One step file at a time, when you reach it — never all up front.** Every token loaded here is re-read on every later turn, so the step bodies live under `references/steps/`. Open a step when its checklist item starts; the shared references it names load the same way. - Step 1 — [`references/steps/01-preconditions.md`](references/steps/01-preconditions.md) · reads [`_shared/preconditions.md`](../_shared/preconditions.md) - Step 2 — [`references/steps/02-locate-the-work.md`](references/steps/02-locate-the-work.md) · reads [`_shared/open-pr.md`](../_shared/open-pr.md) - Step 3 — [`references/steps/03-open.md`](references/steps/03-open.md) · reads [`_shared/open-pr.md`](../_shared/open-pr.md), [`_shared/guard-invocation.md`](../_shared/guard-invocation.md) - Step 4 — [`references/steps/04-recap.md`](references/steps/04-recap.md) · reads [`_shared/recap.md`](../_shared/recap.md)