# UX.md Behavior rules for AI agents that build digital products. DESIGN.md says how a product looks; UX.md says how it behaves. ## How to use this file 1. Read this file before building or changing any user-facing screen. 2. Open the category files in `rules/` that match the work, such as [rules/forms.md](https://ux-md.com/rules/forms.md) when building a form. 3. Treat **MUST** rules as requirements. Follow **SHOULD** rules unless there is a clear, stated reason not to. 4. When you skip or break a rule, say which rule ID and why. 5. When reviewing or auditing, report findings by rule ID, severity, location and suggested fix. ## Principles - **Design every state.** The happy path is one state out of at least four: empty, loading, error and success. - **Never lose people's work.** Protect input, prevent double actions and offer undo. - **Respond to every action.** People should always know whether something happened. - **Be predictable.** Same names, same places, same behavior everywhere. - **Work for everyone.** Keyboard, screen reader, small screen, slow network. - **Say it plainly.** Words are design. Name things by what people do, not by how the system works. ## Categories | Category | File | What it covers | | --- | --- | --- | | Forms | [rules/forms.md](https://ux-md.com/rules/forms.md) | Labels, validation, errors, keeping input | | States | [rules/states.md](https://ux-md.com/rules/states.md) | Empty, loading, error, real-world content | | Feedback | [rules/feedback.md](https://ux-md.com/rules/feedback.md) | Response time, confirmations, double submits, progress | | Navigation | [rules/navigation.md](https://ux-md.com/rules/navigation.md) | Where am I, back button, links and buttons | | Accessibility | [rules/accessibility.md](https://ux-md.com/rules/accessibility.md) | Contrast, keyboard, alternatives, dialogs, motion | | Content | [rules/content.md](https://ux-md.com/rules/content.md) | Button labels, terminology, plain language | | Destructive actions | [rules/actions.md](https://ux-md.com/rules/actions.md) | Undo, confirmation, friction | | Touch and responsive | [rules/mobile.md](https://ux-md.com/rules/mobile.md) | Target size, reflow, zoom, thumb reach | | Visual craft | [rules/visual.md](https://ux-md.com/rules/visual.md) | Hierarchy, primary actions, tokens, AI defaults | Every rule has an ID (such as `FORM-03`), a level (MUST or SHOULD), a reason, a do and a don't, and a check type: **auto** (tools can verify it), **walkthrough** (verify it by using the app) or **visual** (verify it by looking at screenshots). The full rule set in a single file is at https://ux-md.com/ux-full.md, and as JSON at https://ux-md.com/rules.json. --- # Forms Forms are where most products ask for effort. Every rule here exists to make that effort smaller and safer. ## FORM-01: Every input has a visible label - **Level:** MUST - **Why:** Placeholder text disappears as soon as someone types, is usually low contrast, and is not a reliable label for screen readers. - **Do:** Put a `