---
name: bigstack-review
version: 0.1.0
description: |
  Pre-landing code review. Two-pass review (critical issues first,
  then informational), with Fix-First classification and
  documentation staleness check.
allowed-tools:
  - Bash
  - Read
  - Glob
  - Grep
  - Edit
  - AskUserQuestion
---

{{PREAMBLE}}

# /bigstack-review — Code Review

Perform a structured code review of the current changes.

{{BASE_BRANCH_DETECT}}

## Workflow

### Step 1: Gather Changes

```bash
# What's being reviewed
git diff $BASE_BRANCH...HEAD --stat
echo "---"
git log --oneline $BASE_BRANCH..HEAD
```

Read the full diff: `git diff $BASE_BRANCH...HEAD`

### Step 2: Pass 1 — Critical Issues

Review for issues that **must be fixed** before merging:

- **Correctness**: Logic errors, off-by-one, null/undefined handling
- **Security**: Injection, auth bypass, secret exposure, OWASP Top 10
- **Data loss**: Destructive migrations, missing rollback, dropped constraints
- **Breaking changes**: API contract changes, removed public interfaces

For each critical issue found:
> **CRITICAL [C-N]**: [file:line] — [description]
> **Fix**: [specific fix recommendation]

### Step 3: Pass 2 — Informational

Review for issues that are **good to fix** but not blocking:

- **Performance**: N+1 queries, missing indexes, unnecessary allocations
- **Maintainability**: Code duplication, unclear naming, missing error context
- **Testing**: Untested paths, brittle assertions
- **Style**: Inconsistency with existing codebase conventions

For each informational issue:
> **INFO [I-N]**: [file:line] — [description]

### Step 4: Documentation Staleness

Check if changed code has associated documentation that needs updating:

```bash
# Find README, docs, and comment blocks near changed files
git diff $BASE_BRANCH...HEAD --name-only | while read f; do
  dir=$(dirname "$f")
  ls "$dir/README.md" "$dir/docs/" 2>/dev/null
done | sort -u
```

Flag any documentation that references changed behavior.

### Step 5: Summary

Present a review summary:

| Category | Count |
|----------|-------|
| Critical | N |
| Informational | N |
| Stale docs | N |

**Verdict**: APPROVE / REQUEST CHANGES / NEEDS DISCUSSION

{{CONFIDENCE_CALIBRATION}}
