avalonia-zafiro-development

Mandatory skills, conventions, and behavioral rules for Avalonia UI development using the Zafiro toolkit.

Author

Install

Hot:7

Download and extract to your skills directory

Copy command and send to OpenClaw for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=sickn33-skills-avalonia-zafiro-development&locale=en&source=copy

Avalonia Zafiro Development Guide

Overview


Avalonia Zafiro Development is a set of mandatory conventions and behavioral guidelines for developing Avalonia UI cross-platform applications using the Zafiro toolkit, implementing maintainable, secure, and predictable applications through a functional reactive MVVM architecture.

Applicable Scenarios

  • Cross-platform desktop application development: When you need to build desktop applications across Windows, macOS, and Linux using Avalonia UI, especially enterprise-level projects with high demands on code quality and maintainability.
  • Reactive data-intensive applications: Applications that need to handle large amounts of dynamic data and complex state management, implementing efficient reactive data pipelines via DynamicData and ReactiveUI.
  • Team collaborative development projects: Multi-person Avalonia projects that require unified coding conventions, naming conventions, and error handling standards to ensure code consistency and readability.
  • Core Features

  • Functional reactive MVVM architecture: A pure MVVM logic implementation based on DynamicData and ReactiveUI, providing declarative data binding and reactive state management, allowing view models to be completely decoupled from views.
  • Safe and predictable error handling: Use a Result type for explicit error handling, avoid using exceptions for control flow, and ensure application stability and predictability.
  • Zafiro toolkit integration: Provides rich Zafiro abstractions and helper methods, including quick operation mappings, common patterns, and extension methods to avoid reinventing the wheel and improve development efficiency.
  • Frequently Asked Questions

    What is the Zafiro toolkit? How is it used for Avalonia development?


    Zafiro is a development toolkit specifically designed for Avalonia UI, providing a complete set of abstraction layers, helper functions, and best-practice guidelines. It helps developers quickly build cross-platform applications that conform to a functional reactive MVVM architecture, with built-in core features like DynamicData pipeline operations, ReactiveUI integration, and Result-type error handling.

    Why use functional reactive MVVM in Avalonia development?


    Functional reactive MVVM combines the separation of concerns of the MVVM pattern with the predictability advantages of functional programming. DynamicData provides powerful collection manipulation capabilities, while ReactiveUI brings a declarative reactive programming experience. This architecture allows ViewModels to be completely independent from the Avalonia UI, facilitating unit testing and cross-platform reuse, while reducing common bugs in state management.

    How to integrate Zafiro into an Avalonia project?


    First, install the relevant Zafiro packages (Zafiro.Core, Zafiro.Avalonia, etc.) via NuGet, then follow Zafiro's three-layer architecture in your project: core business logic (Avalonia-independent), view model layer (using ReactiveUI), and view layer (Avalonia XAML). When writing code according to the guidelines, prioritize using the extension methods and convenience operations provided by Zafiro, and ensure dynamic data is manipulated using DynamicData operators rather than plain Rx.