Prompt file imported from kavo-labs/kavo (
.claude/commands/pr.md). Fill in{{arguments}}before use. Copyright stays with the author.
Context
- Branch: !
git rev-parse --abbrev-ref HEAD - Working tree: !
git status --short - Commits on branch: !
git log main..HEAD --oneline - Remote: !
git remote -v | head -1 || echo "NO REMOTE" - Existing PR for this branch: !
gh pr view --json number,url,isDraft 2>/dev/null || echo "NO PR"
Your task
Push this branch and create or update its PR. Notes: {{arguments}}
-
Refuse to push if any of these hold — say which one, and stop:
- the branch is
main; - there is no GitHub remote;
- the working tree is dirty (commit with
/commitfirst); - there are no commits on the branch.
- the branch is
-
Run the gate for real:
pnpm check pnpm docs:linksIf build, typecheck,
depcruise, or the tests fail, stop and report the failure output. A red gate is never pushed, and never worked around. The same goes fordocs:links— it is a separate CI job, sopnpm checkpassing says nothing about it, and pushing without it means finding out from a red job instead of from a one-second local run. -
Push:
git push -u origin HEAD -
Create the PR, or update it if one already exists (see the context above):
-
No PR yet —
gh pr create. Use--draftif the user asked for a draft or if anything non-blocking is still open. The description should say:- What changed and why, in a short paragraph — not a file list.
Closes #<n>for the issue, so the merge closes it automatically. Get<n>from the branch name, which theconventionsskill fixes as<type>/<issue-number>-<short-slug>— theBranch:line in the context above is enough to read it off. If{{arguments}}names an issue explicitly (#123), that wins; if neither yields a number, say so and open the PR without the trailer rather than guessing one, since a wrongClosessilently closes someone else's issue on merge. A PR covering more than one issue gets oneCloses #<n>line each.- Public API impact — barrel changes, and whether they are breaking. Write "none" when there are none; do not omit the line.
- Testing — what was added, and the verified
pnpm checkresult. - Review notes — anything you want a reviewer to look at hardest, and any non-blocking findings deliberately left for later.
-
PR already exists — the push above already updated it with the new commits. Only touch the description if
{{arguments}}gives new notes or the existing body is now stale (e.g. the testing/review-notes sections no longer reflect the latest commits); update it withgh pr edit <n> --body "..."in that case. Do not needlessly rewrite an accurate description.
-
-
Print the PR URL and tell the user to run
/reviewon it or/mergeonce CI and review are green.
Do not merge here. /pr opens or updates the PR; /merge closes the loop.