Mobile Session And Location Safety
Keep one current session owner across lifecycle, location, background, and recovery paths. Fail closed on ambiguous ownership while degrading calmly when location or background capability is unavailable.
Standalone Use And Scope
This skill does not require sibling skills. References to other skills below are optional: use them only if available and relevant. Otherwise follow the target repository's instructions, existing owners, and tests; ask when missing domain policy prevents a safe decision. Do not install a missing skill automatically.
Match the user's request: review or planning does not authorize edits. Instructions here do not grant permission for unrelated installs, credential access, destructive actions, deployment, or publication.
Establish Runtime Truth
- Run
git status --short --branchand preserve unrelated work. - Trace the affected path through the session hook or store, lifecycle services, location services, background tasks, notifications, persistence, and direct UI consumers.
- Identify the lifecycle state, owner receipt or equivalent, operation identity, location evidence, foreground or background state, durable record, and cleanup owner.
- Record
event | lifecycle owner | required receipt | location evidence | commit condition | degraded or recovery outcome.
Preserve Session Lifecycle Authority
- Keep the existing session hook or store, lifecycle machine, activation transaction, recovery policy, and owner-scoped cleanup as one authority set. Do not create a second session state machine in a screen, task, or convenience store.
- Model hydration, starting, active, paused, ending, ended, failed, replacement, and orphan recovery explicitly.
- Capture and carry the exact owner receipt or immutable equivalent at effect boundaries. Reject stale, replaced, or ambiguous receipts; never authorize old work by recapturing the latest owner after an await.
- During recovery, distinguish provisional ownership from committed ownership. Permit only the bounded recovery effects needed to establish authority; keep ordinary user-visible, notification, and background effects blocked until ownership commits.
- Revoke prior ownership before replacement proceeds. Scope tracking, notifications, media, persistence, and terminal cleanup so late cleanup cannot clear a newer session.
- Keep pause, resume, end, force-quit, account change, and restart behavior idempotent at replayable boundaries.
- Use
async-effect-authorityfor generic operation currentness, cancellation, idempotency, and late publication; keep lifecycle policy and owner receipts here.
Preserve Location And Background Truth
- Treat a location fix as evidence with coordinates, timestamp, accuracy, permission state, provider availability, and owning session. Do not promote cached, initial, last-good, approximate, stale, or simulated coordinates to live precise truth.
- Keep hot latitude, longitude, heading, and speed out of broad render or effect dependency loops. Throttle, quantize, or read refs at the owner boundary without bypassing stale-fix checks.
- Handle denied, reduced or approximate, foreground-only, unavailable, disabled-provider, stale, noisy, and missing location states explicitly. Preserve the session when safe and show a degraded state instead of fabricating progress.
- Reconcile foreground and background tracking on app-state changes and restart. Background execution is opportunistic and platform-controlled.
- Keep TaskManager callbacks globally defined and owner-scoped at their domain entry. Use
expo-platform-engineeringfor task registration, task names, permission strings, config plugins, native manifests, foreground-service policy, and notification registration. - Bound geofence membership, notification scheduling or cancellation, and locked-phone effects to the current owner. Test duplicate events, edge dwell, late callbacks, pause, end, replacement, and permission loss.
Respect Adjacent Authority
- Use
mobile-navigation-authorityfor app or geographic transitions, destination and geometry truth, rerouting, recovery transitions, and camera priority. - Use
react-native-engineeringfor accessible degraded states, overlays, sheets, and ordinary component or hook mechanics. - Provider evidence cannot authorize a session transition or a location-quality claim; keep provider normalization with its existing owner.
- Keep AI-context shaping with its AI owner. This skill owns underlying location truth, not prompt selection or wording.
- Use
mobile-app-qa-proofto keep deterministic lifecycle proof separate from simulator, hosted or provider, background, and physical-device evidence.
Prove The Lifecycle Slice
For moving fixes that starve a nearby query, read the location-query example, with a dependency-free runnable model.
- Run focused deterministic lifecycle tests for start, pause, resume, end, duplicate entry, replacement, stale owner, orphan cleanup, restart recovery, degraded location, and partial failure.
- Run the repository's type check when typed app code changed, then
git diff --checkand inspect exact changed paths. - Use simulator evidence for controlled fixes, app-state transitions, permission states, and visible degraded behavior when authorized.
- Reserve physical-device evidence for pocket or locked-phone tracking, real GPS accuracy and staleness, background termination, geofences, and notification delivery.
- Report deterministic, simulator, hosted or provider, and physical-device evidence separately. Leave unrun behavior
NOT_OBSERVABLE.