Skip to content

Sync address-review command and prompt from react_on_rails#23

Open
justin808 wants to merge 3 commits intomainfrom
jg/sync-address-review
Open

Sync address-review command and prompt from react_on_rails#23
justin808 wants to merge 3 commits intomainfrom
jg/sync-address-review

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Apr 18, 2026

Summary

  • Syncs commands/address-review.md and prompts/address-review.md with the latest versions from shakacode/react_on_rails.
  • Adds the check all reviews override phrase, PR summary checkpoint comments tagged with <!-- address-review-summary -->, and scan-window cutoff logic so repeated runs only triage feedback posted since the last summary.

Test plan

  • Run /address-review <PR> on a PR with an existing summary comment and confirm it only surfaces new feedback.
  • Run /address-review <PR> check all reviews and confirm it rescans the full PR history.

Note

Medium Risk
Although this PR only updates Markdown workflow docs, it materially changes the /address-review process (cutoff-based scanning, new actions, follow-up issue creation), which could cause reviewers/agents to miss older feedback if the cutoff/override is misunderstood.

Overview
Updates the /address-review command and companion prompt to support incremental review triage by default: full-PR scans now start after the latest checkpoint comment marked <!-- address-review-summary -->, with an explicit check all reviews override to rescan history.

Expands fetched data to include review summary bodies and timestamps/URLs, adds guidance for thread-activity-based filtering, and formalizes a quick-action menu (f, f+i, d, r, m) with range selection plus new flows for follow-up issue creation and posting a consolidated PR summary checkpoint after actions.

Reviewed by Cursor Bugbot for commit 987a697. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • "check all reviews" override to bypass scan-window filtering
    • Checkpoint-based scan windows and consolidated PR summary comments to track review state and become the next cutoff
    • Quick-action menu (f, f+i, d, r, m) with range-based selection and validation messages
    • Ingest full-PR review summaries as actionable items and create follow-up issues for deferred items
  • Bug Fixes / Improvements

    • Cutoff-aware messaging distinguishing “no comments found” vs “no new feedback since last summary”
    • Improved timestamp-aware filtering to avoid re-triaging older threads and skipped checkpoint comments
    • Updated merge-ready signaling and explicit push confirmation steps

Pulls in the latest versions from shakacode/react_on_rails, adding the
`check all reviews` override, summary checkpoint comments with the
`<!-- address-review-summary -->` marker, and scan-window cutoff logic
so repeated runs only triage new feedback by default.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

Walkthrough

The address-review workflow adds a check all reviews override, implements a timestamped checkpoint cutoff for scan windows, expands fetched review metadata with timestamps, ingests full-PR review summaries, replaces the old prompt with a quick-action menu, adds follow-up issue creation, and posts a consolidated PR summary checkpoint comment.

Changes

Cohort / File(s) Summary
Address-review docs & workflow
commands/address-review.md
Defines checkpoint-based scan windows using <!-- address-review-summary -->, records CHECK_ALL_REVIEWS override, expands fetched metadata to include created_at/submitted_at, refines cutoff-aware filtering and unresolved-thread evaluation, changes empty/error messaging to reflect cutoff behavior, and explains consolidated PR summary posting.
Prompt/input and control flow
prompts/address-review.md
Parses {{PR_REFERENCE}} with optional check all reviews suffix, resolves repo/PR inputs, adds scan-window discovery for REVIEW_CUTOFF_AT, describes cutoff bypass logic, documents ingestion of review-summary bodies as triage items, replaces interactive triage with quick-action menu (f, f+i, d, r, m) including numeric/range selection validation, and details follow-up issue creation, git push confirmation, and merge-ready signaling rules.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Workflow
    participant GitHubAPI
    participant Repo

    User->>Workflow: invoke /address-review <PR or URL> [optional "check all reviews"]
    Workflow->>GitHubAPI: resolve repo/PR, fetch comments, reviews, review threads (with timestamps)
    GitHubAPI-->>Workflow: return comments/reviews/threads (created_at/submitted_at)
    Workflow->>Workflow: find latest <!-- address-review-summary --> (derive REVIEW_CUTOFF_AT)
    alt CHECK_ALL_REVIEWS not set
        Workflow->>Workflow: filter items by REVIEW_CUTOFF_AT (use latest thread activity)
    end
    Workflow->>User: present quick-action menu (f, f+i, d, r, m) with triage set
    User->>Workflow: select actions (supports numeric/range)
    Workflow->>GitHubAPI: post PR comments / thread replies / create follow-up issue as needed
    GitHubAPI-->>Workflow: ack created comments/issues
    Workflow->>GitHubAPI: post consolidated PR summary comment <!-- address-review-summary -->
    GitHubAPI-->>Workflow: ack summary comment (new cutoff)
    Workflow->>Repo: optionally push changes (after git push confirmation)
    Workflow->>User: report merge-ready status (based on deferred MUST-FIXs)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 A rabbit scanned comments, timestamps in tow,

