Skip to content

Sync address-review command with react_on_rails upstream#22

Closed
justin808 wants to merge 2 commits intomainfrom
jg/sync-ror-commands
Closed

Sync address-review command with react_on_rails upstream#22
justin808 wants to merge 2 commits intomainfrom
jg/sync-ror-commands

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Apr 18, 2026

Summary

Brings commands/address-review.md in sync with the significantly evolved upstream version at shakacode/react_on_rails/.claude/commands/address-review.md.

Key additions: summary cutoff system with <!-- address-review-summary --> markers for incremental review passes, check all reviews override, quick-action menu (f / f+i / d / r / m) with range syntax (1,3-5), follow-up GitHub issue creation for deferred items, consolidated PR summary checkpoint comment after each action, explicit merge-ready signal, review summary body fetching, timestamp-based filtering, and push confirmation.

The other react_on_rails commands (run-ci.md, update-changelog.md) are repo-specific and were not ported.

Test plan

  • Run /address-review <PR URL> on a PR with existing review comments and verify the quick-action menu renders with dynamic item numbers
  • Re-run on the same PR and confirm only new activity is triaged after the <!-- address-review-summary --> cutoff
  • Run with check all reviews and confirm full history is rescanned
  • Exercise f+i path and confirm a follow-up issue is created and linked in thread replies

🤖 Generated with Claude Code


Note

Medium Risk
Although this is documentation, it significantly changes the /address-review automation workflow (scan cutoffs, reply/resolve behavior, follow-up issue creation, merge-ready signaling), so misunderstandings could lead to missed feedback or incorrect thread resolution.

Overview
Updates the /address-review command spec to support incremental review passes by defaulting full-PR scans to only comments after the latest <!-- address-review-summary --> checkpoint, with a check all reviews override and timestamp-based filtering that considers thread activity.

Expands fetched data to include review summary bodies and adds required timestamps/URLs in API payloads, plus new execution guidance: a quick-action menu (f/f+i/d/r/m) with range selection, optional follow-up issue creation for deferred items, and a single end-of-run PR summary checkpoint + explicit merge-ready/non-ready signal.

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

Summary by CodeRabbit

  • Documentation
    • Updated address-review workflow docs to support full GitHub URLs, scan-window cutoff behavior, timestamp-based filtering, and new messaging when cutoff removes all items
    • Documents the consolidated follow-up-issue flow and bundling rules
  • New Features
    • Quick-action menu with range syntax, check all reviews override, persistent PR summary checkpoint, and explicit merge-readiness signaling

Brings over significant upstream improvements from
shakacode/react_on_rails `.claude/commands/address-review.md`:

- Summary cutoff system using `<!-- address-review-summary -->` markers
  for incremental review passes; default to only new feedback
- `check all reviews` override to rescan full PR history
- Quick-action menu (f / f+i / d / r / m) with range syntax (e.g. 1,3-5)
  replacing free-text item selection
- Follow-up GitHub issue creation (Step 9) bundling deferred items
- Consolidated PR summary checkpoint comment posted after each action
  (Step 10) to anchor the next cutoff
- Explicit merge-ready signal (Step 11)
- Fetch standalone review summary bodies from /pulls/{N}/reviews
- Timestamp-based filtering via created_at/submitted_at
- Require push confirmation before running git push

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

coderabbitai Bot commented Apr 18, 2026

Walkthrough

Updates commands/address-review.md to convert the one-shot triage flow into a persistent, checkpointed /address-review workflow: accepts full GitHub repo URLs, introduces scan-window cutoff logic and timestamps, revises triage/filtering, adds a quick-action menu, follow-up issue bundling, and posts a single persistent PR summary checkpoint.

Changes

Cohort / File(s) Summary
Address Review Workflow Documentation
commands/address-review.md
Reworks the /address-review doc from a single “triage → address → resolve” flow to a persistent, checkpointed workflow. Adds full-GitHub-URL parsing (org/repo), a check all reviews override, scan-window cutoff with REVIEW_CUTOFF_AT, additional timestamp metadata for comments/reviews, updated triage/filter rules (skip prior checkpoints, treat replies as context), a quick-action menu (f, f+i, d, r, m) with range syntax and chaining, consolidated follow-up-issue bundling, explicit merge-readiness signaling, and a single PR summary checkpoint comment marker <!-- address-review-summary -->.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Workflow
    participant GitHub
    participant IssueTracker
    User->>Workflow: Invoke /address-review (optional full repo URL)
    Workflow->>GitHub: Parse repo, fetch PR, fetch latest <!-- address-review-summary --> comment
    GitHub-->>Workflow: return prior checkpoint (if any) with timestamp
    Workflow->>GitHub: fetch reviews, review comments, issue comments (include created_at/submitted_at)
    GitHub-->>Workflow: return review & comment metadata
    Workflow->>Workflow: apply REVIEW_CUTOFF_AT (unless check-all override), filter/triage items
    Workflow->>User: present quick-action menu (f, f+i, d, r, m) and item ranges
    User->>Workflow: choose actions / chains
    Workflow->>GitHub: perform actions (post comments, resolve threads, anchor replies)
    alt follow-up needed
        Workflow->>IssueTracker: create follow-up issue (bundle selected items)
        IssueTracker-->>Workflow: return follow-up URL
    end
    Workflow->>GitHub: post exactly one `<!-- address-review-summary -->` PR comment with outcomes and follow-up URL
    GitHub-->>User: visible PR summary checkpoint
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nudged the threads, then hopped away,
Checkpoints and cutoffs now guide the day.
Quick actions lined in a neat little row,
Follow-ups bundled where task-flowers grow.
A tiny rabbit, proud of this flow 🌿

🚥 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 'Sync address-review command with react_on_rails upstream' directly and accurately describes the main change: bringing the address-review.md command into sync with an upstream version.
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-ror-commands

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.

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 with the significantly evolved upstream version, adding an incremental summary-cutoff system, a quick-action menu (f/f+i/d/r/m) with range syntax, follow-up issue creation, timestamp-based filtering, and an explicit merge-ready signal.

  • P1 – Step 10 summary comment will silently fail: gh api ... --input \"${summary_body_file}\" sends raw markdown as the HTTP body, but GitHub's API requires JSON ({\"body\":\"...\"}). Since this summary comment is also the cutoff anchor for future runs, every subsequent incremental scan will fall back to a full-history scan until fixed.
  • P2 – Timestamp field ambiguity: The cutoff filter prose says "created after REVIEW_CUTOFF_AT" but review summaries expose submitted_at, not created_at; an agent that looks for created_at will silently skip the cutoff check for review summary bodies.

Confidence Score: 4/5

Safe to merge after fixing the gh api --input JSON encoding bug in Step 10; everything else is additive and well-structured.

One P1 bug: the summary comment POST in Step 10 will fail because raw markdown is sent where JSON is required, breaking the entire cutoff mechanism for future runs. The rest of the additions are solid and faithfully replicate upstream intent.

commands/address-review.md — line 399 (gh api --input encoding bug)

Important Files Changed

Filename Overview
commands/address-review.md Significant upstream sync adding summary-cutoff, quick-action menu, follow-up issue creation, and merge-ready signalling; contains a P1 bug where Step 10 posts the summary comment with gh api --input using raw text instead of JSON, which will cause the cutoff mechanism to silently fail.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["/address-review input"] --> B{Contains 'check all reviews'?}
    B -- yes --> C[Set CHECK_ALL_REVIEWS flag]
    B -- no --> D[Parse PR number / URL / anchor]
    C --> D
    D --> E{Anchor type?}
    E -- issuecomment --> F[Fetch single issue comment]
    E -- pullrequestreview --> G[Fetch review + inline comments]
    E -- none/PR only --> H[Fetch latest summary comment]
    H --> I{Summary found AND not CHECK_ALL_REVIEWS?}
    I -- yes --> J[Set REVIEW_CUTOFF_AT]
    I -- no --> K[Full history scan]
    J --> L[Fetch all reviews + comments]
    K --> L
    F --> M[Triage Comments]
    G --> M
    L --> M
    M --> N[Present triage + Quick-action menu]
    N --> O{User action}
    O -- f --> P[Fix MUST-FIX, commit, push confirm, reply, resolve]
    O -- f+i --> Q[Fix MUST-FIX + create follow-up issue]
    O -- d --> R[Discuss selected items]
    O -- r --> S[Post rationale replies]
    O -- m --> T[Create follow-up issue, defer all]
    P --> U[Post PR summary comment with marker]
    Q --> U
    R --> U
    S --> U
    T --> U
    U --> V[Merge-ready signal]
Loading

Reviews (1): Last reviewed commit: "Sync address-review command with react_o..." | Re-trigger Greptile

@claude
Copy link
Copy Markdown

claude Bot commented Apr 18, 2026

Code Review: Sync address-review command with react_on_rails upstream

Overview

This PR substantially expands /address-review with incremental scan support (summary cutoff markers), a structured quick-action menu (f/f+i/d/r/m), follow-up issue creation, and explicit merge-ready signaling. The design is solid and the new workflow is meaningfully more useful than the previous version.


Bug (must fix)

Step 10 — gh api --input sends raw markdown as a JSON body (see inline comment on line 399)

gh api --input <file> forwards the file verbatim as the HTTP request body. GitHub's Issues Comments endpoint requires {"body": "..."} JSON, so the summary comment will never be posted — the call will return 422 Unprocessable Entity. The fix is one line:

# Replace:
gh api repos/${REPO}/issues/${PR_NUMBER}/comments -X POST --input "${summary_body_file}"

# With:
gh pr comment "${PR_NUMBER}" --repo "${REPO}" --body-file "${summary_body_file}"

(Step 9's gh issue create --body-file is unaffected — that CLI wrapper handles JSON serialization itself.)


Minor issues

Placeholder vs. shell-variable inconsistency (see inline comment on line 57)

Throughout the file, ${REPO} is a live shell variable while {PR_NUMBER}, {COMMENT_ID}, etc. are prose placeholders. This distinction isn't marked anywhere, so an AI executing the snippet verbatim would expand $REPO correctly but pass the literal string {PR_NUMBER} as a URL segment (→ 404). A one-line comment above each snippet clarifying which tokens need substitution would remove the ambiguity.

printf -v with \n in single-quoted format string (Step 9, lines 323/328)

printf -v DISCUSS_SECTION '### Discuss items\n%s\n' "${DISCUSS_ITEMS}"

printf does interpret \n in the format string regardless of quoting, so this produces the intended newlines. It's correct — just not obvious at a glance.


Strengths

  • Incremental scan design is clean. Using an HTML comment marker (<!-- address-review-summary -->) as a semantic cutoff is pragmatic and requires no external state.
  • check all reviews override is a nice escape hatch with clear documentation.
  • Push confirmation guard is explicit and placed at the right points in each action flow.
  • Range syntax validation (reject reversed/out-of-bounds ranges rather than silently coercing) is good defensive UX.
  • Single sequential numbering across triage categories makes item selection unambiguous.
  • <<'EOF' heredocs in the issue-creation template correctly prevent shell injection of review content.
  • Step 9's guard ([ -z "${MUST_FIX_BLOCK}${DISCUSS_SECTION}${SKIPPED_SECTION}" ]) correctly skips issue creation when there's nothing to defer.

Summary

One concrete bug (Step 10 --input) needs fixing before this is safe to use. The placeholder-vs-variable inconsistency is a pre-existing pattern but worth cleaning up in the new Step 3 command at minimum. Everything else looks good.

Comment thread commands/address-review.md Outdated
Comment thread commands/address-review.md
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

🧹 Nitpick comments (2)
commands/address-review.md (2)

57-58: Use one placeholder convention in command snippets.

The doc mixes {PR_NUMBER} and ${PR_NUMBER} styles in executable snippets. Standardizing to shell variable form in runnable examples will reduce copy/paste errors during execution.

Proposed normalization example
-gh api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments | jq -s '...'
+gh api --paginate repos/${REPO}/issues/${PR_NUMBER}/comments | jq -s '...'

-gh api repos/${REPO}/issues/comments/{COMMENT_ID} | jq '{...}'
+gh api repos/${REPO}/issues/comments/${COMMENT_ID} | jq '{...}'

Also applies to: 73-74, 80-84, 92-99, 255-263, 271-273, 399-400

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@commands/address-review.md` around lines 57 - 58, The command snippets in
commands/address-review.md mix two placeholder conventions ({PR_NUMBER} vs
${PR_NUMBER}); update all executable examples (including the snippet showing gh
api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments and the other
occurrences around the ranges noted) to use the shell variable form ${PR_NUMBER}
(and ${REPO} where applicable) for consistency and to make snippets directly
runnable; search for occurrences of "{PR_NUMBER}" and replace them with
"${PR_NUMBER}" (and likewise normalize any "{REPO}" to "${REPO}") so all
examples use the same shell variable convention.

199-201: Minor readability polish: reduce repeated “If …” sentence starts.

LanguageTool is right here; a quick reword improves flow in procedural steps without changing meaning.

Also applies to: 213-215

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@commands/address-review.md` around lines 199 - 201, Revise the three
procedural bullets (the numbered steps shown as items 1–3 in the snippet) to
remove repetitive sentence-initial "If ..." phrasing by merging conditional
clauses or rephrasing to lead with the action, e.g., convert "If there are no X,
skip Y" patterns into "Skip Y when there are no X" or combine conditions and
actions into single sentences; apply the same rewrite pattern to the similar
block referenced (items covering lines 213–215) so the steps read more smoothly
while preserving exact meaning.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@commands/address-review.md`:
- Around line 369-370: The current sentence ambiguously says "after any chosen
action or completed action chain" and may trigger posting the consolidated PR
comment after intermediate steps (e.g., after `d` before `f+i`), so update the
wording to state that the consolidated PR comment (which sets the next default
review cutoff) must be posted only once at the final stable stopping point of
the current run — i.e., after the user completes the full action or action chain
(`f`, `f+i`, `d`, `r`, `m`, or direct item selection), not after intermediate or
partial actions; revise the sentence to explicitly require posting at the end of
the complete flow.

---

Nitpick comments:
In `@commands/address-review.md`:
- Around line 57-58: The command snippets in commands/address-review.md mix two
placeholder conventions ({PR_NUMBER} vs ${PR_NUMBER}); update all executable
examples (including the snippet showing gh api --paginate
repos/${REPO}/issues/{PR_NUMBER}/comments and the other occurrences around the
ranges noted) to use the shell variable form ${PR_NUMBER} (and ${REPO} where
applicable) for consistency and to make snippets directly runnable; search for
occurrences of "{PR_NUMBER}" and replace them with "${PR_NUMBER}" (and likewise
normalize any "{REPO}" to "${REPO}") so all examples use the same shell variable
convention.
- Around line 199-201: Revise the three procedural bullets (the numbered steps
shown as items 1–3 in the snippet) to remove repetitive sentence-initial "If
..." phrasing by merging conditional clauses or rephrasing to lead with the
action, e.g., convert "If there are no X, skip Y" patterns into "Skip Y when
there are no X" or combine conditions and actions into single sentences; apply
the same rewrite pattern to the similar block referenced (items covering lines
213–215) so the steps read more smoothly while preserving exact meaning.
🪄 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: fb1f2436-ce88-4d70-b5e8-ad5599fcdbd3

📥 Commits

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

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

Comment thread commands/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: fc442cc459

ℹ️ 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
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 2 potential issues.

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 fc442cc. Configure here.

Comment thread commands/address-review.md Outdated
Comment thread commands/address-review.md Outdated
- Step 10: replace `gh api --input` (which sends raw markdown) with `gh pr comment --body-file`; the API expected JSON, so the previous call would 422 and break the cutoff mechanism.
- Step 4: split the ambiguous "created after" cutoff bullet into explicit per-type rules — issue comments and inline threads use `created_at`; review summaries use `submitted_at`.
- Normalize shell snippets to use `${PR_NUMBER}`/`${REVIEW_ID}`/`${COMMENT_ID}`/`${THREAD_ID}` consistently so examples are directly runnable.
- Step 10 timing: require posting the checkpoint only at the final stable stopping point, not after intermediate steps in a chain.
- Readability polish on Action `f`/`f+i` steps.

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

claude Bot commented Apr 19, 2026

Code Review

This is a substantial, well-structured sync from the upstream react_on_rails version. The incremental scan cutoff, quick-action menu, and follow-up issue creation are all additive improvements that materially reduce repeated work on multi-round reviews.

What's good

  • Shell variable fix: {VARIABLE}${VARIABLE} throughout is a real bug fix. Curly-brace-only syntax is not valid bash; without the leading $ those are treated as literal strings. Every API call and GraphQL mutation in the original was broken if executed verbatim.
  • Timestamp-based filtering: Adding created_at/submitted_at to all fetched payloads and the explicit cutoff logic in Step 3/4 is correct and thorough. The field-name discrepancy (submitted_at for review summaries vs created_at for inline comments) is called out clearly.
  • Single sequential numbering (Step 7, line 169): The instruction to not restart numbering per category is a nice fix — without it, range syntax like 1,3-5 becomes ambiguous.
  • Summary checkpoint placement: The rule "do not post after intermediate steps within a chain" is an important guard against polluting the cutoff baseline mid-workflow.
  • mktemp + --body-file pattern: Using temp files for issue/PR bodies avoids shell quoting issues with multi-line markdown content.

Issues and suggestions

1. REVIEW_CUTOFF_AT is never explicitly cleared (Step 3)

The cutoff rules say "If no summary comment exists, scan the full PR history" but never say REVIEW_CUTOFF_AT="". An LLM executing step-by-step that retains variable state from a prior run could carry a stale value. Adding an explicit "set REVIEW_CUTOFF_AT to empty" when the condition is false removes the ambiguity.

2. Step 1 code block executes unconditionally

The prose correctly says "Otherwise, detect the repository from the current checkout" — but the code block below shows REPO=$(gh repo view ...) with no conditional. An LLM may always run gh repo view even when it already set REPO from a URL. The code block should show the fallback guard, e.g.:

# Only if REPO was not already extracted from a URL:
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)

3. r all must-fix rejection is invisible in the menu

Step 8 correctly forbids r all must-fix, but this restriction appears nowhere in the quick-action menu shown to users in Step 7. A user who types r all must-fix will get a surprising refusal with no prior indication. A parenthetical like "(not applicable to must-fix items)" on the r line would set expectations.

4. printf -v is bash-only (Step 9)

printf -v varname format args is a bash built-in. The Step 9 snippet will silently fail or error in sh/dash environments. Since this repo targets gh+shell invocation, the snippet should either carry a #!/usr/bin/env bash note or use DISCUSS_SECTION=$(printf '...' "${DISCUSS_ITEMS}") which works in POSIX sh.

5. Missing check all reviews case-sensitivity note (Step 2)

The spec says "detect the exact phrase check all reviews" without specifying case sensitivity. A user typing "Check All Reviews" would silently fall through to the default cutoff. Worth stating "case-insensitive" if that's the intent (more user-friendly), or "exact case" if intentional.

Minor nits

  • Step 10's bash example has a hardcoded placeholder timestamp (2026-04-01T20:14:33Z) inside the format string; consider making it a ${CUTOFF_TIMESTAMP} variable reference to reinforce that the LLM should substitute the real value.
  • The rm -f "${issue_body_file}" runs unconditionally after gh issue create. If gh fails, the temp file is silently removed with no way to inspect the body. A trap "rm -f '${issue_body_file}'" EXIT at creation time is more robust, but this is spec/example code so low priority.

Summary

This is a solid sync. The four substantive issues above are the most worth addressing before merge: the REVIEW_CUTOFF_AT initialization gap, the Step 1 code block ordering, the r all must-fix UX gap, and the printf -v portability concern. The rest are nits.

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

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

214-214: Optional wording polish for readability.

This section has repetitive sentence openings (“For …”). Consider varying one sentence start to improve scanability.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@commands/address-review.md` at line 214, The bulleted guideline starting with
"For trivial `SKIPPED` items that are not included in the follow-up issue..."
repeats the "For ..." opening and hurts scanability; rephrase one of the
repeated sentences in this section (e.g., change the opening of the fourth
bullet or the neighboring sentence that also begins with "For ...") to vary the
sentence start while preserving meaning—target the sentence that contains "For
trivial `SKIPPED` items that are not included in the follow-up issue
(duplicates, factually incorrect suggestions, status noise), still post
rationale replies and resolve those threads." and rewrite it to something like
"When an item is a trivial `SKIPPED` case (duplicates, factually incorrect
suggestions, or status noise), post a rationale reply and resolve the thread."
to improve readability.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@commands/address-review.md`:
- Around line 92-93: The jq filter used in the gh api command that builds review
objects (the pipeline starting with gh api --paginate ... | jq -s '[.[].[] |
select((.body // "") != "") | {id: .id, type: "review_summary", body: .body,
state: .state, user: .user.login, submitted_at: .submitted_at, html_url:
.html_url}]') should exclude non-submitted reviews: update the select to also
require reviews be submitted (e.g. .submitted_at != null) and not in PENDING
state (e.g. .state != "PENDING") before mapping into the review_summary object
so only actionable, submitted reviews are included.

---

Nitpick comments:
In `@commands/address-review.md`:
- Line 214: The bulleted guideline starting with "For trivial `SKIPPED` items
that are not included in the follow-up issue..." repeats the "For ..." opening
and hurts scanability; rephrase one of the repeated sentences in this section
(e.g., change the opening of the fourth bullet or the neighboring sentence that
also begins with "For ...") to vary the sentence start while preserving
meaning—target the sentence that contains "For trivial `SKIPPED` items that are
not included in the follow-up issue (duplicates, factually incorrect
suggestions, status noise), still post rationale replies and resolve those
threads." and rewrite it to something like "When an item is a trivial `SKIPPED`
case (duplicates, factually incorrect suggestions, or status noise), post a
rationale reply and resolve the thread." to improve readability.
🪄 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: d9a30df0-8b81-4646-bd21-8da8d912c895

📥 Commits

Reviewing files that changed from the base of the PR and between fc442cc and 5d7b1b2.

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

Comment on lines +92 to +93
gh api --paginate repos/${REPO}/pulls/${PR_NUMBER}/reviews | jq -s '[.[].[] | select((.body // "") != "") | {id: .id, type: "review_summary", body: .body, state: .state, user: .user.login, submitted_at: .submitted_at, html_url: .html_url}]'

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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether current PR has review objects that are non-submitted but would be included by body-only filtering.
gh api --paginate "repos/${REPO}/pulls/${PR_NUMBER}/reviews" \
| jq -s '[.[].[] | select((.body // "") != "") | {id, state, submitted_at, html_url}]'

Repository: shakacode/claude-code-commands-skills-agents

Length of output: 580


🌐 Web query:

GitHub API pull request reviews states submitted_at documentation

💡 Result:

In the GitHub REST API, pull request reviews have a 'state' field that can be PENDING, APPROVED, CHANGES_REQUESTED, COMMENT, or DISMISSED. The 'submitted_at' field is a date-time string present only for submitted reviews (not PENDING). PENDING reviews lack submitted_at as they are not submitted. In the GitHub GraphQL API, the PullRequestReview object has a 'state' enum (PENDING, COMMENTED, APPROVED, CHANGES_REQUESTED, DISMISSED) and 'submittedAt' field indicating submission time. Official documentation: https://docs.github.com/en/rest/pulls/reviews (REST API, up-to-date as of API version 2026-03-10).

Citations:


Exclude non-submitted reviews from summary triage input.

This query can pull PENDING draft reviews that have body text but have not been submitted yet. Filter to submitted reviews (non-null submitted_at and excluding state: "PENDING") before classifying as actionable.

Suggested adjustment
-gh api --paginate repos/${REPO}/pulls/${PR_NUMBER}/reviews | jq -s '[.[].[] | select((.body // "") != "") | {id: .id, type: "review_summary", body: .body, state: .state, user: .user.login, submitted_at: .submitted_at, html_url: .html_url}]'
+gh api --paginate repos/${REPO}/pulls/${PR_NUMBER}/reviews | jq -s '[.[].[]
+  | select((.body // "") != "")
+  | select(.submitted_at != null)
+  | select(.state != "PENDING")
+  | {id: .id, type: "review_summary", body: .body, state: .state, user: .user.login, submitted_at: .submitted_at, html_url: .html_url}
+]'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@commands/address-review.md` around lines 92 - 93, The jq filter used in the
gh api command that builds review objects (the pipeline starting with gh api
--paginate ... | jq -s '[.[].[] | select((.body // "") != "") | {id: .id, type:
"review_summary", body: .body, state: .state, user: .user.login, submitted_at:
.submitted_at, html_url: .html_url}]') should exclude non-submitted reviews:
update the select to also require reviews be submitted (e.g. .submitted_at !=
null) and not in PENDING state (e.g. .state != "PENDING") before mapping into
the review_summary object so only actionable, submitted reviews are included.


