.NET MAUI — UI Best Practices Skill
Purpose
This skill defines the recommended UI/UX patterns, layout strategies, styling conventions, accessibility rules, and performance guidelines for .NET MAUI applications. It ensures that all generated UI code is consistent, maintainable, responsive, and aligned with modern cross-platform design expectations.
The goal is to help agents produce clean, scalable, and accessible XAML and C# UI code across Android, iOS, Windows, and MacCatalyst.
Core Principles
- Simplicity first
Use minimal layout nesting, clear structure, and predictable patterns.
- Consistency
Centralize styles, colors, and fonts in
Resources/Styles.
- Responsiveness
Use adaptive layouts (
OnIdiom, OnPlatform, Grid, FlexLayout) to support all devices.
- Accessibility
Provide semantic properties, proper contrast, and screen reader support.
- Performance
Prefer compiled bindings, lightweight controls, and efficient layout containers.
Categories of Rules
- Layout & Structure
- Styling & Theming
- Controls & Components
- Accessibility
- Performance
Each rule is stored in the rules/ directory and should be applied whenever generating UI code.
Agent Usage Guidelines
- When generating XAML, follow the layout and styling rules.
- When creating new pages, apply consistent structure:
- Root layout should be
Grid or VerticalStackLayout.
- Avoid deeply nested layouts.
- Use styles instead of inline properties.
- When generating controls, prefer reusable components in
/Views/Controls.
- When asked to “make the UI responsive,” apply idiom/platform conditions.
- When asked to “improve performance,” apply rules from the performance category.
Out of Scope
- Business logic (covered in other skills)
- Authentication UI flows (covered in
maui-authentication)
- Deployment or platform packaging
1---2name: maui-ui-best-practices3description: Defines recommended UI/UX patterns, layout strategies, styling conventions, accessibility rules, and performance guidelines for .NET MAUI applications.4---56# .NET MAUI — UI Best Practices Skill78## Purpose910This skill defines the recommended UI/UX patterns, layout strategies, styling conventions, accessibility rules, and performance guidelines for .NET MAUI applications. It ensures that all generated UI code is consistent, maintainable, responsive, and aligned with modern cross-platform design expectations.1112The goal is to help agents produce clean, scalable, and accessible XAML and C# UI code across Android, iOS, Windows, and MacCatalyst.1314## Core Principles15161. **Simplicity first**17 Use minimal layout nesting, clear structure, and predictable patterns.182. **Consistency**19 Centralize styles, colors, and fonts in `Resources/Styles`.203. **Responsiveness**21 Use adaptive layouts (`OnIdiom`, `OnPlatform`, `Grid`, `FlexLayout`) to support all devices.224. **Accessibility**23 Provide semantic properties, proper contrast, and screen reader support.245. **Performance**25 Prefer compiled bindings, lightweight controls, and efficient layout containers.2627## Categories of Rules2829- Layout & Structure30- Styling & Theming31- Controls & Components32- Accessibility33- Performance3435Each rule is stored in the `rules/` directory and should be applied whenever generating UI code.3637## Agent Usage Guidelines3839- When generating XAML, follow the layout and styling rules.40- When creating new pages, apply consistent structure:41 - Root layout should be `Grid` or `VerticalStackLayout`.42 - Avoid deeply nested layouts.43 - Use styles instead of inline properties.44- When generating controls, prefer reusable components in `/Views/Controls`.45- When asked to “make the UI responsive,” apply idiom/platform conditions.46- When asked to “improve performance,” apply rules from the performance category.4748## Out of Scope4950- Business logic (covered in other skills)51- Authentication UI flows (covered in `maui-authentication`)52- Deployment or platform packaging