ui-design
3
总安装量
2
周安装量
#57131
全站排名
安装命令
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-ux-design --skill ui-design
Agent 安装分布
codex
2
claude-code
2
kilo
1
zencoder
1
cline
1
Skill 文档
UI Design Skill
Atomic Skill: Create visually compelling and systematic user interfaces
Purpose
This skill provides structured approaches to visual design, design systems, and component creation.
Skill Invocation
Skill("custom-plugin-ux-design:ui-design")
Parameter Schema
Input Parameters
interface UIDesignParams {
// Required
task: "visual" | "system" | "component" | "typography" | "color";
scope: string;
// Optional
brand?: {
colors?: string[];
fonts?: string[];
guidelines_url?: string;
};
platform?: "web" | "mobile" | "desktop" | "cross-platform";
constraints?: {
accessibility_level?: "AA" | "AAA";
dark_mode?: boolean;
};
}
Validation Rules
task:
type: enum
required: true
values: [visual, system, component, typography, color]
scope:
type: string
required: true
min_length: 5
platform:
type: enum
default: "web"
values: [web, mobile, desktop, cross-platform]
Execution Flow
UI DESIGN EXECUTION
ââââââââââââââââââââââââââââââââââââââââââââ
Step 1: ANALYZE REQUIREMENTS
âââ Parse brand guidelines
âââ Identify constraints
âââ Define design scope
Step 2: ESTABLISH FOUNDATIONS
âââ Define design tokens
âââ Set up grid system
âââ Create base styles
Step 3: CREATE COMPONENTS
âââ Design atomic elements
âââ Build component variants
âââ Document specifications
Step 4: COMPOSE LAYOUTS
âââ Apply visual hierarchy
âââ Ensure consistency
âââ Optimize for platform
Step 5: VALIDATE & HANDOFF
âââ Check accessibility
âââ Generate specifications
âââ Prepare assets
ââââââââââââââââââââââââââââââââââââââââââââ
Retry Logic
retry_config:
max_attempts: 3
backoff_type: exponential
initial_delay_ms: 1000
max_delay_ms: 10000
retryable_errors:
- ASSET_GENERATION_FAILED
- TOKEN_SYNC_ERROR
- EXPORT_INTERRUPTED
Logging Hooks
interface DesignLog {
timestamp: string;
event: "start" | "token_created" | "component_built" | "error" | "complete";
task: string;
tokens_defined: number;
components_created: number;
accessibility_score: number;
}
Learning Modules
Module 1: Visual Hierarchy
VISUAL HIERARCHY PRINCIPLES
âââ Size and scale
âââ Color and contrast
âââ Typography weight
âââ Spacing and proximity
âââ Alignment and grids
âââ Visual flow patterns
Module 2: Design Tokens
TOKEN ARCHITECTURE
âââ Primitive tokens (raw values)
â âââ Colors: #hex values
â âââ Spacing: px/rem values
â âââ Typography: font specs
âââ Semantic tokens (purpose)
â âââ color-text-primary
â âââ spacing-component-gap
â âââ font-heading-lg
âââ Component tokens (scoped)
âââ button-background
âââ card-padding
âââ input-border-color
Module 3: Component Design
COMPONENT ANATOMY
âââ Base state
âââ Hover state
âââ Active state
âââ Focus state
âââ Disabled state
âââ Loading state
âââ Error state
COMPONENT VARIANTS
âââ Size variants (sm, md, lg)
âââ Style variants (primary, secondary)
âââ Context variants (dark, light)
Module 4: Typography Systems
TYPE SCALE DESIGN
âââ Base size selection (16px)
âââ Scale ratio (1.25 major third)
âââ Heading hierarchy
âââ Body text styles
âââ Caption and labels
âââ Responsive adjustments
FONT PAIRING
âââ Primary font (headings)
âââ Secondary font (body)
âââ Monospace (code)
Module 5: Color Systems
COLOR ARCHITECTURE
âââ Brand colors
â âââ Primary
â âââ Secondary
â âââ Accent
âââ Neutral palette
â âââ Gray scale
â âââ Background/surface
âââ Semantic colors
â âââ Success (green)
â âââ Warning (yellow)
â âââ Error (red)
â âââ Info (blue)
âââ State colors
âââ Hover variations
âââ Active variations
âââ Disabled variations
Error Handling
| Error Code | Description | Recovery |
|---|---|---|
UI-001 |
Token undefined | Add to token system |
UI-002 |
Contrast failure | Suggest accessible colors |
UI-003 |
Component orphaned | Link to design system |
UI-004 |
Grid misalignment | Snap to grid |
UI-005 |
Asset export failed | Retry with fallback format |
Troubleshooting
Problem: Design inconsistency
Diagnosis:
âââ Check: Token usage
âââ Check: Component variants
âââ Check: Manual overrides
âââ Solution: Audit and standardize
Steps:
1. Extract all style values
2. Compare to token definitions
3. Replace hardcoded values
4. Update component library
Problem: Dark mode issues
Diagnosis:
âââ Check: Semantic color mapping
âââ Check: Contrast in dark mode
âââ Check: Image/icon adaptation
âââ Solution: Separate dark tokens
Steps:
1. Create dark mode token set
2. Map semantic colors
3. Test all components
4. Adjust problem areas
Unit Test Templates
describe("UIDesignSkill", () => {
describe("token generation", () => {
it("should create valid color tokens", async () => {
const result = await invoke({
task: "color",
scope: "primary palette"
});
expect(result.tokens.colors).toBeDefined();
expect(result.tokens.colors.primary).toMatch(/^#[0-9A-F]{6}$/i);
});
});
describe("accessibility compliance", () => {
it("should meet AA contrast requirements", async () => {
const result = await invoke({
task: "color",
constraints: { accessibility_level: "AA" }
});
expect(result.contrast_ratio).toBeGreaterThanOrEqual(4.5);
});
});
describe("component specification", () => {
it("should include all states", async () => {
const result = await invoke({
task: "component",
scope: "button"
});
const states = ["default", "hover", "active", "focus", "disabled"];
states.forEach(state => {
expect(result.component.states).toContain(state);
});
});
});
});
Quality Metrics
| Metric | Target | Measurement |
|---|---|---|
| Token coverage | > 95% | Styles using tokens |
| Accessibility | 100% | AA compliance |
| Component reuse | > 80% | Instances vs customs |
| Consistency score | > 95% | Design audit |
Version History
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2025-12-30 | Production-grade upgrade |