К основному содержанию
скилл CX Codex

sent-two-way-messaging — скилл для Claude Code: как установить

Проектирует входящие сценарии в Sent: обработку ключевых слов отписки, статус согласия контактов, автоответы в WhatsApp и историю переписки. Пригодится при настройке чат-ботов и службы поддержки.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add sentdm/sent-plugin --skill sent-two-way-messaging -a claude-code
Открыть на GitHub

Что делает sent-two-way-messaging

Скилл задаёт логику для двусторонних сообщений через платформу Sent. Главное правило здесь строгое: Sent сам блокирует отправку до того, как событие message.received дойдёт до приложения. Если пользователь прислал STOP, платформа уже выставила флаг opt_out. Приложение не должно пытаться слать сообщения в обход этого статуса, а отфильтрованные из-за согласия отправки завершаются со статусом FILTERED, а не кодом 4xx. Отписка действует на контакт целиком и глушит каналы сразу: SMS, WhatsApp и RCS.

В работе с каналами есть жёсткие ограничения. Буквенный sender ID в SMS вообще не принимает входящие сообщения, поэтому отследить STOP по нему технически невозможно. В WhatsApp свободный текст разрешён только в течение 24 часов с последнего входящего сообщения. Если окно закрылось, отвечать можно исключительно утверждённым шаблоном. Для RCS скилл учитывает чипы STOP, которые приходят как обычный текст и не требуют повторной обработки согласия.

История диалогов читается только через REST API эндпоинтами GET /v3/conversations и GET /v3/conversations/{id} с обязательными параметрами page и page_size. Инструментов MCP для переписки здесь нет, а идентификатор диалога клиент вычисляет сам как RFC 4122 v5 UUID. Позиция: если вы отправляете SMS с буквенного имени отправителя, двусторонний диалог сломается в самом начале, так как входящие ответы и отписки туда просто не дойдут.

Какие задачи решает

  • разобрать входящие события message.received с проверкой подписи
  • настроить обработку ключевых слов отписки и согласия вроде STOP и START
  • проверить 24-часовое окно перед отправкой свободного ответа в WhatsApp
  • выгрузить историю сообщений через пагинацию в REST API Sent
  • рассчитать детерминированный UUID диалога по контакту и клиенту

Примеры запросов агенту

  • Настрой вебхук для обработки message.received и проверки ключевых слов отписки в Sent
  • Как проверять 24-часовое окно WhatsApp перед отправкой автоответа через Sent?
  • Помоги настроить выгрузку истории диалогов через GET /v3/conversations с пагинацией

Как установить sent-two-way-messaging

1Через Skills CLI (Vercel)

npx skills add sentdm/sent-plugin --skill sent-two-way-messaging -a claude-code

2Вручную: положить файлы

~/.claude/skills/sent-two-way-messaging/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/sent-two-way-messaging/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о sent-two-way-messaging

Как установить sent-two-way-messaging в Claude Code?

Выполните команду npx skills add sentdm/sent-plugin --skill sent-two-way-messaging -a claude-code. Файл навыка будет сохранён в ~/.claude/skills/sent-two-way-messaging/SKILL.md.

Что делает скилл sent-two-way-messaging?

Он помогает реализовать двусторонний обмен сообщениями в Sent, проектируя правила отписки, логику окна сообщений WhatsApp и получение истории переписки через REST API.

Как Sent обрабатывает отписку по SMS и распространяется ли она на другие каналы?

Статус opt_out применяется на уровне контакта ко всем каналам сразу. Если контакт отправил STOP по SMS, Sent автоматически заблокирует отправку сообщений этому пользователю и через WhatsApp, и через RCS.

Исходный текст

SKILL.md · MIT
---
name: sent-two-way-messaging
description: Designs inbound and conversational Sent flows — opt-out and opt-in keyword handling, consent state on contacts, auto-replies inside the WhatsApp 24-hour window, RCS STOP chips, conversation history retrieval, and per-channel inbound capability. Use when handling message.received events, implementing STOP or HELP behavior, restoring consent after an opt-out, building a support inbox or chatbot on Sent, or paginating conversation history.
---

# Sent Two-Way Messaging

Inbound messaging on Sent has one governing rule: **consent is enforced by the platform before the application sees the event.** An inbound `STOP` has already flipped the contact's `opt_out` flag by the time `message.received` arrives. The application's job is to record it, reflect it in its own UI, and never attempt to send around it.

