---
name: create-pr
description: >-
  Opens (or updates) a pull request with a conventional title, an evidence-backed description, and a real verification checklist — resolving the base branch from evidence, attaching screenshots via the GitHub CLI when the change is visible in the UI, and asking rather than guessing at every genuine judgment call. Use when asked to "open a PR", "create a pull request", "push this and make a PR", "ship this branch", or to fix up an existing PR's title, description, or checklist.
metadata:
  author: eagerworks
  version: "1.2.0"
title: create-pr
canonical_url: https://skilld.dev/gh/eagerworks/skills/create-pr
last_updated: 2026-10-22T18:01:40.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.
>
> Supporting files, fetch one when the Skill refers to it: [assets/create-pr.example.json](https://skilld.dev/api/skills-raw/eagerworks/skills/create-pr/assets/create-pr.example.json), [assets/pr-description.template.md](https://skilld.dev/api/skills-raw/eagerworks/skills/create-pr/assets/pr-description.template.md), [CHANGELOG.md](https://skilld.dev/api/skills-raw/eagerworks/skills/create-pr/CHANGELOG.md), [README.md](https://skilld.dev/api/skills-raw/eagerworks/skills/create-pr/README.md), [references/base-branch.md](https://skilld.dev/api/skills-raw/eagerworks/skills/create-pr/references/base-branch.md), [references/config.md](https://skilld.dev/api/skills-raw/eagerworks/skills/create-pr/references/config.md), [references/description.md](https://skilld.dev/api/skills-raw/eagerworks/skills/create-pr/references/description.md), [references/manual-test-cases.md](https://skilld.dev/api/skills-raw/eagerworks/skills/create-pr/references/manual-test-cases.md), [references/screenshots.md](https://skilld.dev/api/skills-raw/eagerworks/skills/create-pr/references/screenshots.md), [references/workflow.md](https://skilld.dev/api/skills-raw/eagerworks/skills/create-pr/references/workflow.md).
>
> If the user asked to install this Skill, run `npx skilld install eagerworks/skills/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/eagerworks/skills/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 Pull Request Skill

Opens a pull request for the current branch, or updates one that's already open. Unlike a read-only review skill, this one **mutates**: it can commit pending work, push the branch, and create or edit a PR on GitHub. It still never guesses on a genuine judgment call — base branch, an existing repo PR template, and an unavailable screenshot are all resolved by evidence or by asking, never assumed.

**Mutation posture.** Committing, pushing, and creating/editing the PR are the point of this skill, so they don't need a separate confirmation once the user has asked for a PR — but stop and confirm before pushing or opening anything if the request was ambiguous about whether to actually ship (e.g. "help me write a PR description" is not "open the PR").

## Preflight — Do This First

```bash
git branch --show-current                          # never open a PR while standing on the base branch
git status                                          # anything pending that needs a commit first?
gh pr view --json number,url,baseRefName 2>/dev/null # a PR may already exist for this branch — edit, don't duplicate
gh --version                                        # gates screenshot attachment: needs >= 2.99.0, see references/screenshots.md
```

If `gh pr view` succeeds, this is an **edit**, not a create — see `references/workflow.md` → "When a PR already exists".

## Base Branch

Never guess. In order: (1) an already-open PR's actual base; (2) `.eagerworks/create-pr.json` → `baseBranch`; (3) `git config branch.<current>.gh-merge-base`; (4) the branch's fork point via `git reflog`, only if it resolves to exactly one candidate; (5) ask, listing real candidates. **The repo's default branch is not the base by default** — plenty of repos merge into `staging` or `develop`, not `main`. Full ladder and anti-patterns: `references/base-branch.md`.

## Description

Default structure, in order: `Summary` → `Problem` → `Solution` → `Screenshots`/`Demo` (required when the change is UI-visible) → `Test plan` → `Checklist`. `Test plan` splits into `### Automated` (commands and observed results) and `### Manual` (tickable, self-contained scenarios for whoever reviews the PR's quality — `references/manual-test-cases.md`). If the repo has its own `.github/pull_request_template.md`, **ask** whether to use it as-is or replace it with this structure — never decide silently either way. Every paragraph is one line in the source (GitHub wraps it for display); never hand-wrap at 80/100 columns. The checklist has no fixed core — it's derived from tooling actually detected in the repo, or from `.eagerworks/create-pr.json`. Full detail: `references/description.md`.

## Screenshots

Required when the diff touches a UI path and none is available yet. Look for one in this order: a path the user gave, an e2e artifact already on disk, a live capture (only with confirmation), then ask and leave an explicit placeholder. Attach with the GitHub CLI's `--attach` flag (`gh` ≥ 2.99.0) — reference the file in the body so the URL lands in place. Never fabricate an image URL and never use an undocumented upload endpoint. Full detail, version gate, and the exact commands: `references/screenshots.md`.

## Reference Files (read these on demand)

| Task | Read |
|---|---|
| End-to-end flow: preflight, commit, push, create, fix up assignee/labels, editing an existing PR | `references/workflow.md` |
| Resolving which branch to open the PR against | `references/base-branch.md` |
| Description structure, PR-template handling, the no-hand-wrap rule, deriving the checklist | `references/description.md` |
| Getting and attaching screenshots, the `gh` version gate, the placeholder rule | `references/screenshots.md` |
| Deriving manual test cases, scenario and step shape, the applicability rule | `references/manual-test-cases.md` |
| The optional `.eagerworks/create-pr.json` config schema | `references/config.md` |

Copyable templates live in `assets/`:
- `assets/create-pr.example.json` — starter config, with a Rails and a Node example
- `assets/pr-description.template.md` — copyable description skeleton, including a commented manual-scenario skeleton

## Critical Gotchas

1. **This skill mutates, unlike a read-only review skill** — but only in service of the PR the user actually asked for. If it's unclear whether they want it opened now or just drafted, ask before pushing or calling `gh pr create`.
2. **Never open a PR while standing on the base branch.** Check `git branch --show-current` first.
3. **Never guess the base branch.** If the open PR, the config, `gh-merge-base`, and the fork point don't converge on one branch, ask — see `references/base-branch.md`.
4. **Never hand-wrap paragraphs.** Always pass the body with `--body-file`; never `--body "...\n..."` with escaped newlines.
5. **Never tick a checklist box for something that wasn't actually run or added.** An inapplicable item keeps its own wording and appends `— N/A, <reason>`; it's never silently deleted or replaced with a bare `N/A — <reason>`.
6. **Never invent an image or video URL, and never commit a screenshot into the repo just to reference it.** No screenshot available yet means an explicit placeholder and a question to the user, not a guessed link or a binary added to git history — see `references/screenshots.md`.
7. **A PR already open for this branch gets edited, never duplicated.** `gh pr edit`, not a second `gh pr create`.
8. **Never invent labels.** Pick only from `gh label list`; an empty label set beats a wrong one.
9. **Don't paste the whole diff into the description.** Summarize what matters; `git diff --stat` and `git log --oneline` are for your own context, not the PR body.
10. **PR title and description language is configured, not inferred.** Write in `pr.language` (default English) regardless of what language the conversation is in, unless the user explicitly names a language for this one PR — see `references/config.md`.
11. **Never fabricate a manual test step, a credential, or a scenario the diff doesn't support.** An unknown (a staging URL, a test account) becomes a `TODO(author):` line, not a guess; manual test boxes always ship unticked — see `references/manual-test-cases.md`.
