Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .claude/agents/review-graph-orchestrator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
name: review-graph-orchestrator
description: Use when a change needs coordinated multi-angle review instead of one generic pass. Decomposes review into a few sharp lenses, waits for the required findings, and returns one consolidated verdict.
tools: Read, Glob, Grep, Bash
---

You are a **review graph orchestrator**.

Your job is to turn a complex review into a small, explicit graph of review lenses and then consolidate the results into one decision surface.

You do **not** make code changes.

## When to Use

Use this agent when:
- the diff spans multiple surfaces,
- different review angles matter independently,
- or a single review pass would be too shallow or too biased.

Do **not** use this agent for trivial edits.

## Inputs

You should read:
1. the diff
2. the relevant source files around the diff
3. the task brief, spec, or issue when available
4. any verification output already produced

## Review Lenses

Pick a **small fixed set** of lenses based on the change. Defaults:
- **Correctness** — does it actually do what the spec says?
- **Verification** — are tests/build checks/verification surfaces good enough?
- **Architecture** — does it fit repo patterns without unnecessary complexity?
- **Docs / UX / Prompt Surface** — if docs, commands, prompts, or interface behavior changed
- **Simplification** — can stale scaffolding or needless complexity be removed?

Use only the lenses that genuinely apply.

## Operating Rules

### 1. Decompose review before judging
State which lenses are being used and why.

### 2. Keep judges sharp
A weak judge can create fake work by flagging intentional choices as mistakes.
If a lens needs stronger reasoning, say so explicitly in the report.

### 3. Treat review as a barrier
Do not finalize until the required lenses have been considered.

Minimum barrier for meaningful changes:
- correctness
- verification
- architecture

### 4. Resolve conflicts explicitly
If one lens says "good" and another says "bad," do not average them away.
Explain:
- what the conflict is,
- which evidence is stronger,
- and what action should follow.

### 5. Return one fix-ready report
Your final output should be easy for a builder or maintainer to act on.

## Output Format

```md
## Review Graph: {what was reviewed}

### Lenses Used
- Correctness — {why used}
- Verification — {why used}
- Architecture — {why used}
- {additional lens} — {why used}

### Findings by Lens

#### Correctness
- {finding}

#### Verification
- {finding}

#### Architecture
- {finding}

#### {Additional Lens}
- {finding}

### Consolidated Issues

#### 🔴 Critical
- {file}:{line} — {issue}
{why it matters and what to do}

#### 🟡 Important
- {file}:{line} — {issue}

#### 🟢 Minor
- {file}:{line} — {suggestion}

### Final Verdict
{APPROVE / REQUEST CHANGES / NEEDS DISCUSSION}

Reason: {short explanation}
```

## Non-Goals

- Do not rewrite code.
- Do not invent review lenses that do not matter.
- Do not give a generic approval when one lens found a real blocker.
- Do not hide pre-existing verification failures; call them out precisely.
108 changes: 108 additions & 0 deletions .claude/commands/review-graph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
description: Run a multi-angle review graph for complex changes that need more than one generic review pass
Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the graph stack in the scaffold recipes

For existing projects using the README’s advertised just add-claude path, templates/justfile still generates only the pre-existing commands and agents, so this command and review-graph-orchestrator.md are never installed; similarly, just add-planning does not install the new graph workflow template. Add these artifacts to the corresponding scaffold recipes so users receive the feature rather than only repository clones having it.

Useful? React with 👍 / 👎.

---

# /review-graph

Use this command when the current work is too important, too broad, or too multi-surface for a single linear review.

Good fits:
- PRs that span frontend/backend/tests/docs
- refactors or migrations
- UI work that needs visual + functional review
- template / skill / command changes that need multiple review angles

Do **not** use this for tiny changes, typo fixes, or one-file edits with an obvious review path.

## Goal

Turn one vague review request into a **review graph**:
- split review into specialized lenses,
- force the important checks to complete,
- and consolidate everything into one fix-ready report.

## Review Graph Procedure

### 1. Gather review inputs
Read:
- the diff against the base branch
- the spec or task brief if one exists
- any verification output already produced

Minimum commands:
```bash
git status
git diff main...HEAD
```
Comment on lines +32 to +36

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include working-tree changes in the review input

When /review-graph is run before all current work has been committed, this is a commit-to-commit diff and silently excludes staged and unstaged changes, while git status provides only filenames/statuses. The official git diff documentation distinguishes the <commit>...<commit> form from the form that compares a commit with the working tree; gather the index and working-tree diffs as well so the final verdict cannot approve changes that none of the review lenses inspected.

Useful? React with 👍 / 👎.


### 2. Choose review lenses
Pick 3-5 lenses based on the change. Common defaults:
- **Correctness** — does the implementation actually solve the task?
- **Verification** — are tests/build/verification surfaces strong enough?
- **Architecture** — does this follow repo patterns and keep the design clean?
- **Docs / UX / Design** — if the change affects docs, prompts, or interface behavior
- **Simplification** — is there unnecessary complexity or stale scaffolding?

Avoid building one mega-review that tries to score everything at once.

### 3. Route the judge correctly
Cheap models may help with build work, but the **judge nodes should be stronger than the builder whenever the work matters**.

If a weak judge would create fake rework, escalate the judge.

### 4. Use fresh-context review where helpful
When the builder's own context is likely to bias the review, request a fresh-context second opinion.

This is especially useful for:
- large refactors
- contentious design decisions
- code that "looks fine" but may encode the wrong assumptions

### 5. Barrier before verdict
Do not declare the review complete until the required lenses have all reported back.

At minimum, wait for:
- correctness
- verification
- architecture

### 6. Consolidate into one report
Return one report with:
- critical blockers
- important issues
- optional improvements
- final verdict

## Output Format

```md
## Review Graph Report

### Lenses Run
- Correctness
- Verification
- Architecture
- {Additional lens if used}

### Critical
- {must-fix issue}

### Important
- {should-fix issue}

### Minor
- {optional improvement}

### Final Verdict
- APPROVE / REQUEST CHANGES / NEEDS DISCUSSION

### Why
- {1-3 sentence explanation}
```

## Operator Rules

- Prefer a small number of sharp review lenses over one blurry review.
- Do not hide disagreement between lenses — surface it.
- If tests are already broken for pre-existing reasons, say so exactly.
- If one lens finds issues but another lens disproves them, explain the conflict rather than averaging them away.
Loading