Answer Review Remark in PR
Reply to a code review remark on a GitHub PR and resolve the thread.
Inputs
Infer all inputs from the conversation context. Ask only if ambiguous.
Input 1 — PR number or URL. The pull request to act on. Infer from context (e.g. a previously displayed PR URL or branch name). If truly ambiguous, run:
gh pr list --head "$(git rev-parse --abbrev-ref HEAD)" --json number,url --jq '.[0]'
Input 2 — The remark to answer.
A specific reviewer finding — usually identified by number (#2), file+line, or quoted text from the remark table shown earlier in the conversation.
If no remark table is in the conversation and the dakubo-display-pr-remarks skill is available, use it to make the table. If not, ask the user for the remark.
Input 3 — The answer. The response to post: an explanation, acknowledgement, or fix summary. Derive from context (e.g. what was just fixed or discussed). Ask if unclear.
Process
1. Resolve the comment ID
Fetch inline review comments for the PR:
gh api repos/:owner/:repo/pulls/<PR>/comments --paginate \
--jq '.[] | {id, path, line: (.line // .original_line), body: .body[0:120]}'
Match the target remark by line number, file path, or body snippet. Note its id.
2. Post the reply
gh api repos/:owner/:repo/pulls/<PR>/comments \
--method POST \
--field body="<answer>" \
--field in_reply_to=<comment_id>
3. Resolve the thread
Find the review thread that contains this comment:
gh api graphql -f query='
{
repository(owner: "<owner>", name: "<repo>") {
pullRequest(number: <PR>) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 1) { nodes { databaseId } }
}
}
}
}
}'
Match the thread whose comments.nodes[0].databaseId equals the original comment id (not the reply). Then resolve it:
gh api graphql -f query='
mutation {
resolveReviewThread(input: { threadId: "<thread_node_id>" }) {
thread { isResolved }
}
}'
Output
Confirm: reply posted to comment <id> at <file>:<line>, thread resolved. One sentence.
What NOT to do
- Do not fabricate an answer — derive it from context or ask.
- Do not resolve a thread without posting a reply first.
- Do not guess the PR if multiple are open on this branch; ask.