ui-style-compliance
1
总安装量
1
周安装量
#46683
全站排名
安装命令
npx skills add https://github.com/dereknex/skills --skill ui-style-compliance
Agent 安装分布
amp
1
opencode
1
kimi-cli
1
codex
1
gemini-cli
1
Skill 文档
UI Style Compliance
Overview
Apply a strict UI compliance checklist to React-based UI work so outputs match the UI Skills constraints without adding unrequested styling or interaction behavior.
Priority: This skill is a compliance gate. When it conflicts with other UI skills (e.g., animation or styling), these rules take precedence.
Scope
Use this skill for UI design, UI review, or implementation review in Next.js, Vite, Remix, or Astro projects. It is a compliance gate, not a creativity prompt.
Quick Checklist
- Confirm stack rules (Tailwind defaults, motion/react, tw-animate-css, cn).
- Confirm component primitive rules (accessibility, no mixing systems, aria-labels).
- Confirm interaction rules (AlertDialog, skeletons, h-dvh, safe-area, errors, paste).
- Confirm animation rules (only when requested, compositor-only, timing, reduced motion).
- Confirm typography rules (text-balance, text-pretty, tabular-nums, no tracking).
- Confirm layout rules (fixed z-index scale, size-x for squares).
- Confirm performance rules (no large blur/backdrop animations, no stray will-change, avoid unnecessary useEffect).
- Confirm design rules (no gradients unless asked, no purple/multicolor, no glow affordance, empty state CTA, limited accent color).
Rules by Category
Stack
- MUST use Tailwind CSS defaults (spacing, radius, shadows) before custom values
- MUST use
motion/reactwhen JavaScript animation is required - SHOULD use
tw-animate-cssfor entrance and micro-animations in Tailwind CSS - MUST use
cnutility (clsx+tailwind-merge) for class logic
Components
- MUST use accessible component primitives for anything with keyboard or focus behavior (Base UI, React Aria, Radix)
- MUST use the projectâs existing component primitives first
- NEVER mix primitive systems within the same interaction surface
- SHOULD prefer Base UI for new primitives if compatible with the stack
- MUST add an
aria-labelto icon-only buttons - NEVER rebuild keyboard or focus behavior by hand unless explicitly requested
Interaction
- MUST use an AlertDialog for destructive or irreversible actions
- SHOULD use structural skeletons for loading states
- NEVER use
h-screen, useh-dvh - MUST respect
safe-area-insetfor fixed elements - MUST show errors next to where the action happens
- NEVER block paste in input or textarea elements
Animation
- NEVER add animation unless explicitly requested
- MUST animate only compositor props (
transform,opacity) - NEVER animate layout properties (
width,height,top,left,margin,padding) - SHOULD avoid animating paint properties (
background,color) except for small, local UI - SHOULD use
ease-outon entrance - NEVER exceed
200msfor interaction feedback - MUST pause looping animations when off-screen
- MUST respect
prefers-reduced-motion - NEVER introduce custom easing curves unless explicitly requested
- SHOULD avoid animating large images or full-screen surfaces
Typography
- MUST use
text-balancefor headings andtext-prettyfor body/paragraphs - MUST use
tabular-numsfor data - SHOULD use
truncateorline-clampfor dense UI - NEVER modify letter-spacing (
tracking-) unless explicitly requested
Layout
- MUST use a fixed
z-indexscale (no arbitraryz-x) - SHOULD use
size-xfor square elements instead ofw-x+h-x
Performance
- NEVER animate large
blur()orbackdrop-filtersurfaces - NEVER apply
will-changeoutside an active animation - NEVER use
useEffectfor anything that can be expressed as render logic
Design
- NEVER use gradients unless explicitly requested
- NEVER use purple or multicolor gradients
- NEVER use glow effects as primary affordances
- SHOULD use Tailwind CSS default shadow scale unless explicitly requested
- MUST give empty states one clear next action
- SHOULD limit accent color usage to one per view
- SHOULD use existing theme or Tailwind CSS color tokens before introducing new ones
Quick Reference Table
| Area | Hard Stop | Preferred Defaults |
|---|---|---|
| Animation | No unrequested animation; only transform/opacity; <=200ms feedback | ease-out entrances, tw-animate-css |
| Layout | No h-screen, no arbitrary z-* |
h-dvh, fixed z-index scale |
| Typography | No tracking-* without request |
text-balance, text-pretty, tabular-nums |
| Design | No gradients unless requested; no purple/multicolor | Tailwind default shadows, 1 accent color |
| Components | No mixing primitives | Use existing primitives, Base UI preferred |
Example (Single View Audit)
User request: “Design a settings page in Next.js with a subtle animated header and a destructive delete button.”
Compliance response:
- Ask whether animation is explicitly required. If not, remove it.
- Use existing component primitives for dialog and inputs.
- Implement destructive action with AlertDialog.
- Use
h-dvhfor full height layout. - Use
text-balancefor the title andtext-prettyfor descriptions. - Add
aria-labelfor any icon-only buttons. - Avoid gradients unless the user explicitly asked for them.
Common Mistakes and Fixes
- “Added a gradient for polish” -> Remove it unless explicitly requested.
- “Used h-screen out of habit” -> Replace with
h-dvh. - “Mixed Radix and Headless UI” -> Pick one primitive system per surface.
- “Animated height for accordion” -> Use transform/opacity or remove animation.
- “Added tracking for headings” -> Remove tracking unless requested.
Rationalization vs Reality
| Rationalization | Reality |
|---|---|
| “It looks better with a gradient” | Gradients are forbidden unless requested. |
| “The animation is tiny” | Any animation still requires explicit request. |
| “h-screen is standard” | The rule is h-dvh. |
| “Custom easing feels smoother” | Custom easing is forbidden unless requested. |
| “I can hack focus behavior quickly” | Use accessible primitives; do not rebuild focus handling. |
Red Flags (Stop and Correct)
- Adding animation without the user explicitly asking
- Using
h-screenor arbitraryz-* - Mixing primitive systems in a single surface
- Introducing gradients or purple/multicolor accents
- Modifying letter-spacing without a request
- Adding
useEffectfor render-derivable state
Resources
No external resources required for this skill.