Communitygithub.com

ali-kk/uxlaws

30 evidence-based UX principles as an agent skill — mechanism, how to apply, pitfalls, and a real example for each.

Funciona com~Claude Code~Codex CLI~Cursor
npx skills add ali-kk/uxlaws

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentação

Laws of UX

A working toolkit of 30 principles about how people see, remember, decide, and act — each translated into decisions you can make in a real interface. These aren't style opinions. They come from perception and cognition research, and they hold across platforms, eras, and visual trends.

Use this skill to design new UI, diagnose why an existing screen feels off, or back a design decision with a reason instead of a preference.

How to run a UX pass

  1. Name the symptom. "Too many buttons," "feels slow," "people abandon the form," "nobody notices the CTA." Symptoms map to principles — the index below is organized that way.
  2. Pull the 1–3 relevant principles and read their full entry in reference/laws.md. Read the mechanism and the pitfalls, not just the definition — that's where the useful nuance lives.
  3. Propose a concrete change to this screen, and cite the principle by name so the reasoning is auditable. Not "add more contrast" — instead: "Von Restorff Effect: make the primary action the only filled button so it stops competing with the three ghost buttons around it."
  4. Check for conflicts. Principles pull against each other. More whitespace (Prägnanz) vs. more visible options (discoverability). Simplicity (Occam) has a floor (Tesler). Resolve deliberately; don't apply one law blind.
  5. Verify with users when the stakes are real. These principles predict behavior well, but they don't replace testing — the Aesthetic-Usability Effect specifically warns that a good-looking design can hide broken tasks.

The 30 principles, by what they govern

Perception & visual grouping (Gestalt) — how the eye organizes a screen before anyone reads a word.

  • Law of Proximity · Law of Common Region · Law of Similarity · Law of Uniform Connectedness · Law of Prägnanz · Von Restorff Effect · Selective Attention · Aesthetic-Usability Effect

Memory & attention — what people can hold in their heads while using your UI.

  • Miller's Law · Working Memory · Chunking · Serial Position Effect · Cognitive Load · Zeigarnik Effect · Peak-End Rule

Decision-making — how choices get made, and where they stall.

  • Hick's Law · Choice Overload · Cognitive Bias · Occam's Razor · Pareto Principle

Interaction & performance — speed, effort, motion, momentum.

  • Fitts's Law · Doherty Threshold · Flow · Goal-Gradient Effect · Parkinson's Law

Expectations & mental models — what people assume before they even arrive.

  • Jakob's Law · Mental Model · Paradox of the Active User · Postel's Law · Tesler's Law

Index — reach for it when…

PrincipleReach for it when…
Aesthetic-Usability EffectYou need to know why a prettier design tests as "easier" — and why that's a trap.
Choice OverloadToo many options make people freeze, decide worse, or leave.
ChunkingDense content or long strings need grouping to be scannable.
Cognitive BiasDecisions skew from "rational" — framing, defaults, anchoring, confirmation.
Cognitive LoadThe interface asks the brain to hold or process too much at once.
Doherty ThresholdAnything feels slow; responses cross ~400ms; you need loading states.
Fitts's LawSizing and placing buttons, links, and touch targets.
FlowKeeping people immersed; matching challenge to skill; killing friction.
Goal-Gradient EffectMotivating completion; progress that accelerates near the finish.
Hick's LawDecision time balloons with the number and complexity of choices.
Jakob's LawUsers expect your UI to behave like every other one they know.
Law of Common RegionGrouping with borders, cards, backgrounds, containers.
Law of ProximityGrouping by spacing alone — what's near reads as related.
Law of PrägnanzReduce visual complexity; the eye prefers the simplest reading.
Law of SimilarityMatching look implies matching function (links vs. plain text).
Law of Uniform ConnectednessTie related items together with lines, frames, shared containers.
Mental ModelMatch how users already believe the thing should work.
Miller's LawWorking memory is small (~7±2 chunks); chunk — but don't over-limit.
Occam's RazorStrip every element that isn't earning its place.
Paradox of the Active UserPeople won't read docs; teach in context, inline, just in time.
Pareto PrincipleFocus effort on the ~20% of features driving ~80% of value.
Parkinson's LawTasks stretch to fill the time; shorten steps, autofill, set expectations.
Peak-End RuleDesign the most intense moment and the ending on purpose.
Postel's LawAccept messy input generously; emit clean, predictable output.
Selective AttentionPeople tune things out; avoid banner blindness and change blindness.
Serial Position EffectFirst and last items stick; place key actions at the ends.
Tesler's LawSome complexity is irreducible — let the system carry it, not the user.
Von Restorff EffectMake the one important thing visibly distinct (without faking an ad).
Working MemorySupport recognition over recall; carry state across screens.
Zeigarnik EffectUnfinished tasks tug at attention; use progress cues to pull completion.

Ready-made combinations

  • Declutter a busy screen → Occam's Razor + Law of Proximity + Miller's Law.
  • Kill a slow-feeling flow → Doherty Threshold + Goal-Gradient Effect + optimistic UI.
  • Fix a confusing new feature → Jakob's Law + Mental Model + Paradox of the Active User.
  • Rescue an abandoned form → Hick's Law + Parkinson's Law + Postel's Law + progress cues (Zeigarnik / Goal-Gradient).
  • Sharpen a landing page → Von Restorff Effect + Selective Attention + Serial Position Effect + Peak-End Rule.

Full entries — mechanism, how-to-apply, pitfalls, and a real example each — are in reference/laws.md.

Habilidades Relacionadas