component-create-icon

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

A set of project rules for creating icon components, including SVG handling, accessibility, design-system use, and performance practices.

In plain words
What is it for?
Use it when adding a new system, brand, or content icon to a React or Next.js project. It guides component location, SVG optimization, API design, and integration with the existing icon system.
Why use it?
It gives icon work a consistent structure and helps avoid repeated decisions about sizing, screen readers, file size, and rendering.

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-create-icon
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-create-icon

README.md
[![agentmods](https://agentmods.dev/badge/rules/oakensoul/nextjs-cursor-prompts/component-create-icon.svg)](https://agentmods.dev/rules/oakensoul/nextjs-cursor-prompts/component-create-icon)
Your own site
<a href="https://agentmods.dev/rules/oakensoul/nextjs-cursor-prompts/component-create-icon"><img src="https://agentmods.dev/badge/rules/oakensoul/nextjs-cursor-prompts/component-create-icon.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,033 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.05033
Opus 5 $0.00000 $0.02516
Sonnet 5 $0.00000 $0.01007
Haiku 4.5 $0.00000 $0.00503

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

Security

Grade A, and why

component-create-icon 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-create-icon.mdc · 733 lines

How it starts

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

Icon Component Creation Request

Please create a new icon component following our specialized icon patterns, SVG optimization principles, and accessibility standards.

🎯 ICON CREATION OBJECTIVES:

  1. OPTIMIZE SVG performance with efficient rendering, minimal file sizes, and build-time optimization
  2. ENSURE accessibility compliance with proper ARIA attributes, semantic usage, and screen reader support
  3. INTEGRATE with design system for consistent sizing, styling, and theming across all icons
  4. PROVIDE flexible API with multiple icon sources, dynamic loading, and customization options
  5. FOLLOW performance standards for bundle optimization, tree shaking, and runtime efficiency

📋 ICON DEVELOPMENT METHODOLOGY:

STEP 1: Icon Planning and Architecture

Determine Icon Type and Location:
  • Client Component: src/components/client/icons/ - Interactive icons with state or animations
  • Server Component: src/components/server/icons/ - Static icons for SSR optimization
  • Icon Categories:
    • System Icons: UI elements, actions, states (system/)
    • Brand Icons: Logos, social media, company branding (brand/)
    • Content Icons: Illustrations, decorative elements (content/)
    • Custom Icons: Project-specific iconography (custom/)
Icon Source Strategy:
  • Icon Libraries: Heroicons, React Icons, Radix Icons, Lucide
  • Custom SVGs: Project-specific icons and illustrations
  • Icon Fonts: Legacy support and specific use cases
  • Dynamic Icons: Runtime-generated or API-sourced icons

STEP 2: SVG Optimization and Performance

SVG Optimization Pipeline:
// Optimized SVG icon component with build-time optimization
interface IconProps {
  /** Icon name or source */
  name?: string
  /** Custom SVG path or content */
  svg?: string
  /** Icon size (design system tokens) */
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number
  /** Icon color (theme-aware) */
  color?: 'current' | 'primary' | 'secondary' | 'muted' | string
  /** Accessibility label */
  label?: string
  /** Decorative icon (hidden from screen readers) */
  decorative?: boolean
  /** Animation type */
  animation?: 'none' | 'spin' | 'pulse' | 'bounce'
  /** Additional CSS classes */
  className?: string
  /** Click handler for interactive icons */
  onClick?: () => void
  /** Test identifier */
  'data-testid'?: string
}

const Icon = ({ 
  name,
  svg,
  size = 'md',
  color = 'current',
  label,
  decorative = false,
  animation = 'none',
  className,
  onClick,
  ...props 
}) => {
  const iconContent = useMemo(() => {
    if (svg) {
      return optimizeSVGContent(svg)
    }
    
    if (name) {
      return getIconFromLibrary(name)
    }
    
    return null
  }, [name, svg])

  const sizeValue = useMemo(() => {
    if (typeof size === 'number') return size
    return getSizeFromToken(size)
  }, [size])

  const colorValue = useMemo(() => {
    if (color === 'current') return 'currentColor'
    return getColorFromTheme(color)
  }, [color])

  if (!iconContent) {
    console.warn(`Icon not found: ${name}`)
    return null
  }

  return (
    <svg
      width={sizeValue}
      height={sizeValue}
      viewBox={iconContent.viewBox}
      fill={colorValue}
      aria-label={decorative ? undefined : label}
      aria-hidden={decorative}
      role={decorative ? 'presentation' : 'img'}
      className={cn(
        'icon',
        `icon-${size}`,
        `icon-${animation}`,
        onClick && 'icon-interactive',
        className
      )}
      onClick={onClick}
      {...props}
    >
      {iconContent.paths.map((path, index) => (
        <path 
          key={index} 
          d={path.d} 
          fillRule={path.fillRule}
          clipRule={path.clipRule}
        />
      ))}
    </svg>
  )
}

Read the full file on GitHub · 733 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 · 733 lines · 0 tokens per session scan A b3a84485c8dc

Subscribe to this mod's changes

component-create-icon 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,033 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.