rewrite-inbound/SKILL.md
Rewrite webhook ingestion workflow for your application. Use when the agent needs to configure Rewrite webhooks, verify signatures, parse and normalize event payloads, handle retries and dedupe, inspect delivery logs, and route delivery or OTP events safely.
npx skillsauth add rewritetoday/skills rewrite-inboundInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Implement Rewrite webhook ingestion with security and reliability controls.
svix-* headers before trusting the payload.2xx response.contactId as transport metadata that helps correlation, not as your app's canonical user identity.import { Webhook } from "svix";
const wh = new Webhook(process.env.REWRITE_WEBHOOK_SECRET!);
const headers = { "svix-id": req.headers["svix-id"], "svix-timestamp": req.headers["svix-timestamp"], "svix-signature": req.headers["svix-signature"] };
const payload = wh.verify(rawBody, headers); // throws on invalid signature
Always pass the raw request body (Buffer/string before JSON parsing) to verify.
references/installation.mdreferences/webhook-verification.mdreferences/payload-contract.mdreferences/inbound-processing-patterns.mdreferences/reply-routing.mdreferences/delivery-logs.mdExpect the official Rewrite webhook delivery envelope documented in references/payload-contract.md:
{
"id": "748395130237498911",
"createdAt": "2026-03-19T18:42:13.000Z",
"type": "message.sent",
"data": {
"id": "748395130237498500",
"projectId": "748395130237498412",
"contact": "Fernanda",
"contactId": "748395130237498515",
"to": "+5511999999999",
"tags": [
{ "name": "use_case", "value": "otp_login" }
],
"type": "SMS",
"status": "SENT",
"content": "Rewrite: your verification code is 123456",
"country": "br",
"analysis": {
"characters": 41,
"encoding": "gsm7",
"segments": {
"concat": 153,
"count": 1,
"reason": "fits",
"single": 160
}
},
"error": null,
"deliveredAt": null,
"scheduledAt": null,
"templateId": null
}
}
If your app needs a normalized internal schema, derive it from this envelope after signature verification and raw payload persistence.
development
General SMS best-practices guide for Rewrite-based systems. Use when the agent needs to define SMS architecture, contacts and segments strategy, deliverability, templates, retries, observability, webhook handling, or rollout guardrails before or alongside implementation.
tools
Production SMS delivery workflow for Rewrite. Use when the agent needs to send transactional or campaign SMS, manage Rewrite contacts or segments, implement batching, enforce idempotency, use templates and scheduling, and integrate the official Rewrite SDKs, REST client, CLI, or ecosystem packages.
development
Secure SMS agent workflow for building a text message chatbot, messaging agent, or SMS bot on Rewrite. Covers LLM-driven replies over application-owned inbound conversations with prompt-injection defense, action policy gates, risk-level escalation, and outbound send controls.
tools
Rewrite platform router for API, SDK, CLI, contacts, segments, webhooks, templates, and AI workflows. Use when the agent needs to send SMS, manage Rewrite contacts or segments, handle Rewrite webhook events, work with official Rewrite SDKs/packages, or build application-owned agent flows on top of Rewrite.