agent-reviews 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-reviews",
|
|
3
3
|
"description": "Manage GitHub PR review comments from Claude Code. Automatically triage, fix, and respond to bot findings.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Paul Bakaus",
|
|
7
7
|
"url": "https://github.com/pbakaus"
|
package/bin/agent-reviews.js
CHANGED
|
@@ -362,12 +362,6 @@ async function main() {
|
|
|
362
362
|
process.exit(1);
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
-
if (!options.json) {
|
|
366
|
-
console.log(
|
|
367
|
-
`${colors.dim}Finding PR for branch: ${branch}...${colors.reset}`
|
|
368
|
-
);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
365
|
const pr = await findPRForBranch(
|
|
372
366
|
repoInfo.owner,
|
|
373
367
|
repoInfo.repo,
|
|
@@ -396,12 +390,6 @@ async function main() {
|
|
|
396
390
|
process.exit(1);
|
|
397
391
|
}
|
|
398
392
|
|
|
399
|
-
if (!options.json) {
|
|
400
|
-
console.log(
|
|
401
|
-
`${colors.dim}Replying to comment ${options.replyTo}...${colors.reset}`
|
|
402
|
-
);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
393
|
const result = await replyToComment(
|
|
406
394
|
repoInfo.owner,
|
|
407
395
|
repoInfo.repo,
|
|
@@ -433,12 +421,6 @@ async function main() {
|
|
|
433
421
|
process.exit(1);
|
|
434
422
|
}
|
|
435
423
|
|
|
436
|
-
if (!options.json) {
|
|
437
|
-
console.log(
|
|
438
|
-
`${colors.dim}Fetching comments for PR #${prNumber}...${colors.reset}`
|
|
439
|
-
);
|
|
440
|
-
}
|
|
441
|
-
|
|
442
424
|
const rawData = await fetchPRComments(
|
|
443
425
|
repoInfo.owner,
|
|
444
426
|
repoInfo.repo,
|
|
@@ -476,12 +458,6 @@ async function main() {
|
|
|
476
458
|
}
|
|
477
459
|
|
|
478
460
|
// Default: fetch and display comments
|
|
479
|
-
if (!options.json) {
|
|
480
|
-
console.log(
|
|
481
|
-
`${colors.dim}Fetching comments for PR #${prNumber}...${colors.reset}`
|
|
482
|
-
);
|
|
483
|
-
}
|
|
484
|
-
|
|
485
461
|
const rawData = await fetchPRComments(
|
|
486
462
|
repoInfo.owner,
|
|
487
463
|
repoInfo.repo,
|
|
@@ -495,9 +471,6 @@ async function main() {
|
|
|
495
471
|
|
|
496
472
|
console.log(formatOutput(filtered, options));
|
|
497
473
|
|
|
498
|
-
if (!options.json && prUrl) {
|
|
499
|
-
console.log(`\n${colors.dim}PR: ${prUrl}${colors.reset}`);
|
|
500
|
-
}
|
|
501
474
|
}
|
|
502
475
|
|
|
503
476
|
main().catch((error) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-reviews
|
|
3
|
-
description: Review and fix PR review bot findings on current PR, loop until resolved
|
|
4
|
-
|
|
3
|
+
description: Review and fix PR review bot findings on current PR, loop until resolved. Fetches unanswered bot comments, evaluates each finding, fixes real bugs, dismisses false positives, and replies to every comment with the outcome.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires git and gh (GitHub CLI) installed. Designed for Claude Code.
|
|
6
|
+
metadata:
|
|
7
|
+
author: pbakaus
|
|
8
|
+
version: "0.3.1"
|
|
9
|
+
homepage: https://github.com/pbakaus/agent-reviews
|
|
10
|
+
allowed-tools: Bash(scripts/agent-reviews.js *), Bash(gh *), Bash(git *), Read, Glob, Grep, Edit, Write, AskUserQuestion, Task, TaskOutput
|
|
5
11
|
---
|
|
6
12
|
|
|
7
13
|
Automatically review, fix, and respond to findings from PR review bots on the current PR. Uses a deterministic two-phase workflow: first fix all existing issues, then poll once for new ones.
|
|
@@ -19,12 +25,12 @@ If no PR exists, notify the user and exit.
|
|
|
19
25
|
### Step 2: Fetch All Bot Comments
|
|
20
26
|
|
|
21
27
|
```bash
|
|
22
|
-
|
|
28
|
+
scripts/agent-reviews.js --bots-only --unanswered
|
|
23
29
|
```
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
This shows only unanswered bot comments. Each comment shows its ID in brackets (e.g., `[12345678]`), the author, file path, and a truncated body.
|
|
26
32
|
|
|
27
|
-
If zero
|
|
33
|
+
If zero comments are returned, print "No unanswered bot comments found" and skip to Phase 2.
|
|
28
34
|
|
|
29
35
|
### Step 3: Process Each Unanswered Comment
|
|
30
36
|
|
|
@@ -33,16 +39,11 @@ For each comment where `hasAnyReply === false`:
|
|
|
33
39
|
#### A. Get Full Detail
|
|
34
40
|
|
|
35
41
|
```bash
|
|
36
|
-
|
|
42
|
+
scripts/agent-reviews.js --detail <comment_id>
|
|
37
43
|
```
|
|
38
44
|
|
|
39
45
|
This shows the full comment body (no truncation), the diff hunk (code context), and all replies. Use this instead of `gh` CLI for comment details.
|
|
40
46
|
|
|
41
|
-
For structured data, use:
|
|
42
|
-
```bash
|
|
43
|
-
node scripts/agent-reviews.js --detail <comment_id> --json
|
|
44
|
-
```
|
|
45
|
-
|
|
46
47
|
#### B. Evaluate the Finding
|
|
47
48
|
|
|
48
49
|
Read the referenced code and determine:
|
|
@@ -103,21 +104,21 @@ Now that the commit hash exists, reply to every processed comment:
|
|
|
103
104
|
|
|
104
105
|
**For each TRUE POSITIVE:**
|
|
105
106
|
```bash
|
|
106
|
-
|
|
107
|
+
scripts/agent-reviews.js --reply <comment_id> "Fixed in {hash}.
|
|
107
108
|
|
|
108
109
|
{Brief description of the fix}"
|
|
109
110
|
```
|
|
110
111
|
|
|
111
112
|
**For each FALSE POSITIVE:**
|
|
112
113
|
```bash
|
|
113
|
-
|
|
114
|
+
scripts/agent-reviews.js --reply <comment_id> "Won't fix: {reason}
|
|
114
115
|
|
|
115
116
|
{Explanation of why this is intentional or not applicable}"
|
|
116
117
|
```
|
|
117
118
|
|
|
118
119
|
**For each SKIPPED:**
|
|
119
120
|
```bash
|
|
120
|
-
|
|
121
|
+
scripts/agent-reviews.js --reply <comment_id> "Skipped per user request"
|
|
121
122
|
```
|
|
122
123
|
|
|
123
124
|
**DO NOT start Phase 2 until all replies are posted.**
|
|
@@ -131,7 +132,7 @@ node scripts/agent-reviews.js --reply <comment_id> "Skipped per user request"
|
|
|
131
132
|
Launch the watcher in the background. It polls every 30 seconds and exits after 10 minutes of inactivity (no new comments):
|
|
132
133
|
|
|
133
134
|
```bash
|
|
134
|
-
|
|
135
|
+
scripts/agent-reviews.js --watch --bots-only
|
|
135
136
|
```
|
|
136
137
|
|
|
137
138
|
This runs as a background task.
|
|
@@ -320,7 +320,7 @@ async function main() {
|
|
|
320
320
|
const options = parseArgs();
|
|
321
321
|
|
|
322
322
|
if (options.version) {
|
|
323
|
-
console.log("0.3.
|
|
323
|
+
console.log("0.3.1");
|
|
324
324
|
process.exit(0);
|
|
325
325
|
}
|
|
326
326
|
|
|
@@ -361,12 +361,6 @@ async function main() {
|
|
|
361
361
|
process.exit(1);
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
if (!options.json) {
|
|
365
|
-
console.log(
|
|
366
|
-
`${colors.dim}Finding PR for branch: ${branch}...${colors.reset}`
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
364
|
const pr = await findPRForBranch(
|
|
371
365
|
repoInfo.owner,
|
|
372
366
|
repoInfo.repo,
|
|
@@ -395,12 +389,6 @@ async function main() {
|
|
|
395
389
|
process.exit(1);
|
|
396
390
|
}
|
|
397
391
|
|
|
398
|
-
if (!options.json) {
|
|
399
|
-
console.log(
|
|
400
|
-
`${colors.dim}Replying to comment ${options.replyTo}...${colors.reset}`
|
|
401
|
-
);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
392
|
const result = await replyToComment(
|
|
405
393
|
repoInfo.owner,
|
|
406
394
|
repoInfo.repo,
|
|
@@ -432,12 +420,6 @@ async function main() {
|
|
|
432
420
|
process.exit(1);
|
|
433
421
|
}
|
|
434
422
|
|
|
435
|
-
if (!options.json) {
|
|
436
|
-
console.log(
|
|
437
|
-
`${colors.dim}Fetching comments for PR #${prNumber}...${colors.reset}`
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
|
|
441
423
|
const rawData = await fetchPRComments(
|
|
442
424
|
repoInfo.owner,
|
|
443
425
|
repoInfo.repo,
|
|
@@ -475,12 +457,6 @@ async function main() {
|
|
|
475
457
|
}
|
|
476
458
|
|
|
477
459
|
// Default: fetch and display comments
|
|
478
|
-
if (!options.json) {
|
|
479
|
-
console.log(
|
|
480
|
-
`${colors.dim}Fetching comments for PR #${prNumber}...${colors.reset}`
|
|
481
|
-
);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
460
|
const rawData = await fetchPRComments(
|
|
485
461
|
repoInfo.owner,
|
|
486
462
|
repoInfo.repo,
|
|
@@ -494,9 +470,6 @@ async function main() {
|
|
|
494
470
|
|
|
495
471
|
console.log(formatOutput(filtered, options));
|
|
496
472
|
|
|
497
|
-
if (!options.json && prUrl) {
|
|
498
|
-
console.log(`\n${colors.dim}PR: ${prUrl}${colors.reset}`);
|
|
499
|
-
}
|
|
500
473
|
}
|
|
501
474
|
|
|
502
475
|
main().catch((error) => {
|