fix: Add code-review plugin example with required --comment flag#1170
Open
gradam26 wants to merge 1 commit intoanthropics:mainfrom
Open
fix: Add code-review plugin example with required --comment flag#1170gradam26 wants to merge 1 commit intoanthropics:mainfrom
gradam26 wants to merge 1 commit intoanthropics:mainfrom
Conversation
The code-review plugin requires the --comment flag to post review comments to the PR. Without it, the review completes but output only goes to terminal. This is a common pitfall when setting up the plugin for CI — the generated workflow from /install-github-app omits the flag, and users see successful runs with no comments posted. Add a new example workflow (examples/pr-review-plugin.yml) and a plugin section in docs/solutions.md showing the correct configuration. Fixes anthropics#1087
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
code-reviewplugin requires the--commentflag to post review comments to the PR. Without it, the review completes successfully but output only goes to terminal — no comments are posted. This is a common pitfall because:/install-github-appomits the--commentflagis_error: falsegiving no indication that comments were silently skippedThis PR adds:
examples/pr-review-plugin.yml— a new example workflow showing the correct plugin-based review setup with--comment, properpull-requests: writepermissions, and explanatory commentsdocs/solutions.md— a new "Plugin Example" section under "Automatic PR Code Review" showing the plugin approach alongside the existing custom-prompt examplesContext
Multiple users have reported this issue:
/install-github-appgenerates brokenclaude-code-review.ymlThe root cause in all cases is the missing
--commentflag in the prompt. The plugin's command file (commands/code-review.md, step 7) explicitly gates comment posting on this argument:Changes
examples/pr-review-plugin.yml(new)Complete working example with:
--commentflag in the promptpull-requests: writepermission--commentis requireddocs/solutions.mdNew "Plugin Example" subsection showing the plugin approach with
--comment, between the existing "Basic Example" and "Enhanced Example" sections.