|
| 1 | +--- |
| 2 | +name: get-pr-comments |
| 3 | +description: Fetch and display comments from the active PR for the current branch. Use when the user asks for PR comments, review feedback, or "get pr comments" / "apply this skill". |
| 4 | +--- |
| 5 | + |
| 6 | +# Get PR Comments |
| 7 | + |
| 8 | +Fetch and display comments from the **active pull request** for the current branch (Cursor Team Kit style). |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## Steps |
| 13 | + |
| 14 | +1. **Check `gh` CLI** — Verify the GitHub CLI is available (`gh --version` or `where gh`). If not, tell the user to install [GitHub CLI](https://cli.github.com/). |
| 15 | + |
| 16 | +2. **Check for an open PR** — Run: |
| 17 | + ```bash |
| 18 | + gh pr view --json number,url,title |
| 19 | + ``` |
| 20 | + - If no PR exists for this branch, inform the user: *"There is no open PR for this branch."* |
| 21 | + - If a PR exists, continue. |
| 22 | + |
| 23 | +3. **Fetch PR comments and reviews** — Run: |
| 24 | + ```bash |
| 25 | + gh pr view --json comments,reviews |
| 26 | + ``` |
| 27 | + Optionally for full thread context: |
| 28 | + ```bash |
| 29 | + gh pr view --json comments,reviews,reviewRequests |
| 30 | + ``` |
| 31 | + |
| 32 | +4. **Display in a readable format**: |
| 33 | + - **Review comments**: author, date, body (and path/line if present). |
| 34 | + - **General PR comments**: author, date, body. |
| 35 | + - Group by review thread where applicable. |
| 36 | + |
| 37 | +5. **Summarize** — Briefly summarize reviewer feedback and any **action items** or requested changes. |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## When to use |
| 42 | + |
| 43 | +- User says "get PR comments", "show PR feedback", "what did reviewers say?", or "apply get-pr-comments". |
| 44 | +- Before addressing review feedback or merging. |
| 45 | +- When preparing a response to reviewers. |
| 46 | + |
| 47 | +## Requirements |
| 48 | + |
| 49 | +- **GitHub CLI** (`gh`) installed and authenticated (`gh auth status`). |
| 50 | +- Current branch must have an open PR. |
0 commit comments