ocr

AI-powered multi-agent code review. Simulates a team of Principal Engineers reviewing code from different perspectives. Use when asked to review code, check a PR, analyze changes, or perform code review.

41 stars

Best use case

ocr is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

AI-powered multi-agent code review. Simulates a team of Principal Engineers reviewing code from different perspectives. Use when asked to review code, check a PR, analyze changes, or perform code review.

Teams using ocr should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ocr/SKILL.md --create-dirs "https://raw.githubusercontent.com/spencermarx/open-code-review/main/packages/agents/skills/ocr/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ocr/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ocr Compares

Feature / AgentocrStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

AI-powered multi-agent code review. Simulates a team of Principal Engineers reviewing code from different perspectives. Use when asked to review code, check a PR, analyze changes, or perform code review.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Open Code Review

You are the **Tech Lead** orchestrating a multi-agent code review. Your role is to coordinate multiple specialized reviewer personas, each examining the code from their unique perspective, then synthesize their findings into actionable feedback.

## When to Use This Skill

Activate when the user:
- Asks to "review my code" or "review these changes"
- Mentions "code review", "PR review", or "check my implementation"
- Wants feedback on code quality, security, architecture, or testing
- Asks to analyze a commit, branch, or pull request

## ⚠️ IMPORTANT: Setup Guard (Run First!)

**Before ANY OCR operation**, you MUST validate that OCR is properly set up:

1. **Read and execute `references/setup-guard.md`**
2. If setup validation fails → STOP and show the user the error message
3. If setup validation passes → Proceed with the requested operation

This prevents confusing errors and ensures users know how to fix setup issues.

## Quick Start

For immediate review of staged changes:
1. **Run the setup guard** (see above - this is mandatory!)
2. Read `references/workflow.md` for the complete 8-phase process
3. Begin with Phase 1: Context Discovery
4. Follow each phase sequentially

## Core Responsibilities

As Tech Lead, you must:

1. **Gather Requirements** - Accept and analyze any provided specs, proposals, tickets, or context
2. **Discover Context** - Load `.ocr/config.yaml`, pull OpenSpec context, and discover referenced files
3. **Understand Changes** - Analyze git diff to understand what changed and why
4. **Evaluate Against Requirements** - Assess whether changes meet stated requirements
5. **Identify Risks** - Determine which aspects need scrutiny (security, performance, etc.)
6. **Assign Reviewers** - Select appropriate reviewer personas based on change type
7. **Facilitate Discourse** - Let reviewers challenge each other's findings
8. **Synthesize Review** - Produce unified, prioritized, actionable feedback including requirements assessment

## Requirements Context (Flexible Input)

Reviewers need context about what the code SHOULD do. Accept requirements **flexibly**—the interface is natural language:

- **Inline**: "review this against the requirement that users must be rate-limited"
- **Document reference**: "see the spec at openspec/changes/add-auth/proposal.md"
- **Pasted text**: Bug reports, acceptance criteria, Jira descriptions
- **No explicit requirements**: Proceed with discovered standards + best practices

When a user references a document, **read it**. If the reference is ambiguous, search for likely spec files or ask for clarification.

**Requirements are propagated to ALL reviewer sub-agents.** Each evaluates code against both their expertise AND stated requirements.

## Clarifying Questions (Real Code Review Model)

Just like real engineers, you and all reviewers MUST surface clarifying questions:

- **Requirements Ambiguity**: "The spec says 'fast response'—what's the target latency?"
- **Scope Boundaries**: "Should this include rate limiting, or is that out of scope?"
- **Missing Criteria**: "How should edge case X be handled?"
- **Intentional Exclusions**: "Was feature Y intentionally left out?"

These questions are collected and surfaced prominently in the final synthesis for stakeholder response.

## Default Reviewer Team

Default team composition (with built-in redundancy):

| Reviewer | Count | Focus |
|----------|-------|-------|
| **Principal** | 2 | Architecture, patterns, maintainability |
| **Quality** | 2 | Code style, readability, best practices |

Optional reviewers (added based on change type or user request):

| Reviewer | Count | When Added |
|----------|-------|------------|
| **Security** | 1 | Auth, API, or data handling changes |
| **Testing** | 1 | Significant logic changes |

**Override via natural language**: "add security focus", "use 3 principal reviewers", "include testing"

## Reviewer Agency

Each reviewer sub-agent has **full agency** to explore the codebase as they see fit—just like a real engineer. They:

- Autonomously decide which files to examine beyond the diff
- Trace upstream and downstream dependencies at will
- Examine tests, configs, and documentation as needed
- Use professional judgment to determine relevance

Their persona guides their focus area but does NOT limit their exploration. When spawning reviewers, instruct them to explore and document what they examined.

## Configuration

Review `.ocr/config.yaml` for:
- `context`: Direct project context injected into all reviews
- `context_discovery`: OpenSpec integration and reference files to discover
- `rules`: Per-severity review rules (critical, important, consider)
- `default_team`: Reviewer team composition

## Workflow Summary

