# Pr Descr

> Update PR title and description from branch context. Triggers: 'pr description', 'update PR', 'PR title', 'describe PR'.

- Skill: `luan/pr-descr` (Agent Skill)
- Install (CLI): `npx skillmds@latest add luan/pr-descr`
- Raw SKILL.md: https://api.skillmd.com/api/skills/luan/pr-descr/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: luan (https://skillmd.com/u/luan)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/luan/pr-descr

---


# PR Description

Update an existing PR's title and description from branch context.

**Assumes PR already exists.** This skill NEVER pushes or submits.

## Context

Log: !`git log --oneline -10 2>/dev/null`
Status: !`git status -sb 2>/dev/null`
Template: !`cat .github/PULL_REQUEST_TEMPLATE.md 2>/dev/null`

## Step 1: Check State

Resolve at runtime:

- **PR**: `gh pr view --json number,title,body,headRefName -q '{number,title,headRefName}'`. If empty, tell user and stop.
- **BASE**: `gh stack view --json 2>/dev/null | jq -r '.trunk // empty' || gt parent 2>/dev/null || gt trunk 2>/dev/null || git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/||' || echo main`

`--auto` → skip edge case questions, assume committed changes only. Without `--auto`:

**Edge cases — ask before proceeding:**

- **On main:** "You're on main. Did you mean to be on a feature branch?"
- **Uncommitted changes:** "Describe from just committed, or include uncommitted too?"
- **No commits ahead:** "Branch has no commits ahead. Describe uncommitted changes?"

If state is clear, proceed directly.

## Step 2: Get Diff

```bash
git diff $BASE...HEAD        # three-dot finds common ancestor
```

If including uncommitted (per Step 1): `git diff HEAD`

If diff is large, use `--stat` first and read key files.

## Step 3: Generate Title and Body

**Title**: conventional commit per /commit skill — `type(scope): description`. Max 72 chars — GitHub truncates longer titles in list views.

**Body**: Follow the repo's PR template if one exists — fill each section from the diff. Otherwise, if recent merged PRs share a consistent format, match it. Fallback: 1-3 sentences explaining WHY with high-level HOW. Don't restate what's obvious from the diff.

## Step 4: Preview and Update

Show title + body. Add observations only if genuinely useful:

- WHY is unclear → ask user for context
- Unrelated changes mixed in → suggest splitting
- Too large for one review → suggest multiple PRs

`--auto` → update directly. Without `--auto` → AskUserQuestion: "Update PR with this title and description?"

```bash
gh pr edit <NUMBER> --title "<title>" --body "<body>"
```

Show PR URL when done.

