← AI Code Review with DeepSeek

How to Automate PR Review with DeepSeek

Part of the DeepSeek Harness PR Review guide series · 5-minute setup

Manual code review is slow, inconsistent, and gets skipped when deadlines hit. Automating PR review with DeepSeek gives every pull request the same deep-dive: the description is verified claim-by-claim against the real code, docs are checked against reality, and requirement impact is flagged — before a human ever looks at it.

What the automated review checks

Step 1 — Install

Requirements: Python 3.10+ (auto-detected by the installer), the GitHub CLI (gh) already authenticated, and a DeepSeek API key. One command installs everything into an isolated venv:

curl -fsSL https://raw.githubusercontent.com/nexpeakcore/deepseek-harness-pr-review/main/scripts/install.sh | bash
export DEEPSEEK_API_KEY=sk-...

Or install manually with pip: pip install git+https://github.com/nexpeakcore/deepseek-harness-pr-review.git

Step 2 — Review one PR

harness-pr-review https://github.com/owner/repo/pull/123
# or: harness-pr-review owner/repo 123

This runs the full 5-phase pipeline: snapshot the PR from GitHub, split the description into claims, deep-dive the code with a DeepSeek Harness agent, ask confirmation questions only when uncertain, and write an English report plus one comment on the PR.

Step 3 — Automate: review every new PR

Enable auto review for a repo and the poller handles everything — new PRs are reviewed automatically, and PRs are re-reviewed when the head commit changes:

# autoreview.yml
org: your-org
repos:
  your-repo: auto

# run the poller (or use launchd/cron to run it every 2 minutes)
autoreview --daemon

Step 4 — See the results

The web dashboard shows per-repo KPIs: PRs reviewed, bugs found, doc errors, verdict distribution, and review rounds:

harness-pr-review web   # open http://127.0.0.1:6789

What happens when the agent is uncertain

The agent never guesses. Anything it cannot verify is marked Unverified and turned into a ≤20-word confirmation question for a human. In batch mode those questions are recorded and left for you to answer.

Why this catches things manual review misses

Humans review the diff; the agent reviews the diff against the description, the docs, and the requirements. The most common finding is a PR description that says one thing while the code does another — and docs that were written once and never updated.