Skip to content

fix: Add code-review plugin example with required --comment flag#1170

Open
gradam26 wants to merge 1 commit intoanthropics:mainfrom
gradam26:fix/code-review-plugin-example
Open

fix: Add code-review plugin example with required --comment flag#1170
gradam26 wants to merge 1 commit intoanthropics:mainfrom
gradam26:fix/code-review-plugin-example

Conversation

@gradam26
Copy link
Copy Markdown

@gradam26 gradam26 commented Apr 5, 2026

Summary

The code-review plugin requires the --comment flag 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:

  1. The workflow generated by /install-github-app omits the --comment flag
  2. The plugin README documents it, but the action repo has no example showing the correct setup
  3. Runs complete with is_error: false giving no indication that comments were silently skipped

This PR adds:

  • examples/pr-review-plugin.yml — a new example workflow showing the correct plugin-based review setup with --comment, proper pull-requests: write permissions, and explanatory comments
  • docs/solutions.md — a new "Plugin Example" section under "Automatic PR Code Review" showing the plugin approach alongside the existing custom-prompt examples

Context

Multiple users have reported this issue:

The root cause in all cases is the missing --comment flag in the prompt. The plugin's command file (commands/code-review.md, step 7) explicitly gates comment posting on this argument:

If --comment argument was NOT provided, stop here. Do not post any GitHub comments.

Changes

examples/pr-review-plugin.yml (new)

Complete working example with:

  • --comment flag in the prompt
  • pull-requests: write permission
  • Comments explaining why --comment is required

docs/solutions.md

New "Plugin Example" subsection showing the plugin approach with --comment, between the existing "Basic Example" and "Enhanced Example" sections.

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
@gradam26 gradam26 changed the title docs: add code-review plugin example with required --comment flag Bug Fix: Add code-review plugin example with required --comment flag Apr 5, 2026
@gradam26 gradam26 changed the title Bug Fix: Add code-review plugin example with required --comment flag fix: Add code-review plugin example with required --comment flag Apr 5, 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