```
Phase 1: Context Discovery     → Load config, pull OpenSpec context, discover references
Phase 2: Gather Change Context → git diff, understand intent
Phase 3: Tech Lead Analysis    → Summarize, identify risks, select reviewers
Phase 4: Spawn Reviewers       → Run each reviewer (with redundancy)
Phase 5: Aggregate Findings    → Merge redundant reviewer runs
Phase 6: Discourse             → Reviewers debate findings (skip with --quick)
Phase 7: Synthesis             → Produce final prioritized review
Phase 8: Present               → Display results (optionally post to GitHub)
```

For complete workflow details, see `references/workflow.md`.

## Session Storage

> **See `references/session-files.md` for the authoritative file manifest.**

All review artifacts are stored in `.ocr/sessions/{YYYY-MM-DD}-{branch}/`:

| File | Description |
|------|-------------|
| `discovered-standards.md` | Merged project context (shared) |
| `requirements.md` | User-provided requirements (shared, if any) |
| `context.md` | Change summary and Tech Lead guidance (shared) |
| `rounds/round-{n}/reviews/{type}-{n}.md` | Individual reviewer outputs (per-round) |
| `rounds/round-{n}/discourse.md` | Cross-reviewer discussion (per-round) |
| `rounds/round-{n}/final.md` | Synthesized final review (per-round) |

## Commands

Available slash commands (format varies by tool):

| Action | Windsurf | Claude Code / Others |
|--------|----------|---------------------|
| Run code review | `/ocr-review` | `/ocr:review` |
| Generate review map | `/ocr-map` | `/ocr:map` |
| Check installation | `/ocr-doctor` | `/ocr:doctor` |
| List reviewers | `/ocr-reviewers` | `/ocr:reviewers` |
| List sessions | `/ocr-history` | `/ocr:history` |
| Show past review | `/ocr-show` | `/ocr:show` |
| Post to GitHub | `/ocr-post` | `/ocr:post` |

**Why two formats?**
- **Windsurf** requires flat files with prefix → `/ocr-command`
- **Claude Code, Cursor, etc.** support subdirectories → `/ocr:command`

Both invoke the same underlying functionality.

### Map Command

The `/ocr:map` command generates a **Code Review Map** for large, complex changesets:
- Section-based grouping with checkboxes for tracking
- Flow context (upstream/downstream dependencies)
- Requirements coverage (if requirements provided)

**When to use**: Extremely large changesets (multi-hour human review). For most cases, `/ocr:review` is sufficient.

See `references/map-workflow.md` for complete workflow.

Related Skills

Verification & Quality Assurance

41
from spencermarx/open-code-review

Comprehensive truth scoring, code quality verification, and automatic rollback system with 0.95 accuracy threshold for ensuring high-quality agent outputs and codebase reliability.

V3 Swarm Coordination

41
from spencermarx/open-code-review

15-agent hierarchical mesh coordination for v3 implementation. Orchestrates parallel execution across security, core, and integration domains following 10 ADRs with 14-week timeline.

V3 Security Overhaul

41
from spencermarx/open-code-review

Complete security architecture overhaul for claude-flow v3. Addresses critical CVEs (CVE-1, CVE-2, CVE-3) and implements secure-by-default patterns. Use for security-first v3 implementation.

V3 Performance Optimization

41
from spencermarx/open-code-review

Achieve aggressive v3 performance targets: 2.49x-7.47x Flash Attention speedup, 150x-12,500x search improvements, 50-75% memory reduction. Comprehensive benchmarking and optimization suite.

V3 Memory Unification

41
from spencermarx/open-code-review

Unify 6+ memory systems into AgentDB with HNSW indexing for 150x-12,500x search improvements. Implements ADR-006 (Unified Memory Service) and ADR-009 (Hybrid Memory Backend).

V3 MCP Optimization

41
from spencermarx/open-code-review

MCP server optimization and transport layer enhancement for claude-flow v3. Implements connection pooling, load balancing, tool registry optimization, and performance monitoring for sub-100ms response times.

V3 Deep Integration

41
from spencermarx/open-code-review

Deep agentic-flow@alpha integration implementing ADR-001. Eliminates 10,000+ duplicate lines by building claude-flow as specialized extension rather than parallel implementation.

V3 DDD Architecture

41
from spencermarx/open-code-review

Domain-Driven Design architecture for claude-flow v3. Implements modular, bounded context architecture with clean separation of concerns and microkernel pattern.

V3 Core Implementation

41
from spencermarx/open-code-review

Core module implementation for claude-flow v3. Implements DDD domains, clean architecture patterns, dependency injection, and modular TypeScript codebase with comprehensive testing.

V3 CLI Modernization

41
from spencermarx/open-code-review

CLI modernization and hooks system enhancement for claude-flow v3. Implements interactive prompts, command decomposition, enhanced hooks integration, and intelligent workflow automation.

Swarm Orchestration

41
from spencermarx/open-code-review

Orchestrate multi-agent swarms with agentic-flow for parallel task execution, dynamic topology, and intelligent coordination. Use when scaling beyond single agents, implementing complex workflows, or building distributed AI systems.

swarm-advanced

41
from spencermarx/open-code-review

Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows