ui

ui is a cursor rule for Cursor from virastack/ai. It costs 0 tokens per session (608 once invoked), scanned A, original, MIT.

A set of interface-building rules for shadcn/ui and Tailwind CSS. These are tools for assembling reusable interface elements and styling web pages.

In plain words
What is it for?
Use it when creating interface primitives, shared components, layouts, forms, loading states, and responsive pages.
Why use it?
It reduces inconsistent components, styling, responsive layouts, and accessibility problems.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when creating interface primitives, shared components, layouts, forms, loading states, and responsive pages.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/virastack/ai/ui
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.

Clone the repo
git clone --depth 1 https://github.com/virastack/ai

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ui

README.md
[![agentmods](https://agentmods.dev/badge/rules/virastack/ai/ui/github.svg)](https://agentmods.dev/rules/virastack/ai/ui)
Your own site
<a href="https://agentmods.dev/rules/virastack/ai/ui"><img src="https://agentmods.dev/badge/rules/virastack/ai/ui/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ui

Your own site · 80×15
<a href="https://agentmods.dev/rules/virastack/ai/ui"><img src="https://agentmods.dev/badge/rules/virastack/ai/ui.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 608 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00608
Opus 5.5 $0.00000 $0.00243
Sonnet 5.5 $0.00000 $0.00122
Haiku 4.5 $0.00000 $0.00061

Measured 8d ago against content hash 2c5f21c08498, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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 8d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • ui — 89% identical, 3 lines differ
templates/rules/ui.mdc · 54 lines

How it starts

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

UI

Components

  • components/ui: primitives without data or store access. components/shared: reused app components. features/<feature>/components: domain UI.
  • Add primitives with {{EXEC_COMMAND}} shadcn@latest add <component>; do not hand-write them.
  • Find the primitive library first: style in components.json (base-… or radix-…), else package.json (@base-ui/react or @radix-ui/*). Never mix them.
  • Merge classes with cn() (@/lib/utils), never template strings.
  • Data-driven UI has loading (a skeleton of the final size), empty and error states.
  • Animate with motion/react and respect reduced motion.

Tailwind CSS 4

  • Theme tokens and the default scale only (bg-background, p-4). No hex, rgb or arbitrary values like p-[13px].
  • v4 class names: bg-linear-to-r instead of bg-gradient-to-r, size-4 instead of w-4 h-4.
  • Mobile first from 320px; check every breakpoint up to xl.

Accessibility

  • Semantic HTML: button for actions, links for navigation, one h1 per page, no skipped heading levels.
  • Every control has a name: visible text, a <label>, or aria-label if nothing is visible.
  • Everything works by keyboard and focus is visible.
  • Dialogs and menus use the primitive's focus handling, never a custom focus trap.
  • Text contrast meets WCAG AA (4.5:1). Never show state with color alone.
  • Meaningful alt text; alt="" for decorative images.

Bans

  • onClick on div or span.
  • The generic "AI look": indigo or purple defaults, gradients everywhere, rounded-2xl on everything, identical card grids. Lorem ipsum.

type StatCardProps = { label: string; value: string; className?: string };

export function StatCard({ label, value, className }: StatCardProps) { return ( <section className={cn("rounded-lg border bg-card p-4 md:p-6", className)}> {label} {value} ); }

</example>

Read the full file on GitHub · 54 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. 8d ago First seen · 54 lines · 0 tokens per session scan A 2c5f21c08498

Subscribe to this mod's changes

ui is a cursor rule published in the GitHub repository virastack/ai (23 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 608 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-10-22.