Skip to main content
Configure AgentUse agents to run in GitHub Actions for automated PR reviews, comment responses, and custom workflows. This guide uses agentuse/pr-review-agent as a comprehensive example. You can copy its workflows and agents directly to your project.

Overview

GitHub Actions can run AgentUse agents in response to repository events:
  • PR Reviews: Automatic code review when PRs are opened/updated
  • Comment Replies: Respond to @mentions in PR/issue comments
  • Custom Workflows: Manual or scheduled agent runs

Quick Start

1. Copy Workflow Files

From the agentuse-pr-agents repository:
This gives you:

2. Configure API Keys

Add ONE of these secrets to your repository (Settings → Secrets → Actions):
For Claude Pro/Max users, run npx agentuse auth setup-github in your project directory. Follow the instructions and the command will write the secret to GitHub for you.

3. Done

Open a PR to trigger automatic review, or mention @agentuse in any comment.

Workflow Configuration

PR Code Review Workflow

File: .github/workflows/agentuse-code-review.yml

Key Configuration

Environment Variables

The workflow sets these variables for the agent:

Comment Reply Workflow

File: .github/workflows/agentuse-comment-reply.yml

Key Configuration

Context Variables

Agent File Configuration

Structure

Agent files use YAML frontmatter + markdown:

Model Selection

Override the default model in three ways: 1. Agent file (recommended for consistency):
2. Workflow dispatch input (one-time override):
3. Environment variable (all runs):
Priority: Dispatch input → Env var → Agent file

Tool Permissions

Limit what the agent can do:

Timeout & Step Limits

Advanced Configuration

Filter PRs by Path

Different Models per Task

Skip Draft PRs

Monorepo: Pass Affected Packages

Set environment variable in workflow:
Agent reads it at runtime:

Custom Review Standards

Edit .github/agents/code-review.agentuse:

Debugging

Enable debug mode in workflow:
Common issues:

Security

Limit agent access in CI:

Cost Optimization

Use Cheaper Models

Reduce Token Usage

In agent prompt:

Skip Low-Value PRs

Reference

Common bash commands in agents:

Next Steps

  • Customize agents: Edit .github/agents/*.agentuse to match your workflow
  • Add more workflows: Create agents for deployment, testing, documentation
  • Share across repos: Use organization-level secrets and reusable workflows
  • See Agent Design Patterns for advanced prompt engineering