Section-by-section UX spec authoring for a screen, flow or HUD. Reads the player journey to provide context; also project-wide accessibility.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-ux-design-04ea69c86ffb ,按照其中的说明把「ux-design」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
!bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" resolve_config --keys automation,workflow,docs.density
Resolved above — use as-is. No block → defaults in
.claude/docs/config-resolution.md.
When this skill is invoked:
Every AskUserQuestion call follows .claude/docs/automation-modes.md
(collaborative asks always · guided major-only · autonomous logs and proceeds;
automation_always_ask categories always prompt).
Authoring guidance: the skeletons below are self-contained — author from them directly. When a section needs depth (worked examples, pattern catalogs, accessibility criteria), the matching guide has it:
| Producing | Guide |
|---|---|
| UX spec | .claude/docs/templates/guidance/ux-spec-guide.md |
| HUD design | .claude/docs/templates/guidance/hud-design-guide.md |
| Interaction patterns | .claude/docs/templates/guidance/interaction-pattern-library-guide.md (routes to three topic files) |
| Accessibility requirements | .claude/docs/templates/guidance/accessibility-requirements-guide.md |
Load a guide per-section, never whole — each is organised by section and the pointers in the templates name the exact section to read.
workflow (see .claude/docs/workflow-modes.md):
full — a UX spec is required per screen.standard — core screens only (main menu, HUD, primary game loop).minimal — not required. Can still be run voluntarily.docs.density — it controls per-section depth, where workflow
controls which screens are specced. modes.rigor sets both together; set
docs.density explicitly to vary depth alone: terse = wireframe descriptions +
interaction bullets; balanced = wireframes + paragraph descriptions of flows
(default); thorough = full prose including user-research summaries and
alternative flow considerations. Apply it to every section you author.
Four authoring modes exist based on the argument:
| Argument | Mode | Output file |
|---|---|---|
hud | HUD design | design/ux/hud.md |
patterns | Interaction pattern library | design/ux/interaction-patterns.md |
accessibility | Project-wide accessibility requirements | design/accessibility-requirements.md |
Any other value (e.g., main-menu, inventory) | UX spec for a screen or flow | design/ux/[argument].md |
| No argument | Ask the user | (see below) |
accessibilityis the only mode that writes outsidedesign/ux/. Its output is a project-wide standard the per-screen specs consult, not a spec for one screen —.claude/docs/workflow-catalog.yaml, the Pre-Production and Polish gates, and/architecture-reviewall checkdesign/accessibility-requirements.mdat that exact path. Do not "tidy" it underdesign/ux/: every one of those checks would stop matching, and the Technical Setup → Pre-Production gate would become unpassable again.
If no argument is provided, do not fail — ask instead. Use AskUserQuestion:
If the user selects "I'll name it" or types a screen name, normalize it to kebab-case
for the filename (e.g., "Main Menu" becomes main-menu).
Read all relevant context before asking the user anything. The skill's value comes from arriving informed.
design/gdd/game-concept.md — if missing, warn:
"No game concept found. Run
/brainstormfirst to establish the game's foundation before designing UX." Continue anyway if the user asks.
Read design/player-journey.md if it exists. For each relevant section, extract:
If the player journey file does not exist, note the gap and proceed:
"No player journey map found at
design/player-journey.md. Designing without it means we'll be making assumptions about player context. Consider running a player journey session after this spec is drafted."
Also add to the UX spec's Open Questions section:
"Player journey map not yet created. Author it from the template at
.claude/docs/templates/player-journey.mdto establish player context for this screen."
Do not tell the user to "run
/ux-designPhase 2b" to create it. Phase 2b is this step — the one that reads the file. That remediation is circular: it sends the user back to the check that just reported the gap. No skill writesdesign/player-journey.md; it is hand-authored from its template.
Glob design/gdd/*.md and grep for UI Requirements sections. Read any GDD whose
UI Requirements section references this screen by name or category.
These GDD UI Requirements are the requirements input to this spec. Collect them as a list of constraints the spec must satisfy.
If designing the HUD, you need the UI Requirements of every system — the HUD aggregates them. Collect them with one scan rather than opening each GDD:
Grep pattern="^#+ .*UI Requirements" glob="design/gdd/*.md" output_mode="content" -A 20
Establish the denominator first (glob design/gdd/*.md, count N) and check
the match count against it. A GDD with no UI Requirements section is not a GDD
with no UI needs — it may predate the section. List the unmatched ones and
confirm with the user that they are genuinely headless before excluding them
from the HUD's requirement set; a HUD that silently omits a system's readout is
the exact failure this aggregation exists to prevent.
Glob design/ux/*.md and note which screens already have specs. For screens that
will link to or from the current screen, read their navigation/flow sections to
find the entry and exit points this spec must match.
If design/ux/interaction-patterns.md exists, read the pattern catalog index
(the list of pattern names and their one-line descriptions). Do not read full
pattern details — just the catalog. This tells you which patterns already exist
so you can reference them rather than reinvent them.
Check for design/art/art-bible.md. If found, read the visual direction
section. UX layout must align with the aesthetic commitments already made.
Check for design/accessibility-requirements.md. If found, read it. The spec
must satisfy the accessibility tier committed to there.
Read the platform block from project.yaml; if project.yaml has no
platform block, fall back to the ## Input & Platform section of
.claude/docs/technical-preferences.md. Store these values for use throughout
the skill — they drive the Interaction Map and inform accessibility
requirements:
platform.primary_input — the dominant input for this gameplatform.gamepad_support — Full / Partial / Noneplatform.touch_support — Full / Partial / Noneplatform.targets — for safe zone and aspect ratio decisionsproject.yaml, derive it: keyboard/mouse if PC or Web is in targets;
gamepad if gamepad support is Full/Partial; touch if touch support is
Full/Partial; plus the primary input. When falling back to
technical-preferences.md, use its explicit Input Methods field.If neither source is configured, ask once:
"Input methods aren't configured yet. What does this game target?" Options: "Keyboard/Mouse only", "Gamepad only", "Both (PC + Console)", "Touch (mobile)", "All of the above"
(Run
/setup-engineto save this permanently so you won't be asked again.)
Store the answer for the rest of this session. Do not ask again per section or per screen.
Before any design work, present a brief summary to the user:
Designing: [Screen/Flow Name]
- Mode: [UX Spec / HUD Design / Pattern Library]
- Journey phase(s): [from player-journey.md, or "unknown — no journey map"]
- GDD requirements feeding this spec: [count and names, or "none found"]
- Related screens already specced: [list, or "none yet"]
- Known patterns available: [count, or "no pattern library yet"]
- Accessibility tier: [from requirements doc, or "not yet defined"]
- Input methods: [derived from the
project.yamlplatform block, or "asked above"]
Then ask: "Anything else I should read before we start, or shall we proceed?"
Before creating a skeleton, check if the target output file already exists.
Glob design/ux/[filename].md (where [filename] is the resolved output path from Phase 1).
If the file exists — retrofit mode:
[To be designed] placeholder) or is empty/placeholder"Found existing UX spec at
design/ux/[filename].md. Here's what's already done:
Section Status Overview & Context [Complete / Empty / Placeholder] Player Journey Integration ... Screen Layout & Information Architecture ... Interaction Model ... Feedback & State Communication ... Accessibility ... Edge Cases & Error States ... Open Questions ... I'll work on the [N] incomplete sections only — existing content will not be overwritten."
Edit to fill placeholders in-place rather than creating a new skeletonIf the file does not exist — fresh authoring mode: Proceed to Phase 3 (Create File Skeleton) as normal.
Once the user confirms, immediately create the output file with empty section headers. This ensures incremental writes have a target and work survives interruptions.
Ask: "May I create the skeleton file at design/ux/[filename].md?" — except in
accessibility mode, where the path is design/accessibility-requirements.md
(see the mode table in Section 1; it is deliberately not under design/ux/).
# UX Spec: [Screen/Flow Name]
> **Status**: In Design
> **Author**: [user + ux-designer]
> **Last Updated**: [today's date]
> **Journey Phase(s)**: [from context]
> **Template**: UX Spec
---
## Purpose & Player Need
[To be designed]
---
## Player Context on Arrival
[To be designed]
---
## Navigation Position
[To be designed]
---
## Entry & Exit Points
[To be designed]
---
## Layout Specification
### Information Hierarchy
[To be designed]
### Layout Zones
[To be designed]
### Component Inventory
[To be designed]
### ASCII Wireframe
[To be designed]
---
## States & Variants
[To be designed]
---
## Interaction Map
[To be designed]
---
## Events Fired
[To be designed]
---
## Transitions & Animations
[To be designed]
---
## Data Requirements
[To be designed]
---
## Accessibility
[To be designed]
---
## Localization Considerations
[To be designed]
---
## Acceptance Criteria
[To be designed]
---
## Open Questions
[To be designed]
# HUD Design
> **Status**: In Design
> **Author**: [user + ux-designer]
> **Last Updated**: [today's date]
> **Template**: HUD Design
---
## HUD Philosophy
[To be designed]
---
## Information Architecture
### Full Information Inventory
[To be designed]
### Categorization
[To be designed]
---
## Layout Zones
[To be designed]
---
## HUD Elements
[To be designed]
---
## Dynamic Behaviors
[To be designed]
---
## Platform & Input Variants
[To be designed]
---
## Accessibility
[To be designed]
---
## Open Questions
[To be designed]
# Interaction Pattern Library
> **Status**: In Design
> **Author**: [user + ux-designer]
> **Last Updated**: [today's date]
> **Template**: Interaction Pattern Library
---
## Overview
[To be designed]
---
## Pattern Catalog
[To be designed]
---
## Patterns
[Individual pattern entries added here as they are defined]
---
## Gaps & Patterns Needed
[To be designed]
---
## Open Questions
[To be designed]
Section list mirrors .claude/docs/templates/accessibility-requirements.md — if
the template gains or loses a section, this skeleton follows it, not the reverse.
# Accessibility Requirements
> **Status**: In Design
> **Author**: [user + ux-designer]
> **Last Updated**: [today's date]
> **Template**: Accessibility Requirements
## Accessibility Tier Definition
[To be designed]
---
## Visual Accessibility
[To be designed]
---
## Motor Accessibility
[To be designed]
---
## Cognitive Accessibility
[To be designed]
---
## Auditory Accessibility
[To be designed]
---
## Platform Accessibility API Integration
[To be designed]
---
## Per-Feature Accessibility Matrix
[To be designed]
---
## Accessibility Test Plan
[To be designed]
---
## Known Intentional Limitations
[To be designed]
---
## Audit History
[To be designed]
---
## External Resources
[To be designed]
---
## Open Questions
[To be designed]
The tier commitment is the gated part.
gate-pre-production.mdrequires the file to exist with an accessibility tier committed, andgate-production.mdchecks that tier is addressed in every key screen spec. A skeleton whose Tier Definition is still[To be designed]satisfies the glob but not the gate — author that section first.
After writing the skeleton, update production/session-state/active.md with:
design/accessibility-requirements.md in accessibility mode)Walk through each section in order. For each section, follow this cycle:
Context -> Questions -> Options -> Decision -> Draft -> Approval -> Write
AskUserQuestion
for constrained choices, conversational text for open-ended exploration.AskUserQuestion to capture the decision.AskUserQuestion:
AskUserQuestion: "May I write the [section name] section to [filepath]?"
Edit to replace the [To be designed] placeholder with approved content.After writing each section, update production/session-state/active.md.
Per-section authoring guidance lives in its own file per mode. When you reach Phase 4, read only the file matching the mode resolved in Section 1; never load the other two.
| Mode | Guidance file |
|---|---|
| UX Spec (screen or flow) | .claude/skills/ux-design/references/sections-ux-spec.md |
| HUD Design | .claude/skills/ux-design/references/sections-hud.md |
| Interaction Pattern Library | .claude/skills/ux-design/references/sections-patterns.md |
| Accessibility Requirements | .claude/docs/templates/guidance/accessibility-requirements-guide.md |
The accessibility guidance lives under
templates/guidance/rather than this skill'sreferences/because the template it documents (.claude/docs/templates/accessibility-requirements.md) is consumed by/ux-reviewand the gate files too. Same rule applies: load only the part covering the section you are authoring, never the whole file.
Apply docs.density (Section 1) to whatever that file tells you to author — it
controls the depth of each section, not which sections exist.
Before marking the spec as ready for review, run these checks:
1. GDD requirement coverage: Does every GDD UI Requirement that references this screen have a corresponding element in this spec? Present any gaps.
2. Pattern library alignment: Are all interaction patterns used in this spec
referenced by name? If a new pattern was invented during this spec session, flag
it for addition to the pattern library:
Use AskUserQuestion:
3. Navigation consistency: Do the entry/exit points in this spec match the navigation map in any related specs? Flag mismatches.
4. Accessibility coverage: Does the spec address the accessibility tier
committed to in design/accessibility-requirements.md? If not, flag open questions.
5. Empty states: Does every data-dependent element have an empty state defined? Flag any that don't.
Present the check results:
Cross-Reference Check: [Screen Name]
- GDD requirements: [N of M covered / all covered]
- New patterns to add to library: [list or "none"]
- Navigation mismatches: [list or "none"]
- Accessibility gaps: [list or "none"]
- Missing empty states: [list or "none"]
When all sections are approved and written:
Update production/session-state/active.md with:
Before presenting options, state clearly:
"This spec should be validated with
/ux-reviewbefore it enters the implementation pipeline. The Pre-Production gate requires all key screen specs to have a review verdict."
Then use AskUserQuestion:
/ux-review [filename] now, or do something else first?"
/ux-review now — validate this spec"If the user picks "Design another screen first", add a note: "Reminder: run
/ux-review on all completed specs before running /gate-check pre-production."
If other UX specs link to or from this screen, note which ones should reference this spec. Do not edit those files without asking — just name them.
If the session is interrupted (compaction, crash, new session):
production/session-state/active.md — it records the current screen
and which sections are complete.design/ux/[filename].md — sections with real content are done;
sections with [To be designed] still need work.This is why incremental writing matters: every approved section survives any disruption.
This skill uses ux-designer as the primary agent (set in frontmatter). For
specific sub-topics, additional context or coordination may be needed:
| Topic | Coordinate with |
|---|---|
| Visual aesthetics, color, layout feel | art-director — UX spec defines zones; art defines how they look |
| Implementation feasibility (engine constraints) | ui-programmer — before finalizing component inventory |
| Gameplay data requirements | game-designer — when data ownership is unclear |
| Narrative/lore visible in the UI | narrative-director — for flavor text, item names, lore panels |
| Accessibility tier decisions | Handled by this session — owned by ux-designer |
When delegating to another agent via the Agent tool:
In collaborative mode (the default). For guided and autonomous modes,
see the per-mode rules in .claude/docs/automation-modes.md — the steps below
describe what collaborative mode requires, not what applies universally.
This skill follows the collaborative design principle at every step:
Aesthetic deference: When layout or visual choices come down to personal taste, present the options and ask. Do not select a layout because it is "standard" — always confirm. The user is the creative director.
Conflict surfacing: When a GDD requirement and the available screen real estate conflict, surface the conflict and present resolution options. Never silently drop a requirement. Never silently expand the layout without flagging it.
Never auto-generate the full spec and present it as a fait accompli. Never write a section without user approval. Never contradict an existing approved UX spec without flagging the conflict. Always show where decisions come from (GDD requirements, player journey, user choices).
Verdict: COMPLETE — UX spec written and approved section by section.
/ux-review [filename] to validate this spec before it enters the implementation pipeline/ux-design [next-screen] to continue designing remaining screens or flows/gate-check pre-production once all key screens have approved UX specs