paralect/ship/no-use-effect
Claude Code and agent skill by paralect/ship
- community
Checking that the SKILL.md file is still in the repository.
Enforce the no-useEffect rule when writing or reviewing React code. ACTIVATE when writing React components, refactoring existing useEffect calls, reviewing PRs with useEffect, or when an agent adds useEffect "just in case." Provides the five replacement patterns and the useMountEffect escape hatch.
Install
npx vskill@latest install paralect/ship/no-use-effectSKILL.md
No useEffect
Never call useEffect directly. Use derived state, event handlers, data-fetching libraries, or useMountEffect instead.
Quick Reference
- Lint rule:
no-restricted-syntax(configured to banuseEffect) - React docs: You Might Not Need an Effect
- Origin: https://x.com/alvinsng/status/2033969062834045089
| Instead of useEffect for... | Use | |
|---|---|---|
| Deriving state from other state/props | Inline computation (Rule 1) | |
| Fetching data | useQuery / data-fetching library (Rule 2) | |
| Responding to user actions | Event handlers (Rule 3) | |
| One-time external sync on mount | useMountEffect (Rule 4) | |
| Resetting state when a prop changes | key prop on parent (Rule 5) |
When to Use This Skill
- Writing new React components
- Refactoring existing
useEffectcalls - Reviewing PRs that introduce
useEffect - An agent adds
useEffect"just in case"
Workflow
1. Identify the useEffect
Determine what the effect is doing -- deriving state, fetching data, responding to an event, syncing with an external system, or resetting state.
2. Apply the Correct Replacement Pattern
Use the five rules below to pick the right replacement.
3. Verify
The Escape Hatch: useMountEffect
For the rare case where you need to sync with an external system on mount:
The implementation wraps useEffect with an empty dependency array to make intent explicit:
Replacement Patterns
Rule 1: Derive state, do not sync it
Most effects that set state from other state are unnecessary and add extra renders.
Smell test: You are about to write useEffect(() => setX(deriveFromY(y)), [y]), or you have state that only mirrors other state or props.
Rule 2: Use data-fetching libraries
Effect-based fetching creates race conditions and duplicated caching logic.
Smell test: Your effect does fetch(...) and then setState(...), or you are re-implementing caching, retries, cancellation, or stale handling.
Rule 3: Event handlers, not effects
If a user clicks a button, do the work in the handler.
Smell test: State is used as a flag so an effect can do the real action, or you are building "set flag -> effect runs -> reset flag" mechanics.
Rule 4: useMountEffect for one-time external sync
Good uses: DOM integration (focus, scroll), third-party widget lifecycles, browser API subscriptions.
Use useMountEffect for stable dependencies (singletons, refs, context values that never change):
Smell test: You are synchronizing with an external system, and the behavior is naturally "setup on mount, cleanup on unmount."
Rule 5: Reset with key, not dependency choreography
Smell test: You are writing an effect whose only job is to reset local state when an ID/prop changes, or you want the component to behave like a brand-new instance for each entity.
Component Structure Convention
Computed values come after hooks and local state, never via useEffect:
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtemplate/apps/web/.agents/skills/no-use-effect/SKILL.md
Popularity
- Repository stars
- 426
- Repository forks
- 74
- 7-day trend score
- 30
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/paralect/ship/no-use-effect)