
Twilio Communications
Wire Twilio SMS, voice, WhatsApp, and verification flows with E.164 formatting, rate limits, and carrier-aware error handling.
Overview
Twilio Communications is an agent skill for the Build phase that implements SMS, voice, WhatsApp, and user verification with Twilio APIs, compliance, and production-grade error handling.
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill twilio-communicationsWhat is this skill?
- SMS sending pattern with E.164 validation, TwilioRestException handling, and delivery callbacks
- Coverage spans SMS notifications, voice/IVR, WhatsApp Business API, and multi-channel 2FA verification
- Operational defaults called out: ~80 MPS, 160-character segmentation, US carrier filtering risk
- Compliance, rate limits, and error handling framed as first-class—not optional add-ons
- Python-oriented Client examples for transactional alerts, reminders, and auth codes
- Default SMS rate limit noted at 80 messages per second (MPS)
- Messages over 160 characters split into segments
- SMS sending pattern documented as the foundational integration flow
Adoption & trust: 723 installs on skills.sh; 40.1k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need SMS or voice in your app but keep getting blocked messages, wrong number formats, or unhandled API errors in production.
Who is it for?
Indie SaaS or apps adding transactional SMS, WhatsApp notifications, or phone verification without hiring a telephony specialist first pass.
Skip if: Marketing-only email stacks, or products that cannot use Twilio-compliant opt-in and regional messaging rules.
When should I use this skill?
Building SMS, voice, WhatsApp, or verification features with Twilio including compliance and rate limits
What do I get? / Deliverables
You get validated Twilio integration patterns—send, verify, and callback flows—with formatting and rate-limit assumptions your agent can turn into working backend code.
- SMS send helper with validation and TwilioRestException handling
- Guidance for verify/voice/WhatsApp flows scoped to your use case
- Callback and compliance checklist for production sends
Recommended Skills
Journey fit
Twilio work happens while integrating external comms APIs into the product—not during launch SEO or operate monitoring unless you are only fixing production webhooks. Third-party messaging and telephony providers belong on the integrations shelf alongside payments and email providers.
How it compares
Skill-guided Twilio integration patterns—not a hosted inbox UI or a generic ‘send email’ skill.
Common Questions / FAQ
Who is twilio-communications for?
Solo builders shipping notifications, alerts, IVR, or 2FA who already chose Twilio and want agent-assisted, error-aware implementation snippets.
When should I use twilio-communications?
During Build integrations when adding SMS order updates, voice callbacks, WhatsApp Business messages, or verify APIs—before you hard-code untested send loops.
Is twilio-communications safe to install?
Check the Security Audits panel on this page; never commit Account SID or Auth Token—load secrets from env and rotate if exposed.
SKILL.md
READMESKILL.md - Twilio Communications
# Twilio Communications Build communication features with Twilio: SMS messaging, voice calls, WhatsApp Business API, and user verification (2FA). Covers the full spectrum from simple notifications to complex IVR systems and multi-channel authentication. Critical focus on compliance, rate limits, and error handling. ## Patterns ### SMS Sending Pattern Basic pattern for sending SMS messages with Twilio. Handles the fundamentals: phone number formatting, message delivery, and delivery status callbacks. Key considerations: - Phone numbers must be in E.164 format (+1234567890) - Default rate limit: 80 messages per second (MPS) - Messages over 160 characters are split (and cost more) - Carrier filtering can block messages (especially to US numbers) **When to use**: Sending notifications to users,Transactional messages (order confirmations, shipping),Alerts and reminders from twilio.rest import Client from twilio.base.exceptions import TwilioRestException import os import re class TwilioSMS: """ SMS sending with proper error handling and validation. """ def __init__(self): self.client = Client( os.environ["TWILIO_ACCOUNT_SID"], os.environ["TWILIO_AUTH_TOKEN"] ) self.from_number = os.environ["TWILIO_PHONE_NUMBER"] def validate_e164(self, phone: str) -> bool: """Validate phone number is in E.164 format.""" pattern = r'^\+[1-9]\d{1,14}$' return bool(re.match(pattern, phone)) def send_sms( self, to: str, body: str, status_callback: str = None ) -> dict: """ Send an SMS message. Args: to: Recipient phone number in E.164 format body: Message text (160 chars = 1 segment) status_callback: URL for delivery status webhooks Returns: Message SID and status """ # Validate phone number format if not self.validate_e164(to): return { "success": False, "error": "Phone number must be in E.164 format (+1234567890)" } # Check message length (warn about segmentation) segment_count = (len(body) + 159) // 160 if segment_count > 1: print(f"Warning: Message will be sent as {segment_count} segments") try: message = self.client.messages.create( to=to, from_=self.from_number, body=body, status_callback=status_callback ) return { "success": True, "message_sid": message.sid, "status": message.status, "segments": segment_count } except TwilioRestException as e: return self._handle_error(e) def _handle_error(self, error: TwilioRestException) -> dict: """Handle Twilio-specific errors.""" error_handlers = { 21610: "Recipient has opted out. They must reply START.", 21614: "Invalid 'To' phone number format.", 21211: "'From' phone number is not valid.", 30003: "Phone is unreachable (off, airplane mode, no signal).", 30005: "Unknown destination (invalid number or landline).", 30006: "Landline or unreachable carrier.", 30429: "Rate limit exceeded. Implement exponential backoff.", } return { "success": False, "error_code": error.code, "error": error_handlers.get(error.code, error.msg), "details": str(erro