.agents/skills/frontend-large-feature-architecture/SKILL.md
Use this skill when building, changing, or refactoring a large frontend surface.
In this skill, "controller" means a component or hook that owns feature logic: data fetching, view state, table/list state, effects, actions, and expensive rendering. The problem is not the name; it is one place owning too many changing responsibilities.
When a feature grows, split rendering from logic. Most components should be view-only. Data preparation should be pure. Complex user actions should live in external async functions or local-store actions. Effects are integration boundaries, not the normal way to derive state.
For the full rules, read
references/big-feature-rules.md.
UI is a pure function of state. Do not use useEffect to derive, prepare, or
sync data:
const title = data?.name ?? ""),
never mirrored into state by an effect. Client state that refers to server
data stores only the user's intent (an id) and derives the effective value
by merging with query data in render.<Spinner /> as minimal fallback); the inner component receives
the loaded value as an initialValue prop and seeds useState(initialValue).
Do not render UI before its data is ready.useCallback/useMemo are premature optimization; fix re-render problems by
splitting components, not memoizing.useEffect is legitimate only for DOM/browser API integration: no (or
minimal) dependencies, one concern, and a cleanup function.For the golden example and full reasoning, read
references/react-without-useeffect.md.
useState, not useMemo.src/components/* exports should stay context-free or receive
explicit props. Put view-scoped Zustand consumers in src/features/*.README.md owner map.Prefer a local vanilla Zustand store for large or high-frequency feature state. The store is created by the page/view and destroyed on unmount.
Use selectors that return primitives or stable references. If a component needs multiple values, use shallow selector helpers or split subscriptions so one changing field does not rerender unrelated UI.
Complex user workflows should live in actions/*.ts files or store actions.
The component wires hooks and passes dependencies; the action owns the workflow.
For a complete effect audit or component-splitting recipes, use
../refactor-react-effects/SKILL.md.
references/big-feature-rules.md.initialValue props, forms, actions outside React, and why not
to memoize — read
references/react-without-useeffect.md.references/virtualized-lists.md.references/local-feature-state.md.README.md owner maps, read
references/feature-readmes.md.references/controller-migration.md.
This is the default reference for traces/observations tables, sessions,
experiments, prompts, evals, datasets, and other controller-heavy surfaces.