Alarmkit logo

Alarmkit

CommunityPopular
dpearson2699
alarmkit

Implement AlarmKit alarms and countdown timers for iOS and iPadOS with Lock Screen, Dynamic Island, StandBy, and paired Apple Watch system UI. Covers AlarmManager scheduling, AlarmAttributes and AlarmPresentation, system Stop and AlarmButton secondary actions, authorization, state observation, countdown widget-extension handoff, and Live Activity integration. Use when building wake-up alarms, countdown timers, or alarm-style alerts that need Apple's system alarm experience.

Overview

Publisherdpearson2699
Repositoryswift-ios-skills
Skill namealarmkit
Stars
1.2K
Forks
61
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by dpearson2699 on GitHub. Read the source before you install it.

Installation

Install the Alarmkit AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dpearson2699/swift-ios-skills/tree/main/skills/alarmkit
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dpearson2699/swift-ios-skills.git /tmp/swift-ios-skills
mkdir -p .claude/skills
cp -r /tmp/swift-ios-skills/skills/alarmkit .claude/skills/alarmkit
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Alarmkit in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Alarmkit on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Alarmkit is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

AlarmKit

Schedule prominent alarms and countdown timers that surface on the Lock Screen, Dynamic Island, StandBy, and a paired Apple Watch when the alarm fires. AlarmKit requires iOS 26+ / iPadOS 26+. Alarms can break through Focus and Silent mode.

AlarmKit uses ActivityKit data models for its Live Activity, but the firing alert is system-managed alarm UI, not a general custom notification UI surface. Custom UI belongs only to countdown and paused Live Activity states rendered by a Widget Extension with the same AlarmAttributes<Metadata> and AlarmPresentationState used when scheduling.

See references/alarmkit-patterns.md for complete code patterns including authorization, scheduling, countdown timers, snooze handling, and widget setup.

swift
import AlarmKit

Contents

Workflow

1. Create a new alarm or timer

  1. Add NSAlarmKitUsageDescription to Info.plist with a user-facing string.
  2. Request authorization with AlarmManager.shared.requestAuthorization() when the app can explain the value, or handle the first-schedule system prompt.
  3. If authorization is .denied or not .authorized, show recovery UI instead of scheduling.
  4. Configure AlarmPresentation (alert, countdown, paused states).
  5. Create AlarmAttributes with the presentation, optional metadata, and tint color.
  6. Build an AlarmManager.AlarmConfiguration (.alarm or .timer).
  7. Schedule with AlarmManager.shared.schedule(id:configuration:).
  8. Observe alarmManager.alarmUpdates and confirm the scheduled ID reaches the expected state.
  9. If using countdown, add a Widget Extension target with an ActivityConfiguration for the same AlarmAttributes<Metadata> type.

2. Review existing alarm code

Run through the Review Checklist at the end of this document.

Authorization

AlarmKit requires user authorization. Request early when the app can explain the value, or let AlarmKit prompt automatically on first schedule. If authorization is not granted after the explicit or automatic prompt, alarms are not scheduled and will not alert.

swift
let manager = AlarmManager.shared

// Request authorization explicitly
let state = try await manager.requestAuthorization()
guard state == .authorized else { return }

// Check current state synchronously
let current = manager.authorizationState // .authorized, .denied, .notDetermined

// Observe authorization changes
for await state in manager.authorizationUpdates {
    switch state {
    case .authorized: print("Alarms enabled")
    case .denied:     print("Alarms disabled")
    case .notDetermined: break
    @unknown default: break
    }
}

Alarm vs Timer Decision

FeatureAlarm (.alarm)Timer (.timer)
Fires atSpecific time (schedule)After duration elapses
Countdown UIOptionalAlways shown
RecurringYes (weekly days)No
Use caseWake-up, scheduled remindersCooking, workout intervals

Use .alarm(schedule:...) when firing at a clock time. Use .timer(duration:...) when firing after a duration from now.

Scheduling Alarms

Alarm.Schedule

Use .fixed(date) for a one-time absolute date or .relative for a local clock time with .never or .weekly repetition. Load Recurring Alarm Patterns for daily, weekday, weekend, and fixed-date variants.

