.cursor/skills/review-react/SKILL.md
Reviews React and TypeScript code for correctness, security, hook usage, and multi-tenancy safety. Use when reviewing generated React components, hooks, or TypeScript files, or when asked to do a code review on frontend code.
npx skillsauth add guimap01/notes_app review-reactInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Targets React 19 with the React Compiler. Work through the five areas in order. For the full pass/fail checklist, see checklist.md.
any, no implicit {}Core rules (non-negotiable)
use(), which is designed for conditional callsreact-hooks/rules-of-hooks and react-hooks/exhaustive-deps ESLint rules; treat all warnings as errorsReact 19 hook additions to know
| Hook | Use for |
| ----------------------- | ------------------------------------------------------------------------------------ |
| use(promise\|context) | Reading context or async values; can be called conditionally |
| useActionState | Form submission state + pending flag — replaces manual useState + loading patterns |
| useFormStatus | Child components reading parent form submission state |
| useOptimistic | Optimistic UI updates before server confirmation |
Effects
useEffect deps array must be exhaustive; missing deps hide stale closuresAbortController, not just a mounted flag:useEffect(() => {
const ac = new AbortController();
fetch(`/api/notes/${id}`, { signal: ac.signal })
.then((r) => r.json())
.then(setNote)
.catch((e) => {
if (e.name !== "AbortError") setError(e);
});
return () => ac.abort();
}, [id]);
useLayoutEffect only for DOM measurements or synchronizing layout — never as a first choiceuseRef, read ref.current inside the effectThe React Compiler automatically memoizes at build time. Do not add useMemo / useCallback / React.memo by default.
Add manual memoization only in these three cases:
Use useTransition to keep urgent interactions (typing, gestures) responsive while deferring heavy renders.
Use useDeferredValue to defer a derived value to a slower render.
dangerouslySetInnerHTML with any user-supplied string → critical bug; must sanitize with DOMPurify firsthref={userInput} → critical bug; validate URL starts with https:// or use an allowlistlocalStorage → critical bug; must use httpOnly cookiesconsole in production pathsorgId / tenantId used in API calls must come from the server-side session (token/cookie), never from URL params or component state alonetools
Writes unit tests for React components using Vitest and React Testing Library. Use when writing or reviewing tests for React components, hooks, forms, or pages in apps/client. Covers setup, mocking strategy, form validation testing, async interactions, and testing library best practices.
development
Reviews NestJS TypeScript code for correctness, security, multi-tenancy safety, and architectural best practices. Use when reviewing generated NestJS controllers, services, guards, interceptors, pipes, or modules, or when asked to do a code review on backend API code.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.