/engineering-paved-path:react-frontend-architecturefrom engineering-paved-path
React/Next.js frontend architecture & code organization (2025-26): where files live, how to split components, feature-based structure, co-location, constants/utils/helpers/types/hooks placement, where business logic goes, import boundaries, barrel files, path aliases, and naming conventions. Use when structuring a new frontend, deciding where a file or piece of logic belongs, splitting an oversized component/module, reviewing folder layout, or naming files. Stack-agnostic (React 19 + Next.js 15 App Router aware).
Ships in engineering-paved-path. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
How a React/Next.js frontend should be organized — where code lives, how it's split, and what to name it. This is about structure and placement, not component runtime correctness. For code examples (good/bad per rule) see examples.md; for sources see references.md.
Sibling skills (do not duplicate):
engineering-paved-path:react-best-practices → component purity, hooks misuse, memoization, keys, derive-don't-store.engineering-paved-path:next-best-practices → App Router file conventions, RSC mechanics, metadata, image/font optimization.Colocation: place code as close to where it's used as possible. A file's location is a claim about its scope. Promote code to a shared layer only when a second consumer actually appears — not in anticipation. Premature shared abstractions (AHA: Avoid Hasty Abstractions) are as harmful as duplication.
features/checkout/ beats a global components/, hooks/, utils/ split once the app has more than a handful of screens.components/, hooks/, utils/ at the root) is fine for small apps but scales poorly: working on one feature forces edits across many directories (low cohesion, high coupling).api/, components/, hooks/, stores/, types/, utils/.shared/, components/ui/, lib/) for genuinely cross-feature primitives only.app → pages → widgets → features → entities → shared) makes boundaries explicit. Adopt the layering, not necessarily the full vocabulary.components/ within the feature, or a flat shared components/ for cross-cutting UI. Avoid Atomic-Design buckets (atoms/molecules/organisms) — categorizing wastes time and the boundaries are arbitrary.hooks/ (feature-local) or alongside the component that owns them. One hook per file, file named after the hook (useCart.ts).constants.ts (feature-local) or shared/constants/. Never scatter magic values inline; never dump everything into one global constants.ts with thousands of lines — split by domain.types.ts colocated with the feature; shared contracts in a shared types module. Co-locate a type with its consumer until a second consumer appears.utils/.helpers.ts.utils/ should hold pure functions only. A function with side effects is not a util — it belongs in a hook, service, or data layer.api/ or lib/ module (a Data Access Layer), never inline in components.server-only so they can't be imported into the client bundle.shared → features → app. Lower layers never import from higher layers. This keeps the dependency graph acyclic and prevents tangled coupling.import/no-restricted-paths or equivalent), not by convention alone.index.ts that re-exports a folder's contents) for internal modules. They break tree-shaking, slow dev servers/bundlers, and create circular-import hazards. Import directly from the source file.@/features/..., @/shared/...) instead of deep relative chains (../../../).children/slots over adding ever more boolean/config props. A component accreting many flags (isModal, isCompact, hasHeader...) wants to be split or composed.children prop and composition to avoid prop drilling before reaching for context. Lift content up; pass elements as props/slots.<Tabs><Tabs.List/><Tabs.Tab/></Tabs>) express related parts that share implicit state — use them for cohesive widget families instead of one mega-component with a giant prop list.any/broad objects. Provide defaults for optional props.useState/Redux/Zustand.useState/useReducer), URL state (search params for filters/pagination/sorting), server cache (TanStack Query/SWR), app-wide client state (Zustand/Jotai/Redux only when warranted).useOrders, useCreateOrder) so components depend on an intent-revealing API, not raw fetch/query plumbing.useEffect — derive it. (Detail lives in engineering-paved-path:react-best-practices; relevant here because it dictates that derived values get no storage location at all.)PascalCase — UserCard, UserCard.tsx.useCamelCase, file useCart.ts. The name must convey intent ("what it does/returns"), not implementation. A hook you can't name clearly is probably too coupled to one component.camelCase. Booleans: prefix is/has/should (isLoading, hasAccess).UPPER_SNAKE_CASE for true constants; PascalCase/objects for enums/config maps.kebab-case for folders, PascalCase for component folders). Pick one and don't mix.validation.helpers.ts, order.constants.ts, cart.types.ts beat a dozen ambiguous index.ts/utils.ts.index.ts re-exporting everything.../../../../).server-only guard).utils.ts/constants.ts instead of domain-split files.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
8 skills in this plugin
/fastify-best-practicesGuides development of Fastify Node.js backend servers and REST APIs using TypeScript or JavaScript. Use when building, configuring, or debugging a Fastify application — including defining routes, implementing plugins, setting up JSON Schema validation, handling errors, optimising performance, managing authentication, configuring CORS and security headers, integrating databases, working with WebSockets, and deploying to production. Covers the full Fastify request lifecycle (hooks, serialization, logging with Pino) and TypeScript integration via strip types. Trigger terms: Fastify, Node.js server, REST API, API routes, backend framework, fastify.config, server.ts, app.ts./next-best-practicesNext.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling/onion-architectureEnforces Onion Architecture (dependencies point inward) on a TypeScript backend (a Fastify + Drizzle + Zod server/ package and a pure domain core, reviewer-core in the reference layout). Use this skill whenever you add or change a backend route, service, repository, adapter, DB query, contract, or DI wiring — and whenever deciding WHERE a piece of logic, an external-tool call (LLM/OpenAI/Anthropic/OpenRouter, GitHub/octokit, git, ripgrep/ast-grep, Postgres), a type, or a validation belongs across layers. Also use when reviewing layering, an import that crosses package/layer boundaries, a leaked Drizzle query, a directly-instantiated SDK client, or business logic creeping into a route. Trigger terms: onion architecture, layer, dependency direction/rule, ports and adapters, repository, service, adapter, composition root, container, dependency inversion, where should this live, layering violation./react-best-practicesModern React best practices and anti-pattern catalog (2025-26). Use when writing, reviewing, or refactoring React components, hooks, and state management. Covers component design, state patterns, hooks misuse, performance, data fetching, and code organization./react-testing-libraryGeneral-purpose React Testing Library guide with Vitest. Use when writing, reviewing, or setting up React component and hook tests. Covers project setup from scratch, RTL query priority, userEvent, async patterns, mocking strategies, and common anti-patterns. Applicable to any Vite + React project./securityWeb application security best practices based on OWASP Top 10:2025. Use when reviewing code for vulnerabilities, implementing auth/authorization, handling user input, working with file uploads, managing secrets, or building API endpoints. Covers React, Express, MongoDB, and JWT security.npx claudepluginhub syukpublic/dev-digest-ai-marketplace --plugin engineering-paved-path2 plugins ship this exact skill · first indexed Jul 20, 2026