component-update-ui

component-update-ui is a cursor rule for Cursor from oakensoul/nextjs-cursor-prompts. It costs 0 tokens per session (5,119 once invoked), scanned A, original, MIT.

A set of instructions for improving an existing user-interface component within a design system, including its appearance, states, accessibility, and interactions.

In plain words
What is it for?
Use it to review and update component variants, design tokens, ARIA attributes, keyboard navigation, focus handling, animations, and responsive feedback.
Why use it?
It provides a structured way to improve a component while keeping it compatible with existing code and design rules. It also highlights keyboard use, screen readers, and focus behavior.

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/oakensoul/nextjs-cursor-prompts/component-update-ui
Clone the repo
git clone --depth 1 https://github.com/oakensoul/nextjs-cursor-prompts

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 component-update-ui

README.md
[![agentmods](https://agentmods.dev/badge/rules/oakensoul/nextjs-cursor-prompts/component-update-ui.svg)](https://agentmods.dev/rules/oakensoul/nextjs-cursor-prompts/component-update-ui)
Your own site
<a href="https://agentmods.dev/rules/oakensoul/nextjs-cursor-prompts/component-update-ui"><img src="https://agentmods.dev/badge/rules/oakensoul/nextjs-cursor-prompts/component-update-ui.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 5,119 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.05119
Opus 5 $0.00000 $0.02559
Sonnet 5 $0.00000 $0.01024
Haiku 4.5 $0.00000 $0.00512

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

Security

Grade A, and why

component-update-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 5d 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/prompts/component/component-update-ui.mdc · 766 lines

How it starts

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

UI Component Update Request

Please update and enhance an existing UI component following our design system improvement patterns and interaction standards:

🎯 UI COMPONENT UPDATE OBJECTIVES:

  1. ENHANCE variant system with improved design tokens, states, and interaction patterns
  2. IMPROVE accessibility with better ARIA attributes, keyboard navigation, and focus management
  3. OPTIMIZE interactions with smooth animations, micro-interactions, and responsive feedback
  4. UPGRADE design system integration with Catalyst compatibility and token consistency
  5. MAINTAIN backward compatibility while implementing meaningful design and functionality improvements

📋 UI COMPONENT UPDATE METHODOLOGY:

STEP 1: Current Component Assessment

Analyze Existing Implementation:
  • Current variant system: Review existing size, color, and state variants
  • Design system integration: Check Catalyst compatibility and token usage
  • Accessibility audit: Test ARIA attributes, keyboard navigation, and screen reader support
  • Interaction patterns: Evaluate hover, focus, active, and loading states
  • Performance analysis: Review rendering optimization and bundle impact
Identify Enhancement Opportunities:
// Assessment checklist for UI component improvements
interface UIComponentAudit {
  designSystem: {
    catalystIntegration: boolean;
    designTokens: boolean;
    variantConsistency: boolean;
    responsiveDesign: boolean;
  };
  accessibility: {
    ariaAttributes: boolean;
    keyboardNavigation: boolean;
    focusManagement: boolean;
    colorContrast: boolean;
  };
  interactions: {
    hoverStates: boolean;
    focusStates: boolean;
    loadingStates: boolean;
    animations: boolean;
  };
  performance: {
    memoOptimization: boolean;
    bundleSize: boolean;
    renderingSpeed: boolean;
    memoryUsage: boolean;
  };
}

STEP 2: Variant System Enhancement

Advanced Variant Improvements:
// Enhanced variant system with comprehensive options
interface EnhancedUIVariants {
  /** Visual style variant */
  variant: 'primary' | 'secondary' | 'outline' | 'ghost' | 'link' | 'destructive';
  /** Size configuration */
  size: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
  /** Color scheme */
  color?: 'blue' | 'green' | 'red' | 'orange' | 'purple' | 'gray';
  /** Corner radius */
  radius?: 'none' | 'sm' | 'md' | 'lg' | 'full';
  /** Shadow depth */
  shadow?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
  /** State variants */
  state?: 'default' | 'hover' | 'focus' | 'active' | 'disabled' | 'loading';
}

// Enhanced variant implementation with class-variance-authority
const enhancedUIVariants = cva(
  [
    // Base styles with design tokens
    "inline-flex items-center justify-center",
    "font-medium transition-all duration-200 ease-in-out",
    "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
    "disabled:pointer-events-none disabled:opacity-50"
  ],
  {
    variants: {
      variant: {
        primary: [
          "bg-primary text-primary-foreground",
          "hover:bg-primary/90",
          "focus-visible:ring-primary"
        ],
        secondary: [
          "bg-secondary text-secondary-foreground",
          "hover:bg-secondary/80",
          "focus-visible:ring-secondary"
        ],
        outline: [
          "border border-input bg-background",
          "hover:bg-accent hover:text-accent-foreground",
          "focus-visible:ring-ring"
        ],
        ghost: [
          "hover:bg-accent hover:text-accent-foreground",
          "focus-visible:ring-ring"
        ],
        link: [
          "text-primary underline-offset-4",
          "hover:underline",
          "focus-visible:ring-ring"
        ],
        destructive: [
          "bg-destructive text-destructive-foreground",
          "hover:bg-destructive/90",
          "focus-visible:ring-destructive"
        ]
      },
      size: {
        xs: "h-7 px-2 text-xs",
        sm: "h-8 px-3 text-sm",
        md: "h-9 px-4 text-sm",
        lg: "h-10 px-6 text-base",
        xl: "h-11 px-8 text-base"
      },
      radius: {
        none: "rounded-none",
        sm: "rounded-sm",
        md: "rounded-md",
        lg: "rounded-lg",
        full: "rounded-full"
      },
      shadow: {
        none: "shadow-none",
        sm: "shadow-sm",
        md: "shadow-md",
        lg: "shadow-lg",
        xl: "shadow-xl"
      }
    },
    defaultVariants: {
      variant: "primary",
      size: "md",
      radius: "md",
      shadow: "none"
    }
  }
);

Read the full file on GitHub · 766 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. 5d ago First seen · 766 lines · 0 tokens per session scan A 89cce9f2d071

Subscribe to this mod's changes

component-update-ui is a cursor rule published in the GitHub repository oakensoul/nextjs-cursor-prompts (4 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 5,119 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-31.