Audit Front-End Code Against Web Interface Guidelines

A SKILL.md that reviews your React, Vue, Svelte or HTML components against 15 checkable interface rules and lists each problem as file:line with a suggested fix.

Skill prompt for Claude Code and Codex

Prompt

Installs to .agents/skills/audit-front-end-code-against-web-interface-guidelines/

mkdir -p .agents/skills/audit-front-end-code-against-web-interface-guidelines && curl -sL "https://prompts-gpt.com/prompts/audit-front-end-code-against-web-interface-guidelines/raw" -o .agents/skills/audit-front-end-code-against-web-interface-guidelines/SKILL.md
SKILL.md
Preview
---
name: audit-front-end-code-against-web-interface-guidelines
description: "A SKILL.md that reviews your React, Vue, Svelte or HTML components against 15 checkable interface rules and lists each problem as file:line with a suggested fix."
---

# Audit Front-End Code Against Web Interface Guidelines

A SKILL.md that reviews your React, Vue, Svelte or HTML components against 15 checkable interface rules and lists each problem as file:line with a suggested fix.

## Prompt

```
---
name: ui-guidelines-audit
description: Reviews front-end code (React, Vue, Svelte or plain HTML and CSS) against a fixed set of web interface rules and reports each violation as file:line with a fix. Use when asked to "audit the UI", "review my UI code", "check this against web interface guidelines", "UX review of these components" or "is this page accessible". Not for critiquing screenshots or visual style.
---

# UI guidelines audit

## Scope

1. If no files or routes were named, audit the files changed on this branch: `git diff --name-only main...HEAD`, keeping component, page and style files.
2. Read each file in full before judging it. Skip generated files and vendored libraries.

## Rules

Keyboard and focus
- Every clickable element is a button, link or form control, never a div with a click handler.
- Focus is visible; an outline is only removed when a replacement style exists.
- Dialogs and menus move focus in, trap it, close on Escape and return focus on close.

Forms
- Every input has a visible label or an accessible name, the right `type`, and `autocomplete` where it applies.
- Errors appear next to the field, are announced, and keep what the user typed.
- Submit shows progress and blocks double submits once a request starts.

States and content
- Every async view has loading, empty and error states.
- Long names, long words and missing images do not break the layout.
- Dates, numbers and currency use `Intl` formatting.

Media
- Images set width and height or aspect-ratio, and have useful alt text (empty alt when decorative).

Motion
- Animations honour `prefers-reduced-motion` and animate transform or opacity.

Layout
- Usable at 320 px wide with no sideways scroll; touch targets at least 24 by 24 px.
- Full-bleed mobile layouts respect safe-area insets.

Navigation
- Filters, tabs and pagination live in the URL; navigation uses real links so open-in-new-tab works.

Colour
- Text contrast at least 4.5:1 in every theme; colour is never the only signal.

## Output

Findings grouped by file, one per line: `path:line - rule - what is wrong - fix`. Then a count per rule, and the three fixes with the most user impact. Write "passes" for clean files. Do not edit files unless asked.

## Stop and ask

- More than 40 files in scope: propose a subset first.
- A fix changes the design (colour, spacing, layout): list it, do not apply it.
```

## Usage Notes

Save as .claude/skills/ui-guidelines-audit/SKILL.md. Works in Claude Code, and Codex, Cursor or Gemini CLI from .agents/skills/. Ask: "audit the checkout components". For a full WCAG checklist, pair it with Create a WCAG 2.2 AA Accessibility Audit Checklist.

Example output

Example for: "audit the checkout components" in a React app, 4 files changed on the branch.

src/checkout/AddressForm.tsx

  • src/checkout/AddressForm.tsx:42 - accessible name - the postcode input has a placeholder but no label - add a <label htmlFor> or aria-label "Postcode"
  • src/checkout/AddressForm.tsx:58 - autocomplete - street input has no autocomplete - add autocomplete="address-line1"
  • src/checkout/AddressForm.tsx:91 - double submit - the Continue button stays active while the request runs - disable it and show "Saving..." until the promise settles

src/checkout/CouponModal.tsx

  • src/checkout/CouponModal.tsx:17 - dialog focus - focus stays on the page behind the modal - move focus to the code input on open and back to the trigger on close
  • src/checkout/CouponModal.tsx:23 - clickable div - the close icon is a div with onClick - use a <button aria-label="Close">

src/checkout/OrderSummary.tsx

  • src/checkout/OrderSummary.tsx:30 - number formatting - total is built as "$" + total.toFixed(2) - use Intl.NumberFormat with the store currency
  • src/checkout/OrderSummary.tsx:64 - long text - product names overflow at 320 px - add min-width: 0 to the flex child and allow wrapping

src/checkout/checkout.css - passes

Count per rule: accessible name 1, autocomplete 1, double submit 1, dialog focus 1, clickable div 1, number formatting 1, long text 1.

Top three fixes by user impact

  1. Block double submits on Continue (duplicate orders).
  2. Label the postcode input (screen reader users cannot complete the form).
  3. Fix focus in the coupon modal (keyboard users get stuck behind it).
Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Every rule can be checked by reading the code, so findings point to a line instead of giving general UX advice.
  • Defaulting to the files changed on the branch keeps the review the size of a pull request.
  • Separating fixes that change the design from fixes that only change behaviour stops the agent restyling your app.

Save as .claude/skills/ui-guidelines-audit/SKILL.md. Works in Claude Code, and Codex, Cursor or Gemini CLI from .agents/skills/. Ask: "audit the checkout components". For a full WCAG checklist, pair it with Create a WCAG 2.2 AA Accessibility Audit Checklist.

Common edits

  • Add your design system's own rules, such as "use the Button component, never a raw button", under a new heading.
  • Point it at a deployed URL instead and have the agent open the page in a browser tool for the focus and 320 px checks.

Reuse it: Use in a workflowAdapt in the builder

More in Design
Design

Create Accessible Keyboard Navigation Maps for Complex Web Layouts

Generate a logical, WCAG-compliant keyboard navigation sequence for complex web components to ensure full usability for screen reader and keyboard-only users.

Design

Audit mobile forms for keyboard friction

Identify mismatched mobile keyboards, missing autocomplete attributes, and form fields that slow down mobile completion.

Design

Audit mobile screens for thumb reach

Evaluate mobile UI layouts to fix out-of-reach controls, tight tap targets, and accidental mis-taps on handheld devices.

Design

Check mobile layouts against dynamic font scaling

Review mobile UI against dynamic font scaling and accessibility text sizes. Use it to catch truncated text, clipped buttons, and broken navigation before handoff.

Design

Create a WCAG 2.2 AA Accessibility Audit Checklist

Receive a structured accessibility audit checklist for complex interactive components based on WCAG 2.2 AA standards.

Design

Build a Button and Form Field States Reference Sheet in a Single HTML File

Get a polished, single-file reference sheet that shows button and text field states side by side, with a live playground and contrast ratios computed from design tokens.