Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    lawful-ui: Make Your UI Obey the Law

    1

    Your agent builds UI that follows 30 Laws of UX and 20 Laws of UI, and audits existing screens with measured evidence and a prioritized fix list.

    Free

    7 usesSecurity scanned
    lawful-ui: Make Your UI Obey the Law

    lawful-ui: Make Your UI Obey the Law

    Example session with this skill installed

    Please test this sign-up page: http://127.0.0.1:8765/violations.html

    • Read your context and instructions
    • Compiled the lawful-ui

    Summary

    Excerpt from a real run, translated from Indonesian (the request was made in Indonesian, and the skill reports in the user's language). The complete report, with all 23 findings and the coverage table for all 50 laws, is at https://github.com/SandroDuarsa/lawful-ui/blob/main/demo/sample-report.md

    This page is not ready to ship. A paid add-on is ticked by default, and sign-up never visibly completes: the most prominent button is dead, and the "OK" button accepts an empty form and then shows the empty form again with no message. On a phone the content runs 757 px past the screen and zoom is blocked. Fix the pre-ticked insurance first (F-01), then the submit flow with its validation and confirmation (F-02, F-03).

    CriticalHighMediumLow
    28103

    UX score: 18 / 100 · UI score: 31 / 100

    Evidence: the running page in a browser at 1280 × 800 and 375 × 812, measured with the bundled probe, plus real clicks, typing, Tab, submit, and reload.

    Findings (3 of 23)

    F-01 Premium insurance (Rp 49,000) is ticked by default: Critical

    • Component: S1-C14 · Where: form#signup > label > input[type=checkbox]
    • Law: L04 Cognitive Bias
    • Evidence (measured): checked = true when the page loads, and again after every reload and submit.
    • Impact: a user who does not notice pays Rp 49,000 for something they did not choose.
    • Fix: remove the checked attribute and offer insurance as an explicit choice at the payment step.

    F-03 Three competing buttons; the most prominent one does nothing: High

    • Component: S1-C16 · Where: button.btn-a, button.btn-b, button.btn-c

    Law: L10 Hick's Law, L28 Von Restorff Effect, L15 Law of Similarity, L17 Mental Model, L06 Doherty Threshold, U01 Visual Hierarchy, U07 Color System, U10 Consistency

    • Evidence (measured):
    ButtonSizeStyleBehaviour
    OK56.2 × 36 pxred, radius 4the only type=submit
    Daftar Sekarang162.7 × 42.5 pxblue, bold, radius 20click: 0 DOM changes, no navigation within 1 second
    Lanjut56.7 × 30 pxgreen, radius 0same, dead

    Impact: users press the largest button, nothing happens, and they have to guess that the red "OK" is the sign-up button.

    • Fix: keep one primary button (type=submit, 44 px tall) and remove "OK" and "Lanjut".

    F-08 Keyboard focus is invisible: High

    • Component: all controls · Where: CSS rule button:focus, input:focus, a:focus { outline: none; }
    • Law: U14 Focus Visibility

    Evidence (measured): Tab passes 38 stops; 36 of them have outline-style: none with nothing in its place. It takes 19 Tab presses to reach the first field.

    • Impact: keyboard users cannot tell which control they are on, while Enter submits the form.
    • Fix: remove that rule and add :focus-visible { outline: 2px solid #1a56db; outline-offset: 2px }.

    Law coverage

    SetPASSWARNFAILN/A
    30 Laws of UX18192
    20 Laws of UI1982

    Fix order

    1. F-01: remove the pre-ticked insurance. It is one line and it concerns the user's money.
    2. Change the form to method="post" so the password does not appear in the URL.
    3. F-02 and F-03: one working sign-up button, per-field validation, and a confirmation page.
    4. F-05: remove the fixed 1100 px width and the zoom block so the page works on phones.

    Not tested

    Page speed (the page was served from localhost), behaviour on a real touch device, screen readers, and text at 200% zoom. The full report says what each would need.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    lawful-ui gives your agent two sets of laws and two ways to use them.

    The laws

    • 30 Laws of UX: Fitts's Law, Hick's Law, Jakob's Law, Miller's Law, the Peak-End Rule, and the rest, restated as test criteria.
    • 20 Laws of UI: visual hierarchy, alignment, spacing, typography, color, contrast, touch targets, interactive states, focus visibility, form layout, motion, responsive layout. Drawn from WCAG 2.2, Apple's Human Interface Guidelines, and Material Design 3.

    Build mode

    Loads whenever you ask the agent to create or change an interface. You do not have to mention UX. The agent builds to the laws from the start: one primary action per view, full-size touch targets, a spacing and type scale, contrast that passes, labelled fields, every state designed, a layout that works at 320 px, no dark patterns. For a new screen it checks its own work and closes with a short "Lawful check" note.

    It sets constraints, not a style. Your brand, palette, and layout stay yours, and an existing design system wins wherever it meets the thresholds.

    Test mode

    Loads when you ask the agent to test, QA, audit, or review an interface. It lists every component on every screen, measures it, checks each one against the laws that apply, and writes a report: findings ordered by severity, each with evidence, the cost to the user, and one concrete fix. The report also has a coverage table for all 50 laws, a UX score and a UI score, and a list of what could not be tested and why.

    It works on a running app, on source code alone, or on screenshots, and labels each finding by where the evidence came from.

    What is in the package

    • SKILL.md: the two modes.
    • references/: the build rules, the test workflow, both sets of laws, checklists per component type, and guides for web and for Android, iOS, Flutter, and React Native.
    • scripts/ux_probe.js: reads a web page and reports target sizes, contrast failures, form-field problems, pre-ticked boxes, spacing scale, alignment, removed focus outlines, image problems, and blocked zoom. It only reads the page.
    • scripts/ux_checks.js: dead-control test, focus check, state rules, grayscale and text-spacing views.
    • scripts/serve.py: serves the scripts, and optionally a page on disk, on localhost only.
    • scripts/android_targets.py: reads an Android view-hierarchy dump and reports tap targets under 48 dp.
    • assets/report-template.md: the report format.

    No API keys and nothing to install. The scripts send no data anywhere.

    Limits

    It is a heuristic audit. It finds likely problems and does not replace testing with real users. Build mode has been tried on web; mobile frameworks are covered by guidance and are less tested.

    Open source under MIT: https://github.com/SandroDuarsa/lawful-ui

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for UX & UI Design.

    A heuristic audit: it finds likely problems and does not replace testing with real users. Measured results need a browser tool that can run JavaScript (web) or a view-hierarchy dump (Android); otherwise findings are read from code or screenshots and labelled as inferred. There is no measuring script for iOS yet. Build mode has been tried on web; mobile frameworks are covered by guidance and are less tested. Not for backend-only, API, or unit-test work with no user interface.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    7 uses

    Times used to date

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 6 days ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Read Files
    Browser
    Network Access
    Write Files

    Read and write files: reading your UI code, writing UI in Build mode, saving the report. Terminal: running the optional Python helper scripts. Browser and network: only to load the page you ask it to test; serve.py listens on localhost only. The scripts send no data anywhere.

    Listed6 days ago

    What's inside

    Frequently Asked Questions

    A plain review is the agent's opinion. lawful-ui has the agent list every component, measure it (target sizes, contrast, spacing, focus, form fields), and check it against 50 named laws. Each finding cites a law, a location, and its evidence, and the same checks run every time.

    Any agent that reads the SKILL.md standard. The laws apply to any interface. Measured audits are strongest on web, where a script reads the rendered page, and on Android, where a script reads the view-hierarchy dump. iOS, Flutter, and React Native are covered by guidance for measuring from screenshots and source code.

    SKILL.md, the build rules, the test workflow, both sets of laws as test criteria, checklists per component type, platform guides, four helper scripts, and the report template. It is free and open source under the MIT license.

    Yes. The skill's instructions are in English, and the agent writes the report in the language you ask in. It recognises Indonesian requests such as "tolong testing halaman ini". Law names and status words stay in English so they can be looked up.

    For measured results: a browser tool that can run JavaScript in the page (web), or an adb view-hierarchy dump (Android). Without either, it reads your source code or screenshots and labels those findings as inferred. On a live production site it keeps to read-only actions and asks before submitting any form.

    New versions are published on GitHub (github.com/SandroDuarsa/lawful-ui) and uploaded here. The laws follow lawsofux.com, WCAG 2.2, Apple's Human Interface Guidelines, and Material Design 3.

    New in UX & UI Design

    Free