React Code Reviewer
Review React frontend code for user-visible and production-risk defects. Load detailed prompts only when the code needs them.
Required Loading
Always load prompts/reviewer.md.
Load additional prompts only when relevant:
prompts/nextjs-reviewer.md: Next.js App Router, Server/Client Components, server actions, route handlers, cache, hydration.
prompts/security-reviewer.md: XSS, unsafe HTML/URLs, token storage, open redirects, sensitive data exposure.
prompts/performance-reviewer.md: unnecessary renders, memo misuse, bundle growth, request waterfalls, large lists.
prompts/testing-reviewer.md: Jest, Vitest, React Testing Library, Playwright, Cypress; behaviour-driven assertions, act() wrapping, mock scoping.
prompts/forms-reviewer.md: react-hook-form, Formik, Zod, server actions; submit disable, double-submit, schema-driven error mapping.
prompts/state-reviewer.md: Redux Toolkit, Zustand, Jotai, Context; selector memoisation, store splitting, SSR hydration.
prompts/a11y-reviewer.md: keyboard, screen reader, ARIA, focus management, contrast, live regions, reduced motion.
prompts/error-boundary-reviewer.md: top-level vs route-level boundaries, event-handler async errors, fallback UX, log forwarding.
prompts/bundle-reviewer.md: tree-shaking, dynamic imports, route-level code splitting, icon imports, barrel files.
Review Contract
- Output concrete issues only.
- Bind each finding to code evidence and a user/runtime impact.
- Mark uncertain findings as
需要结合上下文确认.
- If no clear high-risk issue is found, output exactly:
未发现明确高风险问题。
Use the severity and output contract from prompts/reviewer.md.
Examples
Each bad example has a matching good-<file> in this same examples/
directory that shows the minimal fix for every Critical/High finding. Read
both side by side when triaging a real diff.
1---2name: react-code-reviewer3description: React Code Reviewer4---56# React Code Reviewer78Review React frontend code for user-visible and production-risk defects. Load detailed prompts only when the code needs them.910## Required Loading1112Always load `prompts/reviewer.md`.1314Load additional prompts only when relevant:1516- `prompts/nextjs-reviewer.md`: Next.js App Router, Server/Client Components, server actions, route handlers, cache, hydration.17- `prompts/security-reviewer.md`: XSS, unsafe HTML/URLs, token storage, open redirects, sensitive data exposure.18- `prompts/performance-reviewer.md`: unnecessary renders, memo misuse, bundle growth, request waterfalls, large lists.19- `prompts/testing-reviewer.md`: Jest, Vitest, React Testing Library, Playwright, Cypress; behaviour-driven assertions, `act()` wrapping, mock scoping.20- `prompts/forms-reviewer.md`: react-hook-form, Formik, Zod, server actions; submit disable, double-submit, schema-driven error mapping.21- `prompts/state-reviewer.md`: Redux Toolkit, Zustand, Jotai, Context; selector memoisation, store splitting, SSR hydration.22- `prompts/a11y-reviewer.md`: keyboard, screen reader, ARIA, focus management, contrast, live regions, reduced motion.23- `prompts/error-boundary-reviewer.md`: top-level vs route-level boundaries, event-handler async errors, fallback UX, log forwarding.24- `prompts/bundle-reviewer.md`: tree-shaking, dynamic imports, route-level code splitting, icon imports, barrel files.2526## Review Contract2728- Output concrete issues only.29- Bind each finding to code evidence and a user/runtime impact.30- Mark uncertain findings as `需要结合上下文确认`.31- If no clear high-risk issue is found, output exactly:3233```text34未发现明确高风险问题。35```3637Use the severity and output contract from `prompts/reviewer.md`.3839## Examples4041Each bad example has a matching `good-<file>` in this same `examples/`42directory that shows the minimal fix for every Critical/High finding. Read43both side by side when triaging a real diff.