Why Use This This skill provides specialized capabilities for HoangNguyen0403's codebase.
Use Cases Developing new features in the HoangNguyen0403 repository Refactoring existing code to follow HoangNguyen0403 standards Understanding and working with HoangNguyen0403's codebase structure
Install Guide 2 steps 1 2 Install inside Ananke
Click Install Skill, paste the link below, then press Install.
https://github.com/HoangNguyen0403/agent-skills-standard/tree/develop/skills/react/hooks Skill Snapshot Auto scan of skill assets. Informational only.
Valid SKILL.md Checks against SKILL.md specification
Source & Community
Updated At Jan 18, 2026, 04:24 AM
Skill Stats
SKILL.md 62 Lines
Total Files 1
Total Size 0 B
License NOASSERTION
---
name: React Hooks Expert
description: Standards for efficient React functional components and hooks usage. Use when writing custom hooks, optimizing useEffect, or working with useMemo/useCallback in React.
metadata:
labels: [react, hooks, performance, frontend]
triggers:
files: ['**/*.tsx', '**/*.jsx']
keywords:
[
useEffect,
useCallback,
useMemo,
useState,
useRef,
useContext,
useReducer,
useLayoutEffect,
custom hook,
]
---
# React Hooks Expert
## **Priority: P0 (CRITICAL)**
**You are a React Performance Expert.** Optimize renders and prevent memory leaks.
## Implementation Guidelines
- **Dependency Arrays**: exhaustive-deps is Law. Never suppress it.
- **Memoization**: `useMemo` for heavy calc, `useCallback` for props.
- **Custom Hooks**: Extract logic starting with `use...`.
- **State**: Keep local state minimal; lift up strictly when needed.
- **Rules**: Top-level only. Only in React functions.
- **`useEffect`**: Sync with external systems ONLY. Cleanup required.
- **`useRef`**: Mutable state without re-renders (DOM, timers, tracking).
- **`useMemo`/`Callback`**: Measure first. Use for stable refs or heavy computation.
- **Dependencies**: Exhaustive deps always. Fix logic, don't disable linter.
- **Custom Hooks**: Extract shared logic. Prefix `use*`.
- **Refs as Escape Hatch**: Access imperative APIs (focus, scroll).
- **Stability**: Use `useLatest` pattern (ref) for event handlers to avoid dependency changes.
- **Concurrency**: `useTransition` / `useDeferredValue` for non-blocking UI updates.
- **Initialization**: Lazy state `useState(() => expensive())`.
## Performance Checklist (Mandatory)
- [ ] **Rules of Hooks**: Called at top level? No loops/conditions?
- [ ] **Dependencies**: Are objects/arrays memoized before passing to deps?
- [ ] **Cleanup**: Do `useEffect` subscriptions return cleanup functions?
- [ ] **Render Count**: Does component re-render excessively?
## Anti-Patterns
- **No Missing Deps**: Fix logic, don't disable linter.
- **No Complex Effects**: Break tailored effects into smaller ones.
- **No Derived State**: Compute during render, don't `useEffect` to sync state.
- **No Heavy Init**: Use lazy state initialization `useState(() => heavy())`.
## References
- [Optimization Patterns](references/REFERENCE.md)