← 返回 Skills 市场
anderskev

Respond Pr Feedback

作者 Kevin Anderson · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
30
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install respond-pr-feedback
功能描述
Respond to review comments on a PR after evaluation and fixes
使用说明 (SKILL.md)

Respond to PR Feedback

Post replies to review comments after you've evaluated the feedback and made fixes. Resolves conversation threads by default.

Usage

Invoke the respond-pr-feedback skill, optionally passing these flags:

respond-pr-feedback [--pr \x3Cnumber>] [--no-resolve]

Flags:

  • --pr \x3Cnumber> - PR number to target (default: current branch's PR)
  • --no-resolve - Skip thread resolution after posting replies (default: resolve all)

Prerequisites

Run the fetch-pr-feedback skill first to evaluate the feedback and make any necessary fixes.

Hard gates (sequenced)

Advance only after each pass condition is met (objective checks—not assumed completion).

  1. Prerequisite satisfied: You have already run the fetch-pr-feedback 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.

Instructions

1. Parse Arguments

Extract flags from $ARGUMENTS:

  • --pr \x3Cnumber> or detect from current branch
  • --no-resolve flag (boolean, default false)

2. Get PR Context

# 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.

3. Fetch Unreplied Comments and Thread Data

3a. Unreplied Review Comments

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 \x3C\x3C '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
})
JQEOF
gh 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.

3b. Pre-fetch Thread Data

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.

4. Generate and Post Replies

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"

5. Resolve Threads

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 }
    }
  }
"
  • If a comment's $COMMENT_ID has a matching thread ID in the lookup, resolve it
  • If no thread ID found (e.g., issue comment rather than review thread), skip resolution for that comment

6. Output Summary

Group by reviewer:

### Reviewer: coderabbitai[bot]

| File:Line | Response Type | Thread |
|-----------|---------------|--------|
| `src/foo.ts:42` | Fixed in `abc1234` | Resolved |
| `src/bar.ts:15` | Explained design | Resolved |

### Reviewer: octocat

| File:Line | Response Type | Thread |
|-----------|---------------|--------|
| `src/baz.ts:7` | Won't fix | Resolved |

Footer:

**Threads resolved: 3/3**

Response Guidelines

  • @-tag bot reviewers to trigger re-processing; do not tag human reviewers
  • Keep responses concise and technical
  • No performative agreement ("Great point!", "You're right!")
  • Reference specific code/design when explaining decisions
  • If fixed: state what changed, no gratitude

Example

# Respond to all reviewers on current PR (resolves threads)
respond-pr-feedback

# Respond on a specific PR
respond-pr-feedback --pr 123

# Respond without resolving threads
respond-pr-feedback --no-resolve
安全使用建议
Install only if you want an agent to post PR review replies and resolve review threads through your GitHub identity. Review the queued comments and responses before use, and pass --no-resolve when you do not want conversations closed automatically.
能力评估
Purpose & Capability
The skill has mutation authority over PR review comments and review-thread resolution, but that capability directly matches its stated purpose and is explicitly described.
Instruction Scope
Instructions include hard gates requiring prior feedback evaluation, concrete PR/repo/user context from gh commands, no blind posting, and an opt-out flag for resolving threads.
Install Mechanism
The artifact is a single markdown skill file with no executable scripts, declared dependencies, package installs, or hidden install-time behavior.
Credentials
Use of the GitHub CLI and GitHub API is proportionate for reading PR context, posting replies, and resolving review threads, though it depends on the user's authenticated GitHub account.
Persistence & Privilege
No background process, local persistence, credential harvesting, or privilege escalation is present; persistent effects are limited to intended GitHub PR comments and thread state.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install respond-pr-feedback
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /respond-pr-feedback 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the respond-pr-feedback skill. - Automatically replies to unreplied PR review comments after evaluation and fixes. - Resolves conversation threads by default (can skip with --no-resolve). - Groups summary output by reviewer and provides thread resolution stats. - Enforces prerequisite evaluation and non-blind replies to review comments. - Avoids @-tagging human reviewers; only bots are tagged to trigger re-processing.
元数据
Slug respond-pr-feedback
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Respond Pr Feedback 是什么?

Respond to review comments on a PR after evaluation and fixes. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 30 次。

如何安装 Respond Pr Feedback?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install respond-pr-feedback」即可一键安装,无需额外配置。

Respond Pr Feedback 是免费的吗?

是的,Respond Pr Feedback 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Respond Pr Feedback 支持哪些平台?

Respond Pr Feedback 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Respond Pr Feedback?

由 Kevin Anderson(@anderskev)开发并维护,当前版本 v1.0.0。

💬 留言讨论