Skip to content

Code Review Workflow

Alessio Rocchi edited this page Jan 27, 2026 · 1 revision

Code Review Workflow

Complete pattern for conducting code reviews with multiple agents.


Overview

Use Researcher, Reviewer, and optionally Adversarial agents to perform comprehensive code reviews.

Workflow

sequenceDiagram
    participant User
    participant Researcher
    participant Reviewer
    participant Adversarial

    User->>Researcher: Analyze changes
    Researcher-->>User: Context & impact
    User->>Reviewer: Review code
    Reviewer-->>User: Quality feedback
    User->>Adversarial: Security review
    Adversarial-->>User: Security issues
Loading

Implementation

Step 1: Start Session

const session = await memory.createSession({
  type: 'code-review',
  pr: 'PR-123',
  repository: 'my-app'
});

Step 2: Analyze Changes

Spawn a researcher agent to analyze the changes in PR-123

Step 3: Code Review

Spawn a reviewer agent to review the code for quality and best practices

Step 4: Security Review (Optional)

For security-critical changes:
Spawn an adversarial agent to find security vulnerabilities

Step 5: Aggregate Feedback

Combine all findings and create review summary

Example

Complete code review for authentication PR:

1. Session: code-review-auth-pr
2. Researcher: Analyzes auth changes
3. Reviewer: Checks code quality
4. Adversarial: Tests for vulnerabilities
5. Result: Comprehensive review report

Related:

Clone this wiki locally