---
name: create-pr
description: Open one pull request as a draft, with a body the reviewer can act on.
metadata:
  credits:
    - skill: show-me
      author: Dex Horthy
      organisation: Humanlayer
      url: "https://github.com/humanlayer/skills/blob/main/plugins/show-me/skills/show-me/SKILL.md"
    - skill: pr
      author: Matt Pocock
      url: "https://github.com/mattpocock/skills/blob/main/skills/engineering/pr/SKILL.md"
    - skill: pr-screenshots
      author: Josh Goldberg
      organisation: Sentry
      url: "https://github.com/getsentry/skills/blob/main/skills/pr-screenshots/SKILL.md"
title: create-pr
canonical_url: https://skilld.dev/gh/jd-solanki/ai/create-pr
last_updated: 2026-11-20T00:05:11.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install jd-solanki/ai/create-pr`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/create-pr`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/jd-solanki/ai/create-pr) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/create-pr`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/create-pr --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/create-pr --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Create PR

Read `/writing-for-humans` skill first. It carries the title, the shape, the evidence
rules, and the de-slopping pass. This skill adds only what a pull request needs on
top.

The work is already written and committed. This turns it into a pull request a
reviewer can act on. It opens as a **draft**. Marking it ready for review is the
author's call, never yours.

## The body carries what the diff can't

The diff is already open in the reviewer's tab. Anything they can read there is not
your job to restate: bullets that say "adds X", "moves Y", "renames Z" pad the body
without giving the reviewer something new. The body is these sections, in this order:

1. `## What problem this solves` — the issue that already exists, or the feature
   that is missing. What was true before, and what forced the change: the trigger,
   the report, the deadline, the security note.
2. `## How this PR solves it` — the idea holding the lines together, and the
   alternative you rejected. The reviewer reads the diff for the lines; they read
   this for the shape, so show it: see **Show the shape**.
3. `## Screenshots and videos` — only when the diff changes what a user sees; a pull
   request with no UI change has no such section. See **Screenshots and videos**.
4. `## What happens when this merges` — the effect downstream. Behaviour that
   changes for users, a migration that has to run, a follow-up this unblocks. Name
   the **door**: one-way when the merge is hard to walk back (a destructive
   migration, a published contract, deleted data), two-way when a revert undoes it.
   Then the **blast radius**: what breaks if the change is wrong (consumers, layout,
   mobile, a scheduled job).
5. `## QA steps` — how a person tries the change by hand before it merges: the QA
   scenarios `/write-qa-scenarios` writes for this change, happy and unhappy paths,
   each an unticked checkbox. Whoever tries a scenario and sees it pass ticks its box.
6. `## Notes` — what a careful reader still cannot infer from the diff after
   reading it. Invariants that hold across the change, a decision that looks
   arbitrary but was deliberate, a gotcha that will trip the next person, a
   constraint from outside the repo.

Anything belonging to none of them gets its own section after them, named the way a
colleague would name it.

Every section survives on the test "could the reviewer figure this out from the diff
alone?" A section that fails comes out rather than getting padded. What problem this
solves and QA steps stay regardless — the reason for a change and how to try it are
never in the diff — so a body carrying only those two is a fine pull request.

## Show the shape

Pick the smallest visual that makes the approach clear, and place it beside the
sentence it supports. Usually one, sometimes two:

- Logic or an algorithm: pseudocode.
- Runtime control flow: a call tree.
- UI structure: a component tree, with the state and module boundaries that matter.
- File responsibilities or a broad refactor: a shallow file tree, one comment per
  folder.
- Interaction or data flow between parts: a Mermaid diagram.
- A change to a shape that already exists: a `diff` block of that tree or flow.

```diff
 submitForm
   createSession
     persistPrompt
+    expandSkillMention
     launchAgent
```

Keep only the calls, files and boundaries the reviewer needs to see the idea. A
visual that copies the code diff fails the diff-alone test like any bullet.

## Screenshots and videos

Pixels are the one thing a UI diff cannot show. Capture them with `/capture-media`, purpose
**showcase**, from the running app: it picks the media this change needs, highlights, before /
after screenshots, a video for a flow, and hides personal data. Capture them on every run of this
skill, so the media always shows the code being reviewed.

Lay them out with any highlight first, then one row per surface and state:

```markdown
| Location | Before | After |
| --- | --- | --- |
| Explore › Logs | ![Explore › Logs before](./shots/logs-before.png) | ![Explore › Logs after](./shots/logs-after.png) |
| Explore › Logs, loading | ![Explore › Logs, loading before](./shots/logs-loading-before.png) | ![Explore › Logs, loading after](./shots/logs-loading-after.png) |
```

- **Location** is a `›` breadcrumb to the surface, then the state after a comma. Trace the
  changed components to every page, drawer or modal that renders them, and every state the
  change touches.
- A surface that is new gets `—` for Before.
- A video goes on its own line under its row or highlight, since a table cell does not play it.
- Save the files to `shots/` in a temp directory, beside the body file. Step 5 uploads them.

## Read the diff, don't imagine it

`git diff <base>...HEAD` and `git log <base>..HEAD` before you write a word.

Every claim in the body traces back to a line you read. A body that describes a
change the diff does not contain costs the reviewer more than an empty body:
they have to find the lie before they can start reviewing.

Reading the diff also settles which sections are real. If a bullet you drafted
turns out to sit in plain view of the diff, it fails the test and comes out.

## The title becomes history

Your title is the line the squashed merge commit carries, so write it for
`git log`.

## Link the ticket

`Closes owner/repo#123` at the bottom of the body, so merging closes the ticket. Reference
the ticket by ID rather than pasting a link: some trackers put private detail in
the URL.

No ticket exists? Write the body anyway and leave the line off. Do not open a
ticket just to link it.

## Length

One change per PR. A refactor and a fix in the same diff make the reviewer grade
two things at once, and they will do both worse.

## Process

### 1. Check where you are

You need a branch that is not the default one, and a clean tree with your work
committed. On the default branch, or holding uncommitted changes? Say so and
stop.

**Done when:** you know the base branch, the current branch, and that nothing is
uncommitted.

### 2. Read the change

The diff, the log, and the ticket it closes.

**Done when:** from what you read, you can state the problem, the approach, the
downstream effect with its door and blast radius, the QA scenarios a reviewer will try,
every Note you plan to include, and, for a UI change, every highlight and every row
of the screenshots and videos.

### 3. Draft the body

Title, then the sections in order, then any section that fits none of them,
then the ticket line. Drop a section that fails the diff-alone test rather than
filling it.

### 4. Clean it up

Run the draft through `/writing-for-humans`: the title, the evidence, the secrets
check, and the humanizer pass. Extra tells in a pull request:

- A bullet per file that only restates the filename.
- A second section of checks beside `## QA steps` (`How you know`, `Verification`).
  Fold it into QA steps, or cut it if it only restated the diff.

### 5. Open it

Push the branch and open the pull request **as a draft**:

```shell
gh pr create --draft --base <base> --title "<title>" --body "<body>"
```

With screenshots or videos, pass the body as `--body-file <dir>/body.md` and add
`--attach ./shots/<file>` per file, run from `<dir>`: `gh` uploads each one and
rewrites its reference in the body to the hosted asset. Editing an existing body works
the same way with `gh pr edit <n> --body-file <dir>/body.md --attach ./shots/<file>`.

Return the link, and say plainly that it is a draft waiting for them to mark it
ready for review.

Labels go on after it exists (`gh pr edit <n> --add-label ...`), and only labels
the repo already has.

## Where it goes

GitHub through the `gh` CLI is the fallback. Before you settle for it, check
`git remote -v`: GitLab takes `glab`, where the draft flag is `--draft` on
`glab mr create`.

A repo pull request template at `.github/pull_request_template.md` is the house
style, and it wins. Fill its sections; sections that do not apply to this change
come out rather than getting padded. A template with no QA section still gets
`## QA steps`, after its own sections.

## Boundaries

Opens the pull request. Reviewing it, merging it, and marking it ready for review
belong to a person.
