Review-Gate
Structured post-implementation review. Nothing passes without evidence.
1. Trace affected code paths
Use Read, Grep, and Glob to trace the call chain from each changed function to its callers and dependents. For changes that touch multiple files or cross API boundaries, trace both directions.
2. Bug pattern scan
Check every changed file for:
- Null safety: optional chaining gaps, unchecked nullable values, NonNullable casts without guards
- Async errors: missing await, unhandled promise rejections, race conditions
- Stale data: old values in caches, persisted state, or UI that survive restarts
- Off-by-one: index boundaries, array length vs last index, loop bounds
- Import errors: missing imports, circular dependencies, wrong paths
- Security: unsanitized input, eval usage, SQL/command injection, hardcoded secrets
- Error handling: swallowed exceptions, missing catch blocks, generic error responses
3. Build verification
Discover and run the project's build command:
- Check
package.json scripts, Makefile, Cargo.toml, pyproject.toml, or README
- Run the build — confirm it succeeds
- If multiple build targets exist (e.g., plugin + shared types), rebuild all
4. Type and test verification
- Run the type checker (e.g.,
npx tsc --noEmit, pyright, cargo check)
- Run the test suite (e.g.,
npm test, pytest, cargo test)
- Fix all failures before proceeding
- If no type checker or test suite exists: state this explicitly in the report
5. Architectural check
Find 2-3 examples of the same pattern used elsewhere in the codebase. Confirm the change is consistent with them. Flag if:
- The change introduces a pattern not used anywhere else
- A simpler approach already exists in the codebase
- Unnecessary abstractions or over-engineering were added
6. Report
Present findings in this format:
## Review-Gate Report
| Check | Status | Notes |
|-------|--------|-------|
| Code path trace | PASS/FAIL | [what was traced] |
| Bug pattern scan | PASS/FAIL | [issues found or clean] |
| Build | PASS/FAIL | [command run + result] |
| Type check | PASS/FAIL/SKIP | [command run + result] |
| Tests | PASS/FAIL/SKIP | [command run + result] |
| Architecture | PASS/FAIL | [consistency notes] |
### Issues Found
- [list each issue and the fix applied, or "None"]
### Final Status: PASS / FAIL
Do not declare done until all checks PASS or are explicitly SKIP with reason.
1---2name: review-gate3description: Use after completing any code implementation, bug fix, or refactor. Structured review with pass/fail verification before declaring done.4---56# Review-Gate78Structured post-implementation review. Nothing passes without evidence.910## 1. Trace affected code paths1112Use Read, Grep, and Glob to trace the call chain from each changed function to its callers and dependents. For changes that touch multiple files or cross API boundaries, trace both directions.1314## 2. Bug pattern scan1516Check every changed file for:17- **Null safety:** optional chaining gaps, unchecked nullable values, NonNullable casts without guards18- **Async errors:** missing await, unhandled promise rejections, race conditions19- **Stale data:** old values in caches, persisted state, or UI that survive restarts20- **Off-by-one:** index boundaries, array length vs last index, loop bounds21- **Import errors:** missing imports, circular dependencies, wrong paths22- **Security:** unsanitized input, eval usage, SQL/command injection, hardcoded secrets23- **Error handling:** swallowed exceptions, missing catch blocks, generic error responses2425## 3. Build verification2627Discover and run the project's build command:28- Check `package.json` scripts, `Makefile`, `Cargo.toml`, `pyproject.toml`, or README29- Run the build — confirm it succeeds30- If multiple build targets exist (e.g., plugin + shared types), rebuild all3132## 4. Type and test verification3334- Run the type checker (e.g., `npx tsc --noEmit`, `pyright`, `cargo check`)35- Run the test suite (e.g., `npm test`, `pytest`, `cargo test`)36- Fix all failures before proceeding37- If no type checker or test suite exists: state this explicitly in the report3839## 5. Architectural check4041Find 2-3 examples of the same pattern used elsewhere in the codebase. Confirm the change is consistent with them. Flag if:42- The change introduces a pattern not used anywhere else43- A simpler approach already exists in the codebase44- Unnecessary abstractions or over-engineering were added4546## 6. Report4748Present findings in this format:4950```51## Review-Gate Report5253| Check | Status | Notes |54|-------|--------|-------|55| Code path trace | PASS/FAIL | [what was traced] |56| Bug pattern scan | PASS/FAIL | [issues found or clean] |57| Build | PASS/FAIL | [command run + result] |58| Type check | PASS/FAIL/SKIP | [command run + result] |59| Tests | PASS/FAIL/SKIP | [command run + result] |60| Architecture | PASS/FAIL | [consistency notes] |6162### Issues Found63- [list each issue and the fix applied, or "None"]6465### Final Status: PASS / FAIL66```6768Do not declare done until all checks PASS or are explicitly SKIP with reason.