home / skills / phrazzld / claude-config / pr

pr skill

/skills/pr

This skill creates a draft PR from the current branch, commits uncommitted changes, and writes a structured body with issue links for review.

npx playbooks add skill phrazzld/claude-config --skill pr

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.0 KB
---
name: pr
description: |
  Full PR workflow from working directory to draft PR.
  Commits uncommitted changes, analyzes diff, writes description, opens draft.
  Use when: opening a pull request, shipping to review, creating PR.
effort: medium
---

# /pr

Open a pull request from current branch state.

## Role

Engineer shipping clean, well-documented PRs.

## Objective

Create a draft PR from current branch. Link to issue, explain what/why/how.

## Latitude

- Stage and commit any uncommitted changes with semantic message
- Read linked issue from branch name or recent commits
- Write PR body that explains decisions, not just changes

## PR Body Requirements (MANDATORY)

Every PR body must contain all five sections. A PR missing any section is not ready.

```
## Summary
What changed and why it matters. Not a diff recap — explain the significance.
Link to the issue. State the problem this solves or the capability this adds.

## Changes
Concise list of what was done. Reference key files/functions.

## Acceptance Criteria
Copied or derived from the linked issue. Checkboxes.

## Manual QA
Step-by-step instructions a reviewer can follow to verify the change works.
Include: setup steps, exact commands, expected output, URLs to visit.

## Test Coverage
Pointers to specific test files and test functions that cover this change.
Note any gaps: what ISN'T tested and why.
```

## Workflow

1. **Clean** — Commit any uncommitted changes with semantic message
2. **Context** — Read linked issue, diff branch against main, identify relevant tests
3. **Describe** — Title from issue, body follows PR Body Requirements above
4. **Open** — `gh pr create --draft --assignee phrazzld`
5. **Comment** — Add context comment if notable decisions were made

## Comment Style

Like a colleague leaving context for future-you:
- **Concise** — No fluff
- **High-context** — Reference files, functions, decisions
- **Useful** — What's not obvious from the diff?
- **Human** — Some wit welcome

## Output

PR URL.

Overview

This skill creates a draft pull request from the current branch, handling uncommitted changes, writing a structured PR body, and opening the draft for review. It links to an issue when available and produces a concise, review-ready PR with required sections. Designed for engineers shipping clear, testable changes.

How this skill works

It stages and commits any uncommitted changes with a semantic message, inspects the branch name and recent commits to find a linked issue, and diffs the branch against main to identify relevant changes and tests. It then generates a PR title and a mandatory five-section body (Summary, Changes, Acceptance Criteria, Manual QA, Test Coverage), runs the gh command to open a draft PR, and posts a concise context comment if notable decisions were made.

When to use it

  • Opening a new pull request from your working branch
  • Shipping code for review or design feedback
  • Creating a draft PR that must link to an issue
  • When you need a structured PR body with QA and test notes
  • Before requesting reviewers to ensure completeness

Best practices

  • Keep commit messages semantic; the skill will stage and commit, but aim for clear, focused changes
  • Name branches to include issue IDs so the skill can auto-link issues
  • Ensure tests and manual QA steps are reproducible with exact commands and fixtures
  • Document noteworthy design decisions in the context comment for future readers
  • Run local tests before invoking the skill to surface failures early

Example use cases

  • You finished a feature branch and want a draft PR that links the issue and includes step-by-step QA
  • You have uncommitted fixes and want them committed and included in a review-ready draft
  • You want a PR body that highlights what changed, why it matters, and what remains untested
  • You need to open a draft PR quickly and assign it to the reviewer with a single command
  • You want the PR to include explicit acceptance criteria copied from the issue

FAQ

What if the branch has no linked issue?

The skill will attempt to infer context from recent commits and will prompt to include a link or short problem statement; it will still create the PR but flags missing issue linkage.

Can I customize the commit message the skill uses?

Yes. You can provide a semantic message; otherwise the skill generates one based on the changes and common conventions.

Will it run tests automatically?

No. The skill identifies relevant tests and references them in the PR body, but it expects you to run tests before creating the PR.