Home › Agent workflows › /pr-description slash command (Claude Code)

/pr-description slash command (Claude Code)

A Claude Code /pr-description command that drafts a pull request title and body from the branch diff, without pushing.

Claude Code (CLAUDE.md)Agent workflows

How to use

Save this as .claude/commands/pr-description.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

.claude/commands/pr-description.mdDownload  
---
description: Draft a PR title and description from the current branch's changes
allowed-tools: Bash(git diff:*), Bash(git log:*), Bash(git branch:*), Read, Grep
argument-hint: [base branch, default main]
---

## Context
- Current branch: !`git branch --show-current`
- Commits: !`git log --oneline main..HEAD`
- Files changed: !`git diff --stat main...HEAD`

## Task
If I passed a base branch ("$ARGUMENTS"), use it instead of `main` in the commands below and re-run them.

Read the diff (`git diff main...HEAD`) and the most important changed files, then write a pull request draft in Markdown. Do not push, open the PR, or run `gh` commands; just print the draft.

Use this structure:

**Title:** Conventional-style summary under 70 chars.

### What
2-4 sentences describing the change from the reviewer's point of view.

### Why
The problem or ticket this solves (link issue numbers found in commit messages).

### How to test
Exact commands and manual steps.

### Risk and rollout
Migrations, config/env changes, feature flags, breaking changes, performance concerns. Write "Low risk" with a reason if none.

### Screenshots
Placeholder only if UI files changed.

Keep it factual: describe only what is in the diff, and flag anything that looks unfinished (TODOs, commented-out code, missing tests) in a final "Notes for reviewers" list.

More: all Agent workflows rules · all Claude Code (CLAUDE.md) rules

Related rules

Code review Copilot instructions

Copilot instructions focused on pull request review: what to flag, severity labels, and how to word comments.

GitHub CopilotAgent workflows

Code review prompt file (Copilot)

A Copilot prompt file (/review-changes) that reviews the current changes and reports issues by severity without editing.

GitHub CopilotAgent workflows

Code reviewer subagent (Claude Code)

A Claude Code subagent definition that reviews the current diff for bugs, security, and tests, reporting by severity.

Claude Code (CLAUDE.md)Agent workflows

/commit slash command (Claude Code)

A Claude Code /commit slash command that reviews staged changes and writes a Conventional Commits message.

Claude Code (CLAUDE.md)Agent workflows

Context management for long agent sessions CLAUDE.md

CLAUDE.md practices for keeping Claude Code effective in long sessions: lean memory, notes files, subagents, and resets.

Claude Code (CLAUDE.md)Agent workflows

Git commits & PRs AGENTS.md

AGENTS.md rules for how agents commit: Conventional Commits, atomic changes, safe git commands, and PR descriptions.

AGENTS.mdAgent workflows

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.