What problem does it solve? Integrating Terra API correctly is easy to get wrong: unverified webhook signatures accept forged health data, deduplicating on the wrong header silently drops large-request chunks, and plain overwrite upserts erase enrichment scores. This Skill provides 21 prioritized rules distilled from a production multi-device integration so agents and developers avoid these failure modes. ## Core Features & Use Cases - Webhook Handling Rules: Verify terra-signature HMAC over the raw body, acknowledge within the 8-second timeout, deduplicate on X-Terra-Trace-Id, and archive raw payloads to object storage. - Data & Idempotency Rules: Key records by natural identifiers (summary_id, connection+date), apply superset-guarantee overwrites gated on X-Terra-Ordering-Timestamp, and COALESCE enrichment scores so nulls never overwrite. - Auth & Lifecycle Rules: Handle all seven auth event types, swap Terra user IDs on user_reauth, parse comma-separated scopes, and reconcile connection state against the API. - Use Case: When building a webhook endpoint that receives sleep and activity data from Garmin and Oura users, read the webhooks-* and data-* rules to implement signature verification, deduplication, and idempotent upserts with correct/incorrect TypeScript and SQL examples. ## Quick Start Ask your agent to review or implement a Terra API webhook endpoint using the terra-unified-api rules, starting with signature verification and deduplication.