Agent Skills
› mocasus/unprompted
› unprompted-ui
unprompted-ui
GitHub提供Web界面视觉组合、排版、动效及性能规范,指导UI设计与重构。
Trigger Scenarios
设计或构建Web界面
UI组件或页面样式调整
前端代码重构
Install
npx skills add mocasus/unprompted --skill unprompted-ui -g -y
SKILL.md
Frontmatter
{
"name": "unprompted-ui",
"license": "MIT",
"version": "4.0.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 v4 D-02…D-12, S-01…S-11, M-01…M-10, and E-08. Do not duplicate core checks; apply the structural engineering rules below whenever building visual interfaces.
1. Check direction first (D-01)
- 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, blur budget, and grid proportions strictly.
- If absent on a greenfield UI task, either invoke
unprompted-directionto establishDESIGN.md, or strip decorative invention, use a neutral architectural baseline, and mark the reportDRAFT (NO DESIGN.MD).
2. Spatial composition & anti-template choreography (S-01, S-02, S-03, S-04)
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 (
S-03) 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). Use the numbered index only when the order carries meaning, not as decoration. - Bento discipline: Only use multi-span bento cells when each cell renders genuinely heterogeneous data density—never stuff uniform text blurbs into arbitrary
col-span-2boxes.
3. Surface, border & chromatic restraint (D-02, D-06, D-07, D-09, D-11, M-03)
- 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. At most 2 elevation levels (D-06). - Border budget: One default border treatment for layout and controls; focus, status, and overlay borders are exempt (
D-06). - Blur budget: At most one backdrop-blur surface per view unless
DESIGN.mdexplicitly documents a larger budget and a non-blur fallback (D-06). Decorative blur orbs always fail (M-03). - 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 (
D-09): 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 (
S-08): 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 (
D-07): Outer container radius equals inner child radius plus container padding (R_outer = R_inner + P). Prefer crisp radii (0px–10px) unlessDESIGN.mdspecifies pill/organic spatial geometry.
4. Typographic mechanics (D-03, D-04, S-08)
- Role separation: Assign clear structural roles—Display (headlines), Sans (controls & prose), Monospace (timestamps, IDs, code, metrics). That is at most 2 text families plus one mono; 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: 55ch–68ch,text-wrap: pretty. - Numeric values:
font-variant-numeric: tabular-nums lining-nums.
- Display (
- Scale discipline: at most 4 weights and 6 rendered sizes per view; shared components reuse sizes (
D-03).
5. Tactile controls, motion & Core Web Vitals (M-01…M-10, E-08)
- Control depth: Avoid lifeless single-hex
<button style="background:#333">blocks unlessDESIGN.mdexplicitly mandates stark brutalism (brutalist). If the direction calls for machined controls:- Primary buttons: subtle vertical luminance step,
1pxtop inner specular highlight, crisp1pxouter bezel, tight contact shadow. - Secondary / ghost keycaps: light-catching surface,
inset 0 1px 0highlight,1pxhairline ring. <kbd>keycaps: concentric radii (R_kbd = R_btn - padding) and subtle keycap lip depth.
- Primary buttons: subtle vertical luminance step,
- Physics-grounded micro-interactions:
- Animate compositor-safe properties (
transform,opacity) plus crisp140mssurface/border transitions; use one easing family (M-01,D-11). - Press & state morph: buttons may compress on
:active(translateY(1px) scale(0.985)). Async actions morph in place (Idle-> spinner ->Confirmed) instead of flashing full-screen spinners. Never hover-scale content cards (M-02). - Segmented controls: give tab/view switchers a recessed track and a thumb gliding via
transform: translateX(...).
- Animate compositor-safe properties (
- Performance baseline:
- LCP: Never hide above-the-fold hero copy or primary imagery behind
opacity: 0entrance animations or client-only hydration delays; preload or prioritize the hero image (fetchpriority="high"), lazy-load offscreen media (loading="lazy"). - CLS (
M-04,E-08): Reserve exact aspect-ratio boxes for every image, video, embed, font fallback, and async skeleton. - INP: Keep click/input handlers free of synchronous layout thrashing; debounce expensive filter/search recalculations.
- Asset and JS budgets (
M-06,M-10): Stay within the budget declared inDESIGN.md; no oversized hero assets and no client JS for layout, type, or simple interaction.
- LCP: Never hide above-the-fold hero copy or primary imagery behind
- Media controls (
M-07): Video/audio needs a poster, visible controls, pause, and no autoplay with sound. Animations pause offscreen (M-08), and one motion idea dominates per view (M-09).
See deeper examples in ../unprompted/references/typography-and-color-tokens.md and ../unprompted/references/layouts-and-microinteractions.md.
Version History
-
5f9ec34
Current 2026-12-05 03:22
更新扩展的核心规则ID,细化空间构图与表面色彩约束指南。
- 10cd954 2026-12-03 02:10