- If a summary comment exists and `CHECK_ALL_REVIEWS` is false, set `REVIEW_CUTOFF_AT` to that comment's `created_at` timestamp.
- Use exact timestamps in user-facing status updates, for example: "Scanning review activity after 2026-04-01T20:14:33Z."
- If no summary comment exists, scan the full PR history.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing explicit reset: when the jq query returns null (no summary comment exists), REVIEW_CUTOFF_AT is never set to empty. An LLM with retained state from a prior execution could carry a stale value forward. Suggest adding a line here:

Suggested change
- If no summary comment exists, scan the full PR history.
- If a summary comment exists and `CHECK_ALL_REVIEWS` is false, set `REVIEW_CUTOFF_AT` to that comment's `created_at` timestamp.
- Otherwise (no summary comment, or `CHECK_ALL_REVIEWS` is true), set `REVIEW_CUTOFF_AT` to empty so no cutoff is applied.


```bash
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
```
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 prose says "Otherwise, detect the repository from the current checkout" but the code block below shows gh repo view unconditionally with no guard. An LLM may run it even when REPO was already extracted from a URL. Suggest making the fallback explicit in the code block:

Suggested change
```
If the user input is a full GitHub URL, extract `org/repo` from the URL and use that as `REPO`.
Otherwise, detect the repository from the current checkout:

And in the code block, add a comment like # Fallback: only run if REPO was not extracted from a URL to clarify intent.

f — Fix must-fix items, then confirm whether to reply/resolve skipped items before deciding discuss items
f+i — Fix must-fix + create follow-up issue for discuss/non-trivial skipped items
d — Discuss specific items before deciding (e.g., "d2,4"). Bare "d" presents all DISCUSS items.
r — Reply with rationale to items (e.g., "r3,5", "r7-9", "r all skipped", "r all discuss"); add `+ resolve` to also resolve those threads
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 r all must-fix rejection (defined in Step 8) is invisible here. A user who types r all must-fix will get a surprising refusal with no prior indication. Adding a short note prevents confusion:

Suggested change
r — Reply with rationale to items (e.g., "r3,5", "r7-9", "r all skipped", "r all discuss"); add `+ resolve` to also resolve those threads
r — Reply with rationale to items (e.g., "r3,5", "r7-9", "r all skipped", "r all discuss"); add `+ resolve` to also resolve those threads (not applicable to must-fix items — use `f` or `f+i` instead)


DISCUSS_SECTION=""
if [ -n "${DISCUSS_ITEMS}" ]; then
printf -v DISCUSS_SECTION '### Discuss items\n%s\n' "${DISCUSS_ITEMS}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

printf -v varname is a bash-only built-in; it silently fails or errors in sh/dash. Since the broader script uses bash-specific constructs ($'\n\n', ${VAR%/*}), the whole snippet implicitly requires bash, but it's not stated. Either add a #!/usr/bin/env bash note at the top of the Step 9 snippet or switch to POSIX-compatible assignment:

Suggested change
printf -v DISCUSS_SECTION '### Discuss items\n%s\n' "${DISCUSS_ITEMS}"
DISCUSS_SECTION=$(printf '### Discuss items\n%s\n' "${DISCUSS_ITEMS}")

Same applies to the SKIPPED_SECTION assignment two lines below.

@justin808
Copy link
Copy Markdown
Member Author

Address-review summary

Scan scope: full history (first run on this PR — no prior summary cutoff).

Mattered

MUST-FIX (addressed in 5d7b1b2):

  • commands/address-review.md:399gh api --input was sending raw markdown where the Issues Comments API expects JSON, so the Step 10 checkpoint POST would 422. Swapped to gh pr comment --repo "${REPO}" --body-file. (#discussion_r3105943592)
  • commands/address-review.md:106 — The generic "filter items created after REVIEW_CUTOFF_AT" bullet was ambiguous because review summary objects expose submitted_at, not created_at. Split into explicit per-type rules: issue comments and inline threads compare created_at; review summaries compare submitted_at. (#discussion_r3105944017)

OPTIONAL (addressed in 5d7b1b2):

  • Normalized shell snippets across Steps 3, 4, and 8 to use ${PR_NUMBER}, ${REVIEW_ID}, ${COMMENT_ID}, ${THREAD_ID} consistently so every example is directly runnable. Prose URL-path references kept the bare-placeholder convention since those describe endpoint shapes, not runnable code. (#discussion_r3105943669)
  • Rewrote Step 10 timing guidance to post the summary checkpoint only once, at the final stable stopping point of the run (not after intermediate steps in a chain like f+i → d). (#discussion_r3105944039)
  • Readability polish on Action f and f+i bullets: led with the action instead of repeated "If …" clauses (from CodeRabbit review body).

Skipped

  • 5 inline duplicates of the MUST-FIX items above (greptile, codex, cursor bots) — replied and resolved with cross-links to the canonical threads.
  • 3 bot PR-summary comments (coderabbit walkthrough, greptile summary, claude[bot] detailed review) — all findings already covered by the inline comment replies above; no separate action needed.

No follow-up issue was created; every item either landed in 5d7b1b2 or was a duplicate/bot-summary with no new signal.

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

@justin808
Copy link
Copy Markdown
Member Author

Superseded by #23, which includes this sync plus the companion prompts/address-review.md file and runtime bug fixes flagged in review here.

@justin808 justin808 closed this Apr 19, 2026
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