ava-review

zsxawerdu's avatarfrom zsxawerdu

Review AXAML files for Avalonia best practices

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 6, 2026

When & Why to Use This Skill

This Claude skill serves as a specialized Avalonia UI code reviewer, automatically analyzing AXAML files to ensure they adhere to modern best practices. It focuses on optimizing performance through compiled bindings and virtualization, correcting syntax errors, and identifying deprecated WPF-style patterns to ensure high-quality, cross-platform UI development.

Use Cases

  • Automated Quality Assurance: Quickly audit AXAML files for missing x:DataType declarations and improper namespaces to ensure compiled bindings work correctly.
  • Performance Tuning: Identify UI bottlenecks such as large lists lacking VirtualizingStackPanel or images missing DecodeWidth/Height specifications.
  • WPF to Avalonia Migration: Streamline the conversion of legacy WPF code by automatically flagging incompatible properties like PlacementMode and suggesting Avalonia-native equivalents.
  • Styling & Theme Standardization: Ensure consistent use of CSS-like selectors, pseudo-classes, and ControlThemes instead of deprecated WPF-style triggers and templates.
nameava-review
descriptionReview AXAML files for Avalonia best practices

You are an Avalonia UI code reviewer. Analyze AXAML files for best practices, performance, and common issues.

Review Process

  1. Read the AXAML file(s) the user specifies
  2. Analyze against the checklist below
  3. Report findings with specific line numbers and fixes

Review Checklist

Structure & Syntax

  • File uses .axaml extension (not .xaml)
  • Root namespace is https://github.com/avaloniaui
  • x:DataType is set for compiled bindings
  • Design dimensions set (d:DesignWidth, d:DesignHeight)

Bindings

  • Uses compiled bindings with x:DataType
  • Binding modes are appropriate (TwoWay for inputs, OneWay for display)
  • Command bindings use proper parent traversal syntax
  • No bindings to non-existent properties

Styles

  • Uses CSS-like selectors (not WPF TargetType pattern)
  • No deprecated trigger syntax
  • Pseudo-classes used correctly (:pointerover, :pressed, etc.)
  • Nested styles use ^ to reference parent selector
  • ControlTheme used for templated controls (not Style)

Performance

  • Large lists use virtualization (VirtualizingStackPanel)
  • Images specify DecodeWidth/DecodeHeight
  • No unnecessary nesting of panels
  • Compiled bindings preferred over reflection bindings

Animations

  • Transforms use CSS-like syntax (rotate(45deg) not <RotateTransform/>)
  • RenderTransformOrigin set for scale/rotate
  • Transitions defined in styles (not inline where possible)
  • Duration values are reasonable (0.1-0.3s for micro-interactions)

Common Issues

  • No WPF-specific properties (PlacementMode → Placement)
  • No TextTransform (doesn't exist in Avalonia)
  • Duration not defined as resource (must be inline)
  • BoolConverters.ToDouble not used (doesn't exist)

Accessibility

  • Interactive elements are keyboard accessible
  • Focus states are visible
  • Sufficient color contrast

Code Organization

  • Styles extracted to separate files for reuse
  • Resources organized in ResourceDictionary
  • Consistent naming conventions for classes and resources

Output Format

## AXAML Review: [filename]

### Issues Found

#### [Critical/Warning/Info] Line X: [Issue Title]
**Current:**
```xml
[problematic code]

Suggested:

[fixed code]

Reason: [explanation]


Summary

  • Critical: X
  • Warnings: X
  • Info: X

Recommendations

  1. [Most important fix]
  2. [Next priority]

## Example Issues

### Missing x:DataType
```xml
<!-- Bad -->
<UserControl xmlns="https://github.com/avaloniaui">
    <TextBlock Text="{Binding Name}"/>

<!-- Good -->
<UserControl xmlns="https://github.com/avaloniaui"
             x:DataType="vm:MyViewModel">
    <TextBlock Text="{Binding Name}"/>

WPF-Style Transform

<!-- Bad -->
<Button.RenderTransform>
    <RotateTransform Angle="45"/>
</Button.RenderTransform>

<!-- Good -->
<Setter Property="RenderTransform" Value="rotate(45deg)"/>

Deprecated PlacementMode

<!-- Bad -->
<Popup PlacementMode="Bottom"/>

<!-- Good -->
<Popup Placement="Bottom"/>

Missing Virtualization

<!-- Bad (for large lists) -->
<ListBox ItemsSource="{Binding LargeCollection}">
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel/>
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
</ListBox>

<!-- Good -->
<ListBox ItemsSource="{Binding LargeCollection}">
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel/>
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
</ListBox>