How this skill is triggered — by the user, by Claude, or both
Slash command
/yyh211-frontend-design:frontend-designThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
此技能指导创建独特的生产级前端界面,避免平庸的"AI 粗糙"美学。实现真正可用的代码,并高度关注美学细节和创意选择。
此技能指导创建独特的生产级前端界面,避免平庸的"AI 粗糙"美学。实现真正可用的代码,并高度关注美学细节和创意选择。
使用此技能当用户请求:
关键触发词: Web 组件、页面、应用、网站、着陆页、仪表盘、React 组件、HTML/CSS、UI 设计、美化、前端
在编写代码之前,必须进行深入的设计思考。每个界面都应该是独特的、有意图的、令人难忘的。
在实现任何代码之前,回答以下问题:
选择一个明确且大胆的美学方向。不要选择"现代简约"这样的通用描述,而是选择极致的风格:
风格选项(但不限于这些):
关键: 选择清晰的概念方向并精准执行。大胆的极致主义和精致的极简主义都有效——关键在于意图,而不是强度。
原则: 字体选择是设计的灵魂。
Do:
Don't:
推荐字体来源:
示例字体组合:
/* 极简编辑风格 */
--font-heading: 'Playfair Display', serif;
--font-body: 'Source Sans Pro', sans-serif;
/* 现代科技风格 */
--font-heading: 'Space Mono', monospace;
--font-body: 'DM Sans', sans-serif;
/* 优雅奢华风格 */
--font-heading: 'Cormorant Garamond', serif;
--font-body: 'Lato', sans-serif;
原则: 颜色定义情绪和品牌。
Do:
Don't:
示例主题:
:root {
/* 极简黑白 */
--color-primary: #000000;
--color-secondary: #ffffff;
--color-accent: #ff3366;
/* 复古未来 */
--color-primary: #1a1a2e;
--color-secondary: #16213e;
--color-accent: #00fff5;
--color-highlight: #ff006e;
/* 自然有机 */
--color-primary: #2d6a4f;
--color-secondary: #52b788;
--color-accent: #ffc857;
}
原则: 动画应该增强体验,而不是分散注意力。
Do:
animation-delay 实现元素逐个显示Don't:
prefers-reduced-motion 媒体查询示例动画:
/* 页面加载 - 元素逐个淡入 */
.fade-in-up {
animation: fadeInUp 0.6s ease-out forwards;
opacity: 0;
}
.fade-in-up:nth-child(1) { animation-delay: 0.1s; }
.fade-in-up:nth-child(2) { animation-delay: 0.2s; }
.fade-in-up:nth-child(3) { animation-delay: 0.3s; }
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* 悬停效果 */
.card {
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
transform: translateY(-8px);
box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
原则: 布局应该引导视线,创造视觉节奏。
Do:
Don't:
示例布局技巧:
/* 不对称网格 */
.grid-asymmetric {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 40px;
}
/* 重叠效果 */
.overlap-container {
position: relative;
}
.overlap-item {
position: absolute;
z-index: 2;
transform: translate(-20%, -20%);
}
/* 对角线流程 */
.diagonal-section {
transform: skewY(-3deg);
padding: 100px 0;
}
.diagonal-section > * {
transform: skewY(3deg);
}
原则: 背景营造氛围和深度。
Do:
Don't:
示例背景效果:
/* 渐变网格背景 */
.gradient-grid {
background:
linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px),
linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
linear-gradient(135deg, #667eea 0%, #764ba2 100%);
background-size: 50px 50px, 50px 50px, 100% 100%;
}
/* 噪点纹理 */
.noise-texture {
position: relative;
}
.noise-texture::before {
content: '';
position: absolute;
inset: 0;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
pointer-events: none;
}
/* 玻璃态效果 */
.glass-card {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
绝对禁止的元素:
如何避免:
关键原则: 代码复杂度应与设计愿景相匹配。
// 示例:复杂的动画卡片
<motion.div
initial={{ opacity: 0, scale: 0.8, rotateX: -15 }}
animate={{ opacity: 1, scale: 1, rotateX: 0 }}
whileHover={{
scale: 1.05,
rotateY: 5,
boxShadow: "0 25px 50px rgba(0,0,0,0.2)"
}}
transition={{
type: "spring",
stiffness: 300,
damping: 20
}}
>
{/* 复杂内容 */}
</motion.div>
/* 示例:精致的极简主义 */
.minimal-card {
padding: 60px;
background: #ffffff;
border: 1px solid rgba(0,0,0,0.08);
transition: border-color 0.3s ease;
}
.minimal-card:hover {
border-color: rgba(0,0,0,0.2);
}
.minimal-card h2 {
font-family: 'Cormorant Garamond', serif;
font-size: 2.5rem;
font-weight: 300;
letter-spacing: -0.02em;
line-height: 1.2;
margin: 0 0 20px 0;
}
用户请求: "帮我创建一个 SaaS 产品的着陆页"
设计思考:
实现重点:
用户请求: "创建一个数据分析仪表盘"
设计思考:
实现重点:
用户请求: "创建一套自定义按钮组件"
设计思考:
实现重点:
<header>, <nav>, <main>, <article>)!important.box1, .container2)在完成实现后,验证以下内容:
创造性诠释是关键。不要问用户"你想要什么颜色?",而是基于上下文做出大胆的设计决策。每个设计都应该是独一无二的。在不同项目之间变化浅色/深色主题、字体和美学风格。
追求卓越,而非完美。一个有强烈个性的设计胜过一个"安全"但平庸的设计。敢于尝试,为用户带来惊喜。
npx claudepluginhub aiskillstore/marketplace --plugin yyh211-frontend-designGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.