Entity model

The eight entity kinds that make up the uidex registry and how each is discovered.

uidex discovers most entities by convention. You only annotate to override a convention, to opt out, or to declare something that has no conventional location (a widget, acceptance criteria, a primitive description).

Module-scoped metadata is authored as a single named export:

DOM-scoped metadata (elements, regions, widget roots) stays on data-uidex* attributes. Legacy JSDoc tags (@uidex page|feature|widget, @acceptance, @uidex:not-flow) are no longer recognised — see the migration section in uidex scan.

The eight kinds

Convention reference

Region id derivation

When the scanner auto-promotes a landmark to a region, the id is derived (first match wins):

  1. The element's id attribute
  2. Its aria-label (kebab-cased)
  3. kebab(tagName + index-within-file) — e.g. header-1, nav-2

A data-uidex-region="my-id" on the same element replaces the derived id.

Primitive name derivation

Files under a primitives glob are registered with name = kebab(basename(file)):

  • src/ui/Button.tsxbutton
  • src/ui/TextField.tsxtext-field

data-uidex-primitive="my-button" on the component's root element replaces the basename-derived name.

Override precedence

For any single entity, precedence is:

  • Setting conventions.primitives = false disables filesystem discovery globally. Annotated primitives still register.
  • An export const uidex value wins over any convention-derived id on the same module.
  • page: false / feature: false / primitive: false in an export const uidex opts a convention-matching module out of registration.

Element annotation is intentional

The scanner does not auto-promote DOM elements. element registration requires an explicit data-uidex attribute. uidex scan --audit may flag interactive elements lacking an annotation.

Marker MD files are obsolete

UIDEX_PAGE.md and UIDEX_FEATURE.md are not read. uidex scan --audit emits a migration warning when these files are present.