feature-slicing
Skill60 starsChanged 2 months agoMITView on GitHub
Organize frontend code with Feature-Sliced Design (FSD). Use when adopting FSD, placing code in an existing FSD project, or fixing slice imports and public APIs; not for every new component or page.
In this repository10 other files it gives its agents.
- bazelSkill
- clean-ddd-hexagonalSkill
- mermaid-diagramsSkill
- modern-cssSkill
- modern-javascriptSkill
- postgres-drizzleSkill
- slack-block-kitSkill
- slack-mrkdwnSkill
- teams-adaptive-cardsSkill
- teams-message-formattingSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
- Distinctive: line 12
Use the affected files, imports, framework/router, and requested behavior as input.
- Distinctive: line 14
Prefer page-local ownership until shared use or a distinct responsibility justifies extraction:
- Very specific: line 25
Use only the layers needed.
- Distinctive: line 49
Use the official FSD documentation for specification questions.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Feature-Sliced Design
Apply FSD v2.1 to the requested module-boundary decision. The user's explicit instructions take precedence over this skill's guidelines; an ordinary frontend edit is not permission to migrate its architecture.
Work within the project
Use the affected files, imports, framework/router, and requested behavior as input. Determine whether the repository already uses FSD or the user is asking to adopt it. If neither is true, preserve the existing structure.
Prefer page-local ownership until shared use or a distinct responsibility justifies extraction:
| Layer | Responsibility |
app | Initialization, providers, routing |
pages | Screens and their local UI, data, and logic |
widgets | Self-contained UI blocks |
features | Reusable user interactions |
entities | Shared business concepts |
shared | Infrastructure and domain-independent utilities/UI |
Use only the layers needed. Preserve framework-reserved directories and server/client boundaries, particularly in Next.js.
Maintain the import contract
- A slice imports other slices from lower layers, not sideways or upward. Explicit
@xAPIs are the documented cross-entity exception. appandsharedhave segments rather than slices; their segments can import one another.- Expose deliberate public APIs. Use internal relative imports to avoid importing a slice's own barrel; keep server-only exports out of client entrypoints.
- Name FSD segments by purpose (
ui,api,model,lib,config). Do not rename unrelated folders merely to match an example.
Deliver the requested placement, refactor, or review with the resulting import paths. For code changes, verify affected imports and use existing architecture checks when available. Install Steiger or rewrite path aliases only when the task calls for tooling setup.
References
Choose the reference that resolves the current decision.
| Task | Reference |
| Layer ownership and extraction | LAYERS.md |
Public APIs, barrels, cycles, @x | PUBLIC-API.md |
| Concrete entity/feature/widget/page examples | IMPLEMENTATION.md |
| Next.js route directories and server/client exports | NEXTJS.md |
| Requested migration of existing code | MIGRATION.md |
| Import matrix or compact structure lookup | CHEATSHEET.md |
Use the official FSD documentation for specification questions. Adapt example libraries and aliases to the installed stack.
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
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.

