UX rules your AI agent actually follows
DESIGN.md tells agents how your product looks. UX.md tells them how it behaves. Drop it in your repo, and Claude Code, Codex or Cursor builds forms, states and flows that hold up with real people.
> Audit the sign-up and projects pages against UX.md
Read ux.md, rules/forms.md, rules/states.md, rules/content.md
3 MUST rules broken
- FORM-01Email field uses its placeholder as the labelsignup.tsx:42
- STATE-02Projects list has no empty stateprojects/page.tsx:18
- COPY-01Button says "Submit" instead of the actionsignup.tsx:77
Fixed all 3. Re-ran the checks: 0 issues left.
Works with any agent that reads markdown
Point it at UX.md from the file your agent already reads.
Agents build the happy path. Real people don't stay on it.
They arrive with empty accounts, slow networks, typos, small phones and a keyboard instead of a mouse. Here's what changes when the agent has the rules.
-
Without: Sign-up form uses placeholders as labels
With: Visible labels that stay while typing
FORM-01 -
Without: A failed submit clears everything you typed
With: Every value survives an error
FORM-04 -
Without: New users land on a blank page
With: An empty state that explains and offers a next step
STATE-02 -
Without: Delete sits next to Save, with no way back
With: Destructive actions set apart, with undo
ACT-02 -
Without: 16 px icon buttons that are hard to tap
With: 44 px touch targets
TOUCH-01
Written to be followed, and checked
Most guidelines are prose that agents skim and reviewers argue about. Every UX.md rule has the same parts, so an agent knows exactly what to do and an audit knows exactly what to test.
See the rule in the library- ID and level
- STATE-02 MUST
- Rule
- Empty states explain what goes here and offer the next step
- Why
- An empty screen is a new user's first impression. It should teach, not shrug.
- Do
- Say what will appear and add the action that fills it, for example "No projects yet" with a "Create project" button.
- Don't
- Show a blank area, "No data" or a lonely table header.
- Test
- walkthrough Open each list or dashboard with no data. Each shows an explanation and a primary action.
Rule IDs for reviews
Audits cite
FORM-03instead of "the form feels off", so every fix is specific and easy to track.MUST and SHOULD
29 MUST rules are requirements. The rest are strong defaults that need a stated reason to break.
Loads only what's needed
A short root file points to topic files. Agents read the form rules when building a form, not everything at once.
Any stack
Rules describe behavior, not code, so they apply to React, Vue, Svelte, native apps or plain HTML.
Open and versioned
Plain markdown in a public Git repo. Fork it, add your own rules and pull in updates.
Checked on every commit
The build validates every rule. A missing field or a reused ID fails the deploy with a clear message.
Get started
Two ways to give your agent the rules. No install, no dependencies.
Always up to date. Paste this into Claude Code, Codex, Cursor or any agent that can read web pages. It fetches the latest rules every time.
Prompt for your agent
Read https://ux-md.com and follow its UX rules when you build or review UI. MUST rules are requirements. Report issues by rule ID with a suggested fix.
Works offline. One markdown file with all 48 rules. Put it in your repo and tell your agent to follow it.
Download UX.mdAdd to AGENTS.md or CLAUDE.md
Follow the rules in ux.md when you build or review UI. MUST rules are requirements. Report issues by rule ID.
For AI agents: the full rule set as markdown is at https://ux-md.com/ux-full.md. Read that file and follow its rules.
The library
48 rules across 9 categories, each with a reason, an example and a test.
- Forms7Labels, validation and errors that help people finish, and never lose their work.
- States5Empty, loading, error and edge-case states, beyond the happy path that agents tend to stop at.
- Feedback4Every action gets a response, and people always know whether something worked.
- Navigation4People always know where they are, how they got there, and how to get back.
- Accessibility6Contrast, keyboard, focus and alternatives, so the product works for everyone.
- Content5Words that make the product easier to use, with clear actions, one name per thing, and plain language.
- Destructive actions4Deleting, cancelling and other actions people can't easily take back.
- Touch and responsive5Targets, zoom and layouts that hold up on small screens and real thumbs.
- Visual craft8Hierarchy, focus and restraint, and how to avoid the generic look of AI-made UI.
Next: an audit that checks the rules for you
Point it at a URL. An agent walks your key flows, forces empty, error and slow states, and reports every broken rule with a screenshot and a fix prompt for your coding agent.