Claude
Skills
Sign in
Back

prfeedback

Included with Lifetime
$97 forever

Parse PR review comments, categorize them, and create beads tasks for required changes

Code Review

What this skill does


# Handle PR Review Feedback

Parses PR review comments from GitHub, categorizes them by type and priority, and creates beads tasks for required changes. Supports marking the PR ready for re-review once all blocking comments are addressed.

## Usage

```bash
# Process PR feedback
/bkff:prfeedback --pr=123

# Process by URL
/bkff:prfeedback --pr=https://github.com/owner/repo/pull/123

# Mark ready for re-review after addressing comments
/bkff:prfeedback --pr=123 --ready=true

# Output as JSON for automation
/bkff:prfeedback --pr=123 --format=json
```

## Comment Categorization Logic

Comments are categorized by type and priority based on content analysis:

```
┌─────────────────────────────────────────────────────────────┐
│               COMMENT CATEGORIZATION                         │
└─────────────────────────────────────────────────────────────┘

┌────────────────────────────────────┐
│         FETCH PR COMMENTS          │
│  • Review comments                 │
│  • Inline code comments            │
│  • Conversation threads            │
└─────────────┬──────────────────────┘
              │
              ▼
┌────────────────────────────────────┐
│        ANALYZE EACH COMMENT        │
│  • Extract action indicators       │
│  • Detect blocking keywords        │
│  • Identify suggestions            │
│  • Check resolution status         │
└─────────────┬──────────────────────┘
              │
              ▼
┌────────────────────────────────────┐
│          CATEGORIZE                │
├────────────────────────────────────┤
│ Type:                              │
│  • BLOCKING - Must fix             │
│  • SUGGESTION - Should consider    │
│  • QUESTION - Needs response       │
│  • PRAISE - No action needed       │
│  • NIT - Minor/optional            │
│                                    │
│ Priority:                          │
│  • P0 - Critical/Security          │
│  • P1 - Must fix before merge      │
│  • P2 - Should fix                 │
│  • P3 - Nice to have               │
└────────────────────────────────────┘
```

### Category Detection Rules

| Category | Detected By | Priority |
|----------|-------------|----------|
| BLOCKING | "must", "required", "fix", "blocker", changes_requested review | P1 |
| SECURITY | "vulnerability", "security", "XSS", "injection", "CVE" | P0 |
| SUGGESTION | "suggest", "consider", "could", "might", "optional" | P2 |
| QUESTION | "?", "why", "how", "what", "can you explain" | P2 |
| NIT | "nit:", "nitpick", "minor", "style" | P3 |
| PRAISE | "LGTM", "nice", "great", "well done", approved review | None |

### Keyword Patterns

```
BLOCKING patterns:
  - "please fix"
  - "this needs to"
  - "must be"
  - "required"
  - "blocker"
  - "cannot merge until"
  - Review state: CHANGES_REQUESTED

SECURITY patterns:
  - "security"
  - "vulnerability"
  - "injection"
  - "XSS"
  - "CSRF"
  - "authentication"
  - "authorization"
  - "CVE-"

SUGGESTION patterns:
  - "consider"
  - "suggestion:"
  - "you could"
  - "might want to"
  - "alternatively"
  - "optional:"

NIT patterns:
  - "nit:"
  - "nitpick"
  - "minor:"
  - "style:"
  - "formatting"
```

## Beads Task Creation for Required Changes

When blocking or high-priority comments are found, beads tasks are created:

