Skill: ux-flows
Draws how the user moves through a UI-touching feature — after clarify, before design. For
each UI-touching §4 user story it produces a mermaid flowchart (happy path + the alt/error
branches the §5 ACs demand), builds the screen inventory (SCR-NN — the id contract screens
details later), and maps every UI-touching AC to the flow/branch that shows it. The artifact is
always markdown + mermaid whatever docs/design-system.md picks as the drawing tool — flows
are flow-altitude, not visual design. design then reads it as evidence for the
target-surface + UI-architecture decisions (the formal target_surfaces declaration stays
design's); sequences aligns UI-driven flows on the SCR ids; plan-tests takes the
e2e-through-UI paths from here.
This stage is optional by surface, not by size: its N/A condition (no human-facing UI) lives in
../_shared/size-matrix.md and is evaluated by clarify's handoff
(specify's when clarify was legally skipped). Invoked directly, it always runs.
Question phrasing → ../_shared/ask-style.md; each diagram is confirmed
in prose, never as raw mermaid → ../_shared/diagram-presentation.md.
Flow labels + prose follow artifact_language — mermaid keywords, SCR ids and AC ids stay English
→ ../_shared/artifact-language.md.
Owner
PM + designer (or whoever owns the user experience). The PM confirms each flow matches a real user
story; the Tech Lead flags flows that imply architecture (they become design input, not decisions
here).
Inputs
<slug> — feature slug.
- Gate (hard-refuse if missing):
docs/features/<slug>/spec.md — the flows derive from §4 user
stories + §5 ACs. Absent → STOP: «run specify <slug> first — ux-flows derives from its user
stories».
- (Expected)
docs/design-system.md — the platform posture (the default platform assumption) +
the tool. Absent → not a block: work in code-mode assumptions, recommend
/sdd:design-system in the handoff.
- (Optional)
CONTEXT.md (both levels, per-feature wins) — canonical roles for the actors.
- (Optional)
docs/features/<slug>/.size / .route — depth + handoff resolution; absent → default
M / standard and say so in the handoff.
Protocol
- Gate + read.
test -f docs/features/<slug>/spec.md → missing = refuse with the pointer
above. Read spec §1 (context), §4 (user stories — which touch a UI?), §5 (ACs), CONTEXT.md
glossary, and docs/design-system.md (posture + tool; note its absence for the handoff).
- Set the depth dial + platform. Read
interview_depth from .claude/sdd.local.md (else
medium); unless --depth= was passed, ask ONE depth-selection AskUserQuestion per
../_shared/ask-style.md, then confirm the platform posture in
the same call (second question): the design-system posture as «(Recommended)», deviation
allowed + recorded with its why. Depth governs the per-flow question volume
(→ ../_shared/interview-depth.md); coverage never shrinks.
- Derive flows + inventory. For every UI-touching §4 user story: one flow — happy path +
an alt/error branch per relevant §5 AC. Collect every screen the flows visit into the
Screen inventory (
SCR-NN + purpose/entry/exit); flow nodes reference the SCR ids. A
backend-only user story is listed as out of scope, not drawn.
- Socratic pass — prose, never raw mermaid. Per
../_shared/diagram-presentation.md: write each flow into
docs/features/<slug>/ux-flows.md (from ./templates/ux-flows.md),
validate it parses per ../_shared/mermaid-check.md, then
describe it in plain words (every branch) and confirm — at medium/hard one AskUserQuestion per
flow (Accept / Fix / Save-as-OQ / Drop); at easy, write + one-line summary into the
assumptions ledger and proceed.
- Fill the AC map + write + commit. Complete the AC-coverage table (every UI-touching §5 AC →
flow/node/branch, or an explicit
N/A: <reason>), re-validate every mermaid block, stamp
updated_at, propose commit ux-flows: <slug>.
- Structural self-check — per
../_shared/self-check.md: re-read
the file from disk and verify 4 items: (1) every UI-touching §4 user story has a flow;
(2) every flow node's SCR id exists in the inventory (and every inventory row appears in ≥1
flow); (3) every UI-touching §5 AC appears in the coverage table with a flow/branch or an
explicit N/A; (4) every mermaid block parses. Fix + re-check ≤2 cycles; surface anything
unresolved.
- Handoff. Emit the stage-handoff block per
../_shared/handoff.md
— What I did (incl. «self-check: 4/4 pass»; + «docs/design-system.md absent — run
/sdd:design-system» when it was) + Review (docs/features/<slug>/ux-flows.md) + Run next:
/clear, then /sdd:design <slug> (it reads these flows as target-surface evidence).
Definition of Done
docs/features/<slug>/ux-flows.md exists: platform decisions, the SCR-NN inventory, one flow per
UI-touching §4 user story (happy + AC-demanded branches), the AC-coverage table — zero silently
uncovered UI ACs.
- Every flow was confirmed in prose (or written + ledgered at easy); every mermaid block parses.
- No visual design leaked in: no component names, no layout, no styling — flow altitude only
(screens is where states + components live).
Anti-patterns
- Drawing screens here. Components, states, layout belong to
screens; this artifact is the
movement between screens, not their content.
- Deciding architecture here. «SPA vs SSR», «this needs a websocket» — flag it as design input;
design decides and declares target_surfaces.
- Raw mermaid as the confirmation prompt — the anti-pattern
diagram-presentation.md exists to kill.
- Skipping backend-only stories silently. List them as out of scope with one line — the reader
must see they were considered.
- Blocking on a missing design-system. Its absence degrades (code-mode assumptions + a handoff
recommendation), never blocks the flow work.
References & template
1---2name: ux-flows3description: Use to derive the user flows of a UI-touching feature after the spec is clarified — one mermaid flowchart per UI-touching §4 user story (happy + alt/error branches from §5 ACs), a screen inventory (SCR-NN ids), and an AC→flow map, written to docs/features/{slug}/ux-flows.md. Triggers on "ux flows for {slug}", "user flows for {slug}", "screen flow for {slug}", "/sdd:ux-flows {slug}", "юзер-флоу для {slug}", "потік екранів {slug}", "намалюй флоу користувача". Always markdown + mermaid regardless of the design tool; the Socratic pass confirms each flow in prose, never raw mermaid. Feeds design (target-surface evidence), sequences (SCR alignment), screens (the inventory) and plan-tests (e2e-through-UI paths). Hard-refuse if spec.md is missing; skipped for features with no human-facing UI.4---56# Skill: ux-flows78Draws **how the user moves** through a UI-touching feature — after `clarify`, before `design`. For9each UI-touching §4 user story it produces a mermaid `flowchart` (happy path + the alt/error10branches the §5 ACs demand), builds the **screen inventory** (`SCR-NN` — the id contract `screens`11details later), and maps every UI-touching AC to the flow/branch that shows it. The artifact is12**always markdown + mermaid** whatever `docs/design-system.md` picks as the drawing tool — flows13are flow-altitude, not visual design. `design` then reads it as **evidence** for the14target-surface + UI-architecture decisions (the formal `target_surfaces` declaration stays15`design`'s); `sequences` aligns UI-driven flows on the SCR ids; `plan-tests` takes the16e2e-through-UI paths from here.1718**This stage is optional by surface, not by size:** its N/A condition (no human-facing UI) lives in19[`../_shared/size-matrix.md`](../_shared/size-matrix.md) and is evaluated by `clarify`'s handoff20(`specify`'s when clarify was legally skipped). Invoked directly, it always runs.2122Question phrasing → [`../_shared/ask-style.md`](../_shared/ask-style.md); each diagram is confirmed23**in prose, never as raw mermaid** → [`../_shared/diagram-presentation.md`](../_shared/diagram-presentation.md).24Flow labels + prose follow `artifact_language` — mermaid keywords, SCR ids and AC ids stay English25→ [`../_shared/artifact-language.md`](../_shared/artifact-language.md).2627## Owner2829PM + designer (or whoever owns the user experience). The PM confirms each flow matches a real user30story; the Tech Lead flags flows that imply architecture (they become `design` input, not decisions31here).3233## Inputs3435- `<slug>` — feature slug.36- **Gate (hard-refuse if missing):** `docs/features/<slug>/spec.md` — the flows derive from §4 user37 stories + §5 ACs. Absent → STOP: «run `specify <slug>` first — ux-flows derives from its user38 stories».39- (Expected) `docs/design-system.md` — the platform posture (the default platform assumption) +40 the tool. **Absent → not a block**: work in `code`-mode assumptions, recommend41 `/sdd:design-system` in the handoff.42- (Optional) `CONTEXT.md` (both levels, per-feature wins) — canonical roles for the actors.43- (Optional) `docs/features/<slug>/.size` / `.route` — depth + handoff resolution; absent → default44 M / standard and say so in the handoff.4546## Protocol47481. **Gate + read.** `test -f docs/features/<slug>/spec.md` → missing = refuse with the pointer49 above. Read spec §1 (context), §4 (user stories — which touch a UI?), §5 (ACs), `CONTEXT.md`50 glossary, and `docs/design-system.md` (posture + tool; note its absence for the handoff).512. **Set the depth dial + platform.** Read `interview_depth` from `.claude/sdd.local.md` (else52 medium); unless `--depth=` was passed, ask ONE depth-selection `AskUserQuestion` per53 [`../_shared/ask-style.md`](../_shared/ask-style.md), then confirm the **platform posture** in54 the same call (second question): the design-system posture as «(Recommended)», deviation55 allowed + recorded with its why. Depth governs the per-flow question volume56 (→ [`../_shared/interview-depth.md`](../_shared/interview-depth.md)); coverage never shrinks.573. **Derive flows + inventory.** For every **UI-touching** §4 user story: one flow — happy path +58 an alt/error branch per relevant §5 AC. Collect every screen the flows visit into the59 **Screen inventory** (`SCR-NN` + purpose/entry/exit); flow nodes reference the SCR ids. A60 backend-only user story is listed as out of scope, not drawn.614. **Socratic pass — prose, never raw mermaid.** Per62 [`../_shared/diagram-presentation.md`](../_shared/diagram-presentation.md): write each flow into63 `docs/features/<slug>/ux-flows.md` (from [`./templates/ux-flows.md`](./templates/ux-flows.md)),64 validate it parses per [`../_shared/mermaid-check.md`](../_shared/mermaid-check.md), then65 describe it in plain words (every branch) and confirm — at medium/hard one `AskUserQuestion` per66 flow (Accept / Fix / Save-as-OQ / Drop); at **easy**, write + one-line summary into the67 assumptions ledger and proceed.685. **Fill the AC map + write + commit.** Complete the AC-coverage table (every UI-touching §5 AC →69 flow/node/branch, or an explicit `N/A: <reason>`), re-validate every mermaid block, stamp70 `updated_at`, propose commit `ux-flows: <slug>`.716. **Structural self-check** — per [`../_shared/self-check.md`](../_shared/self-check.md): re-read72 the file from disk and verify **4 items**: (1) every UI-touching §4 user story has a flow;73 (2) every flow node's SCR id exists in the inventory (and every inventory row appears in ≥174 flow); (3) every UI-touching §5 AC appears in the coverage table with a flow/branch or an75 explicit N/A; (4) every mermaid block parses. Fix + re-check ≤2 cycles; surface anything76 unresolved.777. **Handoff.** Emit the **stage-handoff block** per [`../_shared/handoff.md`](../_shared/handoff.md)78 — *What I did* (incl. «self-check: 4/4 pass»; + «`docs/design-system.md` absent — run79 `/sdd:design-system`» when it was) + *Review* (`docs/features/<slug>/ux-flows.md`) + *Run next*:80 `/clear`, then `/sdd:design <slug>` (it reads these flows as target-surface evidence).8182## Definition of Done8384- `docs/features/<slug>/ux-flows.md` exists: platform decisions, the SCR-NN inventory, one flow per85 UI-touching §4 user story (happy + AC-demanded branches), the AC-coverage table — zero silently86 uncovered UI ACs.87- Every flow was confirmed in prose (or written + ledgered at easy); every mermaid block parses.88- No visual design leaked in: no component names, no layout, no styling — flow altitude only89 (screens is where states + components live).9091## Anti-patterns9293- **Drawing screens here.** Components, states, layout belong to `screens`; this artifact is the94 movement between screens, not their content.95- **Deciding architecture here.** «SPA vs SSR», «this needs a websocket» — flag it as design input;96 `design` decides and declares `target_surfaces`.97- **Raw mermaid as the confirmation prompt** — the anti-pattern98 [`diagram-presentation.md`](../_shared/diagram-presentation.md) exists to kill.99- **Skipping backend-only stories silently.** List them as out of scope with one line — the reader100 must see they were considered.101- **Blocking on a missing design-system.** Its absence degrades (code-mode assumptions + a handoff102 recommendation), never blocks the flow work.103104## References & template105106- [`./templates/ux-flows.md`](./templates/ux-flows.md) — output scaffold; inline comments are the107 generation contract.108- [`../_shared/diagram-presentation.md`](../_shared/diagram-presentation.md) ·109 [`../_shared/mermaid-check.md`](../_shared/mermaid-check.md) — confirm-in-prose + parse-validation.110- [`../_shared/size-matrix.md`](../_shared/size-matrix.md) — the N/A condition (no human-facing UI)111 evaluated by the upstream handoff.112- [`../_shared/interview-depth.md`](../_shared/interview-depth.md) — the depth dial set in step 2.