Coding & EngineeringIntermediate10-20 minutes per PR

AI Code Review

AI quickly finds nulls, missing checks, duplication and test gaps, but it can also be confidently wrong. This skill defines review order, prompts and the boundary of human verification.

Workflow

  1. 1

    Provide context before the diff

    Tell AI the business goal, callers, input range and known constraints before attaching the diff. Review without context only catches syntax and style.

  2. 2

    Review by risk layer

    Use a fixed order: correctness, security, concurrency/performance, maintainability, style. Require every finding to include trigger conditions, impact and a minimal fix; reject vague “consider optimizing” comments.

  3. 3

    Ask AI for failing tests

    For each suspected issue, have AI write a test that reproduces it before changing code. The test must fail before the fix and pass after; otherwise it proves nothing.

  4. 4

    Human-review high-risk findings

    Manually verify findings involving auth, payments, data deletion, concurrency and third-party calls. AI may miss framework conventions or misread lifecycles; never merge its patch blindly.

Recommended prompts

FAQ

Can AI review replace humans?

No. AI is good for broad first-pass screening; architecture trade-offs, business rules and security boundaries still need human judgment.

What should a review prompt include?

Business goal, callers, input range, known constraints, risks to prioritize and an instruction to say when uncertain.

Related skills