---
description: Design system non-negotiables — components, tokens, and composition rules for <DESIGN SYSTEM NAME>. Use whenever writing or editing UI.
globs:
alwaysApply: true
---

<!--
  Destination: .cursor/rules/design-system.mdc

  The four Cursor rule types are not declared anywhere — they emerge from
  which of the three frontmatter fields you set:

    alwaysApply: true                    -> Always. Loaded every turn.
    alwaysApply: false + globs           -> Auto Attached. Loads on matching files.
    alwaysApply: false + description     -> Agent Requested. The model decides.
    neither                              -> Manual. Only via @rule-name.

  This file is the Always rule, so keep it to the non-negotiables. Put
  anything larger in a second file with `globs: src/components/**` and
  `alwaysApply: false`, so it loads only when it is relevant.

  A plain .md file in .cursor/rules has no frontmatter and is ignored. The
  extension must be .mdc.
-->

# <DESIGN SYSTEM NAME>

Full instructions: see `AGENTS.md` at the repo root.

## Hard rules

- Import UI from `<@scope/design-system>`. Never hand-roll a component that
  already exists there.
- There is no `Box`, `Stack`, `Container`, or `Flex`. Use `<layout primitive>`.
- No literal colours, spacing, radii, or font sizes. Tokens only:
  `var(--color-*)`, `var(--space-*)`, `var(--radius-*)`.
- Prop values come from the union type. Do not invent new ones — if the type
  rejects it, the answer is not to widen the type.
- Run `<pnpm typecheck>` before reporting a task complete.

## When unsure

Search the source before generating: `<rg "export function" src/components>`.
The fastest path to a working component is to write a new one, and that is
exactly how a codebase drifts away from its own design system. Ask instead.
