pr-feedback-classifier
Original:🇺🇸 English
Translated
Fetches and classifies PR review feedback with context isolation. Returns structured JSON with thread IDs for deterministic resolution. Use when analyzing PR comments before addressing them.
9installs
Sourcedagster-io/erk
Added on
NPX Install
npx skill4agent add dagster-io/erk pr-feedback-classifierTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →PR Feedback Classifier
Fetch and classify all PR review feedback for the current branch's PR.
Arguments
- : Target a specific PR by number (default: current branch's PR)
--pr <number> - : Include resolved threads (for reference)
--include-resolved
Check for flags.
$ARGUMENTSCritical Constraints
DO NOT write Python scripts or any code files. Classify the data using direct AI reasoning only. Writing code to process JSON is unnecessary and pollutes the filesystem.
Steps
-
Fetch PR info and all comments in a single call:bash
erk exec get-pr-feedback [--pr <number>] [--include-resolved]Passif specified in--pr <number>. Pass$ARGUMENTSif specified in--include-resolved.$ARGUMENTSThis returns JSON with,pr_number,pr_title,pr_url, andreview_threads.discussion_commentsAlso fetch file-level restructuring context:bashgit diff --stat -M -C main...HEADThis reveals renames, copies, and splits. Use this to inform pre-existing detection in step 2. -
Classify each comment using the Comment Classification Model below.
-
Group into batches by complexity.
-
Output structured JSON (schema below).
Comment Classification Model
For each comment, determine:
Classification
Classification determines how the thread is presented to the user, not whether it appears.
- Actionable: Code changes requested, violations to fix, missing tests, documentation updates requested, bot suggestions to add tests, bot style/refactoring suggestions (optional/could)
- Informational: CI-generated style suggestions, acknowledgments on review threads
Important: Every unresolved review thread goes into , regardless of whether it's from a bot or human. The field distinguishes how the user should handle it.
actionable_threadsclassificationDiscussion comments that are purely informational (CI status updates, Graphite stack comments, PR description summaries) are still counted in and do NOT appear in .
informational_countactionable_threadsPre-Existing Detection
For each thread in , determine the field:
actionable_threadspre_existing-
when ALL of:
pre_existing: true- Author is a bot (suffix)
[bot] - PR involves file restructuring (renames, splits, moves visible in )
git diff --stat -M -C - The flagged pattern would have been equally flaggable in the original file location (generic code quality issue, not specific to the restructuring)
- Author is a bot (
-
when ANY of:
pre_existing: false- Author is human
- The issue is specifically caused by the restructuring (e.g., in a new
__all__, new import paths)__init__.py - No restructuring detected in the PR
Complexity
- : Single line change at specified location
local - : Multiple changes in one file
single_file - : Changes across multiple files
cross_cutting - : Architectural changes or related refactoring needed
complex
Batch Ordering
- Pre-Existing (Auto-Resolve) (auto_proceed: true): Pre-existing issues in moved/restructured code ()
pre_existing: true - Local Fixes (auto_proceed: true): Single-line changes
- Single-File (auto_proceed: true): Multi-location in one file
- Cross-Cutting (auto_proceed: false): Multiple files
- Complex (auto_proceed: false): Architectural changes
- Informational (auto_proceed: false): Threads classified as — user decides to act or dismiss
informational
Output Format
Output ONLY the following JSON (no prose, no markdown, no code fences):
json
{
"success": true,
"pr_number": 5944,
"pr_title": "Feature: Add new API endpoint",
"pr_url": "https://github.com/owner/repo/pull/5944",
"actionable_threads": [
{
"thread_id": "PRRT_kwDOPxC3hc5q73Ne",
"type": "review",
"path": "src/api.py",
"line": 42,
"is_outdated": false,
"classification": "actionable",
"pre_existing": false,
"action_summary": "Add integration tests for new endpoint",
"complexity": "local",
"original_comment": "This needs integration tests"
},
{
"thread_id": "PRRT_kwDOPxC3hc5q73Nf",
"type": "review",
"path": "src/api.py",
"line": 55,
"is_outdated": false,
"classification": "actionable",
"pre_existing": true,
"action_summary": "Bot suggestion: add unit tests for error handling paths",
"complexity": "pre_existing",
"original_comment": "Consider adding unit tests for the error handling paths in this endpoint"
}
],
"discussion_actions": [
{
"comment_id": 12345678,
"action_summary": "Update API documentation",
"complexity": "cross_cutting",
"original_comment": "Please update the docs to reflect..."
}
],
"informational_count": 12,
"batches": [
{
"name": "Pre-Existing (Auto-Resolve)",
"complexity": "pre_existing",
"auto_proceed": true,
"item_indices": [1]
},
{
"name": "Local Fixes",
"complexity": "local",
"auto_proceed": true,
"item_indices": [0]
},
{
"name": "Single-File",
"complexity": "single_file",
"auto_proceed": true,
"item_indices": []
},
{
"name": "Cross-Cutting",
"complexity": "cross_cutting",
"auto_proceed": false,
"item_indices": []
}
],
"error": null
}Field notes:
- : The ID needed for
thread_iderk exec resolve-review-thread - : The ID needed for
comment_iderk exec reply-to-discussion-comment - :
classificationor"actionable"— determines how the user handles the thread"informational" - :
pre_existingif the issue existed before this PR (bot comment on moved/restructured code). Pre-existing threads usetrueand are placed in the first batch for auto-resolutioncomplexity: "pre_existing" - : References into
item_indices(type=review) oractionable_threads(type=discussion)discussion_actions - : First 200 characters of the comment text
original_comment - : Count of informational discussion comments only (CI status, Graphite stack). Review threads always appear individually in
informational_countwith aactionable_threadsfieldclassification
Error Case
If no PR exists for the branch or API fails:
json
{
"success": false,
"pr_number": null,
"pr_title": null,
"pr_url": null,
"actionable_threads": [],
"discussion_actions": [],
"informational_count": 0,
"batches": [],
"error": "No PR found for branch feature-xyz"
}No Comments Case
If PR exists but has no unresolved comments:
json
{
"success": true,
"pr_number": 5944,
"pr_title": "Feature: Add new API endpoint",
"pr_url": "https://github.com/owner/repo/pull/5944",
"actionable_threads": [],
"discussion_actions": [],
"informational_count": 0,
"batches": [],
"error": null
}