prompt-engineering-ui
БесплатноБез исполняемых скриптовНе проверенPrompt patterns for consistent UI generation: stating design intent precisely, component specification formats, few-shot examples, and structured refinement…
от Ormus-Solutions★ 128 звёзд на GitHubОб этом скилле
Prompt Engineering for UI Generation
Master the art of communicating design intent to LLMs. This skill covers prompt patterns specifically optimized for generating consistent, high-quality user interfaces.
When to Use This Skill
- Writing prompts that generate consistent UI components
- Describing design intent precisely to AI systems
- Building reusable prompt templates for design systems
- Iterating on UI generation with structured feedback
- Creating few-shot examples for UI patterns
- Debugging inconsistent UI generation outputs
The UI Prompting Challenge
UI generation is uniquely challenging because it requires:
- Visual precision - Exact spacing, colors, typography
- Behavioral specification - Interactions, states, animations
- Contextual coherence - Fitting within a design system
- Accessibility compliance - WCAG, ARIA, keyboard navigation
- Responsive adaptation - Multiple breakpoints, devices
- Code quality - Clean, maintainable output
Standard prompting techniques often fail because UI is simultaneously visual, behavioral, and technical.
Core Prompt Patterns
Pattern 1: The Component Contract
Define components as contracts with explicit input/output specifications.
## Component Contract: DataTable
### Purpose
Display tabular data with sorting, filtering, and pagination.
### Props (Inputs)
| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| data | T[] | Yes | - | Array of data objects |
| columns | ColumnDef[] | Yes | - | Column configuration |
| pageSize | number | No | 10 | Rows per page |
| sortable | boolean | No | true | Enable column sorting |
| filterable | boolean | No | false | Show filter inputs |
### Visual Specification
- **Container**: bg-white rounded-lg shadow-sm border border-gray-200
- **Header row**: bg-gray-50 text-gray-600 text-sm font-medium
- **Data rows**: hover:bg-gray-50 border-b border-gray-100
- **Typography**: Font-sans, body text 14px, headers 12px uppercase
- **Spacing**: Cell padding 12px horizontal, 8px vertical
### States
1. **Loading**: Skeleton rows with pulse animation
2. **Empty**: Centered message with icon
3. **Error**: Red border, error message below
4. **Selected**: bg-blue-50, left border accent
### Accessibility Requirements
- role="table" on container
- Sortable columns announce sort direction
- Focus visible on all interactive elements
- Keyboard navigation: Tab through headers, Enter to sort
### Output Format
React TypeScript component using Tailwind CSS.
Include JSDoc comments and prop types.
Why This Works:
- Explicit contract eliminates ambiguity
- Visual specs use actual CSS values
- States prevent incomplete implementations
- Accessibility is non-negotiable requirement
Pattern 2: Design Token Injection
Embed design tokens directly in prompts for consistency.
Generate a Card component following these design tokens:
## Tokens
```json
{
"spacing": {
"xs": "4px",
"sm": "8px",
"md": "16px",
"lg": "24px",
"xl": "32px"
},
"colors": {
"surface": {
"primary": "#FFFFFF",
"secondary": "#F9FAFB",
"elevated": "#FFFFFF"
},
"border": {
"subtle": "#E5E7EB",
"default": "#D1D5DB"
},
"shadow": {
"sm": "0 1px 2px rgba(0,0,0,0.05)",
"md": "0 4px 6px rgba(0,0,0,0.1)"
}
},
"radius": {
"sm": "4px",
"md": "8px",
"lg": "12px"
}
}
Requirements
- Card uses
surface.elevatedbackground - Border uses
border.subtle - Padding uses
spacing.lg - Border radius uses
radius.lg - Shadow uses
shadow.md
Map these tokens to Tailwind classes where possible.
**Token Mapping Strategy**:
```typescript
// Prompt can include this mapping guide
const tokenToTailwind = {
"spacing.xs": "p-1",
"spacing.sm": "p-2",
"spacing.md": "p-4",
"spacing.lg": "p-6",
"spacing.xl": "p-8",
"colors.surface.primary": "bg-white",
"colors.surface.secondary": "bg-gray-50",
"colors.border.subtle": "border-gray-200",
"radius.lg": "rounded-xl",
"shadow.md": "shadow-md",
};
Pattern 3: Visual Reference Chain
Chain visual descriptions from abstract to concrete.
## Component: Hero Section
### Mood (Abstract)
Confident, minimal, focused. The user should feel capable and unintimidated.
### Aesthetic (Semi-Abstract)
- Clean sans-serif typography
- Generous whitespace (40% of viewport)
- Single accent color for CTAs
- Photography: abstract, not literal
### Visual Details (Concrete)
- **Layout**: Centered, max-width 1200px, py-24
- **Headline**: text-5xl font-bold tracking-tight text-gray-900
- **Subheadline**: text-xl text-gray-600 max-w-2xl mx-auto mt-6
- **CTA Group**: mt-10 flex gap-4 justify-center
- **Primary CTA**: bg-indigo-600 hover:bg-indigo-700 text-white px-8 py-4 rounded-lg
- **Secondary CTA**: border border-gray-300 text-gray-700 px-8 py-4 rounded-lg
### Content
Установить prompt-engineering-ui в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл prompt-engineering-ui?
Prompt patterns for consistent UI generation: stating design intent precisely, component specification formats, few-shot examples, and structured refinement loops. Use when UI output from an LLM is inconsistent or generic, or when building reusable prompt templates for a design system.
Как установить скилл prompt-engineering-ui?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл prompt-engineering-ui запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic