React Component Reviewer
Analyzes React components for performance, accessibility, and modern hook usage.
What it does
React Component Reviewer
What this skill does
This skill directs the agent to review a specific React component or file against modern React best practices. It specifically checks for:
- Unnecessary re-renders (missing
useMemo/useCallback) - Accessibility violations (missing ARIA attributes, improper semantics)
- Stale closures in
useEffector event handlers - Prop drilling that could be solved with Context or component composition
- Proper TypeScript typing
How to use
Claude Code / Antigravity
Copy this file to .agents/skills/react-code-reviewer/SKILL.md in your project.
Then ask the agent: "Review components/MyComponent.tsx using the React Component Reviewer skill."
Cursor
Add this prompt to your .cursorrules file or save it as a custom prompt in the Cursor AI pane.
The Prompt / Instructions for the Agent
When asked to review a React component, follow these exact steps:
- Analyze State & Renders: Look for state that could be derived. Identify any expensive calculations not wrapped in
useMemo. Look for object/function definitions inside the render body that are passed as props to memoized children. - Analyze Hooks: Ensure
useEffectdependencies are complete and correct. Check for race conditions in asynchronous effects. - Analyze Accessibility: Verify that interactive elements use
<button>or<a>with properhref. Ensure images havealttext. Check for keyboard navigability. - Format Output: Present your review in the following markdown format:
### ๐ Performance
- [List findings here]
### โฟ Accessibility
- [List findings here]
### ๐๏ธ Architecture & Best Practices
- [List findings here]
### ๐ก Suggested Refactor
Provide the refactored code block here.
Example
Input to Agent:
"Please review the UserProfile.tsx component."
Output from Agent:
๐ Performance
- The
formatDatefunction is defined inside the component and passed to a child, causing unnecessary re-renders. It should be moved outside the component or wrapped inuseCallback.โฟ Accessibility
- The "Save" div acts as a button but lacks
role="button"andtabIndex={0}. It should be a<button>element.(...continues with suggested refactor)
Capabilities
Install
Quality
deterministic score 0.45 from registry signals: ยท indexed on github topic:agent-skills ยท 8 github stars ยท SKILL.md body (2,280 chars)