askill
handling-commands

handling-commandsSafety 70Repository

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.

50 stars
1.2k downloads
Updated 2/20/2026

Package Files

Loading files...
SKILL.md

XMTP commands and validation

Best practices for handling commands, validating input, and filtering messages.

When to apply

Reference these guidelines when:

  • Implementing slash commands
  • Validating hex strings and addresses
  • Filtering message types
  • Using type guards instead of type assertions

Rule categories by priority

PriorityCategoryImpactPrefix
1ValidatorsCRITICALvalidators-
2FiltersHIGHfilters-
3Type GuardsHIGHguards-

Quick reference

Validators (CRITICAL)

  • validators-hex - Use validHex() for hex string validation
  • validators-address - Validate Ethereum addresses

Filters (HIGH)

  • filters-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-messages
  • filters-content - Check for defined content

Type Guards (HIGH)

  • guards-codec - Use usesCodec() instead of type assertions
  • guards-content-type - Use filter helpers for type safety

How to use

Read individual rule files for detailed explanations:

rules/validators-hex.md
rules/filters-message-types.md
rules/guards-codec.md

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

55/100Analyzed 2/22/2026

A reference-style skill providing a framework for command handling patterns in XMTP agents with priority categories (validators, filters, type guards). Has good structure and a 'When to apply' section, but actual implementation details are in referenced external files that aren't included. Tags are empty. Moderate value as a lookup index but limited immediate actionability without the referenced rule files."

70
75
60
45
40

Metadata

Licenseunknown
Version-
Updated2/20/2026
Publisherxmtplabs

Tags

No tags yet.