본문으로 건너뛰기
cccskills
무료GitHub에 공개

add-icon-mapping

Connect provider, model, or agent IDs to existing icons in lobe-icons. Use it to add or adjust keyword mappings when an item shows the default fallback icon, including keeping the main and React Native configurations aligned.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Add or modify icon keyword mappings for providers, models, or agents in lobe-icons. Use this whenever a task involves mapping a provider/model id to an icon, adding a new entry to ModelProvider enum or providerMappings/modelMappings/agentMappings, or fixing a provider/model that renders the fallback (default) icon in LobeHub. Trigger even if the request only says "add icon for X provider" or references a Linear issue about icon keyword mapping — the actual icon component usually already exists; only the mapping is missing.

lobehub/lobe-icons스타 2,646(GitHub 2,646 + cccskills 0)
연동 도구LinearOpenAI

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Map a new provider ID to its existing brand icon
  • Fix a model that displays the fallback icon
  • Add model or agent keyword matching rules
  • Keep provider mappings aligned in React Native

포함된 파일(1)

  • SKILL.md5.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Add icon keyword mapping

lobe-icons ships icon components (e.g. src/Grok/) and, separately, mapping tables that resolve a provider/model/agent id string to one of those components. A provider showing the fallback icon in LobeHub almost always means the mapping entry is missing, not the icon itself. Always check src/<Name>/ first — if the brand icon already exists, the task is only wiring it up.

Where mappings live (edit ALL that apply)

The react-native package duplicates the main package's config files. Forgetting the RN package is the most common mistake — the main package edits compile and pass review on their own.

WhatMain packagereact-native package
Provider enumsrc/features/providerEnum.tspackages/react-native/src/features/providerEnum.ts
Provider mappingssrc/features/providerConfig.tsxpackages/react-native/src/features/providerConfig.tsx
Model mappingssrc/features/modelConfig.tspackages/react-native/src/features/modelConfig.ts
Agent mappingssrc/features/agentConfig.ts— (main package only)

The static-* workspace packages (static-svg, static-png, static-webp, static-avatar) are generated from icon components and contain no mapping logic — never edit them for a mapping change.

Matching semantics (they differ!)

  • ProviderIcon: exact match — keyword.toLowerCase() === provider. A keyword like xai will NOT match supergrok; every provider id needs its own keyword.
  • ModelIcon / AgentIcon: each keyword is a case-insensitive RegExp tested against the model id, and the first matching entry in the array wins. Consequences:
    • Substrings match: keyword gpt-4 matches chatgpt-4o-latest.
    • Order matters: put more specific entries before general ones (see how gpt-oss sits before the broad OpenAI entry).
    • Regex syntax is live: ^o1, /o1, o1- are anchored patterns, and characters like . or + in a keyword are regex metacharacters — escape or anchor deliberately.

Provider mapping workflow

  1. Enum — add to ModelProvider in providerEnum.ts, alphabetically sorted, value lowercase:
    SuperGrok = 'supergrok',
    
  2. Import — in providerConfig.tsx, import the icon (alphabetical order). Main package uses the @/ alias, RN uses relative paths:
    import Grok from '@/Grok';          // main package
    import Grok from '../icons/Grok';   // react-native package
    
  3. Mapping entry — add to providerMappings, near related entries:
    { Icon: Grok, keywords: [ModelProvider.SuperGrok] },
    
  4. Repeat 1–3 in the react-native package. The RN enum is RNModelProvider inside its own providerEnum.ts; entry shape is identical.

New entry vs appending a keyword

Two established patterns for derived/subscription providers:

  • Append to an existing entry when the new provider should look identical to its parent — precedent: keywords: [ModelProvider.Moonshot, ModelProvider.KimiCodingPlan], [ModelProvider.ZhiPu, ModelProvider.GLMCodingPlan].
  • New entry with a different brand icon when a more recognizable brand exists and visual distinction from the parent provider helps — precedent: supergrok → Grok icon instead of appending to the XAI entry.

Prefer whichever the issue/requester specifies; otherwise pick based on whether users would benefit from telling the two providers apart in a list.

Verification

bun run type-check                             # repo root
cd packages/react-native && bun run type-check # RN package has its own tsconfig

If dependencies aren't installed, the RN type-check reports pre-existing Cannot find module 'react-native' / 'react-native-svg' errors — those are environmental, not caused by your change. Only errors mentioning your new enum member or the config files matter; don't install dependencies just to silence them (pnpm install creates lockfile noise, see below).

Type-check catches typos but not a missed mapping — grep is the completeness check:

grep -rn "supergrok" src packages/react-native/src

Expect hits in both enum files and both config files (2×2). For a model/agent keyword, quickly sanity-check the regex in isolation: new RegExp(keyword, 'i').test(modelId).

There are no committed tests and the repo's vitest.config.ts alias ('@': './src', relative) does not resolve transitive @/ imports — a render test needs a throwaway config with an absolute-path alias and server.deps.inline: [/@lobehub/]. Usually type-check + grep is sufficient.

Commit pitfalls

  • .npmrc sets lockfile=false — the repo commits no lockfile. Running pnpm install generates pnpm-lock.yaml and may inject a placeholder allowBuilds: block into pnpm-workspace.yaml. Delete the lockfile and git checkout -- pnpm-workspace.yaml before committing.
  • The pre-commit hook runs lint-staged and can sweep unintended files into the commit. After committing, check git show --stat HEAD — a mapping change should touch only the 2–4 config files.
  • Commit style is gitmoji + conventional: ✨ feat: add Grok icon mapping for supergrok provider.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Build a product or documentation landing page by arranging @lobehub/ui/awesome components for the hero, live examples, feature sections, and install call to action. Wire links and theming, then review the page for responsive layout and accessibility preferences.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Create a product landing page from existing components
  • Build a home page for a lobedocs documentation site
  • Add live component examples and feature sections
lobehub/lobe-icons2.6천2026년 10월 26일 업데이트

Set up and write a static documentation site with @lobehub/docs-kit and its lobedocs CLI. Create component pages with live demos and API tables, guides, a home page, and changelog, while following the kit’s build validations.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Set up a docs site with lobedocs
  • Write component pages with demos and API tables
  • Migrate existing documentation from dumi
lobehub/lobe-icons2.6천2026년 10월 26일 업데이트

lobehub의 스킬 모두 보기

이 스킬의 문제 신고