git-gremlin:pr
Draft, publish, create. Match the user's language; keep technical identifiers unchanged.
Voice
Read ../../persona.md; it is canonical for this skill's user-facing output, and its scope ends at the final report.
Context
Auto-injected on Claude Code at skill load. If the line below still shows a raw,
unexpanded dynamic-context command, run it manually before step 1.
- Branch: !
git branch --show-current
Workflow
- Check the minimum preconditions.
- Verify
gh is available and authenticated with gh auth status.
- Infer the base branch with
gh repo view --json defaultBranchRef, falling back to
main.
- Stop on a detached
HEAD, when the current branch is the base branch, or when no
commits exist ahead of the base.
- Capture the current branch and
HEAD_OID = git rev-parse HEAD.
- Read
git log <base>...HEAD --oneline and git diff <base>...HEAD. Detect Linear
issue ids with /\b[A-Z][A-Z0-9]+-[0-9]+\b/, preferring the branch, then the log, then
the diff. When exactly one id is unambiguous, suffix the title with [<id>]; when
several ids remain ambiguous, add no suffix. Draft an imperative title no longer than
72 characters including any Linear suffix, preserving a useful conventional type or
scope from the commits. Draft a body with ## Summary and one to three bullets, then
## Test plan with a checklist, then Closes <id> on its own line when one unambiguous
Linear id was detected. Do not invent changes or verification absent from the inputs.
- If the user asked only for PR text, display it and stop. Otherwise display the title,
body, and
<branch> → <base>, then wait for confirmation or edits. This is the only
extra approval gate.
- After confirmation, verify that the branch and
HEAD_OID still match the proposal. If they
changed, regenerate it and ask again.
- Resolve the push remote in this order:
branch.<BRANCH>.pushRemote,
remote.pushDefault, branch.<BRANCH>.remote, origin, then the sole configured remote.
Stop if the result is local (.), missing, or ambiguous.
- Run
git push --set-upstream "<REMOTE>" "HEAD:refs/heads/<BRANCH>". Never force-push.
--set-upstream is what leaves the branch with an upstream: it is silently ignored on an
OID refspec, and push.autoSetupRemote only covers a push with no refspec, so a branch
pushed either of those ways has none and tooling that maps a branch to its PR finds
nothing. If the push fails, surface stderr verbatim and do not retry or create the PR.
- Verify what actually landed:
git rev-parse "<REMOTE>/<BRANCH>" must equal <HEAD_OID>.
On mismatch, stop without creating the PR and report both OIDs — the remote holds
something the user never approved.
- Run
gh pr create --head "<BRANCH>" --title "<TITLE>" --body "<BODY>" --base "<BASE>",
passing every value as a separately quoted argument without eval. If it fails,
surface stderr verbatim and do not retry. On success, capture the PR URL from stdout.
Hooks and CI own verification. This skill does not run checks, merge the PR, update issue or
project state, orchestrate follow-up work, or infer human acceptance unless the user asks for
that work separately.
Final Report
git-gremlin:pr report
PR: <url>
Title: <pr title>
Base: <base branch>
Branch: <branch> published via <remote>
Never
- Push during drafting or before the user confirms the displayed PR proposal.
- Push when the current branch or
HEAD differs from the approved proposal.
- Push the base branch, force-push, or choose between ambiguous remotes.
- Create a PR without explicit user confirmation.
- Retry silently after
git push or gh pr create failure.
- Run verification, merge, update external issue state, or invoke another workflow unless
the user asks separately.
1---2name: pr3description: Use automatically when the user asks to create, open, draft, or publish a GitHub PR, pull request, review request, "ouvre une PR", "fais la PR", "crée une pull request", or says the branch is ready for review. Drafts from branch history and, after confirmation, publishes the branch before creating the PR. Do not use for commits, plain git status, diff, log, push-only, rebase, or non-GitHub merge requests.4---56# git-gremlin:pr78Draft, publish, create. Match the user's language; keep technical identifiers unchanged.910## Voice1112Read `../../persona.md`; it is canonical for this skill's user-facing output, and its scope ends at the final report.1314## Context1516> Auto-injected on Claude Code at skill load. If the line below still shows a raw,17> unexpanded dynamic-context command, run it manually before step 1.1819- Branch: !`git branch --show-current`2021## Workflow22231. Check the minimum preconditions.24 - Verify `gh` is available and authenticated with `gh auth status`.25 - Infer the base branch with `gh repo view --json defaultBranchRef`, falling back to26 `main`.27 - Stop on a detached `HEAD`, when the current branch is the base branch, or when no28 commits exist ahead of the base.29 - Capture the current branch and `HEAD_OID = git rev-parse HEAD`.302. Read `git log <base>...HEAD --oneline` and `git diff <base>...HEAD`. Detect Linear31 issue ids with `/\b[A-Z][A-Z0-9]+-[0-9]+\b/`, preferring the branch, then the log, then32 the diff. When exactly one id is unambiguous, suffix the title with ` [<id>]`; when33 several ids remain ambiguous, add no suffix. Draft an imperative title no longer than34 72 characters including any Linear suffix, preserving a useful conventional type or35 scope from the commits. Draft a body with `## Summary` and one to three bullets, then36 `## Test plan` with a checklist, then `Closes <id>` on its own line when one unambiguous37 Linear id was detected. Do not invent changes or verification absent from the inputs.383. If the user asked only for PR text, display it and stop. Otherwise display the title,39 body, and `<branch> → <base>`, then wait for confirmation or edits. This is the only40 extra approval gate.414. After confirmation, verify that the branch and `HEAD_OID` still match the proposal. If they42 changed, regenerate it and ask again.435. Resolve the push remote in this order: `branch.<BRANCH>.pushRemote`,44 `remote.pushDefault`, `branch.<BRANCH>.remote`, `origin`, then the sole configured remote.45 Stop if the result is local (`.`), missing, or ambiguous.466. Run `git push --set-upstream "<REMOTE>" "HEAD:refs/heads/<BRANCH>"`. Never force-push.47 `--set-upstream` is what leaves the branch with an upstream: it is silently ignored on an48 OID refspec, and `push.autoSetupRemote` only covers a push with no refspec, so a branch49 pushed either of those ways has none and tooling that maps a branch to its PR finds50 nothing. If the push fails, surface stderr verbatim and do not retry or create the PR.517. Verify what actually landed: `git rev-parse "<REMOTE>/<BRANCH>"` must equal `<HEAD_OID>`.52 On mismatch, stop without creating the PR and report both OIDs — the remote holds53 something the user never approved.548. Run55 `gh pr create --head "<BRANCH>" --title "<TITLE>" --body "<BODY>" --base "<BASE>"`,56 passing every value as a separately quoted argument without `eval`. If it fails,57 surface stderr verbatim and do not retry. On success, capture the PR URL from stdout.5859Hooks and CI own verification. This skill does not run checks, merge the PR, update issue or60project state, orchestrate follow-up work, or infer human acceptance unless the user asks for61that work separately.6263## Final Report6465```text66git-gremlin:pr report67 PR: <url>68 Title: <pr title>69 Base: <base branch>70 Branch: <branch> published via <remote>71```7273## Never7475- Push during drafting or before the user confirms the displayed PR proposal.76- Push when the current branch or `HEAD` differs from the approved proposal.77- Push the base branch, force-push, or choose between ambiguous remotes.78- Create a PR without explicit user confirmation.79- Retry silently after `git push` or `gh pr create` failure.80- Run verification, merge, update external issue state, or invoke another workflow unless81 the user asks separately.