$npx -y skills add SamarthaKV29/antigravity-god-mode --skill avalonia-viewmodels-zafiroOptimal ViewModel and Wizard creation patterns for Avalonia using Zafiro and ReactiveUI.
| 1 | # Avalonia ViewModels with Zafiro |
| 2 | |
| 3 | This skill provides a set of best practices and patterns for creating ViewModels, Wizards, and managing navigation in Avalonia applications, leveraging the power of **ReactiveUI** and the **Zafiro** toolkit. |
| 4 | |
| 5 | ## Core Principles |
| 6 | |
| 7 | 1. **Functional-Reactive Approach**: Use ReactiveUI (`ReactiveObject`, `WhenAnyValue`, etc.) to handle state and logic. |
| 8 | 2. **Enhanced Commands**: Utilize `IEnhancedCommand` for better command management, including progress reporting and name/text attributes. |
| 9 | 3. **Wizard Pattern**: Implement complex flows using `SlimWizard` and `WizardBuilder` for a declarative and maintainable approach. |
| 10 | 4. **Automatic Section Discovery**: Use the `[Section]` attribute to register and discover UI sections automatically. |
| 11 | 5. **Clean Composition**: map ViewModels to Views using `DataTypeViewLocator` and manage dependencies in the `CompositionRoot`. |
| 12 | |
| 13 | ## Guides |
| 14 | |
| 15 | - [ViewModels & Commands](viewmodels.md): Creating robust ViewModels and handling commands. |
| 16 | - [Wizards & Flows](wizards.md): Building multi-step wizards with `SlimWizard`. |
| 17 | - [Navigation & Sections](navigation_sections.md): Managing navigation and section-based UIs. |
| 18 | - [Composition & Mapping](composition.md): Best practices for View-ViewModel wiring and DI. |
| 19 | |
| 20 | ## Example Reference |
| 21 | |
| 22 | For real-world implementations, refer to the **Angor** project: |
| 23 | - `CreateProjectFlowV2.cs`: Excellent example of complex Wizard building. |
| 24 | - `HomeViewModel.cs`: Simple section ViewModel using functional-reactive commands. |