前端设计
- 作者仓库星标 18
- 作者更新于 实时读取
- 作者仓库 claude-skills
- 领域
- 运维部署
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 89 / 100 · 社区维护
- 作者 / 版本 / 许可
- @markpitt · v2.0 · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。;上游仓库已 184 天未更新,可能与最新 agent 行为不一致。
---
name: avalonia
description: Expert guidance for developing cross-platform desktop applications with Avalonia UI framework. U…
category: 运维部署
runtime: 无特殊运行时
---
# avalonia 输出预览
## PART A: 任务判断
- 适用问题:部署、CI、环境检查、发布或运维排障。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Quick Reference: When to Load Which Resource / Framework Overview / Standard Project Structure”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于部署、CI、环境检查、发布或运维排障,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Quick Reference: When to Load Which Resource / Framework Overview / Standard Project Structure”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“Quick Reference: When to Load Which Resource / Framework Overview / Standard Project Structure”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: avalonia
description: Expert guidance for developing cross-platform desktop applications with Avalonia UI framework. U…
category: 运维部署
source: markpitt/claude-skills
---
# avalonia
## 什么时候使用
- avalonia 是运维部署方向的技能,让 Agent 操作环境、改配置、跑发布流程 适合处理部署、CI、发布、回滚、环境检查和运维排障,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执…
- 面向部署、CI、环境检查、发布或运维排障,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Quick Reference: When to Load Which Resource / Framework Overview / Standard Project Structure」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "avalonia" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Quick Reference: When to Load Which Resource / Framework Overview / Standard Project Structure
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Avalonia UI Framework - Orchestration Hub
Modular guidance for cross-platform desktop and mobile development using Avalonia, a WPF-inspired XAML-based framework for .NET.
Quick Reference: When to Load Which Resource
| Task/Goal | Load Resource |
|---|---|
| MVVM patterns, data binding, dependency injection, value converters | resources/mvvm-databinding.md |
| UI controls reference (layouts, inputs, collections, menus) | resources/controls-reference.md |
| Custom controls, advanced layouts, performance optimization, virtualization | resources/custom-controls-advanced.md |
| Styling, themes, animations, control templates | resources/styling-guide.md |
| Reactive patterns, commands, observables, animations | resources/reactive-animations.md |
| Windows, macOS, Linux, iOS, Android implementation details | resources/platform-specific.md |
Framework Overview
Avalonia is a cross-platform XAML framework supporting:
- Platforms: Windows, macOS, Linux, iOS, Android, WebAssembly
- Architecture: MVVM with ReactiveUI support
- Styling: CSS-like selectors with Fluent/Simple themes
- Features: Data binding, reactive commands, observable collections, custom controls
- Modern .NET: .NET 6+ and .NET Standard 2.0
Standard Project Structure
MyAvaloniaApp/
├── MyAvaloniaApp/ # Shared code
│ ├── App.axaml
│ ├── Views/ # XAML views
│ ├── ViewModels/ # Business logic + state
│ ├── Models/ # Data models
│ ├── Services/ # Application services
│ ├── Converters/ # Value converters
│ ├── Assets/ # Images, fonts
│ └── Styles/ # Style resources
├── MyAvaloniaApp.Desktop/ # Desktop-specific (Win/Mac/Linux)
├── MyAvaloniaApp.Android/ # Android-specific (optional)
├── MyAvaloniaApp.iOS/ # iOS-specific (optional)
└── MyAvaloniaApp.Browser/ # WebAssembly (optional)
Getting Started
Minimal Setup
// Program.cs
public static void Main(string[] args)
{
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
public static AppBuilder BuildAvaloniaApp() =>
AppBuilder.Configure<App>()
.UsePlatformDetect()
.LogToTrace();
<!-- App.axaml -->
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="MyApp.App">
<Application.Styles>
<FluentTheme />
</Application.Styles>
</Application>
<!-- Views/MainWindow.axaml -->
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="MyApp.Views.MainWindow"
Title="My Application"
Width="800"
Height="600">
<StackPanel Padding="20" Spacing="10">
<TextBlock Text="Hello, Avalonia!" FontSize="24" FontWeight="Bold" />
</StackPanel>
</Window>
Core Patterns
MVVM Architecture Pattern
- View (XAML): UI presentation with data bindings
- ViewModel (C#): State management and commands
- Model (C#): Business logic and data access
- Service: Cross-cutting concerns (DI/IoC)
Load resources/mvvm-databinding.md for:
- ViewModel base classes
- Data binding modes and paths
- Multi-binding and converters
- Dependency injection setup
- Design-time data
Reactive Programming Pattern
Leverage ReactiveUI for event-driven UI updates:
this.WhenAnyValue(x => x.SearchText)
.Debounce(TimeSpan.FromMilliseconds(300))
.Subscribe(text => PerformSearch(text));
Load resources/reactive-animations.md for:
- Reactive properties and commands
- Observable sequences
- Animations and transitions
- Performance optimization
Platform-Adaptive Pattern
Design once, adapt per platform:
<OnPlatform Default="16">
<On Options="Windows" Content="14" />
<On Options="macOS" Content="15" />
</OnPlatform>
Load resources/platform-specific.md for:
- Runtime platform detection
- Platform-specific services
- Conditional UI rendering
- Native dialogs and features
Navigation by Task
"I need to build a form with validation"
- Load
resources/mvvm-databinding.md→ Implement ViewModel with property validation - Load
resources/controls-reference.md→ Find TextBox, ComboBox, Button controls - Load
resources/reactive-animations.md→ Add debounced validation with observables
"I'm seeing poor performance with large lists"
- Load
resources/custom-controls-advanced.md→ Enable virtualization - Load
resources/mvvm-databinding.md→ Use compiled bindings - Load
resources/reactive-animations.md→ Debounce/throttle updates
"I need platform-specific behavior"
- Load
resources/platform-specific.md→ Implement service interfaces - Load
resources/mvvm-databinding.md→ Register platform implementations via DI - Platform-specific
resources/→ Implement per-platform project
"I want custom styling and animations"
- Load
resources/styling-guide.md→ Define styles and themes - Load
resources/reactive-animations.md→ Add animations to styles - Load
resources/custom-controls-advanced.md→ Custom control templates
"I'm building a complex control"
- Load
resources/custom-controls-advanced.md→ TemplatedControl or UserControl pattern - Load
resources/mvvm-databinding.md→ Attached properties and data binding - Load
resources/styling-guide.md→ Control templates and styling
Resource Organization
mvvm-databinding.md (Primary)
- Architecture overview
- ViewModel patterns with ReactiveUI
- Binding modes and syntax
- Value converters
- Collections and list binding
- Design-time data
- Master-detail and tab patterns
controls-reference.md (Primary)
- Layout controls (Grid, StackPanel, DockPanel, etc.)
- Input controls (TextBox, Button, CheckBox, ComboBox, etc.)
- Display controls (TextBlock, Image, ProgressBar, etc.)
- Collection controls (ListBox, DataGrid, TreeView, etc.)
- Navigation (Menu, TabControl, SplitView, etc.)
- Shapes and drawing
styling-guide.md (Primary)
- CSS-like selectors (type, class, pseudo-classes)
- Resource dictionaries and themes
- Control templates
- Data templates
- Animations and transitions
- Easing functions
- Theme variants (light/dark)
reactive-animations.md (Advanced)
- ReactiveUI integration
- Reactive properties
- Reactive commands (sync and async)
- Observable sequences
- Filtering, transformation, combining
- Programmatic animations
- Common patterns (search, validation, auto-complete)
custom-controls-advanced.md (Advanced)
- Custom TemplatedControl creation
- User control composition
- Advanced layouts
- Virtualization
- Performance optimization
- Render transforms
- Graphics and drawing
platform-specific.md (Advanced)
- Runtime platform detection
- Multi-project structure
- Service abstractions
- Platform-specific implementations
- Window management per platform
- File system access
- Native features (Windows DLL, macOS Cocoa, etc.)
Common Workflows
Build a Desktop App (Windows/macOS/Linux)
1. → Setup: Standard project structure + FluentTheme
2. → Create Views and ViewModels following MVVM
3. → Use controls-reference for UI layouts
4. → Add styles with styling-guide
5. → Implement services with DI (mvvm-databinding)
6. → Add animations with reactive-animations
7. → Test on each platform with platform-specific guidance
Build a Cross-Platform Mobile+Desktop App
1. → Create shared project + platform-specific projects
2. → Define service interfaces in shared code (mvvm-databinding)
3. → Implement services per platform (platform-specific)
4. → Use OnPlatform for adaptive UI
5. → Register platform implementations via DI
6. → Test thoroughly on each target (iOS/Android/Windows/Mac)
Add Real-Time Search
1. → Create SearchViewModel (mvvm-databinding)
2. → Use ObservableCollection for results (mvvm-databinding)
3. → Implement with reactive search pattern (reactive-animations)
4. → Debounce input to reduce API calls
5. → Display with ListBox (controls-reference)
6. → Style with appropriate CSS selectors (styling-guide)
Build Complex Data-Driven UI
1. → Design ViewModel hierarchy (mvvm-databinding)
2. → Create master-detail view (mvvm-databinding)
3. → Use DataGrid for tabular data (controls-reference)
4. → Add sorting/filtering with observables (reactive-animations)
5. → Optimize with virtualization (custom-controls-advanced)
6. → Add custom controls if needed (custom-controls-advanced)
Best Practices Summary
Architecture
- Maintain strict MVVM separation of concerns
- Use dependency injection for testability
- Keep business logic in ViewModels, not Views
Performance
- Enable compiled bindings with
x:DataType - Virtualize large collections
- Debounce rapid updates
Styling
- Use resource dictionaries for consistency
- Support light and dark themes
- Test styles on all target platforms
Reactive Patterns
- Use observables for event-driven updates
- Debounce/throttle input-triggered operations
- Always handle ThrownExceptions on commands
Testing
- Unit test ViewModels in isolation
- Use Avalonia.Headless for UI testing
- Provide design-time DataContext in XAML
Cross-Platform Deployment
- Windows: ClickOnce, MSI, portable exe
- macOS: DMG, homebrew
- Linux: AppImage, snap, flatpak
- Mobile: Apple App Store, Google Play Store
- Web: Static hosting (WASM runtime required)
Refer to resources/platform-specific.md for platform-specific build and deployment guidance.
Navigation: Choose a resource above based on your task. Each resource is self-contained with comprehensive examples and best practices.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核