"Check all reviews" whispers when you want it to go.
Quick actions chosen, some deferred to a thread,
A summary checkpoint marks where we led.
Hoppity follow-ups — onward we tread! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: syncing two documentation files with latest versions from an external repository, which is the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jg/sync-address-review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 18, 2026

Code Review

Overview

This PR syncs the /address-review command and companion prompt from shakacode/react_on_rails, adding three substantial improvements:

  1. Incremental scan-window cutoff — defaults to only triaging feedback since the last <!-- address-review-summary --> checkpoint, with a check all reviews override
  2. Quick-action menu (f, f+i, d, r, m) replacing the old open-ended "which items do you want to address?" prompt
  3. Follow-up issue creation and structured PR summary comments that establish the next scan baseline

The changes are well-structured and the incremental-scan idea is genuinely useful for iterative review cycles.


Bugs

1. review_summary field name mismatch — cutoff filter will silently miss review summaries

Review summary objects are fetched with submitted_at (the GitHub API field name for /pulls/{PR}/reviews), but the cutoff-filter prose says "Filter issue comments and review summaries to items created after REVIEW_CUTOFF_AT" and the inline-thread filter uses created_at > REVIEW_CUTOFF_AT. An AI assistant following these instructions would likely try to compare against a created_at key that doesn't exist on review_summary objects, silently passing all of them through (or filtering none). The fix is either to normalize the field to created_at during fetch or to say submitted_at in the filter rule. See inline comment on commands/address-review.md:92.

2. gh api --input expects a JSON file, not plain markdown

gh api repos/${REPO}/issues/${PR_NUMBER}/comments -X POST --input "${summary_body_file}" passes the file as the raw JSON request body. The script writes plain markdown into that file, which will fail with a JSON parse error. The correct call is either:

  • -F body=@"${summary_body_file}" (field from file), or
  • -f body="$(cat "${summary_body_file}")" (inline string)

gh issue create --body-file (used in Step 9) correctly accepts a plain-text file, but gh api --input does not. See inline comment on commands/address-review.md:399.


