Agent skill

Maui Geolocation

by davidortinau in davidortinau/maui-skills

Add geolocation capabilities to .NET MAUI apps using Microsoft.Maui.Devices.Sensors.

MITAuto-check passedMobile

Install Maui Geolocation

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

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

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

At a glance

Add geolocation capabilities to .NET MAUI apps using Microsoft.Maui.Devices.Sensors.

  • Get current location
  • SKILL.md covers Critical: Always Pass a…, Accuracy vs. Battery Trade-off, Platform Gotchas and Continuous Listening: Don't…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Location permission

What it does

Maui Geolocation is an agent skill from davidortinau/maui-skills. Add geolocation capabilities to .NET MAUI apps using Microsoft.Maui.Devices.Sensors. Covers one-shot and continuous location, platform permissions (Android, iOS, macOS, Windows), accuracy levels, CancellationToken usage, mock-location detection, and a DI-friendly service wrapper. USE FOR: "geolocation", "GPS location", "get current location", "location permission", "continuous location", "location tracking", "GeolocationRequest", "mock location", "latitude longitude MAUI". DO NOT USE FOR: displaying locations on…

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/geolocation-api.md`).

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

When your agent uses it

  • Get current location
  • Location permission
  • Continuous location
  • Location tracking

Example prompts

  • “geolocation”
  • “GPS location”
  • “get current location”
  • “/maui-geolocation”

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

Always · name and description, kept in context so the agent knows when to use it
~162
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.2k

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). 316 words, ~1,191 tokens.

Download SKILL.mdSave it as .claude/skills/maui-geolocation/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
maui-geolocation
description
Add geolocation capabilities to .NET MAUI apps using Microsoft.Maui.Devices.Sensors. Covers one-shot and continuous location, platform permissions (Android, iOS, macOS, Windows), accuracy levels, CancellationToken usage, mock-location detection, and a DI-friendly service wrapper. USE FOR: "geolocation", "GPS location", "get current location", "location permission", "continuous location", "location tracking", "GeolocationRequest", "mock location", "latitude longitude MAUI". DO NOT USE FOR: displaying locations on a map (use maui-maps), general permission handling (use maui-permissions), or geocoding addresses (use maui-maps).

.NET MAUI Geolocation

Critical: Always Pass a CancellationToken

GetLocationAsync can hang indefinitely if GPS is off, the device is indoors, or permissions are in a pending state. Always set a timeout.

csharp
// ❌ Hangs forever if no GPS fix is available
var location = await Geolocation.Default.GetLocationAsync(
    new GeolocationRequest(GeolocationAccuracy.High));

// ✅ Times out after 30 seconds
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
var location = await Geolocation.Default.GetLocationAsync(
    new GeolocationRequest(GeolocationAccuracy.High), cts.Token);

Accuracy vs. Battery Trade-off

Use the lowest accuracy that satisfies your feature. Higher accuracy drains battery significantly faster — especially on Android.

Use caseRecommended accuracy
City-level / weatherLowest or Low
Nearby search / store finderMedium
Turn-by-turn navigationHigh or Best

Platform Gotchas

iOS 14 reduced accuracy

Users can grant "approximate" location (accuracy > 1 km). Your app receives a location, but it may be useless for precision features.

  • Check location.Accuracy — values > 100 m likely indicate reduced precision.
  • Use GeolocationRequest.RequestFullAccuracy with a key matching NSLocationTemporaryUsageDescriptionDictionary in Info.plist to prompt for full accuracy.
Android: mock locations in security-sensitive flows
csharp
// ⚠️ Always check in security-sensitive flows (e.g., geofence, check-in)
if (location.IsFromMockProvider)
{
    // Reject — user is spoofing location
}
Android: Altitude 0.0 is not sea level

Some Android devices return 0.0 for Altitude when the GPS has no barometric sensor. Treat 0.0 as "unknown", not sea level.

Android 10+: background location requires separate permission

ACCESS_BACKGROUND_LOCATION must be requested separately from foreground permissions and triggers a distinct system dialog. Requesting it together with foreground permissions causes both to be denied on some devices.

GetLastKnownLocationAsync returns null

This is expected on first boot or after a location-data reset. Always fall back to GetLocationAsync:

csharp
// ✅ Cache-first with fresh fallback
var location = await geolocation.GetLastKnownLocationAsync();
if (location is null || location.Timestamp < DateTimeOffset.UtcNow.AddMinutes(-5))
{
    location = await geolocation.GetLocationAsync(
        new GeolocationRequest(GeolocationAccuracy.Medium, TimeSpan.FromSeconds(10)), ct);
}
Permissions must be requested before any geolocation call

Call Permissions.RequestAsync<Permissions.LocationWhenInUse>() first, or catch PermissionException. Calling GetLocationAsync without permission throws on some platforms and returns null on others — inconsistent behaviour across platforms.


Continuous Listening: Don't Forget to Unsubscribe

Failing to remove the LocationChanged handler when stopping causes continued GPS usage and battery drain.

csharp
// ❌ Forgetting to unsubscribe — GPS stays active
public void StopTracking()
{
    Geolocation.Default.StopListeningForeground();
    // LocationChanged handler still fires!
}

// ✅ Always remove the event handler
public void StopTracking()
{
    Geolocation.Default.StopListeningForeground();
    Geolocation.Default.LocationChanged -= OnLocationChanged;
}

Checklist

  • CancellationToken passed to every GetLocationAsync call
  • Accuracy level matched to feature need (not blindly set to Best)
  • GetLastKnownLocationAsync null-check with GetLocationAsync fallback
  • Runtime permissions requested before first geolocation call
  • LocationChanged handler removed when stopping continuous listening
  • Android: ACCESS_BACKGROUND_LOCATION requested separately (if needed)
  • iOS: NSLocationTemporaryUsageDescriptionDictionary added for full-accuracy prompt
  • Android: IsFromMockProvider checked in security-sensitive flows

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

  • SKILL.md
  • references/geolocation-api.md

Open the folder on GitHubat commit 79bb4bf

Compare with similar skills

Maui Geolocation 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 Geolocation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Maui Geolocation this skilldavidortinau/maui-skills175—~1.2kAutomated safety check: PassMIT
Engine Whats Newflutter/flutter179k—~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).

    179k 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 6 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 11 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 today
    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

Works with

Categories

Questions about Maui Geolocation

What does Maui Geolocation do?

Add geolocation capabilities to .NET MAUI apps using Microsoft.Maui.Devices.Sensors. Maui Geolocation is an agent skill from davidortinau/maui-skills.Sensors.

When should I use Maui Geolocation?

Maui Geolocation fits situations like: get current location; location permission; continuous location; location tracking.

How do I install Maui Geolocation in Claude Code?

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

How do I install Maui Geolocation in Codex?

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

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

What does Maui Geolocation need to run?

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

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

Maui Geolocation 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 Geolocation use?

About 1.2k tokens (SKILL.md is roughly 4.8k 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 1k tokens, read only when the agent opens those files.

What are the alternatives to Maui Geolocation?

Skills that share tags, products or a category with Maui Geolocation: Engine Whats New (flutter/flutter, 179k 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 Geolocation?

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.