/engineering:avalonia-desktop-developmentfrom engineering
Builds and reviews cross-platform .NET desktop apps with Avalonia UI, covering AXAML, MVVM, compiled bindings, virtualization, accessibility, WebViews, and packaging for Windows/macOS/Linux.
Ships in engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.
Any Chwezi app or system UI work (effective 01 Nov 2026) MUST follow the Chwezi Product Excellence Standard in chwezi-design-engine (resolve via the engine-routing table; never hard-code the path): doctrine/product-excellence-standard.md and skill skills/00-cross-cutting-ops-qa-a11y/chwezi-product-excellence-standard. Engineering gates: product-excellence-engineering-gates.md. Desktop apps meet interaction parity (same states, flows and semantics, not pixel identity), consume tokens generated from the same source, and pass the screenshot matrix (light/dark, 200% text, RTL). Where this skill and the standard differ, the standard wins.
.axaml; keep logic in view models; keep domain logic in the core project so it is unit-testable.DataContext in App.OnFrameworkInitializationCompleted, branching on IClassicDesktopStyleApplicationLifetime vs ISingleViewApplicationLifetime.CommunityToolkit.Mvvm ([ObservableProperty], [RelayCommand]); reach for ReactiveUI only for genuinely reactive streams.x:DataType on every view/DataTemplate, AvaloniaUseCompiledBindingsByDefault on.Classes; re-skin controls with ControlTheme; theme with FluentTheme + RequestedThemeVariant for light/dark.Core/ — models, services, domain (no Avalonia dependency; fully unit-testable).App/ — shared Avalonia UI: Views/, ViewModels/, Assets/, Styles/.Desktop/ — entry point referencing Avalonia.Desktop (one project serves Windows + macOS + Linux).Tests/ — view-model unit tests + Avalonia.Headless UI tests..axaml extension. App.axaml holds app-level resources/styles; Program.cs configures the AppBuilder.Avalonia, Avalonia.Desktop, Avalonia.Themes.Fluent, Avalonia.Diagnostics (dev), CommunityToolkit.Mvvm.public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
desktop.MainWindow = new MainWindow { DataContext = _provider.GetRequiredService<ShellViewModel>() };
else if (ApplicationLifetime is ISingleViewApplicationLifetime single)
single.MainView = new MainView { DataContext = _provider.GetRequiredService<ShellViewModel>() };
base.OnFrameworkInitializationCompleted();
}
Create the root DataContext here (ideally resolved from a DI container). Do not scatter view-model construction across code-behind.
Prefer source-generated view models over hand-written INotifyPropertyChanged:
public partial class LibraryViewModel : ObservableObject
{
public ObservableCollection<BookViewModel> Books { get; } = new();
[ObservableProperty] private BookViewModel? _selectedBook;
[RelayCommand(CanExecute = nameof(CanOpen))]
private async Task OpenAsync(BookViewModel book) => await _reader.OpenAsync(book.FilePath);
private bool CanOpen(BookViewModel b) => b is not null;
}
Always declare x:DataType and bind type-safely:
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:App.ViewModels"
x:DataType="vm:LibraryViewModel">
<ListBox ItemsSource="{Binding Books}" SelectedItem="{Binding SelectedBook}">
<ListBox.ItemTemplate>
<DataTemplate x:DataType="vm:BookViewModel">
<TextBlock Text="{Binding Title}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</UserControl>
Compiled bindings fail the build on typos, run faster (no reflection), and are essential for large lists. Bind Button.Command to a [RelayCommand]; make commands async to keep the UI responsive. Use async commands + Dispatcher.UIThread.Post for any background → UI update.
ReactiveObject, RaiseAndSetIfChanged, ReactiveCommand, WhenAnyValue) is for complex reactive pipelines (e.g. debounced live search).{Binding #Other.Prop} (element), {Binding $parent[Window].DataContext.Cmd}, RelativeSource FindAncestor, $self/$parent.IValueConverter for type mismatches; prefer FuncValueConverter<TIn,TOut> and built-in BoolConverters/StringConverters/ObjectConverters.Avalonia ships no navigation framework. Use a ViewLocator : IDataTemplate that maps FooViewModel → FooView by name, register it in Application.DataTemplates, and drive a CurrentPage view-model property bound to a host ContentControl/SplitView. Honour the *ViewModel → *View naming convention. Keep window/dialog code (Show, ShowDialog(owner)) behind an IDialogService so view models stay testable.
Grid (most versatile/performant; sizes Auto/*/absolute), StackPanel (use Spacing), WrapPanel, DockPanel (menus/toolbars/status bars), Canvas (absolute), RelativePanel, ScrollViewer (never wrap a ListBox/DataGrid, never nest).Button/SplitButton, TextBox (Watermark), AutoCompleteBox (type-ahead search), ComboBox, CheckBox, Slider, DatePicker, Menu/MenuItem (_ mnemonics, InputGesture), Flyout, Expander, TabControl, ProgressBar.Auto/* sizing and TextWrapping="Wrap" so layouts flex for long localized text.Style with selectors (CSS-like), not WPF keyed styles. Use Classes and pseudo-classes (:pointerover, :pressed, :focus, :disabled, :checked):
<Style Selector="Button.primary">
<Setter Property="Background" Value="{DynamicResource AccentBrush}" />
<Setter Property="CornerRadius" Value="6" />
</Style>
<Style Selector="Button.primary:pointerover">
<Setter Property="Background" Value="#1E5BD0" />
</Style>
Apply via Classes="primary" (no per-control reference needed). For full re-skins use ControlTheme (TargetType, nested ^ selectors, ControlTemplate + ContentPresenter + {TemplateBinding}) applied with Theme="{StaticResource …}". Theme the app with <FluentTheme /> and switch light/dark via RequestedThemeVariant (follow OS by default, offer an override). Organize resources/styles into .axaml dictionaries merged with ResourceInclude/StyleInclude; use DynamicResource for theme colours, StaticResource elsewhere.
Modernize legacy code:
<FluentTheme Mode="…"/>→RequestedThemeVariant;Items="{Binding}"→ItemsSource="{Binding}". Both old forms are pre-Avalonia-11.
For hundreds/thousands of items, virtualization is mandatory:
ListBox virtualizes by default (VirtualizingStackPanel) — keep it; bind ItemsSource to ObservableCollection<T>.ItemsControl does not virtualize by default — set its ItemsPanel to VirtualizingStackPanel.ItemsRepeater virtualizes and supports custom layouts (UniformGridLayout for cover grids).<ListBox ItemsSource="{Binding Books}">
<ListBox.ItemsPanel><ItemsPanelTemplate><VirtualizingStackPanel/></ItemsPanelTemplate></ListBox.ItemsPanel>
</ListBox>
Keep item templates lightweight, load thumbnails lazily/async, and filter/group in the view model rather than rendering all rows. DataGrid (package Avalonia.Controls.DataGrid, add its Fluent theme include) suits tabular detail/admin views with explicit columns, not the main browse experience.
Place images under Assets/, set Build Action AvaloniaResource (the default glob already covers Assets/**), and reference with avares://:
<Image Source="avares://App/Assets/icons/shelf.png" Width="32" Height="32" Stretch="Uniform" />
Stretch: Uniform (default), UniformToFill, Fill, None. Load runtime images via new Bitmap(...). Ship icons at the resolutions you use to limit bundle size; for monochrome/scalable iconography prefer vectors (PathIcon/StreamGeometry, or SVG via Avalonia.Svg.Skia); keep colourful raster icons as PNGs. Set Window.Icon for the app/window icon.
.resx resource files per culture (Resources.resx, Resources.fr.resx, …) with the generated strongly typed accessor.CultureInfo.CurrentUICulture at startup; offer an in-app language switch persisted to settings.ILocalizer exposed on view models so switching language refreshes bindings without restart.AutomationProperties.Name (and HelpText/LabeledBy) on interactive and icon-only controls so Narrator/VoiceOver announce them.:focus styles.AutomationPeer when they add new interaction semantics.Avalonia has no first-party WebView. Use a community control (Avalonia.WebView, WebViewControl-Avalonia) wrapping the OS engine (WebView2/Edge-Chromium on Windows, WKWebView on macOS). Bundle web assets as AvaloniaResource (avares://) or serve from localhost loopback. Bridge C# ↔ JS via host objects/message channels and ExecuteScript/PostMessage; marshal results to the UI thread. On Windows, ensure the WebView2 evergreen runtime is installed (bundle the bootstrapper in the installer); WKWebView ships with macOS. Provide a native fallback view in case the WebView fails to initialize.
AvaloniaProperty.Register<TOwner,T>) and custom routed events (RoutedEvent.Register<…> with a RoutingStrategies). Prefer these for composite UI.ControlTheme/ControlTemplate + ContentPresenter + {TemplateBinding}; never hard-code sizes/colours in a template. Use only for genuinely new reusable widgets.Use Skia-backed shapes (Rectangle/Ellipse/Path), Style.Animations keyframes (KeyFrame Cue="x%", Duration, IterationCount, Easing), Transitions per setter (DoubleTransition, BrushTransition, ThicknessTransition, TransformOperationsTransition), and render transforms. Prefer lightweight declarative transitions for hover/selection micro-interactions over per-frame C#.
Dispatcher.UIThread.Post.Grid over deeply nested StackPanels; cache/lazy-load and dispose Bitmaps; avoid Opacity/effects on large lists.Avalonia.Diagnostics, F12 in debug).Avalonia.Headless (+ Avalonia.Headless.XUnit, [AvaloniaTest]) to render and drive the real UI headlessly: simulate input, call Dispatcher.UIThread.RunJobs(), assert on control/view-model state.dotnet publish -c Release -r win-x64 | osx-arm64 | osx-x64; prefer self-contained so users need no separate .NET; trim cautiously (compiled bindings help)..app bundle, codesign + notarize (Gatekeeper), distribute a notarized .dmg; set bundle id, .icns, Info.plist/entitlements.INotifyPropertyChanged boilerplate instead of [ObservableProperty].x:DataType, especially on hot/large lists.ListBox/DataGrid in a ScrollViewer; nesting ScrollViewers; non-virtualized big lists.Style TargetType thinking — Avalonia uses selectors + ControlTheme.<FluentTheme Mode="…"/> and Items="{Binding}" (outdated pre-11 forms)..axaml) + view model, styles/ControlTheme, or a review of existing Avalonia code against these standards.| Artifact | Produced by | Required? | Why |
|---|---|---|---|
| Target platforms and user flows | Product or project brief | required | Defines controls, accessibility, and packaging constraints |
| Existing solution and UI conventions | Repository inspection | optional | Preserves architecture and styling decisions |
| Condition | Choice | Failure avoided |
|---|---|---|
| Large or frequently updated collection | Use a virtualising control with compiled bindings | UI stalls and excess allocation |
| Shared logic has no UI dependency | Keep it in a view model or service | Platform coupling |
| Platform API is unavoidable | Isolate it behind an interface | Broken cross-platform builds |
Read and search the solution first. Edit only when authorised; execute the narrowest build and headless tests available. Network access is optional for version-specific documentation.
If repository access or execution is unavailable, provide a file-level plan and mark build, binding, packaging, and accessibility checks as unverified.
| Category | Artifact | Format | Example |
|---|---|---|---|
| UX quality | Avalonia journey and platform verification | Markdown plus screenshots/test output | keyboard flow, states, binding errors, packaging, failure recovery, and accessibility |
csharp-dotnet-development for language/runtime depth and world-class-engineering for release evidence.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub peterbamuhigire/chwezi-dev-engine --plugin engineering169 skills in this plugin
/accounting-engineUse when designing or implementing double-entry accounting policy and an embedded ledger engine for invoices, payments, stock, balanced postings, mapped accounts, idempotency, reversals, period locks, audit trails, and financial statements./accounting-finance-controllerUse when coordinating accounting and finance implementation reviews, doctrine routing, control evidence, remediation priorities, and release decisions across a software system./advanced-testing-strategyUse when designing or reviewing test strategy for production systems, APIs, mobile apps, SaaS platforms, ERP workflows, and AI-enabled systems. Covers unit, integration, contract, end-to-end, regression, release-gate, and risk-based testing decisions.Other plugins' skills for the same job