uno-platform-agent

star 4

Comprehensive Uno Platform development patterns for Single Project architecture, MVVM/MVUX, navigation, styling, platform-specific code, and custom controls. Use when: (1) Creating new Uno Platform projects, (2) Implementing MVVM or MVUX patterns, (3) Setting up navigation or styling, (4) Writing platform-specific code, (5) Building custom controls, (6) Optimizing build configuration with Uno.Sdk. Do NOT use for: XAML-only best practices (see winui-xaml), Toolkit control APIs (see uno-toolkit), or service-layer extensions (see uno-extensions-services).

mtmattei By mtmattei schedule Updated 4/4/2026

name: uno-platform-agent description: "Comprehensive Uno Platform development patterns for Single Project architecture, MVVM/MVUX, navigation, styling, platform-specific code, and custom controls. Use when: (1) Creating new Uno Platform projects, (2) Implementing MVVM or MVUX patterns, (3) Setting up navigation or styling, (4) Writing platform-specific code, (5) Building custom controls, (6) Optimizing build configuration with Uno.Sdk. Do NOT use for: XAML-only best practices (see winui-xaml), Toolkit control APIs (see uno-toolkit), or service-layer extensions (see uno-extensions-services)." license: "Apache 2.0 (patterns derived from Uno Platform documentation)" metadata: version: "1.0.0"

Uno Platform Development Patterns

Best practices extracted from uno.extensions (50+ modules) and 17+ production applications.

Critical Rules

Project Setup

  • Use Uno.Sdk with UnoSingleProject=true for all new projects (5.2+)
  • Configure UnoFeatures based on app requirements
  • Target frameworks: net9.0-android;net9.0-ios;net9.0-browserwasm;net9.0-desktop
  • Always include net9.0 (or net8.0) as base TFM at the end - NOT first, due to VS2022 debugging issues (UNOB0011, UNOB0013)
  • Organize platform-specific code in Platforms/ folder

Build Configuration

  • Use Directory.Build.props for shared configuration across projects
  • Enable central package management with Directory.Packages.props
  • Conditional TFM assignment based on platform flags
  • Build performance: enable hard links, binding redirects
  • Output paths: bin\$(MSBuildProjectName) to avoid conflicts

High Priority Rules

MVVM & MVUX

  • Prefer MVUX (reactive) for new applications; CommunityToolkit.Mvvm for traditional MVVM
  • [ObservableProperty] and [RelayCommand] attributes for MVVM
  • IListFeed for read-only data, IListState for mutable data
  • MVUX auto-generates commands from public async methods
  • {Binding StringFormat=...} is NOT supported - use multiple <Run> elements or computed properties

Navigation

  • Set up with .UseNavigation(RegisterRoutes)
  • Register ViewMaps and RouteMaps in RegisterRoutes method
  • Prefer XAML-based navigation (Navigation.Request) over code-behind
  • INavigator service for programmatic navigation

Platform-Specific Code

  • Compile-time: #if __ANDROID__, #if __IOS__, #if __WINDOWS__, #if __WASM__
  • Runtime: OperatingSystem.IsAndroid(), IsBrowser(), etc.
  • Partial classes for platform-specific implementations

Medium Priority Rules

Styling & Theming

  • MaterialToolkitTheme with ColorPaletteOverride.xaml
  • Never hardcode colors - use {ThemeResource} references
  • Material Design 3 color naming; predefined typography styles (TitleLarge, BodyMedium, etc.)
  • ThemeShadow for elevation with Translation property
  • Responsive design with {utu:Responsive} extension
  • AutoLayout over StackPanel for consistent spacing

Data & HTTP

  • Configure HTTP clients with .UseHttp()
  • HttpKiota preferred for new projects; Refit also supported
  • Configuration in appsettings.json as EmbeddedResource
  • ValueTask for async operations that often complete synchronously

Custom Controls

  • SKCanvasElement for custom rendering with SkiaSharp
  • Separate Renderer from Control for clean architecture
  • ItemsRepeater for better performance than ListView
  • Lottie animations for splash screens and loading indicators

Extension Patterns

For DI, authentication, HTTP, configuration, and logging patterns, see the uno-extensions-services skill. Key convention: always return the builder for chaining, use TryAdd* for services.

Common Mistakes

  • Putting net9.0 first in TargetFrameworks (causes UNOB0011/UNOB0013) - always list platform TFMs first
  • Using {Binding StringFormat=...} which is NOT supported - use <Run> elements or computed properties
  • Hardcoding colors instead of using {ThemeResource} references
  • Manually creating HttpClient instances instead of using .UseHttp() with DI
  • Mixing StackPanel with per-child Margin instead of AutoLayout with Spacing

Related Skills

Skill Use instead when...
winui-xaml Optimizing XAML layout, binding, async, collections, memory, or accessibility
uno-extensions-services Configuring hosting, DI, authentication, HTTP clients, or logging
uno-toolkit Using Toolkit controls (AutoLayout, NavigationBar, SafeArea, TabBar, Chip)
uno-csharp-markup Building UI in C# instead of XAML
uno-migration-troubleshoot Migrating from UWP/WPF/Silverlight or fixing build errors
uno-wasm-pwa Targeting WebAssembly or adding PWA support

Detailed References

Read the reference file matching the task at hand:

Install via CLI
npx skills add https://github.com/mtmattei/UnoPlatformSkills --skill uno-platform-agent
Repository Details
star Stars 4
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator