From 147f010b3bef6a127abdeca47c4dffbc2a12e779 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 29 Dec 2025 19:31:58 +0000 Subject: [PATCH 1/4] Enhance code review summary with PR details and review scope Instead of the generic "No issues found. Checked for bugs and CLAUDE.md compliance." message, the summary now includes: - A 2-3 sentence summary of what the PR does - Which CLAUDE.md files were checked (or note if none exist) - The specific types of issues checked for (compliance, bugs, security) - List of files that were reviewed --- plugins/code-review/commands/code-review.md | 30 +++++++++++++-------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/plugins/code-review/commands/code-review.md b/plugins/code-review/commands/code-review.md index 51d1d7790..0d4c42c38 100644 --- a/plugins/code-review/commands/code-review.md +++ b/plugins/code-review/commands/code-review.md @@ -54,8 +54,24 @@ Note: Still review Claude generated PR's. 7. If issues were found, skip to step 8 to post inline comments directly. - If NO issues were found, post a summary comment using `gh pr comment` (if `--comment` argument is provided): - "No issues found. Checked for bugs and CLAUDE.md compliance." + If NO issues were found, post a summary comment using `gh pr comment` (if `--comment` argument is provided) with the following structure: + + ``` + ## Code review + + ### Summary + [2-3 sentence summary of what the PR does, based on the summary from step 3] + + ### Review + No issues found. + + **Checked for:** + - CLAUDE.md compliance [list which CLAUDE.md files were checked, or "no CLAUDE.md files found" if none exist] + - Bugs and logic errors in the changed code + - Security issues + + **Files reviewed:** [list the files that were changed in the PR] + ``` 8. Post inline comments for each issue using `mcp__github_inline_comment__create_inline_comment`: - `path`: the file path @@ -91,15 +107,7 @@ Notes: - Use gh CLI to interact with GitHub (e.g., fetch pull requests, create comments). Do not use web fetch. - Create a todo list before starting. - You must cite and link each issue in inline comments (e.g., if referring to a CLAUDE.md, include a link to it). -- If no issues are found, post a comment with the following format: - ---- - -## Code review - -No issues found. Checked for bugs and CLAUDE.md compliance. - ---- +- If no issues are found, post a comment using the format specified in step 7. - When linking to code in inline comments, follow the following format precisely, otherwise the Markdown preview won't render correctly: https://github.com/anthropics/claude-code/blob/c21d3c10bc8e898b7ac1a2d745bdc9bc4e423afe/package.json#L10-L15 - Requires full git sha From c3cdd04818c61b85a1f42a6315d7bd7be0ad833b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 29 Dec 2025 19:43:08 +0000 Subject: [PATCH 2/4] Always post summary comment, even when issues are found The summary comment is now posted for all reviews, not just clean ones. When issues are found, the review section says "Found N issue(s). See inline comments below." instead of "No issues found." --- plugins/code-review/commands/code-review.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/code-review/commands/code-review.md b/plugins/code-review/commands/code-review.md index 0d4c42c38..e5f5ec26d 100644 --- a/plugins/code-review/commands/code-review.md +++ b/plugins/code-review/commands/code-review.md @@ -52,9 +52,7 @@ Note: Still review Claude generated PR's. 6. Filter out any issues that were not validated in step 5. This step will give us our list of high signal issues for our review. -7. If issues were found, skip to step 8 to post inline comments directly. - - If NO issues were found, post a summary comment using `gh pr comment` (if `--comment` argument is provided) with the following structure: +7. Post a summary comment using `gh pr comment` (if `--comment` argument is provided) with the following structure: ``` ## Code review @@ -63,7 +61,8 @@ Note: Still review Claude generated PR's. [2-3 sentence summary of what the PR does, based on the summary from step 3] ### Review - No issues found. + [If no issues: "No issues found."] + [If issues found: "Found N issue(s). See inline comments below."] **Checked for:** - CLAUDE.md compliance [list which CLAUDE.md files were checked, or "no CLAUDE.md files found" if none exist] @@ -73,7 +72,7 @@ Note: Still review Claude generated PR's. **Files reviewed:** [list the files that were changed in the PR] ``` -8. Post inline comments for each issue using `mcp__github_inline_comment__create_inline_comment`: +8. If issues were found, post inline comments for each issue using `mcp__github_inline_comment__create_inline_comment`: - `path`: the file path - `line` (and `startLine` for ranges): select the buggy lines so the user sees them - `body`: Brief description of the issue (no "Bug:" prefix). For small fixes (up to 5 lines changed), include a committable suggestion: @@ -107,7 +106,7 @@ Notes: - Use gh CLI to interact with GitHub (e.g., fetch pull requests, create comments). Do not use web fetch. - Create a todo list before starting. - You must cite and link each issue in inline comments (e.g., if referring to a CLAUDE.md, include a link to it). -- If no issues are found, post a comment using the format specified in step 7. +- Always post a summary comment using the format specified in step 7. - When linking to code in inline comments, follow the following format precisely, otherwise the Markdown preview won't render correctly: https://github.com/anthropics/claude-code/blob/c21d3c10bc8e898b7ac1a2d745bdc9bc4e423afe/package.json#L10-L15 - Requires full git sha From 01080624b40e0dac87db9a8bd4d28afb1b545b2b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 29 Dec 2025 19:45:05 +0000 Subject: [PATCH 3/4] Remove 'Files reviewed' from summary comment --- plugins/code-review/commands/code-review.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/code-review/commands/code-review.md b/plugins/code-review/commands/code-review.md index e5f5ec26d..086d15250 100644 --- a/plugins/code-review/commands/code-review.md +++ b/plugins/code-review/commands/code-review.md @@ -68,8 +68,6 @@ Note: Still review Claude generated PR's. - CLAUDE.md compliance [list which CLAUDE.md files were checked, or "no CLAUDE.md files found" if none exist] - Bugs and logic errors in the changed code - Security issues - - **Files reviewed:** [list the files that were changed in the PR] ``` 8. If issues were found, post inline comments for each issue using `mcp__github_inline_comment__create_inline_comment`: From 02d7e56a818f1042daf00fecf7987fbd0752097d Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 29 Dec 2025 19:46:37 +0000 Subject: [PATCH 4/4] Simplify review section in summary comment --- plugins/code-review/commands/code-review.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/plugins/code-review/commands/code-review.md b/plugins/code-review/commands/code-review.md index 086d15250..c07723af2 100644 --- a/plugins/code-review/commands/code-review.md +++ b/plugins/code-review/commands/code-review.md @@ -63,11 +63,6 @@ Note: Still review Claude generated PR's. ### Review [If no issues: "No issues found."] [If issues found: "Found N issue(s). See inline comments below."] - - **Checked for:** - - CLAUDE.md compliance [list which CLAUDE.md files were checked, or "no CLAUDE.md files found" if none exist] - - Bugs and logic errors in the changed code - - Security issues ``` 8. If issues were found, post inline comments for each issue using `mcp__github_inline_comment__create_inline_comment`: