fsd-architecture

Organize Next.js/React projects using Feature-Sliced Design layer hierarchy.

2|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/atilladeniz/next-go-pg --skill fsd-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fsd-architecture
Source: https://github.com/atilladeniz/next-go-pg/tree/main/.claude/skills/fsd-architecture
Command: npx skills add https://github.com/atilladeniz/next-go-pg --skill fsd-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the complexity and inconsistency often found in large frontend codebases by providing a clear, structured approach based on Feature-Sliced Design (FSD). It helps you maintain a scalable and understandable architecture, reducing development time and onboarding friction.

Core Features & Use Cases

  • Strict Layer Hierarchy: Enforces FSD's "only import downward" rule, preventing architectural tangles.
  • Public API Pattern: Guides you to expose only necessary parts of a slice, improving encapsulation and maintainability.
  • New Feature/Entity Creation: Provides a step-by-step guide for correctly scaffolding new features and entities within the FSD structure.
  • Use Case: When building a new feature like "User Profile," use this skill to ensure it adheres to the strict FSD layer hierarchy and public API patterns, preventing common architectural errors and ensuring consistency across the application.

Quick Start

Explain the core principles of Feature-Sliced Design (FSD) architecture and how it helps organize a large frontend application into manageable, independent slices.

Frequently Asked Questions about fsd-architecture

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

FAQPage Schema
How do I organize a React or Next.js project structure to scale without architectural chaos?

Feature-Sliced Design organizes your codebase into independent slices with strict layer hierarchy (app, widgets, features, entities, shared), ensuring code scales predictably. Each slice follows a standardized structure with ui, model, api, and lib segments, preventing architectural tangles and reducing onboarding friction.

What is the "only import downward" rule in Feature-Sliced Design and why does it matter?

The downward import rule enforces that higher layers can depend on lower layers, but never the reverse. This creates a clear dependency direction, prevents circular imports, and keeps your architecture maintainable and testable across large codebases.

How do I create a new feature or entity correctly in an FSD-structured React application?

Define your feature within the appropriate FSD layer (features or entities), organize it into segments (ui, model, api, lib), expose only what's necessary through an index.ts Public API, and use TypeScript path aliases for clean imports. This ensures consistency and prevents exposing internal implementation details.

Can I use Feature-Sliced Design with TypeScript and path aliases in Next.js projects?

Yes. FSD works seamlessly with Next.js and TypeScript by leveraging path aliases to map slice imports cleanly. Configure aliases in tsconfig.json to match your layer and slice structure, enabling organized imports that enforce the FSD hierarchy automatically.

What's the difference between creating a feature versus an entity in Feature-Sliced Design?

Entities represent core business objects (User, Post) shared across features, while features are user-facing workflows that combine multiple entities (UserProfile feature). Entities live lower in the hierarchy, allowing features to depend on them without circular dependencies.

Why use the Public API pattern with index.ts files in FSD slices?

The Public API pattern exposes only the necessary exports from each slice through index.ts, hiding internal implementation. This improves encapsulation, makes refactoring safer, and clarifies what each slice provides to the rest of the application.