Skip to content

Enable pr-review-toolkit plugin in GitHub Actions workflow #39

@matthew-petty

Description

@matthew-petty

Problem

Our local Claude Code environment has access to powerful pr-review-toolkit agents, but our GitHub Actions PR review workflow does not. This creates a significant capability gap.

Local environment has:

  • code-reviewer - Reviews code for adherence to guidelines
  • code-simplifier - Simplifies code while preserving functionality
  • comment-analyzer - Analyzes comments for accuracy
  • pr-test-analyzer - Reviews test coverage quality
  • silent-failure-hunter - Identifies silent failures and error handling issues
  • type-design-analyzer - Expert analysis of type design

GitHub Actions workflow currently:

  • Relies only on prompt-based instructions
  • No access to specialized agents
  • Lower quality reviews compared to local

Proposed Solution: Vendor the Plugin

Instead of relying on marketplace URLs or remote installation, we can vendor the pr-review-toolkit directly into the repository and load it via the --plugin-dir flag.

Step 1: Add plugin to repository

# Copy the plugin from the official claude-code repo
mkdir -p .claude/plugins
# Clone just the pr-review-toolkit directory

The plugin structure we need:

.claude/plugins/pr-review-toolkit/
├── .claude-plugin/
│   └── plugin.json
├── agents/
│   ├── code-reviewer.md
│   ├── code-simplifier.md
│   ├── comment-analyzer.md
│   ├── pr-test-analyzer.md
│   ├── silent-failure-hunter.md
│   └── type-design-analyzer.md
├── commands/
│   └── review-pr.md
└── README.md

Step 2: Update workflow to load the plugin

# .github/workflows/claude-code-review.yml
- name: Run Claude Code Review
  uses: anthropics/claude-code-action@v1
  with:
    claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

    # Load vendored plugin via --plugin-dir
    claude_args: |
      --plugin-dir .claude/plugins/pr-review-toolkit
      --allowed-tools "Bash(gh issue view:*),Bash(gh search:*),..."

    prompt: |
      You have access to the pr-review-toolkit agents. Use them for comprehensive review:
      1. Use silent-failure-hunter to scan for error handling issues
      2. Use type-design-analyzer to review any new TypeScript types
      3. Use pr-test-analyzer to evaluate test coverage
      4. Use code-reviewer for overall guideline adherence

Alternative: Standalone Agents (No Plugin Wrapper)

If --plugin-dir doesn't work with the action, we can copy just the agent markdown files:

.claude/agents/
├── code-reviewer.md
├── code-simplifier.md
├── comment-analyzer.md
├── pr-test-analyzer.md
├── silent-failure-hunter.md
└── type-design-analyzer.md

These would be available as standard agents without the plugin namespace.

Implementation Tasks

  • Clone pr-review-toolkit from anthropics/claude-code/plugins/pr-review-toolkit
  • Add to .claude/plugins/
  • Test --plugin-dir flag works with claude-code-action
  • Update workflow to pass --plugin-dir via claude_args
  • Update prompt to instruct Claude to use the agents
  • Test on a real PR to verify agents are accessible
  • Document the vendoring approach in CONTRIBUTING.md

Open Questions

  1. Does --plugin-dir work with claude-code-action? Need to test.
  2. Should we use git submodule (auto-updates) or vendored copy (stability)?
  3. Do we need to modify the plugin for CI context?

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions