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.

patterns.md

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

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 EditDiff internally to update items without clearing the list.
  • UI Friendly: Exposes Items as a ReadOnlyObservableCollection suitable 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");

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