Clarx

AI Rules Layer

Portable guidance files that keep AI assistants aligned with your repo conventions.

Teams increasingly ship code with AI assistance — through Claude, Cursor, Copilot, or custom agents. Without guidance, these tools improvise: wrong file choices, override-heavy patterns, missing verification steps. The output works, but it does not compose with your standard or stay consistent across sessions.

The AI rules layer is a set of portable instructions that teams add to their repos so agents follow your conventions — manifest locations, verification commands, semantic vocabulary, and review habits.

What the rules layer does

Guide generation

When AI creates new UI, it should reach for the design system first — using semantic props and existing components rather than constructing visual patterns from scratch.

Guide clarification

When a request is visually specific but semantically unclear ("make this red," "make it stand out"), the AI should ask what it needs to communicate before writing code.

Guide migration

When a codebase has accumulated override-heavy patterns, AI can help identify repeated overrides and convert them into system vocabulary.

Guide review

When AI reviews UI code, it should flag places where meaning is being encoded through styling instead of system-level semantics.

What the layer contains

Why this is part of the core system

A design system that only ships components but not guidance for how AI should use them is incomplete. AI will use those components incorrectly — or not at all — unless the system tells it how.

The AI rules layer turns your design system from a set of files into a set of instructions. Teams can adopt the components and the rules together, or adopt the rules alone with their existing system. Either way, the AI starts building more consistently.