Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 27 additions & 110 deletions github/pr-threads-address/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,33 @@ metadata:
license: MIT
---

# /pr-threads-address
## Prerequisites

**Usage:** `/pr-threads-address [PR_NUMBER]`
### gh pr-review extension

**Description:** Review all unresolved PR review threads, address them by making necessary code changes, and commit the changes appropriately.
Before using this command, check if the gh pr-review extension is installed:

**Note:** If `PR_NUMBER` is omitted, the command will automatically detect and use the PR associated with the current branch.
```bash
gh extension list | grep -q pr-review || gh extension install agynio/gh-pr-review
```

### Resolve PR context

Every `gh pr-review` subcommand requires both `--pr <number>` and `--repo <owner/repo>` — do not omit either. Look the values up once at the start of the workflow and substitute the literal numbers and slugs into every later command.

Get the PR number for the current branch:

```bash
gh pr view --json number -q .number
```

Get the repository slug:

```bash
gh repo view --json nameWithOwner -q .nameWithOwner
```

Then pass the resulting values directly — e.g. `--pr 42 --repo posit-dev/skills` — on every subsequent `gh pr-review` call in this workflow (review view, comments reply, threads resolve, etc.).

## Workflow

Expand All @@ -27,32 +47,6 @@ license: MIT
4. Report back with a summary of addressed threads
5. Ask if the user wants to resolve the threads. If so, reply to each thread indicating what was done and then resolve the thread.

## When to use

Use this command when you have received PR review feedback and need to systematically address all unresolved threads before the PR can be merged.

## Example

```
/pr-threads-address 42
```

This will:
- View unresolved threads on PR #42
- Make code changes to address each thread
- Create commits for the changes
- Reply to reviewers with explanations
- Provide a summary of all addressed items
- Ask if you want to resolve the threads

## Prerequisites

Before using this command, check if the gh pr-review extension is installed:

```bash
gh extension list | grep -q pr-review || gh extension install agynio/gh-pr-review
```

## CLI Reference

### View PR Reviews and Comments
Expand All @@ -66,100 +60,23 @@ gh pr-review review view --pr <number> --repo <owner/repo>
**Common filters:**

- `--reviewer <login>` — Filter by specific reviewer
- `--states <list>` — Filter by review state (APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED)
- `--states <list>` — Comma-separated review states (APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED)
- `--unresolved` — Show only unresolved threads
- `--not_outdated` — Exclude outdated threads
Comment thread
schloerke marked this conversation as resolved.
- `--tail <n>` — Show only the last n replies per thread
- `--include-comment-node-id` — Include GraphQL node IDs for replies

**Examples:**

```bash
# View all unresolved comments
gh pr-review review view --pr 42 --unresolved --repo owner/repo

# View comments from a specific reviewer
gh pr-review review view --pr 42 --reviewer username --repo owner/repo

# View only change requests, excluding outdated threads
gh pr-review review view --pr 42 --states CHANGES_REQUESTED --not_outdated --repo owner/repo
```

### Reply to Review Threads

Respond to specific review comment threads:

```bash
gh pr-review comments reply --thread-id <PRRT_...> --body "<reply-text>" --repo <owner/repo> --pr <number>
```

**Multi-line replies** use heredoc syntax:

```bash
gh pr-review comments reply --thread-id PRRT_xyz789 --body "$(cat <<'EOF'
Fixed in commit abc123.

The changes include:
- Updated function signature
- Added error handling
- Updated tests
EOF
)" --repo owner/repo --pr 42
```
For multi-line replies, pass `--body "$(cat <<'EOF' ... EOF\n)"` heredoc syntax.

### Resolve a Thread

```bash
gh pr-review threads resolve --thread-id <PRRT_...> --pr <number> --repo <owner/repo>
```

### Start a Pending Review

Create a new pending review to add comments before submission:

```bash
gh pr-review review --start --pr <number> --repo <owner/repo>
```

This returns a review ID (format: `PRR_...`) needed for adding comments.

### Add Review Comments

Add inline comments to a pending review:

```bash
gh pr-review review --add-comment --review-id <PRR_...> --path <file-path> --line <number> --body "<comment-text>" --repo <owner/repo>
```

**Flags:**

- `--review-id` — Review ID from `--start` command (required)
- `--path` — File path in the repository (required)
- `--line` — Line number for the comment (required)
- `--body` — Comment text (required)

### Submit a Review

Finalize and submit a pending review:

```bash
gh pr-review review --submit --review-id <PRR_...> --event <EVENT_TYPE> --body "<summary>" --repo <owner/repo>
```

**Event types:**

- `APPROVE` — Approve the changes
- `REQUEST_CHANGES` — Request changes before merging
- `COMMENT` — Submit general feedback without explicit approval

## Usage Notes

1. **Repository Context**: Always include `--repo owner/repo` to ensure correct repository context, or run commands from within a local clone of the repository.

