Feature-Sliced Design for frontends
Explain Feature-Sliced Design (FSD) for frontends, including layers, slices, segments, public APIs, and dependency boundaries.
от agenticweb4222 установки в других каталогах
Установить Feature-Sliced Design for frontends в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Feature-Sliced Design for frontends
Based on the official Feature-Sliced Design specification.
FSD groups code into layers by responsibility, slices by their meaning to the product, and segments by purpose. Slices keep related changes together. Public APIs give consumers a stable entry point.
Architecture shape
<source root>/
app/routes/
pages/product-details/{ui,api}/
widgets/product-gallery/ui/
features/add-to-cart/{ui,model}/
entities/product/{model,ui}/
shared/{ui,api}/
| Layer | Responsibility |
|---|---|
app |
Entry points, routing, global styles, and dependency wiring. |
pages |
Full screens or major route content, including page-specific UI, state, and requests. |
widgets |
Self-contained UI blocks reused across pages or serving as independent regions within a page. |
features |
Reusable user actions with business value, such as adding an item to a cart. |
entities |
Business entities and their models, data access, or UI representations, such as products. |
shared |
General UI components, API clients, configuration, and libraries. |
app and shared contain segments directly. The other layers contain slices, which contain segments. Common segments include ui for presentation, model for state and rules, api for external interactions, lib for supporting code, and config for settings. Use layers and segments as their responsibilities arise. processes is deprecated.
Dependency boundaries
- From highest to lowest, the layers are
app → pages → widgets → features → entities → shared. Imports across slices target strictly lower layers and can skip intermediate layers. Modules within a slice can reference one another, as can segments withinappor withinshared. - Consumers access a slice through its public API. Segments in
appandsharedalso provide public entry points. Export what consumers need explicitly. Within a slice, import internal modules directly. - Compose sibling slices in a higher layer. When two entities have a direct model relationship,
@xcan expose a dedicated API to the named consumer. For example,entities/product/@x/orderservesentities/order.
Pages first
Keep page-specific UI, state, and requests in the page slice. A request specific to product details belongs in pages/product-details/api. When multiple pages reuse the add-to-cart action, features/add-to-cart owns the behavior and exposes an entry point for those pages.
Relationship to feature-first
Feature-first typically groups modules by business capability, then separates responsibilities within each module. FSD defines global layers, groups slices by product meaning within those layers, and governs imports between slices through the layer order.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Feature-Sliced Design for frontends?
Explain Feature-Sliced Design (FSD) for frontends, including layers, slices, segments, public APIs, and dependency boundaries.
Как установить скилл Feature-Sliced Design for frontends?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Feature-Sliced Design for frontends запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
AnthropicGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
webapp-testing
AnthropicToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
brand-guidelines
AnthropicApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
web-artifacts-builder
AnthropicSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…