Skip to content
Development
Command

/resolve-threads

Batch-resolve unresolved PR/MR review threads via GraphQL API (GitHub/GitLab)

From plugin
claude-night-market
343162 skills60 agents162 commands1 MCP
> /plugin marketplace add athola/claude-night-market

Command definition

resolve-threads.md
name: resolve-threads
description: Batch-resolve unresolved PR/MR review threads via GraphQL API (GitHub/GitLab)
usage: /resolve-threads [<pr-number> | <pr-url> | <mr-url>]

Resolve PR Review Threads

Quickly resolve all unresolved review threads on a PR after fixes have been addressed.

When To Use

  • **Runs automatically** at the end of `/fix-pr` (Phase 7)
  • After manually addressing PR review comments outside `/fix-pr`
  • To clean up resolved conversations before merge
  • As a standalone verification command

When NOT To Use

  • Simple changes that don't need the full workflow
  • Work already completed through another sanctum command

Workflow

Step 1: Identify Target PR

# GitHub - if no PR specified, use current branch
gh pr view --json number,url -q '.number'

# GitLab
glab mr view --json iid -q '.iid'

Step 2: Fetch Unresolved Threads

# Replace OWNER, REPO, PR_NUMBER with actual values
gh api graphql --paginate --slurp -f query='
query($endCursor: String) {
  repository(owner: "OWNER", name: "REPO") {
    pullRequest(number: PR_NUMBER) {
      reviewThreads(first: 100, after: $endCursor) {
        pageInfo { hasNextPage endCursor }
        nodes {
          id
          isResolved
          path
          line
          subjectType
          comments(first: 1) {
            nodes { body }
          }
        }
      }
    }
  }
}'

Step 3: Resolve Each Thread

For each unresolved thread:

gh api graphql -f query='
mutation {
  resolveReviewThread(input: {threadId: "PRRT_xxx"}) {
    thread { isResolved }
  }
}'

Step 4: Verify Resolution

Rerun the Step 2 query and count what is still open. gh rejects `--slurp` together with `--jq`. Pipe the slurped pages to `jq` instead.

# Should print 0
gh api graphql --paginate --slurp -f query='
query($endCursor: String) {
  repository(owner: "OWNER", name: "REPO") {
    pullRequest(number: PR_NUMBER) {
      reviewThreads(first: 100, after: $endCursor) {
        pageInfo { hasNextPage endCursor }
        nodes { id isResolved }
      }
    }
  }
}' | jq '[.[].data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)] | length'

Output

### Thread Resolution Summary

| Status | Count |
|--------|-------|
| Resolved | 15 |
| Already resolved | 3 |
| Failed | 0 |

All 18 review threads are now resolved.

Notes

  • Requires GitHub CLI with GraphQL access
  • Does NOT reply to threads - use `/fix-pr` for reply + resolve
  • Safe to run multiple times (idempotent)

See Also

  • `/fix-pr` - Full workflow for addressing PR comments (reply + resolve)
  • `/pr-review` - Review a PR and post findings as GitHub comments
Read more
@athola
Ships withclaude-night-market

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

343200 skills60 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
343
Star history of athola/claude-night-market on GitHub, a chart by star-history.com

Other commands on claude-night-market.

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command