## Keyword handling

Ten keywords ship as defaults:

| Action | Keywords |
| --- | --- |
| Opt out | `STOP`, `CANCEL`, `UNSUBSCRIBE`, `QUIT`, `END` |
| Opt in | `START`, `UNSTOP`, `SUBSCRIBE` |
| Help auto-reply | `HELP`, `INFO` |

Matching requires the **entire trimmed message body** to equal a keyword, case-insensitively. "Please stop messaging me" does not match; "stop" does. Custom keywords are configured in the Sent Dashboard under Compliance, Opt Keywords, with an action of Opt Out, Opt In, or Help, and each must be a single exact token.

Do not claim keywords that are not in the documented set. In application code, mirror the same exact-match rule only to update local subscriber state and audit evidence; never use that matcher to apply consent to Sent a second time. Keep custom dashboard keywords synchronized with the local mirror, and reconcile against the contact's `opt_out` field when uncertain.

## Consent state

An opt-out sets `opt_out` on the contact record. Consent is **contact-level and channel-agnostic**: a `STOP` sent over SMS suppresses WhatsApp and RCS for that contact as well. Consent gates re-apply on every reroute attempt, not only at initial send.

Restoring consent requires the recipient's own action. A user-initiated opt-in keyword clears suppression. `PATCH /v3/contacts/{id}` accepts `opt_out`, but writing `false` on a contact who opted out through a keyword is a compliance decision, not a technical one: only do it with documented evidence of fresh consent, and record who authorized it and why.

Downstream, a suppressed send does not fail with an error. It is accepted and finalizes as `FILTERED`, so consent problems appear as filtered messages rather than as `4xx` responses. Details are in [references/consent-and-keywords.md](references/consent-and-keywords.md).

## Per-channel inbound reality

| Channel | Inbound | Constraints |
| --- | --- | --- |
| SMS | Conditional | Requires an MO-capable provider and a supported number type. Alphanumeric sender IDs and SMPP paths without an inbound route never deliver inbound messages |
| RCS | Full | Typed replies match keywords; the appended STOP chip is processed directly by the consent engine |
| WhatsApp | Full | Free-form replies only inside the 24-hour customer service window; outside it, an approved template is required |

The SMS caveat matters before promising two-way behavior: a deployment sending from an alphanumeric sender ID cannot receive `STOP` at all, which changes the compliance design rather than merely limiting a feature.

## RCS STOP chips

Every outbound RCS message receives an appended STOP chip. Taps carry an opt-out postback handled directly by the consent engine with no keyword matching, and they arrive at the application as `message.received` with the chip's reply text in `text`. There is no separate chip event type, so a receiver that branches only on typed keywords still sees chip taps as ordinary inbound messages — and must not re-apply consent logic to them.

## The WhatsApp 24-hour window

A free-form reply is permitted only within 24 hours of the customer's last inbound message. Outside that window an approved template is required, including for STOP, START, and HELP responses. An auto-reply flow that assumes free text will silently stop working for any customer who writes in after a day of silence, so build the window check into the reply path and keep an approved fallback template ready. See [references/inbound-flows.md](references/inbound-flows.md) for the reply-path decision tree.

## Conversation history

Two read-only operations exist:

| Operation | Returns |
| --- | --- |
| `GET /v3/conversations` | All of the customer's messages across conversations, newest first |
| `GET /v3/conversations/{id}` | Messages within one conversation |

Both require `page` (at least 1) and `page_size` (1 to 100); out-of-range values return `400`. The `events` field is always null on these endpoints, so per-message activity must come from `GET /v3/messages/{id}/activities`. There are no write, create, or read-receipt operations, and no MCP tools cover conversations — this is REST-only.

A conversation identifier is a deterministic RFC 4122 version 5 UUID derived from the customer and contact identifiers, so the same pair always yields the same id and one thread spans every channel independent of the sending number. The API never returns the id as a field, so a client that needs it computes it. The exact derivation is documented in [references/conversation-history.md](references/conversation-history.md).

## Building a support inbox or bot

