All skills
davila7 avatar

/avalonia-viewmodels-zafiro

@1deb97c

Optimal ViewModel and Wizard creation patterns for Avalonia using Zafiro and ReactiveUI.

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

This session only. Nothing lands on disk.

wizards.md

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

Wizards & Flows

Complex multi-step processes are handled using the SlimWizard pattern. This provides a declarative way to define steps, navigation logic, and final results.

Defining a Wizard

Use WizardBuilder to define the steps. Each step corresponds to a ViewModel.

SlimWizard<string> wizard = WizardBuilder
    .StartWith(() => new Step1ViewModel(data))
        .NextUnit()
        .WhenValid()
    .Then(prevResult => new Step2ViewModel(prevResult))
        .NextCommand(vm => vm.CustomNextCommand)
    .Then(result => new SuccessViewModel("Done!"))
        .Next((_, s) => s, "Finish")
    .WithCompletionFinalStep();

Navigation Rules

  • NextUnit(): Advances when a simple signal is emitted.
  • NextCommand(): Advances when a specific command in the ViewModel execution successfully.
  • WhenValid(): Wait until the current ViewModel's validation passes before allowing navigation.
  • Always(): Navigation is always allowed.

Navigation Integration

The wizard is navigated using an INavigator:

public async Task CreateSomething()
{
    var wizard = BuildWizard();
    var result = await wizard.Navigate(navigator);
    // Handle result
}

Step Configuration

  • WithCompletionFinalStep(): Marks the wizard as finished when the last step completes.
  • WithCommitFinalStep(): Typically used for wizards that perform a final "Save" or "Deploy" action.

[!NOTE] The SlimWizard handles the "Back" command automatically, providing a consistent user experience across different flows.

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides architectural guidelines and code patterns for building Avalonia applications with ReactiveUI and the Zafiro toolkit. No security risks or malicious behaviors were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    5/5 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 16 hours ago.

Activeupdated 8 months ago

README badge

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