davila7 avatar

Twilio Communications

This is a solid foundation for Twilio integration that covers the three main use cases: sending SMS messages, handling 2FA with Twilio Verify, and building IVR phone menus with TwiML. The patterns include proper error handling, phone number validation for E.164 format, and webhook security validation. The Verify pattern is the standout here since it saves you from rolling your own OTP system and gets you built-in fraud prevention. The IVR example shows the basics of gathering touch-tone input and routing calls. Use this when you need to add phone-based features to your app and want working code that handles the common gotchas like message segmentation costs and rate limits.

skills.sh installs
213
GitHub stars
33.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add davila7/claude-code-templates --skill twilio-communications --agent claude-code

Installs into .claude/skills of the current project.

Files

Twilio Communications

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"]

Sponsors

Details

Repository
github.com/davila7/claude-code-templates
Categories
Backend & APIs, Security, DevOps & CI/CD, Debugging
First seen
Jun 3, 2026

More from davila7/claude-code-templates

All 618
1davila7 avatarhubspot-integrationdavila7/claude-code-templatesExpert patterns for HubSpot CRM integration including OAuth authentication, CRM objects, associations, batch operations, webhooks, and custom objects. Covers No212skills.sh installs
2get-convex avatarfunction-creatorget-convex/convex-agent-pluginsCreate Convex queries, mutations, and actions with proper validation, authentication, and error handling. Use when implementing new API endpoints.209skills.sh installs
3itechmeat avatarrefine-devitechmeat/llm-codeRefine.dev headless React framework for CRUD apps: data providers, resources, routing, authentication, hooks, and forms. Use when building admin panels, dashboa208skills.sh installs
4sendaifun avatarsolana-kit-migrationsendaifun/skillsHelps developers understand when to use @solana/kit vs @solana/web3.js (v1), provides migration guidance, API mappings, and handles edge cases for Solana JavaSc208skills.sh installs
5davila7 avatarneon-postgresdavila7/claude-code-templatesExpert patterns for Neon serverless Postgres, branching, connection pooling, and Prisma/Drizzle integration Use when: neon database, serverless postgres, databa206skills.sh installs
6yonatangross avatarimplementyonatangross/orchestkitFull-power feature implementation using parallel subagents for backend, frontend, testing, and security, with worktree isolation and quality verification in one206skills.sh installs