skills/handling-commands/SKILL.md
Patterns for handling commands, validating input, and filtering messages in XMTP agents. Use when implementing slash commands, validators, or message filters. Triggers on command handling, input validation, or type guards.
npx skillsauth add xmtplabs/xmtp-agent-examples handling-commandsInstall 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.
Best practices for handling commands, validating input, and filtering messages.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Validators | CRITICAL | validators- |
| 2 | Filters | HIGH | filters- |
| 3 | Type Guards | HIGH | guards- |
validators-hex - Use validHex() for hex string validationvalidators-address - Validate Ethereum addressesfilters-message-types - Filter by message type (SDK 2.0+: use direct imports isText, isReaction, isReply, etc. from @xmtp/agent-sdk; keep filter.fromSelf, filter.hasDefinedContent)filters-sender - Filter out self-messagesfilters-content - Check for defined contentguards-codec - Use usesCodec() instead of type assertionsguards-content-type - Use filter helpers for type safetyRead individual rule files for detailed explanations:
rules/validators-hex.md
rules/filters-message-types.md
rules/guards-codec.md
development
Emoji reactions and thinking indicators for XMTP agents. Use when adding reactions to messages or showing processing state with thinking emoji. Triggers on emoji reactions, thinking indicator, or message acknowledgment.
development
ENS and Web3 identity resolution for XMTP agents. Use when resolving domain names, extracting mentions, or fetching Farcaster profiles. Triggers on ENS resolution, Farcaster lookup, or mention extraction.
data-ai
Group conversation management for XMTP agents. Use when creating groups, managing members, setting permissions, or sending welcome messages. Triggers on group creation, member management, or permissions.
data-ai
Token transactions and wallet integration for XMTP agents. Use when sending USDC, creating transaction requests, or handling transaction confirmations. Triggers on USDC transfer, wallet calls, or transaction reference.