react-effects-audit

Solid

Audit React components for unnecessary useEffect patterns. Detects 9 anti-patterns from "You Might Not Need an Effect" and proposes fixes with severity levels. Use when: auditing React or Next.js components for unnecessary or unsafe useEffect usage.

Web & Frontend 22 stars 3 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 85/100

Stars 20%
45
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

**Target:** $ARGUMENTS # React Effects Audit ## Overview Scan React codebases to detect unnecessary `useEffect` usage based on official React documentation ("You Might Not Need an Effect"). Reports anti-patterns with severity, location, and recommended fixes. --- ## Agent Workflow (MANDATORY) ``` PHASE 1: Scan target files (Glob *.tsx, *.jsx, *.ts, *.js) PHASE 2: Detect anti-patterns (Grep detection rules) PHASE 3: Analyze context (Read flagged files) PHASE 4: Generate report with fixes ``` --- ## Anti-Pattern Summary | # | Anti-Pattern | Severity | Detection | |---|---|---|---| | 1 | Derived state in Effect | WARNING | `useEffect` + `setState` from other state/props | | 2 | Expensive calculation in Effect | WARNING | `useEffect` + `setState` with filter/map/reduce | | 3 | State reset via Effect | WARNING | `useEffect` resets state when prop changes | | 4 | Event logic in Effect | CRITICAL | User interaction logic inside `useEffect` | | 5 | Parent notification via Effect | WARNING | `useEffect` calls parent `onChange`/`onUpdate` | | 6 | Effect chains | CRITICAL | Multiple `useEffect` triggering each other | | 7 | Missing cleanup in fetch | CRITICAL | `useEffect` fetch without cleanup/AbortController | | 8 | Manual store subscription | WARNING | `addEventListener`/`subscribe` in `useEffect` | | 9 | App init in Effect | INFO | One-time init logic in `useEffect(fn, [])` | --- ## Severity Levels | Level | Meaning | Action | |---|---|---| | CRITICAL | Bugs, race condit...

Details

Author
fusengine
Repository
fusengine/agents
Created
6 months ago
Last Updated
2 days ago
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category