UX Component Spec Skill
WorkflowSkills Project Context
Before acting, resolve project documentation roots:
- Look for a
[DOC]-*directory at project root. - If found, set
DOC_ROOTto that directory andUX_DOCS_ROOTto[DOC]-*/11-UX-DesignOps. - If
[DOC]-*is absent, stop and ask to initialize project documentation first; never write persistent UX documentation todocs/obsidian. - If UX docs do not exist inside
[DOC]-*, run or followux-bootstrap. - Read
DESIGN.md, existing components, tokens, Storybook if present, and related UX docs. - All persistent documentation must be in French and include YAML frontmatter.
Goal
Create a component contract before implementation or refactor.
Process
- Identify the component role, users, context, and parent flows. Justify the component choice using data volume, search/comparison needs, selection scope, frequency, expertise and error recovery. Compare plausible alternatives when the choice is unresolved; do not replace a familiar native control solely for visual novelty.
- Define props or inputs at a behavioral level without inventing backend contracts.
- Define visual states, validation states, loading, disabled, selected, empty, and error variants.
- Define keyboard, focus, labels, motion and platform accessibility semantics (ARIA for web, native semantics for native UI). Include system navigation and software keyboard behavior when relevant.
- Define responsive behavior and layout constraints.
- Map required tokens and existing components to reuse.
- Save the output under
UX_DOCS_ROOT/05-Components/.
Output
Create or update UX_DOCS_ROOT/05-Components/[component].md with frontmatter:
---
title: UX Component - ComponentName
type: ux-component
status: draft
created: YYYY-MM-DD
updated: YYYY-MM-DD
component: ComponentName
tags:
- ux
- component
---
Rules
- Do not code unless explicitly asked.
- Prefer existing components and tokens.
- Reuse documented design direction and platform constraints. If existing primitives cannot support the specified task, document the needed extension rather than forcing every task into the same component.
- If Storybook exists, include story coverage recommendations.
- Update
DOC_ROOT/00-MOC/MOC-UX.md.
Taste and design references
Use the selected contract and Design_References from ux-design-direction. Adapt reference component properties to the task and native/web semantics; do not replace functional controls for novelty.