dat-conventions

Establishes Swift conventions for Meta Wearables Device Access Toolkit iOS implementations with async/await and MainActor UI updates.

506|113|Updated Nov 21, 2025
One-click install
npx skills add https://github.com/facebook/meta-wearables-dat-ios --skill dat-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dat-conventions
Source: https://github.com/facebook/meta-wearables-dat-ios/tree/main/plugins/mwdat-ios/skills/dat-conventions
Command: npx skills add https://github.com/facebook/meta-wearables-dat-ios --skill dat-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill reduces confusion and inconsistencies when implementing the Meta Wearables Device Access Toolkit (DAT) on iOS by standardizing architecture choices, Swift concurrency patterns, naming, and module usage.

Core Features & Use Cases

  • Async-first SDK usage: Use async/await everywhere and avoid blocking the main thread during streaming or frame handling.
  • Correct UI concurrency: Update UI from @MainActor to keep rendering safe and predictable.
  • Readable, consistent code structure: Apply consistent naming for sessions, selectors, configurations, and publishers.
  • Module-aligned development: Import the right frameworks (Core/Camera/Display/Mock) to match the capability you’re using.
  • Practical error handling guidance: Use do/catch and try/await patterns consistent with how the SDK throws typed errors.

Quick Start

Follow the conventions to structure your iOS DAT integration by configuring the SDK at launch and then using the shared entry point to start registration with async/await error handling.

Frequently Asked Questions about dat-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle async errors when integrating the Wearables SDK on iOS?

Use async/await for all Wearables SDK calls and wrap them in do/catch blocks to handle typed errors, preventing asynchronous misuse during device discovery or camera streaming on iOS.

When do I need @MainActor for iOS wearable device UI updates?

You need @MainActor for iOS wearable device UI updates whenever rendering display output or handling frame data, ensuring safe and predictable main thread execution during async streaming and photo capture operations.

What's the best way to name Swift sessions and selectors for Wearables device discovery?

The best way to name Swift sessions and selectors for Wearables device discovery is to apply standardized type and symbol naming conventions, ensuring readable and consistent code structure across registration and configuration processes.

Can I use MockDeviceKit for testing iOS async camera streaming without a physical device?

Yes, you can use MockDeviceKit for testing iOS async camera streaming by importing the Mock module to simulate device discovery, registration, and photo capture scenarios without requiring physical hardware.

Does the iOS Wearables SDK require module-scoped imports for camera and display capabilities?

Yes, the iOS Wearables SDK requires module-scoped imports for camera and display capabilities, meaning you must import the specific Core, Camera, or Display frameworks to match the exact capability you are using.

Why does my iOS Swift async code block the main thread during DAT frame handling?

Your iOS Swift async code blocks the main thread during DAT frame handling if you are not using async/await-first patterns, which are required to avoid blocking the main thread during streaming or session updates.