Code Review Skill
General Guidelines
- •Readability: Code should be self-documenting. Variable names should be descriptive (e.g.,
userCreditsvsuc). - •Simplicity: Prefer simple solutions. If a function does too much, suggest splitting it.
- •Consistency: Follow existing patterns (e.g., Service pattern in
src/lib, Hooks insrc/hooks).
Project-Specific Checks
- •Asaas Integration: Ensure
AsaasClientis used for payments; check for proper error handling (try-catchwithApiError). - •Auth: Verify that
auth()orcurrentUser()from Clerk is used correctly. - •Database: Check that Prisma queries are optimized (e.g.,
selectspecific fields, avoid hugeincludes). - •Client/Server: Ensure sensitive logic stays on the server (API routes/Server Actions) and isn't leaked to Client Components.
Security & Performance
- •SQL Injection: Prisma handles this, but watch out for raw queries.
- •XSS: Ensure user input rendered in React is safe.
- •RSC: Check if components are marked
use clientunnecessarily. - •Images: Verify usage of
next/imagewith proper sizing.