# Create PR

Creates a GitHub PR with a Linear-ticket-prefixed title and a decision-led, narrative...

- Repository: https://github.com/prisma/orm (47661 stars)
- Category: Git and review
- License: Apache-2.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add prisma/orm --skill create-pr -g -a claude-code -y`
Codex: `npx skills add prisma/orm --skill create-pr -g -a codex -y`
Cursor: `npx skills add prisma/orm --skill create-pr -g -a cursor -y`
Gemini CLI: `npx skills add prisma/orm --skill create-pr -g -a gemini-cli -y`

## Description

Creates a GitHub PR with a Linear-ticket-prefixed title and a decision-led, narrative description for Prisma 8. Use when the user wants to create a pull request, open a PR, or submit changes for review.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Create PR Skill

## Instructions

### Step 1: Gather Context

Detect the PR's base branch instead of hardcoding `main`. Set `BASE_BRANCH` once and reuse it in every diff/log command:

```bash
BASE_BRANCH=$(git rev-parse --abbrev-ref origin/HEAD 2>/dev/null | sed 's@^origin/@@')
BASE_BRANCH=${BASE_BRANCH:-main}
```

`git rev-parse --abbrev-ref origin/HEAD` returns the remote's default branch (e.g. `origin/main`); the `sed` strips the `origin/` prefix. The fallback to `main` covers repos where `origin/HEAD` is unset. If you know the PR was branched off a non-default branch, override `BASE_BRANCH` explicitly before running the commands below.

1. Run `git log "$BASE_BRANCH..HEAD" --oneline` to see all commits on the current branch (fallback: `git log "origin/$BASE_BRANCH..HEAD" --oneline`).
2. Run `git diff "$BASE_BRANCH...HEAD" --stat` to see which files changed (fallback: `git diff "origin/$BASE_BRANCH...HEAD" --stat`).
3. Run `git diff "$BASE_BRANCH...HEAD"` to read the full diff (fallback: `git diff "origin/$BASE_BRANCH...HEAD"`).
4. Check for local-only changes that won't be in the PR unless committed:
   - `git status -sb`
   - If there are uncommitted changes, explicitly call out that `gh pr create` can proceed but those changes will not be in the PR.

### Step 2: Resolve the Linear Ticket

Resolve the Linear ticket from context, **do not ask the user**. The ticket is almost always derivable from one of:

1. **The branch name.** Most branches are named `tml-NNNN-…` (lower-case form of the Linear identifier). The current ticket is whatever matches `(?i)\b(TML-\d+)\b` in `git rev-parse --abbrev-ref HEAD`. Use the trailing slug from the branch name verbatim as `$SLUG`.
2. **The conversation context.** If the user previously linked or named a ticket in this conversation, use that.
3. **The most recent commit messages on the branch.** Look for a `Refs: TML-NNNN` or `(TML-NNNN)` trailer / mention in `git log "$BASE_BRANCH..HEAD"`.

The rest: https://github.com/prisma/orm/blob/HEAD/skills-contrib/create-pr/SKILL.md
