What this prompt does
This prompt builds a .NET MAUI cross-platform application for an [app_purpose] targeting [platforms]. It organizes the project with an [architecture_pattern] and Shell navigation, defines routes for [screens], creates [shared_pages] shared XAML pages that adapt across phone, tablet, and desktop using OnPlatform and OnIdiom, and implements [platform_features] through partial classes and conditional compilation. It also sets up an offline-first data layer with [local_storage] and native API access for [native_apis].
The structure works because one codebase across iOS, Android, and desktop only stays maintainable if the platform seams are deliberate. The prompt establishes where OnPlatform divergence and dependency-injection abstractions matter most, sets up Shell flyout, tab, and modal navigation for [menu_items], [tab_items], and [modal_pages], and includes a testing step with [test_approach]. Offline-first caching that syncs when online is treated as a first-class concern rather than bolted on later.
When to use it
- A client needs one codebase across
[platforms]instead of separate native apps - You are planning Shell navigation and routes for
[screens]before building - You need shared XAML that adapts across form factors via
OnPlatformandOnIdiom - You need platform-specific features like
[platform_features]abstracted cleanly - You want an offline-first data layer with
[local_storage]that syncs when connectivity returns - You need native APIs such as
[native_apis]integrated through proper handlers
Example output
Expect a project plan and code: an MVVM-structured solution with Shell routes, shared XAML pages using OnPlatform and OnIdiom for responsive layout, partial-class abstractions for platform-specific features, an offline-first data layer with local caching and sync logic, Shell navigation configured for flyout, tab, and modal pages, DI registration with platform-specific implementations, native-API integration via handlers or the Community Toolkit, and unit and UI test setup.
Pro tips
- Name your
[platforms]precisely, since Windows desktop and mobile differ enough thatOnIdiomandOnPlatformbranches need real thought, not copy-paste - Keep
[platform_features]behind an interface so ViewModels stay testable and platform code lives only in the partial-class implementations - Design the offline-first layer around conflict resolution early; deciding how
[local_storage]reconciles with the server after reconnect is harder to retrofit - Register
[di_services]with platform-specific implementations so the same ViewModel runs everywhere while the concrete service swaps per platform - Use the Community Toolkit for common
[native_apis]before writing custom handlers, since it covers camera, geolocation, and notifications already - Treat UI tests with
[test_approach]as a smoke layer; they are slower and flakier than ViewModel unit tests, so put most assertions in the latter - Map your
[screens]to Shell routes early so deep linking and back-navigation behave consistently rather than being patched in later - Test responsive layouts on a real tablet and desktop, not just a phone emulator, since
OnIdiombranches are easy to get subtly wrong across form factors