agentleFS
ontology-of-everythingontology-of-everything/concept-skills/skills/en/architect-frontend-fsd/SKILL.md

architect-frontend-fsd

Skill14 starsChanged 22 days agoApache-2.0View on GitHub

Explain Feature-Sliced Design (FSD) for frontends, including layers, slices, segments, public APIs, and dependency boundaries.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep page-specific UI, state, and requests in the page slice.

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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}/
LayerResponsibility
appEntry points, routing, global styles, and dependency wiring.
pagesFull screens or major route content, including page-specific UI, state, and requests.
widgetsSelf-contained UI blocks reused across pages or serving as independent regions within a page.
featuresReusable user actions with business value, such as adding an item to a cart.
entitiesBusiness entities and their models, data access, or UI representations, such as products.
sharedGeneral 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 within app or within shared.
  • Consumers access a slice through its public API. Segments in app and shared also 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, @x can expose a dedicated API to the named consumer. For example, entities/product/@x/order serves entities/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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.