|
| 1 | +--- |
| 2 | +name: fix-pr |
| 3 | +description: Fix or update the PR description for the current branch to follow best practices |
| 4 | +argument-hint: "[optional: PR number or URL]" |
| 5 | +allowed-tools: Bash, Read, Grep, Glob |
| 6 | +--- |
| 7 | + |
| 8 | +# Fix PR Description |
| 9 | + |
| 10 | +Review and fix the pull request description for the current branch, ensuring it follows the formatting and content standards from the `making-great-prs` skill. |
| 11 | + |
| 12 | +## Pre-fetched Context |
| 13 | + |
| 14 | +Current branch: !`git branch --show-current 2>/dev/null || echo "(not in a git repo)"` |
| 15 | + |
| 16 | +## Step 1: Identify the PR |
| 17 | + |
| 18 | +Based on **$ARGUMENTS**: |
| 19 | + |
| 20 | +- **No arguments**: Find the open PR for the current branch |
| 21 | +- **PR number or URL provided**: Use the specified PR |
| 22 | + |
| 23 | +## Step 2: Read Current PR State |
| 24 | + |
| 25 | +Fetch the current PR details (title, body, commits, changed files) so you understand: |
| 26 | + |
| 27 | +- What the PR currently says |
| 28 | +- What files were actually changed |
| 29 | +- What the commit history says about the changes |
| 30 | + |
| 31 | +## Step 3: Evaluate and Fix |
| 32 | + |
| 33 | +Check the PR against these standards (from the `making-great-prs` skill): |
| 34 | + |
| 35 | +### Title |
| 36 | + |
| 37 | +- Under 70 characters |
| 38 | +- Starts with a verb (Add, Fix, Update, Refactor, etc.) |
| 39 | +- Matches conventional commit style when applicable |
| 40 | + |
| 41 | +### Body Structure |
| 42 | + |
| 43 | +- Has a `## Summary` section with bullet points describing what changed and why |
| 44 | +- Has a `## Test plan` section with checkbox items for verification |
| 45 | +- Includes a session link if available |
| 46 | +- Uses proper markdown formatting with real newlines (no literal `\n`) |
| 47 | + |
| 48 | +### Body Content |
| 49 | + |
| 50 | +- Summary accurately reflects ALL commits on the branch, not just the latest |
| 51 | +- Test plan items are specific and actionable |
| 52 | +- No placeholder text or template remnants |
| 53 | + |
| 54 | +## Step 4: Update the PR |
| 55 | + |
| 56 | +Update the PR title and/or body with the corrected content. Show the user what changed. |
| 57 | + |
| 58 | +## Usage Examples |
| 59 | + |
| 60 | +```bash |
| 61 | +/fix-pr # Fix PR for current branch |
| 62 | +/fix-pr 300 # Fix PR #300 |
| 63 | +``` |
0 commit comments