react-sot-ui-primitives

A set of React UI component rules for repeated interface elements such as buttons, headings, chips, and code blocks. It recommends one source of truth for each reusable pattern and Storybook stories for its variations.

In plain words
What is it for?
Use it when extracting shared React components, documenting their variants in Storybook, and separating reusable UI primitives from larger page sections.
Why use it?
Webflow exports often repeat the same markup and styles on many pages, which makes later changes inconsistent and harder to maintain.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/dmenchaca/webflow-to-react/react-sot-ui-primitives
Clone the repo
git clone --depth 1 https://github.com/dmenchaca/webflow-to-react
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 735 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00735
Opus 5 $0.00000 $0.00367
Sonnet 5 $0.00000 $0.00147
Haiku 4.5 $0.00000 $0.00073

Measured 2d ago against content hash b6b664ffd904, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

react-sot-ui-primitives scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/react-sot-ui-primitives.mdc · 70 lines

How it starts

The opening of the file, as written. The whole thing — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.

UI primitives — one SOT, variant stories (step 10g)

Webflow exports repeat the same UI chrome on every page: buttons, eyebrow chips, heading scales, icon slots. During migration, extract each pattern into one React component with Storybook variant stories — not per-route markup.

Two-tier SOT model

Tier Examples Storybook folder When
UI primitives (10g) Button, Tagline, Heading, CopyableCodeBlock Components/UI/… Before section SOT
Page sections (11a) Hero, logo band, FAQ, CTA band Components/Page sections/… Before routes (11)

Sections compose primitives. Section CSS must not reimplement button borders, chip colors, or heading scales.

Audit signals (export)

Pattern Typical export classes
CTAs .button, .w-button, .is-secondary, .is-icon
Eyebrows mono uppercase bordered chips
Headings .heading-style-h1h6, or repeated title classes
Code snippets toolbar + monospace + copy

Grep CSS and HTML before porting routes. One component per pattern.

Required pattern

// Components/UI/Button.tsx — one SOT
<Button variant="primary" theme="dark" href="/signup">Try it free</Button>

// Components/UI/Button.stories.tsx — variants, not routes
export const Primary: Story = { args: { variant: 'primary', children: 'Try it free' } }
export const Secondary: Story = { args: { variant: 'secondary', children: 'Talk to us' } }

Routes and page sections import Button — never:

// Forbidden on new work
<a href="…" className="button w-button is-secondary">…</a>

CSS ownership

  • Primitive chrome (colors, padding, borders, font) → component CSS or global design-system entry.
  • Forbidden: route *-page.css targeting .button, .w-button, or .ui-button__* internals.
  • Forbidden: different button markup per page when Button SOT exists.

Storybook

  • Install and wire preview in step 10f before 10g.
  • Primitive stories use the same stylesheet tier as production.
  • Name stories after variants (Primary, Secondary, On dark) — not after routes (Home CTA, Pricing CTA).

Read the full file on GitHub · 70 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 70 lines · 0 tokens per session scan A b6b664ffd904

Subscribe to this mod's changes

react-sot-ui-primitives is a cursor rule published in the GitHub repository dmenchaca/webflow-to-react (27 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 735 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.