Architecture rules as lint errors, for people and agents

I moved Feed to Feature-Sliced Design and wrote lint rules for our team's conventions. A separate review agent checks changes that bypass those rules.

ESLint rules in fsd-rail, the same for people and agents
8
slices in three layers, import direction checked by lint
14
Where
Feed at Rogii
When
FSD in April 2025, fsd-rail from December 2025, review plugin in August 2026
My part
Migrated the frontend to FSD and built the lint and review plugins
Stack
ESLint, TypeScript, Feature-Sliced Design, fsd-cruise, Claude Code

At Rogii, our frontend conventions cover both where code belongs and how it uses the design system. I put those conventions into lint rules so developers and coding agents get feedback while they work.

Feature-Sliced Design

In April 2025 I moved the app to Feature-Sliced Design (FSD): fixed layers, with imports pointing to lower layers. I added @conarti/eslint-plugin-feature-sliced to check the layer order and fixed every file it flagged.

To see the result I used fsd-cruise, an open source tool I wrote. It draws the dependencies between slices as a graph, so a wrong arrow stands out.

Five FSD layers from left to right: app, pages, features, entities, shared. Imports point only from a higher layer to a lower one. app router, bootstrap pages 3 slices features 6 slices entities 5 slices shared api, lib, ui imports point right, to a lower layer
The layers today. A lint rule checks the direction.

fsd-rail

FSD covers layer order, not the conventions a team adds on top. When I rebuilt the app in December 2025, I wrote those down as code: a small ESLint plugin, fsd-rail, in the repo from the first day. Two choices shaped it:

  • Violations report lint errors, with the same rules for people and agents.
  • Where possible, the error message names the file to import from, giving the developer or agent a concrete fix.

One example: the company's design system package may be imported only in shared/ui, where we wrap its components. A design system update can be handled in those wrappers.

These rules run alongside the existing FSD layer checks. Agents run lint as part of their verification, and CI runs it again.

Reviewing changes to the rules

Any lint rule can be switched off in a file, so in August 2026 I built a reviewer for exactly that. fe-review is a Claude Code plugin in Rogii's internal plugin marketplace (more on it). Its rails reviewer knows the rules and does not repeat what lint already reports. It looks for the ways around them: a new eslint-disable, a wider ignore list, a rule turned off, a file moved out of a rule's reach. It also flags what no rule can see, like business logic placed in shared.

Related: the frontend rebuild.

Questions about this project: [email protected]