Arguments:
- scope: what to analyze (default: your current changes). Examples: "diff to main", "PR #123", "src/components/", "whole codebase"
- fix: whether to apply fixes (default: true). Set to false to only propose changes.
User arguments: $ARGUMENTS
References
Read before analyzing:
- https://overreacted.io/before-you-memo/ — two techniques to avoid memo entirely
Anti-patterns to detect
- Wrapping a slow component in React.memo when state can be moved down: If a component re-renders because of state it doesn't use, move that state into a smaller child component instead of memoizing. The slow component stops re-rendering without memo.
- Wrapping in React.memo when children can be lifted up: If a parent owns state that changes frequently, extract the stateful part and pass the expensive subtree as . Children passed as props don't re-render when the parent's state changes.