@mushi-mushi/ux 0.0.0-stage → 0.1.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kenji Sakuramoto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,90 @@
1
- # Temporary Holding Version
1
+ # @mushi-mushi/ux
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > **Your AI wrote it. Mushi tells you why it broke.**
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).
6
+
7
+ ```mermaid
8
+ flowchart LR
9
+ subgraph local["Your computer"]
10
+ 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"]
11
+ end
12
+ R -. "--sync mirrors the run" .-> C["Mushi console<br/>review every screen"]
13
+ B --> P["Draft PR"] --> C
14
+ C --> M["Merge"]
15
+ ```
16
+
17
+ 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.
18
+ 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.
19
+ 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.
20
+
21
+ ## Quick start
22
+
23
+ ```bash
24
+ mushi ux ui # through the Mushi CLI: passes your login, so runs show in the console
25
+ npx @mushi-mushi/ux ui # or standalone
26
+ mushi ux run --dev "pnpm dev --port {port}" --agent cursor --model <id> --skill enhance-mobile-native-feel
27
+ ```
28
+
29
+ Your app must run locally. `{port}` is replaced with a spare port. Signed-in app? Run `mushi-ux login --url http://localhost:5173` once and sign in by hand; later runs reuse that session with `--login-url`.
30
+
31
+ ## What a run does
32
+
33
+ 1. Checks the agent can start and read a file (about a minute), so a signed-out agent fails before anything slow.
34
+ 2. Creates a git worktree on a new branch `mushi-ux/<run>` and starts your dev server there. Your own checkout is never touched.
35
+ 3. Maps the app: every page, plus the tabs, dialogs and menus each one opens.
36
+ 4. For each screen: screenshots it at phone and desktop width and measures accessibility (axe), sideways scrolling, tap targets under 24×24 px, console errors and layout shift. The agent gets the screenshots, the problems and your design tokens.
37
+ 5. After each attempt it re-measures. The edit is **kept** as a commit if nothing got worse and something changed, otherwise **rolled back** with the reason for one more try. Screens already done are re-checked, and any that moved are marked **regressed**.
38
+ 6. Optionally, a second model compares each changed screen before and after. Its review is advisory and never keeps or reverts anything.
39
+
40
+ With `--steps` (on by default in the studio) the agent first plans 2–5 small changes per screen, then makes one per attempt. A stopped run (closed laptop, Stop, crash) shows **Resume** and continues from the first unfinished screen: `mushi-ux run --resume <runId>`.
41
+
42
+ ## Safety
43
+
44
+ - **Exploring never writes.** Every non-GET request is blocked, forms are never submitted, and buttons like Delete, Pay, Send and Log out are never clicked. If your app reads with POST (Supabase `rpc`, GraphQL), allow it: `--allow "POST /rest/v1/rpc/*"`.
45
+ - **The agent never sees your session or keys.** Credentials are stripped from its environment except its own model key. Claude Code runs with no shell and only the worktree's files.
46
+ - **Your dev server** runs without this tool's keys (`CURSOR_API_KEY`, `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GITHUB_TOKEN`, `MUSHI_*`). Put app secrets in the app's ignored `.env` files; those are copied into the worktree.
47
+ - **What reaches the console:** phase, screens, scores, problem counts, screenshots, and the names of files read or edited. The agent's words, its commands and their output stay in `.mushi/ux/<run>/agent/`.
48
+ - Use a test account if your dev server talks to production data.
49
+
50
+ ## Agents
51
+
52
+ | `--agent` | Needs | Status |
53
+ | --- | --- | --- |
54
+ | `claude-code` (default) | `claude` on PATH | Verified on Windows |
55
+ | `cursor` | Cursor CLI (`agent`), signed in with `agent login` | Verified on Windows |
56
+ | `codex` | `codex` on PATH | Unverified |
57
+ | `cursor-cloud` | `CURSOR_API_KEY` and an `origin` on GitHub | Unverified |
58
+
59
+ `mushi-ux models --agent <name>` lists the models your account can use. `--skill` takes a name from [kensaurus/skills](https://github.com/kensaurus/skills) (`mushi-ux skills` lists them) or a path to a skill folder. Without one, the agent gets built-in UX guidance. On Windows, start runs from PowerShell or cmd: a Claude Code hook that fails under Git Bash makes the Cursor CLI refuse every file read, and the start-up check says so.
60
+
61
+ ## Commands and options
62
+
63
+ | Command | What it does |
64
+ | --- | --- |
65
+ | `mushi-ux ui` | The studio: start runs and watch them |
66
+ | `mushi-ux run --dev "<cmd with {port}>"` | Run the loop from the terminal |
67
+ | `mushi-ux discover --url <url>` | List the screens, change nothing |
68
+ | `mushi-ux login --url <url>` | Sign in once, in a visible browser |
69
+ | `mushi-ux models` / `mushi-ux skills` | What `--model` and `--skill` accept |
70
+ | `mushi-ux open <runId>` | The local dashboard for a past run |
71
+
72
+ | `run` option | Default | What it does |
73
+ | --- | --- | --- |
74
+ | `--max-surfaces` / `--iterations` / `--timeout` | 10 / 2 / 10 min | Screens, attempts per screen, minutes per attempt |
75
+ | `--base <ref>` | `HEAD` | Branch from this ref, e.g. `origin/main` |
76
+ | `--path <path>` | — | Work only on these pages (repeatable) |
77
+ | `--ignore <selector>` | — | Not your UI (a dev badge): hidden and skipped. Or mark it `data-mushi-ux-ignore` |
78
+ | `--install <cmd>` | from lockfile | Monorepos: also build workspace packages, e.g. `"pnpm install --frozen-lockfile && pnpm turbo run build --filter=<app>^..."` |
79
+ | `--sync` | off | Mirror the run to the console (`mushi ux` passes your login) |
80
+ | `--no-judge` / `--no-preflight` / `--no-dashboard` | — | Skip the review, the agent check, or the local dashboard |
81
+
82
+ 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.
83
+
84
+ ## On GitHub Actions
85
+
86
+ Copy [`docs/templates/mushi-ux.yml`](https://github.com/kensaurus/mushi-mushi/blob/master/docs/templates/mushi-ux.yml) to `.github/workflows/mushi-ux.yml` and set its `dev-command`. Start it from the Actions tab, or with **Run in the cloud** on the console's [UX runs](https://kensaur.us/mushi-mushi/docs/admin/ux-runs) page. It uses `cursor-cloud`, sees the app signed out, and opens one draft PR. Its pushes go to `mushi-ux/**`, so add `branches-ignore: ['mushi-ux/**']` to any CI that runs on every push.
87
+
88
+ ## License
89
+
90
+ MIT