@mushi-mushi/ux 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Kenji Sakuramoto / Kensaurus 合同会社
3
+ Copyright (c) 2026 kensaurus LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # @mushi-mushi/ux
2
2
 
3
- > **Your AI wrote it. Mushi tells you why it broke.**
3
+ > **Your AI built it. Mushi Mushi makes it better.**
4
4
 
5
- Find the UX problems on every screen of your app before your users do, and let the coding agent you already pay for fix them one screen at a time. Every change is measured. Only the ones that help are kept, on a branch you review. Part of [Mushi Mushi](https://github.com/kensaurus/mushi-mushi).
5
+ For people who build with an AI coding agent and keep hearing that a screen is cramped, unreadable or broken on a phone. This [Mushi Mushi](https://github.com/kensaurus/mushi-mushi) tool finds the UX problems on every screen of your app before your users do, and lets the coding agent you already pay for fix them one screen at a time. Every change is measured. Only the ones that help are kept, on a branch you review.
6
+
7
+ You need your app running locally and a coding agent you are signed in to (Claude Code or the Cursor CLI; Codex and Cursor Cloud are not yet verified). A Mushi Mushi account is only needed to mirror runs to the console or file reports.
6
8
 
7
9
  ```bash
8
10
  npx @mushi-mushi/ux ui # the studio on 127.0.0.1: pick agent, model and pages, then watch each attempt
@@ -15,13 +17,13 @@ flowchart LR
15
17
  subgraph local["Your computer"]
16
18
  S["Studio on 127.0.0.1<br/>mushi ux ui"] --> R["Run: map screens,<br/>agent edits, measure"] --> B["Branch mushi-ux/run-id<br/>kept changes only"]
17
19
  end
18
- R -. "--sync mirrors the run" .-> C["Mushi console<br/>review every screen"]
20
+ R -. "--sync mirrors the run" .-> C["Mushi Mushi console<br/>review every screen"]
19
21
  B --> P["Draft PR"] --> C
20
22
  C --> M["Merge"]
21
23
  ```
22
24
 
23
25
  1. **Studio (your computer).** `mushi ux ui` opens a page on 127.0.0.1. Pick the agent, model, skill and pages, then watch each attempt live.
24
- 2. **Console (mirror and review).** With sync on, the run is mirrored to the [console](https://kensaur.us/mushi-mushi/admin) as it goes. The studio offers sync when you are signed in with the Mushi CLI; from the terminal, add `--sync`. **Review in console** on a run opens it there, screen by screen.
26
+ 2. **Console (mirror and review).** With sync on, the run is mirrored to the [console](https://kensaur.us/mushi-mushi/admin) as it goes. The studio offers sync when you are signed in with the Mushi Mushi CLI; from the terminal, add `--sync`. **Review in console** on a run opens it there, screen by screen.
25
27
  3. **Merge.** Open the kept changes as a draft PR from the studio, then merge it from the console (after a confirmation) or on GitHub. Nothing is merged for you.
26
28
 
27
29
  ## Quick start
@@ -71,7 +73,8 @@ With `--steps` (on by default in the studio) the agent first plans 2–5 small c
71
73
  | `mushi-ux ui` | The studio: start runs and watch them |
72
74
  | `mushi-ux run --dev "<cmd with {port}>"` | Run the loop from the terminal |
73
75
  | `mushi-ux discover --url <url>` | List the screens, change nothing |
74
- | `mushi-ux audit --url <live url> --profile-dir <dir>` | Find UX bugs on signed-in screens and file them as Mushi reports (below) |
76
+ | `mushi-ux audit --url <live url> --profile-dir <dir>` | Find UX bugs on signed-in screens and file them as Mushi Mushi reports (below) |
77
+ | `mushi-ux scorecard --url <live url> --profile-dir <dir>` | Score every page 1–10 on a written UX rubric and file the root causes (below) |
75
78
  | `mushi-ux explore --url <live url> --profile-dir <dir>` | Let a model use the signed-in app like a careless user; file the errors a replay confirms (below) |
76
79
  | `mushi-ux fresh-eyes --url <landing> --goal "<text>"` | Try one goal as a first-time visitor; time the path and file what stops them (below) |
77
80
  | `mushi-ux login --url <url>` | Sign in once, in a visible browser |
@@ -88,11 +91,11 @@ With `--steps` (on by default in the studio) the agent first plans 2–5 small c
88
91
  | `--sync` | off | Mirror the run to the console (`mushi ux` passes your login) |
89
92
  | `--no-judge` / `--no-preflight` / `--no-dashboard` | — | Skip the review, the agent check, or the local dashboard |
90
93
 
91
- Run state and screenshots live in `.mushi/ux/<runId>/`. The run adds its folders to `.git/info/exclude`, so `git status` stays clean. `--sync` refuses a run whose app reports to a different Mushi project than your login.
94
+ Run state and screenshots live in `.mushi/ux/<runId>/`. The run adds its folders to `.git/info/exclude`, so `git status` stays clean. `--sync` refuses a run whose app reports to a different Mushi Mushi project than your login.
92
95
 
93
96
  ## Audit signed-in screens
94
97
 
95
- `mushi-ux audit` checks the live app the way a signed-in user sees it and files what is wrong as Mushi reports, so the fix loop picks them up. It never edits code and never opens a fresh browser: point it at a cached, signed-in profile.
98
+ `mushi-ux audit` checks the live app the way a signed-in user sees it and files what is wrong as Mushi Mushi reports, so the fix loop picks them up. It never edits code and never opens a fresh browser: point it at a cached, signed-in profile.
96
99
 
97
100
  ```bash
98
101
  mushi-ux audit --url https://example.com/admin \
@@ -106,6 +109,25 @@ mushi-ux audit --url https://example.com/admin \
106
109
  - `--profile-dir` opens the profile with your installed Chrome (`--channel chromium` for one Chromium made). A signed-out profile stops the run: sign it in once by hand.
107
110
  - Output: `~/.cache/mushi/ux-audits/<run>/` (summary, findings, screenshots).
108
111
 
112
+ ## Score every page: the UX scorecard
113
+
114
+ `mushi-ux scorecard` scores each page of the live app 1–10 against a written rubric, groups what is wrong into root causes, and can file the top causes as Mushi Mushi reports (ADR 0067).
115
+
116
+ ```bash
117
+ mushi-ux scorecard --url https://example.com/admin/ \
118
+ --profile-dir ~/.playwright-cli-profiles/example \
119
+ --paths-file pages.txt --sync --file --dry-run
120
+ ```
121
+
122
+ - **The rubric:** clarity, hierarchy and density, consistency with the app's own pages, states (loading, empty, error, locked), truthfulness (does the page claim what its own data contradicts), copy, accessibility and speed. A page's score follows its worst dimension. The settle time and axe cap the speed and accessibility scores.
123
+ - **What it reads:** the tab title, headings, visible text (with banners outside the content), controls, a screenshot about a second into the load and one once the page settles, the settle time and axe. It never clicks, only navigates.
124
+ - **Pages:** `--path` (repeatable) or `--paths-file`, else the routes in your source (`--routes-from <dir>`), else a crawl under the URL. `/team?view=sso` and `/team?view=billing` are two pages. A console with its own nav registry should pass that list as `--paths-file`; `--routes-from` reads route files and `<Route path>` literals, and misses views kept in the query string.
125
+ - **Who scores:** `--score-via server` (default) sends each page to Mushi, which uses your app's AI key, then Mushi's. `claude-code`, `cursor` or `anthropic-api` score on your machine.
126
+ - **The viewport:** desktop first, 1440×900. Set it per app on the console, or pass `--viewport 390x844`.
127
+ - **Root causes:** problems that come from one shared thing (a component, a banner, a status rule) become one cause with every page it touches. So do two pages that disagree about the same fact. `--file` files at most 5 causes a run, one report per cause. A cause that is already open only gets its pages refreshed.
128
+ - **`--from-captures <dir>`** scores captures another browser driver wrote as `<dir>/pages/<page>/{facts.json, early.png, settled.png}`. Use it when the signed-in profile is already open in another browser.
129
+ - **Output:** `scorecard.md` and `scorecard.json` in the run folder. `--sync` shows the run on the console (UX runs → Scorecard), with each page's trend across runs.
130
+
109
131
  ## Explore signed-in screens
110
132
 
111
133
  `mushi-ux explore` runs short sessions where a model picks what a curious or careless user would do next (forms with odd input, back and reload mid-task, double-clicks, filters that match nothing), in the same read-only browser and cached profile as the audit. The model only chooses actions; code decides what is a bug.
@@ -134,7 +156,7 @@ mushi-ux fresh-eyes --url https://example.com --goal "get my first report" \
134
156
  - **Time to first value** is the app's wait (each action, navigation and settle) plus reading time for each new screen (238 words a minute, at most a minute a screen), until the goal check passes: `--success-url`, `--success-text`, `--success-selector` or `--success-api` (all given must hold). The model's think time is recorded but never counted.
135
157
  - **Measured findings**, filed once a replay of the steps without the model shows them again: console and page errors, a 5xx, a blank page, a dead end, a sign-in it cannot pass, a captcha (never solved), a step that needs an inbox, an API key, a terminal or another account. **Opinions** ("confusing", "unclear copy", "too many choices", giving up) are filed only when 2 of the sessions (`--sessions`, default 3) name the same screen.
136
158
  - **Writes** reach only the start URL's origin and `--app-host` hosts. Payments, third-party sign-in, public sign-up endpoints (`/auth/v1/signup`, OTP, recovery) and anything labelled delete, revoke, upgrade or sign out are refused in every mode. `--dry-run` writes nothing, uses no account and files nothing.
137
- - **Accounts:** the model types `{{email}}` and `{{password}}`; code fills in `MUSHI_FRESH_EYES_EMAIL` / `MUSHI_FRESH_EYES_PASSWORD` (your app's test account) or, for Mushi itself, `--mint-account` (an operator key; the account is flagged synthetic and deleted after a day). The real values never reach the prompt, the timeline or the console.
159
+ - **Accounts:** the model types `{{email}}` and `{{password}}`; code fills in `MUSHI_FRESH_EYES_EMAIL` / `MUSHI_FRESH_EYES_PASSWORD` (your app's test account) or, for Mushi Mushi itself, `--mint-account` (an operator key; the account is flagged synthetic and deleted after a day). The real values never reach the prompt, the timeline or the console.
138
160
  - **Terminal setup:** `--terminal` runs a CLI setup step itself when a screen asks for a terminal: a sample app in a temp folder, the setup command (`--setup-command`, `{projectId}` and `{apiKey}` filled from the screen), one report through the widget, each phase timed.
139
161
  - What the model reads: the page's main content first, then its navigation, never a control a mouse user cannot see. A window a click opens on the app (a sign-in popup) is followed. A wait that hits its 20 s cap is marked on its step and never counted as the app's time. `--steps` defaults to 30, or 60 with a test account; the minted account's user id is in the log and timeline (never its password).
140
162
  - Output: `timeline.md` (each step, its screenshot, app wait and reading time, where it stalled), `result.json` and `shots/`. `--out <dir>` chooses the folder. `--sync` mirrors the run to the console's First-time user test page (a `--dry-run` too, marked "look around only"). `--request-stdin` reads the run (its id, start page, goal, visitors and test accounts) as JSON on stdin: how a local worker runs a test the console queued, so nothing it was given sits in argv.