Skip to content

ci(claude): restore code-review plugin (the posting mechanism), add context - #54

Merged
gonzafg2 merged 1 commit into
mainfrom
ci/claude-review-plugin-context
Jun 11, 2026
Merged

gonzafg2 merged 1 commit into
mainfrom
ci/claude-review-plugin-context

Conversation

@gonzafg2

Copy link
Copy Markdown
Owner

Summary

Fixes the real root cause of why the reviewer analysed PRs but posted nothing.

What I got wrong, and the fix

In #52 I replaced the code-review plugin with a pure custom prompt. The docs make clear that the plugin is the posting mechanism — the canonical code-review workflow in claude-code-action is exactly:

plugins: "code-review@claude-code-plugins"
prompt: "/code-review:code-review ${{ github.repository }}/pull/..."

Without the plugin, Claude had no tool to create inline review comments. It tried gh (denied — hence the 14->4 permission denials across #52/#53) and posted nothing (No buffered inline comments). No amount of prompt tweaking fixed it because the mechanism was missing.

This PR restores the plugin and keeps project-aware behaviour through the two channels the plugin already honours:

  • CLAUDE.md — read automatically by the plugin → the review criteria.
  • --append-system-prompt — the ADR-vs-Rust change-aware lens (don't hunt for bugs in ADRs; apply the hard security rules to crates/).

Net result is better than the original generic plugin: same robust posting, now with project context + a change-aware lens. Model stays claude-sonnet-4-6; pull-requests: write retained.

Type of change

  • Refactor / chore / CI / build

Validation

Like #52/#53 this modifies the review workflow, so its own check will 401 (benign, expected). The real test is the first PR after merge: the reviewer should post inline comments + a summary with zero permission denials this time — because it finally has the posting tool.

Checklist

  • Commits signed off (DCO), Conventional Commits, signed commit, YAML validated.

Honest note

Third iteration on the reviewer (#52 -> #53 -> this). The lesson, now documented: keep the code-review plugin for posting; layer project context via CLAUDE.md + --append-system-prompt, don't replace the plugin.

…ontext

Root cause of the no-post / permission-denials problem: PR #52 removed
the code-review plugin in favour of a pure prompt. But the plugin IS
the posting mechanism — the canonical code-review workflow in the
claude-code-action docs uses `plugins: code-review@claude-code-plugins`
+ `/code-review:code-review`. Without it, Claude has no tool to create
inline review comments, so it tried gh (denied) and posted nothing.

Restore the plugin, and keep the project-aware behaviour two ways the
plugin already honours:
- CLAUDE.md (read automatically by the plugin) for the review criteria;
- --append-system-prompt for the ADR-vs-Rust change-aware lens.

Net result is better than the original generic plugin: same robust
posting, now with project context and a change-aware lens. Model stays
pinned to claude-sonnet-4-6; pull-requests: write retained.

Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2
gonzafg2 merged commit 7ac5550 into main Jun 11, 2026
6 of 7 checks passed
gonzafg2 added a commit that referenced this pull request Jun 11, 2026
In agent mode (explicit prompt) claude-code-action only mounts the
github_inline_comment MCP server when the tool is named in the
action-level allowed tools (install-mcp-server.ts gates on
hasInlineCommentTools); the code-review plugin's own frontmatter cannot
grant it. Every run since #54 ended 'success' with 4-53 permission
denials, 'No buffered inline comments', and nothing posted on PRs
46/47/49/50.

Pass --allowedTools "mcp__github_inline_comment__create_inline_comment"
in claude_args — the same form the action repo's own
.github/workflows/claude-review.yml uses — and upload the execution
transcript as a short-lived artifact so the next posting failure is
diagnosable instead of silent.

Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2
gonzafg2 deleted the ci/claude-review-plugin-context branch July 18, 2026 04:16
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