dotnet/maui-labs/maui-app-assets-lifecycle
Claude Code and agent skill by dotnet/maui-labs
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Configure MAUI assets and lifecycle. USE FOR: `MauiIcon`, `MauiSplashScreen`, images, fonts, raw assets, `OpenAppPackageFileAsync`, window lifecycle, `ConfigureLifecycleEvents`, resume/state restore, Xamarin asset migration. DO NOT USE FOR: localization, permissions, broad project structure.
Install
npx vskill@latest install dotnet/maui-labs/maui-app-assets-lifecycleSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as dotnet/maui-labs/maui-app-assets-lifecycle.
MAUI App Assets and Lifecycle
Use this skill when a MAUI app needs app identity assets, packaged files, or state handling across start, stop, resume, and multi-window lifecycle events.
Workflow
- Inspect the app project file and
Resourcesfolders before adding assets. - Use MAUI single-project item types for shared assets.
- Put platform-only assets under the matching
Platforms/*folder only when a
shared MAUI asset cannot express the requirement.
- For Xamarin.Forms asset migrations, explicitly map old Android
drawable-*, iOS .xcassets, and iOS Info.plist UIAppFonts font registrations to MAUI MauiImage, MauiFont, Resources/Images, and Resources/Fonts.
- Access bundled raw files through
FileSystem.OpenAppPackageFileAsync. - Use
Windowlifecycle events for cross-platform app/window state. - Use
ConfigureLifecycleEventsfor platform-specific lifecycle hooks. - Persist user/session state before deactivation or stop; restore on resume or
app startup.
- Validate icon/splash/background behavior on each target platform.
Asset Item Types
Use vector SVG sources when possible and let MAUI generate platform-specific sizes. Avoid manually adding resized copies unless a platform requires a custom override.
When migrating from Xamarin.iOS, remove old UIAppFonts entries from Platforms/iOS/Info.plist; MauiFont generates those registrations. Keep font aliases in MAUI's font pipeline, typically with MauiFont items and ConfigureFonts() when explicit aliases are needed. Do not copy Xamarin Android drawable-* folders or iOS .xcassets directly into Platforms/* for images used by MAUI XAML/C#; put shared image assets in Resources/Images as MauiImage items.
Bundled Assets
Put read-only bundled files in Resources/Raw and open them with:
Copy bundled data into app storage before editing it. Files in the app package are read-only.
Lifecycle Guidance
Cross-platform Window lifecycle events are the default place to coordinate state:
CreatedActivatedDeactivatedStoppedResumedDestroying
Use platform lifecycle hooks only for behavior that truly depends on native app events, such as Android activity callbacks or iOS scene/app delegate events.
State Preservation
- Save lightweight preferences in
Preferences. - Save larger state, drafts, and caches in app data files or SQLite.
- Persist in-progress work before
StoppedorDestroying. - Reconcile stale network data after
Resumed. - Treat each window as having separate UI/navigation state when multi-window is
enabled.
- Keep background work platform-specific and explicit; do not assume arbitrary
code continues running after the app is stopped.
Platform Configuration
| Area | Shared default | Platform override examples | |
|---|---|---|---|
| Icon | MauiIcon | Android adaptive icon details, iOS alternate icon metadata | |
| Splash | MauiSplashScreen | Platform launch storyboard/theme customization | |
| Bundled files | MauiAsset in Resources/Raw | Native-only files under Platforms/* | |
| Lifecycle | Window events | ConfigureLifecycleEvents for native callbacks |
Validation Checklist
- Shared assets use MAUI item types and live under
Resources. - Bundled files are read through
FileSystem.OpenAppPackageFileAsync. - Editable data is copied out of the app package.
- Xamarin migration guidance removes old
UIAppFonts/Info.plistfont
registrations when MauiFont/ConfigureFonts() owns shared fonts.
- State is saved before stop/destroy and restored on startup/resume.
- Platform lifecycle hooks are isolated to platform-specific behavior.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/dotnet-maui/skills/maui-app-assets-lifecycle/SKILL.md
Popularity
- Repository stars
- 224
- Repository forks
- 35
- 7-day trend score
- 32
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dotnet/maui-labs/maui-app-assets-lifecycle)