Feature-Sliced Design

Implement Feature-Sliced Design architecture in Next.js projects with a 7-layer structure.

5|3|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/constellos/claude-code-plugins --skill feature-sliced-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Feature-Sliced Design
Source: https://github.com/constellos/claude-code-plugins/tree/main/plugins/project-context/skills/feature-sliced-design
Command: npx skills add https://github.com/constellos/claude-code-plugins --skill feature-sliced-design

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Feature-Sliced Design provides a scalable, discipline-based frontend architecture to prevent tangled imports and enable clear ownership across an app.

Core Features & Use Cases

  • Clear 7-layer structure (app, views, widgets, features, entities, shared) with strict import rules that reduce circular dependencies.
  • Custom 'views' layer to separate business logic from Next.js App Router routing, supporting Next.js apps and Turborepo monorepos.
  • Slices and segments discipline for modular, slice-isolated code that can be developed independently and composed into pages.
  • Migration guidance for moving from traditional monolithic structures to FSD, including public API conventions and colocated tests.

Quick Start

Set up the 7-layer folder structure under src (app, views, widgets, features, entities, shared) and begin by defining a core entity under src/entities, then build features that consume that entity, compose widgets, and finally expose pages in src/views and route with app/

Frequently Asked Questions about Feature-Sliced Design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Next.js frontend with Feature-Sliced Design?

Next.js frontend structure using Feature-Sliced Design organizes code into a 7-layer architecture: app, views, widgets, features, entities, and shared. This structure enforces strict import rules to reduce circular dependencies and separate business logic from App Router routing.

What is the best way to prevent circular dependencies in a frontend monorepo?

Preventing circular dependencies in a frontend monorepo is achieved by adopting Feature-Sliced Design. It enforces strict layer import rules and slice isolation, ensuring modules are developed independently and composed cleanly into pages without tangled imports.

Can I use Feature-Sliced Design in a Turborepo monorepo?

Feature-Sliced Design works in Turborepo monorepos and scales to apps of any size. It applies the same 7-layer architecture and import rules to manage shared code across multiple packages, maintaining clear ownership and modular slice isolation.

Where should I place business logic when using Next.js App Router?

Business logic in Next.js App Router belongs in the custom 'views' layer of Feature-Sliced Design. This separates it from routing concerns, allowing pages in the app layer to route while widgets and features handle the underlying presentation and logic.

How do I migrate an existing frontend app to Feature-Sliced Design?

Migrating an existing frontend app to Feature-Sliced Design involves moving from monolithic structures to the 7-layer setup. You start by defining core entities under src/entities, build features that consume them, compose widgets, and establish public API conventions.

Why do I need a views layer in frontend architecture?

A views layer in frontend architecture separates business logic from Next.js App Router routing. This isolation prevents routing configurations from tangling with feature composition, keeping slices modular and enabling independent development of UI components.