agentleFS
crafter-stationcrafter-station/elements/.claude/skills/logo-with-variants/SKILL.md

logo-with-variants

Skill524 starsChanged 9 months agoMITView on GitHub

Create logo components with multiple variants (icon, wordmark, logo) and light/dark modes. Use when the user provides logo SVG files and wants to create a variant-based logo component following the Clerk pattern in the Elements project.

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 11 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use conditional rendering based on variant prop

    line 40
  2. Very specific:

    Default to variant="wordmark" (primary logo)

    line 42
  3. Distinctive:

    Add proper TypeScript types

    line 44
  4. Very specific:

    Reference implementation: Check src/components/ui/logos/clerk.tsx for the exact pattern to follow.

    line 46
  5. Distinctive:

    Read the SVG file content

    line 51
  6. Distinctive:

    Add title tag for accessibility

    line 55
  7. Very specific:

    If updating an existing logo: Search for the logo name in registry/index.ts and replace the entire entry with the new metadata including …

    line 141
  8. Distinctive:

    Add new logo to the list

    line 146
  9. Distinctive:

    Ensure it's in the correct category (tech-giants, ai-services, etc.)

    line 147
  10. Distinctive:

    All copy/download functions work for each variant

    line 211
  11. Distinctive:

    If brand guidelines are provided:

    line 216
  12. Distinctive:

    Use exact brand colors specified

    line 217
  13. Distinctive:

    Follow naming conventions (e.g., Linear uses "Linear" not "linear")

    line 218
  14. Very specific:

    Don't forget to copy component to both src/ and registry/ locations

    line 231
  15. Very specific:

    Ensure hasVariants: true is set in registry metadata

    line 232
  16. Distinctive:

    Don't hardcode colors - use COLORS object for theme support

    line 233
  17. Distinctive:

    Test all variant combinations before committing

    line 235

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Logo with Variants Creator

Creates logo components with variant support following the established pattern in Elements codebase.

When to use this Skill

  • User provides multiple SVG files for a logo (icon, wordmark, logo variants)
  • User mentions "variants", "light/dark modes", or references Clerk-style logos
  • User wants to add a new logo to the collection with multiple variants
  • User has SVG files in public/test/ or provides paths to logo files

Process

1. Analyze provided SVGs

  • Identify variant types (icon, logo, wordmark)
  • Detect light/dark mode versions (files ending in -dark.svg or -light.svg)
  • Extract viewBox, colors, and dimensions from each SVG
  • Note the brand guidelines if provided

2. Create component file

Location: src/components/ui/logos/{name}.tsx

Props interface:

{
  className?: string;
  variant?: "icon" | "logo" | "wordmark";
  mode?: "dark" | "light";
}

Structure:

  • Use conditional rendering based on variant prop
  • Configure colors for light/dark modes using a COLORS object pattern
  • Default to variant="wordmark" (primary logo)
  • Support theme-aware mode prop
  • Add proper TypeScript types

Reference implementation: Check src/components/ui/logos/clerk.tsx for the exact pattern to follow.

3. Convert SVG to JSX

For each SVG file:

  • Read the SVG file content
  • Convert SVG attributes to JSX (e.g., fill-rule → fillRule, stroke-width → strokeWidth)
  • Replace hardcoded colors with variables from COLORS object
  • Preserve viewBox and dimensions
  • Add title tag for accessibility

4. Create registry structure

Location: registry/default/blocks/logos/{name}-logo/

Files to create:

  1. registry-item.json:
{
  "name": "{name}-logo",
  "type": "registry:block",
  "title": "{DisplayName} Logo",
  "description": "{Brand description}",
  "categories": ["logos"],
  "meta": {
    "hasVariants": true,
    "variants": [
      "icon-dark",
      "icon-light",
      "logo-dark",
      "logo-light",
      "wordmark-dark",
      "wordmark-light"
    ],
    "variantTypes": {
      "base": ["icon", "logo", "wordmark"],
      "modes": ["dark", "light"]
    }
  },
  "files": [
    {
      "path": "components/logos/{name}.tsx",
      "type": "registry:component"
    }
  ],
  "docs": "{Brand} logo with 3 base variants (icon, logo, wordmark) and 2 modes (dark, light) = 6 total combinations. Theme-aware: automatically adapts colors when you switch themes."
}

