avalonia-layout-zafiro – skill Thiết kế & UI cho agent AI
Hướng dẫn bố cục Avalonia UI hiện đại với Zafiro.Avalonia, nhấn mạnh style dùng chung, component tổng quát và tránh lặp XAML.
Cài skill avalonia-layout-zafiro bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/avalonia-layout-zafiro-20fed.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /avalonia-layout-zafiro – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/avalonia-layout-zafiro-20fed.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $avalonia-layout-zafiro – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/avalonia-layout-zafiro-20fed.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /avalonia-layout-zafiro – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/avalonia-layout-zafiro-20fed.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /avalonia-layout-zafiro – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Avalonia Layout with Zafiro.Avalonia
> Master modern, clean, and maintainable Avalonia UI layouts.
> Focus on semantic containers, shared styles, and minimal XAML.
🎯 Selective Reading Rule
Read ONLY files relevant to the layout challenge!
---
The five guides below are bundled; the author-local Angor solution is not. Examples are partial and need the actual Avalonia/Zafiro/package versions and XML namespace declarations; UntouchedClassBehavior and icon resources must exist in that installation. Do not assume MultiBinding supplies logical And/Or without a suitable converter, or merge style files as ResourceDictionary resources when they contain Styles. Use StyleInclude for style collections and ResourceInclude for resource dictionaries as appropriate to the file root. Keep icons accessible, preserve focus/keyboard behavior and test light/dark themes, text scaling and localization. Avoiding converters/code-behind is a design preference, not a universal correctness or performance rule.
📑 Content Map
| File | Description | When to Read |
|------|-------------|--------------|
| themes.md | Theme organization and shared styles | Setting up or refining app themes |
| containers.md | Semantic containers (HeaderedContainer, EdgePanel, Card) | Structuring views and layouts |
| icons.md | Icon usage with IconExtension and IconOptions | Adding and customizing icons |
| behaviors.md | Xaml.Interaction.Behaviors and avoiding Converters | Implementing complex interactions |
| components.md | Generic components and avoiding nesting | Creating reusable UI elements |
---
🔗 Related Project (Exemplary Implementation)
For a real-world example, refer to the Angor project:
/mnt/fast/Repos/angor/src/Angor/Avalonia/Angor.Avalonia.sln
---
✅ Checklist for Clean Layouts
- [ ] Used semantic containers? (e.g.,
HeaderedContainerinstead ofBorderwith manual header) - [ ] Avoided redundant properties? Use shared styles in
axamlfiles. - [ ] Minimized nesting? Flatten layouts using
EdgePanelor generic components. - [ ] Icons via extension? Use
{Icon fa-name}andIconOptionsfor styling. - [ ] Behaviors over code-behind? Use
Interaction.Behaviorsfor UI-logic. - [ ] Avoided Converters? Prefer ViewModel properties or Behaviors unless necessary.
---
❌ Anti-Patterns
DON'T:
- Use hardcoded colors or sizes (literals) in views.
- Create deep nesting of
GridandStackPanel. - Repeat visual properties across multiple elements (use Styles).
- Use
IValueConverterfor simple logic that belongs in the ViewModel.
DO:
- Use
DynamicResourcefor colors and brushes. - Extract repeated layouts into generic components.
- Leverage
Zafiro.Avaloniaspecific panels likeEdgePanelfor common UI patterns.
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.
Skill liên quan
- avalonia-zafiro-development – Kỹ năng bắt buộc, quy ước và quy tắc hành vi khi phát triển Avalonia UI với bộ công cụ…
- offers – Khi người dùng muốn thiết kế, xây dựng hoặc cải thiện một offer — thứ họ thực sự bán —…
- interaction-design – Thiết kế và triển khai microinteraction, motion design, hiệu ứng chuyển cảnh và các mẫu…
- commercial-policy – Dùng khi thiết kế hoặc chỉnh sửa chính sách thương mại của công ty — các quy tắc tham…
- hunt-nextjs – Săn lỗ hổng đặc thù Next.js: thực thi hàm tùy ý qua Server Actions, vượt qua xác thực…
- gitnexus-explorer – Chạy giao diện web tương tác để khám phá đồ thị tri thức của codebase.
- kpi-dashboard-design – Thiết kế dashboard KPI hiệu quả với lựa chọn chỉ số, thực hành trực quan hóa tốt nhất và…
- confluence-expert – Chuyên gia Atlassian Confluence để tạo và quản lý space, knowledge base và tài liệu. Cấu…