| name | code-review |
| description | Review code for quality, security, performance, and maintainability. Use when reviewing PRs, auditing a codebase, or refactoring. Covers TypeScript, Node.js, infrastructure-as-code, and full-stack web apps. |
Code Review
Systematic code review for Espen's TypeScript/Node.js projects.
Process
-
Understand scope — Read the changed files or the area under review:
git diff --name-only HEAD~1
git diff HEAD~1
find src/ -name "*.ts" -newer <reference-file>
-
Read the code — Use the read tool on each file. Don't guess.
-
Analyze against checklist — Score each category.
-
Report — Use the output format below.
Review Checklist
Correctness
Security
Performance
Maintainability
Project Conventions
Output Format
## Code Review: [scope]
### Summary
One paragraph: what the code does, overall quality assessment.
### Issues
#### 🔴 Critical
- [file:line] Description and fix
#### 🟡 Important
- [file:line] Description and suggestion
#### 🔵 Minor
- [file:line] Nit or style suggestion
### What's Good
- Call out well-written code, good patterns, clever solutions
### Recommendations
- Prioritized list of changes, starting with most impactful
Common Patterns in Espen's Stack
| Project Type | Key Things to Check |
|---|
| Pi extensions | Tool parameter schemas, error returns, signal/abort handling |
| Eleventy sites | Template data flow, permalink structure, Tailwind purge config |
| TanStack apps | Router setup, query keys, optimistic updates, Clerk auth guards |
| Infrastructure | Terraform state safety, Docker layer caching, env var handling |
| SQLite | Migration ordering, prepared statements, WAL mode, index coverage |