ui-design
Skill18 starsChanged 5 months agoMITView on GitHub
Opinionated constraints for building better interfaces with agents. Use when building UI components, implementing animations, designing layouts, reviewing frontend accessibility, or working with Tailwind CSS, motion/react, or accessible primitives like Radix/Base UI.
28 other projects use a version of this.
Adopted by
Most recently taken up by
- TencentCloudBase/skillstheir own version, first seen Sep 30, 2026
- mia-cx/skillstheir own version, first seen Sep 29, 2026
- casoon/ai-agent-configtheir own version, first seen Sep 27, 2026
- ZeroTokenClaw/agents-skillstheir own version, first seen Sep 21, 2026
- angelgabrieljacintohuayllasco/clipboard-skillstheir own version, first seen Sep 20, 2026
- mblode/agent-skillstheir own version, first seen Sep 11, 2026
Used with
Projects with it also use algorithmic-art, git-commit and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
GoogleSkillalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Also in 3 projects that use this
GitHubSkillgit-commit
Execute git commit with conventional commit message analysis, intelligent staging, and message generation. Use when user asks to commit changes, create a git commit, or mentions "/commit". Supports: (1) Auto-detecting type and scope from changes, (2) Generating conventional commit messages from diff, (3) Interactive commit with optional type/scope/description overrides, (4) Intelligent file staging for logical grouping
Also in 3 projects that use this
MicrosoftSkillcaveman
Ultra-compressed response style that reduces output token count while preserving technical accuracy, with intensity levels and auto-clarity safety rules
Also in 3 projects that use this
Other versions28 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 28
- yunshu0909/yunshu_skillshub★ 764same name
- Mindrally/skills★ 266same name
- JayZeeDesign/awesome-claude-skills★ 171same name
- AnastasiyaW/codex-claude-code-config★ 153same name
- frappe/skills★ 145same name
- mblode/agent-skills★ 142same name
- TencentCloudBase/skills★ 78same name
- getsentry/abacus★ 77same name
- uizze/uizze★ 38same name
- Starchild-ai-agent/official-skills★ 27same name
18 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-browserSkill
- agent-engineeringSkill
- app-marketing-copySkill
- ascii-pixel-artSkill
- autopredictSkill
- autoresearchSkill
- babysit-prSkill
- bird-fastSkill
- blockchain-auditorSkill
- brainstormingSkill
- ceo-reviewSkill
- ck-reviewSkill
- cloudflare-managerSkill
- codex-advisorSkill
- content-trend-researcherSkill
- continuous-learningSkill
- coreml-optimizerSkill
- cto-reviewSkill
- direct-mail-strategistSkill
- evangelion-designSkill
- executing-plansSkill
- freshdesk-apiSkill
- gemini-image-generatorSkill
- gemini-visualSkill
- github-actions-templatesSkill
- googleSkill
- gsplat-optimizerSkill
- hyperagentSkill
- idea-mdSkill
- imagegenSkill
- ios-app-testerSkill
- llm-advisorSkill
- llm-evaluationSkill
- macos-appsSkill
- markdown-fetchSkill
- mcp-builderSkill
- mcp-testerSkill
- nano-bananaSkill
- opensea-apiSkill
- paperclipSkill
- playdate-devSkill
- poke-assistantSkill
- poplar-direct-mailSkill
- practical-typographySkill
- prompt-factorySkill
- qmdSkill
- scientific-critical-thinkingSkill
- security-best-practicesSkill
- security-threat-modelSkill
- seo-optimizerSkill
- shadertoySkill
- skill-finderSkill
- skimmableSkill
- subway-infoSkill
- systematic-debuggingSkill
- tui-designerSkill
- video-editorSkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 9 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 154
Test colors: Use online contrast checkers (https://webaim.org/resources/contrastchecker/)
- Very specific: line 159
For colored text (not gray): Use darker tints (red-700 not red-300)
- Very specific: line 190
Stack on mobile: Use flex-col by default, md:flex-row for desktop
- Very specific: line 193
Use flex-1 instead of fixed widths for flexible layouts
- Distinctive: line 194
Test responsiveness: Check at 375px (iPhone SE) and 768px (tablet) breakpoints
- Distinctive: line 195
Avoid horizontal scroll: Never force users to scroll sideways
- Distinctive: line 220
No recovery path from errors
- Distinctive: line 223
Loading states: Use structural skeletons (not spinners)
- Distinctive: line 232
Disabled states: Always provide visual feedback
- Distinctive: line 234
Never silently disable without explaining why
- Distinctive: line 238
Problem: All text the same size, all colors the same weight, all spacing the same distance — nothing stands out.
- Distinctive: line 281
One accent color per view: Use a single color for CTAs, not multiple colors fighting for attention
“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
UI Design
Opinionated constraints for building better interfaces with agents.
When to Use
- Building UI components with Tailwind CSS
- Implementing animations or transitions
- Adding interactive elements with keyboard/focus behavior
- Reviewing frontend code for accessibility
- Designing layouts with proper z-index and spacing
- Working with loading states, error handling, or empty states
Stack
| Requirement | Rule |
| Tailwind CSS | MUST use defaults (spacing, radius, shadows) before custom values |
| Animation library | MUST use motion/react (formerly framer-motion) for JS animation |
| CSS animation | SHOULD use tw-animate-css for entrance and micro-animations |
| Class logic | MUST use cn utility (clsx + tailwind-merge) |
Components
| Requirement | Rule |
| Interactive primitives | MUST use accessible primitives (Base UI, React Aria, Radix) for keyboard/focus behavior |
| Existing components | MUST use project's existing primitives first |
| Consistency | NEVER mix primitive systems within the same interaction surface |
| New primitives | SHOULD prefer Base UI if compatible with stack |
| Icon buttons | MUST add aria-label to icon-only buttons |
| Custom behavior | NEVER rebuild keyboard or focus behavior by hand unless explicitly requested |
Interaction
| Requirement | Rule |
| Destructive actions | MUST use AlertDialog for destructive or irreversible actions |
| Loading states | SHOULD use structural skeletons |
| Viewport height | NEVER use h-screen, use h-dvh |
| Fixed elements | MUST respect safe-area-inset |
| Error display | MUST show errors next to where the action happens |
| Input behavior | NEVER block paste in input or textarea elements |
Animation
| Requirement | Rule |
| Default | NEVER add animation unless explicitly requested |
| Compositor props | MUST animate only transform, opacity |
| Layout props | NEVER animate width, height, top, left, margin, padding |
| Paint props | SHOULD avoid background, color except for small, local UI (text, icons) |
| Entrance easing | SHOULD use ease-out on entrance |
| Feedback timing | NEVER exceed 200ms for interaction feedback |
| Looping | MUST pause looping animations when off-screen |
| Accessibility | MUST respect prefers-reduced-motion |
| Custom easing | NEVER introduce custom easing curves unless explicitly requested |
| Large surfaces | SHOULD avoid animating large images or full-screen surfaces |
Typography
| Requirement | Rule |
| Headings | MUST use text-balance |
| Body text | MUST use text-pretty for paragraphs |
| Data | MUST use tabular-nums |
| Dense UI | SHOULD use truncate or line-clamp |
| Letter spacing | NEVER modify letter-spacing (tracking-) unless explicitly requested |
Layout
| Requirement | Rule |
| Z-index | MUST use a fixed scale (no arbitrary z-x) |
| Square elements | SHOULD use size-x instead of w-x + h-x |
Performance
| Requirement | Rule |
| Blur effects | NEVER animate large blur() or backdrop-filter surfaces |
| Will-change | NEVER apply will-change outside an active animation |
| useEffect | NEVER use for anything expressible as render logic |
Design
| Requirement | Rule |
| Gradients | NEVER use unless explicitly requested |
| Purple/multicolor gradients | NEVER use |
| Glow effects | NEVER use as primary affordances |
| Shadows | SHOULD use Tailwind CSS default scale unless explicitly requested |
| Empty states | MUST give one clear next action |
| Accent colors | SHOULD limit to one per view |
| Color tokens | SHOULD use existing theme or Tailwind CSS tokens before introducing new ones |
Common Pitfalls
The most common UI design failures occur in spacing, color contrast, mobile responsiveness, state management, and visual hierarchy. These gotchas are discovered through repeated agent mistakes when building interfaces.
1. Inconsistent Spacing (Arbitrary Margins, No System)
Problem: Using an inconsistent mix of Tailwind spacing values without a deliberate system makes layouts feel incoherent.
// ❌ WRONG - arbitrary pixel values, no spacing system
<div className="ml-[13px] mr-[22px] pt-[7px]">Content</div>
// ✅ CORRECT - use system scales
<div className="ml-4 mr-4 pt-4">Content</div>Why it fails:
- Designs look accidental (some spacing is
2px, some is16px, no pattern) - Mobile layouts break (spacing doesn't scale proportionally)
- Alignment is impossible (gaps don't align to grid)
Fix:
- ALWAYS use Tailwind spacing scale (
0,1,2,3,4,6,8,12,16,24,32, etc.) - Define spacing systems for common patterns:
- Button padding:
px-4 py-2 - Card padding:
p-6 - Gap between sections:
gap-8 - Nested spacing:
ml-6(notml-3)
- Button padding:
- Group related elements with consistent gaps (use same
gap-xfor all horizontal lists)
2. Poor Color Contrast (Accessibility Violations)
Problem: Color combinations that fail WCAG AA contrast ratios (4.5:1 for text, 3:1 for UI components) making content illegible for low-vision users.
// ❌ WRONG - gray-400 text on gray-100 background fails contrast
<p className="text-gray-400 bg-gray-100">Important content</p>
// ✅ CORRECT - gray-700 on gray-100 passes WCAG AA
<p className="text-gray-700 bg-gray-100">Important content</p>Why it fails:
- Approximately 4-5% of users have color blindness, and a broader 15%+ have some form of visual impairment
- Users on bright displays (phones) can't read low-contrast text
- Legal liability (WCAG compliance required in many jurisdictions)
Fix:
- Use color pairs with sufficient contrast:
text-gray-900/text-whiteon any background (always safe)text-gray-700on light backgroundstext-gray-300on dark backgrounds
- Test colors: Use online contrast checkers (https://webaim.org/resources/contrastchecker/)
- Avoid problematic pairs:
gray-400ongray-100❌red-500onpink-100❌- Disabled states: use
text-gray-400on white,text-gray-600on color
- For colored text (not gray): Use darker tints (
red-700notred-300)
3. Mobile-Unfriendly Layouts (Small Touch Targets, Horizontal Scroll)
Problem: Touch targets smaller than 44×44px, horizontal scrolling, or layouts that don't adapt to narrow viewports.
// ❌ WRONG - button too small, no responsive layout
<button className="px-2 py-1 text-xs">Click me</button>
<div className="flex gap-2">
<div className="w-80">Sidebar</div>
<div className="w-80">Content</div>
</div>
// ✅ CORRECT - hit target size, responsive stack
<button className="px-4 py-3 md:px-6 md:py-3">Click me</button>
<div className="flex flex-col md:flex-row gap-4">
<div className="w-full md:w-80">Sidebar</div>
<div className="flex-1">Content</div>
</div>Why it fails:
- 40% of traffic is mobile; small buttons are impossible to tap
- Horizontal scrolling is a UX nightmare on phones
- Layouts that work on desktop can be unusable on mobile
Fix:
- Minimum touch target: 44×44px
- Buttons: at least
px-4 py-3(standard:px-6 py-3) - Links: wrap in larger clickable area
- Buttons: at least
- Stack on mobile: Use
flex-colby default,md:flex-rowfor desktop - Use responsive widths:
w-fullon mobile,md:w-80ormd:w-1/3on desktop- Use
flex-1instead of fixed widths for flexible layouts
- Test responsiveness: Check at 375px (iPhone SE) and 768px (tablet) breakpoints
- Avoid horizontal scroll: Never force users to scroll sideways
4. Missing States (Loading, Error, Empty, Disabled)
Problem: Interfaces that only show the happy path, failing silently when loading, erroring, or empty.
// ❌ WRONG - no feedback states
<button onClick={save}>Save</button>
<div>{data.map(item => <ItemCard item={item} />)}</div>
// ✅ CORRECT - all states accounted for
<button onClick={save} disabled={loading}>
{loading ? 'Saving...' : 'Save'}
</button>
{loading && <LoadingSkeleton />}
{error && <ErrorAlert message={error} />}
{!loading && data.length === 0 && <EmptyState action="Create your first item" />}
{!loading && !error && data.map(item => <ItemCard item={item} />)}Why it fails:
- Users don't know if action worked (no feedback = perceived failure)
- Empty lists look broken (not intentionally empty)
- No recovery path from errors
Fix:
- Loading states: Use structural skeletons (not spinners)
- Layout remains stable while content loads
- Users see what's coming, not just spinning
- Error states: Show next to the failed action
- Explain what happened and how to fix it
- Include retry button
- Empty states: Make intentional and actionable
- "No items yet" → "Create your first item" (button)
- Show what empty state means, how to populate
- Disabled states: Always provide visual feedback
disabled={true}+opacity-50orcursor-not-allowed- Never silently disable without explaining why
5. Unclear Hierarchy (Everything Looks Equally Important)
Problem: All text the same size, all colors the same weight, all spacing the same distance — nothing stands out.
// ❌ WRONG - flat hierarchy
<div className="text-lg text-gray-700">
<div className="text-lg text-gray-700">Subheading</div>
<div className="text-lg text-gray-700">Subtitle</div>
<button className="text-lg px-4 py-2">Action</button>
</div>
// ✅ CORRECT - clear hierarchy
<div>
<h1 className="text-3xl font-bold text-gray-900">Title</h1>
<h2 className="text-xl font-semibold text-gray-700 mt-6">Subheading</h2>
<p className="text-base text-gray-600 mt-2">Subtitle</p>
<button className="mt-6 px-6 py-3 bg-blue-600 text-white font-semibold rounded">
Primary Action
</button>
</div>Why it fails:
- Users don't know where to look first
- Scanning pages is slower (no skimmable structure)
- Important actions get missed
Fix:
- Size hierarchy:
- Headings:
text-3xl(h1) →text-2xl(h2) →text-xl(h3) - Body text:
text-base(paragraphs) →text-sm(secondary)
- Headings:
- Weight hierarchy:
- Primary actions:
font-boldorfont-semibold - Important text:
font-semibold - Body:
font-normal - Secondary:
font-normalwith lighter color
- Primary actions:
- Color hierarchy:
- Primary text:
text-gray-900 - Secondary text:
text-gray-600 - Tertiary:
text-gray-500
- Primary text:
- Spacing hierarchy:
- Section gaps:
gap-8(largest) - Component gaps:
gap-4 - Dense content:
gap-2
- Section gaps:
- One accent color per view: Use a single color for CTAs, not multiple colors fighting for attention
Quick Reference
Allowed Animation Properties
transform, opacityForbidden Animation Properties
width, height, top, left, margin, padding, blur(), backdrop-filterRequired Accessibility Patterns
// Icon button - always add aria-label
<button aria-label="Close dialog">
<XIcon />
</button>
// Respect reduced motion
@media (prefers-reduced-motion: reduce) {
* { animation: none !important; }
}Class Utility Pattern
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

