
Energykit
Review or implement Apple EnergyKit EV charging in a Swift iOS app with valid guidance tokens and the correct ElectricVehicleLoadEvent lifecycle.
Overview
EnergyKit is an agent skill for the Build phase that guides correct Swift EnergyKit EV charging integration—capability setup, real guidance tokens, and begin/active/end load events.
Install
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill energykitWhat is this skill?
- Requires `com.apple.developer.energykit` / EnergyKit capability as an explicit setup prerequisite
- Forbids fabricating guidance tokens; events must use the `guidanceToken` returned on the device that requested guidance
- Defines a full session lifecycle with `.begin`, `.active`, and `.end` load events—not a single submit-at-end shortcut
- Documents ~15-minute EV sampling when charging is steady plus extra events for user actions, pauses, new guidance, or ra
- Keeps scope on EnergyKit boundaries instead of drifting into HomeKit automation or BackgroundTasks tutorials
- Session lifecycle expects `.begin`, `.active`, and `.end` load events
- Steady EV charging sampling about every 15 minutes with extra events on significant changes
- Eval scenario covers guidance via `GuidanceState(wasFollowingGuidance: true, guidanceToken: UUID())` only with real retu
Adoption & trust: 1.6k installs on skills.sh; 713 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have EV charging code that enables EnergyKit but may fake guidance tokens, skip lifecycle events, or blur EnergyKit with unrelated Apple frameworks.
Who is it for?
Indie iOS developers implementing or reviewing ElectricVehicleLoadEvent flows against live ElectricityGuidance on device.
Skip if: Teams who only need generic SwiftUI layout help, HomeKit automations, or background fetch scheduling without EnergyKit APIs.
When should I use this skill?
Reviewing or writing Swift EnergyKit EV charging that uses ElectricityGuidance and ElectricVehicleLoadEvent.
What do I get? / Deliverables
You get a concise EnergyKit-bound review or implementation plan that uses returned guidance tokens, proper load-event cadence, and avoids off-topic HomeKit or BackgroundTasks detours.
- EnergyKit-bound code review notes
- Corrected load-event lifecycle and sampling guidance
- Checklist of capability and token handling fixes
Recommended Skills
Journey fit
EnergyKit is platform SDK work you do while wiring the mobile product to Apple’s energy APIs, not during launch or growth. Integrations is the right shelf because the skill centers on entitlements, ElectricityGuidance, and load events against EnergyKit—not generic UI layout.
How it compares
Use instead of generic iOS integration chat that does not enforce Apple’s guidance-token and load-event lifecycle rules.
Common Questions / FAQ
Who is energykit for?
Solo and indie Swift iOS builders integrating or reviewing Apple EnergyKit EV charging, especially when guidance tokens and load events must match on-device behavior.
When should I use energykit?
Use it during Build integrations when you enable EnergyKit, wire ElectricityGuidance into a schedule, or audit ElectricVehicleLoadEvent cadence before TestFlight or App Store submission.
Is energykit safe to install?
Treat it like any third-party agent skill: review the Security Audits panel on this Prism page and your org policy before enabling it in Claude Code, Cursor, or Codex.
SKILL.md
READMESKILL.md - Energykit
{ "skill_name": "energykit", "evals": [ { "id": 1, "name": "ev-guidance-load-events", "prompt": "Review this EnergyKit EV charging integration. It enables the capability, fetches ElectricityGuidance for an EnergyVenue, builds a charging schedule, then submits one ElectricVehicleLoadEvent at the end of the session with `GuidanceState(wasFollowingGuidance: true, guidanceToken: UUID())`. Give corrected Swift-level guidance without turning this into a HomeKit or BackgroundTasks tutorial.", "expected_output": "A concise review that preserves the EnergyKit boundary, uses the real guidance token, and explains the load event lifecycle and cadence for EV charging.", "files": [], "assertions": [ "Lists the EnergyKit capability or `com.apple.developer.energykit` entitlement as a setup prerequisite, not only as an error-handling detail.", "Rejects fabricating a guidance token and says the event must use the `guidanceToken` returned by EnergyKit guidance on the device/app that requested it.", "Requires a session lifecycle with `.begin`, `.active`, and `.end` events rather than only one final event.", "Mentions EV sampling about every 15 minutes when charging is steady and additional events for significant changes such as user actions, pauses, new guidance, or rapid power changes.", "Keeps the answer focused on EnergyKit rather than expanding into HomeKit automation or BackgroundTasks implementation details." ] }, { "id": 2, "name": "insight-availability-granularity", "prompt": "Fix this EnergyKit insight snippet for an app that supports iOS 26.0: it requests `.daily` insights for the last 7 days and immediately reads `record.dataByGridCleanliness?.cleaner`. Include the right availability and range guidance.", "expected_output": "Corrects the query granularity/range mismatch and guards grid cleanliness insight access for iOS/iPadOS 26.1+.", "files": [], "assertions": [ "States that `dataByGridCleanliness` / grid cleanliness breakdowns require iOS/iPadOS 26.1+ and should be guarded or omitted on 26.0.", "Does not claim all EnergyKit insight APIs are 26.1-only.", "Pairs granularity to the requested range, using `.hourly` for a seven-day or calendar-week view and `.daily` only for at least a calendar month.", "Mentions that empty `ElectricityInsightQuery.Options` returns totals without cleanliness or tariff breakdown." ] }, { "id": 3, "name": "energykit-boundary-review", "prompt": "A teammate wrote: 'EnergyKit works anywhere, no entitlement is needed, and if there are no insights we can infer usage from MetricKit power metrics.' Review this plan for a smart thermostat app and identify the minimal corrections.", "expected_output": "Identifies EnergyKit entitlement, region/venue limitations, submitted load-event dependency for insights, HVAC stage-change event guidance, and avoids MetricKit substitution.", "files": [], "assertions": [ "Requires the `com.apple.developer.energykit` entitlement and handles `EnergyKitError.permissionDenied` rather than saying no entitlement is needed.", "Handles unsupported regions and unavailable or restricted venues instead of claiming EnergyKit works anywhere.", "States that EnergyKit insights depend on submitted EnergyKit load events and cannot be replaced by MetricKit power metrics.", "For HVAC, recommends separate load events for heating/cooling stage transitions rather than only fixed timer samples or a final summary." ] } ] } # EnergyKit Extended Patterns Overflow reference for the `energykit` skill. Contains advanced patterns that exceed the main skill file's scope. ## Contents - [Full App Architecture](#full-app-architecture) - [EV Charging Session Manager](#ev-charging-session-manager) - [HVAC Control Manager](#hvac-control-manager) - [SwiftUI E