> ## Documentation Index
> Fetch the complete documentation index at: https://docs.augmentcode.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure a Code Review Pipeline

> Configure a Cosmos PR-to-merge pipeline with specialized Experts for authoring, review, repair, verification, and approval.

## Configure a PR-to-merge pipeline

In AI-native engineering organizations, generating code is no longer the slowest part of shipping software. Review, verification, repair, and human decision-making become the bottlenecks. Cosmos addresses the complete PR-to-merge loop: agents do the mechanical work while humans provide judgment, knowledge transfer, and the final merge decision.

This is [loop engineering](https://www.augmentcode.com/blog/what-is-loop-engineering-and-how-are-leading-software-engineering-teams-using-it) applied to the PR lifecycle. Optimize the verified, understood, merge-ready outcome—not an individual review agent or time to first comment.

<img src="https://mintcdn.com/augment-mtje7p526w/ditxIl-9-ytPi62z/images/cosmos/code-review-pipeline.png?fit=max&auto=format&n=ditxIl-9-ytPi62z&q=85&s=7055919d761e41719c6e1972705bc48b" alt="Cosmos code review pipeline" width="1672" height="941" data-path="images/cosmos/code-review-pipeline.png" />

## The Cosmos code review fleet

Each specialized Expert owns part of the loop. Together they turn a chain of manual handoffs into a coordinated system.

### PR Author / PR Fixer

Choose the Expert that matches how the change entered review:

* [**PR Author**](/cosmos/experts-pr-author) turns a task or ticket into a reviewed pull request or merge request, then stays with it through review comments, CI failures, and merge conflicts.
* [**PR Fixer**](/cosmos/experts-pr-fixer) provides the same follow-up loop for changes created without PR Author. It repairs review findings, CI failures, and merge conflicts, explaining what changed and asking for human judgment when a safe repair is ambiguous.

Together, they provide interchangeable paths into the author-side loop: PR Author for changes it creates, or PR Fixer for changes created elsewhere. Both pair with Deep Reviewer, Pair Reviewer, Verifier, and CI.

### Risk Analyzer

[Risk Analyzer](/cosmos/experts-risk-analyzer) classifies every new or ready-for-review change and applies your organization's auto-approval policy to intrinsically low-risk changes. It routes higher-risk changes to human review with a focused explanation of what needs attention.

* **Role in the pipeline**: Prevents every change from receiving the same expensive level of human attention.
* **Pairs with**: Pair Reviewer for changes that need deeper context or human judgment.

### Deep Reviewer

[Deep Reviewer](/cosmos/experts-deep-reviewer) performs exhaustive, line-by-line analysis for objective correctness defects. It runs autonomously and checks the change against repository guidance such as `AGENTS.md` and `CLAUDE.md`.

* **Role in the pipeline**: Handles objective correctness review before a human spends attention on judgment calls.
* **Pairs with**: PR Fixer, which can repair its findings, and Pair Reviewer for broader judgment.

### Pair Reviewer

[Pair Reviewer](/cosmos/experts-pair-reviewer) reconstructs intent, architecture, product context, and tradeoffs, then guides a human through the decisions that require judgment. It posts comments or a verdict only after human authorization. When instructed, it can monitor whether its comments are addressed and approve on the reviewer's behalf.

* **Role in the pipeline**: Preserves human judgment and knowledge transfer without requiring line-by-line human review.
* **Pairs with**: Risk Analyzer for routing, PR Fixer for repairs, and Memory Manager for team-specific standards.

### Verifier

[Verifier](/cosmos/experts-verifier) exercises affected behavior end to end in a running environment and reports inspectable evidence such as screenshots, logs, traces, and captured outputs.

* **Role in the pipeline**: Replaces confidence based on code inspection alone with runtime evidence.
* **Pairs with**: PR Fixer when verification finds a defect and Pair Reviewer when a human must assess the evidence.

### PR Dashboard Manager

PR Dashboard Manager observes and summarizes each Expert's status, evidence, reviewed commits, and available actions. It is an observer and entry point, not a controller of the other Experts.

* **Role in the pipeline**: Makes the complete review state legible without searching across comments and checks.

### `cosmos approve`

A PR author can comment `cosmos approve` to request evaluation against a configurable approval policy. This path is disabled by default and is distinct from Risk Analyzer's automatic approval of intrinsically low-risk changes.

A policy can require:

1. **Ownership**: The requester is the PR author and an effective CODEOWNER for every modified file.
2. **Current-head review**: There are no unresolved Deep Reviewer findings, Pair Reviewer blockers, or unaddressed human comments.
3. **Runtime evidence**: Verifier has not reported an unaddressed defect against the current commit.

An approval never merges the change. A human always owns and performs the final merge.

### Memory Manager

Memory Manager learns from merged changes and human feedback. It distills comments, replies, reactions, and Pair Reviewer sessions into reusable per-repository knowledge for future reviews.

* **Role in the pipeline**: Makes the review system adapt to local conventions over time.
* **Pairs with**: Every review Expert that benefits from shared team standards and prior feedback.

## Recommended rollout

Start with the complete fleet except Verifier: PR Author, PR Fixer, Risk Analyzer, Deep Reviewer, Pair Reviewer, PR Dashboard Manager, and Memory Manager. This gives your team the core authoring, review, repair, and visibility loops immediately. Optionally enable `cosmos approve` after defining ownership and review requirements.

Once the team is comfortable with that workflow, add Verifier. Runtime verification takes more time to set up because it needs a working test environment and access to exercise the affected behavior.

Finally, customize the fleet for your organization: add custom Experts for domain-specific checks or workflows, and remove Experts that do not provide value for your team.

<Note>
  Teams with strict compliance requirements should define which changes can be auto-approved, who can request approval, which paths always require human review, and how agent approvals are audited.
</Note>

## What changes for engineers

* Agents handle mechanical analysis, repair, and verification.
* Humans focus on architecture, product behavior, security, rollout, and other consequential decisions.
* Evidence and Expert state are visible in one place.
* A human always makes the final merge decision.

## See Also

* [Template Experts](/cosmos/experts-templates) — choose the Experts that make up the pipeline.
* [PR Author](/cosmos/experts-pr-author) and [PR Fixer](/cosmos/experts-pr-fixer) — own new changes end to end or repair changes created elsewhere.
* [Risk Analyzer](/cosmos/experts-risk-analyzer), [Deep Reviewer](/cosmos/experts-deep-reviewer), [Pair Reviewer](/cosmos/experts-pair-reviewer), and [Verifier](/cosmos/experts-verifier) — review and verify each change.
