用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mingdw/sapmall --skill icon-migration-pattern命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | icon-migration-pattern |
| description | Migrate Font Awesome and Ant Design Icons to Lucide React across all frontend apps. |
| Old | New |
|---|---|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | import { IconName } from 'lucide-react' |
import { AntDesignIcon } from '@ant-design/icons' | import { IconName } from 'lucide-react' |
<FontAwesomeIcon icon="fas fa-xxx" /> | <IconName size={16} /> |
Twitter, Telegram, Discord, Github → Use semantic substitutes:
ExternalLink or SendSendMessageCircleCode2For data files mapping codes to icons:
// Before (string-based)
const categoryIcons: Record<string, string> = {
electronics: 'fas fa-laptop',
clothing: 'fas fa-tshirt',
};
// After (LucideIcon component)
import { LucideIcon, Laptop, Shirt } from 'lucide-react';
const categoryIcons: Record<string, LucideIcon> = {
electronics: Laptop,
clothing: Shirt,
};
For backend strings still in "fas fa-xxx" format:
const FA_TO_LUCIDE: Record<string, LucideIcon> = {
'fa-laptop': Laptop,
'fa-tshirt': Shirt,
'fa-home': Home,
};
function resolveApiIcon(faClass: string): LucideIcon | undefined {
const iconName = faClass.replace('fas ', '').replace('far ', '');
return FA_TO_LUCIDE[iconName];
}
// ✅ Correct
const Icon = theme.icon;
return <Icon size={16} />;
// ❌ Incorrect (invalid JSX)
return <theme.icon size={16} />;
// Ant Design accepts ReactNode
<Button icon={<LucideIcon size={16} />}>Label</Button>
<Heart size={16} fill={isActive ? 'currentColor' : 'none'} />
// Before
<DownOutlined rotate={isActive ? 180 : 0} />
// After
<ChevronDown
size={16}
style={{
transform: isActive ? 'rotate(180deg)' : 'rotate(0deg)',
transition: 'transform 0.2s',
}}
/>
LucideIcon typeFA_TO_LUCIDE resolver if backend sends FA strings