/aictrl:ux-testingfrom aictrl
Runs AI-driven usability tests on web pages or HTML prototypes using Playwright, producing scorecards and before/after reports. Tester agents see only the accessibility tree or screenshots for honest feedback.
Ships in aictrl. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Measure whether a first-time user can complete real tasks in a UI, find out where they get stuck, and improve the UI with evidence. Testers are subagents that see only what a screen reader would: the page's accessibility tree. That keeps them honest about what the UI actually communicates and doubles as an accessible-name check. Vision testers see only screenshots, which catches what the tree hides: the fold, icon-only controls and visual hierarchy.
npm i -D playwright && npx playwright install chromium) and run the scripts with NODE_PATH=<that directory>/node_modules, or install it next to the skill. The scripts load playwright or playwright-core only from the skill's own location or NODE_PATH, never from the current directory, so a prototype you are testing cannot plant code in them.summarize.py and score.py. A YAML task model needs PyYAML (pip install pyyaml) in Python and js-yaml (npm i -D js-yaml) for the simulator; or write the task model as JSON.SKILL below means the directory this file is in.
Ask only for what is missing.
Target. An HTML file or a URL. For a page behind sign-in, use a test account: pass UX_SETUP=<module.cjs> (exports async (page, context) => {} that signs in; the simulator takes the same module as setup) or UX_STORAGE_STATE=<state.json>. Never test against real customer data.
Persona. One line on who the tester is, e.g. "a clinic manager using this booking app for the first time, with no documentation". Default: "a first-time user of this product, with no documentation".
Tasks. 4–8 outcome tasks for one flow (see reference/tester-brief.md). For a UI that serves several roles, or when variants will be compared, write a task model instead: roles, objectives, weighted tasks with success and must-not checks (reference/task-model.md).
Success checks. One per task that changes state: a JavaScript expression evaluated in the tester's page that returns a value. Either
window.__state = state; // test hook, read-only), e.g. (() => ({ success: window.__state.orders.some((o) => o.status === 'paid') }))(); or(() => ({ success: !!document.querySelector('[data-order-status="paid"]') }))().For an app with a backend you can also check the API or database from your own shell. Question tasks ("which order is late?") are graded from the tester's answer.
(umask 077; openssl rand -hex 24 > <token-file>) # once: the verify token, in a private file outside the repository
UX_TARGET=path/to/page.html UX_OUT=<scratch dir outside the repository> UX_VERIFY_TOKEN="$(cat <token-file>)" node $SKILL/scripts/server.cjs # run in the background
node $SKILL/scripts/ux.cjs t0 open && node $SKILL/scripts/ux.cjs t0 snapshot | head -40 # smoke test
verify.cjs and the operator-only actions need a verify token. Best: generate it into a private file once, as above, and pass it by reference (UX_VERIFY_TOKEN="$(cat <token-file>)") to the server, verify.cjs and operator ux.cjs calls, so the value never appears in a command, a transcript or shell history, and the server never prints it. Otherwise the server generates one and prints it once, and any captured server output then holds a copy. Never put the token or its file in a tester brief.UX_OUT receives actions.jsonl and screenshots. Without it the server makes a new temp directory and prints the path. Never point it inside the repository.UX_PORT (default 3917) sets the harness port; export the same value for every ux.cjs and verify.cjs call, including in tester briefs. UX_VIEWPORT (default 1440x900) sets the default window.UX_HIDE_CSS hides prototype chrome real users would not see (state switchers, design notes). UX_SCENARIO_SEL names a <select> that jumps a prototype to a named state, so you can pre-open a session mid-flow with ux.cjs <session> open <scenario>.$TMPDIR/ux-harness-<uid>/<port>.token (mode 0600, inside a 0700 per-user directory; the file is removed when the server exits); ux.cjs reads it. Evaluating checks needs the second, verify token, which the harness never writes to disk. Requests with an Origin or Referer header (anything a browser sends) are rejected, so a web page cannot drive a signed-in session. Typed text is redacted in the log. The tokens keep tester agents, which are given only ux.cjs, to tester commands; they are not a defence against other programs running as your user. Stop the server when the run ends.reference/tester-brief.md and a unique session id each (T1-t1, T1-t2, T1-c1, …). Add 1 vision tester per task when the layout or the fold matters. This is the sampling rule in reference/task-model.md too.UX_VERIFY_TOKEN="$(cat <token-file>)" node $SKILL/scripts/ux.cjs <session> open <scenario>. Add --viewport 390x844 for a phone or --viewport 1366x768 for a laptop. Opening with a scenario or viewport, re-opening a live session, errors and close are operator-only: the harness refuses them without the verify token, so one tester cannot reset, read or close another's session.UX_VERIFY_TOKEN="$(cat <token-file>)" node $SKILL/scripts/verify.cjs <check.js> <sessions…>, or from the answer for question tasks. Testers do claim success falsely, especially after a control that only looks like it worked.python3 $SKILL/scripts/summarize.py $UX_OUT/actions.jsonl), not the tester's own count.UX_VERIFY_TOKEN="$(cat <token-file>)" node $SKILL/scripts/ux.cjs <session> errors.python3 $SKILL/scripts/score.py <model.yaml> results.json $UX_OUT/actions.jsonl --out scorecard.json (success by task and role, weighted cost J).Present the baseline scorecard (success per task for novice and control, median commands, top friction points, any false successes caught by the checks) and ask whether to continue into the fix loop. Do not edit the target before the user approves.
design-review skill to screenshots of every state (desktop, 390px phone, and dark theme if the product has one) plus the baseline evidence. When the target spans several screens, require a cross-screen lens: a concept inventory, one name per concept, one place per job, one vocabulary for state and action. Single-screen review misses the costliest problems, such as the same state under four names. The reviewer confirms or refines each tester finding, adds its own, and separates plain fixes from product decisions (each with a recommendation).ui-polish skill. It then re-checks: no page errors, unique accessible names that start with the visible label, no control under 24px.When a change is a bet about layout, prominence, wording or the fold ("moving Start above the approvals will stop mis-approvals"), screen it with simulated users before spending agent runs: node $SKILL/scripts/simulate.cjs --config sim.config.json --hyp H.json compares two variants on the tasks the change could help or hurt, focused and on a laptop-sized screen, with a 90% interval on the difference. Confirm clear or risky results with agent testers in two arms (3 hurried vision testers each, same viewport), then apply the change and record the hypothesis and its evidence in the task model. Details, config and limits: reference/simulator.md.
The simulator needs a fast System One model that returns probabilities over choices: TypeSafe's Jev (TYPESAFE_API_KEY), or a compatible endpoint (UX_SIM_ENDPOINT, UX_SIM_API_KEY, UX_SIM_MODEL) that follows the contract in reference/simulator.md. The user supplies the selected provider's key in the command environment outside chat. Do not search their machine, read .env files, or retrieve an installer's credentials. The TypeSafe key is sent only to https://api.typesafe.ai/v1/systemone. A custom endpoint needs its own separately supplied key issued by that endpoint's provider; never reuse another vendor's key. Requests include screen state and questions, reject redirects, and do not forward keys to aictrl.
If simulate.cjs exits with "Simulator not configured", tell the user: the simulator is optional; they can get a TypeSafe API key at https://typesafe.ai or configure a compatible System One endpoint; local models are not supported yet. Then continue with agent testers only. Never ask the user to paste a key into the chat, and never echo, log or write one.
Write a before/after scorecard:
When the results go beyond this session, build the visual report in reference/visual-report.md: the version story, experiments replayed on the real screens with click clouds (scripts/replay.cjs), and the progression. Ask the user to confirm the product decisions, then record them where the team tracks work.
wait calls; tell testers to wait and re-snapshot.UX_VERIFY_TOKEN="$(cat <token-file>)" node $SKILL/scripts/ux.cjs <session> close; at most 32 are open at once) and restart the harness between batches of about 6 testers; Chromium otherwise crashes ("Target crashed") under memory pressure. Void and re-run those sessions; say how many were voided.Built by aictrl.dev. This skill teaches the workflow; aictrl operationalizes it — grounded in your backlog, team standards, and codebase knowledge graph. See how →
reference/simulator.md (opens in a new tab)reference/task-model.md (opens in a new tab)reference/tester-brief.md (opens in a new tab)reference/visual-report.md (opens in a new tab)scripts/common.cjs (opens in a new tab)scripts/replay.cjs (opens in a new tab)scripts/score.py (opens in a new tab)scripts/server.cjs (opens in a new tab)scripts/simulate.cjs (opens in a new tab)scripts/summarize.py (opens in a new tab)scripts/ux.cjs (opens in a new tab)scripts/verify.cjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
17 skills in this plugin
/code-reviewReview the exact head revision of a pull request for actionable correctness, security, reliability, performance, and test findings without modifying code. Use when the user says "review this PR", "do a code review", "find defects in this change", or provides a pull or merge request identifier./create-bugCreate an evidence-backed bug report with reproduction, expected and actual behavior, impact, code context, and a regression-test requirement. Use when the user says "file a bug", "report this defect", "turn these symptoms into a ticket", or describes broken or regressed behavior./create-issueCreate a code-grounded engineering story or task with scope, acceptance criteria, test expectations, risks, and open questions. Use when the user says "create an issue", "open a ticket", "make a backlog item", or describes a feature or chore that should be tracked; delegate defects to create-bug.npx claudepluginhub aictrl-dev/skills --plugin aictrlOther plugins' skills for the same job