What problem does it solve? Writing high-performance serialization and validation code with msgspec requires knowing its specific patterns: Struct options, Meta constraints, tagged unions, encoder/decoder singletons, and hooks for custom types. This Skill provides those patterns so generated code follows msgspec best practices instead of falling back to slower Pydantic or dataclass habits. ## Core Features & Use Cases - Struct Definition & Validation: Generate msgspec.Struct models with Annotated Meta constraints (gt, ge, min_length, pattern), kw_only, frozen, and forbid_unknown_fields options. - Serialization Codecs: Set up cached JSON and MessagePack Encoder/Decoder singletons with enc_hook/dec_hook for datetime, UUID, Decimal, and Enum types. - Tagged Unions & Conversion: Build discriminated unions with custom tag fields and values, plus strict/lax type coercion via msgspec.convert(). - Use Case: When building a Litestar API, use this Skill to define camelCase response Structs, a to_json serializer (re-exporting sqlspec's when available), and a tagged-union event system with round-trip encode/decode validation. ## Quick Start Define a msgspec Struct for a user API response with validation constraints and a JSON encoder that handles UUID and datetime fields.