organizing-fsd-architecturelisted
Install: claude install-skill dork-labs/dorkos
# Organizing FSD Architecture
## Overview
This skill provides expertise for implementing Feature-Sliced Design (FSD) in the DorkOS monorepo. FSD organizes code by business domains with clear layer boundaries and unidirectional dependency rules.
## When to Use
- Creating new features, widgets, or entities in `apps/client`
- Deciding where code should live (which layer/segment)
- Reviewing imports for layer violations
- Refactoring components into FSD structure
- Adding new services to `apps/server` (size-aware guidance)
## Layer Hierarchy
FSD uses strict top-to-bottom dependency flow within `apps/client/src/layers/`:
```
app → widgets → features → entities → shared
```
| Layer | Purpose | Can Import From |
| ----------- | ----------------------------------------------------- | -------------------------- |
| `app/` | App initialization (`App.tsx`, `main.tsx`, providers) | All lower layers |
| `widgets/` | Large UI compositions (app layout, sidebars) | features, entities, shared |
| `features/` | Complete user-facing functionality (chat, commands) | entities, shared |
| `entities/` | Business domain objects (Session, Command) | shared only |
| `shared/` | Reusable utilities, UI primitives, Transport | Nothing (base layer) |
### Dependency Rules (Critical)
```
ALLOWED: Higher layer imports from lower layer
features/chat/ui/Chat