Skip to main content

/ui-quality - UI Quality Gate Verification

Run quality gates to validate UI against design tokens, accessibility standards (WCAG), and visual consistency requirements.

Usage

# Run all quality gates
/ui-quality

# Run on specific path
/ui-quality src/components/Dashboard/

# Run specific gate
/ui-quality --gate accessibility
/ui-quality --gate tokens
/ui-quality --gate visual

# Strict mode (fail on warnings)
/ui-quality --strict

# Generate detailed report
/ui-quality --report

# Auto-fix violations
/ui-quality --fix

# WCAG level selection
/ui-quality --wcag AAA

Output Format

UI QUALITY GATES
═══════════════════════════════════════════════════════════════

Target: src/components/
Files Scanned: 24

Gate 1: Requirements Completeness
───────────────────────────────────────────────────────────────
✅ PASS (100%)

Checks:
├─ ✅ UI type specified
├─ ✅ Target framework defined (React)
├─ ✅ User flows documented
└─ ✅ Acceptance criteria present

Gate 2: Design Token Compliance
───────────────────────────────────────────────────────────────
⚠️ WARN (95%)

Checks:
├─ ✅ Color tokens (100%) - 0 raw hex values
├─ ⚠️ Typography (95%) - 2 violations
│ ├─ Button.tsx:42 - Font size 15px not on scale
│ └─ Card.tsx:28 - Font weight 450 not defined
├─ ✅ Spacing (100%) - All on 8px grid
└─ ✅ Borders (100%) - Consistent radius

Auto-fixable: 2 issues

Gate 3: Accessibility (WCAG AA)
───────────────────────────────────────────────────────────────
✅ PASS (98%)

Checks:
├─ ✅ Color contrast (4.5:1 text, 3:1 UI)
├─ ✅ Heading hierarchy (no skipped levels)
├─ ✅ Form labels (all inputs labeled)
├─ ✅ Alt text (all images)
├─ ✅ Focus indicators (visible on all)
├─ ✅ Touch targets (44x44px minimum)
└─ ⚠️ Skip links (not implemented)

Warnings:
└─ Consider adding skip link to main content

Gate 4: Visual Consistency
───────────────────────────────────────────────────────────────
✅ PASS (92%)

Checks:
├─ ✅ Hierarchy Score: 92
├─ ✅ Spacing Score: 95
├─ ✅ Polish Score: 94
├─ ✅ Border radius: Consistent (8px)
├─ ✅ Shadow levels: 2 (within limit)
└─ ⚠️ Icon style: Mixed (outline + filled)

Recommendations:
└─ Standardize to outline icons throughout

Gate 5: Performance Budget
───────────────────────────────────────────────────────────────
✅ PASS (100%)

Checks:
├─ ✅ Bundle size: 145KB (limit: 200KB)
├─ ✅ Component count: 24 (no limit)
├─ ✅ Nesting depth: 3 (limit: 5)
└─ ✅ Props count: avg 4 (limit: 10)

Summary
═══════════════════════════════════════════════════════════════

Gate Status Score
────────────────────────────────────────────
Requirements ✅ PASS 100%
Design Tokens ⚠️ WARN 95%
Accessibility ✅ PASS 98%
Visual Consistency ✅ PASS 92%
Performance ✅ PASS 100%
────────────────────────────────────────────
Overall ✅ PASS 97%

Issues:
├─ Violations: 0
├─ Warnings: 4
└─ Auto-fixable: 2

RESULT: ✅ QUALITY GATES PASSED
Ready for UI generation: YES

Quality Gates

Gate 1: Requirements Completeness

CheckDescriptionPass Criteria
ui_typeUI type specifiedcomponent/layout/app
frameworkTarget frameworkReact/Vue/Angular
user_flowsUser flows documentedAt least 1 flow
acceptanceAcceptance criteriaCriteria defined

Gate 2: Design Token Compliance

CheckDescriptionPass Criteria
colorsColor token usage100% tokens, 0 raw hex
typographyFont scale adherenceAll on defined scale
spacing8px grid complianceAll values on grid
bordersBorder consistencyConsistent radius

Gate 3: Accessibility (WCAG)

CheckDescriptionPass Criteria
contrastColor contrast ratios4.5:1 text, 3:1 UI
headingsHeading hierarchyNo skipped levels
labelsForm input labelsAll inputs labeled
alt_textImage alt textAll images have alt
focusFocus indicatorsVisible on all
touchTouch targets44x44px minimum

Gate 4: Visual Consistency

CheckDescriptionPass Criteria
hierarchyVisual hierarchyScore ≥ 85
spacingSpacing rhythmScore ≥ 85
polishVisual polishScore ≥ 90
consistencyPattern consistencyConsistent styles

Gate 5: Performance

CheckDescriptionPass Criteria
bundle_sizeComponent bundle size≤ 200KB
nestingComponent nesting depth≤ 5 levels
propsAverage props per component≤ 10

Options

OptionDescription
--gate <name>Run specific gate only
--strictFail on any warning
--reportGenerate detailed report file
--fixAuto-fix violations where possible
--wcag <level>WCAG compliance level (A, AA, AAA)
--jsonOutput as JSON
--output <file>Save report to file

Agent Invoked

GateAgentPurpose
Requirementsmoe-ui-quality-gate-enforcerValidate requirements
Design Tokensmoe-ui-design-system-enforcerCheck token compliance
Accessibilitygenerative-ui-accessibility-auditorWCAG validation
Visualmoe-ui-visual-design-specialistConsistency check
Performancemoe-ui-quality-gate-enforcerPerformance budget

Exit Codes

CodeMeaning
0All gates passed
1Passed with warnings
2Gates failed
3Invalid path or configuration
  • /ui-optimize - Full optimization pipeline
  • /ui-design-system - Design system management
  • /ui-a2ui-render - A2UI tree generation
  • /ui-approve - Approval management

Completion Checklist

Before marking complete:

  • All gates evaluated
  • Violations identified
  • Warnings documented
  • Auto-fixes applied (if requested)
  • Report generated (if requested)
  • Ready for generation status determined

When NOT to Use

Do NOT use when:

  • ❌ Need full optimization (use /ui-optimize)
  • ❌ Quick component generation
  • ❌ Design system not loaded yet

Command Version: 1.0.0 Created: 2026-01-19 Part of: CODITECT MoE UI/UX Agent System