Skip to content
EN · PT

Gate: layer-boundary

The layer does not reach what is not its own (boundaries:).

Property Value
Checker layer-boundary
Confronts code
Blocking by default — new project yes
Blocking by default — existing project no — informs

Confronts a code file against the architecture the project DECLARED: the layers exist on paper, but do they respect each other?

Anchors already declared layers — and did not confront whether they hold. Declaring screens/, hooks/, repositories/ and never verifying that the screen does not talk straight to the repository is drawing the architecture and not defending it: layers: becomes documentation.

The gap surfaced because every project solved it alone. A real project kept a 366-line shell script with 15 hand-written architectural rules — all of the same shape: “files matching THIS pattern must not contain THAT one”. Fifteen instances of a single mechanism, reimplemented because the framework did not offer it.

The rule is declared in anchors.yaml and is language-agnostic — the project writes the pattern, the engine knows no dialect: a layer says to whom it applies, forbid what must not appear, because the reason that keeps it from being ritual, and severity the maturation of the rule. The honest opt-out is @allow-boundary: <reason> on the line: acknowledged debt stays visible and dated in the code, instead of becoming an exception in a distant list nobody revisits.

gates:
- name: layer-boundary
on: [code]
check: layer-boundary

Source: checker · its spec