type-level-error-messages
Installation
SKILL.md
Type-Level Error Messages
Related Skills: See
typescriptfor general TypeScript conventions. Seearktypefor runtime regex validation and where this pattern surfaces in arktype itself.
The pattern in one example
// 1. Predicate on the literal type.
type IsSnakeCase<S extends string> = /* recursive template literal walk */;
// 2. Branded error type. The trailing is a zero-width space.
type InvalidKey<S extends string> =
`Invalid action key "${S}", must be snake_case ASCII matching /^[a-z][a-z0-9_]*$/`;