# Swiftui Alarmkit

> Schedule alarms and countdown timers in iOS apps using AlarmKit. Use when implementing alarm functionality, timer features, AlarmKit integration, snooze/stop controls, Dynamic Island alarm displays, or focus mode override. Requires iOS 18+.

- **Type:** Skill
- **Install:** `agentstack add skill-ariadoss-superskills-swiftui-alarmkit`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ariadoss](https://agentstack.voostack.com/s/ariadoss)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ariadoss](https://github.com/ariadoss)
- **Source:** https://github.com/ariadoss/superskills/tree/main/design-skills/swiftui-alarmkit

## Install

```sh
agentstack add skill-ariadoss-superskills-swiftui-alarmkit
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# AlarmKit

iOS 18+ framework for scheduling alarms and countdown timers with custom UI, Live Activities, and focus/silent mode override capabilities.

## When This Skill Activates

Use this skill when the user needs to:
- Implement alarm or timer functionality
- Reference AlarmKit, AlarmManager, or AlarmPresentation
- Create one-time, repeating, or countdown alarms
- Add snooze/stop controls
- Display content on Dynamic Island or Lock Screen
- Override Focus or silent mode

## Reference Structure

- **scheduling.md**: Authorization setup, alarm creation, management, state observation
- **presentation.md**: Alert/countdown/paused UI customization, buttons, tint colors
- **live-activities.md**: Widget integration, AlarmAttributes, Dynamic Island display

All APIs require **iOS 18 or later**.

## Critical Mistakes to Avoid

| # | Mistake | Correct Approach |
|---|---------|-----------------|
| 1 | Using `.authorizationStatus` | Use `.authorizationState` |
| 2 | Missing Info.plist entry | Add `NSAlarmKitUsageDescription` before requesting authorization |
| 3 | Schedule parameter with countdown timers | Timers use only `CountdownDuration` — no schedule parameter |
| 4 | No widget extension | Countdown and paused presentations require an `ActivityConfiguration(for: AlarmAttributes.self)` widget |
| 5 | Not persisting alarm UUIDs | Store alarm IDs for pause/resume/cancel operations |
| 6 | Not observing state changes | Subscribe to `alarmUpdates` async sequence for synchronization |

## Quick Start Pattern

```swift
import AlarmKit

// 1. Request authorization
let manager = AlarmManager.shared
guard await manager.requestAuthorization() == .authorized else { return }

// 2. Create an alarm
let alarm = try await manager.schedule(
    AlarmRequest(
        id: UUID(),
        schedule: .oneTime(date: targetDate),
        presentation: .alert
    )
)

// 3. Persist the alarm ID
UserDefaults.standard.set(alarm.id.uuidString, forKey: "savedAlarmId")

// 4. Observe state changes
for await update in manager.alarmUpdates {
    // Handle alarm state changes
}
```

## Validation Checklist

Before deploying:
- [ ] `NSAlarmKitUsageDescription` in Info.plist
- [ ] Authorization flow implemented and tested
- [ ] Using `.authorizationState` (not `.authorizationStatus`)
- [ ] Alarm UUIDs persisted
- [ ] `alarmUpdates` sequence observed
- [ ] Widget extension present (if countdown/paused UI needed)
- [ ] Error handling for all alarm operations
- [ ] Tested on real device (not simulator)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ariadoss](https://github.com/ariadoss)
- **Source:** [ariadoss/superskills](https://github.com/ariadoss/superskills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ariadoss-superskills-swiftui-alarmkit
- Seller: https://agentstack.voostack.com/s/ariadoss
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
