Review or replace React useEffect calls, or enforce a no-direct-effect policy. Use for effect implementation, refactoring, or lint policy; excludes unrelated React work and non-React effect systems.
71
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Direct useEffect is an external-synchronization escape hatch. Components do
not call it; a reviewed, domain-specific hook for a real external system may.
Effect replacement changes the touched behavior. Repository-wide lint enforcement is a separate task: apply it when requested or required by existing repository policy. A review request produces findings; an implementation request authorizes in-scope replacements and verification without another approval checkpoint.
Find direct imports, React.useEffect(...) namespace calls, and wrappers
around useEffect in the touched surface.
Classify each effect and replace it in this order of preference:
queryOptions factory with variables in the key and the signal passed
through)useSyncExternalStoreIf none fits, state the external synchronization contract before keeping an effect. Replacements covers the non-obvious cases.
Preserve the repository's framework, data layer, lint shape, and dependency policy. Add a library only when the request or repository policy authorizes it; without a server-state layer, call the remaining effect a design gap.
Run lint, type, and test gates plus the smallest real UI or hook check for the changed behavior.
Put every legitimate effect in a hook named for its external system (a chat connection, a map SDK, a widget), in its own file. The hook owns setup and cleanup, takes its reactive inputs as parameters, and lists every value setup or cleanup reads. The component calling it stays effect-free. Prefer an existing repository hook.
Never:
useUpdateEffect(fn, deps), useAsyncEffect(fn, deps),
useMountEffect(fn));react-hooks/exhaustive-deps;When enforcement is in scope, extend the repository's existing linter so it
rejects both named useEffect imports and React.useEffect(...) calls. Allow
only the named, reviewed integration-hook files, never a directory such as
src/hooks/**, and never a generic wrapper; report the wrapper and its callers
as violations to migrate. Keep the canonical local gate and CI on that same lint
surface; agent guidance or optional scanners do not replace it. Do not use
@latest diagnostic tools as durable enforcement.
In review, every new direct effect is a finding unless the change documents and proves a legitimate external-system boundary. Ask for a replacement, not dependency-array tuning.
useLayoutEffect, useInsertionEffect, framework lifecycle APIs, and
non-React effect systems alone, including in lint rules, unless requested.0d577da
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.