Agent skill

Maui REST API

by davidortinau in davidortinau/maui-skills

Guidance for consuming REST APIs in .NET MAUI apps. An agent skill from davidortinau/maui-skills.

MITAuto-check passedBackend & APIs

Install Maui REST API

skills CLI
$ npx skills add davidortinau/maui-skills --skill maui-rest-api -a claude-code

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

GitHub CLI
$ gh skill install davidortinau/maui-skills maui-rest-api --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-rest-api .claude/skills/maui-rest-api && 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-rest-api
GitHub stars
175
Token cost
~1.2k tokens
SKILL.md length
223 words
Files
2 (incl. references)
Skills in repo
41
Repo updated
First seen
Licence
MIT

At a glance

Guidance for consuming REST APIs in .NET MAUI apps. An agent skill from davidortinau/maui-skills.

  • Works in 5 steps: Creating HttpClient per request → Blocking with .Result or .Wait() → Deserializing before checking status → …
  • JSON deserialization
  • SKILL.md covers Common Mistakes, Platform Pitfalls, Decision Framework and Checklist
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Maui REST API is an agent skill from davidortinau/maui-skills. Guidance for consuming REST APIs in .NET MAUI apps. Covers HttpClient setup with System.Text.Json, DI registration, service interface/implementation pattern, full CRUD operations (GET, POST, PUT, DELETE), error handling, platform-specific clear-text traffic configuration, and async/await best practices. USE FOR: "REST API", "HttpClient", "call API", "GET request", "POST request", "API service", "JSON deserialization", "CRUD operations", "clear-text traffic", "consume API MAUI". DO NOT USE FOR: Aspire service…

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

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

When your agent uses it

  • JSON deserialization
  • CRUD operations
  • Clear-text traffic
  • Consume API MAUI

Example prompts

  • “REST API”
  • “HttpClient”
  • “call API”
  • “/maui-rest-api”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Creating HttpClient per request
  2. Blocking with .Result or .Wait()
  3. Deserializing before checking status
  4. Hardcoding BaseAddress in service methods
  5. Missing error handling for network failures

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 REST API loads about 1.2k tokens when it runs, and up to ~2.5k if it reads all its reference files. Until then it costs about 167 tokens; SKILL.md has 223 words of instructions outside code blocks.

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

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). 223 words, ~1,224 tokens.

Download SKILL.mdSave it as .claude/skills/maui-rest-api/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
maui-rest-api
description
Guidance for consuming REST APIs in .NET MAUI apps. Covers HttpClient setup with System.Text.Json, DI registration, service interface/implementation pattern, full CRUD operations (GET, POST, PUT, DELETE), error handling, platform-specific clear-text traffic configuration, and async/await best practices. USE FOR: "REST API", "HttpClient", "call API", "GET request", "POST request", "API service", "JSON deserialization", "CRUD operations", "clear-text traffic", "consume API MAUI". DO NOT USE FOR: Aspire service discovery (use maui-aspire), authentication token handling (use maui-authentication), or local database storage (use maui-sqlite-database).

REST API Consumption — Gotchas & Best Practices

Common Mistakes

1. Creating HttpClient per request
csharp
// ❌ Creates socket exhaustion — each instance opens a new connection
public async Task<List<Item>> GetItemsAsync()
{
    using var client = new HttpClient();
    var response = await client.GetAsync("https://api.example.com/items");
    // ...
}

// ✅ Register once in DI, inject everywhere
builder.Services.AddSingleton(sp => new HttpClient
{
    BaseAddress = new Uri("https://api.example.com")
});
2. Blocking with .Result or .Wait()
csharp
// ❌ Deadlocks on the UI thread
var items = _apiService.GetItemsAsync().Result;

// ✅ Always use async/await
var items = await _apiService.GetItemsAsync();
3. Deserializing before checking status
csharp
// ❌ Tries to deserialize error HTML/JSON as your model
var content = await response.Content.ReadAsStringAsync();
var items = JsonSerializer.Deserialize<List<Item>>(content, _jsonOptions);

// ✅ Check status first
response.EnsureSuccessStatusCode();
var content = await response.Content.ReadAsStringAsync();
var items = JsonSerializer.Deserialize<List<Item>>(content, _jsonOptions) ?? [];
4. Hardcoding BaseAddress in service methods
csharp
// ❌ Absolute URIs in every method — hard to change, easy to typo
await _httpClient.GetAsync("https://api.example.com/api/items");

// ✅ Set BaseAddress in DI, use relative URIs in methods
await _httpClient.GetAsync("api/items");
5. Missing error handling for network failures
csharp
// ❌ Crashes on network timeout, DNS failure, etc.
var items = await _apiService.GetItemsAsync();

// ✅ Catch both network and deserialization errors
try
{
    var items = await _apiService.GetItemsAsync();
}
catch (HttpRequestException ex) { /* network or HTTP error */ }
catch (JsonException ex) { /* malformed response */ }

Platform Pitfalls

⚠️ Clear-text HTTP blocked on emulators/simulators

Local dev servers on http:// are blocked by default. Configure exceptions:

  • Android: needs network_security_config.xml with cleartextTrafficPermitted="true" for 10.0.2.2
  • iOS/Mac Catalyst: needs NSAllowsLocalNetworking in Info.plist
