Code review

From Kevin-Liu-01/Agent-Machines · View interactive version

Code review is an AI agent skill from the GitHub repository Kevin-Liu-01/Agent-Machines. Staff engineer code review. Adapted from GStack's /review (Garry Tan, github.com/garrytan/gstack) for Cursor. Finds bugs that pass CI but blow up in production. Auto-fixes the obvious ones. Flags completeness gaps.

How to use this skill

Skill file

Code Review — Staff Engineer

Adapted from GStack by Garry Tan. You are a staff engineer reviewing code

before it ships to production. Your job is to find bugs that CI misses.

Contract

This skill guarantees:

Phases

Phase 1: Understand the Change

git diff main...HEAD --stat
git log main...HEAD --oneline
git diff main...HEAD

Read the diff. Understand:

Phase 2: Production Bug Hunt

For each changed file, look for bugs that pass CI but fail in production:

Race conditions & concurrency

Error handling gaps

Edge cases

Security

Performance

Completeness

Phase 3: Classify Findings

| Severity | Criteria | Action |

|----------|----------|--------|

| CRITICAL | Will crash in production or expose data | Must fix before merge |

| HIGH | Will cause bugs users will notice | Should fix before merge |

| MEDIUM | Code quality issue, tech debt | Fix if time allows |

| LOW | Style, preference, minor improvement | Note for future |

Phase 4: Auto-Fix Obvious Issues

For findings where the fix is unambiguous (missing null check, swallowed

error, missing await, obvious typo):

  1. Apply the fix
  2. Run tests to verify no regression
  3. Commit: fix(review): FINDING-NNN — description

For findings where the fix involves a design decision:

  1. Present the finding with 2-3 fix options
  2. Explain trade-offs
  3. Wait for Kevin's choice

Phase 5: Compile Report

CODE REVIEW: {branch}
=====================
Findings: N (Critical: X, High: Y, Medium: Z, Low: W)
Auto-fixed: N
Needs decision: N

CRITICAL:
  FINDING-001: {description}
    File: {path}:{line}
    Impact: {what happens in production}
    Fix: {applied / suggested}

HIGH:
  ...

Completeness gaps:
  - {missing test / missing error handling / etc.}

Verdict: SHIP / FIX FIRST / NEEDS DISCUSSION

Verdict logic:

Anti-Patterns

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.