```
┌─────────────────────────────────────────────────────────────┐
│                TASK CREATION FLOW                            │
└─────────────────────────────────────────────────────────────┘

Categorized Comments:
┌────────────────────────────────────┐
│ BLOCKING: 2 comments               │
│ SECURITY: 1 comment                │
│ SUGGESTION: 3 comments             │
│ NIT: 2 comments                    │
└─────────────┬──────────────────────┘
              │
              │ Create tasks for P0-P2
              ▼
┌────────────────────────────────────┐
│         CREATE BEADS TASKS         │
├────────────────────────────────────┤
│                                    │
│ bd create --type=task              │
│   --title="PR #123: Fix SQL        │
│            injection in query"     │
│   --priority=0                     │
│   --description="..."              │
│                                    │
│ bd create --type=task              │
│   --title="PR #123: Add input      │
│            validation"             │
│   --priority=1                     │
│   --description="..."              │
│                                    │
└─────────────┬──────────────────────┘
              │
              │ Link to parent issue
              ▼
┌────────────────────────────────────┐
│     SET DEPENDENCIES               │
│                                    │
│ • Link tasks to PR feature/epic    │
│ • Add dependency on PR approval    │
└────────────────────────────────────┘
```

### Task Format

```markdown
Title: PR #123: [Comment summary]

Description:
From PR review comment by @reviewer:

> [Original comment text]

File: src/api/query.ts
Line: 42

Action Required:
[Extracted action from comment]

---
PR: https://github.com/owner/repo/pull/123
Comment: https://github.com/owner/repo/pull/123#discussion_r123456
```

### Task Creation Rules

| Comment Type | Task Created | Priority |
|--------------|--------------|----------|
| SECURITY | Yes | P0 |
| BLOCKING | Yes | P1 |
| SUGGESTION (with "should") | Yes | P2 |
| SUGGESTION (with "could") | No (logged only) | - |
| QUESTION | No (needs response) | - |
| NIT | No (logged only) | - |
| PRAISE | No | - |

## --ready Flag for Re-Review

When `--ready=true` is specified:

```
┌─────────────────────────────────────────────────────────────┐
│                  RE-REVIEW FLOW                              │
└─────────────────────────────────────────────────────────────┘

┌────────────────────────────────────┐
│     CHECK BLOCKING COMMENTS        │
│                                    │
│ Scan for unresolved BLOCKING and   │
│ SECURITY comments                  │
└─────────────┬──────────────────────┘
              │
    ┌─────────┴─────────┐
    │                   │
    ▼                   ▼
┌──────────┐     ┌──────────────────┐
│ All      │     │ Unresolved       │
│ Resolved │     │ Comments Remain  │
└────┬─────┘     └────────┬─────────┘
     │                    │
     ▼                    ▼
┌──────────────┐  ┌──────────────────┐
│ Request      │  │ List unresolved  │
│ Re-review    │  │ Exit with error  │
│ via gh CLI   │  │                  │
└──────────────┘  └──────────────────┘

Re-review request:
  gh pr ready 123
  gh pr edit 123 --add-reviewer @original-reviewer
```

### Re-Review Checklist

Before marking ready:
1. All BLOCKING comments resolved
2. All SECURITY comments resolved
3. All created beads tasks closed
4. Tests passing (checked via CI status)
5. Optional: Response to all QUESTION comments

## Stale Comment Handling

Comments may become stale when code changes after the review:

```
┌─────────────────────────────────────────────────────────────┐
│                 STALE DETECTION                              │
└─────────────────────────────────────────────────────────────┘

Comment on src/api/query.ts:42
┌────────────────────────────────────┐
│ @reviewer: "Fix the SQL injection" │
│ Posted: 2 days ago                 │
│ Line content: "SELECT * FROM..."   │
└────────────────────────────────────┘
              │
              │ Compare with current
              ▼
Current src/api/query.ts:42
┌────────────────────────────────────┐
│ // Using parameterized queries     │
│ Line changed since comment         │
└────────────────────────────────────┘
              │
              ▼
┌────────────────────────────────────┐
│ STALE COMMENT DETECTED             │
│                                    │
│ Possible reasons:                  │
│ • Already addressed                │
│ • Code refactored                  │
│ • Line moved                       │
│                                    │
│ Action: Mark as potentially stale  │
│ Require manual verification        │
└────────────────────────────────────┘
``

Related in Code Review