skills/laws-of-ux/SKILL.md
Fundamental UX laws and principles from lawsofux.com for designing better interfaces. Trigger: When designing UI flows, reviewing UX decisions, or justifying design choices.
npx skillsauth add 333-333-333/agents laws-of-uxInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Law | Principle | Flutter Application | |-----|-----------|---------------------| | Fitts's Law | Time to target = f(distance, size) | Large touch targets (48dp+), important actions within thumb reach | | Hick's Law | Decision time ↑ with more choices | Limit options, use progressive disclosure | | Doherty Threshold | Response < 400ms keeps flow | Show loading states, optimistic UI updates |
| Law | Principle | Flutter Application | |-----|-----------|---------------------| | Miller's Law | Working memory: 7±2 items | Chunk content, limit nav items to 5-7 | | Cognitive Load | Minimize mental effort | Simple layouts, clear hierarchy, familiar patterns | | Chunking | Group related info | Use cards, sections, visual grouping |
| Law | Principle | Flutter Application | |-----|-----------|---------------------| | Law of Proximity | Near = related | Group related controls, consistent spacing | | Law of Similarity | Similar = related | Consistent button styles, icon families | | Law of Common Region | Shared boundary = group | Cards, outlined sections, backgrounds | | Law of Prägnanz | Simplest interpretation wins | Clean shapes, minimal decoration |
| Law | Principle | Flutter Application | |-----|-----------|---------------------| | Jakob's Law | Users expect familiar patterns | Follow platform conventions, standard nav | | Peak-End Rule | Judge by peak + end moments | Strong onboarding, satisfying completion | | Von Restorff Effect | Different = memorable | Highlight CTAs, use contrast for key actions | | Serial Position Effect | Remember first/last best | Important items at top/bottom of lists | | Goal-Gradient Effect | Motivation ↑ near goal | Progress indicators, completion percentages | | Zeigarnik Effect | Incomplete = memorable | Progress saving, resume prompts |
| Law | Principle | Flutter Application | |-----|-----------|---------------------| | Tesler's Law | Complexity can't be eliminated, only moved | Hide complexity from users, smart defaults | | Occam's Razor | Simplest solution is best | Remove unnecessary elements, clear paths | | Aesthetic-Usability | Pretty = perceived as usable | Polish visual design, attention to detail | | Postel's Law | Accept liberally, send conservatively | Flexible inputs, strict validation output |
User struggling with choices? → Hick's Law (reduce options)
UI feels slow? → Doherty Threshold (< 400ms feedback)
Users missing key actions? → Fitts's Law (bigger targets)
→ Von Restorff (make it stand out)
Users confused by layout? → Gestalt laws (proximity, similarity)
Users abandoning flows? → Peak-End Rule (improve completion)
→ Goal-Gradient (show progress)
Users not finding features? → Jakob's Law (use familiar patterns)
Too much on screen? → Miller's Law (chunk to 7±2)
→ Cognitive Load (simplify)
See assets/laws_quick_reference.md for a printable checklist.
| ❌ Violation | Law Broken | ✅ Fix | |-------------|------------|--------| | 15 nav items | Miller's Law | Group into 5 categories | | Tiny 24px buttons | Fitts's Law | Minimum 48dp touch target | | 500ms+ response, no feedback | Doherty Threshold | Immediate loading indicator | | All buttons look the same | Von Restorff | Highlight primary CTA | | No progress in long forms | Goal-Gradient | Add progress indicator | | Custom unfamiliar navigation | Jakob's Law | Use standard patterns | | Dense wall of text | Chunking | Break into scannable sections |
testing
Review Flutter components and screens for UX/UI compliance. Trigger: When user invokes /ux-review command or requests UX audit.
development
TypeScript strict patterns and best practices. Trigger: When implementing or refactoring TypeScript in .ts/.tsx (types, interfaces, generics, const maps, type guards, removing any, tightening unknown).
testing
Testing philosophy and strategy for every feature: test pyramid, mandatory levels per change type, completion checklist, and skill delegation. Trigger: When planning tests for a feature, reviewing test coverage, defining acceptance criteria, or asking what tests a change needs.
development
Terraform security practices: sensitive variables, secret management, state protection, .gitignore patterns, and CI/CD credential handling. Trigger: When handling secrets in Terraform, configuring state backends, reviewing .gitignore for Terraform, or setting up CI/CD pipelines for infrastructure.