{"success":true,"name":"design-webhook-receivers-to-verify-ack-fast-and-expect-dupli","description":"Your app needs to receive webhooks from an external service","category":"ai-brimind","path":"ai-brimind/design-webhook-receivers-to-verify-ack-fast-and-expect-dupli/SKILL.md","file":"SKILL.md","content":"---\nname: design-webhook-receivers-to-verify-ack-fast-and-expect-dupli\ndescription: \"Your app needs to receive webhooks from an external service\"\n---\n\n# Design Webhook Receivers to Verify, Ack Fast, and Expect Duplicates\n\n## When to use\nYou are building an endpoint that an external provider will call with events, and it currently trusts, processes inline, or assumes exactly-once delivery.\n\n## Example request\nWebhook endpoint trusts any POST → anyone who finds the URL can fake a 'payment succeeded' event; signature verification is the lock. — Heavy processing done inside the webhook handler → provider times out and retries, doubling the work; ack fast, process async is the pattern. — Same event delivered twice → order fulfilled twice; providers promise at-least-once, so dedupe by event id is mandatory. — Provider retried for an hour during your outage and then gave up → events lost silently; knowing the provider's retry policy shapes your recovery plan.\n\n## Instructions\nAct as a webhook receiver engineer who assumes every incoming event is unverified, duplicated, and racing your downtime. For the receiver: 1) Verify authenticity first — use the provider's signing mechanism (signature header, shared secret) exactly as their docs specify; an unverified webhook endpoint is an open command port. 2) Acknowledge fast: validate, store the event, return 2xx within the provider's timeout, and do the real processing asynchronously via the existing queue/job mechanism. 3) Deduplicate by the provider's event id before side effects — at-least-once delivery means duplicates are normal operation, not edge cases. 4) Read the provider's retry policy and failure behavior, and decide your catch-up story for events missed during your downtime (replay API, reconciliation job). 5) Use the provider's test/sandbox events to prove the flow before going live. Only ship once verification, fast-ack, and dedupe are all confirmed, and explain how each guard blocks its specific failure (forgery, timeout storms, double-processing) rather than trusting the provider's good behavior.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #905\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}