generating-components

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Generating Components

生成组件

Agent Workflow (MANDATORY)

Agent工作流(强制执行)

Before ANY component generation, use
TeamCreate
to spawn 3 agents:
  1. fuse-ai-pilot:explore-codebase - Analyze existing UI patterns, colors, typography
  2. fuse-ai-pilot:research-expert - Verify latest component patterns via Context7
  3. mcp__magic__21st_magic_component_inspiration - Search 21st.dev for inspiration
After implementation, run fuse-ai-pilot:sniper for validation.

任何组件生成操作之前,使用
TeamCreate
生成3个Agent:
  1. fuse-ai-pilot:explore-codebase - 分析现有UI模式、配色、排版
  2. fuse-ai-pilot:research-expert - 通过Context7验证最新组件模式
  3. mcp__magic__21st_magic_component_inspiration - 在21st.dev搜索灵感
实现完成后,运行fuse-ai-pilot:sniper进行验证。

Overview

概述

FeatureDescription
Gemini Design MCPAI-powered frontend generation (create, modify, snippet)
21st.devComponent inspiration and builder
shadcn/uiCopy-paste component library
Anti-AI-SlopMandatory rules against generic designs

功能说明
Gemini Design MCPAI驱动的前端生成(创建、修改、代码片段)
21st.dev组件灵感与构建工具
shadcn/ui可直接复制粘贴的组件库
Anti-AI-Slop针对通用设计的强制规范

Critical Rules

核心规则

  1. ALWAYS use Gemini Design - Never write UI code manually
  2. Search inspiration first - 21st.dev before coding
  3. Match existing tokens - Analyze codebase before generating
  4. No forbidden fonts - Inter, Roboto, Arial are BANNED
  5. Framer Motion required - Every component needs animations

  1. 必须使用Gemini Design - 禁止手动编写UI代码
  2. 先搜索灵感 - 编码前先参考21st.dev
  3. 匹配现有设计令牌 - 生成前先分析代码库
  4. 禁用指定字体 - Inter、Roboto、Arial均被禁止使用
  5. 必须使用Framer Motion - 所有组件都需要添加动画

Architecture

架构

components/
├── ui/
│   ├── Button.tsx        (~40 lines)
│   ├── Card.tsx          (~50 lines)
│   └── HeroSection.tsx   (~80 lines)
└── sections/
    ├── HeroBackground.tsx (~30 lines)
    └── FeatureGrid.tsx    (~60 lines)
→ See hero-section.md for complete example

components/
├── ui/
│   ├── Button.tsx        (~40 lines)
│   ├── Card.tsx          (~50 lines)
│   └── HeroSection.tsx   (~80 lines)
└── sections/
    ├── HeroBackground.tsx (~30 lines)
    └── FeatureGrid.tsx    (~60 lines)
→ 完整示例请查看hero-section.md

Reference Guide

参考指南

Concepts

概念

TopicReferenceWhen to Consult
Gemini Workflowgemini-design-workflow.mdMANDATORY - Read first
21st.dev21st-dev.mdComponent inspiration
shadcn/uishadcn.mdComponent library
Buttonsbuttons-guide.mdButton states, sizing
Formsforms-guide.mdValidation, layout
Cardscards-guide.mdCard patterns
Iconsicons-guide.mdIcon usage
UI Designui-visual-design.md2026 trends, animations
Gridsgrids-layout.mdLayout system
Patternsdesign-patterns.mdCommon patterns
主题参考文档适用场景
Gemini工作流gemini-design-workflow.md强制执行 - 请先阅读
21st.dev21st-dev.md组件灵感获取
shadcn/uishadcn.md组件库使用
按钮buttons-guide.md按钮状态、尺寸设置
表单forms-guide.md表单验证、布局
卡片cards-guide.md卡片设计模式
图标icons-guide.md图标使用规范
UI设计ui-visual-design.md2026设计趋势、动画
栅格系统grids-layout.md布局系统使用
设计模式design-patterns.md通用设计模式参考

Templates

模板

TemplateWhen to Use
hero-section.mdLanding page hero
hero-glassmorphism.mdGlassmorphism hero
feature-grid.mdFeatures showcase
pricing-card.mdPricing tiers
contact-form.mdContact forms
testimonial-card.mdReviews/testimonials
stats-section.mdStats with counters
faq-accordion.mdFAQ sections

模板适用场景
hero-section.md落地页Hero区块
hero-glassmorphism.md毛玻璃效果Hero区块
feature-grid.md功能展示栅格
pricing-card.md定价套餐卡片
contact-form.md联系表单
testimonial-card.md用户评价/推荐卡片
stats-section.md带计数器的数据统计区块
faq-accordion.mdFAQ折叠面板