CRITICAL: The variants array MUST list ALL combinations explicitly in {base}-{mode} format (e.g., "icon-dark", "logo-light"). This is what makes the variant count badge (e.g., "6") appear correctly in the UI. Do NOT just list base names like ["icon", "logo", "wordmark"].

  1. Copy component to: components/logos/{name}.tsx

5. Update registry/index.ts

CRITICAL STEP: The registry/index.ts file is the SOURCE OF TRUTH for the build process. You MUST add/update the logo entry in this file with the EXACT same metadata structure as the registry-item.json.

Location: registry/index.ts

Find the array of registry items and add your logo entry with the complete meta field:

{
  $schema: "https://ui.shadcn.com/schema/registry-item.json",
  name: "{name}-logo",
  type: "registry:block",
  title: "{DisplayName} Logo",
  description: "{Brand description}",
  registryDependencies: [],
  dependencies: [],
  categories: ["logos"],
  meta: {
    hasVariants: true,
    variants: [
      "icon-dark",
      "icon-light",
      "logo-dark",
      "logo-light",
      "wordmark-dark",
      "wordmark-light",
    ],
    variantTypes: {
      base: ["icon", "logo", "wordmark"],
      modes: ["dark", "light"],
    },
  },
  files: [
    {
      path: "registry/default/blocks/logos/{name}-logo/components/logos/{name}.tsx",
      type: "registry:component",
    },
  ],
  docs: "{Brand} logo with 3 base variants (icon, logo, wordmark) and 2 modes (dark, light) = 6 total combinations. Theme-aware: automatically adapts colors when you switch themes.",
}

If updating an existing logo: Search for the logo name in registry/index.ts and replace the entire entry with the new metadata including the meta field.

6. Update logos collection

Add to registry/default/blocks/logos/logos/registry-item.json:

  • Add new logo to the list
  • Ensure it's in the correct category (tech-giants, ai-services, etc.)

7. Build registry

Run:

bun run build:registry

This generates the public registry files.

Component Template Pattern

interface LogoProps {
  className?: string;
  variant?: "icon" | "logo" | "wordmark";
  mode?: "dark" | "light";
}

const COLORS = {
  dark: "#HEX_VALUE",
  light: "#HEX_VALUE",
};

export function BrandLogo({
  className,
  variant = "wordmark",
  mode = "dark",
}: LogoProps) {
  const color = COLORS[mode];

  if (variant === "icon") {
    return (
      <svg className={className} viewBox="...">
        {/* Icon SVG content */}
      </svg>
    );
  }

  if (variant === "logo") {
    return (
      <svg className={className} viewBox="...">
        {/* Logo SVG content */}
      </svg>
    );
  }

  // Default: wordmark
  return (
    <svg className={className} viewBox="...">
      {/* Wordmark SVG content */}
    </svg>
  );
}

Expected outcome

After completion:

  1. Component is available at @/components/ui/logos/{name}
  2. Logo appears in the logos page with variant badge
  3. Context menu shows "View X Variants" option
  4. Variants dialog displays all combinations (variants × modes)
  5. All copy/download functions work for each variant
  6. Can be installed via npx shadcn@latest add @elements/{name}-logo

Brand Guidelines Integration

If brand guidelines are provided:

  • Use exact brand colors specified
  • Follow naming conventions (e.g., Linear uses "Linear" not "linear")
  • Respect hierarchy (wordmark primary, logomark for tight layouts, icon for social)
  • Include usage notes in component comments

Files to reference

  • Template: src/components/ui/logos/clerk.tsx
  • Registry example: registry/default/blocks/logos/clerk-logo/
  • Variants dialog: src/app/docs/logos/logo-variants-dialog.tsx
  • Logos collection: registry/default/blocks/logos/logos/registry-item.json

Common pitfalls to avoid

  • Don't forget to copy component to both src/ and registry/ locations
  • Ensure hasVariants: true is set in registry metadata
  • Don't hardcode colors - use COLORS object for theme support
  • Remember to run build:registry after making changes
  • Test all variant combinations before committing

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.