一键导入
visuals
Write $visual blocks that define layout, elements, descriptions, and test hooks for each state
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write $visual blocks that define layout, elements, descriptions, and test hooks for each state
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add purposeful motion to a UXSpec — $animations, onEnter choreography, and timing tokens
Improve every piece of text in a UXSpec — descriptions, labels, error messages, empty states, and loading copy
Identify repeated patterns and consolidate them into $elements and shared tokens for systematic reuse
Collect design context, audience, intent, and requirements before writing any UXSpec JSON
Strengthen a UXSpec against real-world conditions — overflow, missing data, network failures, and accessibility
Run a systematic quality audit on a completed UXSpec — design intent, consistency, accessibility, and state coverage
| name | visuals |
| description | Write $visual blocks that define layout, elements, descriptions, and test hooks for each state |
Write the $visual blocks that define what each state looks like — layout, elements, descriptions, and test hooks.
When adding $visual to leaf states, writing $description fields, or defining $elements for reuse.
The $description is what a human reads in a PR review and what an agent uses to generate an implementation. It must convey design intent.
Bad: "Shows a form with inputs" Good: "Login form with generous vertical spacing. Email and password fields stacked with labels above each. A prominent blue sign-in button spans full width below the fields. A subtle 'Forgot password?' link sits right-aligned beneath the button."
Bad: "Error state" Good: "A red-tinted banner appears above the form with an alert icon and the error message. The form fields remain visible and editable. The submit button returns to its default state with a 'Try again' label."
Include: layout direction, spacing character, emphasis/hierarchy, color intent, element placement, interactive affordances.
Every $visual has a container that sets the layout frame:
stack-v — vertical stack. Default for forms, lists, card content.stack-h — horizontal stack. For toolbars, button groups, inline fields.grid — 2D grid. For dashboards, galleries, responsive layouts.layer — Z-axis stacking. For overlays, floating elements, badges on cards.Set padding, gap, background, and borderRadius via token references.
Slots are named regions within the container. Use semantic names:
header, body, footer — for page-level layoutsicon, label, action — for component-level slotsprimary, secondary — for emphasis hierarchygroup with spacing.$elements)Extract when a pattern appears in 2+ states:
"$elements": {
"form-input": {
"type": "group",
"layout": "stack-v",
"gap": "{spacing.xs}",
"params": ["label", "name", "inputType"],
"children": [
{ "type": "text", "content": { "$bind": "label" } },
{ "type": "input", "name": { "$bind": "name" }, "binding": { "inputType": { "$bind": "inputType" } } }
]
}
}
Reference with: { "$ref": "form-input", "label": "Email", "name": "email", "inputType": "email" }
Only extract what's reused now. Premature abstraction creates dead elements.
testId on every interactive element. These compile to assertions. Name them descriptively: "submit-btn", "email-input", "error-banner".aria.label on elements where the visual content isn't self-describing: icon buttons, abstract shapes, dynamic content.aria.live on regions that update dynamically: error messages ("assertive"), status updates ("polite").Define hover, focus, and disabled appearances via interactions:
"interactions": {
"hover": { "background": "{color.accentHover}" },
"focus": { "outlineWidth": { "value": 2, "unit": "px" }, "outlineColor": "{color.focusRing}" },
"disabled": { "opacity": 0.5 }
}
Every interactive element needs a visible focus state. Users navigating by keyboard must always know where they are.
A $visual is a contract between designer and implementer. It should be specific enough that two different agents, reading the same $visual, produce implementations that look substantially the same.