deepagents-architectur…
Guides architectural decisions for Deep Agents applications. Use when deciding between Deep Agents vs alternatives, choosing backend strategies, designing…
Respond to review comments on a PR after evaluation and fixes
$ npx -y skills add existential-birds/beagle --skill respond-pr-feedback --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/respond-pr-feedbackContext preview
The summary Claude sees to decide when to auto-load this skill.
Respond to review comments on a PR after evaluation and fixes
name: respond-pr-feedback description: Respond to review comments on a PR after evaluation and fixes disable-model-invocation: true
Post replies to review comments after you've evaluated the feedback and made fixes. Resolves conversation threads by default.
Invoke the **respond-pr-feedback** skill, optionally passing these flags:
respond-pr-feedback [--pr <number>] [--no-resolve]
**Flags:**
Run the [fetch-pr-feedback](../fetch-pr-feedback/SKILL.md) skill first to evaluate the feedback and make any necessary fixes.
Advance only after each pass condition is met (objective checks—not assumed completion).
1. **Prerequisite satisfied:** You have already run the [fetch-pr-feedback](../fetch-pr-feedback/SKILL.md) skill, evaluated each thread, and applied fixes or chosen an explicit response strategy per thread (no posting blind). 2. **Context loaded:** Step 2 commands exit `0`; values parsed from `gh pr view`, `gh repo view`, and `gh api user` are non-empty and assigned to `$PR_NUMBER`, `$PR_AUTHOR`, `$OWNER`, `$REPO`, `$CURRENT_USER`—never invent owner, repo, or PR number. 3. **Queue decided:** Step 3a `jq` exits `0`. If the filtered list is empty, output exactly `All review comments have been addressed.` and **stop** (do not call reply or GraphQL resolve APIs). 4. **Reply before resolve:** For each target comment, Step 4 `gh api .../replies` exits `0` before Step 5 attempts resolution for that item (unless `--no-resolve`). 5. **Resolve with mapping:** Step 5 calls `resolveReviewThread` only when Step 3b provides a `threadId` for that comment’s id; if there is no mapping, skip resolution for that item without treating it as failure.
Extract flags from `$ARGUMENTS`:
# Get PR info (if --pr not specified, uses current branch)
gh pr view --json number,author --jq '{number, author: .author.login}'
# Get repo owner/name
gh repo view --json owner,name --jq '{owner: .owner.login, name: .name}'
# Get current authenticated user
gh api user --jq '.login'Store as `$PR_NUMBER`, `$PR_AUTHOR`, `$OWNER`, `$REPO`, `$CURRENT_USER`.
**Note:** `$OWNER`, `$REPO`, etc. are placeholders. Substitute actual values from previous steps.
Fetch review comments, excluding PR author and current user, filtering to root comments that haven't been replied to.
Write the jq filter to a temp file using a heredoc with single-quoted delimiter (prevents shell escaping issues with `!=`, regex patterns, and angle brackets):
cat > /tmp/unreplied_comments.jq << 'JQEOF'
add // [] |
# Root comments from reviewers (not replies, not PR author, not current user)
[.[] | select(
.in_reply_to_id == null and
.user.login != $pr_author and
.user.login != $current_user
)] as $roots |
# IDs that current user has already replied to
[.[] | select(.user.login == $current_user) | .in_reply_to_id] as $replied |
# Filter to unreplied only
$roots | map(select(. as $c | $replied | index($c.id) == null)) |
# Dedup: group by path + line + reviewer, pick newest per group
group_by({
p: .path,
l: (.line // .original_line),
u: .user.login
}) |
map(sort_by(.created_at) | last) |
# Output needed fields
map({
id,
user: .user.login,
path,
line_display: (
.line as $end | .start_line as $start |
if $start and $start != $end then "\($start)-\($end)"
else "\($end // .original_line)" end
),
body
})
JQEOFgh api --paginate "repos/$OWNER/$REPO/pulls/$PR_NUMBER/comments" | \ jq -s --arg pr_author "$PR_AUTHOR" --arg current_user "$CURRENT_USER" \ -f /tmp/unreplied_comments.jq
If no unreplied comments found, output: "All review comments have been addressed." and stop.
Fetch review thread IDs to enable resolution after posting replies:
gh api graphql -f query="
query {
repository(owner: \"$OWNER\", name: \"$REPO\") {
pullRequest(number: $PR_NUMBER) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 1) {
nodes { databaseId }
}
}
}
}
}
}
"Build a lookup map: comment `databaseId` → thread `id` (unresolved threads only). This enables immediate resolution after posting each reply.
For each unreplied comment, determine the appropriate response based on your evaluation:
| Evaluation Outcome | Response | |--------------------|----------| | Feedback was incorrect/unfounded | Explain why the current code is correct | | Feedback lacked context | Explain the design decision | | Feedback was valid and fixed | "Fixed in `$COMMIT_SHA`" or brief description of change | | Feedback was valid but won't fix | Explain the tradeoff/decision |
**Tagging guideline:** `@`-tag bot reviewers (e.g., `@coderabbitai`) to trigger their processing. Do not `@`-tag human reviewers.
Post reply to each comment:
gh api "repos/$OWNER/$REPO/pulls/$PR_NUMBER/comments/$COMMENT_ID/replies" \ -X POST --raw-field body="$RESPONSE"
**This step runs by default.** Skip only if `--no-resolve` was passed.
After posting each reply, look up the `$THREAD_ID` from the step 3b mapping using the comment's `$COMMENT_ID`:
gh api graphql -f query="
mutation {
resolveReviewThread(input: {threadId: \"$THREAD_ID\"}) {
thread { isResolved }
}
}
"Image: NASA, Public Domain. Source Beagle is an Agent Skills marketplace: framework-aware code review, documentation, testing, architectural analysis, and git workflows for any compatible coding agent.
Repo: existential-birds/beagle
Guides architectural decisions for Deep Agents applications. Use when deciding between Deep Agents vs alternatives, choosing backend strategies, designing…
Reviews Deep Agents code for bugs, anti-patterns, and improvements. Use when reviewing code that uses create_deep_agent, backends, subagents, middleware, or…
Implements agents using Deep Agents. Use when building agents with create_deep_agent, configuring backends, defining subagents, adding middleware, or setting…
Guides architectural decisions for LangGraph applications. Use when deciding between LangGraph vs alternatives, choosing state management strategies, designing…
Reviews LangGraph code for bugs, anti-patterns, and improvements. Use when reviewing code that uses StateGraph, nodes, edges, checkpointing, or other LangGraph…
Implements stateful agent graphs using LangGraph. Use when building graphs, adding nodes/edges, defining state schemas, implementing checkpointing, handling…