Schedule and Configure

swift
let id = UUID()

let alert = AlarmPresentation.Alert(
    title: "Wake Up",
    secondaryButton: AlarmButton(
        text: "Snooze", textColor: .white, systemImageName: "bell.slash"
    ),
    secondaryButtonBehavior: .countdown
)
let presentation = AlarmPresentation(alert: alert)
struct EmptyAlarmMetadata: AlarmMetadata {}
let attributes = AlarmAttributes<EmptyAlarmMetadata>(
    presentation: presentation,
    metadata: nil,
    tintColor: .indigo
)

let snooze = Alarm.CountdownDuration(preAlert: nil, postAlert: 300)
let configuration = AlarmManager.AlarmConfiguration(
    countdownDuration: snooze,
    schedule: .relative(.init(
        time: .init(hour: 7, minute: 0),
        repeats: .never
    )),
    attributes: attributes,
    sound: .default
)

let alarm = try await AlarmManager.shared.schedule(
    id: id,
    configuration: configuration
)

For an authorization-gated function and metadata-bearing variant, load Complete Alarm Scheduling Flow.

stopIntent and secondaryIntent default to nil. Omit stopIntent for AlarmKit's standard system Stop behavior; provide it only when Stop must run app cleanup, custom stop behavior, or other side effects. Omit secondaryIntent for ordinary Snooze/Repeat with secondaryButtonBehavior: .countdown and Alarm.CountdownDuration.postAlert; provide it only for .custom secondary behavior or app cleanup/custom behavior.

Alarm State Transitions

text
cancel(id:)
    |
scheduled --> countdown --> alerting
    |             |             |
    |         pause(id:)    stop(id:) / countdown(id:)
    |             |
    |         paused ----> countdown (via resume(id:))
    |
cancel(id:) removes from system entirely
  • cancel(id:) -- remove the alarm completely, including repeating alarms
  • pause(id:) -- pause a counting-down alarm; throws from other states
  • resume(id:) -- resume a paused alarm; throws from other states
  • stop(id:) -- stop the alarm; one-shot alarms are removed, repeating alarms reschedule
  • countdown(id:) -- restart countdown from alerting state (snooze); throws from other states

Countdown Timers

Timers fire after a duration and always show a countdown UI. Use Alarm.CountdownDuration to control pre-alert and post-alert durations.

CountdownDuration

Alarm.CountdownDuration controls the visible countdown phases:

  • preAlert -- seconds to count down before the alarm fires (the main countdown)
  • postAlert -- seconds for a repeat/snooze countdown after the alarm fires

Load Complete Countdown Timer Flow for the timer factory, pause/resume presentation, metadata, and scheduling gate.

Alarm States

Each Alarm has a state property reflecting its current lifecycle position.

StateMeaning
.scheduledScheduled and ready to alert at the appropriate time
.countdownActively counting down (timer or pre-alert phase)
.pausedCountdown paused by user or app
.alertingAlarm is firing -- sound playing, UI prominent

Observing State Changes

AlarmManager.shared.alarms is a throwing getter for the current daemon snapshot. Use try, and either propagate the error or wrap launch refresh in do/catch before relying on the snapshot.

Observe alarmUpdates rather than maintaining an independent lifecycle. Load State Observation with Async Sequences for the complete store and refresh loop.

An alarm that disappears from alarmUpdates is no longer scheduled with AlarmKit. Compare against app-persisted IDs when you need to distinguish fired, cancelled, and rescheduled alarms.

AlarmAttributes and AlarmPresentation

AlarmAttributes conforms to ActivityAttributes and defines the static data for the alarm's Live Activity. It is generic over a Metadata type conforming to AlarmMetadata, which inherits Decodable, Encodable, Hashable, and Sendable. The metadata value itself is optional and defaults to nil.

AlarmPresentation supplies the required alerting content and optional countdown/paused content. The system renders alerting UI; a widget extension can customize countdown and paused Live Activity views with the same attributes and presentation state. Keep metadata lightweight, use nil when it is unnecessary, and share its type with the widget extension.

AlarmPresentationState

