Skip to content

feat(agents): pr-reviewer, a CodeRabbit-like review of published PRs as the review-bot fallback (#1447) - #1458

Merged
dlrivada merged 10 commits into
mainfrom
feat/pr-reviewer-1447
Sep 27, 2026
Merged

dlrivada merged 10 commits into
mainfrom
feat/pr-reviewer-1447

Conversation

@dlrivada

Copy link
Copy Markdown
Owner

Fixes #1447

Summary

Introduces the pr-reviewer agent, a read-only, CodeRabbit/Copilot-like reviewer that evaluates published pull requests against repository standards. It operates post-publish, using gh pr diff to analyze changes against AGENTS.md, CLAUDE.md, the path_instructions in .coderabbit.yaml, and the linked issue's acceptance criteria. The agent produces a structured report (artifacts/pr-review/<pr>.md) containing a summary, walkthrough, detailed findings with file:line references and severity levels, a per-criterion check against the linked issue, a security review (secrets, personal data, injection, fail-closed gates), and lessons learned. It uses Sonnet by default, escalating to Opus only when the spawn request justifies it. pr-reviewer never posts to GitHub; the orchestrator handles publishing. The existing adversarial-reviewer retains its pre-push, brief-based role.

Changes

  • New Files:

    • .claude/agents/pr-reviewer.md: Agent definition including system prompt, tool usage, and output format.
    • .claude/agents/lessons/pr-reviewer.md: Accumulated lessons for the agent.
    • docs/plans/pr-reviewer-implementation-plan-1447.md: Implementation plan.
    • docs/knowledge/issues/1447.md: Knowledge record documenting dry-run evidence and decisions.
  • Edited Files:

    • .claude/hooks/block-worker-spawn.ps1: Updated spawn allowlist to include pr-reviewer.
    • .claude/hooks/enforce-path-ownership.ps1: Restricted write access to artifacts/pr-review/**; wired to both Write/Edit and Bash/PowerShell matchers to prevent shell-based writes outside the allowed path.
    • .claude/hooks/block-worker-publish.ps1 and .claude/hooks/no-background-specialists.ps1: Updated comments to reflect the new agent's non-publishing role.
    • .claude/hooks/tests/Test-Hooks.ps1: Added regression tests for path-ownership enforcement (including Bash/PowerShell matcher cases) and updated frontmatter self-check to include pr-reviewer and site-steward for block-worker-publish.
    • .claude/agents/README.md: Added pr-reviewer to the agent documentation.
    • .claude/skills/pr-cycle/SKILL.md: Updated workflow to spawn pr-reviewer when CodeRabbit is rate-limited or skips a PR; clarified that adversarial-reviewer remains for gate, CI-workflow, and script PRs.
    • docs/engineering/ai-task-routing.md and docs/engineering/AI-DEVELOPMENT-MODEL.md: Updated agent tables to include pr-reviewer (via docs-writer).

Evidence: dry runs versus CodeRabbit

Dry runs were performed following the agent definition, as the new spawn allowlist is live only after merge.

Details are documented in the knowledge record (docs/knowledge/issues/1447.md).

Verification

  • Test-Hooks.ps1: 729 test cases executed, 0 failed.
  • AST parse clean for every changed .ps1 file.
  • knowledge-records --check: OK.

Review

  • CodeRabbit: No free reviews remaining; did not review this PR.
  • Adversarial Review (pre-push):
    • 1 Major: enforce-path-ownership was initially wired only on the Write/Edit matcher, allowing a shell command to write outside artifacts/pr-review/**. Fixed by also wiring the Bash/PowerShell matcher (consistent with site-steward), with 2 regression test cases added.
    • 1 Minor: The Test-Hooks frontmatter self-check did not name site-steward or pr-reviewer for block-worker-publish. Fixed by adding them to the check.
  • docs-reviewer: Passed all documentation pages.

Cross-cutting checklist (ADR-018)

Tooling-only change (Claude Code agent and hooks); none of the 12 functions apply.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: dlrivada/Encina/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f999e5bb-22c3-42b6-bee0-ca95b7ecaaa9


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dlrivada
dlrivada enabled auto-merge (squash) September 27, 2026 14:25
@dlrivada
dlrivada merged commit 9c629f1 into main Sep 27, 2026
22 checks passed
@dlrivada
dlrivada deleted the feat/pr-reviewer-1447 branch September 27, 2026 14:37
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.

[FEATURE] pr-reviewer agent: CodeRabbit-like review of published PRs as a fallback for external review bots

1 participant