agentleFS
wittyreferencewittyreference/twilio-claude-plugin/skills/messaging-services/SKILL.md

messaging-services

Skill2 starsChanged 8 months agoMITView on GitHub

Twilio development skill: messaging-services

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Total: 2–10+ business days: Do NOT promise same-day high-volume messaging.

    line 52
  2. Very specific:

    Opt-Out Auto-Handling: STOP/STOPALL/etc. never reach your webhook.

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- ABOUTME: Essential context for Messaging Services functions with sender pools and compliance. --><!-- ABOUTME: Covers file inventory, key differences from basic messaging, A2P 10DLC, and error codes. -->

Messaging Services Context

For full API examples, service features, and common patterns, see REFERENCE.md.

Files

FileAccessDescription
send-message.protected.jsProtectedSend SMS/MMS via Messaging Service with optional scheduling and status callbacks
sender-pool.protected.jsProtectedManage sender pool: list/add/remove phone numbers via action param
incoming-handler.jsPublicInbound webhook with keyword routing (HELP, INFO) and default acknowledgment

Key Difference from Basic Messaging

Uses messagingServiceSid instead of from — Twilio selects the optimal sender from the pool:

// Basic: await client.messages.create({ to, from: phoneNumber, body });
// Service: await client.messages.create({ to, messagingServiceSid: serviceSid, body });

Service Features (Overview)

  • Sender Pool: Multiple numbers for scale and deliverability
  • Sticky Sender: Same number for ongoing conversations
  • Geographic Matching: Local numbers when available
  • MMS Conversion: Auto-fallback when MMS unsupported
  • Smart Encoding: GSM-compatible character conversion
  • Link Shortening: Click-through tracking
  • Compliance: Built-in opt-out (STOP/HELP) management

A2P 10DLC (US)

Registration flow: Brand → Campaign → Number Assignment. Required for US messaging at scale.

Use CaseThroughput
2faHighest
notifications, customer_care, delivery_notifications, account_notificationHigher
marketingStandard

Registration Timeline

Total: 2–10+ business days. Do NOT promise same-day high-volume messaging.

StageDurationNotes
Brand registration1–7 business daysVetting by TCR. Sole proprietors take longer
Campaign registration1–3 business daysPer-campaign review
Number assignmentInstantAfter campaign approval
Throughput ramp1–14 daysStarts at low TPS, ramps to campaign limit

For 50K+ messages/day, budget 2–4 weeks total including ramp-up. Unregistered traffic on 10DLC numbers gets filtered aggressively.

Webhook Parameters

Status Callback

ParameterDescription
MessageSidMessage identifier
MessageStatusqueued, sent, delivered, undelivered, failed
ErrorCode / ErrorMessageError details if failed
MessagingServiceSidAssociated service

Error Codes

CodeDescription
21211Invalid 'To' phone number
21408Permission to send not enabled
21610Recipient opted out
21611No phone numbers in Messaging Service
21614'To' not verified (trial accounts)
21617Messaging Service not found
30003Unreachable destination
30004Message blocked (spam)
30005Unknown destination
30006Landline or unreachable carrier
30007Carrier violation

Environment Variables

TWILIO_MESSAGING_SERVICE_SID=MGxxxxxxxx

Gotchas

  • Empty Sender Pool: Error 21611 if no numbers added to service. Add numbers before sending.
  • Sticky Sender Persistence: Binding persists even after removing a number. Clear via API if needed.
  • 10DLC Registration Required: US A2P messaging without registration gets heavily filtered.
  • Scheduled Message Limits: Max 7 days in advance. scheduleType: 'fixed' required.
  • MMS Conversion Side Effects: With mmsConverter: true, MMS becomes SMS+link on some carriers — changes UX.
  • Opt-Out Auto-Handling: STOP/STOPALL/etc. never reach your webhook. Don't try to intercept them.

File Naming

  • *.js — Public (inbound webhooks)
  • *.protected.js — Protected (sending, status callbacks)
  • *.private.js — Private (formatting, validation helpers)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.