Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add tomkrikorian/visionOSAgents --skill "SharePlay Developer"
Install specific skill from multi-skill repository
# Description
Build, integrate, and troubleshoot SharePlay GroupActivities features, including GroupActivity definitions, activation flows, GroupSession lifecycle, messaging and journals, ShareLink and SharePlay UI surfaces, and visionOS spatial coordination. Use when implementing or debugging SharePlay experiences across Apple platforms, especially visionOS.
# SKILL.md
name: shareplay-developer
description: Build, integrate, and troubleshoot SharePlay GroupActivities features, including GroupActivity definitions, activation flows, GroupSession lifecycle, messaging and journals, ShareLink and SharePlay UI surfaces, and visionOS spatial coordination. Use when implementing or debugging SharePlay experiences across Apple platforms, especially visionOS.
SharePlay Developer
Description and Goals
This skill provides comprehensive guidance for implementing SharePlay experiences with the GroupActivities framework. It covers activity definition, session lifecycle, state synchronization, UI surfaces, and visionOS spatial coordination.
Goals
- Enable developers to build SharePlay experiences across Apple platforms
- Guide proper GroupActivity definition and activation
- Support GroupSession lifecycle management
- Help implement state synchronization with messaging and journals
- Enable spatial coordination for visionOS experiences
What This Skill Should Do
When implementing SharePlay features, this skill should:
- Guide activity setup - Help you define GroupActivity types and metadata
- Handle activation - Show how to check eligibility and activate SharePlay
- Manage sessions - Demonstrate GroupSession lifecycle and participant management
- Sync state - Provide patterns for messaging and journal-based synchronization
- Coordinate spatially - Show how to use SystemCoordinator for visionOS spatial experiences
- Present UI - Guide use of ShareLink and other SharePlay UI surfaces
Load the appropriate reference file from the tables below for detailed usage, code examples, and best practices.
Quick Start Workflow
- Add the Group Activities capability and
com.apple.developer.group-sessionentitlement in Xcode. - Define a
GroupActivitytype per experience and keep its data minimal andCodable. - Provide
GroupActivityMetadatawith a clear title, type, and fallback URL. - Check
GroupStateObserver.isEligibleForGroupSessionand activate or present SharePlay UI. - Listen for sessions with
for await session in Activity.sessions()and store the session strongly. - Configure
SystemCoordinatorbeforejoin()when spatial personas or immersive spaces are involved. - Call
session.join()only after UI and state are ready. - Sync state with
GroupSessionMessenger(small, time-sensitive) orGroupSessionJournal(attachments). - Observe
activeParticipantsand send a state snapshot for late joiners. - Call
leave()orend()and cancel tasks when the session invalidates.
Information About the Skill
Core Concepts
Activity Definition
- Use
GroupActivityto define the shareable experience and keep payloads minimal. - Provide
GroupActivity.metadatawith title, subtitle, preview image, and fallback URL. - Set
GroupActivityMetadata.typeto a matchingActivityTypevalue. - Use
GroupActivityActivationResultfromprepareForActivation()to decide activation. - Use
GroupActivityTransferRepresentationforShareLinkand share sheets.
Session Lifecycle and Participants
- Use
GroupSessionto manage the live activity; calljoin(),leave(), orend(). - Observe
GroupSession.state,activeParticipants, andisLocallyInitiatedto drive UI. - Use
GroupSession.sceneSessionIdentifierto map sessions to scenes when needed. - Call
requestForegroundPresentation()when the activity needs the app visible. - Use
GroupSession.showNotice(_:)orpostEvent(_:)for system playback notices.
Messaging and Transfer
- Use
GroupSessionMessengerfor small messages (<= 256 KB). - Use
.reliabledelivery for critical state and.unreliablefor high-frequency updates. - Use
GroupSessionJournalfor attachments and large data (<= 100 MB).
UI Surfaces to Start SharePlay
- Use
ShareLinkwithTransferable+GroupActivityTransferRepresentationin SwiftUI. - Use
GroupActivitySharingControllerin UIKit/AppKit when no FaceTime call is active. - Use
NSItemProvider.registerGroupActivity(...)in share sheets when needed.
visionOS Spatial Coordination
- Use
SystemCoordinatorfromGroupSession.systemCoordinatorfor spatial layout. - Set
spatialTemplatePreferenceandsupportsGroupImmersiveSpaceas needed. - Use
localParticipantStatesandremoteParticipantStatesto track poses. - Use
groupActivityAssociation(_:)to choose the primary scene.
Reference Files
| Reference | When to Use |
|---|---|
[REFERENCE.md](references/REFERENCE.md) |
When looking for GroupActivities-focused code samples and excerpts. |
Implementation Patterns
- Send a full state snapshot when new participants join.
- Keep UI state separate from shared game state to reduce message churn.
- Use
GroupSessionMessengerfor transient actions andGroupSessionJournalfor durable data. - Prefer AVFoundation coordinated playback for media sync.
Pitfalls and Checks
- Keep
GroupActivitydata minimal; send state changes via messenger or journal. - Store strong references to
GroupSession,GroupSessionMessenger, andGroupSessionJournal. - Join only when UI and state are ready; call
leave()on teardown. - Handle late joiners by sending the current state snapshot on
activeParticipantschange.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.