The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.
Supporting Evidence
LAYER_09_UX
安装 LAYER_09_UX,这是一款面向AI agent workflows and automation的 AI Agent Skill。支持 Claude Code、Cursor、Windsurf,一键安装。
SKILL.md
Readonly
Imported Repository Instructions
The section below is supporting source material from the upstream repository. Use the Killer-Skills review above as the primary decision layer.
Supporting Evidence
UX Layer Skill
Layer Number: 09
Specification: Metadata Model Spec v0.8.3
Purpose: Defines user experience using Three-Tier Architecture, specifying views, components, state machines, and interactions.
Layer Overview
The UX Layer captures user experience design:
VIEWS - Screens/pages, modals, dialogs, drawers, and panels
Wants to define user interfaces or user experiences
Asks about state machines, transitions, or user flows
Needs to model screens, forms, or interactive elements
Wants to link UX to navigation, APIs, or business processes
Entity Types
CLI Introspection: Run dr schema types ux for the authoritative, always-current list of node types.
Run dr schema node <type-id> for full attribute details on any type.
ComponentReference - Reference to a library component by ID (required: ref)
ActionComponent - Interactive element (button, link, voice command)
ExperienceState - State in state machine
StateAction - Action during state lifecycle
StateTransition - Transition between states
LayoutConfig - Layout configuration for views and components (required: type)
DataConfig - Data binding configuration (required: source, target)
ErrorConfig - Error handling configuration for components
Type Decision Tree
Use this decision tree before assigning a type to any UX element.
LIBRARY TIER — reusable, cross-experience artifacts
├── Component library container? → ux.uxlibrary
├── Reusable UI component type (form, table, chart, card)? → ux.librarycomponent
├── Reusable grouping of components? → ux.librarysubview
├── Reusable state machine pattern? → ux.statepattern
├── Reusable action definition? → ux.actionpattern
├── Reusable parameterized state action template? → ux.stateactiontemplate
│ (no lifecycle binding; has parameters array)
├── Reusable transition template with animation? → ux.transitiontemplate
│ (has animationType/duration/easing; both `to` and `trigger` required)
├── Column definition for a table component? → ux.tablecolumn
└── Data series definition for a chart component? → ux.chartseries
APPLICATION TIER — app-wide UX configuration
└── Application-wide UX configuration (channel required)? → ux.uxapplication
EXPERIENCE TIER — specific to a view or experience
├── Top-level experience specification container? → ux.uxspec
├── Screen, page, modal, dialog, drawer, or panel? → ux.view
│ (required: type enum — page|modal|dialog|drawer|panel|overlay|embedded|full-screen)
├── Section or grouping within a view? → ux.subview
├── Placed instance of a component on a view? → ux.componentinstance
│ (has `order` for positioning and `props` for overrides)
├── Typed reference to a component by slot or variant? → ux.componentreference
│ (ref required; use when targeting a specific variant or slot, not placement)
├── Interactive element (button, link, voice command)? → ux.actioncomponent
├── State in an experience state machine? → ux.experiencestate
├── Concrete action bound to a state lifecycle? → ux.stateaction
│ (has lifecycle: on-enter|on-exit|on-transition and timing; no parameters)
├── Concrete transition with trigger and optional guard? → ux.statetransition
│ (trigger required; has guard conditions and inline actions; no animation)
├── Layout configuration (grid, flex, block, etc.)? → ux.layoutconfig
├── Data binding configuration (source → target)? → ux.dataconfig
└── Error handling configuration? → ux.errorconfig
Performance - Set performance targets (load time, interaction latency)
React Flow / Graph Visualization Patterns
When the codebase uses a graph visualization library (React Flow, D3, Cytoscape), apply these patterns in addition to the standard UX decision tree.
Configuration-Driven Node Renderer
tsx
1// src/core/nodes/components/UnifiedNode.tsx
2export function UnifiedNode({ data }: NodeProps<UnifiedNodeData>) {
3 const config = nodeConfigLoader.get(data.elementType);
4 return <div style={config.styles}>{data.name}</div>;
5}
6// src/core/nodes/nodeConfig.json ← drives all 20 node type styles
→ UnifiedNode.tsx → ux.librarycomponent.unified-node (type: graph-node)
→ nodeConfig.json → data-model.objectschema.node-config
→ Do NOT create 20 separate elements for each node type in the config — the configuration-driven system as a whole is one librarycomponent
Custom Edge Type
tsx
1// src/core/edges/ElbowEdge.tsx
2export function ElbowEdge(props: EdgeProps) { ... }
→ ux.librarycomponent.elbow-edge (type: graph-edge)
→ Each distinct custom edge type → one librarycomponent
Layer Container / Swimlane Node
tsx
1// src/core/nodes/LayerContainerNode.tsx
2export function LayerContainerNode({ data }: NodeProps) { ... }
→ Already captured in the application layer as ApplicationComponent. Do NOT add it again as a UX element — the ux.view.* that represents the graph page already serves this purpose in the UX layer.
Sub-components (field lists, tooltips, badges)
FieldList.tsx, FieldTooltip.tsx, RelationshipBadge.tsx, BadgeRenderer.tsx are internal implementation details of UnifiedNode. Do NOT add them as separate librarycomponent entries.
A login page with a form component, state machine, and data binding:
bash
1# Add the view (page type, routable)2dr add ux view "Login"--description"Login page"--attributes'{"type":"page","routable":true}'3# → id: ux.view.login45# Add a form component from the library6dr add ux librarycomponent "Login Form"--description"Email/password form"--attributes'{"type":"form"}'7# → id: ux.librarycomponent.login-form89# Place the form as an instance on the login view10dr add ux componentinstance "Login Form Instance"11# → id: ux.componentinstance.login-form-instance1213# Add states for the login flow14dr add ux experiencestate "Idle"15dr add ux experiencestate "Submitting"16dr add ux experiencestate "Error"1718# Add a transition: click submit → submitting19dr add ux statetransition "Submit Clicked"--attributes'{"trigger":"click","to":"ux.experiencestate.submitting"}'20# → id: ux.statetransition.submit-clicked2122# Add data config binding the form to the API23dr add ux dataconfig "Login Data"--attributes'{"source":"api","target":"ux.componentinstance.login-form-instance"}'2425# Add error config for failed login26dr add ux errorconfig "Login Error"--description"Show inline error on auth failure"
Pitfalls to Avoid
❌ Not using library components (inconsistent UX)
❌ Complex state machines without documentation
❌ Not linking to API operations or navigation routes
❌ Missing error states and handling
❌ No performance targets defined
Coverage Completeness Checklist
Before declaring UX layer extraction complete, verify each type was considered: