New to Claude Skills? Learn how to install them →

langfuse on GitHub

Frontend Large Feature Architecture

Free

Architect complex frontend features with ease.

by langfuse32.8k stars on langfuse/langfuse
2 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Frontend Large Feature Architecture does

The Frontend Large Feature Architecture skill is designed for developers and designers working on large, state-heavy frontend applications, particularly those using Langfuse. This skill provides guidelines and best practices for structuring components and managing state effectively, ensuring that your application remains performant and maintainable. It emphasizes the importance of separating rendering logic from feature logic, which can lead to cleaner, more understandable code and improved performance.

The skill outlines a set of principles known as the 'Big Feature Rules,' which advocate for a clear division between UI rendering and data management. By following these rules, developers can create components that are primarily view-focused, while delegating complex data handling and side effects to dedicated functions or stores. This approach minimizes the risk of components becoming overly complex and helps maintain a responsive user interface.

Additionally, the skill addresses common pitfalls in React development, such as the misuse of hooks like useEffect, useMemo, and useCallback. It encourages developers to derive state directly in the render process rather than relying on effects, which can lead to unnecessary re-renders and performance issues. By adopting these practices, teams can build applications that are not only easier to reason about but also more efficient in terms of rendering and state management.

Overall, this skill is ideal for teams looking to improve their frontend architecture, particularly when dealing with large features that require careful attention to performance and maintainability. It serves as a comprehensive resource for refactoring existing components or building new ones with best practices in mind.

When to use it

Use this skill when developing or refactoring complex frontend features that involve high-frequency state updates or large data sets.

When not to use it

This skill may not be suitable for small projects or simple components where the overhead of implementing these guidelines outweighs the benefits.

What you can build with it

Refactoring a Complex Component

Use this skill to break down a large component into smaller, more manageable pieces while maintaining performance.

Implementing Virtualized Lists

Apply the guidelines for virtualized lists to efficiently render large datasets without compromising UI responsiveness.

Managing High-Frequency State

Utilize local Zustand stores for managing state in applications with rapid updates, ensuring smooth user experiences.

How to install Frontend Large Feature Architecture

View source

1. Install with the skills CLI

npx skills add langfuse/langfuse/frontend-large-feature-architecture --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by langfuse

Frontend Large Feature Architecture

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.

Big Feature Rules

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.

React Without useEffect

UI is a pure function of state. Do not use useEffect to derive, prepare, or sync data:

  • Derived values are computed in render (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.
  • When loaded data seeds editable state, split the component: an outer data-preparer/controller fetches and renders a loading state (prefer a skeleton; <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.
  • Define a form only where all initial values are already prepared; if data is still loading, the form lives deeper in the tree.
  • Complex actions live outside React as plain functions using the store or query client — not inside components, not behind effects.
  • 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.

Required Model

  • The page/view owns lifecycle and creates feature-scoped dependencies.
  • Server/query state stays in tRPC/React Query; route state stays in the router/filter hooks.
  • High-frequency feature UI state belongs in a per-mount local vanilla Zustand store. Create it with lazy useState, not useMemo.
  • Global stores are only for truly cross-feature, cross-route product state.
  • React context may provide a stable store or action owner. Do not put frequently changing state directly in provider values.
  • Rendered rows/cells/items should be view-only or narrow containers. Put effects, subscriptions, data loading, and workflows outside expensive views.
  • Shared src/components/* exports should stay context-free or receive explicit props. Put view-scoped Zustand consumers in src/features/*.
  • Large feature folders should have a concise README.md owner map.
  • Migrate real features toward this model whenever you touch them: improve state boundaries, action workflows, data-preparation seams, and render boundaries. Hundreds of legacy cases remain — do not preserve a legacy shape just to keep a change small.

Local Store Default

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.

When To Read References

Frequently asked questions about Frontend Large Feature Architecture

Similar skills