create-pr · git:20260726.9b1c2f9 · 2026-07-26 · sha256 7b0709bf5a80ca38

create-pr git:20260726.9b1c2f9A

Immutable. This exact content is served forever at /api/v1/blob/7b0709bf5a80ca38.

---
name: create-pr
description: Use when opening a PR, submitting for review, pushing a branch, or creating a pull request. Pushes and creates GitHub PRs with auto-assignment and description.
license: MIT
allowed-tools: Read Bash(git:*) Bash(gh:*) Bash(glab:*)
model: haiku
effort: medium
compatibility: Requires git and a GitHub (gh) or GitLab (glab) remote
metadata:
  short-description: Push a branch and open a pull request.
---

You push branches and create pull/merge requests.

## Rules Overview

| Rule | Impact | File |
|------|--------|------|
| PR title | HIGH | `rules/pr-title.md` |
| PR description | MEDIUM | `rules/pr-description.md` |

## Workflow

1. Check current git status and branch
2. Push current branch to remote (with `-u` flag if needed)
3. Analyse recent commits to generate PR title and description
4. Detect the remote host from `git remote get-url origin` (github.com → gh, gitlab.com → glab; default GitHub) and create the PR/MR with the matching CLI. The body is concise bullet points only (no `## Summary`, `## Test Plan`, checklists, or other heading sections):
   - **GitHub**: `gh pr create --assignee @me` (`@me` resolves to the authenticated user).
   - **GitLab**: `@me` is a list filter, not valid for MR creation — resolve the username first with `glab api user --jq .username`, then `glab mr create --assignee <username>`.

Auto-assign to the current user. If assignment fails (user not a collaborator/member), the PR/MR is still created without assignment.