Generate ActivityKit Live Activity infrastructure with Dynamic Island layouts, Lock Screen presentation, and push-to-update support. Use when adding Live Activities to an iOS app.
npx skills add https://github.com/rshankras/claude-code-apple-skills --skill live-activity-generator
Generate a complete ActivityKit Live Activity implementation with Dynamic Island layouts, Lock Screen presentation, activity lifecycle management, and push-to-update support.
Use this skill when the user:
Search for existing Live Activity code:
Glob: **/*Activity*.swift, **/*LiveActivity*.swift
Grep: "ActivityKit" or "ActivityAttributes" or "ActivityConfiguration"
If an existing widget extension is found:
WidgetBundle to extendIf Live Activity code already exists:
Live Activities require:
NSSupportsLiveActivities set to YES in Info.plistNSSupportsLiveActivitiesFrequentUpdates (optional, iOS 16.2+)Ask user via AskUserQuestion:
Check project structure:
For the activity manager (lives in the main app target):
Sources/ exists --> Sources/LiveActivity/App/ exists --> App/LiveActivity/LiveActivity/For the widget extension views:
MyAppWidgets/)Generate these files based on configuration answers:
{Name}ActivityAttributes.swift -- Shared between app and widget extensionActivityAttributes struct with static propertiesContentState with dynamic properties{Name}LiveActivityView.swift -- Widget extension fileActivityConfiguration with Lock Screen, Dynamic Island layouts{Name}ActivityManager.swift -- Main app target fileUse the templates in templates.md and customize based on user answers:
<key>NSSupportsLiveActivities</key>
<true/>
<!-- Optional: for frequent push updates (iOS 16.2+) -->
<key>NSSupportsLiveActivitiesFrequentUpdates</key>
<true/>
After generation, provide:
Sources/LiveActivity/
├── {Name}ActivityAttributes.swift # Shared: attributes + content state
└── {Name}ActivityManager.swift # Main app: lifecycle management
MyAppWidgets/
├── {Name}LiveActivityView.swift # Widget ext: all Live Activity UI
└── (update WidgetBundle if needed)
1. Add the widget extension target (if not present):
2. Share the attributes file between targets:
The {Name}ActivityAttributes.swift file must be included in both the main app target and the widget extension target. Select the file in Xcode, open the File Inspector, and check both targets under "Target Membership".
3. Add Info.plist entries in the main app target:
<key>NSSupportsLiveActivities</key>
<true/>
4. Register the Live Activity configuration in the widget bundle:
@main
struct MyAppWidgets: WidgetBundle {
var body: some Widget {
// Existing widgets...
MyAppLiveActivity()
}
}
5. Start a Live Activity from your app:
let attributes = DeliveryActivityAttributes(
orderNumber: "1234",
restaurantName: "Pizza Place"
)
let initialState = DeliveryActivityAttributes.ContentState(
status: .preparing,
estimatedDelivery: Date().addingTimeInterval(30 * 60),
driverName: nil
)
let manager = LiveActivityManager()
try await manager.startActivity(attributes: attributes, state: initialState)
6. Update the activity when state changes:
let updatedState = DeliveryActivityAttributes.ContentState(
status: .enRoute,
estimatedDelivery: Date().addingTimeInterval(15 * 60),
driverName: "Alex"
)
await manager.updateActivity(state: updatedState)
7. End the activity when complete:
let finalState = DeliveryActivityAttributes.ContentState(
status: .delivered,
estimatedDelivery: Date(),
driverName: "Alex"
)
await manager.endActivity(state: finalState, dismissalPolicy: .default)
1. Observe push tokens:
The generated {Name}ActivityManager automatically observes push token updates. Send the token to your server when it changes.
2. Server-side APNs request:
curl -v \
--header "authorization: bearer $JWT_TOKEN" \
--header "apns-topic: com.yourcompany.yourapp.push-type.liveactivity" \
--header "apns-push-type: liveactivity" \
--http2 \
--data '{"aps":{"timestamp":1234567890,"event":"update","content-state":{"status":"enRoute","estimatedDelivery":1234568000,"driverName":"Alex"}}}' \
https://api.push.apple.com/3/device/$PUSH_TOKEN
Note: The apns-topic must be your app bundle ID with .push-type.liveactivity appended.
3. Ending via push:
{
"aps": {
"timestamp": 1234567890,
"event": "end",
"dismissal-date": 1234568000,
"content-state": {
"status": "delivered",
"estimatedDelivery": 1234567890,
"driverName": "Alex"
}
}
}
apnspush or curl with an APNs auth key (.p8 file) to send test payloads.Activity<Attributes>.activities to list all running activitiesApply when generating the Lock Screen and Dynamic Island views.
Lock Screen presentation (WWDC23):
Dynamic Island presentation:
Apple Watch (Smart Stack):
.supplementalActivityFamilies([.small]) plus a switch on @Environment(\.activityFamily) — makes "a significant difference in quality".Static: order number, restaurant name
Dynamic: status enum, ETA, driver name
Static: home team, away team, sport type
Dynamic: home score, away score, period/quarter, game clock
Static: workout type, goal
Dynamic: elapsed time, calories, heart rate, distance
Static: pickup location, destination
Dynamic: driver name, ETA, vehicle info, status
ActivityAttributes + ContentState combined must be under 4KBpushTokenUpdatesstaleDate on content to let the system show stale indicatorsAnalyze Stockbee-style Day 1 Episodic Pivot candidates from earnings, guidance raises, M&A, FDA/regulatory approvals, analyst actions, major contracts, product launches, short-squeeze catalysts, or theme/story events. Scores catalyst quality together with gap/range expansion, volume shock, neglect/revaluation context, liquidity, and risk to the EP-day low. Use when the user asks for EP candidates, episodic pivots, Day 1 catalyst trades, game-changing news reactions, delayed EP watchlists, or handoffs into PEAD monitoring.
Maps architectural components in a codebase and measures their size to identify what should be extracted first. Use when asking "how big is each module?", "what components do I have?", "which service is too large?", "analyze codebase structure", "size my monolith", or planning where to start decomposing. Do NOT use for runtime performance sizing or infrastructure capacity planning.
Understand and adhere to the project's technology stack including Laravel, PHP, React, PostgreSQL, Pest, Tailwind CSS, and all configured tools and services. Use this skill when making architectural decisions, when choosing libraries or packages, when configuring development tools, when setting up testing frameworks, when implementing authentication, when integrating third-party services, when configuring CI/CD pipelines, when setting up local development environments, or when ensuring consistency with the established tech stack across all parts of the application.
Use when the user requests diagrams, flowcharts, architecture diagrams, ER diagrams, UML / sequence / class diagrams, SysML / MBSE diagrams (block definition, internal block, requirement, parametric), BPMN business process diagrams, swimlane / cross-functional flowcharts, network topology, cloud architecture from Terraform or Kubernetes manifests, ML/DL model figures (Transformer/CNN/LSTM), mind maps, or any visualization. Also use proactively when explaining systems with 3+ components, complex data flows, or relationships that benefit from visual representation. Best suited when the diagram needs custom styling, rich shape vocabulary, swimlanes, or exportable images (PNG/SVG/PDF/JPG). Generates .drawio XML and exports locally via the native draw.io desktop CLI.
When the user wants to plan product distribution via marketplaces, app stores, or third-party platforms. Also use when the user mentions "distribution channels," "marketplace listing," "app store listing," "Figma plugin," "Chrome extension marketplace," "AWS Marketplace," "Shopify app," "GPTs store," "app distribution," or "third-party marketplace." For channel mix, use integrated-marketing.
网页设计与部署。生成精美的单页 HTML 网页(报告、落地页、数据可视化等),支持一键部署到 Cloudflare Pages。使用 Tailwind CSS + Chart.js + Font Awesome 技术栈。当用户要求制作网页、生成报告页面、创建落地页、数据可视化展示、部署网页到线上时使用。
Use when the user asks for a Databricks lakehouse architecture diagram — medallion architecture (Bronze/Silver/Gold), Delta Lake, Unity Catalog, workspace deployment, data-plane/control-plane, or any diagram built with Databricks icons. Builds with the declarative layout engine using ground-truth stencils, validates (stencils/colors/nesting/geometry), runs a render-based vision self-check. Default output is .drawio; PNG/SVG only on request.
架构文档生成 — 生成架构设计说明书、技术方案文档、API设计文档、部署架构文档
Take rshankras/live-activity-generator from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.