⚠️ Android emulator uses 10.0.2.2 for localhost

The Android emulator maps 10.0.2.2 to the host machine. localhost refers to the emulator itself.

csharp
// ❌ On Android emulator, this hits the emulator, not your dev machine
new Uri("http://localhost:5000")

// ✅ Use the emulator's host loopback address
new Uri("http://10.0.2.2:5000")

iOS simulators use localhost directly.

⚠️ Inconsistent JSON casing

APIs typically use camelCase; C# properties are PascalCase. Without JsonSerializerOptions, deserialization silently returns default values.

csharp
// ❌ Properties stay null/default — no error thrown
JsonSerializer.Deserialize<Item>(content);

// ✅ Configure casing policy
private static readonly JsonSerializerOptions _jsonOptions = new()
{
    PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
    PropertyNameCaseInsensitive = true
};

Decision Framework

ScenarioError handling approach
Failure is unexpected (auth'd endpoints)EnsureSuccessStatusCode() — throws HttpRequestException
Need to branch on status codesCheck IsSuccessStatusCode or response.StatusCode
Network may be unreliable (mobile)Wrap in try/catch for HttpRequestException
Response format may varyAlso catch JsonException

Checklist

  • HttpClient registered as singleton or via IHttpClientFactory — never created per-request
  • BaseAddress set in DI; service methods use relative URIs
  • JsonSerializerOptions with CamelCase policy applied consistently
  • IsSuccessStatusCode or EnsureSuccessStatusCode() checked before deserializing
  • try/catch for HttpRequestException and JsonException in ViewModel calls
  • All API calls use async/await — no .Result or .Wait()
  • Service interface pattern used so ViewModels depend on abstractions
  • Android clear-text config for local dev (10.0.2.2)
  • iOS NSAllowsLocalNetworking for local dev

© 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-rest-api of davidortinau/maui-skills.

  • SKILL.md
  • references/rest-api-reference.md

Open the folder on GitHubat commit 79bb4bf

Compare with similar skills

Maui REST API 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 REST API compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Maui REST API this skilldavidortinau/maui-skills175—~1.2kAutomated safety check: PassMIT
Web3authWeb3Auth/web3auth-examples144—~1.4kAutomated safety check: PassMIT
Retrieving Developer Knowledgegoogle/skills21k—~2kAutomated safety check: PassApache-2.0
Kotlin SpecialistJeffallan/claude-skills12k—~1.5kAutomated safety check: PassMIT
Flutter Caching Databtwld/superdeck130—~2kAutomated safety check: PassBSD-3-Clause
iOS Networkingdpearson2699/swift-ios-skills1.2k—~4.2kAutomated safety check: PassCustom licence

Similar skills

  • Web3auth

    Web3Auth/web3auth-examples

    Integrates MetaMask Embedded Wallets (Web3Auth) for non-custodial wallets via social login or custom JWT (Firebase, Auth0, Cognito).

    144 GitHub stars~1.4k tokensUpdated 7 days ago
    Backend & APIsAuto-check passed
  • Official

    Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI/Gemini, Android, Chrome, Web, Flutter, Go, Firebase, and other Google developer platforms.

    21k GitHub stars~2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Kotlin Specialist

    Jeffallan/claude-skills

    Applies idiomatic Kotlin 1.9+ patterns for coroutines and Flow, multiplatform code, Jetpack Compose on Android and Ktor servers, checked with detekt and ktlint.

    12k GitHub stars~1.5k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Flutter Caching Data

    btwld/superdeck

    Implements caching strategies for Flutter apps to improve performance and offline support.

    130 GitHub stars~2k tokensUpdated yesterday
    MobileAuto-check passed
  • iOS Networking

    dpearson2699/swift-ios-skills

    Build, review, or improve networking code in iOS/macOS apps using URLSession with async/await, structured concurrency, and modern Swift patterns.

    1.2k GitHub stars~4.2k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed
  • 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).

    179k GitHub stars~978 tokensUpdated today
    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

Questions about Maui REST API

What does Maui REST API do?

Guidance for consuming REST APIs in .NET MAUI apps. An agent skill from davidortinau/maui-skills. Maui REST API is an agent skill from davidortinau/maui-skills.NET MAUI apps.

When should I use Maui REST API?

Maui REST API fits situations like: JSON deserialization; CRUD operations; clear-text traffic; consume API MAUI.

How do I install Maui REST API in Claude Code?

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

How do I install Maui REST API in Codex?

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

Can I use Maui REST API 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-rest-api -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-rest-api, .gemini/skills/maui-rest-api, .github/skills/maui-rest-api and .opencode/skills/maui-rest-api in your project.

What does Maui REST API need to run?

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

Does Maui REST API 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 REST API 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 REST API use?

Maui REST API 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 REST API use?

About 1.2k tokens (SKILL.md is roughly 4.9k 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 REST API?

Skills that share tags, products or a category with Maui REST API: Web3auth (Web3Auth/web3auth-examples, 144 stars), Retrieving Developer Knowledge (google/skills, 21k stars), Kotlin Specialist (Jeffallan/claude-skills, 12k stars) and Flutter Caching Data (btwld/superdeck, 130 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Maui REST API?

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.