2. **Thread IDs**: Thread IDs (format `PRRT_...`) can be obtained from `review view --include-comment-node-id` or `threads list` commands.

3. **Review IDs**: Review IDs (format `PRR_...`) are returned by the `review --start` command and must be used for adding comments to that review.

4. **State Filters**: When using `--states`, provide a comma-separated list: `--states APPROVED,CHANGES_REQUESTED`

5. **Unresolved Focus**: Use `--unresolved --not_outdated` together to focus on actionable comments that need attention.
Thread IDs (format `PRRT_...`) come from `review view --include-comment-node-id`.
91 changes: 25 additions & 66 deletions github/pr-threads-resolve/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,106 +8,65 @@ metadata:
license: MIT
---

# /pr-threads-resolve

**Usage:** `/pr-threads-resolve [PR_NUMBER]`

**Description:** Bulk resolve unresolved PR review threads. Useful after manually addressing threads or after using `/pr-threads-address`.

**Note:** If `PR_NUMBER` is omitted, the command will automatically detect and use the PR associated with the current branch.

## Workflow

1. Fetch and display all unresolved PR review threads
2. Show thread details (file, line, comment text)
3. Ask for confirmation or allow selective resolution
4. Resolve the confirmed threads
5. Report back with a summary of resolved threads

## When to use
## Prerequisites

Use this command when you have already addressed PR review threads and want to bulk resolve them, or when you need to clean up threads that are no longer relevant.
### gh pr-review extension

## Example
Before using this command, check if the gh pr-review extension is installed:

```
/pr-threads-resolve 42
```bash
gh extension list | grep -q pr-review || gh extension install agynio/gh-pr-review
```

This will:
- List all unresolved threads on PR #42
- Show what each thread is about
- Ask which threads to resolve (all or specific ones)
- Resolve the selected threads
- Provide a summary of resolved items
### Resolve PR context first

## Prerequisites
Every `gh pr-review` subcommand requires both `--pr <number>` and `--repo <owner/repo>` — do not omit either. Look the values up once at the start of the workflow and substitute the literal numbers and slugs into every later command.

Before using this command, check if the gh pr-review extension is installed:
Get the PR number for the current branch:

```bash
gh extension list | grep -q pr-review || gh extension install agynio/gh-pr-review
gh pr view --json number -q .number
```

## CLI Reference

### List Review Threads

Enumerate all review threads with filtering:
Get the repository slug:

```bash
gh pr-review threads list --pr <number> --repo <owner/repo>
gh repo view --json nameWithOwner -q .nameWithOwner
```

**Common filters:**
Then pass the resulting values directly — e.g. `--pr 42 --repo posit-dev/skills` — on every subsequent `gh pr-review` call in this workflow (list, resolve, view, reply).

- `--unresolved` — Show only unresolved threads
- `--resolved` — Show only resolved threads
## Workflow

### View PR Reviews and Comments
1. Fetch and display all unresolved PR review threads
2. Show thread details (file, line, comment text)
3. Ask for confirmation or allow selective resolution
4. Resolve the confirmed threads
5. Report back with a summary of resolved threads

## CLI Reference

Display reviews, inline comments, and replies with full context:
### List Review Threads

```bash
gh pr-review review view --pr <number> --repo <owner/repo>
gh pr-review threads list --pr <number> --repo <owner/repo>
```

**Common filters:**

- `--reviewer <login>` — Filter by specific reviewer
- `--states <list>` — Filter by review state (APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED)
- `--unresolved` — Show only unresolved threads
- `--not_outdated` — Exclude outdated threads
- `--tail <n>` — Show only the last n replies per thread
- `--include-comment-node-id` — Include GraphQL node IDs for replies
Filter with `--unresolved` or `--resolved`.

### Resolve / Unresolve Threads

Toggle thread resolution status:

```bash
# Resolve a thread
gh pr-review threads resolve --thread-id <PRRT_...> --pr <number> --repo <owner/repo>

# Unresolve a thread
gh pr-review threads unresolve --thread-id <PRRT_...> --pr <number> --repo <owner/repo>
```

### Bulk Resolve Example

Substitute the actual PR number and repo slug resolved in "Resolve PR context first" — the `42` / `owner/repo` below are placeholders.

```bash
# Get all unresolved thread IDs and resolve them
gh pr-review threads list --pr 42 --unresolved --repo owner/repo | \
jq -r '.threads[].id' | \
xargs -I {} gh pr-review threads resolve --thread-id {} --pr 42 --repo owner/repo
```

## Usage Notes

1. **Repository Context**: Always include `--repo owner/repo` to ensure correct repository context, or run commands from within a local clone of the repository.

2. **Thread IDs**: Thread IDs (format `PRRT_...`) can be obtained from `review view --include-comment-node-id` or `threads list` commands.

3. **State Filters**: When using `--states`, provide a comma-separated list: `--states APPROVED,CHANGES_REQUESTED`

4. **Unresolved Focus**: Use `--unresolved --not_outdated` together to focus on actionable comments that need attention.