Skill站外收录 @skilllib/skill-2014279399745466369
ui-style-format
定义项目 UI 设计规范的标准化格式,支持文本化样式配置与可视化参考图协同使用,涵盖色彩、字体、间距、组件模式等核心设计要素,并通过结构化文件组织实现设计系统与自动化审查流程的深度集成。
软件开发 AI 技能
Skills.MD
# UI Style Format Specification
## Overview
The UI Style system provides a standardized way to define project design preferences
that the `ui` agent uses during design reviews. It supports both text-based style
definitions and visual reference images.
## File Structure
```
{project}/
.claude/
design-style.md # Main style configuration
design-references/ # Visual reference images
{image}.png # PNG or JPG screenshots
MANIFEST.md # Optional metadata
```
## design-style.md Schema
### Required Sections
| Section | Purpose |
|---------|---------|
| Header | Version, dates, base reference |
| Reference Images | Links to visual references (v2.0+) |
| Brand Colors | Color palette with light/dark modes |
| Typography | Fonts and type scale |
| Spacing | Base unit and scale |
| Component Patterns | Button, input, card styles |
| Design Rules | DO and DON'T guidelines |
### Optional Sections
| Section | Purpose |
|---------|---------|
| Reference URLs | External style guides |
| Style History | Change log |
| MANIFEST.md | Detailed image descriptions |
## Reference Images Integration
### Storage Location
All reference images MUST be stored in `.claude/design-references/`.
### Supported Formats
| Format | Extension | Recommended Use |
|--------|-----------|-----------------|
| PNG | .png | Screenshots, UI components |
| JPEG | .jpg, .jpeg | Photos, complex imagery |
| WebP | .webp | Modern alternative to PNG/JPEG |
### Image Table Format
In the style file, reference images are listed in a table:
```markdown
## Reference Images
| Image | Description | Captured | Mode |
|-------|-------------|----------|------|
| hero-section.png | Homepage hero | 2026-01-08 | light |
```
### Usage Guidelines Section
Each image should have usage notes:
```markdown
### Usage Guidelines
- **hero-section.png**: Reference for hero layout, gradient, CTA placement
```
## Parsing the Style File
### Section Extraction
1. Read `.claude/design-style.md` with Read tool
2. Split by `## ` headers
3. Parse tables using Markdown table regex
4. Extract key-value pairs from tables
### Reference Image Resolution
```
Image Name -> .claude/design-references/{image_name}
```
Example:
```
hero-section.png -> .claude/design-references/hero-section.png
```
### Validation Checklist
Before using a style file, validate:
1. File exists at `.claude/design-style.md`
2. Required sections present
3. Referenced images exist in `.claude/design-references/`
4. Colors are valid hex codes
5. Spacing values are numbers
## Integration with ui Agent
### Style-Aware Review Flow
When the ui agent performs a review:
1. **Load Style**: Read `.claude/design-style.md`
2. **Load References**: List `.claude/design-references/`
3. **Match Components**: Find relevant reference images for review target
4. **Comparative Analysis**: Pass reference image + target to Gemini
5. **Validate Tokens**: Check colors, typography, spacing against style
### Gemini Prompt with References
```
Compare this implementation screenshot against the project design reference.
**Reference Image**: .claude/design-references/hero-section.png
**Implementation**: screenshots/current-hero.png
**Style Tokens** (from .claude/design-style.md):
- Primary Color: #2563EB
- Font: Inter 16px
- Spacing: 4px base
**Validate**:
1. Layout matches reference
2. Colors match defined palette
3. Typography follows scale
4. Spacing uses defined tokens
```
## Version Compatibility
| Version | Features |
|---------|----------|
| 1.x | Text-only style (legacy) |
| 2.x | Reference images + text style |
Version 2.x is backward compatible - the ui agent handles missing
`## Reference Images` section gracefully.
## Best Practices
### Capturing Reference Images
1. **Consistent viewport**: Use same browser width (e.g., 1440px)
2. **Clean state**: No modals, tooltips unless intentional
3. **Both modes**: Capture light and dark variants
4. **Component isolation**: Crop to relevant area
### Writing Usage Guidelines
Be specific about what each image demonstrates:
**Good**: "Reference for button padding (12px), border-radius (8px), and hover state"
**Bad**: "Button reference"
### Updating Styles
When UI changes:
1. Capture new screenshot
2. Replace old image (same name) or add new
3. Update Reference Images table
4. Add entry to Style History
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「ui-style-format」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次