@mechanai/deepreview
v2.6.0
Published
Multi-agent parallel code/spec review for OpenCode
Readme
deepreview
Multi-agent parallel code/spec review for OpenCode. Spawns 5 specialized review agents, cross-validates findings, synthesizes results, and produces an actionable implementation plan.
Install
Run the setup script:
bunx @mechanai/deepreview@latest/setup # Global install (~/.config/opencode/)
bunx @mechanai/deepreview@latest/setup --local # Project-level install (.opencode/)Or with Node.js (v22+):
npx --package @mechanai/deepreview@latest deepreview-setup
npx --package @mechanai/deepreview@latest deepreview-setup --localThis will:
- Add
@mechanai/deepreviewto thepluginarray in youropencode.json(creates the file if needed) - Symlink agents and commands into the appropriate config directory
[!NOTE] The symlinks are needed because OpenCode does not yet auto-discover agents and commands from installed plugin packages.
Usage
/deepreview # Review current branch vs main
/deepreview 123 # Review PR #123
/deepreview file1.ts file2.ts # Review specific files
/deepreview --context decisions.md # Review with design context (suppresses known decisions)
/deepreview-loop # Review + fix loop (repeats until clean or 5 iterations)
/deepreview-loop 123 # Same, targeting a PR
/deepreview-loop --context decisions.md # Loop with design context
/deepreview-spec-loop --context decisions.md spec.md # Spec loop with design context
/deepreview-pr-review 123 # Review PR and post findings as a pending GitHub review
/deepreview-spec spec.md # Spec-focused review (completeness, consistency, feasibility)
/deepreview-spec --context decisions.md spec.md # Spec review with design context
/deepreview-spec-loop spec.md # Spec review + fix loopAll commands accept a branch diff, PR number, or file path(s). The -loop variants
apply fixes automatically and re-review until no findings remain. Pauses on plateaus
(same finding persists across iterations).
Pipeline
graph LR
A[5 Reviewers] --> B[5 Validators]
B --> C[Synthesizer]
C --> D[Planner]
D --> E[Applier]Stages communicate via files on disk — the orchestrator never reads review content into its own context, keeping token usage minimal.
Review agents
| Agent | Code review | Spec review | | --------------------------- | -------------------------------------- | -------------------------------------------- | | correctness / completeness | Logic bugs, edge cases, error handling | Gaps, missing edge cases, undefined behavior | | security / consistency | Vulnerabilities, performance | Contradictions, name mismatches, type drift | | architecture | Patterns, coupling, complexity | Patterns, coupling, complexity | | docs | Comment quality, stale claims | Comment quality, stale claims | | compatibility / feasibility | Breaking changes, API contracts | Implicit dependencies, can it be built |
Requirements
Configuration
Verification (formatting, linting, tests)
After applying fixes, the applier agent runs formatting, linting, and tests. It auto-detects commands based on what exists in your project root:
| File detected | Format | Lint | Test |
| -------------- | ---------------- | ---------------------------------- | --------------- |
| mise.toml | mise run fmt | mise run lint / mise run check | mise run test |
| package.json | npm run format | npm run lint | npm run test |
| Makefile | make fmt | make lint | make test |
If your project uses different commands (e.g., cargo fmt, ruff check --fix),
specify them in AGENTS.md. The applier looks for commands labeled Format, Lint, and
Test (or similar). For example:
- **Format:** `cargo fmt`
- **Lint:** `cargo clippy -- -D warnings`
- **Tests:** `cargo test`The applier checks AGENTS.md (or CLAUDE.md) first, falling back to auto-detection.
If no commands are found and no config files exist, verification is skipped.
When lint fails, the applier attempts to fix errors in the files it modified (up to 2 retry cycles) before reporting the failure.
Upgrade
OpenCode caches plugins on first install and does not automatically check for newer versions. To upgrade:
rm -rf ~/.cache/opencode/packages/@mechanai/deepreview*/Then restart OpenCode. It will re-fetch the latest version.
If you installed with --local, also re-run the setup script to update symlinks:
bunx @mechanai/deepreview@latest/setup --local[!NOTE] If upgrading from the old
npx @anthropic/deepreview installworkflow, remove the old copied files first (rm ~/.config/opencode/agents/deepreview* ~/.config/opencode/commands/deepreview*), then run the setup script above. The setup script uses symlinks instead of copies, so future upgrades only require re-running the script.
Development
This project uses Bun as its runtime and package manager.
bun install
mise run test
mise run lint
mise run fmtLicense
MIT
