.mux/skills/generate-readme-screenshots/SKILL.md
Regenerate high-resolution README screenshots from Storybook stories. Use this skill when Chromatic detects visual diffs in any story under "Docs/README Screenshots", or when story data/layout changes require updated documentation assets. Triggers on: Chromatic visual regressions in readme screenshot stories, changes to App.readmeScreenshots.stories.tsx, changes to mockFactory.ts that affect screenshot stories, or explicit user request to update README images.
npx skillsauth add coder/mux generate-readme-screenshotsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The README screenshots in docs/img/*.webp are not manually captured — they are
deterministically generated from Storybook stories defined in
src/browser/stories/App.readmeScreenshots.stories.tsx. When any of these stories
change visually (detected by Chromatic or local inspection), the corresponding WebP
assets must be regenerated and committed.
# 1. Build Storybook
make storybook-build
# 2. Serve the static build (keep running in background)
python3 -m http.server 6006 -d storybook-static &
# 3. Capture all screenshots (3800px, WebP quality 90)
bun run scripts/capture-readme-screenshots.ts
# 4. Capture a single story
bun run scripts/capture-readme-screenshots.ts --story CodeReview
The capture pipeline requires these tools. If any are missing, stop immediately and report the issue to the user with full detail — do not silently skip or produce degraded output.
| Dependency | Purpose | Check command |
| :----------- | :------------------------------------- | :------------------------------- |
| bun | Script runtime | bun --version |
| playwright | Headless browser automation | bun -e "require('playwright')" |
| sharp | Image processing (resize, WebP) | bun -e "require('sharp')" |
| python3 | Static file server for Storybook build | which python3 |
Before running the pipeline, verify all dependencies:
bun --version && \
bun -e "require('playwright'); require('sharp'); console.log('deps ok')" && \
which python3
If any of these fail:
playwright: bun add -d playwright && bunx playwright install chromiumsharp: bun add -d sharppython3: suggest installing Python or using an alternative static serverbun: this is a hard requirement — the entire repo uses bun| Parameter | Value |
| :------------------------ | :------------------------------------- |
| CSS Viewport | 1900 × 1188 |
| Device Scale Factor (DPR) | 2 |
| Native capture resolution | 3800 × 2376 |
| Output format | WebP (quality 90, lanczos3 resampling) |
| Output directory | docs/img/ |
| Story Export Name | Output File | Has Interaction |
| :------------------------ | :------------------------ | :------------------------------ |
| CodeReview | code-review.webp | No |
| AgentStatusSidebar | agent-status.webp | No |
| GitStatusPopover | git-status.webp | Yes (open dialog + toggle mode) |
| PlanMermaidWithCosts | plan-mermaid.webp | No |
| CostsTabRich | costs-tab.webp | No |
| ContextManagementDialog | context-management.webp | Yes (open settings dialog) |
| MobileServerMode | mobile-server-mode.webp | No |
| OrchestrateAgents | orchestrate-agents.webp | No |
| File | Role |
| :------------------------------------------------------ | :----------------------------------------- |
| src/browser/stories/App.readmeScreenshots.stories.tsx | Story definitions and mock data |
| scripts/capture-readme-screenshots.ts | Playwright + Sharp capture pipeline |
| src/browser/stories/mockFactory.ts | Deterministic mock data factories |
| src/browser/stories/mocks/orpc.ts | Mock ORPC backend (terminal, git, secrets) |
| docs/img/*.webp | Output screenshot assets |
make storybook-build
This produces storybook-static/ in the repo root.
The capture script expects Storybook at http://localhost:6006. Use a background
bash task (not nohup or & in foreground) so the server survives:
# As a background bash task with ~10min lifetime
python3 -m http.server 6006 -d storybook-static
Verify the server is reachable:
bun -e "const r = await fetch('http://localhost:6006'); console.log(r.status)"
Important:
curlmay succeed whenbun fetchfails (different DNS resolution). Always verify withbun -e "fetch(...)"since the capture script uses bun's fetch.
bun run scripts/capture-readme-screenshots.ts --storybook-url http://localhost:6006
The script:
networkidle + 2s stabilizationplayInteraction if defined (with up to 3 retries for flaky interactions)docs/img/<outputFile>Stories with playInteraction (GitStatusPopover, ContextManagementDialog)
can be flaky under sequential load due to UI timing. The script retries each up to
3 times. If failures persist:
# Retry individual failed stories
bun run scripts/capture-readme-screenshots.ts --story GitStatusPopover
bun run scripts/capture-readme-screenshots.ts --story ContextManagementDialog
# Check all 8 files are present and 3800px wide
for f in code-review agent-status git-status plan-mermaid costs-tab context-management mobile-server-mode orchestrate-agents; do
bun -e "const s = require('sharp'); const m = await s('docs/img/${f}.webp').metadata(); console.log('${f}:', m.width + 'x' + m.height)"
done
# Stage and commit
git add docs/img/*.webp
git commit -m "regenerate README screenshots at 3800px"
Docs/README Screenshots storyApp.readmeScreenshots.stories.tsx or mockFactory.tsThe capture script verifies Storybook is reachable before starting. Ensure:
make storybook-build completed successfullybun -e "fetch('http://localhost:6006')" (not just curl)Radix popovers/tooltips portal to document.body and require precise hover timing.
The retry logic handles most cases. If persistent:
--story <Name>)capture-readme-screenshots.ts (1900×1188, DPR 2)fullPage) — if content overflows the
viewport, the story layout needs adjustment, not the capture scriptStoryDef interface supports a postProcess hook for custom Sharp pipelines
if a future story needs cropping/compositing, but no current stories use itIntentional — README now uses mux-demo.gif as the hero media. The README
screenshot pipeline covers only the 9 docs/img/*.webp assets that remain in
README, starting with code-review.webp.
testing
Testing doctrine, commands, and test layout conventions
data-ai
Terminal-Bench integration for Mux agent benchmarking and failure analysis
development
Guidelines for when to use (and avoid) useEffect in React components
documentation
Guidelines for creating and managing Pull Requests in this repo