Expand description
Rule engine — the Rule trait and the built-in registry.
To add a new rule, see .agents/rules/rule-engine-patterns.md. The
short version:
- Add a module under
src/rules/with a type implementingRule. - Register it in
register_builtin. - Add a golden snapshot test under
tests/. - Document it at
docs/src/rules/<rule-id>.md.
Modules§
- a11y
- Accessibility rules.
- baseline
- Baseline-rhythm rules.
- color
- Color rules.
- edge
- Edge-alignment rules.
- opacity
- Opacity rules.
- radius
- Border-radius rules.
- shadow
- Box-shadow rules.
- sibling
- Sibling-relationship rules.
- spacing
- Spacing rules.
- type_
- Type-scale rules.
- z
- Z-index rules.
Structs§
- Rule
Metadata - Static metadata needed by output formats and rule listings.
Traits§
- Rule
- A rule — the fundamental unit of work in the engine.
Functions§
- builtin_
rule_ metadata - Return metadata for every built-in rule, sorted by rule id.
- register_
builtin - Return every built-in rule in registration order. Registration order
is not part of the public contract — the engine sorts the resulting
violations by
(rule_id, viewport, selector, dom_order)before return.