jingjing2222/react-native-nitro-geolocation/service-migration
Claude Code and agent skill by jingjing2222/react-native-nitro-geolocation
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Migrate React Native apps directly from react-native-geolocation-service to react-native-nitro-geolocation without using /compat. Use when replacing react-native-geolocation-service imports, installing Nitro packages, configuring the Android provider, converting callback APIs to Promise/watch APIs, preserving service-specific options such as accuracy and provider metadata, and reporting manual-review sites for settings dialogs, forceRequestLocation, and default option differences.
Install
npx vskill@latest install jingjing2222/react-native-nitro-geolocation/service-migrationSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Geolocation Service Migration
Migrate directly to react-native-nitro-geolocation.
Do not use react-native-nitro-geolocation/compat. Do not create intermediate compat imports. Do not preserve Geolocation default-object usage unless the user explicitly asks for a compatibility fallback.
Workflow
- Inspect
package.json, lockfiles, and the worktree state. - Confirm
react-native-geolocation-serviceis installed or imported. - Install
react-native-nitro-modulesand
react-native-nitro-geolocation.
- Refresh docs context when network is available:
``bash curl -fsSL https://react-native-nitro-geolocation.pages.dev/llms.txt curl -fsSL https://react-native-nitro-geolocation.pages.dev/llms-full.txt ` Use llms.txt as the index and llms-full.txt` only for exact API names, option semantics, or examples. If the target app pins an older installed version, confirm APIs against that package's local types.
- Search all service usages:
``bash rg "react-native-geolocation-service|Geolocation\\.|requestAuthorization|showLocationDialog|forceRequestLocation|forceLocationManager|mocked|provider|PLAY_SERVICE_NOT_AVAILABLE|SETTINGS_NOT_SATISFIED|INTERNAL_ERROR|PermissionsAndroid" ``
- Insert or update one app-startup
setConfiguration()call. Normal
react-native-geolocation-service migrations should use locationProvider: "playServices". Use "android" only when the legacy app intentionally used forceLocationManager: true.
- Rewrite imports directly to named imports from
react-native-nitro-geolocation.
- Convert one-shot location calls to Promise chains first. Use
async/await
only when the surrounding function is already async or clearly safe to make async.
- Convert watches to low-level
watchPositionplusunwatchfirst. - Upgrade to
useWatchPositiononly for hook-safe React function components
or custom hooks.
- Convert explicit Android settings-dialog behavior from
showLocationDialog: true to a requestLocationSettings() flow.
- Remove
react-native-geolocation-service. - Run detected validation commands.
- Report semantic changes and manual-review sites.
Bundled Script
Resolve scripts/migrate-geolocation-service.mjs relative to this SKILL.md.
Run inventory first:
Dry-run the direct API transform:
Optionally add startup configuration when the app startup file is obvious:
The script is assistance, not a blind migration. It performs package-manager detection, dependency install/remove commands, AST-based import/callsite rewrites when Babel parser tooling is available, and a manual-review report. If the target project lacks Babel parser/generator dependencies, rerun with --allow-tool-install to install temporary codemod dependencies outside the app.
Hard Rules
- Never import from
react-native-nitro-geolocation/compat. - Never rewrite to
/compatas an intermediate step. - Prefer direct named imports.
- Configure
locationProvider: "playServices"for normal
react-native-geolocation-service migrations.
- Use
locationProvider: "android"only when legacy code used
forceLocationManager: true or the app explicitly requires Android LocationManager.
- Convert
enableHighAccuracy: trueto
accuracy: { android: "high", ios: "best" } unless an explicit accuracy object already exists.
- Preserve explicit
accuracy,timeout,maximumAge,distanceFilter,
interval, fastestInterval, useSignificantChanges, and showsBackgroundLocationIndicator.
- Convert
showLocationDialog: trueto an explicit
requestLocationSettings() flow.
- Do not auto-convert
forceRequestLocation; report it. - Do not introduce React hooks unless the file is a function component or
custom hook and the call is at hook-safe top level.
- Use low-level
watchPositionplusunwatchas the first safe target. - Replace numeric error-code checks with
LocationErrorCodeswhere possible. - Do not remove
PermissionsAndroidcode unless it is clearly only for
location permission and replaced by requestPermission().
API Mapping
react-native-geolocation-service | react-native-nitro-geolocation | Notes | ||
|---|---|---|---|---|
Geolocation.getCurrentPosition(success, error, options) | getCurrentPosition(options) | Convert to Promise chain first. | ||
Geolocation.watchPosition(success, error, options) | watchPosition(...) or useWatchPosition(...) | Start with low-level API. | ||
Geolocation.clearWatch(id) | unwatch(token) | Token type changes. | ||
Geolocation.stopObserving() | stopObserving() | Keep only when global cleanup was intended. | ||
| `requestAuthorization("whenInUse" | "always")` | setConfiguration({ authorizationLevel }) plus requestPermission() | Return statuses differ. | |
accuracy: { android, ios } | accuracy: { android, ios } | Preserve explicit values. | ||
enableHighAccuracy | accuracy preset | Prefer accuracy. | ||
showLocationDialog | requestLocationSettings() | Convert explicit true; report omitted defaults. | ||
forceLocationManager | setConfiguration({ locationProvider: "android" }) | Global setting, not a call option. | ||
| default fused provider intent | setConfiguration({ locationProvider: "playServices" }) | Do this for normal service migrations. | ||
forceRequestLocation | no direct option | Report and preserve intent manually. | ||
position.mocked | GeolocationResponse.mocked | Available in the API. | ||
position.provider | GeolocationResponse.provider | Available in the API. | ||
error codes -1, 1, 2, 3, 4, 5 | LocationErrorCodes | Prefer named constant comparisons. |
Transform Patterns
Rewrite imports directly:
Convert one-shot calls to Promise chains:
Convert explicit Android settings-dialog behavior:
Use low-level watches as the first safe target:
Upgrade to useWatchPosition only when the watch is already owned by a React function component or custom hook and the original callbacks do not contain ordering-sensitive side effects.
Manual Review Requirements
Always report these instead of guessing:
- Omitted
showLocationDialog. Service default wastrue; Nitro requires an
explicit requestLocationSettings() flow if the app wants the Android settings dialog.
- Omitted
timeoutormaximumAgeongetCurrentPosition. Service defaults
were effectively infinite; Nitro defaults are timeout: 600000 and maximumAge: 0.
forceRequestLocation. Preserve the fallback behavior explicitly only after
product/UX review.
- Mixed
forceLocationManagerusage. NitrolocationProvideris global. requestAuthorizationcode that handlesdisabled.requestPermission()
status does not include disabled; use hasServicesEnabled() or getProviderStatus() separately.
PermissionsAndroidusage unless it is clearly redundant after
requestPermission().
- Watch callbacks with analytics, navigation, mutation, debouncing, or
ordering-sensitive side effects.
- Class components, services, background tasks, and conditional branches where
introducing hooks would break React rules.
Validation
Use the target app's detected package manager and existing scripts. Prefer typecheck, lint, and test when they exist. Do not invent missing scripts. For device-sensitive behavior, verify at least one permission request, one current-position request, one Android settings flow when applicable, and one watch start/stop flow.
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/service-migration/SKILL.md
Popularity
- Repository stars
- 106
- Repository forks
- 5
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 13 Jul 2026, 3 months ago.
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/jingjing2222/react-native-nitro-geolocation/service-migration)