All skills
davila7 avatar

/avalonia-zafiro-development

@1deb97c

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

Use this Skill: https://skilld.dev/gh/davila7/claude-code-templates/avalonia-zafiro-development

This session only. Nothing lands on disk.

avalonia-reactive-rules.md

≈488 tokens on demand. Your agent reads this file only when SKILL.md points to it.

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 typed DataContexts.
  • VisualStates: Avoid using VisualStates unless absolutely required.

Zafiro Guidelines

  • Prefer Abstractions: Always look for existing Zafiro helpers, extension methods, and abstractions before re-implementing logic.
  • Validation: Use Zafiro's ValidationRule and 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 DisposeWith for 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 / SourceCache on the fly for local problems.
  • Logic in Subscribe: Do NOT place business logic inside Subscribe.
  • Operator Mismatch: Do NOT use System.Reactive operators 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()

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill defines development conventions and architectural standards for Avalonia UI and the Zafiro toolkit. It consists exclusively of documentation and coding guidelines with no executable scripts or malicious patterns.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    6/6 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 1deb97c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 19 hours ago.

Activeupdated 8 months ago

README badge

README badge for davila7/claude-code-templates/avalonia-zafiro-development