Feature-sliced-design skill
npx skills add https://github.com/aiko-atami/fsd --skill feature-sliced-designInstala esta habilidad con la CLI y comienza a usar el flujo de trabajo SKILL.md en tu espacio de trabajo.
This skill helps Codex apply the Feature-Sliced Design (FSD) v2.1 architecture methodology to frontend projects.
Main update: the "Pages First" approach.
pages and widgets; extract to features or entities only with real reuse.app, pages, widgets, features, entities, shared)@x notation) in entitiessharedCreate a directory for custom skills:
mkdir -p ~/.codex/skills
Copy as a single skill file:
cp SKILL.md ~/.codex/skills/feature-sliced-design.md
Or copy as a skill folder:
mkdir -p ~/.codex/skills/feature-sliced-design
cp SKILL.md ~/.codex/skills/feature-sliced-design/
cp -r agents ~/.codex/skills/feature-sliced-design/
Place the feature-sliced-design-skill folder in your project root and point Codex to use it.
The skill should trigger when you:
User: "Create a profile edit form"
Codex: I will place it in pages/profile/ because it is used only on this page.
If reuse appears later, we can move it to features/.
User: "I have a UserProfile component in features/, but it is used on one page"
Codex: In v2.1, it should move back to pages/. Features should contain reusable interactions.
User: "Help me set up a new React project with FSD v2.1"
Codex: [creates structure, configures path aliases, explains Pages First]
User: "Entity User needs to reference Order"
Codex: Use @x notation for explicit cross-imports between entities.
1. Start in pages/ and keep code near usage.
2. Extract to features/entities only with real reuse.
3. Do not predict future reuse; wait for real repetition.
app/ <- App initialization
pages/ <- Pages with their own logic
widgets/ <- Composite UI blocks with their own logic
features/ <- Reusable business interactions
entities/ <- Reusable business entities
shared/ <- Infrastructure and application-aware shared code
Note: The processes/ layer is deprecated in v2.1.
A module can import only from lower layers:
features/ -> entities/, shared/entities/ must not import from features/Each slice should expose a public API through index.ts:
// features/auth/index.ts
export { LoginForm } from './ui/LoginForm';
export { useAuth } from './model/useAuth';
src/
├── app/
├── pages/
├── widgets/
├── features/
├── entities/
└── shared/
Steiger is the official tool for validating FSD rules:
npm install -D @feature-sliced/steiger
npx steiger src
Checks include:
Migration is non-breaking and can be gradual:
pages/.widgets/.features/ and entities/.shared with infrastructure and app-level constants.processes/ usage.Ask Codex: "In FSD, where should I place [code description]?"
The skill should identify the violation and propose a fix.
This skill is based on official Feature-Sliced Design documentation and is free to use.
Important: This skill follows FSD v2.1 and the "Pages First" approach. Treat it as practical guidance, not rigid law.
Golden rule (v2.1): Start in pages/widgets; extract to features/entities only when real reuse appears.