Agent skill

Maui File Handling

by davidortinau in davidortinau/maui-skills

Guidance for file picker, file system helpers, bundled assets, and app data storage in .NET MAUI applications.

MITAuto-check passedMobile

Install Maui File Handling

skills CLI
$ npx skills add davidortinau/maui-skills --skill maui-file-handling -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davidortinau/maui-skills maui-file-handling --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davidortinau/maui-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/maui-skills/skills/maui-file-handling .claude/skills/maui-file-handling && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
maui-file-handling
GitHub stars
175
Token cost
~1.3k tokens
SKILL.md length
282 words
Files
2 (incl. references)
Skills in repo
41
Repo updated
First seen
Licence
MIT

At a glance

Guidance for file picker, file system helpers, bundled assets, and app data storage in .NET MAUI applications.

  • FileSystem helpers
  • SKILL.md covers Critical: Always Use…, Platform File-Type Format Gotcha, Common Pitfalls and Android Permissions (API 33+…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • AppDataDirectory

What it does

Maui File Handling is an agent skill from davidortinau/maui-skills. Guidance for file picker, file system helpers, bundled assets, and app data storage in .NET MAUI applications. Covers FilePicker APIs, FileResult handling, platform permissions, and common pitfalls across Android, iOS, macOS, and Windows. USE FOR: "file picker", "FilePicker", "pick file", "open file", "save file", "bundled assets", "FileSystem helpers", "AppDataDirectory", "CacheDirectory", "FileResult", "read file MAUI". DO NOT USE FOR: media capture or photo picking (use maui-media-picker), secure credential…

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/file-handling-api.md`).

It sits in Mobile, covering Cross-platform mobile apps. It works with Android, iOS, macOS and SQLite. The repository describes itself as: .NET MAUI skills for GitHub Copilot and Claude Code. The licence is MIT.

When your agent uses it

  • FileSystem helpers
  • AppDataDirectory
  • : media capture
  • Photo picking (use maui-media-picker)

Example prompts

  • “file picker”
  • “FilePicker”
  • “pick file”
  • “/maui-file-handling”

What it can do on your machine

Read from SKILL.md and the folder at commit 79bb4bf. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Maui File Handling loads about 1.3k tokens when it runs, and up to ~2.6k if it reads all its reference files. Until then it costs about 156 tokens; SKILL.md has 282 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~156
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from davidortinau/maui-skills at commit 79bb4bf, republished under its MIT licence (© davidortinau). 282 words, ~1,290 tokens.

Download SKILL.mdSave it as .claude/skills/maui-file-handling/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
maui-file-handling
description
Guidance for file picker, file system helpers, bundled assets, and app data storage in .NET MAUI applications. Covers FilePicker APIs, FileResult handling, platform permissions, and common pitfalls across Android, iOS, macOS, and Windows. USE FOR: "file picker", "FilePicker", "pick file", "open file", "save file", "bundled assets", "FileSystem helpers", "AppDataDirectory", "CacheDirectory", "FileResult", "read file MAUI". DO NOT USE FOR: media capture or photo picking (use maui-media-picker), secure credential storage (use maui-secure-storage), or SQLite database files (use maui-sqlite-database).

.NET MAUI File Handling

Critical: Always Use OpenReadAsync(), Not FullPath

Some platforms (especially Android) return content URIs, not file system paths. Reading FullPath directly will throw or return empty data.

csharp
// ❌ Breaks on Android — FullPath may be a content:// URI
var result = await FilePicker.Default.PickAsync();
var bytes = File.ReadAllBytes(result.FullPath);

// ✅ Works on all platforms
var result = await FilePicker.Default.PickAsync();
if (result is not null)
{
    using var stream = await result.OpenReadAsync();
    // process stream
}

Platform File-Type Format Gotcha

Each platform uses a different format for custom FilePickerFileType. Mixing them up causes the picker to show no files or crash.

PlatformFormatExample
AndroidMIME types"application/json"
iOS / macOSUTType identifiers"public.json"
WindowsDot-prefixed extensions".json"
csharp
// ❌ Using file extensions for Android — picker shows nothing
{ DevicePlatform.Android, new[] { ".json", ".txt" } }

// ✅ Correct MIME types for Android
{ DevicePlatform.Android, new[] { "application/json", "text/plain" } }

Common Pitfalls

Bundled files are read-only

Resources/Raw assets cannot be modified at runtime. Attempting to write throws an exception (or silently fails on some platforms).

csharp
// ❌ Trying to write to a bundled file
var path = "data.json"; // inside Resources/Raw
File.WriteAllText(path, newContent); // fails

// ✅ Copy to AppDataDirectory first, then modify
string targetPath = Path.Combine(FileSystem.Current.AppDataDirectory, "data.json");
if (!File.Exists(targetPath))
{
    using var source = await FileSystem.Current.OpenAppPackageFileAsync("data.json");
    using var dest = File.Create(targetPath);
    await source.CopyToAsync(dest);
}
// Now safe to read/write targetPath
Bundled subdirectories are flattened

On some platforms, Resources/Raw/subdir/file.txt becomes just file.txt. Use unique file names regardless of subdirectory structure.

iOS sandbox path changes on rebuild

The iOS sandbox path includes an app GUID that changes across clean builds. Hard-coded absolute paths break silently.

csharp
// ❌ Hard-coded path — breaks after clean rebuild
var path = "/var/mobile/.../Documents/data.json";

// ✅ Always use the FileSystem helper
var path = Path.Combine(FileSystem.Current.AppDataDirectory, "data.json");
Android: bundled stream has no Length

OpenAppPackageFileAsync may return a stream where .Length throws NotSupportedException. Copy to a MemoryStream if you need the size.

csharp
// ❌ Throws on Android
using var stream = await FileSystem.Current.OpenAppPackageFileAsync("data.json");
var size = stream.Length; // NotSupportedException

// ✅ Copy first if you need the length
using var stream = await FileSystem.Current.OpenAppPackageFileAsync("data.json");
using var ms = new MemoryStream();
await stream.CopyToAsync(ms);
var size = ms.Length;
Windows: virtualized file system

Packaged apps silently redirect writes to classic paths like %AppData%. Always use AppDataDirectory and CacheDirectory for reliable cross-platform paths.

FilePicker returns null on cancellation
csharp
// ❌ NullReferenceException when user cancels
var result = await FilePicker.Default.PickAsync();
using var stream = await result.OpenReadAsync();

// ✅ Always null-check
var result = await FilePicker.Default.PickAsync();
if (result is null) return;
using var stream = await result.OpenReadAsync();

Android Permissions (API 33+ change)

Android 13 replaced READ_EXTERNAL_STORAGE with granular media permissions. Using the old permission on API 33+ silently grants nothing.

Android versionRequired permission
≤ 12 (API 32)READ_EXTERNAL_STORAGE
≥ 13 (API 33)READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO

Checklist

  • Use OpenReadAsync() — never read FullPath directly
  • Null-check FilePicker result before accessing properties
  • Custom FilePickerFileType uses correct format per platform (MIME / UTType / extension)
  • Bundled files copied to AppDataDirectory before modification
  • Unique file names in Resources/Raw (subdirectories are flattened)
  • Android manifest declares correct permission for target API level
  • macOS: App Sandbox entitlement includes file access

© davidortinau, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in plugins/maui-skills/skills/maui-file-handling of davidortinau/maui-skills.

  • SKILL.md
  • references/file-handling-api.md

Open the folder on GitHubat commit 79bb4bf

Compare with similar skills

Maui File Handling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Maui File Handling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Maui File Handling this skilldavidortinau/maui-skills175—~1.3kAutomated safety check: PassMIT
Engine Whats Newflutter/flutter180k—~978Automated safety check: PassBSD-3-Clause
Ksafeioannisa/KSafe338—~17kAutomated safety check: PassApache-2.0
Simfleetentropyconquers/simfleet118—~1.5kAutomated safety check: PassMIT
Maui AI DebuggingRedth/Maui.Gtk101—~4.1kAutomated safety check: PassMIT
flutter_soloud Setupalnitak/flutter_soloud425—~3.6kAutomated safety check: NotesMIT

Similar skills

  • Engine Whats New

    flutter/flutter

    Generates the "what's new" release summary and diff file for changes in the Flutter engine (//engine/src/flutter) between two releases (e.g., 3.47 vs 3.44).

    180k GitHub stars~978 tokensUpdated today
    MobileAuto-check passed
  • Ksafe

    ioannisa/KSafe

    Required before any reply that touches KSafe (by ksafe(...), ksafe.get/put, :ksafe-compose, :ksafe-biometrics), even a 'can KSafe do X?' question or a one-line change that looks like plain Kotlin.

    338 GitHub stars~17k tokensUpdated 8 days ago
    MobileAuto-check passed
  • Simfleet

    entropyconquers/simfleet

    Operate a simfleet device fleet: slimmed iOS simulators and Android emulators, parallel React Native worktree lanes with leased Metro ports, the native build cache, and per-agent device claims.

    118 GitHub stars~1.5k tokensUpdated 12 days ago
    MobileAuto-check passed
  • Maui AI Debugging

    Redth/Maui.Gtk

    End-to-end workflow for building, deploying, inspecting, and debugging .NET MAUI and MAUI Blazor Hybrid apps as an AI agent.

    101 GitHub stars~4.1k tokensUpdated 5 mo ago
    MobileAuto-check passed
  • flutter_soloud Setup

    alnitak/flutter_soloud

    Walks through adding the flutter_soloud audio engine to a Flutter app, with per-platform setup, initialization, binary-size and logging options, and output device switching.

    425 GitHub stars~3.6k tokensUpdated yesterday
    MobileAuto-check: notes
  • Fkit Setup

    Joker-x-dev/FlutterKit

    将 FlutterKit 脚手架初始化为新的应用项目,统一修改应用显示名称、Dart 包名、Android Application ID、Apple Bundle ID、Linux/Windows 标识、Web 名称、运行时品牌文案、Logo、桌面图标和启动页。用户拉取模板后要求改名、改包名、替换品牌资源或完成首次项目配置时使用。

    127 GitHub stars~720 tokensUpdated 2 mo ago
    MobileAuto-check passed

More from davidortinau/maui-skills

All 41 skills in this repo
  • Maui Hot Reload Diagnostics

    davidortinau/maui-skills

    Diagnose and troubleshoot .NET MAUI Hot Reload issues (C Hot Reload, XAML Hot Reload, Blazor Hybrid).

    175 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Maui Accessibility

    davidortinau/maui-skills

    Guide for making .NET MAUI apps accessible — screen reader support via SemanticProperties, heading levels, AutomationProperties visibility control, programmatic focus and announcements, and…

    175 GitHub stars~974 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui Animations

    davidortinau/maui-skills

    .NET MAUI view animations, custom animations, easing functions, rotation, scale, translation, and fade effects.

    175 GitHub stars~911 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui App Icons Splash

    davidortinau/maui-skills

    .NET MAUI app icon configuration, splash screen setup, SVG to PNG conversion at build time, composed/adaptive icons, and platform-specific icon and splash screen requirements for Android, iOS, Mac…

    175 GitHub stars~995 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui App Lifecycle

    davidortinau/maui-skills

    .NET MAUI app lifecycle guidance covering the four app states (not running, running, deactivated, stopped), cross-platform Window lifecycle events, backgrounding and resume behaviour…

    175 GitHub stars~947 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui Aspire

    davidortinau/maui-skills

    Guide for .NET MAUI apps consuming .NET Aspire-hosted backend services.

    175 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed

Categories

Questions about Maui File Handling

What does Maui File Handling do?

Guidance for file picker, file system helpers, bundled assets, and app data storage in .NET MAUI applications. Maui File Handling is an agent skill from davidortinau/maui-skills.NET MAUI applications.

When should I use Maui File Handling?

Maui File Handling fits situations like: fileSystem helpers; appDataDirectory; : media capture; photo picking (use maui-media-picker).

How do I install Maui File Handling in Claude Code?

Run `npx skills add davidortinau/maui-skills --skill maui-file-handling -a claude-code`. Or copy the skill folder (plugins/maui-skills/skills/maui-file-handling in davidortinau/maui-skills) into .claude/skills/maui-file-handling in your project. Claude Code loads it when a task matches its description.

How do I install Maui File Handling in Codex?

Run `npx skills add davidortinau/maui-skills --skill maui-file-handling -a codex`. Or copy the skill folder (plugins/maui-skills/skills/maui-file-handling in davidortinau/maui-skills) into .agents/skills/maui-file-handling in your project. Codex loads it when a task matches its description.

Can I use Maui File Handling in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davidortinau/maui-skills --skill maui-file-handling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/maui-file-handling, .gemini/skills/maui-file-handling, .github/skills/maui-file-handling and .opencode/skills/maui-file-handling in your project.

What does Maui File Handling need to run?

SKILL.md names no scripts, command-line tools or credentials: Maui File Handling is instructions for the agent only.

Does Maui File Handling access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Maui File Handling safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Maui File Handling use?

Maui File Handling is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Maui File Handling use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.3k tokens, read only when the agent opens those files.

What are the alternatives to Maui File Handling?

Skills that share tags, products or a category with Maui File Handling: Engine Whats New (flutter/flutter, 180k stars), Ksafe (ioannisa/KSafe, 338 stars), Simfleet (entropyconquers/simfleet, 118 stars) and Maui AI Debugging (Redth/Maui.Gtk, 101 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Maui File Handling?

davidortinau (a GitHub user) maintains it in davidortinau/maui-skills, which has 175 GitHub stars. The repository holds 41 skills in this directory. The repository was last updated on July 6, 2026.

Source: davidortinau/maui-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.