40-ui

A set of rules for frontend, user-interface, user-experience, and design-system work. It routes design tasks, protects existing project design systems, and requires rendered verification where allowed.

In plain words
What is it for?
Use it when changing frontend layouts, components, visual styles, or design-system behavior, especially when checking the rendered result.
Why use it?
It keeps interface changes consistent with the project’s own design rules and prevents unrelated design guidance from overriding established constraints.

Cursor rule for Cursor

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/conlinjoe/ai-platform/40-ui
Clone the repo
git clone --depth 1 https://github.com/ConlinJoe/ai-platform

Made for: Cursor.

Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,786 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.00022 $0.04786
Opus 5 $0.00011 $0.02393
Sonnet 5 $0.00004 $0.00957
Haiku 4.5 $0.00002 $0.00479

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

Security

Grade A, and why

40-ui 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.

.cursor/rules/40-ui.mdc · 589 lines

How it starts

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

UI / UX

Canonical UI router. Do not load extra design skills. Do not dump Hallmark's reference corpus into context.

Instruction priority (00-platform) still applies: project/harness rules outrank Hallmark. Vendor skills do not authorize browser automation beyond what 60-browser-qa allows.

These platform-owned design constraints outrank Hallmark. If Hallmark recommends a technique prohibited here, do not use it. Do not modify Hallmark vendor content to encode developer preferences. Keep those preferences in this rule.

Design philosophy: product-specific, spacious, hierarchy-driven design. Avoid recognizable AI/template conventions.

Design-system ownership

If the project already has tokens, a Tailwind/theme config, a component library, a design contract, design.md / DESIGN.md, or equivalent project-owned design documentation, that system is authoritative.

Hallmark may reason within it or propose a deliberate evolution. It must not silently replace it. If the task requires changing the established system, say so explicitly before drifting.

Load relevant feature contracts from docs/README.md (design system, page behavior, component contracts) before implementing. Update those contracts when user-visible behavior changes.

Always-on floor

  • Before significant UI, identify: what product this is, who uses it, what the user is trying to accomplish, the established visual language if one exists, the appropriate information density, and what should receive visual emphasis.
  • Design for this subject. A layout that could be dropped unchanged into an unrelated SaaS product is suspect.
  • Prefer generous whitespace: breathing room between conceptual groups, comfortable section spacing, and clear separation through space before adding containers or dividers. Do not fill empty space merely because it exists.
  • Adjacent semantic sections must remain visually distinguishable. Semantic section boundaries should also be perceptible visual boundaries. Do not solve this by mechanically alternating backgrounds or adding unearned containers.
  • Establish structure with typography, spacing, scale, alignment, composition, contrast, and content hierarchy before adding unearned cards, borders, dividers, badges, icons, numbers, gradients, or decorative graphics. Cards that earn semantic grouping are structure, not decoration. Do not use decoration to compensate for weak hierarchy.
  • Consider whether custom imagery, photography, illustration, or vector artwork would materially improve a composition. Do not default to text-only UI, and do not add filler imagery.
  • Avoid recognizable AI/template conventions unless they serve this product, content, and user.
  • UX writing is interface design: specific, user-facing, consistent.
  • Preserve consistency across an established product.
  • Implement framework-natively. Tailwind composition follows 20-coding.
  • Responsive behavior and accessibility are part of design, not extras. Mobile composition is not merely desktop content stacked vertically.
  • Do not declare significant UI complete from source code alone.

Read the full file on GitHub · 589 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 · 589 lines · 22 tokens per session scan A 860565b1d6e8

Subscribe to this mod's changes

40-ui is a cursor rule published in the GitHub repository ConlinJoe/ai-platform (2 stars, last pushed 4d ago), licensed MIT. It adds 22 tokens to every session and 4,786 once invoked, about $0.0001 per session on Opus 5. 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-31.