Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
This skill teaches you how to manage GitHub Pull Request review threads. Review threads are conversation containers attached to specific lines of code in a PR diff.
CRITICAL UNDERSTANDING: Replying to a review thread does NOT automatically resolve it. Resolution is a separate GraphQL mutation that must be explicitly called. Many developers assume replying resolves threads - this is incorrect.
Prerequisites
GitHub CLI (gh) installed and authenticated
Python 3.8+ for running automation scripts
Repository collaborator access (required for resolving threads)
GraphQL API access
Instructions
Follow these steps when managing GitHub PR review threads:
Identify threads requiring attention: Use amia_get_review_threads.py --unresolved-only to list all unresolved threads on the PR
Determine the appropriate action: Consult the Decision Tree section below to decide whether to reply, resolve, or both
Execute the operation: Run the corresponding script from the Available Scripts section with the required parameters
Verify success: Check the JSON output's success field and verify the thread state changed as expected
Track progress: Re-run listing commands to confirm all threads have been properly addressed
Checklist
Copy this checklist and track your progress:
Identify unresolved threads using amia_get_review_threads.py --unresolved-only
Determine action for each thread (reply/resolve/both)
For implemented changes: resolve thread (optionally with reply)
For clarification needed: reply only (keep thread open)
For batch operations: use amia_resolve_threads_batch.py
Verify each operation succeeded via JSON output
Re-run listing to confirm all threads addressed
Check for any comments without replies using
amia_get_unaddressed_comments.py
Output
All scripts in this skill output JSON to stdout with the following standard structure:
Field
Type
Description
success
boolean
Whether the operation completed successfully
threadId
string
The GraphQL node ID of the affected thread (PRRT_xxx format)
isResolved
boolean
Current resolution state of the thread after operation
commentId
string
(Reply operations only) The GraphQL node ID of the created comment
results
array
(Batch operations only) Array of per-thread success/failure details
error
string
(On failure) Human-readable error message explaining what went wrong
See the Script Usage Details section for script-specific output format variations.
Decision Tree for Thread Operations
START: You need to handle a review thread
│
├─► Q: Has the requested change been implemented?
│ │
│ ├─► YES: Do you need to explain what was done?
│ │ │
│ │ ├─► YES: Reply THEN Resolve (two operations)
│ │ │ See: scripts/amia_reply_to_thread.py --and-resolve
│ │ │
│ │ └─► NO: Just Resolve (no reply needed)
│ │ See: scripts/amia_resolve_thread.py
│ │
│ └─► NO: Is clarification needed from the reviewer?
│ │
│ ├─► YES: Reply only (keep thread OPEN)
│ │ See: scripts/amia_reply_to_thread.py (without --and-resolve)
│ │
│ └─► NO: Leave thread untouched until you address it
│
├─► Q: Do you need to resolve MULTIPLE threads at once?
│ │
│ └─► YES: Use batch resolution (1 API call for N threads)
│ See: scripts/amia_resolve_threads_batch.py
│
└─► Q: Do you need to find threads that still need attention?
│
├─► Find all unresolved threads:
│ See: scripts/amia_get_review_threads.py --unresolved-only
│
└─► Find comments without any replies:
See: scripts/amia_get_unaddressed_comments.py
Key Concepts
Thread vs Comment
Review Thread: A container that holds one or more comments, anchored to a specific file/line
Review Comment: An individual message within a thread
Thread ID: The GraphQL node ID of the thread (needed for resolution)
Comment ID: The GraphQL node ID of an individual comment
Thread States
State
Meaning
When to Use
Unresolved
Thread requires attention
Default state, indicates pending work
Resolved
Thread has been addressed
After implementing requested change
The Reply-Resolve Separation
GitHub's API separates these operations because:
Replying adds a comment to the conversation
Resolving changes the thread's status metadata
You might reply without resolving (asking for clarification), or resolve without replying (when the code change speaks for itself).
All scripts are located in the scripts/ subdirectory and output JSON to stdout.
Script
Purpose
Key Parameters
amia_get_review_threads.py
List all review threads on a PR
--owner, --repo, --pr, --unresolved-only
amia_resolve_thread.py
Resolve a single thread
--thread-id
amia_resolve_threads_batch.py
Resolve multiple threads (1 API call)
--thread-ids (comma-separated)
amia_reply_to_thread.py
Reply to a thread
--thread-id, --body, --and-resolve
amia_get_unaddressed_comments.py
Find comments without replies
--owner, --repo, --pr
Common Workflows
Workflow 1: Address All Unresolved Threads
# Step 1: Get all unresolved threads
python3 scripts/amia_get_review_threads.py --owner OWNER --repo REPO --pr 123 --unresolved-only
# Step 2: For each thread, make the code change, then resolve
python3 scripts/amia_resolve_thread.py --thread-id PRRT_xxxxx
Workflow 2: Reply and Resolve in One Command
# When you want to explain what you did AND resolve
python3 scripts/amia_reply_to_thread.py \
--thread-id PRRT_xxxxx \
--body "Fixed by using the recommended approach" \
--and-resolve
Workflow 3: Batch Resolve After Large Refactor
# When you've addressed multiple comments in one commit
python3 scripts/amia_resolve_threads_batch.py \
--thread-ids "PRRT_aaa,PRRT_bbb,PRRT_ccc"
Workflow 4: Find What Still Needs Attention
# Find comments that haven't received any reply yet
python3 scripts/amia_get_unaddressed_comments.py --owner OWNER --repo REPO --pr 123
Cause: The thread ID is incorrect or the thread was deleted.
Solution: Re-fetch thread IDs using amia_get_review_threads.py. Thread IDs start with PRRT_ for review threads.
Resolution Appears to Fail Silently
Cause: The mutation succeeded but the response wasn't checked properly.
Solution: The script verifies resolution by checking the isResolved field in the response. If it returns false, the resolution didn't take effect - check permissions.
Cannot Resolve Thread - Permission Denied
Cause: Only the PR author and repository collaborators can resolve threads.
Solution: Ensure you're authenticated as a user with write access to the repository.
Reply Added But Thread Still Unresolved
Cause: This is expected behavior! Replying does not resolve.
Solution: Use --and-resolve flag with amia_reply_to_thread.py, or call amia_resolve_thread.py separately.
GraphQL Rate Limiting
Cause: Too many API calls in short succession.
Solution: Use batch operations (amia_resolve_threads_batch.py) to resolve multiple threads in a single API call instead of individual calls.