agentleFS
chinthakatchinthakat/agent-skills/skills/ux-state-coverage/SKILL.md

ux-state-coverage

Skill0 starsChanged 53 days agoMITView on GitHub

Work out and design every state a screen can be in — first run, empty, loading, partial, error, denied, offline, stale, overflowing, after-action — and write the copy for each. Use when building or reviewing any screen that loads data or accepts input, and when a bug report describes a blank page, a spinner that never stops, or an unhelpful error.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write the matrix as a table in the design or the ticket.

    line 37
  2. Distinctive:

    Never block the whole screen on a non-critical region.

    line 71
  3. Distinctive:

    Never lose their input: Not on validation failure, not on a server error, not on a navigation.

    line 88
  4. Distinctive:

    Put validation errors next to the field, on blur or submit — not on every keystroke, which scolds people mid-typing.

    line 91
  5. Distinctive:

    No error codes as the whole message.

    line 94
  6. Distinctive:

    Write in the interface's voice, not a person's.

    line 96
  7. Distinctive:

    Keep it plain, in the second person, and about the user's situation rather than the system's internals.

    line 152

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

State coverage

The happy path is one state out of about ten. It gets designed, built, demoed and tested. The other nine are discovered by users.

This is the cheapest quality work available on any interface: enumerate the states before building, because each one is a five-minute decision in advance and a support ticket afterwards.

1. The matrix

For every screen, list and every meaningful component, decide all of these. Most have a sensible default; the point is that you chose it.

StateWhenThe mistake to avoid
First runThe account is new; this has never had dataShowing the empty state, which implies something was lost
EmptyData is possible, there is none right nowA blank area with no explanation
Empty after filterTheir query matched nothingIdentical to empty, so they think the data vanished
Loading, firstNothing on screen yetA spinner where a skeleton would show the shape
Loading, refreshContent is on screen, updatingReplacing content with a spinner; the page jumps
PartialSome of it loaded, some failedShowing the successful half as if it were the whole
Error, retryableNetwork, timeout, 5xx"Something went wrong" with no action
Error, terminalValidation, conflict, goneOffering a retry that cannot work
DeniedSigned in, not allowedTreating it as an error, or as not-found with no explanation
Offline / staleNo connection, or data from cacheShowing old numbers with no indication they are old
Overflow10,000 rows; a 200-character nameLayout breaks, or the browser hangs
In flightThe action is submittingA double-submittable button
After actionIt workedNo confirmation, so they do it again
Destructive pendingThey are about to lose somethingA confirm dialog where an undo would be kinder

Write the matrix as a table in the design or the ticket. A screen with ten states and three designed is a screen that is 30% done, and the table is what makes that visible before it ships.

2. Empty is an invitation, not an absence

An empty state does three things: says what belongs here, says why it is empty, and offers the action that fills it.

Bad:   No results.

Good:  No reports yet
       Reports you complete will appear here, newest first.
       [ Start a report ]

Distinguish the three empties, because they need different words:

  • First run — "Nothing here yet" plus the primary action.
  • Empty now — "You have no open items" is a success in many products. Say so; don't make a clean queue feel like a failure.
  • Empty after filter — name the filter and offer to clear it. "No sites match north. [Clear search]"

3. Loading: show the shape, hold the space

  • Under ~300ms, show nothing. A flash of skeleton is worse than a short wait.
  • Beyond that, a skeleton in the shape of the content beats a spinner: it tells the user what is coming and stops the layout jumping when it arrives.
  • Reserve the space. Content that appears and shoves the page down causes mis-taps, especially on a phone.
  • Over ~10 seconds, it needs progress, an estimate, or a way out. A spinner with no end is indistinguishable from a hang, and users are right to reload.
  • Never block the whole screen on a non-critical region.

4. Errors say what happened, what it means, and what to do

Three parts. Most error messages have one.

Bad:   Error: request failed (500)

Good:  Couldn't save your answers
       They're saved on this device, so nothing is lost. We'll try again
       automatically when you're back online.
       [ Try now ]

Rules:

  • Never lose their input. Not on validation failure, not on a server error, not on a navigation. This is the one that turns an annoyance into an abandonment.
  • Put validation errors next to the field, on blur or submit — not on every keystroke, which scolds people mid-typing.
  • Distinguish retryable from terminal, and only offer the retry that can work.
  • No error codes as the whole message. A code in addition is useful for support; keep it small and copyable.
  • Write in the interface's voice, not a person's. Errors do not apologise repeatedly.

5. Denied is its own state

"You don't have access" is not an error and not a 404. Users hit it constantly in multi-role products, and treating it as a generic failure sends them to support.

Say what is restricted, and what to do — usually "ask an admin", ideally with the admin named. Note the tension with access-control-proof: where confirming that a resource exists would leak information, "not found" is the correct response and the honest message is generic. Decide which case you are in deliberately.

6. Overflow: test with ugly data

The data in the design file is always tidy. Real data is not.

  • A name with 200 characters, and one with an emoji, and one in a right-to-left script.
  • A list with 0, 1, 2 and 10,000 items. Virtualise beyond a threshold and pick the threshold deliberately.
  • A number with 11 digits, a negative, a zero, a null.
  • A field that is legitimately empty versus one that failed to load — those must not look the same.
  • The longest translated string, if you have translations.

Seed a fixture with all of this and keep it. It catches more layout bugs than any amount of reviewing the tidy version.

7. In flight and after

  • Disable the control and show it working. A button that can be pressed twice will be.
  • Give feedback within ~100ms of the press, even if the work takes longer.
  • Confirm success in a way that survives: a toast that vanishes in three seconds is not a receipt. For anything consequential, the state of the page should show it.
  • Optimistic updates need a visible, non-destructive rollback. If you show it as done before it is, you must be able to take it back clearly.

8. Destructive actions: prefer undo to confirm

Confirm dialogs are dismissed reflexively and stop working after the third one. An undo window is better for almost everything that can be soft-deleted.

Where a confirmation is genuinely required, make it specific — name the thing being deleted and what else goes with it — and never make the destructive button the default focus.

9. Write the copy at the same time as the state

The copy is the state. A state designed without its words gets "Error" by default, and a placeholder that ships. Put the actual sentence in the design.

Keep it plain, in the second person, and about the user's situation rather than the system's internals. "We couldn't reach the server" tells them nothing they can act on; "You're offline — your work is saved here and will sync" does.

Checklist

  • The state matrix written out for each screen, with a decision per row
  • Three empty states distinguished, each with an action
  • Skeletons over spinners; space reserved; a way out beyond ~10 seconds
  • Errors say what happened, what it means and what to do
  • Input never lost on error or navigation
  • Denied handled as its own state, or deliberately made generic to avoid leaking
  • Tested with an ugly-data fixture: long, empty, huge, zero, null, RTL
  • In-flight controls disabled; success visible in page state, not just a toast
  • Optimistic updates have a visible rollback
  • Undo preferred over confirm; confirmations name the thing
  • Real copy written for every state, not placeholders

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.