arktype-validation
ArkType runtime validation with TypeScript-native syntax. Type-safe schemas using string expressions, morphs, scopes, and generics. Includes ArkEnv for typesafe environment variable validation with auto-coercion and Vite plugin. Use when defining schemas, validating data, transforming input, building type-safe APIs with ArkType, or validating environment variables with ArkEnv.
What this skill does
# ArkType Validation
## Overview
ArkType is a TypeScript-native runtime validation library that defines schemas using string expressions mirroring TypeScript syntax, providing editor autocomplete, syntax highlighting, and optimized validators. Use when building type-safe APIs, validating JSON payloads, or replacing Zod with a more TypeScript-idiomatic approach. Not suitable for projects that need Zod ecosystem compatibility or JSON Schema output.
**Package:** `arktype`
## Quick Reference
| Pattern | Usage |
| --------------------------------- | ----------------------------------------------- |
| `type({ key: "string" })` | Define object schema |
| `type("string")` | Primitive type |
| `"string.email"`, `"string.url"` | Built-in string validators |
| `"string.trim"`, `"string.lower"` | Built-in string morphs (transforms) |
| `"string.json.parse"` | Parse JSON string to validated object |
| `"number > 0"`, `"string >= 1"` | Inline constraints |
| `"string \| number"` | Union types |
| `"'a' \| 'b' \| 'c'"` | String literal unions |
| `"string[]"` | Array types |
| `"key?": "string"` | Optional properties |
| `"key = 'default'"` | Default values |
| `.pipe()`, `.to()` | Transform output (morphs) |
| `.narrow()` | Custom validation (like Zod refine) |
| `.pick()`, `.omit()` | Object property selection |
| `.merge()` | Combine object types |
| `scope({...}).export()` | Named type scopes with cross-references |
| `type("<t>", { box: "t" })` | Generic type definitions |
| `type.errors` | Error handling (check `instanceof type.errors`) |
| `.assert(data)` | Throws on invalid input instead of returning |
| `"(number % 2)#even"` | Branding — type-only validated marker |
| `"0 <= number <= 100"` | Compact range constraints |
| `configure()` | Global defaults (from `arktype/config`) |
| `match()` | Type-safe pattern matching (2.1) |
| `"+" : "reject"` | Inline undeclared key handling |
| `arkenv({ PORT: "number" })` | Typesafe env var validation (ArkEnv) |
| `arkenvVitePlugin(Env)` | Build-time env validation for Vite |
## Common Mistakes
| Mistake | Fix |
| ------------------------------------- | ----------------------------------------------- |
| `type("string.email()")` with parens | `type("string.email")` (no parens) |
| Checking errors with `=== null` | Use `instanceof type.errors` |
| `{ key: "string?" }` for optional | `{ "key?": "string" }` (question mark on key) |
| Importing from `arktype/types` | Import `type` and `scope` from `"arktype"` |
| Nested `type()` in string expressions | Use `scope()` for cross-referencing types |
| Raw `.pipe()` without error handling | Use `.pipe.try()` for operations that can throw |
| `"string.lowercase"` for case morph | `"string.lower"` (also `"string.upper"`) |
| Configuring after importing `arktype` | Import `arktype/config` before `arktype` |
| Manual `process.env` parsing | Use `arkenv()` for auto-coercion and validation |
## Delegation
Use this skill for ArkType schema definitions, runtime validation, morphs/transforms, scopes, and type inference. For Zod-based validation, delegate to the zod-validation skill.
## References
- [Schema Types](references/schema-types.md) — primitives, string keywords, number constraints, objects, arrays, tuples, unions, optional, defaults
- [Morphs and Scopes](references/morphs-and-scopes.md) — pipe, morph transforms, narrow validation, scopes, recursive types, generics, global configuration, pattern matching
- [Common Patterns](references/common-patterns.md) — JSON parsing, form validation, API responses, error handling, ArkEnv environment variables, Vite plugin, comparison with Zod
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.