ArchReview
Features Pricing Docs
GitHub
Start Free Trial
Documentation

Documentation

Everything you need to install, configure, and use ArchReview across your engineering workflow.

Installation

Prerequisites

  • Node.js 18+ — Required for all modes
  • CKB — Required for structural analysis (Health Check, Risk Audit, PR Review checks). Install CKB
  • OpenAI API key — Required only for AI-powered modes (SRP, PR semantic, Refactor). Not needed for Health Check or Risk Audit
  • Git — Required for temporal coupling, bus factor, and PR Review

Install via npm

$ npm install -g archreview

Install from source

$ git clone https://github.com/archreview/archreview.git
$ cd archreview && npm install
$ npm run build

Verify installation

$ archreview --version

Quick Start

Run your first review in under a minute. We'll start with Health Check since it requires zero API keys.

1

Run a health check

No API key needed. Scans dead code, test gaps, complexity, coupling, secrets, and circular dependencies.

$ archreview --mode health-check /path/to/your/repo
■ Connecting to CKB...
■ Running dead code analysis...
■ Checking test gaps...
■ Analyzing complexity...
■ Detecting coupling...
■ Scanning for secrets...
■ Finding cycles...
✔ Health score: 74/100
Dead code: 12 unreferenced symbols
Test gaps: 8 untested functions (complexity > 10)
Secrets: 0 found
Cycles: 1 circular dependency
2

Set up your API key (for AI modes)

Required for SRP Review, PR Review semantic analysis, and Refactor Plan.

$ export OPENAI_API_KEY=sk-...

Tip: The web UI will prompt you for a key if one isn't set. Keys are persisted to .env automatically.

3

Run an SRP review

Full AI-powered analysis: scans, detects responsibility violations, proposes abstractions, generates test contracts.

$ archreview --mode srp-review ./src
4

Launch the web UI

Interactive dashboard with charts, review history, comparison, AI chat, and more.

$ python3 launch.py

Starts the API server (port 3004) and web UI (port 5178). Auto-finds free ports if occupied.

Web UI

The web interface provides an interactive dashboard for running reviews, exploring results, and tracking quality over time.

ArchReview web UI project overview

Navigation

The sidebar provides access to all sections:

Review Panel
Run any mode, see live pipeline progress
Report Card
Radar chart with multi-dimension quality scores
Trend Dashboard
Line chart of scores over time with zone backgrounds
Review History
Unified timeline with comparison between runs
AI Chat
Context-aware Q&A about your codebase
Settings
Quality gates, custom rules, API key management

Command Palette

Press Cmd+K to open the command palette. Fuzzy-search across all sections, modes, and actions.

Configuration

All settings are configured via environment variables. Single source of truth: packages/server/src/config.ts

Variable Default Description
PORT 3004 Server API port
WEB_PORT 5178 Web dev server port
OPENAI_API_KEY Required for AI-powered modes (SRP, PR semantic, Refactor)
OPENAI_MODEL gpt-4o Model for analysis. Also supports gpt-4o-mini, gpt-4-turbo, o3-mini
CKB_COMMAND ckb Path to CKB binary
ARCHREVIEW_DATA_DIR ~/.archreview Storage for projects, reports, cache, and settings
TOKEN_BUDGET 100000 Maximum tokens per review (prevents runaway costs)

Project Setup

Projects persist settings, review history, and baselines. Stored in ~/.archreview/projects.json.

Create a project

In the web UI, click "New Project" and point it at your repository root. Or via the API:

// tRPC client
const project = await trpc.project.create.mutate({
name: 'my-webapp',
path: '/Users/you/projects/webapp',
});

What's stored per project

  • Repository path and name
  • Quality gate thresholds (min score, max criticals, max total findings)
  • Custom architectural rules
  • Dismissed finding fingerprints
  • Baseline snapshots for clean-as-you-code
  • Review history and trend data

Review Modes

ArchReview has 5 review modes, each targeting a different aspect of your codebase. Modes that don't require AI can run completely free with zero API costs.

SRP Review

AI Required

Deep Single Responsibility Principle analysis. Detects files with too many responsibilities and proposes concrete fixes.

Pipeline

scan analyze design specify report

What you get

  • Violations — Fan-out/fan-in evidence, mixed import patterns, responsibility count per file
  • Abstractions — AI-proposed interfaces with TypeScript signatures and migration plans
  • Test contracts — Generated test skeletons with edge cases for each proposed abstraction
  • Migration plan — Phased adoption with dependency ordering
$ archreview --mode srp-review --depth deep ./src

Cost note: This mode makes multiple LLM calls (analyze + design + specify). Use --depth quick for a faster, cheaper pass.

PR Review

AI Optional

Fast PR quality gates designed for CI. 20 structural checks run in ~5 seconds; the AI layer only kicks in when issues are found.

Structural checks (CKB, no AI)

Secrets Breaking changes Test coverage Complexity Coupling Dead code Bug patterns Import cycles Error handling Naming Documentation Security patterns Type safety API contracts DB migrations Config drift Dependency updates Performance Accessibility License compliance

Smart early exit

If structural score ≥ 90, all checks pass, and the PR has < 100 changed lines, the LLM step is skipped entirely. Zero AI cost for clean PRs.

Output includes

  • Suggested reviewers with expertise areas
  • Review effort estimation (hours + complexity rating)
  • Health delta — which files degraded vs improved
  • Auto-fix suggestions for common patterns
$ archreview --mode pr-review --ci --format sarif

Risk Audit

No AI

8 risk factors scored against 20 compliance frameworks. Pure structural analysis via CKB — zero LLM cost.

Risk factors

Complexity Test Coverage Bus Factor Staleness Security Sensitivity Error Rates Co-change Coupling Churn

Each factor has configurable severity thresholds and weights. The audit produces per-factor scores, overall compliance coverage, and quick wins with effort/impact sizing.

$ archreview --mode risk-audit --frameworks gdpr,hipaa,soc2

See Compliance Frameworks for the full list of 20 supported standards.

Health Check

No AI

Six independent checks that run in parallel, producing a 0–100 health score. All local, all free.

Dead Code
SCIP-based unreferenced symbol detection
Test Gaps
Untested functions ranked by cyclomatic complexity
Complexity
Cyclomatic + cognitive complexity per function
Coupling
Co-change file pairs from git with strength ratings
Secrets
26 credential patterns (API keys, tokens, passwords)
Cycles
Circular module dependency detection
$ archreview --mode health-check .

Refactor Plan

AI Required

The most comprehensive mode. Combines structural analysis with multi-persona AI review to generate a phased migration roadmap.

Pipeline (12 stages)

connect architecture hotspots coupling db-coupling priorities personas smells diffs plan report

Analysis includes

  • Hotspots — Files ranked by churn × complexity
  • Temporal coupling — Files that change together in git but aren't structurally related
  • Bus factor — Knowledge concentration risk per file
  • 6 AI personas — Security Architect, Performance Engineer, API Designer, Junior Developer, Test Engineer, Data Engineer
  • Code smells — God Class, Feature Envy, Shotgun Surgery, Divergent Change (86.7% recall)
  • "What If" simulator — See blast radius of extracting a module before you do it
  • Phased roadmap — 3–5 phases with effort/risk/dependency analysis
$ archreview --mode refactor-plan --personas all ./src

Quality Gates

Configure pass/fail thresholds per project. When running in --ci mode, the exit code reflects whether the gate passed.

Threshold Default Description
minScore70Minimum overall score (0–100)
maxCritical0Maximum critical findings allowed
maxTotal10Maximum total findings allowed

Configure via the web UI (Settings → Quality Gates) or the tRPC API. In CI, a failing gate returns exit code 1.

Custom Rules

Define architectural rules in natural language. ArchReview evaluates them using the LLM during AI-powered reviews.

Examples

"API endpoints must have rate limiting middleware"
"Database queries must not appear in controller files"
"All public functions must have JSDoc comments"
"Error responses must use the standard ErrorResponse type"
"No direct imports from internal modules outside their boundary"

Add rules via the web UI (Settings → Architecture Rules) or the tRPC API. Rules are evaluated per-file during SRP and PR Review modes.

Baselines & Dismissals

Clean-as-you-code baseline

Snapshot your current findings as a baseline. Subsequent reviews only show new issues. Useful for adopting ArchReview on legacy codebases without being overwhelmed by existing debt.

Finding dismissal

Dismiss individual findings via the web UI. Dismissals are fingerprint-based (file + rule + line range) and survive across reviews — even if the line number shifts slightly.

Tip: Use baselines for bulk legacy issues. Use dismissals for individual false positives.

AI Chat

Conversational Q&A about your codebase. The AI has context from your latest review scores, findings, and project structure.

Starter suggestions

"What are the riskiest files in this repo?"
"Which modules have the highest coupling?"
"Explain the SRP violations in UserService"
"How should I prioritize the refactoring?"
"What compliance gaps do we have for HIPAA?"
"Which functions need tests most urgently?"

Supports markdown rendering and keeps the last 10 messages as context. Access via the sidebar chat icon or Cmd+Shift+C.

Export Formats

JSON

Full structured output with all findings, scores, metadata, and pipeline events. Best for programmatic consumption.

--format json

Markdown

Human-readable report with tables and code blocks. Ideal for PR comments, wikis, and documentation.

--format markdown

SARIF 2.1.0

GitHub Code Scanning compatible. Upload directly to the Security tab via the GitHub API or Actions.

--format sarif

CLI Reference

archreview [options] <path>
FlagValuesDescription
--mode srp-review | pr-review | risk-audit | health-check | refactor-plan Review mode (required)
--depth quick | normal | deep Analysis depth. Default: normal
--format json | markdown | sarif Output format. Default: json
--output &lt;path&gt; Write report to file instead of stdout
--ci CI mode: exit code 0 = pass, 1 = fail
--frameworks &lt;list&gt; Comma-separated compliance frameworks for risk-audit
--personas all | security,performance,api,junior,test,data AI personas for refactor-plan
--project &lt;name&gt; Use saved project settings
--baseline Compare against baseline (show only new findings)
--verbose Show pipeline events in real-time
--version Print version and exit
--help Show help

GitHub Action

Run ArchReview on every pull request. Posts inline comments and optionally uploads SARIF to Code Scanning.

Basic setup

# .github/workflows/archreview.yml
name: ArchReview
on: [pull_request]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: archreview/action@v1
with:
mode: pr-review
sarif: true
comment: true
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Action inputs

InputDefaultDescription
modepr-reviewReview mode to run
sariffalseUpload SARIF to GitHub Code Scanning
commenttruePost review summary as PR comment
fail-on-gatetrueFail the check if quality gate fails
baselinefalseCompare against project baseline

Webhook API

Trigger reviews programmatically from any system.

Trigger a review

POST /api/webhook/review
Content-Type: application/json
{
"mode": "pr-review",
"repo": "/path/to/repo",
"options": {
"depth": "normal",
"format": "sarif"
}
}

Poll for status

GET /api/webhook/status/:id
Response:
{
"status": "completed",
"score": 87,
"findings": 3,
"gate": "passed",
"reportUrl": "/api/reports/abc123"
}

VS Code Extension

Get architectural feedback right in your editor without switching context.

Inline Diagnostics
Underlines and hover details at the exact line, with severity levels (error, warning, info)
Sidebar Tree
Browse all findings grouped by file and severity. Click to navigate to source.
Status Bar
Live health score in the bottom bar. Click to run a quick health check.
Command Palette
All modes accessible via Cmd+Shift+P → "ArchReview: ..."

Install

$ code --install-extension archreview.archreview

CI/CD Patterns

Gate-only (no AI cost)

Run Health Check in CI to enforce a minimum quality bar with zero API cost:

$ archreview --mode health-check --ci --project my-app .

PR review with SARIF upload

Run PR Review, upload SARIF to GitHub Code Scanning, and fail the build if the gate fails:

$ archreview --mode pr-review --ci --format sarif --output results.sarif

Nightly audit

Run a full Risk Audit on a cron schedule and pipe the markdown report to Slack:

$ archreview --mode risk-audit --format markdown --output audit.md

tRPC API

The server exposes a tRPC API for programmatic access. The web UI and CLI both use this API internally.

Routers

