ux
Transform product requirements into a definitive behavioral spec β clear on WHAT the user sees/does and how the system responds, silent on visual taste (trust the implementer for pixels). Two stages with a hard gate between them: (1) align on user flows, then (2) write the detailed ux.md.
Inputs
$ARGUMENTSβ explicit feature name/root or descendant requirements artifact.- Requirements doc β first that exists, read FULLY (no offset/limit):
{OUT_DIR}/concepts/scope.md(canonical, preferred){OUT_DIR}/specs/prd.md{OUT_DIR}/task_summary.md
- If none exist β ask for scope context or recommend
spectre-scopefirst; do not invent scope.
Working Set (late-bound β read at run-time, never inline)
- Reuse a managed
FEATURE_ROOTonly when explicit/current-thread evidence ties it to this work (physical directory wins; never branch/recency/lifecycle/scans); distinct work ignores ambient roots. Otherwise, including on collision, standalone MUST first load and followSkill(spectre-feature-root)through DONE; orchestrated calls escalate. Keep writes beneath it and pass it unchanged. - Repair stale feature/root metadata in artifacts this workflow touches.
OUT_DIR = FEATURE_ROOT.- Existing UI: one
@spectre_patternsdispatch (Stage 1) for similar screens/components, conventions, design tokens β return β€~2K in-thread, no files.
Method / guardrails
Stage 1 β Flow discovery & alignment (align before specifying).
- Identify user segments β flows diverge across these and missing them is the #1 cause of UX rework: first-time vs returning, anon vs signed-in, free vs paid, role-based.
- Identify journeys: user goals, entry points, completion states.
- Write each flow as a narrative: Goal Β· Entry point Β· Steps (User sees β User does β System responds) Β· Decision points + branches Β· Success state Β· open Questions. Call out where flows diverge per segment.
- Present flows, propose a specific take (N flows Γ M segments + key segmentation calls), and ask for pushback. GATE: write no detailed spec until the user replies "Flows approved." On feedback β revise and re-present.
Stage 2 β Detailed spec (only after the flow gate clears).
- Review approved flows for gaps (component behaviors, edge cases, state defs, segment variants); if significant, ask 3β5 targeted questions via
AskUserQuestion(empty states, errors, loading, limits, segment differences) β no clarification files. - Write
{OUT_DIR}/ux.mdwith every required section + the domain specifics below.
Outputs + DONE
Write {FEATURE_ROOT}/ux.md with all 11 sections. Immediately below the title, ux.md records:
Feature: <feature-name>
Feature Root: .spectre/features/<feature-name>
Derive both values from the physical feature directory.
- Overview β what it is, problem solved, primary user goal (1 para)
- User Segments β each segment served + what's different about their UX
- Screens β every screen: name, 1-line purpose, navigation relationships
- Flows β formalized from Stage 1 with alternate paths (validation fail, cancel, network error) + per-segment branches
- Layouts β per screen: header/main/footer structure + responsive behavior (desktop >1024 Β· tablet 768β1024 Β· mobile <768)
- Components β each interactive element: purpose, location, applicable states (from the State Vocabulary)
- Interactions β table: Element | Action | Result (exhaustive)
- States β table: State | Trigger | Appearance | Available Actions
- Content β exact copy: page titles, buttons, empty states, error messages, confirmation dialogs
- Edge Cases β limits/boundaries, null/long data, permissions, offline/network failures, segment-specific
- Accessibility β tab order, keyboard actions (Enter/Space/Escape), screen-reader announcements, focus management
State Vocabulary β pick what's relevant per component (not every component needs every state):
- Visual (per interactive element): default, hover, focus, active/pressed, disabled
- Data (per data view): empty, loading, partial-loaded, loaded, error, stale/refreshing
- Form: pristine, dirty, touched, submitting, submitted-success, submitted-error, per-field validation-error
- Selection: none, single, multi, partial-selection, all-selected
- Sync (collaborative/async): optimistic, pending, conflict, resolved
- Network (where relevant): online, offline, reconnecting
DONE when: the Stage-1 flow gate was cleared (user approved flows); ux.md exists with all 11 sections; segments addressed; flows carry alternate paths; Interactions and States tables use the exact column formats above; component states are drawn from the State Vocabulary; layouts state the responsive breakpoints; accessibility and edge cases covered.
Handoff
Confirm completion inline (screens specified, segments addressed, flows documented, components+states, edge cases + a11y covered) with the doc path. Then choose one:
- Material visual/interaction assumptions remain, stakeholder visual review is needed, or prose alone cannot validate the experience β
spectre-prototype. Apply surfaced assumptions or contradictions back toux.mdbefore planning. - Otherwise β
spectre-plan, the unified tier/research/review/task router.
Render Next (recommended): /spectre:{command} β because {observed UX signal}. Confirmed repository-changing work routes to spectre-plan; read-only UX review may stop or hand off without planning. Add at most one conditional alternative. If stopping, offer Pause: spectre-handoff {feature} with the completed UX path and selected next step.
Escalate-If
- No scope/PRD/summary found β stop; get scope context or route to
spectre-scopebefore specifying. - User pushes for implementation/architecture decisions β note them, defer to
spectre-plan; keep this pass on behavior. - Flows won't converge after iterating β surface the specific unresolved divergence (usually a segment conflict) and ask the user to decide before Stage 2.
- Feature has no user-facing surface β this spec adds nothing; route back to
spectre-plan.