avalonia-viewmodels-zafiro
它能做什么
这个工具可以帮你使用推荐的设计模式,组织和创建桌面应用的部分内容(称为 ViewModel 和向导)。它能简化多步骤流程和应用内导航的搭建。
适用场景
- ✓当你要开发一个新的图形界面应用时。
- ✓当你需要一个多步骤流程(比如安装向导)时。
- ✓当你想让应用的代码结构更清晰时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/avalonia-viewmodels-zafiro/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我该如何使用推荐的设计模式,为我的应用创建一个安装向导?”
每周 5 个新技能,1 分钟读完。
工作原理
它会借助 ReactiveUI 和 Zafiro 等库,定义用户数据和操作如何与界面连接。这样就能写出更智能的命令,并把分步流程组织得井井有条。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Avalonia ViewModels with Zafiro
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.
Core Principles
- Functional-Reactive Approach: Use ReactiveUI (
ReactiveObject,WhenAnyValue, etc.) to handle state and logic. - Enhanced Commands: Utilize
IEnhancedCommandfor better command management, including progress reporting and name/text attributes. - Wizard Pattern: Implement complex flows using
SlimWizardandWizardBuilderfor a declarative and maintainable approach. - Automatic Section Discovery: Use the
[Section]attribute to register and discover UI sections automatically. - Clean Composition: map ViewModels to Views using
DataTypeViewLocatorand manage dependencies in theCompositionRoot.
Guides
- ViewModels & Commands: Creating robust ViewModels and handling commands.
- Wizards & Flows: Building multi-step wizards with
SlimWizard. - Navigation & Sections: Managing navigation and section-based UIs.
- Composition & Mapping: Best practices for View-ViewModel wiring and DI.
Example Reference
For real-world implementations, refer to the Angor project:
CreateProjectFlowV2.cs: Excellent example of complex Wizard building.HomeViewModel.cs: Simple section ViewModel using functional-reactive commands.
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.
常见问题
什么是 ViewModel?
它是一段代码,负责管理某个用户界面页面或组件的数据和逻辑。
什么是向导?
它是一系列页面或步骤,引导用户完成某个流程,比如设置并安装软件。
什么是 ReactiveUI?
它是一个库,采用响应式编程的方式,帮助你创建响应更灵敏、更易于维护的用户界面。
详情
作者的原始描述
Optimal ViewModel and Wizard creation patterns for Avalonia using Zafiro and ReactiveUI.
热度
- GitHub 星标
- 48k
- 排名
- #3847
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。