RouterKey procedures
reviewstart (mutation), subscribe (subscription), getReport, listReports
projectcreate, update, delete, list, getSettings, updateSettings
settingsgetApiKey, setApiKey, getGates, updateGates
sourcegetFile, listFiles, getSymbols
chatsend (mutation), getHistory
exporttoMarkdown, toSarif, toJson

Pipeline Events

All review modes are async generators that yield PipelineEvent objects. Subscribe via tRPC to receive real-time progress.

interface PipelineEvent {
stage: string; // e.g. "analyze", "design"
status: 'started' | 'progress' | 'completed' | 'error';
detail?: string; // Human-readable message
data?: unknown; // Stage-specific payload
progress?: number; // 0–100
}

Type Reference

Core domain types are defined in packages/server/src/types/.

review.ts
Violation, Abstraction, TestContract, ReviewResult
pipeline.ts
PipelineEvent, PipelineOptions, ReviewMode
report.ts
Report, ReportCard, HealthScore, ComplianceResult
ckb.ts
CKBSymbol, Architecture, Hotspot, Coupling
settings.ts
QualityGate, CustomRule, ProjectSettings
project.ts
Project, Baseline, DismissedFinding

Compliance Frameworks

The Risk Audit mode supports 20 compliance frameworks grouped by category. Use --frameworks to select specific ones.

Privacy & Data
GDPR CCPA ISO 27701
AI Governance
EU AI Act
Security
ISO 27001 NIST 800-53 OWASP ASVS SOC 2 HIPAA
Industry
PCI DSS DORA NIS2 FDA 21 CFR 11 EU CRA
Supply Chain
SBOM/SLSA
Safety
IEC 61508 ISO 26262 DO-178C
Coding Standards
MISRA IEC 62443

AI Personas

The Refactor Plan mode uses 6 specialized AI reviewer personas, each with focused system prompts.

Security Architect

Authentication, authorization, data exposure, injection, secrets

Performance Engineer

N+1 queries, memory leaks, caching, lazy loading, bundle size

API Designer

Contract stability, versioning, error shapes, naming, pagination

Junior Developer

Readability, confusing logic, missing docs, magic numbers, onboarding

Test Engineer

Coverage gaps, flaky patterns, missing edge cases, test isolation

Data Engineer

Schema design, migrations, query patterns, data integrity, indexing

Select personas via --personas security,test or use --personas all for all six.

Keyboard Shortcuts

Available in the web UI:

1–5 Switch to review mode 1–5
Cmd+K Open command palette
Cmd+Shift+Enter Run batch review
Cmd+Shift+C Open AI chat
Cmd+E Export current report
Esc Close modal / palette

Troubleshooting

CKB not found

Make sure CKB is installed and on your PATH. Run ckb --version to verify. Set CKB_COMMAND to an absolute path if needed.

OpenAI API key invalid

The key is validated on startup. Check that it starts with sk- and has billing enabled. The web UI will prompt you to re-enter it.

Port already in use

Use python3 launch.py which auto-finds free ports. Or set PORT / WEB_PORT manually.

Review takes too long

Use --depth quick for faster passes. Reduce TOKEN_BUDGET to limit LLM calls. Health Check and Risk Audit never call the LLM.

SARIF upload fails on GitHub

Ensure the repository has Code Scanning enabled (Settings → Security → Code scanning). The SARIF file must be under 10MB.

No findings on a large repo

Check that CKB has finished indexing. Run ckb status in the repo root. For SRP review, ensure the path points to a directory with source files.

Changelog

v1.0.0 Latest March 2026
  • + General availability with all 5 review modes
  • + Sessions, tickets, clones, and test backfill
  • + Strangler fig pattern for legacy modernization
  • + Module trends UI and architecture conformance
  • + DB coupling detection and refactoring diffs
  • + 20 compliance frameworks in Risk Audit
  • + Temporal coupling, bus factor, "What If" simulator
  • + 6 AI reviewer personas for Refactor Plan
  • + Code smell detection (86.7% recall)
  • + Review comparison, history, and trend tracking
  • + Custom rules, quality gates, baselines
  • + AI chat, command palette, keyboard shortcuts
  • + SARIF, Markdown, JSON export
  • + GitHub Action, Webhook API, VS Code extension, CLI
Navigation
On This Page