理解React模式、hooks和现代最佳实践的AI代理。
捕获React hooks违规、过时闭包和状态管理bug。
识别不必要的重新渲染、缺失的记忆化和bundle膨胀。
确保组件具有适当的ARIA和键盘支持的可访问性。
验证组件模式、props和组合最佳实践。
执行您团队的React模式。要求特定的hook用法、组件结构或可访问性标准。
rules:
- id: react_use_error_boundary
agent: bugs
title: Routes need error boundaries
description: All route components should
have error boundaries for resilience
importance: 8
match:
file_glob:
- 'app/**/page.tsx'
- 'pages/**/*.tsx'
checklist:
- Verify ErrorBoundary wraps component
- Check for error fallback UI
- Ensure errors are logged
tags:
- react
- reliability
- next-js