Review the files against project patterns, security requirements, AND the reference implementations from Step 3. See checklist.md for detailed criteria.
For each file under review:
- Compare its patterns against the reference from Step 3
- Check against the codebase compliance checklist in checklist.md
- Flag deviations with severity and specific file:line references
When flagging an issue, cite the reference: "Line 42 uses
but reference file
claude-ai-server-actions.ts:65
shows
is required when
."
For React/Next.js Code: Load Performance Guidelines
If reviewing React components, Next.js pages, or frontend code, invoke:
/vercel-react-best-practices
This loads 57 performance rules. Check the code against CRITICAL and HIGH priority rules:
CRITICAL - Eliminating Waterfalls:
- No sequential awaits for independent operations (use Promise.all)
- Suspense boundaries for streaming content
- Early promise initiation in API routes
CRITICAL - Bundle Optimization:
- No barrel file imports (import directly from source)
- Heavy components use next/dynamic
- Third-party scripts deferred after hydration
HIGH - Server-Side Performance:
- React.cache() for per-request deduplication
- Minimal data serialization to client components
- Parallel data fetching in server components
MEDIUM - Re-render Optimization:
- Derived state computed during render, not useEffect
- Memoization for expensive computations
- useTransition for non-urgent updates
Flag violations in the appropriate priority section of the review.
对照项目模式、安全需求以及步骤3中的参考实现审查文件。详细标准请查看checklist.md。
对于每个待审查文件:
- 将其模式与步骤3中的参考文件进行比较
- 对照checklist.md中的代码库合规性检查清单进行检查
- 标记偏离项,并注明严重程度和具体的文件:行号引用
标记问题时,请引用参考文件: “第42行使用
,但参考文件
claude-ai-server-actions.ts:65
显示,当
时,必须使用
。”
对于React/Next.js代码:加载性能指南
如果审查React组件、Next.js页面或前端代码,请调用:
/vercel-react-best-practices
这会加载57条性能规则。对照CRITICAL和HIGH优先级规则检查代码:
CRITICAL - 消除请求瀑布:
- 独立操作不使用顺序await(使用Promise.all)
- 流式内容使用Suspense边界
- API路由中提前初始化Promise
CRITICAL - 包优化:
- 不使用桶文件导入(直接从源导入)
- 大型组件使用next/dynamic
- 第三方脚本在 hydration 后延迟加载
HIGH - 服务端性能:
- 使用React.cache()进行每请求去重
- 最小化向客户端组件的数据序列化
- 服务端组件中并行数据获取
MEDIUM - 重渲染优化:
- 派生状态在渲染时计算,而非useEffect
- 昂贵计算使用 memoization
- 非紧急更新使用useTransition
在审查的相应优先级部分标记违规项。