Claude Devils Advocate banner
richiethomas richiethomas

Claude Devils Advocate

Git community

Description

Claude Code slash command that simulates a multi-round code review between an Author and Reviewer before opening a PR. Reviews the diff against master, works through topics by priority (correctness → error handling → performance → security → maintainability → testing gaps), and produces a summary with concrete action items.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

devils-advocate

A [Claude Code slash command](https://docs.anthropic.com/en/docs/claude-code/slash-commands) that simulates a multi-round code review between an Author and Reviewer before opening a PR. Reviews the diff against `master`, works through topics by priority (correctness → error handling → performance → security → maintainability → testing gaps), and produces a summary with concrete action items.

Why

Getting useful self-review out of an LLM takes a specific kind of prompting. Without structure, you tend to get shallow style nitpicks, premature agreement, and abstract suggestions like "consider adding error handling" with no actual code. This command addresses those problems:

  • Prioritized topics. Correctness and error handling get reviewed before naming and style, so the important stuff doesn't get crowded out by easy wins.
  • Forced disagreement. The Reviewer must raise a substantive concern every round. The Author must push back before conceding. This counteracts the LLM's tendency to converge too quickly.
  • Concrete output. Both parties must include code snippets or diffs when suggesting changes, not just descriptions.
  • Early termination. If consensus is reached before the round limit, the review stops rather than manufacturing filler.
  • Summary table. Shows rounds and action items per topic at a glance, so you can tell whether another pass is warranted.

Install

Copy `devils-advocate.md` to one of these locations:

# Global (available in all projects)
cp devils-advocate.md ~/.claude/commands/devils-advocate.md

# Project-specific
cp devils-advocate.md .claude/commands/devils-advocate.md

Usage

/devils-advocate 6

The argument sets the maximum number of rounds (defaults to 5 if omitted). The command automatically diffs your current branch against `master`.

What you get

Each round is labeled with the round number and topic (e.g. "Round 3 -- Performance") and contains a back-and-forth between