Skip to content
Primer printing platePrimer

Token procedures

Primer defines shared primitives, semantic roles, guarantees, component guidance, and inspectable recipes. Applications own their components, interactions, domain data, persistence, and composition. Tally and Notami remain reference integrations and keep their current components and themes until adoption is requested.

  • Standard. Use an app-owned component that follows a Primer spec.
  • Composition. Build a layout from those components and public tokens.
  • Extension. A new component, variant, or visual style. Change the spec or the tokens in Primer first, then the app.

A composition rebuilt three times becomes a candidate shared pattern. Record the observed product evidence, use cases, intentional differences, states, keyboard behavior, and responsive behavior before promoting it. A pattern is guidance and a review contract, not a new shared React component. If it needs coordinated visual decisions, change the spec or tokens first. The desktop patterns and reference audit demonstrate this process for Tally, Fable, and Wick’s left navigation.

Component guidance defines the expected keyboard behavior, focus and semantics. Applications implement and verify them in context. Radix components in Tally and AFFiNE components in Notami retain their existing responsibilities. Primer’s token contrast guarantees cover the declared color pairs.

An app may keep a primer-exceptions.yaml entry with an id, what, why, owner, and review date. Code that breaks a rule carries primer-exception: <id> on the same line, or in the first 40 lines when the whole file is the exception. tokens:check rejects an unknown id and an overdue review date.

The public name is the identity. Before 1.0, a breaking change bumps the minor version.

  • Major. Remove or rename a public token, change a type, make a token internal, change the theme switch, remove a class, weaken a guarantee, remove a spec variant, or remove a terminal role.
  • Minor. Add a token, accent, class, guarantee, spec, or variant. Deprecate something, with a check warning and a migrate entry. Change a value or a terminal role mapping when every guarantee still holds.
  • Patch. Fix a mistaken value, edit a description, or change something that is not public.

npm run release:check compares the current contract with the last v* tag and rejects a version that does not match the change.

A token-contract diff covers public names and types. Review spec changes in specs/. See elements for ownership and agent kit for the snapshot another project adopts.

Tag v* and do not move a published tag. Protecting those tags is a GitLab setting. Primer does not publish npm packages. Another project adopts a design-kit snapshot, described in agent kit.

Tally, Fable, and Notami remain reference consumers until their owner requests adoption. Wick may keep a checkout-local snapshot of tokens.css and desktop.css with source provenance and checksums. Keep the original source and snapshot verification explicit, and regenerate rather than editing a delivered copy.

No Figma file or Supernova project is required. Applications keep their framework and workflows. Stylelint is not installed. Add it only after the dependency is approved. Custom properties and component styling hooks are added for a demonstrated consumer need and documented as public contracts.

The 0.4 development baseline intentionally changes default values to the selected Fable direction while preserving existing token names, types, and aliases. Orange is the default; brown remains an explicit alternate. Catalog specimens and copyable recipes do not become consumer component APIs.