axiom-core-location
БесплатноБез исполняемых скриптовНе проверенUse for Core Location implementation patterns - authorization strategy, monitoring strategy, accuracy selection, background location
от ComeOnOliver★ 67 звёзд на GitHubОб этом скилле
Core Location Patterns
Discipline skill for Core Location implementation decisions. Prevents common authorization mistakes, battery drain, and background location failures.
When to Use
- Choosing authorization strategy (When In Use vs Always)
- Deciding monitoring approach (continuous vs significant-change vs CLMonitor)
- Implementing geofencing or background location
- Debugging "location not working" issues
- Reviewing location code for anti-patterns
Related Skills
axiom-core-location-ref— API reference, code examplesaxiom-core-location-diag— Symptom-based troubleshootingaxiom-energy— Location as battery subsystem
Part 1: Anti-Patterns (with Time Costs)
Anti-Pattern 1: Premature Always Authorization
Wrong (30-60% denial rate):
// First launch: "Can we have Always access?"
manager.requestAlwaysAuthorization()
Right (5-10% denial rate):
// Start with When In Use
CLServiceSession(authorization: .whenInUse)
// Later, when user triggers background feature:
CLServiceSession(authorization: .always)
Time cost: 15 min to fix code, but 30-60% of users permanently denied = feature adoption destroyed.
Why: Users deny aggressive requests. Start minimal, upgrade when user understands value.
Anti-Pattern 2: Continuous Updates for Geofencing
Wrong (10x battery drain):
for try await update in CLLocationUpdate.liveUpdates() {
if isNearTarget(update.location) {
triggerGeofence()
}
}
Right (system-managed, low power):
let monitor = await CLMonitor("Geofences")
let condition = CLMonitor.CircularGeographicCondition(
center: target, radius: 100
)
await monitor.add(condition, identifier: "Target")
for try await event in monitor.events {
if event.state == .satisfied { triggerGeofence() }
}
Time cost: 5 min to refactor, saves 10x battery.
Anti-Pattern 3: Ignoring Stationary Detection
Wrong (wasted battery):
for try await update in CLLocationUpdate.liveUpdates() {
processLocation(update.location)
// Never stops, even when device stationary
}
Right (automatic pause/resume):
for try await update in CLLocationUpdate.liveUpdates() {
if let location = update.location {
processLocation(location)
}
if update.isStationary, let location = update.location {
// Device stopped moving - updates pause automatically
// Will resume when device moves again
saveLastKnownLocation(location)
}
}
Time cost: 2 min to add check, saves significant battery.
Anti-Pattern 4: No Graceful Denial Handling
Wrong (broken UX):
for try await update in CLLocationUpdate.liveUpdates() {
guard let location = update.location else { continue }
// User denied - silent failure, no feedback
}
Right (graceful degradation):
for try await update in CLLocationUpdate.liveUpdates() {
if update.authorizationDenied {
showManualLocationPicker()
break
}
if update.authorizationDeniedGlobally {
showSystemLocationDisabledMessage()
break
}
if let location = update.location {
processLocation(location)
}
}
Time cost: 10 min to add handling, prevents confused users.
Anti-Pattern 5: Wrong Accuracy for Use Case
Wrong (battery drain for weather app):
// Weather app using navigation accuracy
CLLocationUpdate.liveUpdates(.automotiveNavigation)
Right (match accuracy to need):
// Weather: city-level is fine
CLLocationUpdate.liveUpdates(.default) // or .fitness for runners
// Navigation: needs high accuracy
CLLocationUpdate.liveUpdates(.automotiveNavigation)
| Use Case | Configuration | Accuracy | Battery |
|---|---|---|---|
| Navigation | .automotiveNavigation |
~5m | Highest |
| Fitness tracking | .fitness |
~10m | High |
| Store finder | .default |
~10-100m | Medium |
| Weather | .default |
~100m+ | Low |
Time cost: 1 min to change, significant battery savings.
Anti-Pattern 6: Not Stopping Updates
Wrong (battery drain, location icon persists):
func viewDidLoad() {
Task {
for try await update in CLLocationUpdate.liveUpdates() {
updateMap(update.location)
}
}
}
// User navigates away, updates continue forever
Right (cancel when done):
private var locationTask: Task<Void, Error>?
func startTracking() {
locationTask = Task {
for try await update in CLLocationUpdate.liveUpdates() {
if Task.isCancelled { break }
updateMap(update.location)
}
}
}
func stopTracking() {
locationTask?.cancel()
locationTask = nil
}
Time cost: 5 min to add cancellation, stops battery drain.
Anti-Pattern 7: Ignoring CLServiceSession (iOS 18+)
Wrong (procedural authorization juggling): ```
Установить axiom-core-location в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл axiom-core-location?
Use for Core Location implementation patterns - authorization strategy, monitoring strategy, accuracy selection, background location
Как установить скилл axiom-core-location?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл axiom-core-location запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic