Agent Skills
› mocasus/unprompted
› unprompted-ui
unprompted-ui
GitHub提供Web界面视觉构图、空间节奏、排版校准及Core Web Vitals规范,指导UI组件设计与重构,强调遵循设计规范与克制的美学原则。
触发场景
设计或构建网页界面
对UI组件进行样式调整
重构前端页面布局
安装
npx skills add mocasus/unprompted --skill unprompted-ui -g -y
SKILL.md
Frontmatter
{
"name": "unprompted-ui",
"license": "MIT",
"version": "3.2.0",
"metadata": {
"author": "mocasus",
"category": "design",
"openclaw": {
"emoji": "📐",
"requiredBins": [
"node"
]
},
"repository": "https:\/\/github.com\/mocasus\/unprompted"
},
"description": "Visual composition, surface hierarchy, spatial rhythm, typography calibration, purposeful motion, and Core Web Vitals rules for web interfaces. Load alongside unprompted whenever designing, styling, or refactoring UI components or pages.",
"compatibility": [
"windows",
"macos",
"linux"
]
}
unprompted-ui — Interface Composition, Motion & Web Vitals
Extends core rules U-01–U-04, U-12–U-21, and U-29–U-34. Do not duplicate core checks; apply the structural engineering rules below whenever building visual interfaces.
1. Check Direction First (U-12)
- Look for
DESIGN.mdat the workspace root (or design tokens already committed in CSS/Tailwind config). - If present, obey its palette, font stack, border radii, and grid proportions strictly.
- If absent on a greenfield UI task, either invoke
unprompted-directionto establishDESIGN.mdwith the user, or strip all decorative invention, use a neutral architectural baseline, and mark the Delivery GateDRAFT (NO DESIGN.MD).
2. Spatial Composition & Anti-Template Choreography (U-04, U-13, U-29, U-31)
Replace Predictable Blocks
- Hero Sections: Never stack centered badge + centered gradient H1 + centered dual buttons. Choose a layout dictated by the product's primary proof:
- Asymmetric Split (
7fr / 5fror8fr / 4fr): Left-aligned statement paired with an interactive product state, live telemetry table, or cropped interface frame. - Editorial Masthead: Full-width typographic headline anchored to a crisp
1pxtop/bottom rule with structured metadata columns underneath. - Workspace-First: For tools, calculators, and utilities, open directly into the working instrument with zero marketing preamble.
- Asymmetric Split (
- Feature & Capability Sections:
- Replace 3 equal floating drop-shadow cards (
U-13) with a shared-hairline matrix (display: grid; gap: 1px; background: var(--border-hairline)), a sticky-left narrative + scrolling-right proof rail, or a numbered specification index (01,02,03).
- Replace 3 equal floating drop-shadow cards (
- Bento Discipline: Only use multi-span bento cells when each cell renders genuinely heterogeneous data density (e.g., a wide time-series chart beside a narrow latency counter)—never stuff uniform text blurbs into arbitrary
col-span-2boxes.
3. Surface, Border & Chromatic Restraint (U-01–U-03, U-14, U-15, U-30)
- 90 / 10 Chromatic Budget:
>= 90%of viewport area belongs to calibrated neutral surfaces and ink;<= 10%belongs to the primary brand/signal accent. - Tonal Separation Over Shadows: Establish depth primarily via subtle surface luminance shifts (
--bg-canvas->--bg-surface->--bg-subtle) and1pxhairlines (10%–14%foreground alpha) rather than heavy multi-layer drop shadows. - Semantic Status Colors: Keep destructive (red), warning (amber), and success (green) tokens reserved strictly for real system states—never spend them as random decorative icon backgrounds.
- SVG & Icon Restraint (
U-37): Most headings and feature descriptions need zero icons. Never hand-write decorative<svg>paths from memory, never use 4-point AI sparkle/rocket/lightning badges, and never repeatw-10 h-10 rounded-xl bg-accent/10icon boxes across a grid. Use established icon libraries (Phosphor,Radix,Lucide,Tabler) strictly for interactive affordances (16px–20px, uniform stroke width,currentColor). - Data-Viz Restraint (
U-38): Render charts, progress bars, and allocation breakdowns in neutral ink/surface steps plus at most one accent color—never assign a different neon hue to every row or ring. - Concentric Radii (
U-30): Outer container radius equals inner child radius plus container padding (R_outer = R_inner + P). Prefer crisp radii (0px–10px) unlessDESIGN.mdspecifies pill/organic geometry.
4. Typographic Mechanics (U-16–U-18, U-33)
- Role Separation: Assign clear structural roles—Display (headlines), Sans (controls & prose), Monospace (timestamps, IDs, code, metrics). Never set an entire page in weight-600
Inter. - Optical Scale:
- Display (
>= 2.5rem):line-height: 1.0–1.08,letter-spacing: -0.028emto-0.04em,text-wrap: balance. - Section Title (
1.5rem–2.25rem):line-height: 1.12–1.2,letter-spacing: -0.02em. - Metadata / Eyebrow (
0.72rem–0.78rem): uppercase,letter-spacing: 0.06em–0.1em, zero emojis. - Prose (
0.95rem–1.06rem):line-height: 1.55–1.68,max-width: 60ch–66ch,text-wrap: pretty. - Numeric Values (
U-18):font-variant-numeric: tabular-nums lining-nums.
- Display (
5. Tactile Controls, Spring Motion & Core Web Vitals (U-19–U-21, U-30, U-32, U-34)
- Machined Button Depth (Never Ship Dead Flat Rectangles):
- Avoid lifeless single-hex
<button style="background:#333">blocks unlessDESIGN.mdexplicitly mandates stark brutalism (brutalist). - Anodized Primary Buttons: Combine a subtle vertical luminance step (
linear-gradient(180deg, ...)), a1pxtop inner specular highlight (inset 0 1px 0 rgba(255,255,255,0.2)), a crisp1pxouter bezel, and a tight contact shadow (0 2px 4px rgba(0,0,0,0.16)). - Ceramic Secondary / Ghost Keycaps: Use a subtle light-catching surface (
#FFFFFF->var(--bg-subtle)),inset 0 1px 0 #FFFFFF, and a1pxhairline ring (0 0 0 1px var(--border-hairline), 0 1px 2px rgba(0,0,0,0.06)). - Concentric
<kbd>Keycaps (U-30): Nest keyboard hints (⌘K,↵) inside buttons with concentric radii (R_kbd = R_btn - padding) and subtle keycap lip depth.
- Avoid lifeless single-hex
- Physics-Grounded Micro-Interactions:
- Animate compositor-safe properties (
transform,opacity) plus crisp140mssurface/border transitions oncubic-bezier(0.22, 1, 0.36, 1)or spring curves (cubic-bezier(0.16, 1, 0.3, 1)). - Tactile Press & State Morph (
U-32): Buttons compress on:active(transform: translateY(1px) scale(0.985)). Async actions morph smoothly in-place (Idle->1.5pxmonochrome spinner ->Confirmedicon crossfade fromscale(0.85) blur(2px)toscale(1) blur(0)) instead of flashing jarring full-screen spinners. - Sliding Segmented Pills: Give tab/view switchers a recessed track (
inset 0 1px 2px rgba(0,0,0,0.06)) and an elevated thumb gliding smoothly viatransform: translateX(...).
- Animate compositor-safe properties (
- Performance Baseline:
LCP: Never hide above-the-fold hero copy or primary imagery behindopacity: 0entrance animations or client-only JS hydration delays; preload or prioritize the hero image (fetchpriority="high"), lazy-load offscreen media (loading="lazy").CLS(U-34): Reserve exact aspect-ratio boxes for every image, icon, font fallback, and async skeleton.INP: Keep click/input handlers free of synchronous layout thrashing; debounce expensive filter/search recalculations.
See deeper examples in ../unprompted/references/typography-and-color-tokens.md and ../unprompted/references/layouts-and-microinteractions.md.
版本历史
- 10cd954 当前 2026-12-03 02:10


