
Avalonia Zafiro Development
- 538 installs
- 44k repo stars
- Updated July 27, 2026
- sickn33/antigravity-awesome-skills
avalonia-zafiro-development is a Claude Code skill that keeps Avalonia desktop MVVM code aligned with Zafiro helpers and DynamicData collection pipelines instead of ad-hoc Rx for developers building cross-platform .NET d
About
avalonia-zafiro-development is a desktop UI skill from sickn33/antigravity-awesome-skills governing Avalonia, Zafiro, and Reactive conventions. Strict Avalonia rules forbid System.Drawing, keep ViewModels free of Avalonia types, prefer bindings over code-behind, and use explicit DataTemplates with typed DataContext. Zafiro guidelines require existing helpers, extension methods, and ValidationRule extensions before custom logic. DynamicData is mandatory over raw Rx: Connect, Filter, Transform, Sort, Bind, and DisposeMany operators manage observable collections. Developers reach for it when implementing or reviewing Avalonia MVVM features to avoid footguns like VisualStates abuse or hand-rolled reactive validation. Outputs are compliant ViewModels, binding-driven views, and DynamicData-backed collection pipelines.
- Enforces pure ViewModels with no Avalonia type references and bindings over code-behind
- Mandates DynamicData operators (Connect, Filter, Transform, Sort, Bind, DisposeMany) for collection pipelines
- Documents forbidden anti-patterns: ad-hoc SourceList/SourceCache, logic in Subscribe, redundant System.Reactive operator
- Steers validation through Zafiro ValidationRule extensions instead of one-off reactive checks
- Bans System.Drawing; requires Avalonia types throughout the UI stack
Avalonia Zafiro Development by the numbers
- 538 all-time installs (skills.sh)
- +4 installs in the week ending Jul 27, 2026 (Skillselion tracking)
- Ranked #28 of 154 .NET & C# skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill avalonia-zafiro-developmentAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 538 |
|---|---|
| repo stars | ★ 44k |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 27, 2026 |
| Repository | sickn33/antigravity-awesome-skills ↗ |
How do you structure Avalonia MVVM with DynamicData?
Keep Avalonia desktop MVVM code aligned with Zafiro helpers and DynamicData collection pipelines instead of ad-hoc Rx.
Who is it for?
.NET developers building Avalonia desktop apps who standardize on Zafiro abstractions and DynamicData for reactive collections.
Skip if: Web-only React or WPF teams not using Avalonia UI and the Zafiro helper library on desktop .NET.
When should I use this skill?
The developer writes Avalonia views, ViewModels, Zafiro validation, or DynamicData reactive collection pipelines in C#.
What you get
Pure ViewModels, binding-driven Avalonia views, Zafiro validation rules, and DynamicData collection pipelines without ad-hoc Rx.
- Pure ViewModel classes
- Binding-driven Avalonia views
- DynamicData collection pipelines
By the numbers
- Mandates 6 DynamicData operators: Connect, Filter, Transform, Sort, Bind, and DisposeMany
Files
Avalonia Zafiro Development
This skill defines the mandatory conventions and behavioral rules for developing cross-platform applications with Avalonia UI and the Zafiro toolkit. These rules prioritize maintainability, correctness, and a functional-reactive approach.
Core Pillars
1. Functional-Reactive MVVM: Pure MVVM logic using DynamicData and ReactiveUI. 2. Safety & Predictability: Explicit error handling with Result types and avoidance of exceptions for flow control. 3. Cross-Platform Excellence: Strictly Avalonia-independent ViewModels and composition-over-inheritance. 4. Zafiro First: Leverage existing Zafiro abstractions and helpers to avoid redundancy.
Guides
- Core Technical Skills & Architecture: Fundamental skills and architectural principles.
- Naming & Coding Standards: Rules for naming, fields, and error handling.
- Avalonia, Zafiro & Reactive Rules: Specific guidelines for UI, Zafiro integration, and DynamicData pipelines.
- Zafiro Shortcuts: Concise mappings for common Rx/Zafiro operations.
- Common Patterns: Advanced patterns like
RefreshableCollectionand Validation.
Procedure Before Writing Code
1. Search First: Search the codebase for similar implementations or existing Zafiro helpers. 2. Reusable Extensions: If a helper is missing, propose a new reusable extension method instead of inlining complex logic. 3. Reactive Pipelines: Ensure DynamicData operators are used instead of plain Rx where applicable.
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Avalonia, Zafiro & Reactive Rules
Avalonia UI Rules
- Strict Avalonia: Never use
System.Drawing; always use Avalonia types. - Pure ViewModels: ViewModels must never reference Avalonia types.
- Bindings Over Code-Behind: Logic should be driven by bindings.
- DataTemplates: Prefer explicit
DataTemplates and typedDataContexts. - VisualStates: Avoid using
VisualStatesunless absolutely required.
Zafiro Guidelines
- Prefer Abstractions: Always look for existing Zafiro helpers, extension methods, and abstractions before re-implementing logic.
- Validation: Use Zafiro's
ValidationRuleand validation extensions instead of ad-hoc reactive logic.
DynamicData & Reactive Rules
The Mandatory Approach
- Operator Preference: Always prefer DynamicData operators (
Connect,Filter,Transform,Sort,Bind,DisposeMany) over plain Rx operators when working with collections. - Readable Pipelines: Build and maintain pipelines as a single, readable chain.
- Lifecycle: Use
DisposeWithfor lifecycle management. - Minimal Subscriptions: Subscriptions should be minimal, centralized, and strictly for side-effects.
Forbidden Anti-Patterns
- Ad-hoc Sources: Do NOT create new
SourceList/SourceCacheon the fly for local problems. - Logic in Subscribe: Do NOT place business logic inside
Subscribe. - Operator Mismatch: Do NOT use
System.Reactiveoperators if a DynamicData equivalent exists.
Canonical Patterns
Validation of Dynamic Collections:
this.ValidationRule(
StagesSource
.Connect()
.FilterOnObservable(stage => stage.IsValid)
.IsEmpty(),
b => !b,
_ => "Stages are not valid")
.DisposeWith(Disposables);Filtering Nulls: Use WhereNotNull() in reactive pipelines.
this.WhenAnyValue(x => x.DurationPreset).WhereNotNull()Core Technical Skills & Architecture
Mandatory Expertise
The developer must possess strong expertise in:
- C# and modern .NET: Utilizing the latest features of the language and framework.
- Avalonia UI: For cross-platform UI development.
- MVVM Architecture: Maintaining strict separation between UI and business logic.
- Clean Code & Clean Architecture: Focusing on maintainability and inward dependency flow.
- Functional Programming in C#: Embracing immutability and functional patterns.
- Reactive Programming: Expertise in DynamicData and System.Reactive.
Architectural Principles
- Pure MVVM: Mandatory for all UI code. Logic must be independent of UI concerns.
- Composition over Inheritance: Favor modular building blocks over deep inheritance hierarchies.
- Inward Dependency Flow: Abstractions must not depend on implementations.
- Immutability: Prefer immutable structures where practical to ensure predictability.
- Stable Public APIs: Design APIs carefully to ensure long-term stability and clarity.
Naming & Coding Standards
General Standards
- Explicit Names: Favor clarity over cleverness.
- Async Suffix: Do NOT use the
Asyncsuffix in method names, even if they returnTask. - Private Fields: Do NOT use the
_prefix for private fields. - Static State: Avoid static state unless explicitly justified and documented.
- Method Design: Keep methods small, expressive, and with low cyclomatic complexity.
Error Handling
- Result & Maybe: Use types from CSharpFunctionalExtensions for flow control and error handling.
- Exceptions: Reserved strictly for truly exceptional, unrecoverable situations.
- Boundaries: Never allow exceptions to leak across architectural boundaries.
Common Patterns in Angor/Zafiro
Refreshable Collections
The RefreshableCollection pattern is used to manage lists that can be refreshed via a command, maintaining an internal SourceCache/SourceList and exposing a ReadOnlyObservableCollection.
Implementation
var refresher = RefreshableCollection.Create(
() => GetDataTask(),
model => model.Id)
.DisposeWith(disposable);
LoadData = refresher.Refresh;
Items = refresher.Items;Benefits
- Automatic Loading: Handles the command execution and results.
- Efficient Updates: Uses
EditDiffinternally to update items without clearing the list. - UI Friendly: Exposes
Itemsas aReadOnlyObservableCollectionsuitable for binding.
Mandatory Validation Pattern
When validating dynamic collections, always use the Zafiro validation extension:
this.ValidationRule(
StagesSource
.Connect()
.FilterOnObservable(stage => stage.IsValid)
.IsEmpty(),
b => !b,
_ => "Stages are not valid")
.DisposeWith(Disposables);Error Handling Pipeline
Instead of manual Subscribe, use HandleErrorsWith to pipe errors directly to the user:
LoadProjects.HandleErrorsWith(uiServices.NotificationService, "Could not load projects");Zafiro Reactive Shortcuts
Use these Zafiro extension methods to replace standard, more verbose Reactive and DynamicData patterns.
General Observable Helpers
| Standard Pattern | Zafiro Shortcut |
|---|---|
Replay(1).RefCount() | ReplayLastActive() |
Select(_ => Unit.Default) | ToSignal() |
Select(b => !b) | Not() |
Where(b => b).ToSignal() | Trues() |
Where(b => !b).ToSignal() | Falses() |
Select(x => x is null) | Null() |
Select(x => x is not null) | NotNull() |
Select(string.IsNullOrWhiteSpace) | NullOrWhitespace() |
Select(s => !string.IsNullOrWhiteSpace(s)) | NotNullOrEmpty() |
Result & Maybe Extensions
| Standard Pattern | Zafiro Shortcut |
|---|---|
Where(r => r.IsSuccess).Select(r => r.Value) | Successes() |
Where(r => r.IsFailure).Select(r => r.Error) | Failures() |
Where(m => m.HasValue).Select(m => m.Value) | Values() |
Where(m => !m.HasValue).ToSignal() | Empties() |
Lifecycle Management
| Description | Method |
|---|---|
| Dispose previous item before emitting new one | DisposePrevious() |
| Manage lifecycle within a disposable | DisposeWith(disposables) |
Command & Interaction
| Description | Method |
|---|---|
| Add metadata/text to a ReactiveCommand | Enhance(text, name) |
| Automatically show errors in UI | HandleErrorsWith(notificationService) |
[!TIP]
Always checkZafiro.Reactive.ObservableMixinandZafiro.CSharpFunctionalExtensions.ObservableExtensionsbefore writing custom Rx logic.
Related skills
How it compares
Pick avalonia-zafiro-development over generic C# skills when the stack is Avalonia plus Zafiro with DynamicData collection rules.
FAQ
Why must ViewModels avoid Avalonia types in avalonia-zafiro-development?
avalonia-zafiro-development keeps ViewModels pure by forbidding Avalonia type references, which preserves testability and enforces UI logic through bindings and DataTemplates rather than code-behind or framework leaks.
Which DynamicData operators does avalonia-zafiro-development prefer?
avalonia-zafiro-development mandates DynamicData operators—Connect, Filter, Transform, Sort, Bind, and DisposeMany—over ad-hoc System.Reactive pipelines for observable collection management in Avalonia desktop apps.
Is Avalonia Zafiro Development safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.