skills/team/react-architecture-checklist/SKILL.md
Checklist executor for React architecture reviews. Detects the React version, bundler (Vite/CRA/Next), TypeScript usage, state-management library, and router, then runs a systematic checklist covering hooks discipline, component cohesion, effect correctness, render performance, state-management boundaries, accessibility, and type safety — producing a graded report with file:line evidence. Use to review or grade an existing React/TypeScript codebase. Triggers on "review react project", "react architecture checklist", "audit react code", "evaluate react codebase", "react code review", "check hooks", "react component review", "grade this react architecture". Do NOT use for a Socratic design critique — use architecture-review. Do NOT use for a security audit — use react-security-review. Do NOT use to write new code test-first — use tdd.
npx skillsauth add michaelalber/ai-toolkit react-architecture-checklistInstall 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.
"A checklist cannot fly a plane, but a pilot cannot fly safely without one." — Atul Gawande
Shared across the dotnet / python / php / rust / react architecture checklists — same values, language-specific checks.
Grounding note: the knowledge base has no React corpus. Use
collection="javascript"for TS/JS idioms,collection="ui_ux"for accessibility, andcollection="internal"for architecture standards; cite react.dev as the primary React authority. Never invent areactcollection.
| # | Value | What it means |
|---|-------|---------------|
| 1 | Detect before judge | Determine React version / bundler / TS / state lib before applying any item; context decides what is idiomatic. |
| 2 | Evidence over opinion | Every finding cites file:line and the offending pattern. "Too many re-renders" is not a finding; "features/cart/Cart.tsx:31 recreates onAdd every render, breaking the memoized <Row>" is. |
| 3 | Feature cohesion | Organized by feature, not by technical type (components/, hooks/, utils/ dumping grounds). Cross-feature imports are a violation. |
| 4 | Dependencies point inward | UI components depend on hooks/services, not the reverse; data-fetching is isolated from presentation. Boundaries are explicit via barrels. |
| 5 | Hooks honor the rules | Hooks called unconditionally at the top level; effect dependency arrays complete; effects clean up. A lint suppression of react-hooks/exhaustive-deps is a finding. |
| 6 | Config & secrets hygiene | No secrets in client bundles; only intentionally-public VITE_/NEXT_PUBLIC_ values exposed; config injected, not hardcoded. |
| 7 | Version awareness | Recommendations gated to the detected React version; never suggest an API that does not exist there (e.g. use() / Actions on React 17). |
| 8 | Tests gate change | Untested components/hooks are a finding; high-risk interactive components without RTL tests are prioritized. |
| 9 | Graded, actionable output | A letter grade (A–F) from counted findings, plus prioritized, version-correct recommendations. |
Shared skeleton: DETECT → SCAN → REPORT → RECOMMEND.
DETECT React version (package.json `react`), bundler (Vite/CRA/Next.js), TypeScript (tsconfig +
strict), state library (Redux/RTK/Zustand/Context/none), router. Record findings;
version changes what is idiomatic.
SCAN Run the React Checklist below section by section. Gather evidence with tooling:
npx eslint . --max-warnings 0 # baseline — incl. eslint-plugin-react-hooks
npx tsc --noEmit # type errors gate the review
npx knip # dead code / unused exports / deps
grep -rn "useEffect" src/ | wc -l # effect surface to audit
Every violation becomes a finding with file:line and a severity (critical/high/medium/low).
REPORT Emit the graded report (Output Template). Grade = function of counted findings.
RECOMMEND Prioritize: critical → quick wins → modernization. Version-gate every recommendation.
| # | Check | Severity |
|---|-------|----------|
| 1 | Hooks rules — hooks called unconditionally at top level; no hooks in loops/conditions; custom hooks prefixed use | Critical |
| 2 | Effect correctness — complete dependency arrays (no exhaustive-deps suppressions); cleanup returned for subscriptions/timers; no derived state that belongs in render | High |
| 3 | Component cohesion — one responsibility per component; container/presentation separation where it earns it; no 300-line god components | Medium |
| 4 | State placement — state lives at the lowest common owner; no prop-drilling past ~3 levels (lift to context/store); server state in a query cache, not useState+useEffect | High |
| 5 | Render performance — stable list keys (never array index for dynamic lists); memo/useMemo/useCallback only where a measured re-render warrants it; no new object/array/function literals passed to memoized children | Medium |
| 6 | Type safety — tsconfig strict: true; no any without justification; props typed (no implicit any); no as casts hiding shape mismatches | High |
| 7 | Accessibility — semantic elements over div soup; interactive elements keyboard-reachable; labels/alt/ARIA where needed; eslint-plugin-jsx-a11y clean | High |
| 8 | Boundary & dep hygiene — no cross-feature deep imports; data-fetching isolated from presentation; error boundaries around async UI; bundle/dep weight justified | Medium |
ESLint config: eslint configuration. Full section-by-section list (with the hooks & effects audit table): review checklist.
<arch-checklist-state>
language: react
mode: DETECT | SCAN | REPORT | RECOMMEND | COMPLETE
detected: [react-version | bundler | ts:strict/loose | state-lib | tests:yes/no]
issues_found: [critical:N high:N medium:N low:N]
last_action: [what was just done]
next_action: [what should happen next]
</arch-checklist-state>
Shared across all architecture checklists.
## Architecture Checklist: [app/package] (React)
**React**: [19] | **Bundler**: [Vite/CRA/Next] | **TS**: [strict/loose/none] | **State**: [RTK/Zustand/Context] | **Tests**: [yes/no]
| Section | Pass | Fail | Warn |
|---------|------|------|------|
| Hooks / Effects / Cohesion / State / Render / Types / a11y / Boundaries | … | … | … |
### Grade: [A–F]
Grading: **A** 0 crit/0 high/≤3 med · **B** 0 crit/≤2 high · **C** 0 crit, gaps in one area ·
**D** 1+ crit · **F** fundamental problems (conditional hooks, `any` everywhere, no a11y, server state in effects throughout).
| Severity | Location | Finding | Recommendation |
|----------|----------|---------|----------------|
| CRITICAL | file:line | [pattern] | [version-gated fix] |
**Hooks/effects audit**: | location | issue | dep array | cleanup | risk |
**Quick wins**: [low-effort, high-impact] · **Modernization**: [larger items with effort estimate]
eslint --max-warnings 0 and tsc --noEmit are the baseline; report failures before the architectural checklist.file:line; show the eslint/grep output. Never grade on vibes.useTransition, Actions, use(), server components) for a React 16/17 codebase.react-security-review — note them and route there.architecture-review — When the grade is D/F, escalate to the Socratic critic: this checklist finds what is wrong; architecture-review builds why.react-security-review — Companion for the security dimension (XSS, bundle secrets, npm audit).react-feature-slice — Correct-pattern reference when the checklist flags structural/cross-feature violations.react-modernization-analyzer — When findings cluster around legacy patterns (class components, CRA), route to the modernization plan.tdd — Methodology for adding the RTL tests the checklist flags as missing, and for driving any refactor.dotnet / python / php / rust-architecture-checklist — Sibling skills sharing this exact Core Values + workflow + output.development
Federal / government security overlay applied ON TOP OF a base language security review (dotnet/python/php/rust/react). Language-agnostic: adds NIST SP 800-53 control mapping, FIPS 140-2/3 cryptographic compliance (with a per-language crypto table), CUI handling, EO 14028 supply-chain requirements, and DOE Order 205.1B, and emits POA&M-ready findings with FIPS 199 impact levels. Use for federal/DOE/DOD/national-laboratory systems. Triggers on "federal security review", "NIST compliance", "NIST 800-53", "FISMA", "CUI", "FIPS audit", "DOE security", "POA&M", "ATO review". Do NOT use alone — run the matching <lang>-security-review FIRST; this overlay maps and extends it.
tools
OWASP-based security review of React / TypeScript front-end applications. Detects the framework (Vite/CRA/Next), entry points, and data flows, scans against the OWASP Top 10 (2025) mapped to React client-side patterns (XSS via raw HTML, URL/protocol injection, secrets in the bundle, insecure token storage, dependency CVEs, missing CSP, open redirects), and produces a manager-friendly executive summary plus a graded technical findings table. Use to audit React code for vulnerabilities. Triggers on "react security review", "frontend security audit", "audit react for vulnerabilities", "owasp react", "react xss", "react security posture", "npm audit review". For federal / gov / DOE / NIST / FIPS / CUI context, run security-review-federal after this base review. Do NOT use to grade architecture/structure — use react-architecture-checklist.
tools
Analyzes legacy React codebases and produces actionable modernization plans. Primary migration paths include class components to function components + hooks, Create React App to Vite, React 16/17 to 18 to 19, JavaScript to TypeScript, Enzyme to React Testing Library, legacy Redux to Redux Toolkit / Zustand / Context, and deprecated lifecycle/API removal. Does NOT perform the migration — assesses, quantifies risk, and plans. Triggers on phrases like "modernize react", "class to hooks", "upgrade react", "migrate CRA to vite", "react legacy migration", "react 17 to 18", "react js to typescript", "react technical debt", "enzyme to RTL".
development
Scaffolds feature-based React / TypeScript architecture using feature folders, presentational + container components, custom hooks, a typed data layer, and structural CQRS (query hooks vs mutation hooks). React analog of dotnet-vertical-slice and python-feature-slice — no DI framework; uses props/context for dependency injection and a query cache for server state. Use when creating feature-based React projects, adding React features, organizing components by feature rather than by technical type, or scaffolding a feature's data layer. Triggers on phrases like "scaffold react feature", "create react slice", "react feature folder", "react vertical slice", "add react feature", "react feature architecture", "organize react by feature".