1 agents

ui-flowbite-specialist

ui-flowbite-specialist

Overview

The UI Flowbite Specialist is an L3 agent operating in the development domain of the Prismatic Platform. This agent specializes in UI/UX enhancement using Flowbite components and TailwindCSS with strict design system adherence. Every user interface element in the Prismatic Platform must be built using TailwindCSS utility classes and Flowbite component patterns -- inline styles and custom CSS are forbidden. The UI Flowbite Specialist enforces this mandate while ensuring that the platform's LiveView dashboards, administrative interfaces, and monitoring pages maintain a consistent, professional, and accessible design language.

The platform's TailwindCSS-first policy is not merely an aesthetic preference but an architectural decision that enables consistent theming, efficient CSS bundle sizes, and maintainable component libraries. By centralizing all styling decisions in utility classes and pre-built Flowbite components, the platform eliminates the CSS specificity conflicts, dead CSS accumulation, and design inconsistencies that plague projects with ad-hoc styling approaches.

This agent is part of the platform's 434-strong autonomous agent ecosystem, operating under AIAD standard compliance and enforcing the design system through automated validation.

Design System Rules

The UI Flowbite Specialist enforces a strict set of design system rules that govern all UI development.

RuleEnforcement LevelViolation Response
TailwindCSS utilities onlyBLOCKINGReject PR with inline styles
Flowbite components for common patternsADVISORYSuggest Flowbite alternative
No custom CSS filesBLOCKINGReject PR with custom CSS
Dark mode supportBLOCKINGAll components must support dark mode
Responsive designBLOCKINGAll layouts must be responsive
Accessibility (WCAG 2.1 AA)BLOCKINGReject inaccessible components
Consistent spacing scaleADVISORYSuggest standard spacing values

Component Library

The UI Flowbite Specialist maintains a curated component library built on Flowbite patterns, adapted for the platform's Phoenix LiveView architecture.

Component CategoryComponentsFlowbite BaseLiveView Integration
NavigationSidebar, navbar, breadcrumbs, tabsYesphx-click handlers
Data DisplayTables, cards, badges, statsYesphx-update="stream"
FormsInputs, selects, toggles, date pickersYesphx-change, phx-submit
FeedbackAlerts, toasts, progress bars, spinnersYesphx-hook animations
OverlaysModals, dropdowns, popovers, tooltipsYesAlpine.js integration
ChartsLine, bar, pie, area, sparklinesCustomLiveView push events

Technical Implementation

defmodule PrismaticAgents.UIFlowbiteSpecialist do
  @moduledoc """
  L3 UI Flowbite Specialist agent.
  Enforces TailwindCSS-first design system with Flowbite components.
  """

  use GenServer
  require Logger

  @design_audit_interval_ms :timer.hours(8)

  @forbidden_patterns [
    ~r/style\s*=\s*"/,           # Inline styles
    ~r/<style[^>]*>/,             # Style tags
    ~r/\.css"[^>]*>/,             # Custom CSS imports (excluding tailwind)
    ~r/!important/                 # !important overrides
  ]

  defstruct [
    :template_registry,
    :violation_count,
    :component_usage,
    :last_audit_at,
    status: :enforcing
  ]

  @spec start_link(keyword()) :: GenServer.on_start()
  def start_link(opts \\ []) do
    GenServer.start_link(__MODULE__, opts, name: __MODULE__)
  end

  @impl true
  def init(_opts) do
    schedule_design_audit()
    {:ok, %__MODULE__{template_registry: %{}, violation_count: 0}}
  end

  @impl true
  def handle_info(:design_audit, state) do
    templates = discover_all_templates()
    violations = audit_design_compliance(templates)
    usage = analyze_component_usage(templates)

    :telemetry.execute(
      [:prismatic, :agents, :ui_flowbite, :audit],
      %{templates_audited: length(templates), violations: length(violations)},
      %{component_usage: map_size(usage)}
    )

    schedule_design_audit()

    {:noreply, %{state |
      template_registry: templates,
      violation_count: length(violations),
      component_usage: usage,
      last_audit_at: DateTime.utc_now()
    }}
  end

  defp audit_design_compliance(templates) do
    templates
    |> Enum.flat_map(fn template ->
      content = File.read!(template.path)

      @forbidden_patterns
      |> Enum.flat_map(fn pattern ->
        if Regex.match?(pattern, content) do
          [%{template: template.path, pattern: pattern, severity: :blocking}]
        else
          []
        end
      end)
    end)
  end
end

TailwindCSS Configuration

The platform's TailwindCSS configuration is managed by the UI Flowbite Specialist to ensure consistency across all applications.

// tailwind.config.js (managed by UI Flowbite Specialist)
module.exports = {
  content: [
    './apps/*/lib/*_web/**/*.{heex,ex}',
    './sites/promo/templates/**/*.html',
    './node_modules/flowbite/**/*.js'
  ],
  darkMode: 'class',
  theme: {
    extend: {
      colors: {
        prismatic: {
          50: '#f0f4ff',
          500: '#6366f1',
          900: '#1e1b4b',
          950: '#0f0d2e'
        }
      }
    }
  },
  plugins: [
    require('flowbite/plugin'),
    require('@tailwindcss/typography')
  ]
}

