Skip to content

Commit 431f76c

Browse files
justin808claude
andcommitted
Address review: capture FOLLOW_UP_URL, sync jq parens, tighten check-all-reviews
- Capture gh issue create output into FOLLOW_UP_URL in Step 9 so Step 10's summary comment can include the link (was previously unset). - Add a "Capture the gh issue create output into FOLLOW_UP_URL" rule line so followers don't miss the assignment. - Drop the redundant MUST_FIX_BLOCK alias and use MUST_FIX_SECTION directly in the empty check and for-loop. - Sync prompts/address-review.md jq select expression with commands/ by removing redundant outer parens. - Tighten check-all-reviews matching in both files: case-insensitive, trailing position only; warn on leading/embedded usage instead of silently falling through to a cutoff-filtered scan. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 987a697 commit 431f76c

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

commands/address-review.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ Fetch review comments from a GitHub PR in this repository, triage them, and crea
1010

1111
The user's input is: $ARGUMENTS
1212

13-
First, detect whether the request includes the exact phrase `check all reviews`.
13+
First, detect whether the request includes the phrase `check all reviews` (case-insensitive, trailing position only — match it as the final tokens of the input, after the PR reference).
1414

1515
- If it does, set a `CHECK_ALL_REVIEWS` flag and remove only that phrase before parsing the PR reference.
16+
- If the phrase appears in any other position (leading, embedded), do not treat it as an override; warn the user and ask them to retry with the trailing form.
1617
- Mention that override in the eventual PR summary comment so future runs have clear history.
1718

1819
Then extract the PR number and optional review/comment ID from the remaining input:
@@ -323,8 +324,6 @@ MUST_FIX_SECTION="$(cat <<'EOF'
323324
EOF
324325
)"
325326

326-
MUST_FIX_BLOCK="${MUST_FIX_SECTION}"
327-
328327
DISCUSS_SECTION=""
329328
if [ -n "${DISCUSS_ITEMS}" ]; then
330329
DISCUSS_SECTION="### Discuss items
@@ -339,11 +338,11 @@ ${SKIPPED_ITEMS}
339338
"
340339
fi
341340

342-
if [ -z "${MUST_FIX_BLOCK}${DISCUSS_SECTION}${SKIPPED_SECTION}" ]; then
341+
if [ -z "${MUST_FIX_SECTION}${DISCUSS_SECTION}${SKIPPED_SECTION}" ]; then
343342
echo "No deferred items found; skip follow-up issue creation."
344343
else
345344
SECTION_CONTENT=""
346-
for section in "${MUST_FIX_BLOCK}" "${DISCUSS_SECTION}" "${SKIPPED_SECTION}"; do
345+
for section in "${MUST_FIX_SECTION}" "${DISCUSS_SECTION}" "${SKIPPED_SECTION}"; do
347346
[ -z "${section}" ] && continue
348347
if [ -n "${SECTION_CONTENT}" ]; then
349348
SECTION_CONTENT="${SECTION_CONTENT}"$'\n\n'
@@ -360,7 +359,7 @@ else
360359
printf 'Original PR: https://github.com/%s/pull/%s\n' "${REPO}" "${PR_NUMBER}"
361360
} > "${issue_body_file}"
362361

363-
gh issue create --repo "${REPO}" --title "Follow-up: Review feedback from PR #${PR_NUMBER}" --body-file "${issue_body_file}"
362+
FOLLOW_UP_URL=$(gh issue create --repo "${REPO}" --title "Follow-up: Review feedback from PR #${PR_NUMBER}" --body-file "${issue_body_file}")
364363
fi
365364
```
366365

@@ -373,6 +372,7 @@ Rules for follow-up issues:
373372
- Include the original reviewer username and comment link for each item
374373
- Include enough context that someone can act on the issue without re-reading the full PR review
375374
- After creating the issue, reference it in thread replies (e.g., "Tracked in #NNN for follow-up")
375+
- Capture the `gh issue create` output into `FOLLOW_UP_URL` (as shown above) so Step 10's summary comment can include the link
376376
- Return the issue URL to the user
377377

378378
## Step 10: Post PR Summary Comment

prompts/address-review.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Execution flow when terminal access is available:
4747
- PR URL plus `check all reviews`
4848
- Specific review URL with `#pullrequestreview-...`
4949
- Specific issue comment URL with `#issuecomment-...`
50-
- Detect the exact phrase `check all reviews`, set a `CHECK_ALL_REVIEWS` flag, and remove only that phrase before parsing the PR reference.
50+
- Detect the phrase `check all reviews` (case-insensitive, trailing position only — must be the final tokens after the PR reference), set a `CHECK_ALL_REVIEWS` flag, and remove only that phrase before parsing the PR reference. If the phrase appears in any other position, do not treat it as an override; warn me and ask me to retry with the trailing form.
5151
- If the input is a full GitHub URL, extract the URL's `org/repo` before running `gh repo view`.
5252
- Extract the PR number and optional review/comment ID.
5353
@@ -62,7 +62,7 @@ Execution flow when terminal access is available:
6262
- If `CHECK_ALL_REVIEWS` is true, ignore the cutoff and scan the full PR history.
6363
- 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.
6464
- 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`):
65-
`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')`
65+
`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')`
6666
- An empty `REVIEW_CUTOFF_AT` means no prior summary comment; scan full history.
6767
- If `REVIEW_CUTOFF_AT` is non-empty and `CHECK_ALL_REVIEWS` is false, use it as the cutoff.
6868
- Use exact timestamps in user-facing status updates, for example `2026-04-01T20:14:33Z`.

0 commit comments

Comments
 (0)