Quick Reference

快速参考

Gemini Design Tools

Gemini Design工具

typescript
// Create full view from scratch
mcp__gemini-design__create_frontend({
  prompt: "Hero section with glassmorphism",
  designSystem: "contents of design-system.md"
})

// Modify existing component
mcp__gemini-design__modify_frontend({
  existingCode: "<Button>...",
  prompt: "Add hover animation"
})

// Generate snippet
mcp__gemini-design__snippet_frontend({
  prompt: "Loading spinner"
})
→ See gemini-design-workflow.md for complete workflow
typescript
// 从零开始创建完整视图
mcp__gemini-design__create_frontend({
  prompt: "Hero section with glassmorphism",
  designSystem: "contents of design-system.md"
})

// 修改现有组件
mcp__gemini-design__modify_frontend({
  existingCode: "<Button>...",
  prompt: "Add hover animation"
})

// 生成代码片段
mcp__gemini-design__snippet_frontend({
  prompt: "Loading spinner"
})
→ 完整工作流请查看gemini-design-workflow.md

Anti-AI-Slop Table

反AI通用设计对照表

FORBIDDENUSE INSTEAD
Inter, Roboto, ArialClash Display, Satoshi, Syne
Purple/pink gradientsCSS variables, sharp accents
Border-left indicatorsIcon + bg-*/10 rounded
Flat backgroundsGlassmorphism, gradient orbs
No animationsFramer Motion stagger
→ See ui-visual-design.md for 2026 trends

禁用项替代方案
Inter, Roboto, ArialClash Display, Satoshi, Syne
紫/粉色渐变CSS变量、鲜明强调色
左侧边框指示器图标 + bg-*/10 圆角样式
纯色背景毛玻璃效果、渐变球体
无动画Framer Motion stagger动画
→ 2026设计趋势请查看ui-visual-design.md

Best Practices

最佳实践

DO

建议做法

  • Read gemini-design-workflow.md FIRST
  • Search 21st.dev for inspiration before coding
  • Match existing design tokens exactly
  • Use Framer Motion for all animations
  • Split components into <100 line files
  • 先阅读gemini-design-workflow.md
  • 编码前先在21st.dev搜索灵感
  • 完全匹配现有设计令牌
  • 所有动画均使用Framer Motion
  • 将组件拆分为少于100行的文件

DON'T

禁止做法

  • Write UI code manually (use Gemini Design)
  • Use forbidden fonts (Inter, Roboto, Arial)
  • Skip inspiration search phase
  • Forget hover/focus states
  • Create components without animations

  • 手动编写UI代码(必须使用Gemini Design)
  • 使用禁用字体(Inter、Roboto、Arial)
  • 跳过灵感搜索阶段
  • 忽略 hover/focus 状态
  • 创建无动画的组件

Framework Delegation (AFTER Gemini)

框架委托(Gemini生成后)

After generating UI, ALWAYS delegate to framework expert for SOLID validation.
生成UI后,必须委托给框架专家进行SOLID验证。

Detection → Expert

检测 → 专家分配

Project FilesDelegate To
next.config.*
fuse-nextjs:nextjs-expert
package.json
+ React
fuse-react:react-expert
composer.json
fuse-laravel:laravel-expert
项目文件委托对象
next.config.*
fuse-nextjs:nextjs-expert
package.json
+ React
fuse-react:react-expert
composer.json
fuse-laravel:laravel-expert

Why Delegate?

为什么需要委托?

design-expert handles:
  • ✅ Beautiful UI (Anti-AI-Slop)
  • ✅ Animations (Framer Motion)
  • ✅ Accessibility (WCAG 2.2)
Framework expert handles:
  • ✅ SOLID compliance (files < 100 lines)
  • ✅ Framework patterns (App Router, Server Components)
  • ✅ Integration (Better Auth, Prisma, TanStack)
设计专家负责:
  • ✅ 美观的UI(符合反AI通用设计规范)
  • ✅ 动画效果(Framer Motion)
  • ✅ 可访问性(WCAG 2.2标准)
框架专家负责:
  • ✅ SOLID合规性(文件少于100行)
  • ✅ 框架模式适配(App Router、Server Components)
  • ✅ 集成验证(Better Auth、Prisma、TanStack)

Delegation Workflow

委托工作流

1. Generate component with Gemini Design
2. Detect framework from project files
3. Launch Task with framework expert
4. Expert validates SOLID + patterns
5. sniper runs final validation
1. 使用Gemini Design生成组件
2. 从项目文件检测框架类型
3. 向框架专家发起任务
4. 专家验证SOLID合规性与模式适配
5. sniper执行最终验证