Minor

  • Temporary file cleanup: both mktemp blocks have rm -f at the end but no trap ... EXIT guard, so a failure mid-script leaks the temp file. Low risk in practice since these are ephemeral runner environments, but worth noting if the patterns are copied into production scripts.
  • Redundant parentheses in jq (Step 3): ((.body // "") | contains(...)) — the outer parens are no-ops; .body // "" | contains(...) is equivalent and slightly more readable.

Positive notes

  • The reordering of "parse input" before "detect repo" in the prompt file is a good logical fix — you need to know if it's a GitHub URL before deciding how to populate REPO.
  • The outer fence change from ```text to ````text in prompts/address-review.md correctly prevents inner code blocks from breaking the fence.
  • The sort_by(.created_at) | last pattern for finding the latest summary comment is correct and handles the no-match case (returns null) gracefully.
  • The r action's guard against replying to MUST-FIX items is a nice safety rail.

Comment thread commands/address-review.md Outdated
Comment thread commands/address-review.md Outdated
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 18, 2026

Greptile Summary

This PR syncs commands/address-review.md and prompts/address-review.md with the latest version from shakacode/react_on_rails, adding the check all reviews override phrase, PR summary checkpoint comments tagged with <!-- address-review-summary -->, and scan-window cutoff logic so repeated runs only triage feedback posted since the last summary.

  • P1 (commands/address-review.md line 399): The PR summary comment is posted via gh api --input \"${summary_body_file}\", but the file contains plain markdown, not {\"body\": \"...\"} JSON. The GitHub API will reject this with a parse error, meaning no checkpoint comment is ever created and the cutoff mechanism never activates.

Confidence Score: 4/5

Safe to merge after fixing the --input JSON body issue in Step 10, which silently breaks the core cutoff feature.

One P1 defect: the summary checkpoint post will fail at runtime because gh api --input expects a JSON file but the script writes plain markdown. This breaks the cutoff mechanism that the entire PR is designed to introduce. The P2 (submitted_at vs created_at) is a clarity issue that could cause incorrect filtering. All other changes are well-structured and consistent between the command and prompt files.

commands/address-review.md — specifically Step 10 (line 399) and the cutoff filtering prose in Step 4 (lines 106-107).

Important Files Changed

Filename Overview
commands/address-review.md Major expansion adding check all reviews override, scan-window cutoff logic, quick-action menu, follow-up issue creation, and PR summary checkpoint posting; the --input flag in Step 10 will cause the summary comment post to fail at runtime.
prompts/address-review.md Standalone prompt file updated to mirror command changes; adds check all reviews override docs and the full 11-step execution flow. No issues found.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["User: /address-review input"] --> B["Step 1-2: Resolve REPO + parse PR reference\nDetect check all reviews flag"]
    B --> C{"CHECK_ALL_REVIEWS?"}
    C -->|Yes| D["Scan full PR history"]
    C -->|No| E["Fetch latest address-review-summary comment"]
    E --> F{"Summary comment exists?"}
    F -->|Yes| G["Set REVIEW_CUTOFF_AT = summary.created_at"]
    F -->|No| D
    G --> H["Step 4: Fetch review data (filtered after cutoff)"]
    D --> H
    H --> I["Step 5: Triage: MUST-FIX / DISCUSS / SKIPPED"]
    I --> J["Step 6-7: Todo list + Quick-action menu"]
    J --> K{"User chooses action"}
    K -->|f or f+i| L["Fix MUST-FIX, commit, push with confirmation"]
    K -->|d| M["Discuss items, user decides"]
    K -->|r| N["Post rationale replies"]
    K -->|m| O["Create follow-up issue, defer all items"]
    L --> P["Step 9: Create follow-up issue (f+i/m only)"]
    M --> P
    N --> P
    O --> P
    P --> Q["Step 10: Post PR summary comment with marker"]
    Q --> R["Step 11: Signal merge-ready or not"]
Loading

Reviews (1): Last reviewed commit: "Sync address-review command and prompt f..." | Re-trigger Greptile

Comment thread prompts/address-review.md Outdated
Comment thread commands/address-review.md Outdated
Comment thread commands/address-review.md
Comment thread prompts/address-review.md Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34b9199003

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread commands/address-review.md Outdated
Comment thread commands/address-review.md Outdated
Address-review would fail at runtime in two ways:

1. The summary checkpoint post used `gh api --input <file>`, which sends
   the file verbatim as the HTTP body. The file held plain markdown, but
   `POST /issues/{issue_number}/comments` requires JSON with a `body`
   field, so every run returned a parse error and never created the
   `<!-- address-review-summary -->` marker, disabling the cutoff
   mechanism on subsequent runs. Switched both call sites to
   `-F body=@<file>` so `gh` wraps the markdown into the expected JSON.

2. Review summaries were projected with `submitted_at`, but the
   cutoff-filter prose uniformly refers to `created_at`. Renamed the
   projection to `created_at: .submitted_at` in both command and prompt
   so the filter logic works uniformly across issue comments, inline
   threads, and review summaries.

Also incorporate two cleanup notes from the review:

- Wrap the two `mktemp` blocks in `trap ... EXIT` so temp files are
  cleaned up even when a step aborts mid-script.
- Drop redundant outer parens in the Step 3 jq `select(...)`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@justin808
Copy link
Copy Markdown
Member Author

Thanks — all four items from this review are addressed in bd809c2:

  • Bug 1 (submitted_at vs created_at): projections in both files now alias submitted_at as created_at so the cutoff filter is uniform across all comment types.
  • Bug 2 (gh api --input vs plain markdown): both call sites (Step 10 in the command file, step 10 in the prompt) switched to -F body=@"${file}".
  • Minor: mktemp cleanup — added trap 'rm -f "${file}"' EXIT to both mktemp blocks (follow-up issue and summary checkpoint) so temp files get cleaned up even on mid-script failure.
  • Minor: redundant jq parens — dropped the extra pair in the Step 3 select(...) so it reads select((.body // "") | contains(...)) instead of select(((.body // "") | contains(...))).

@justin808
Copy link
Copy Markdown
Member Author

Both findings are addressed in bd809c2:

  • P1 (gh api --input sends raw file as JSON body): both call sites (Step 10 in commands/address-review.md and step 10 in prompts/address-review.md) now use gh api ... -F body=@"${summary_body_file}", which lets gh wrap the markdown into the required JSON body field. The summary checkpoint will now post successfully and activate the cutoff on subsequent runs.
  • P2 (submitted_at vs created_at on review summaries): review-summary jq projections in both files now emit created_at: .submitted_at, so the uniform created_at > REVIEW_CUTOFF_AT filter works across issue comments, inline threads, and review summaries.

@justin808
Copy link
Copy Markdown
Member Author

Address-review summary

Scan scope: full PR history (default cutoff — no prior summary comment existed)

Mattered

Skipped

Next default scan starts after this comment. Say check all reviews to rescan the full PR.

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 19, 2026

Tip

For best results, initiate chat on the files or code changes.

@justin808 — Thanks for the thorough checkpoint summary. All items I flagged are accounted for:

  • MUST-FIX #1 (-F body=@"${file}") ✅ — the summary-post step will now correctly wrap the markdown into the body JSON field.
  • MUST-FIX #2 (created_at: .submitted_at) ✅ — the cutoff filter is now uniform across all three comment types.
  • OPTIONAL #3 (trap cleanup) ✅ — temp files are cleaned up even on mid-script failure.
  • OPTIONAL #4 (jq parens) ✅ — cleaner select((.body // "") | contains(...)).

The checkpoint comment is correctly placed to set the scan-window cutoff for future runs. The PR looks good to merge.

[approve]


🧠 Learnings used
Learnt from: CR
Repo: shakacode/claude-code-commands-skills-agents PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-27T00:18:23.937Z
Learning: When the user asks to address PR review comments outside Claude slash commands, follow `prompts/address-review.md`

Learnt from: CR
Repo: shakacode/claude-code-commands-skills-agents PR: 0
File: templates/AGENTS.md:0-0
Timestamp: 2026-03-27T00:18:35.335Z
Learning: Batch review fixes into one follow-up push when practical -- do not create a new commit for each minor comment

Learnt from: CR
Repo: shakacode/claude-code-commands-skills-agents PR: 0
File: templates/AGENTS.md:0-0
Timestamp: 2026-03-27T00:18:35.335Z
Learning: Applies to templates/.claude/commands/address-review.md : Do not edit .claude/commands/address-review.md directly in this project -- update the canonical copy in the boosters repo and re-sync

Learnt from: CR
Repo: shakacode/claude-code-commands-skills-agents PR: 0
File: templates/AGENTS.md:0-0
Timestamp: 2026-03-27T00:18:35.335Z
Learning: Wait for the first full review pass to finish before pushing follow-up commits when addressing PR review comments

Learnt from: CR
Repo: shakacode/claude-code-commands-skills-agents PR: 0
File: templates/AGENTS.md:0-0
Timestamp: 2026-03-27T00:18:35.335Z
Learning: All tests must pass before requesting review

Learnt from: CR
Repo: shakacode/claude-code-commands-skills-agents PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-27T00:18:23.937Z
Learning: Do NOT edit local copies of shared commands like `/address-review` in consuming repos—update the canonical version in this repo instead and re-sync using `bin/sync-commands`

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 19, 2026

The summary comment looks well-formed and the checkpoint tag is correctly placed. A few quick observations:

  1. The created_at normalization (MUST-FIX Add Claude Code GitHub Workflow #2) — good catch and fix. Uniformity across comment types is important for the cutoff filter to work reliably.

  2. The gh api --input fix (MUST-FIX Add shared commands repository structure #1) — switching to -F body= is the right call; --input expects a JSON body, not raw markdown.

  3. The trap ... EXIT addition (OPTIONAL Add /review-all-prs command for comprehensive PR reviews #3) — worth doing even as optional; temp file leaks in long-running triage sessions are annoying.

The checkpoint comment itself (this one) correctly includes <!-- address-review-summary --> in the expected position, so the next default scan will use this as the cutoff. The workflow appears to be functioning as designed.

No blocking issues from my end.

Tip: You can customize Greptile's behavior for this repo with .greptile/rules and .greptile/config.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 19, 2026

Code Review

Overview

This PR syncs commands/address-review.md and prompts/address-review.md from react_on_rails. The headline features are:

  • Incremental scan mode: defaults to triaging only feedback posted after the latest <!-- address-review-summary --> checkpoint comment, avoiding repeated re-triage of already-handled feedback
  • check all reviews override: explicit escape hatch to rescan full PR history
  • Quick-action menu (f, f+i, d, r, m): structured UX replacing the freeform "which items?" prompt
  • Follow-up issue template: bundles deferred items into a tracked GitHub issue
  • PR summary checkpoint: auto-posted after each action to set the next scan cutoff

The design is well-thought-out. The cutoff-scan pattern is a genuine usability improvement and the <!-- address-review-summary --> marker is a clean, grep-friendly anchor. The quad-backtick fix in prompts/address-review.md (to allow nested triple-backtick blocks) is correct.


Issues

Bug: double trap clobbers first cleanup handler

In the shell templates, Step 9 sets trap 'rm -f "${issue_body_file}"' EXIT (line 343 of commands/address-review.md) and Step 10 immediately sets trap 'rm -f "${summary_body_file}"' EXIT (line 385). In bash, each new trap ... EXIT replaces any previously registered handler, so issue_body_file will never be cleaned up when both steps run in the same shell. Combine them:

trap 'rm -f "${issue_body_file}" "${summary_body_file}"' EXIT

or append to the existing trap with $(trap -p EXIT).

Bash-specific printf -v in a template marked as portable shell

printf -v VARNAME is a bash extension and not POSIX. If the LLM (or a user) runs the Step 9 template under /bin/sh, the section-assembly logic silently fails and the follow-up issue body is missing its sections. Either restrict the snippet to bash (#!/bin/bash) or replace printf -v with simple variable assignments.

r all not defined

The r action accepts r all skipped and r all discuss but the natural shorthand r all (all skipped + discuss) is never specified. Users will try it; the prompt should either accept and expand it, or explicitly reject it with a helpful message.

Step-ordering inconsistency between the two files

prompts/address-review.md correctly reorders to parse input before running gh repo view (so the URL's org/repo is available when deciding whether to call gh repo view). commands/address-review.md still runs gh repo view first (Step 1) and handles the URL-override case implicitly later. The commands file should adopt the same ordering improvement.

jq last returns null when no summary comment exists

The cutoff-fetch command pipes through jq ... | last, which returns JSON null when the array is empty. The prose says "scan full history" in that case, but the script template has no guard. If the LLM naively uses .created_at from a null result, it may pass a literal null as REVIEW_CUTOFF_AT. A safe guard:

REVIEW_CUTOFF_AT=$(... | jq -r 'if . == null then "" else .created_at end')

Minor observations

  • The r action says to reject r all must-fix and "direct the user to f or explicit deferral" — good guard — but the action description should also clarify what happens with bare r (no arguments).
  • f action Step 6 says show the discuss-decision menu immediately when f starts with zero MUST-FIX items, but the dynamic menu description (Step 7) only says to omit f/f+i when there are no DISCUSS/SKIPPED items. The two rules together imply f is always shown, which is correct, but worth a clarifying note.
  • For very large PRs the paginated fetches for reviews + inline comments + issue comments + GraphQL threads could be slow or hit secondary rate limits. A note suggesting the user try a specific review URL for large PRs would help.

Comment thread commands/address-review.md
Comment thread commands/address-review.md Outdated
Comment thread commands/address-review.md
Comment thread commands/address-review.md Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
prompts/address-review.md (1)

65-65: Remove unnecessary outer parentheses in jq select expression.

The select expression has an extra set of parentheses: select(((.body // "") | contains(...))). The corresponding command in commands/address-review.md (line 57) uses select((.body // "") | contains(...)) without the outer pair. While both are valid jq syntax, the extra parentheses are unnecessary and create an inconsistency between the two files.

♻️ Simplify jq select for consistency
-    `gh api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments | jq -s '[.[].[] | select(((.body // "") | contains("<!-- address-review-summary -->"))) | {id: .id, created_at: .created_at, html_url: .html_url}] | sort_by(.created_at) | last'`
+    `gh api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments | jq -s '[.[].[] | select((.body // "") | contains("<!-- address-review-summary -->")) | {id: .id, created_at: .created_at, html_url: .html_url}] | sort_by(.created_at) | last'`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@prompts/address-review.md` at line 65, The jq select expression in the
command snippet uses an unnecessary outer pair of parentheses around the select
argument (the instance shown as select(((.body // "") | contains("<!--
address-review-summary -->")))); update that snippet to remove the extra outer
parentheses so it becomes the simpler select((.body // "") | contains(...)) form
matching the other file, ensuring consistency across commands/address-review.md
and this file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@prompts/address-review.md`:
- Line 65: The jq select expression in the command snippet uses an unnecessary
outer pair of parentheses around the select argument (the instance shown as
select(((.body // "") | contains("<!-- address-review-summary -->")))); update
that snippet to remove the extra outer parentheses so it becomes the simpler
select((.body // "") | contains(...)) form matching the other file, ensuring
consistency across commands/address-review.md and this file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6be5f009-8ff6-4afc-845b-e3e53958c89a

📥 Commits

Reviewing files that changed from the base of the PR and between 5f6110d and bd809c2.

📒 Files selected for processing (2)
  • commands/address-review.md
  • prompts/address-review.md

Comment thread commands/address-review.md Outdated
- Fix trap overwrite in `f+i`: Step 10 now cleans up both `issue_body_file` and `summary_body_file` so the Step 9 temp file is not leaked (commands/address-review.md Step 10).
- Replace bash-only `printf -v` with plain variable assignment in the follow-up issue template (commands/address-review.md Step 9).
- Define bare `r` and bare `r all` handling in Action `r`: both are rejected with guidance instead of being silently ignored.
- Null-guard the summary-cutoff `jq ... | last` snippet so an empty result yields `""` (not JSON `null`) and document the empty-cutoff = full-history semantics; mirrored in prompts/address-review.md.
- Reorder Step 1/Step 2 in commands/address-review.md so input parsing runs before repo detection, matching prompts/address-review.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@justin808
Copy link
Copy Markdown
Member Author

All issues flagged in this review are now addressed in 987a697:

  • Trap overwrite (Step 10) — Step 10's trap now cleans up both issue_body_file and summary_body_file so f+i no longer leaks the Step 9 temp file.
  • printf -v bash-only — replaced with plain variable assignments in the Step 9 follow-up-issue template.
  • r all undefined — Action r now explicitly rejects bare r and bare r all with guidance (r all skipped / r all discuss); also clarifies that bare r prompts the user for items.
  • jq last null — Step 3 now uses jq -rs '... | last | if . == null then "" else .created_at end' and the cutoff rules state that an empty REVIEW_CUTOFF_AT means scan full history. Mirrored into prompts/address-review.md.
  • Step-ordering inconsistency between files — swapped Step 1 and Step 2 in commands/address-review.md so input parsing runs before repo detection, matching prompts/address-review.md.

Minor observations (bare r, f with zero must-fix, rate-limit notes) are noted as follow-up candidates.

@justin808
Copy link
Copy Markdown
Member Author

Address-review summary

Scan scope: since previous summary at 2026-04-19T03:37:36Z (default cutoff)

Mattered

Skipped

Next default scan starts after this comment. Say check all reviews to rescan the full PR.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 19, 2026

Code Review

Overview

This PR adds incremental triage to /address-review: by default, repeated runs only surface feedback posted after the latest <!-- address-review-summary --> checkpoint, with a check all reviews override to rescan full history. It also introduces a structured quick-action menu (f, f+i, d, r, m) with range selection and a follow-up issue creation flow.

The overall design is solid and the workflow logic is well-specified. A few items below are worth addressing before merge.


Issues

FOLLOW_UP_URL is used in Step 10 but never explicitly captured in Step 9

Step 10's template references ${FOLLOW_UP_URL} (line 408), but Step 9's rules only say "Return the issue URL to the user" — there's no instruction to assign the gh issue create output to FOLLOW_UP_URL. An LLM following the template literally would silently skip the follow-up URL in the summary comment. Step 9 should explicitly say: capture the URL from gh issue create output and assign it to FOLLOW_UP_URL.

check all reviews phrase: case sensitivity and leading-position not addressed

The phrase is documented only trailing the PR reference (12345 check all reviews). It's unclear whether check all reviews 12345 (phrase first) should work, and whether the match is case-sensitive. A user typing Check All Reviews or prefixing the phrase would silently fall through to a cutoff-filtered scan. The spec should call out the case sensitivity and whether the phrase must be trailing.

MUST_FIX_BLOCK indirection adds confusion (minor)

MUST_FIX_BLOCK="${MUST_FIX_SECTION}" immediately after setting MUST_FIX_SECTION is redundant — the for loop on line 346 could simply reference "${MUST_FIX_SECTION}" directly. This extra alias makes it harder to trace where the value comes from.


Positive observations

  • The jq ... | last | if . == null then "" else .created_at end null guard for empty-array results from --paginate is correct and prevents JSON null from leaking into the cutoff timestamp.
  • Changing the outer code fence in prompts/address-review.md from triple to quadruple backtick is the right fix to allow inner code blocks without breaking the markdown.
  • The explicit disambiguation of bare r and r all (vs r all skipped / r all discuss) is good defensive design.
  • The trap 'rm -f "${issue_body_file:-}" "${summary_body_file}"' EXIT consolidation in Step 10, with the :- guard for the case where Step 9 wasn't run, is a clean solution to the bash trap-replacement limitation — and the comment explaining it is helpful.
  • Fetching full datasets first and then filtering by REVIEW_CUTOFF_AT (rather than filtering at the API level) correctly preserves older thread context for incremental triage.

The user's input is: $ARGUMENTS

## Step 2: Parse User Input
First, detect whether the request includes the exact phrase `check all reviews`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec says "exact phrase" but doesn't define whether matching is case-sensitive or whether the phrase must appear trailing. A user typing Check All Reviews or check all reviews 12345 (leading) would silently fall through to a cutoff-filtered scan instead of seeing an error or override. Consider adding:

Suggested change
First, detect whether the request includes the exact phrase `check all reviews`.
First, detect whether the request includes the phrase `check all reviews` (case-insensitive, trailing position only).

Or, if leading position should also be supported, document that explicitly and note it in the supported-formats list below.

printf '%s\n\n' "<bullets for must-fix/discuss outcomes, or - None.>"
printf '### Skipped\n'
printf '%s\n\n' "<bullets for skipped items, or - None.>"
if [ -n "${FOLLOW_UP_URL}" ]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${FOLLOW_UP_URL} is referenced here but is never explicitly assigned in Step 9. The Step 9 rules say "Return the issue URL to the user" but give no instruction to capture the gh issue create output into this variable. An LLM following the template could skip the follow-up URL line silently.

Step 9 should include an explicit assignment, e.g.:

FOLLOW_UP_URL=$(gh issue create --repo "${REPO}" --title "..." --body-file "${issue_body_file}")

…so Step 10 can reliably reference it.

EOF
)"

MUST_FIX_BLOCK="${MUST_FIX_SECTION}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MUST_FIX_BLOCK is set to the same value as MUST_FIX_SECTION immediately after it's assigned, and is only used in the for-loop and the empty check below. The extra alias adds indirection without benefit — the for-loop and check could reference "${MUST_FIX_SECTION}" directly.

Suggested change
MUST_FIX_BLOCK="${MUST_FIX_SECTION}"
# (remove MUST_FIX_BLOCK; use MUST_FIX_SECTION directly in the for-loop and empty check)

Comment thread prompts/address-review.md
- If `CHECK_ALL_REVIEWS` is true, ignore the cutoff and scan the full PR history.
- If the input is a specific review URL or specific issue-comment URL, fetch that exact target even if it predates the latest summary comment.
- Fetch the latest summary comment before collecting review data. Use a null-safe extraction so an empty result becomes an empty string (not JSON `null`):
`REVIEW_CUTOFF_AT=$(gh api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments | jq -rs '[.[].[] | select(((.body // "") | contains("<!-- address-review-summary -->"))) | {id: .id, created_at: .created_at, html_url: .html_url}] | sort_by(.created_at) | last | if . == null then "" else .created_at end')`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor inconsistency with the commands/ version: this uses double parens select(((.body // "") | contains(...))) while commands/address-review.md (line 59) uses single parens select((.body // "") | contains(...)). Both are valid jq, but keeping them identical reduces divergence between the two files.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@prompts/address-review.md`:
- Line 65: The jq select expression used when computing REVIEW_CUTOFF_AT
contains redundant outer parentheses; update the expression in the
REVIEW_CUTOFF_AT command to match the simplified form used in
commands/address-review.md by removing the extra parentheses around the select
argument so the `select(((.body // "") | contains("<!-- address-review-summary
-->")))` portion becomes the consistent simplified `select((.body // "") |
contains("<!-- address-review-summary -->"))` while keeping the surrounding gh
api and jq pipeline intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ef341e33-f9f4-48be-862a-bec45af312ba

📥 Commits

Reviewing files that changed from the base of the PR and between bd809c2 and 987a697.

📒 Files selected for processing (2)
  • commands/address-review.md
  • prompts/address-review.md

Comment thread prompts/address-review.md
- If `CHECK_ALL_REVIEWS` is true, ignore the cutoff and scan the full PR history.
- If the input is a specific review URL or specific issue-comment URL, fetch that exact target even if it predates the latest summary comment.
- Fetch the latest summary comment before collecting review data. Use a null-safe extraction so an empty result becomes an empty string (not JSON `null`):
`REVIEW_CUTOFF_AT=$(gh api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments | jq -rs '[.[].[] | select(((.body // "") | contains("<!-- address-review-summary -->"))) | {id: .id, created_at: .created_at, html_url: .html_url}] | sort_by(.created_at) | last | if . == null then "" else .created_at end')`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent jq syntax with commands/address-review.md.

The select expression has redundant outer parentheses:

select(((.body // "") | contains("<!-- address-review-summary -->")))

The commands file (line 59) has the simplified version:

select((.body // "") | contains("<!-- address-review-summary -->"))

Both work identically, but per the PR objectives mentioning "removed redundant jq parentheses," these two files should be consistent.

🔧 Proposed fix for consistency
-  `REVIEW_CUTOFF_AT=$(gh api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments | jq -rs '[.[].[] | select(((.body // "") | contains("<!-- address-review-summary -->"))) | {id: .id, created_at: .created_at, html_url: .html_url}] | sort_by(.created_at) | last | if . == null then "" else .created_at end')`
+  `REVIEW_CUTOFF_AT=$(gh api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments | jq -rs '[.[].[] | select((.body // "") | contains("<!-- address-review-summary -->")) | {id: .id, created_at: .created_at, html_url: .html_url}] | sort_by(.created_at) | last | if . == null then "" else .created_at end')`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
`REVIEW_CUTOFF_AT=$(gh api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments | jq -rs '[.[].[] | select(((.body // "") | contains("<!-- address-review-summary -->"))) | {id: .id, created_at: .created_at, html_url: .html_url}] | sort_by(.created_at) | last | if . == null then "" else .created_at end')`
`REVIEW_CUTOFF_AT=$(gh api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments | jq -rs '[.[].[] | select((.body // "") | contains("<!-- address-review-summary -->")) | {id: .id, created_at: .created_at, html_url: .html_url}] | sort_by(.created_at) | last | if . == null then "" else .created_at end')`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@prompts/address-review.md` at line 65, The jq select expression used when
computing REVIEW_CUTOFF_AT contains redundant outer parentheses; update the
expression in the REVIEW_CUTOFF_AT command to match the simplified form used in
commands/address-review.md by removing the extra parentheses around the select
argument so the `select(((.body // "") | contains("<!-- address-review-summary
-->")))` portion becomes the consistent simplified `select((.body // "") |
contains("<!-- address-review-summary -->"))` while keeping the surrounding gh
api and jq pipeline intact.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because on-demand usage is turned off. To enable Bugbot Autofix, turn on on-demand usage and set a spend limit in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 987a697. Configure here.

printf 'Original PR: https://github.com/%s/pull/%s\n' "${REPO}" "${PR_NUMBER}"
} > "${issue_body_file}"

gh issue create --repo "${REPO}" --title "Follow-up: Review feedback from PR #${PR_NUMBER}" --body-file "${issue_body_file}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up issue URL never captured into variable

Medium Severity

Step 9's gh issue create output (the new issue URL) is never captured into FOLLOW_UP_URL, but Step 10's summary-comment template checks ${FOLLOW_UP_URL} and conditionally prints it. Since the variable is never assigned, the condition is always false and the summary comment will never include the follow-up issue link. This breaks the stated requirement to "Mention any follow-up issue URL that was created" and means the f+i and m actions silently omit the reference from the checkpoint comment.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 987a697. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant