UXSCII Specification v1.0.0
Abstract
UXSCII (pronounced "you-ex-ski") is a text-based markup language for defining user interface components in a format optimized for both human readability and machine parsing. It uses a two-file system combining structured JSON metadata (.uxm files) with ASCII visual templates (.md files) to represent UI components in a way that is version-control friendly, tool-independent, and particularly well-suited for AI agent consumption and generation.
This specification defines the syntax, semantics, and validation rules for UXSCII version 1.0.0.
1. Introduction
1.1 Purpose
UXSCII provides a standardized format for representing UI components that:
- Can be read and written by both humans and AI agents
- Works with standard version control systems (git-friendly)
- Remains tool-independent and vendor-neutral
- Supports rich component metadata, states, and behaviors
- Uses ASCII art for visual representation
1.2 Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
- Component: A reusable UI element defined by a
.uxmfile and optionally an associated.mdtemplate file. - UXM File: A JSON file with the
.uxmextension containing component metadata, properties, and configuration. - Template File: A Markdown file with the
.mdextension containing ASCII art representations and documentation. - Variable: A named placeholder in a template file that gets substituted with actual values.
1.3 Namespace
UXSCII files use the following conventions:
- File extensions:
.uxm(metadata),.md(templates) - MIME types:
application/vnd.uxscii+json(UXM),text/markdown(templates) - JSON Schema URI:
https://uxscii.org/schema/v1.0.0.json
2. Design Goals
UXSCII is designed with the following priorities:
- AI-Native: Optimized for machine parsing and generation by AI agents
- Human-Readable: ASCII representations understandable without special tools
- Version Control Friendly: Text-based format with meaningful diffs
- Tool Independent: Open specification, no vendor lock-in
- Extensible: Clear extension points for custom types and behaviors
- Accessible: ASCII representation readable by screen readers
3. File Format Overview
3.1 The Two-File System
A UXSCII component consists of two files:
.uxm file (Required):
- JSON format
- Contains component metadata, properties, behaviors, and configuration
- Defines the component's structure and data model
- References the associated template file
.md file (Optional):
- Markdown format with ASCII art sections
- Contains visual representations using ASCII characters
- Uses
{{variable}}syntax for interpolation - Includes documentation and examples
3.2 File Naming
Component files MUST follow these naming conventions:
- Component IDs MUST use kebab-case:
^[a-z0-9][a-z0-9-]*[a-z0-9]$ - File names SHOULD match the component ID:
primary-button.uxm,primary-button.md - Paired files MUST share the same base name
4. UXM File Specification
4.1 File Format
UXM files MUST be valid JSON conforming to the UXSCII JSON Schema at https://uxscii.org/schema/v1.0.0.json.
4.2 Required Fields
Every UXM file MUST contain the following top-level fields:
{
"id": "component-name",
"type": "component-type",
"version": "1.0.0",
"metadata": { /* metadata object */ },
"props": { /* properties object */ },
"ascii": { /* ASCII configuration object */ }
}
4.3 Component Identity
4.3.1 id Field
- Type: String
- Required: Yes
- Pattern:
^[a-z0-9][a-z0-9-]*[a-z0-9]$ - Length: 2-64 characters
- Description: Unique identifier for the component using kebab-case
4.3.2 type Field
- Type: String (enum)
- Required: Yes
- Values:
button,input,card,navigation,form,list,modal,table,badge,alert,container,text,image,divider,custom
4.3.3 version Field
- Type: String
- Required: Yes
- Pattern:
^\d+\.\d+\.\d+(?:-[a-zA-Z0-9-]+)?$ - Description: Semantic version number (major.minor.patch)
4.4 Metadata Object
The metadata object MUST contain the following fields:
| Field | Type | Description | Required |
|---|---|---|---|
name |
String | Human-readable component name | Yes |
created |
String | ISO 8601 timestamp of creation | Yes |
modified |
String | ISO 8601 timestamp of last modification | Yes |
description |
String | Component purpose and usage | No |
author |
String | Author or organization name | No |
tags |
Array | Searchable tags (max 10) | No |
category |
String | Component category | No |
4.5 Properties Object
The props object contains component properties used for configuration and template variable substitution. Property values MAY be any valid JSON type.
4.6 ASCII Configuration Object
The ascii object configures the ASCII template and its variables:
| Field | Type | Description | Required |
|---|---|---|---|
templateFile |
String | Template file name (must end with .md) | Yes |
width |
Number | Component width in characters (1-120) | Yes |
height |
Number | Component height in characters (1-50) | Yes |
variables |
Array | Template variable definitions with validation | No |
5. Template File Specification
5.1 File Format
Template files MUST be valid Markdown files using ASCII characters (hex 0x20-0x7E) in code blocks for visual representations.
5.2 Structure
A template file SHOULD contain the following sections:
- Component name and description
- Default state ASCII representation
- Additional states (hover, focus, disabled, etc.)
- Variables documentation
- Usage examples
- Accessibility notes
5.3 ASCII Art Sections
ASCII art MUST be contained within Markdown code blocks (triple backticks).
5.4 ASCII Character Guidelines
Templates SHOULD use ASCII characters (0x20-0x7E) for maximum compatibility. Recommended patterns:
▓- Filled/primary elements█- Hover/active states░- Shadows/pressed effects┌─┐│└─┘- Light borders┏━┓┃┗━┛- Emphasized borders┌ ─ ┐─└ ─ ┘- Dashed borders
6. Variable Interpolation
6.1 Syntax
Variables in template files use double-brace syntax: {{variableName}}
Rules:
- Variable names MUST match those defined in the
.uxmfile'spropsorascii.variables - Variable names MUST use camelCase
- Whitespace inside braces is NOT significant
- Variables are substituted with their string representation
6.2 Example
Template:
```
┌──────────────────┐
│ {{text}} │
│ Size: {{size}} │
└──────────────────┘
```
Props:
{
"props": {
"text": "Hello World",
"size": "medium"
}
}
Rendered:
```
┌──────────────────┐
│ Hello World │
│ Size: medium │
└──────────────────┘
```
6.3 Type Conversion
Values are converted to strings using these rules:
- String: Used as-is
- Number: Standard number-to-string conversion
- Boolean:
"true"or"false" - null/undefined: Empty string
"" - Array/Object: Implementation-defined (typically JSON.stringify)
7. Validation Rules
7.1 UXM File Validation
A UXM file is valid if:
- It contains valid JSON
- All required fields are present
- Field types match schema definitions
- String patterns conform to regex requirements
- Enum values are from allowed lists
- Numbers are within specified ranges
7.2 Template File Validation
A template file is valid if:
- It exists and is readable (if referenced)
- It contains valid Markdown
- Variable syntax is well-formed:
{{variableName}} - Variables use camelCase naming
- ASCII art primarily uses printable ASCII characters
7.3 Cross-File Validation
A component is fully valid if:
- Both UXM and template files are individually valid
- The
ascii.templateFilepath resolves to an existing file - All variables used in the template are defined in
propsorascii.variables - Template dimensions approximately match declared
widthandheight
8. Versioning
8.1 Specification Versioning
UXSCII uses semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR: Incompatible changes to format or schema
- MINOR: Backward-compatible additions
- PATCH: Backward-compatible fixes
This document describes version 1.0.0.
8.2 Component Versioning
Components MUST use semantic versioning in the version field. Components MAY use pre-release identifiers (e.g., 2.1.0-beta.1).
9. Extension Points
9.1 Custom Types
The type field supports a custom value for domain-specific component types.
9.2 Custom Properties
The props object accepts any valid JSON, allowing custom properties.
9.3 Extension Prefix
Custom extensions SHOULD use an x- prefix or vendor-specific prefix to avoid conflicts with future specification versions.
10. Conformance
10.1 UXSCII Consumer
A conformant consumer MUST:
- Parse valid UXM files as JSON
- Recognize all required fields
- Resolve template file paths according to search order
- Handle variable interpolation using
{{variableName}}syntax
10.2 UXSCII Producer
A conformant producer MUST:
- Generate valid JSON in UXM files
- Include all required fields
- Use correct field types and patterns
- Create valid Markdown template files
- Use proper variable syntax in templates
10.3 UXSCII Validator
A conformant validator MUST:
- Validate JSON syntax in UXM files
- Check required field presence
- Verify field types and patterns
- Validate template file existence (if referenced)
- Check variable syntax in templates
References
- RFC 2119 - Key words for use in RFCs
- JSON - JavaScript Object Notation
- Semantic Versioning
- ISO 8601 - Date and time format
- CommonMark - Markdown specification
Copyright © 2024 UXSCII Working Group
Licensed under MIT License