← ClaudeAtlas

pattern-engineer-frontend-standardlisted

React frontend bullets: composition-first components, custom hooks, route registration + entry-source reachability (a real inbound path, not just a passing URL-render test) in one slice, render to the surface's `docs/ui-contract/<screen>.yaml` (declared role+accessible-name interface; extend its `states` per slice), route-param queries gated by `enabled: !!param`, `onSuccess` cache invalidation, idempotency-key rotation on 4xx, API via `src/lib/api`, Context+Reducer state, RHF+Zod forms, per-route error boundaries, native a11y elements, Tailwind ↔ `docs/design-system/tokens.md`. Activate on frontend `.tsx`/`.ts`.
MartinKChen/harness-claude-code · ★ 0 · Web & Frontend · score 72
Install: claude install-skill MartinKChen/harness-claude-code
# pattern-engineer-frontend-standard ## When to activate Activate when writing or editing React components, hooks, pages, routes, layouts, forms, modals, lists, tables, or navigation in any React-based app (Next.js or Vite). Skip for pure backend code or non-React frontends. ## Project memory overlay After loading this skill, also check `$MAIN_ROOT/.claude/memory/patterns/pattern-engineer-frontend-standard.md` in the consuming project (resolve `MAIN_ROOT="$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")"`). If present, load it as an **additive overlay** to the rules below; if absent, skip silently. See `memory-convention` for the full contract (additivity, severity floor, conflict surfacing). ## Patterns ### Component design - Composition over inheritance: pass behavior as props, structure as children. - Compound components for related parts (`Tabs` / `Tabs.Tab`) sharing state via internal Context — keep the Context unexported. - Render props / `children` as a function when consumers own the markup but you own the logic. - Throw a clear error when a compound child is used outside its parent. ### Custom hooks - Extract any reusable stateful logic into a `useX` hook. - Return a tuple for 2–3 values; an object once it grows past that. - Wrap callbacks in `useCallback` so consumers can pass them to memoized children. - Async data fetching: use TanStack Query (or Next route loaders / server components). Hand-rolled `useFetch` only for tiny one-offs, a