Skip to content
logo-management logo

Logo Management Skill

logo-management

Manage car logo fetching, scraping, and Vercel Blob storage in the logos package. Use when adding new car brand logos, updating logo sources, debugging brand name normalization, managing Vercel Blob storage, or optimizing logo caching.

SKILL.md

Full skill instructions

Logo Management Skill

Logo package lives in packages/​logos/.

packages/​logos/
├── src/
│   ├── services/​logo/     # fetch.ts, list.ts, download.ts
│   ├── infra/​storage/     # Vercel Blob service
│   └── utils/​normalize.ts # Brand name normalization
└── scripts/               # fetch-logos.ts, upload-to-blob.ts

Brand Name Normalization

// packages/​logos/​src/​utils/​normalize.ts
export function normalizeBrandName(brand: string): string {
  return brand.toLowerCase().trim()
    .replace(/\s+/​g, "-")        // Spaces → hyphens
    .replace(/[^a-z0-9-]/​g, "")  // Remove special chars
    .replace(/​-+/​g, "-");        // Dedupe hyphens
}

// Brand aliases for common variations
const BRAND_ALIASES: Record<string, string> = {
  "mercedes": "mercedes-benz",
  "vw": "volkswagen",
  "landrover": "land-rover",
};

Logo Fetching

// packages/​logos/​src/​services/​logo/​fetch.ts
export async function getLogoUrl(brand: string): Promise<string | null> {
  const normalizedBrand = normalizeBrandName(brand);
  const cacheKey = `logo:url:${normalizedBrand}`;

  // Check Redis cache
  const cached = await redis.get<string>(cacheKey);
  if (cached) return cached;

  // Try different extensions
  for (const ext of ["svg", "png", "jpg"]) {
    const url = `${LOGO_CDN_BASE}/​${normalizedBrand}.${ext}`;
    const response = await fetch(url, { method: "HEAD" });
    if (response.ok) {
      await redis.set(cacheKey, url, { ex: 7 * 24 * 60 * 60 });
      return url;
    }
  }
  return null;
}

Vercel Blob Storage

// packages/​logos/​src/​infra/​storage/​blob.ts
import { put, list, del } from "@vercel/​blob";

export class LogoBlobService {
  async upload(brand: string, file: Buffer): Promise<string> {
    const fileName = `logos/​${normalizeBrandName(brand)}.png`;
    const blob = await put(fileName, file, { access: "public", addRandomSuffix: false });
    await redis.set(`logo:blob:${normalizeBrandName(brand)}`, blob.url, { ex: 7 * 24 * 60 * 60 });
    return blob.url;
  }

  async list(): Promise<string[]> {
    const { blobs } = await list({ prefix: "logos" });
    return blobs.map(blob => blob.url);
  }

  async delete(brand: string): Promise<void> {
    await del(`logos/​${normalizeBrandName(brand)}.png`);
    await redis.del(`logo:blob:${normalizeBrandName(brand)}`);
  }
}

Scripts

# Fetch logos from CDN
pnpm -F @sgcarstrends/​logos fetch-logos

# Scrape logos from websites
pnpm -F @sgcarstrends/​logos scrape-logos

Usage in Apps

// API route
import { getLogoUrl } from "@sgcarstrends/​logos";

app.get("/​logos/:brand", async (c) => {
  const logoUrl = await getLogoUrl(c.req.param("brand"));
  if (!logoUrl) return c.json({ error: "Logo not found" }, 404);
  return c.json({ logoUrl });
});

// React component
<Image src={logoUrl || "/​images/​logo-placeholder.png"} alt={`${brand} logo`} width={64} height={64} />

Environment Variables

BLOB_READ_WRITE_TOKEN=vercel_blob_token_here

Best Practices

  1. Normalize Names: Always normalize brand names before lookup
  2. Cache Aggressively: Use multi-layer caching (memory → Redis → Blob)
  3. Fallbacks: Provide placeholder for missing logos
  4. Batch Operations: Use batch uploads for multiple logos

References

  • Vercel Blob: Use Context7 for latest docs
  • packages/​logos/​CLAUDE.md for package details

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View