brand-dev
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBrand.dev Skill
Brand.dev 技能
Fetch brand data from the brand.dev API and save logos locally for serving.
从brand.dev API获取品牌数据并将Logo保存至本地以供使用。
Step 1: Get the Domain
步骤1:获取域名
Extract the target domain from the user's input. Strip protocol and trailing slashes (e.g., "https://example.com/" -> "example.com").
从用户输入中提取目标域名,去除协议和末尾斜杠(例如:"https://example.com/" -> "example.com")。
Step 2: Fetch Brand Info
步骤2:获取品牌信息
bash
BRANDDEV_API_KEY=$(grep BRANDDEV_API_KEY environment variables | cut -d= -f2)
curl -s "https://api.brand.dev/v1/brand/retrieve?domain=${DOMAIN}" \
-H "Authorization: Bearer ${BRANDDEV_API_KEY}" \
-H "Content-Type: application/json"Extract from the response:
- Brand name (or
.brand.title).brand.name - Description ()
.brand.description - Logo URLs (from ) — prefer icon/square logos for card layouts, full logos for headers
.brand.logos[] - Industry/category if available
bash
BRANDDEV_API_KEY=$(grep BRANDDEV_API_KEY environment variables | cut -d= -f2)
curl -s "https://api.brand.dev/v1/brand/retrieve?domain=${DOMAIN}" \
-H "Authorization: Bearer ${BRANDDEV_API_KEY}" \
-H "Content-Type: application/json"从响应结果中提取:
- 品牌名称(或
.brand.title).brand.name - 描述()
.brand.description - Logo链接(来自 )——卡片布局优先使用图标/方形Logo,头部区域优先使用完整Logo
.brand.logos[] - 所属行业/类别(如有提供)
Step 3: Download Logos Locally
步骤3:本地下载Logo
ALWAYS download logos locally for serving. Never reference external URLs in production code — they can change or go down.
media.brand.dev务必将Logo下载至本地以供使用。生产代码中绝不要直接引用外部链接——这些链接可能会变更或失效。
media.brand.devWhere to save
保存位置
The save location depends on the project. Look for existing patterns:
- Next.js / static sites: (served as
public/logos/<context>/)/logos/<context>/ - Other web projects: check for existing ,
static/,assets/, orimages/directoriespublic/ - If no convention exists: create a directory under the project's static asset root
logos/
保存位置取决于项目类型,请遵循现有项目规范:
- Next.js / 静态网站:(访问路径为
public/logos/<context>/)/logos/<context>/ - 其他Web项目:检查是否存在、
static/、assets/或images/目录public/ - 无现有规范时:在项目静态资源根目录下创建目录
logos/
Naming Convention
命名规范
- where:
<brand-slug>.<ext>- is the lowercase brand name, spaces replaced by hyphens (e.g.,
<brand-slug>notmiss-a)miss_a - matches the original file extension (png, webp, jpg, svg)
<ext>
- Optionally group by context subdirectory (e.g., ,
partners/) if the project has multiple logo collectionscustomers/
- ,其中:
<brand-slug>.<ext>- 为品牌名称的小写形式,空格替换为连字符(例如:
<brand-slug>而非miss-a)miss_a - 与原文件扩展名一致(png、webp、jpg、svg)
<ext>
- 如果项目包含多个Logo集合,可选择性地按上下文子目录分组(例如:、
partners/)customers/
Download Command
下载命令
bash
mkdir -p <logo-dir>
curl -sL "<logo-url>" -o "<logo-dir>/<brand-slug>.<ext>"bash
mkdir -p <logo-dir>
curl -sL "<logo-url>" -o "<logo-dir>/<brand-slug>.<ext>"Verify Download
验证下载结果
bash
ls -la <logo-dir>/<brand-slug>.<ext>bash
ls -la <logo-dir>/<brand-slug>.<ext>Step 4: Return Results
步骤4:返回结果
Provide the user with:
- Brand name
- Description
- Industry
- Local logo path — the path to use in code (relative to the project's static root)
- Original source URL (for reference only)
向用户提供以下信息:
- 品牌名称
- 描述
- 所属行业
- 本地Logo路径——代码中使用的路径(相对于项目静态资源根目录)
- 原始来源链接(仅作参考)
Important Rules
重要规则
- Always save images locally — never use URLs directly in production code.
media.brand.dev - Use local paths in code — reference relative to the project's static asset serving root.
- Prefer square/icon logos for card layouts (they fit better in grid cards).
- Prefer full/horizontal logos for headers and hero sections.
- If the brand has no logos in the API response, note this and suggest using a fallback icon.
- 务必将图片保存至本地——生产代码中绝不要直接使用链接。
media.brand.dev - 代码中使用本地路径——引用路径相对于项目静态资源服务根目录。
- 卡片布局优先使用方形/图标Logo(更适合网格卡片布局)。
- 头部和Hero区域优先使用完整/横向Logo。
- 如果API响应中未包含品牌Logo,需告知用户并建议使用备用图标。