Fetch Pr Feedback logo

Fetch Pr Feedback

Organization
existential-birds
fetch-pr-feedback

Fetch unresolved review comments from a PR and evaluate with receive-feedback skill

Overview

Publisherexistential-birds
Repositorybeagle
Skill namefetch-pr-feedback
Stars
82
Forks
8
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by existential-birds on GitHub. Read the source before you install it.

Installation

Install the Fetch Pr Feedback AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/existential-birds/beagle.git /tmp/beagle
mkdir -p .claude/skills
cp -r /tmp/beagle/plugins/beagle-core/skills/fetch-pr-feedback .claude/skills/fetch-pr-feedback
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Fetch Pr Feedback in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Fetch Pr Feedback on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Fetch Pr Feedback is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Fetch PR Feedback

Fetch review comments from all reviewers on the current PR, format them, and evaluate using the receive-feedback skill. Excludes the PR author and current user by default. Line-specific comments belonging to resolved review threads are also excluded by default.

Usage

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

fetch-pr-feedback [--pr <number>] [--include-author] [--include-resolved]

Flags:

  • --pr <number> - PR number to target (default: current branch's PR)
  • --include-author - Include PR author's own comments (default: excluded)
  • --include-resolved - Include line-specific comments from resolved review threads (default: excluded)

Instructions

Gates (sequence; do not skip)

Advance only after each Pass when is satisfied.

  1. PR contextPass when: $PR_NUMBER is set to a positive integer and gh pr view / gh api for that PR completed with exit code 0, or you stop in Get PR Context with only the failure given there (“No PR found for current branch…”).
  2. FetchPass when: the resolved-thread GraphQL call (skipped if --include-resolved) and both paginated gh api … | jq -s -f … runs (issue comments + review comments) exit 0 and parse as JSON (empty [] is valid). On non-zero exit or jq error, stop; surface command stderr—do not invent comments.
  3. Formatted artifactPass when: output is either (a) markdown matching Format Feedback Document (header # PR #$PR_NUMBER Review Feedback, per-reviewer ## Reviewer: … with Summary / Line-Specific sections), or (b) exactly: No review comments found on this PR (excluding PR author, current user, and resolved threads).
  4. Load receive-feedbackPass when: the receive-feedback skill is loaded; only then run that skill’s verify → evaluate → execute loop on that formatted document.

1. Parse Arguments

Extract flags from $ARGUMENTS:

  • --pr <number> or detect from current branch
  • --include-author flag (boolean, default false)
  • --include-resolved flag (boolean, default false)

2. Get PR Context

bash
# If --pr was specified, use that number directly
# Otherwise, get PR for current branch:
gh pr view --json number,headRefName,url,author --jq '{number, headRefName, url, 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.

If no PR exists for current branch, fail with: "No PR found for current branch. Use --pr to specify a PR number."

3. Fetch Comments

Fetch both types of comments, excluding $PR_AUTHOR and $CURRENT_USER (unless --include-author is set). Use --paginate with jq -s to combine paginated JSON arrays into one.

Unless --include-resolved is set, first fetch the databaseIds of every review comment that belongs to a resolved review thread. Issue comments (summary/walkthrough) aren't part of review threads, so this only affects line-specific review comments.

Resolved-thread comment IDs (skip this block entirely when --include-resolved is set; set RESOLVED_IDS='[]' instead):

bash
RESOLVED_IDS=$(gh api graphql \
  -F owner="$OWNER" -F repo="$REPO" -F pr="$PR_NUMBER" \
  -f query='
    query($owner: String!, $repo: String!, $pr: Int!) {
      repository(owner: $owner, name: $repo) {
        pullRequest(number: $pr) {
          reviewThreads(first: 100) {
            nodes {
              isResolved
              comments(first: 100) { nodes { databaseId } }
            }
          }
        }
      }
    }
  ' \
  --jq '[.data.repository.pullRequest.reviewThreads.nodes[]
         | select(.isResolved)
         | .comments.nodes[].databaseId
         | select(. != null)]')

The first: 100 limits cover typical PRs. For very large PRs (>100 threads or >100 comments in a single thread), thread/comment-level pagination would need to be added; for now, that's a known limitation.

Write jq filters to temp files using heredocs with single-quoted delimiters (prevents shell escaping issues with !=, regex patterns, and angle brackets):

Issue comments (summary/walkthrough posts):

bash
cat > /tmp/issue_comments.jq << 'JQEOF'
def clean_body:
  gsub("<!-- suggestion_start -->.*?<!-- suggestion_end -->"; ""; "s")
  | gsub("<!--.*?-->"; ""; "s")
  | gsub("<details>\\s*<summary>\\s*🧩 Analysis chain[\\s\\S]*?</details>"; ""; "s")
  | gsub("<details>\\s*<summary>\\s*🤖 Prompt for AI Agents[\\s\\S]*?</details>"; ""; "s")
  | gsub("<details>\\s*<summary>\\s*📝 Committable suggestion[\\s\\S]*?</details>"; ""; "s")
  | gsub("<details>\\s*<summary>Past reviewee.*?</details>"; ""; "s")
  | gsub("<details>\\s*<summary>Recent review details[\\s\\S]*?</details>"; ""; "s")
  | gsub("<details>\\s*<summary>\\s*Tips\\b.*?</details>"; ""; "s")
  | gsub("\\n?\\n---\\n+(?=\\s*(?:✨\\s*Finishing Touches|🪧\\s*Tips?|🤖\\s*Generated|<sub>|_Generated by|Generated by Claude|Generated with))[\\s\\S]*$"; ""; "s")
  | gsub("^\\s+|\\s+$"; "")
  | if length > 4000 then .[:4000] + "\n\n[comment truncated]" else . end
;
[(add // []) | .[] | select(
  .user.login != $pr_author and
  .user.login != $current_user
)] |
map({id, user: .user.login, body: (.body | clean_body), created_at})
JQEOF

gh api --paginate "repos/$OWNER/$REPO/issues/$PR_NUMBER/comments" | \
  jq -s --arg pr_author "$PR_AUTHOR" --arg current_user "$CURRENT_USER" \
  -f /tmp/issue_comments.jq

Review comments (line-specific):

bash
cat > /tmp/review_comments.jq << 'JQEOF'
def clean_body:
  gsub("<!-- suggestion_start -->.*?<!-- suggestion_end -->"; ""; "s")
  | gsub("<!--.*?-->"; ""; "s")
  | gsub("<details>\\s*<summary>\\s*🧩 Analysis chain[\\s\\S]*?</details>"; ""; "s")
  | gsub("<details>\\s*<summary>\\s*🤖 Prompt for AI Agents[\\s\\S]*?</details>"; ""; "s")
  | gsub("<details>\\s*<summary>\\s*📝 Committable suggestion[\\s\\S]*?</details>"; ""; "s")
  | gsub("<details>\\s*<summary>Past reviewee.*?</details>"; ""; "s")
  | gsub("<details>\\s*<summary>Recent review details[\\s\\S]*?</details>"; ""; "s")
  | gsub("<details>\\s*<summary>\\s*Tips\\b.*?</details>"; ""; "s")
  | gsub("\\n?\\n---\\n+(?=\\s*(?:✨\\s*Finishing Touches|🪧\\s*Tips?|🤖\\s*Generated|<sub>|_Generated by|Generated by Claude|Generated with))[\\s\\S]*$"; ""; "s")
  | gsub("^\\s+|\\s+$"; "")
  | if length > 4000 then .[:4000] + "\n\n[comment truncated]" else . end
;
[(add // []) | .[] | select(
  .user.login != $pr_author and
  .user.login != $current_user and
  (.id as $comment_id | ($resolved_ids | index($comment_id) | not))
)] |
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: (.body | clean_body),
  created_at
})
JQEOF

gh api --paginate "repos/$OWNER/$REPO/pulls/$PR_NUMBER/comments" | \
  jq -s --arg pr_author "$PR_AUTHOR" --arg current_user "$CURRENT_USER" \
  --argjson resolved_ids "$RESOLVED_IDS" \
  -f /tmp/review_comments.jq

If --include-author is set, omit the --arg pr_author parameter and the .user.login != $pr_author condition from both jq filter files. Keep the $current_user exclusion either way. The $resolved_ids filter naturally becomes a no-op when RESOLVED_IDS='[]' (the --include-resolved path), so leave it in place.

4. Format Feedback Document

Noise stripping — handled by the clean_body jq function in Step 3. Order matters: <!-- suggestion_start -->...<!-- suggestion_end --> blocks are removed first, then remaining HTML comments, then known-noise <details> blocks (Analysis chain, Prompt for AI Agents, Committable suggestion, Past reviewee, Recent review details, Tips), and finally the --- footer boilerplate. The <details> blocks must be stripped before the --- footer pattern because bot analysis chains contain --- separators that would otherwise truncate the actual finding. Substantive <details> blocks (e.g. "Suggested fix", "Proposed fix") are preserved. Comments exceeding 4000 chars after stripping are truncated with a [comment truncated] marker.

Group by reviewer — organize the formatted output by reviewer username:

markdown
# PR #$PR_NUMBER Review Feedback

## Reviewer: coderabbitai[bot]

### Summary Comments
[Issue comments from this reviewer, each separated by ---]

### Line-Specific Comments
[Review comments from this reviewer, each formatted as:]

**File: `path/to/file.ts:42`**
[cleaned comment body]

---

## Reviewer: another-reviewer

### Summary Comments
...

### Line-Specific Comments
...

If no comments found from any reviewer, output: "No review comments found on this PR (excluding PR author, current user, and resolved threads)."

5. Evaluate with receive-feedback

Load the receive-feedback skill.

Then process the formatted feedback document:

  1. Parse each actionable item from the formatted document
  2. Process each item through verify → evaluate → execute
  3. Produce structured response summary

Example

# Fetch unresolved reviewer comments on current branch's PR (default)
fetch-pr-feedback

# Fetch from a specific PR
fetch-pr-feedback --pr 123

# Include PR author's own comments
fetch-pr-feedback --include-author

# Include line-specific comments from resolved review threads
fetch-pr-feedback --include-resolved

# Combined
fetch-pr-feedback --pr 456 --include-author --include-resolved

Frequently asked questions

What does the Fetch Pr Feedback AI skill do?

Fetch unresolved review comments from a PR and evaluate with receive-feedback skill

Why use Fetch Pr Feedback on TypingMind?

Because you install it once and use it with any model. Fetch Pr Feedback is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Fetch Pr Feedback in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/existential-birds/beagle/tree/main/plugins/beagle-core/skills/fetch-pr-feedback. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Fetch Pr Feedback?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Fetch Pr Feedback?

As many as you like. As long as a model supports skills, you can use Fetch Pr Feedback with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Fetch Pr Feedback AI skill free?

Yes. It is published on GitHub by existential-birds under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