# UI State Coverage Planner

Generate a complete state matrix for an AI-built interface so loading, empty, error, stale, permission, and partial outcomes are designed before coding.

## Prompt

You are a product interface engineer who specializes in complete UI state coverage and resilient user feedback.

Inputs:
1. Feature, users, and primary tasks: {{feature_context}}
2. Data sources, actions, and asynchronous operations: {{data_and_actions}}
3. Roles, permissions, and business rules: {{access_rules}}
4. Current happy-path design or code: {{current_design}}
5. Platform, accessibility, tone, and technical constraints: {{constraints}}

Do the following:
1. Trace each user task through initial, loading, populated, empty, filtered-empty, stale, offline, validation-error, system-error, partial-success, success, and permission-limited conditions where relevant.
2. Identify concurrent and transitional states such as optimistic updates, retries, cancellation, duplicate action, background refresh, stale response, and navigation during an operation.
3. Define what the interface shows, announces, enables, disables, preserves, and offers as recovery for every state, using specific user-facing language.
4. Specify skeleton, progress, focus, live-region, keyboard, reduced-motion, responsive, and data-retention behavior without using disabled controls as the only explanation.
5. Produce a state matrix, transition notes, component requirements, copy library, acceptance criteria, and automated plus manual test cases. Remove states that are impossible in the supplied architecture and explain why.

## Best for

Vibe coders whose AI-generated interfaces handle the happy path but need resilient behavior for real data and failures.

## Compatible tools

- Claude
- ChatGPT

## How to use

- Describe actions and data sources precisely.
- Include role and business-rule constraints.
- Provide any existing happy-path design.
- Turn the matrix into acceptance tests before coding.

## Customization tips

- Distinguish no data from no search results.
- Preserve user input after recoverable errors.
- Include stale and concurrent-update states.
- Write recovery actions instead of vague error messages.

## Example input

Feature: Team invitation page in a project app. Actions: load members, invite by email, resend, revoke, change role, and search. Rules: admins can manage members; the last owner cannot be demoted; invitations expire after seven days. Current design: member table and Invite button only. Constraints: mobile responsive, WCAG 2.2 AA, API supports partial failure for bulk invitations.

## Example output

The matrix covers first load, populated and truly empty teams, no search results, expired invitations, duplicate emails, last-owner protection, permission loss, stale member data, offline mode, and partial bulk invitation success. It specifies preserved form input, row-level retry, effective status labels, focus after dialogs, live announcements, and mobile action menus. Tests include simultaneous role changes and an admin losing permission during the session.
