dotnet/maui-labs/maui-app-assets-lifecycle

Claude Code and agent skill by dotnet/maui-labs

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

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-lifecycle

Semi-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

  1. Inspect the app project file and Resources folders before adding assets.
  2. Use MAUI single-project item types for shared assets.
  3. Put platform-only assets under the matching Platforms/* folder only when a

shared MAUI asset cannot express the requirement.

  1. 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.

  1. Access bundled raw files through FileSystem.OpenAppPackageFileAsync.
  2. Use Window lifecycle events for cross-platform app/window state.
  3. Use ConfigureLifecycleEvents for platform-specific lifecycle hooks.
  4. Persist user/session state before deactivation or stop; restore on resume or

app startup.

  1. Validate icon/splash/background behavior on each target platform.

Asset Item Types

xml
<MauiIcon Include="Resources/AppIcon/appicon.svg" ForegroundFile="Resources/AppIcon/appiconfg.svg" Color="#512BD4" />
<MauiSplashScreen Include="Resources/Splash/splash.svg" Color="#512BD4" BaseSize="128,128" />
<MauiImage Include="Resources/Images/*" />
<MauiFont Include="Resources/Fonts/*" />
<MauiAsset Include="Resources/Raw/**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />

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:

csharp
await using var stream = await FileSystem.OpenAppPackageFileAsync("seed.json");

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:

  • Created
  • Activated
  • Deactivated
  • Stopped
  • Resumed
  • Destroying

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 Stopped or Destroying.
  • 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

AreaShared defaultPlatform override examples
IconMauiIconAndroid adaptive icon details, iOS alternate icon metadata
SplashMauiSplashScreenPlatform launch storyboard/theme customization
Bundled filesMauiAsset in Resources/RawNative-only files under Platforms/*
LifecycleWindow eventsConfigureLifecycleEvents 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.plist font

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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dotnet/maui-labs/maui-app-assets-lifecycle/badge)](https://verified-skill.com/skills/dotnet/maui-labs/maui-app-assets-lifecycle)

Something wrong with this skill or its page? Tell us.