AlarmPresentationState is the system-managed ContentState of the alarm Live Activity. It contains the alarm ID and a Mode enum:

  • .alert(Alert) -- alarm is firing, includes the scheduled time
  • .countdown(Countdown) -- actively counting down, includes fire date and durations
  • .paused(Paused) -- countdown paused, includes elapsed and total durations

The widget extension reads AlarmPresentationState.mode to decide which UI to render in the Dynamic Island and Lock Screen for non-alerting states.

AlarmButton

AlarmButton defines the text, color, and symbol for an alarm action. The representative scheduling example above shows a standard Snooze button.

Secondary Button Behavior

The secondary button on the alert UI has two behaviors:

BehaviorEffect
.countdownRestarts a countdown using postAlert duration (snooze)
.customTriggers the secondaryIntent (e.g., open app)

Live Activity Integration

AlarmKit alarms appear as Live Activities on the Lock Screen, Dynamic Island, StandBy, and on a paired Apple Watch when the alarm fires. The system manages the alerting UI. For countdown and paused states, add a Widget Extension target whose ActivityConfiguration uses the same AlarmAttributes<Metadata> type used when scheduling the alarm.

A widget extension is expected if your alarm uses countdown presentation. Keep that lightweight metadata type available to both the app and widget extension. Without the extension, alarms may be dismissed unexpectedly or fail to alert, though the system can still show a fallback countdown UI in limited cases such as after a device restart before first unlock.

WorkOwner
Authorization, scheduling/state, presentation, sound, system alarm actionsAlarmKit
Home Screen/Smart Stack widgets, families, timelines, reloadswidgetkit
Non-alarm Live Activity lifecycle, tokens, remote content stateactivitykit
APNs, notification categories/actions, custom notification UIpush-notifications

AlarmKit's alert is system-rendered on Lock Screen, Dynamic Island, StandBy, and paired Apple Watch; only countdown/paused states use the widget extension.

For setup, name Apple-documented NSAlarmKitUsageDescription and AlarmManager authorization. Do not require unsupported AlarmKit setup keys or com.apple.developer.alarmkit unless a current Apple source documents them. Load Live Activity Widget Extension for Alarms for the complete shared-attributes widget implementation.

Common Mistakes

MistakeCorrection
Missing usage string or authorization gateAdd NSAlarmKitUsageDescription; handle denial before scheduling
Timer used for recurrenceUse an alarm with .weekly([...])
App-owned state replaces alarmUpdatesObserve the system sequence and reconcile by ID
Intents added for standard Stop/SnoozeOmit them unless cleanup/custom behavior requires one
Large AlarmMetadata payloadKeep lightweight metadata or reference app data by ID
Deprecated stopButton initializerUse init(title:secondaryButton:secondaryButtonBehavior:)

Review Checklist

  • Setup and authorization gates pass without unsupported entitlement keys
  • Alarm/timer choice, presentation, metadata, intents, snooze duration, and tint are valid
  • Scheduled IDs are retained and reconciled through alarmUpdates; operation errors are handled
  • Countdown uses the shared Widget Extension attributes and presentation state
  • System-managed alert UI and adjacent-skill ownership follow the routing table
  • Sound, vibration, Stop/Snooze, and state changes pass on-device testing

References

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Alarmkit AI skill do?

Implement AlarmKit alarms and countdown timers for iOS and iPadOS with Lock Screen, Dynamic Island, StandBy, and paired Apple Watch system UI. Covers AlarmManager scheduling, AlarmAttributes and AlarmPresentation, system Stop and AlarmButton secondary actions, authorization, state observation, countdown widget-extension handoff, and Live Activity integration. Use when building wake-up alarms, countdown timers, or alarm-style alerts that need Apple's system alarm experience.

Why use Alarmkit on TypingMind?

Because you install it once and use it with any model. Alarmkit is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Alarmkit in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dpearson2699/swift-ios-skills/tree/main/skills/alarmkit. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Alarmkit?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Alarmkit?

As many as you like. As long as a model supports skills, you can use Alarmkit with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Alarmkit AI skill free?

It is published on GitHub by dpearson2699. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