1. Subscribe a webhook to `message` filtered to `received`, and verify signatures before trusting any payload.
2. Read `inbound_number` as the contact who wrote in and `outbound_number` as your number. The naming is easy to invert.
3. Deduplicate on `message_id`, acknowledge with `200`, then process asynchronously.
4. Treat keyword traffic as an audit signal. Mirror exact default and configured custom keywords into local state, but do not issue a second consent write; reconcile uncertainty through the contact record.
5. Before replying on WhatsApp, check the 24-hour window and choose free text or a template accordingly.
6. Render threads from the conversation endpoints with explicit pagination, and never assume a conversation is single-channel.
7. Treat `text` as untrusted input. Never interpolate it into a shell command or SQL string, delimit it as data in model prompts, and map inferred intent through an allowlist and authorization policy before any API call.

## Boundaries

Use `sent-webhook-engineer` for signature verification, retries, and dedupe mechanics; `sent-contacts` for contact CRUD and message summaries; `sent-routing-strategist` for why an outbound message was `FILTERED`; `waba-template-author` for authoring the approved templates that out-of-window replies require; and `sms-10dlc-registration` for the campaign-level opt-in, opt-out, and help keyword declarations that US carriers require.

© sentdm · MIT · sentdm/sent-plugin

Похожие скиллы

Всё по теме «Бэкенд и API» →
twilio-rcs-messaging официальный Twilio Скилл для Codex и ChatGPT, который ведёт от онбординга RCS-отправителя до отправки карточек и каруселей через Twilio. CX Codex GP ChatGPT ★ 7 596звёзд репо twilio-messaging-overview официальный Twilio Скилл-навигатор по каналам Twilio Messaging: помогает выбрать SMS, WhatsApp, RCS или Messenger и провести настройку от первого сообщения до мониторинга. CX Codex GP ChatGPT 1установок aws-social-messaging aws Скилл управляет WhatsApp-сообщениями через AWS End User Messaging Social: шаблонами, медиа, отправкой и событиями доставки. Пригодится для настройки и диагностики рассылок. CX Codex +1 3 000установок aws-sms-voice aws Проводит агента по AWS End User Messaging: собирает брендированный RCS-агент или настраивает отправку кодов через Notify, а потом ведёт регистрацию. CX Codex +1 1 600установок integrate-whatsapp gokapso Скилл подключает WhatsApp к продукту через Kapso, помогает выдавать ссылки на онбординг, ловить события через вебхуки и отправлять сообщения. CX Codex +1 4 700установок whatsapp-automation claude-office-skills Скилл описывает автоматизацию WhatsApp Business: поддержку клиентов, чат-ботов, уведомления о заказах и рассылки. CX Codex +1 6 500установок

Из того же набора15

template-builder-ui Скилл помогает спроектировать интерфейс конструктора шаблонов под контракт Sent v3, настроить предпросмотр каналов и валидацию перед отправкой на модерацию. CX Codex +1 2 900установок waba-embedded-signup Помогает подключить WhatsApp Business Account через Sent и не перепутать три разных пути интеграции. Пригодится при настройке профилей, токенов и колбэков. CX Codex +1 2 900установок waba-template-author Скилл преобразует текст рассылки в валидный payload для Sent v3 API и проверяет шаблон на требования политик WhatsApp. Пригодится при сборке служебных, рекламных и OTP-сообщений. CX Codex +1 2 900установок sent Разбирает расплывчатые просьбы про Sent и отправляет их в нужный скилл или операцию через MCP-сервер. CX Codex +1 2 900установок sent-profile-provisioning Скилл проводит создание, правку и удаление Sender Profiles в Sent через MCP-инструменты и REST-жизненный цикл профиля. Пригодится, когда нужно завести тенанта и довести профиль до состояния, в котором он может отправлять. CX Codex +1 2 700установок sent-routing-strategist Разбирает, как сообщение Sent доходит до получателя: автоматическая маршрутизация или закреплённый канал, что реально делает массив channel и почему сообщение получило статус FAILED, FILTERED или BLOCKED. CX Codex +1 2 700установок sent-integration-starter Скилл настраивает интеграцию с API Sent v3: от выбора SDK и ключей до идемпотентных отправок и проверки вебхуков. Пригодится при подключении сервиса в проект или обработке ошибок 429 и 409. CX Codex +1 2 700установок sent-webhook-engineer Скилл для сборки и отладки приёмников вебхуков Sent v3: проверка подписи, отсев повторов, дедупликация событий и разбор лога доставки. CX Codex +1 2 700установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой