cuj-screenshots
Skill1 starsChanged 3 months agoApache-2.0View on GitHub
Capture Critical User Journey (CUJ) screenshots and GIFs from web apps using headless Chromium. Use when you need to create visual demos, verify UI changes, or document user flows.
- Commits and pushes
In this repository13 other files it gives its agents.
- humanizer/AGENTS.mdAGENTS.md
- aaif-notebooklm-syncSkill
- asciinema-explainer-walkthroughsSkill
- developer-trends-intelSkill
- diagram-designSkill
- elixir-best-practicesSkill
- engineering-disciplineSkill
- humanizerSkill
- intent-refinementSkill
- manim-video-qualitySkill
- opm-trackingSkill
- storybookSkill
- ui-developerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Before sharing work with humans ("here's what it looks like now")
- Distinctive: line 29
When finishing UI work, don't just say "done" — capture CUJs, update the GIFs, and share:
- Distinctive: line 59
Create a Python script for each journey:
- Very specific: line 162
Wait times: Use wait_for_timeout(1000) after interactions for animations
- Very specific: line 163
Selectors: Prefer text= or has-text() over fragile CSS selectors
- Very specific: line 165
Naming: Use numbered prefixes (01-, 02-) for sort order
- Distinctive: line 166
GIF size: Keep under 500KB for GitHub README display
- Very specific: line 170
Create a docs/CUJs.md file to document each journey with embedded GIFs:
- Distinctive: line 205
After making UI changes:
- Distinctive: line 206
Run the CUJ capture scripts
- Distinctive: line 208
If they look correct, update GIFs and commit
- Very specific: line 209
Update CUJs.md if steps changed
- Distinctive: line 210
If something's wrong, you caught a bug!
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CUJ Screenshots Skill
Automate visual documentation of web app user journeys using headless browser automation.
When to Use This
Always run CUJ captures after UI changes. This is part of the dev loop, not just documentation.
Triggered By:
- Any frontend component change
- CSS/styling updates
- New features that affect user flow
- Bug fixes that change visible behavior
- Before sharing work with humans ("here's what it looks like now")
The Loop:
Make UI change → Run CUJs → Review screenshots →
├─ Looks good? → Update GIFs, commit, share link
└─ Looks wrong? → Fix bug, repeatProactive Use:
When finishing UI work, don't just say "done" — capture CUJs, update the GIFs, and share:
"Updated the task card styling. Here's the new CUJ: https://github.com/user/repo/blob/main/docs/CUJs.md"
This gives your human instant visual feedback without them needing to run the app.
What It Does
- Launches headless Chromium via Playwright
- Navigates through a defined user journey
- Captures screenshots at each step
- Stitches screenshots into an animated GIF
- Outputs to a docs folder for commit
Requirements
- Playwright:
uv run --with playwright python script.py - Chromium: Auto-installed by Playwright on first run
- ImageMagick: For GIF creation (
convertcommand)
Install Playwright browsers (one-time):
uv run --with playwright playwright install chromiumQuick Start
1. Define Your CUJ
Create a Python script for each journey:
import asyncio
from playwright.async_api import async_playwright
import os
async def capture_my_cuj():
output_dir = "/tmp/cuj-screenshots/my-cuj"
os.makedirs(output_dir, exist_ok=True)
async with async_playwright() as p:
browser = await p.chromium.launch(headless=True)
context = await browser.new_context(
viewport={"width": 390, "height": 844}, # Mobile
device_scale_factor=2 # Retina
)
page = await context.new_page()
# Step 1
await page.goto("http://localhost:5173")
await page.wait_for_timeout(1500)
await page.screenshot(path=f"{output_dir}/01-initial.png")
# Step 2: Interact
await page.click("button:has-text('Submit')")
await page.wait_for_timeout(1000)
await page.screenshot(path=f"{output_dir}/02-submitted.png")
# ... more steps
await browser.close()
if __name__ == "__main__":
asyncio.run(capture_my_cuj())2. Run Capture
uv run --with playwright python my_cuj.py3. Create GIF
convert -delay 150 -loop 0 /tmp/cuj-screenshots/my-cuj/*.png output.gif-delay 150= 1.5 seconds per frame (hundredths of a second)-loop 0= infinite loop
4. Commit & Share
mv output.gif docs/gifs/my-cuj.gif
git add docs/gifs/my-cuj.gif docs/CUJs.md
git commit -m "docs: add my-cuj GIF"
git pushViewport Presets
| Device | Width | Height | Scale |
| iPhone 12 Pro | 390 | 844 | 2 |
| iPhone SE | 375 | 667 | 2 |
| Pixel 5 | 393 | 851 | 2.75 |
| Desktop | 1280 | 720 | 1 |
| Desktop HD | 1920 | 1080 | 1 |
Common Interactions
# Click button by text
await page.click("button:has-text('Submit')")
# Fill input
await page.fill("input[name='email']", "test@example.com")
# Select dropdown
await page.select_option("select#plan", "premium")
# Wait for element
await page.wait_for_selector(".success-message")
# Scroll
await page.evaluate("window.scrollBy(0, 300)")
# Keyboard shortcut
await page.keyboard.press("Escape")Full Workflow Example
See scripts/capture-cujs.py for a complete example that:
- Starts backend + frontend servers
- Captures multiple CUJs
- Generates GIFs
- Updates CUJs.md
Tips
- Wait times: Use
wait_for_timeout(1000)after interactions for animations - Selectors: Prefer
text=orhas-text()over fragile CSS selectors - Error handling: Wrap interactions in try/except, screenshot on error
- Naming: Use numbered prefixes (
01-,02-) for sort order - GIF size: Keep under 500KB for GitHub README display
CUJs.md Documentation
Create a docs/CUJs.md file to document each journey with embedded GIFs:
# Critical User Journeys (CUJs)
## CUJ 1: App Tour
**Goal:** Navigate the main app layout.
**Steps:**
1. Open app → Activity tab
2. Switch to Live tab
3. Return to Activity

---
## CUJ 2: Create Task
**Goal:** Create a new plan and task.
**Steps:**
1. Click "+ Plan"
2. Enter name, submit
3. Click "+ Task"
4. Enter name, submit
This serves as both documentation and visual regression baseline.
Verifying UI Changes
After making UI changes:
- Run the CUJ capture scripts
- Review the new screenshots (you can read image files!)
- If they look correct, update GIFs and commit
- Update
CUJs.mdif steps changed - If something's wrong, you caught a bug!
Full Workflow
# 1. Make UI changes
# 2. Start servers
# 3. Capture CUJs
uv run --with playwright python scripts/capture-cujs.py
# 4. Review screenshots (agent can view these)
# 5. Create GIFs
convert -delay 150 -loop 0 /tmp/cuj-screenshots/cuj1/*.png docs/gifs/cuj1.gif
# 6. Update CUJs.md with new steps/descriptions
# 7. Commit everything
git add docs/CUJs.md docs/gifs/
git commit -m "docs: update CUJ screenshots after UI changes"
git pushDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