LiveView Component Patterns

The UI Flowbite Specialist defines standard patterns for integrating Flowbite components with Phoenix LiveView.

PatternUse CaseImplementation
Stateless ComponentStatic UI elementsPhoenix.Component function components
Stateful ComponentInteractive elementsPhoenix.LiveComponent
JS HookComplex interactionsphx-hook with Flowbite JS
Alpine.jsDropdowns, modalsx-data, x-show, @click
StreamLarge data tablesphx-update="stream"

Design Audit Metrics

MetricCurrentTarget
Templates audited250+All templates
Design violations00
Flowbite adoption rate95%> 90%
Dark mode coverage100%100%
Accessibility complianceWCAG 2.1 AAWCAG 2.1 AA
CSS bundle size45 KB (minified)< 100 KB

A critical responsibility of the UI Flowbite Specialist is protecting navigation functionality. The platform's dropdown menus, sidebars, and navigation elements use phx-click handlers that can be broken by improper DOM structure changes. Navigation breakage is among the most user-visible types of regression and receives zero tolerance under the NO MERCY doctrine.

Navigation ElementProtection MechanismValidationRisk Level
Sidebarphx-click event handlersE2E test coverageHigh
Dropdown menusAlpine.js x-data stateComponent test coverageHigh
Mobile hamburgerAlpine.js toggleResponsive test coverageMedium
BreadcrumbsStatic <a> linksLink validationLow
Tab navigationphx-click with active stateState management testsMedium
PaginationLiveView phx-click handlersIntegration testsMedium

Responsive Design Framework

The UI Flowbite Specialist enforces a mobile-first responsive design approach where all components must function correctly across the platform's supported viewport sizes. Every component in the library has been tested against these breakpoints and includes responsive utility classes.

BreakpointMin WidthTarget DevicesTailwind PrefixLayout Strategy
Mobile0pxPhones(default)Single column, stacked
Small640pxLarge phones, small tabletssm:Two columns where appropriate
Medium768pxTabletsmd:Sidebar + content
Large1024pxLaptopslg:Full navigation + content
XL1280pxDesktopsxl:Wide content with margins
2XL1536pxLarge monitors2xl:Maximum width constraints
defmodule PrismaticAgents.UIFlowbiteSpecialist.ResponsiveAuditor do
  @moduledoc """
  Audits templates for responsive design compliance.
  Ensures all layouts include proper responsive breakpoint classes.
  """

  @required_breakpoints ["sm:", "md:", "lg:"]

  @spec audit_responsive_compliance(String.t()) :: {:ok, map()} | {:violations, list(map())}
  def audit_responsive_compliance(template_path) do
    content = File.read!(template_path)

    layout_elements = extract_layout_elements(content)

    violations =
      layout_elements
      |> Enum.flat_map(fn element ->
        missing = @required_breakpoints -- extract_breakpoints(element)

        if missing != [] do
          [%{
            element: element.tag,
            line: element.line,
            missing_breakpoints: missing,
            severity: if("lg:" in missing, do: :blocking, else: :advisory)
          }]
        else
          []
        end
      end)

    if violations == [], do: {:ok, %{elements_checked: length(layout_elements)}}, else: {:violations, violations}
  end
end

Dark Mode Implementation

The platform enforces mandatory dark mode support for all components. The UI Flowbite Specialist ensures that the dark: variant is properly applied to all color-related utility classes and that contrast ratios meet WCAG 2.1 AA standards in both light and dark modes.

Color CategoryLight ModeDark ModeContrast Ratio (Dark)
Backgroundbg-whitebg-gray-900 / bg-gray-950N/A
Primary Texttext-gray-900text-white / text-gray-10015.6:1
Secondary Texttext-gray-600text-gray-4005.7:1
Accenttext-indigo-600text-indigo-4005.2:1
Borderborder-gray-200border-gray-7003.1:1
Hoverhover:bg-gray-50hover:bg-gray-800N/A

Integration Points

AIAD Specification Compliance

AIAD ComponentStatus
Agent specification fileCompliant
Behavioral rules12 rules defined
Telemetry integrationFull coverage
NM/ND doctrine enforcementActive
SEADF integrationRegistered

Accessibility Enforcement

The UI Flowbite Specialist enforces WCAG 2.1 AA accessibility compliance as a blocking quality gate. Every UI component must meet accessibility standards before it can be merged into the codebase.

Accessibility CriterionRequirementTest Method
Color ContrastMinimum 4.5:1 for normal text, 3:1 for large textAutomated contrast checker
Keyboard NavigationAll interactive elements keyboard accessibleTab-order testing
Screen ReaderMeaningful aria-label and role attributesaxe-core automated testing
Focus IndicatorsVisible focus rings on all interactive elementsVisual inspection + automated
Alt TextAll images have descriptive alt textTemplate scanning
Form LabelsAll form inputs have associated labelsHTML validator

Authority Level

L3 - Strategic Command - Multi-domain coordination with authority to enforce the TailwindCSS-first design system and reject non-compliant UI changes.


Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL