Create, update or audit an app's user stories, story map, screen/flow inventory, architecture-by-topic diagram or screenshot journeys (iOS, Android, web) from one stories.yaml. Use for 'story map', 'user stories', 'what is actually built', 'screen inventory', or whenever a feature or screen changes and docs/story-map must stay in sync.
3 stars
0 votes
0 copies
3 views
Added October 17, 2026
developmentpythongogit
Works with
cli
Security analysis
A92/100
mediumInstalls packages at runtime which could introduce malicious dependencies
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of User Story Maps?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/enjojoy-user-story-maps)
---
name: user-story-maps
description: "Create, update or audit an app's user stories, story map, screen/flow inventory, architecture-by-topic diagram or screenshot journeys (iOS, Android, web) from one stories.yaml. Use for 'story map', 'user stories', 'what is actually built', 'screen inventory', or whenever a feature or screen changes and docs/story-map must stay in sync."
---
# User story maps
One `stories.yaml` → `REPORT.md`, HTML viewer, topic architecture and one-pager with real screenshots in device frames. Free tools, nothing uploaded.
## When
Use: app docs, "what is built" audit, gap planning, after any user-visible change. Skip: backlog tracking, pixel-perfect design.
**Do this first:** run `init docs/story-map --agents`. It adds a block to the repo's `AGENTS.md` (or `CLAUDE.md`) that tells coding agents to keep the map updated; without it they will not. No such file yet? Use `--agents AGENTS.md` to create one. `validate` warns when none mentions the map.
`<skill>` = the folder containing this `SKILL.md`. Run the bundled generator with `python3 <skill>/scripts/storymap.py`; a skill-only install works. In a clone of the repo, it is `skills/user-story-maps/scripts/storymap.py`.
The `--agents` block sits between markers, so running `init --agents` again updates it and never overwrites the rest of the file.
## Workflow
1. `python3 <skill>/scripts/storymap.py init docs/story-map --agents`. Fill `app` (note commit read), 2–4 `personas`.
2. Define 4–7 `topics`; every flow gets `topic:`.
3. Inventory screens from code (router, components, routes) incl. empty/error/paywall/permission states; `edges:` per flow.
4. Capture screenshots → `image:`; impossible → `not_captured: <why>`.
5. One story per user goal, start `unverified`; promote only what you checked.
6. `theme-from <app-source>` → `theme:`. Gaps, dead ends, risks → `gaps:`.
7. `validate [--strict]` → fix → `build` → open `generated/story-map.html` and `architecture.png`. Check cross-topic arrows against real navigation; isolated topics need edges. Report what is `unverified` and why.
Consider `validate --strict` in CI.
After edits: `validate && build`. Append new items with unique ids; screens need a flow edge and ≥1 story. Overwrite screenshots. Renamed id = find/replace; `validate` lists misses.
## Commands
`DIR` = story-map folder (default: script folder, `docs/story-map`, cwd).
| Command | Does |
|---|---|
| `init [DIR] [--vendor] [--agents [FILE]]` | Create folder + `.gitignore`; vendor script; update AGENTS.md/CLAUDE.md (`FILE` creates it) |
| `validate [DIR] [--strict]` | Exit 1 on errors (`--strict`: warnings too) |
| `build [DIR] [--profile lean\|full] [--formats LIST] [--clean] [--embed-fonts] [--no-graphviz] [--strict] [--force]` | Validate, then write `generated/` |
| `status [DIR]` | Counts per status / flow / persona |
| `set-status [--dir DIR] [--no-build] US-03 built --verified "app, 2026-10-15"` | Edit one story in place (keeps comments), rebuild |
| `theme-from APP_SOURCE [--limit N]` | Read-only scan of colours/fonts → draft `theme:` |
- `init` does not copy `storymap.py` into the app repo; `init --vendor` does (then run `./storymap.py`).
- From a clone of the repo, try the bundled examples: `python3 skills/user-story-maps/scripts/storymap.py build examples/wikipedia-ios` (dark) or `build examples/open-golf` (light).
## Build outputs (`generated/`)
| Format | File | Default |
|---|---|---|
| `report` | `REPORT.md`: counts, topics, stories, gaps, image links; each fact once | yes |
| `html` | `story-map.html`: one file, filters, search, click for details, system fonts, screens ≤ 480 px | yes |
| `arch` | `architecture.png`: topic swimlanes | yes |
| `onepager` | `one-pager.png`: status, topics, top gaps, all screens | yes |
| `pdf`, `crops` | `one-pager.pdf`, `architecture/<topic>.png` | opt-in |
| `flows`, `overview`, `flow-map` | `flows/<flow>.png`, `overview.png`, `flow-map.png` (skipped > 300 MP) | opt-in |
| `csv`, `mermaid`, `dot` | `user-stories.csv`, `mermaid/*.mmd`, `dot/*.dot` | opt-in |
| `legacy-md` | old `story-map.md`, `user-stories.md`, `gaps-and-risks.md` | `full` only |
- `--formats a,b` replaces the set; `+csv,flows` / `-onepager` edit the profile; `--profile full` = everything.
- `--clean` deletes superseded files inside `generated/` only; without it they are listed. Graphviz thumbnails go to `<DIR>/.cache/` (gitignored). No `generated/README.md`.
- Details: [`references/outputs.md`](references/outputs.md).
## stories.yaml
One value per line, 2-space indent, `- ` items, `#` comments, `[a, b]` lists; quote values containing `: `. PyYAML if installed, else built-in subset parser.
| Section | Fields |
|---|---|
| `app` | `name`, `platform` (ios/android/web), `version`, `checked`, `summary`, `disclaimer`, `device`, `agents_check` |
| `theme` | optional → [`references/theme.md`](references/theme.md) |
| `topics[]` | `id`, `title`, `description`, `color` (override), `order` |
| `personas[]` | `id`, `name`, `as_a`, `description` |
| `flows[]` | `id`, `title`, `description`, **`topic`**, `edges: ["from -> to: action"]` (label starting `(` = dashed) |
| `screens[]` | `id`, `title`, `flow`, `image` (relative), `not_captured`, `notes`, `where`; overrides: `status`, `topic`, `device` |
| `stories[]` | `id`, `persona`, `want`, `so_that`, `screens: [ids]`, `status`, `verified`, `where`, `notes`; overrides: `story`, `flow`, `topic` |
| `gaps[]` | `id`, `severity` (high/medium/low), `title`, `detail`, `where`, `stories: [ids]` |
- Sentence: "As a {persona.as_a}, I want {want} so that {so_that}." (`want` starts "to …"); `story:` replaces it.
- Defaults: story topic = its first screen's flow topic; screen topic = flow topic; screen status derives from its stories.
| Status | Meaning |
|---|---|
| `built` | Verified in code or running app. `verified:` = how/when (`"code + app, 2026-10-15"`); `where:` = file/PR/endpoint |
| `partly` | Incomplete; `notes` says what is missing |
| `unverified` | Not confirmed (default) |
| `missing` | Not built / planned |
- `validate` errors: missing/duplicate id, unknown refs/topic, bad edge/status/severity/colour, no `want`/`story`, `built` without `verified:`, absolute or `..` image path. Warnings: unused/orphan items, missing screenshot without `not_captured`, `built` without `where:`, `long-field`, `repeated-text` (same ≥ 40-char text in ≥ 3 items), `AGENTS_MISSING` (no repo instruction file mentions the map; silence with `app.agents_check: off`). Full list: [`references/outputs.md`](references/outputs.md).
## Rules
- Never `built` without `verified:`. Unsure → `unverified`. Dead button, stub, untested flagged feature ≠ built.
- Code and app disagree → say so in `notes`. Bump `app.checked` on re-verify. Keep fields short, say things once (the validator warns).
- `stories.yaml` is the only source; never hand-edit `generated/`; commit it.
- Topics, standard set (list order = swimlane order): `onboarding`, `access`, `journey`, `library`, `settings`, `payments`, `support`.
- Never retouch screenshots. Demo account only: no real names, emails, tokens, absolute paths, internal URLs. Third-party app → `app.disclaimer`.
## Mobile friendly viewer
`story-map.html` must work on a phone. After any change to the viewer (`storymap.py` HTML/CSS/JS):
- Check it at 390 px wide: no horizontal page scroll, tap targets ≥ 44 px, screen detail view usable (full-screen, scrolls, close button reachable).
- Never remove the viewport meta or block pinch-zoom (`user-scalable=no`). One self-contained file, no external requests.
- Verify: `python3 <skill>/scripts/check_viewer.py docs/story-map/generated/story-map.html [--shots DIR]` (needs `pip install playwright && playwright install chromium`; checks 390 and 360 px, exit 1 on failure).
## Looks (all outputs)
Details: [`references/looks.md`](references/looks.md), [`theme.md`](references/theme.md), own frame PNG [`frames.md`](references/frames.md).
- **Theme from the app:** `theme-from` scans tokens; only `primary` required; app font + palette everywhere.
- **Dark mode:** `background:` < 30% luminance or `mode: dark` → black page/lanes, light text, lifted colours, titanium frames.
- **Device frames:** every screenshot framed (iPhone island/notch/home button, Android, tablet, browser, `none`); auto-detected, override with `device:`.
- **No white cards:** device, title, status badge sit on the lane/page background.
- **Topic swimlanes:** `architecture.png` = one coloured lane per topic in `order`, screens in an aligned grid, thick labelled cross-topic arrows.
- **Tree layout:** 2+ outgoing edges → trunk, orthogonal bus, aligned children centred on the parent.
- **Resolution:** screenshots ≥ native pixels (zoom reads all text); never downscaled, the canvas grows. Only HTML embeds reduced copies.
- **Huge images in a repo or PR:** ship one GitHub-friendly preview (≤ ~8000 px wide, e.g. `architecture-preview.png`) plus the full-resolution original as a download link. Never split an image into tiles.
## Capture
Files: `docs/story-map/screens/<screen-id>.png`, one device size per app. More: [`references/capture-details.md`](references/capture-details.md).
| Platform | Helper |
|---|---|
| iOS Simulator | `<skill>/scripts/capture/ios-simulator.sh <id> [-o DIR] [-d "iPhone 16"] [-u deep-link] [-w SECS] [-m light\|dark]` |
| Android | `<skill>/scripts/capture/android-emulator.sh <id> [-o DIR] [-s serial] [-u deep-link] [-w SECS] [-n]` |
| Web | `<skill>/scripts/capture/web-playwright.py --base-url URL --shots capture.json [--out DIR] [--scale 2] [--dark] [--storage-state FILE]` |
## Repo layout and tests
```
skills/user-story-maps/SKILL.md workflow, schema, rules; references/: outputs, looks, theme, frames, capture-details
scripts/ editable source: generator, check_viewer.py (phone check), capture helpers (iOS, Android, web)
templates/ editable source: stories.yaml skeleton, README, AGENTS and .gitignore snippets
skills/user-story-maps/scripts/ bundled copies of scripts/ (generator, check_viewer.py, capture helpers)
skills/user-story-maps/templates/ bundled copies of templates/
examples/ wikipedia-ios (dark), open-golf (light)
tests/ tiny fixture in tests/fixtures/sample-app; test_skill_bundle.py checks copy sync and first run; test_mobile_viewer.py checks the phone viewer
```
- Run tests: `python3 -m unittest discover -s tests`. Numpy-based checks are skipped when `numpy` is missing.
## Dependencies and gotchas
- Python 3.8+. Optional: Pillow (all images), PyYAML, fontTools+brotli (`--embed-fonts`), Graphviz (only without Pillow), mermaid-cli.
- `google_font` is off by default. When true, the font is downloaded once (the tool's only network request) and cached in `~/.cache/storymap/fonts`, never in the repo. The bundled examples set it to false and ship their fonts.
- "no stories.yaml found" → pass the folder. "multi-line … not supported" → one line per value or install PyYAML. Images skipped → install Pillow. Dashed screen → no image or its stories are `missing`.