xiaohongshu
xiaohongshu
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.
Full skill instructions
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
// 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",
};
// 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;
}
// 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)}`);
}
}
# Fetch logos from CDN
pnpm -F @sgcarstrends/logos fetch-logos
# Scrape logos from websites
pnpm -F @sgcarstrends/logos scrape-logos
// 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} />
BLOB_READ_WRITE_TOKEN=vercel_blob_token_here
packages/logos/CLAUDE.md for package detailsxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
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...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
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...
Display project status, active tracks, and next actions
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.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience