main

TriageBotComments Workflow

Steps

1. Fetch Unresolved Bot Threads

python3 "<skill-dir>/scripts/fetch_bot_reviews.py"
# or with explicit PR
python3 "<skill-dir>/scripts/fetch_bot_reviews.py" --pr <number>

If no bot threads found, report “No unresolved bot comments” and stop.

2. Analyze Each Comment

For each thread:

  1. Read the referenced code at the file/line from the thread
  2. Classify: bug, duplication, style, refactor, incorrect
  3. Judge severity: high, medium, low
  4. Determine recommendation: fix or discard

Verify every claim against actual code. Bots frequently misread context.

3. Present Recommendations

Show a compact numbered summary:

## Bot Comment Triage — PR #<number>

| # | File:Line | Bot | Category | Severity | Recommendation |
|---|-----------|-----|----------|----------|----------------|
| 1 | src/auth.go:42 | golangci-lint | bug | high | fix |
| 2 | src/util.go:18 | copilot | style | low | discard |
| 3 | src/api.go:99 | coderabbit | incorrect | - | discard |

### Details

**1. src/auth.go:42** — golangci-lint flagged unchecked error return
Severity: high — real bug, error is silently dropped
→ Recommend: fix

**2. src/util.go:18** — copilot suggests renaming variable
Severity: low — current name is fine in context
→ Recommend: discard

**3. src/api.go:99** — coderabbit claims unused parameter
Severity: n/a — parameter IS used on line 105, bot misread
→ Recommend: discard as incorrect

Ask user which items to fix (if not already specified).

4. Apply Selected Fixes

For each chosen fix:

  1. Make the code change
  2. Run any relevant formatter
  3. Run the smallest useful test set

5. Reply and Resolve

For every targeted thread, post a professional reply:

Fixed:

Fixed — [brief description of what changed].

Discarded as incorrect:

Keeping current code — [brief explanation why suggestion doesn't apply].

Discarded as optional:

Acknowledged — keeping current approach [brief reason].

Then resolve the thread:

gh api repos/{owner}/{repo}/pulls/{pr}/comments/{comment_id}/replies -f body="<reply>"
gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "<thread_id>"}) { thread { id isResolved } } }'

6. Verify

Run the fetch script again and confirm targeted threads are resolved.