.claude/skills/ts-arktype/SKILL.md
Define runtime-validated types with ArkType — TypeScript's 1:1 validator. Use when someone asks to "validate data in TypeScript", "runtime type checking", "ArkType", "type-safe validation", "alternative to Zod", "faster validation library", or "validate with TypeScript syntax". Covers type definitions, validation, morphs (transforms), scopes, and comparison with Zod.
npx skillsauth add eliferjunior/Claude arktypeInstall 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.
ArkType is a runtime validation library that uses TypeScript's own syntax for type definitions. Instead of learning a new API (z.string().email()), you write types the way you already know ("string.email"). It's the fastest TypeScript validator — 100x faster than Zod for complex schemas — with better error messages and 1:1 correspondence between your types and validators.
npm install arktype
// types.ts — Define types using TypeScript syntax
import { type } from "arktype";
// String with constraints
const email = type("string.email");
const result = email("[email protected]"); // "[email protected]"
const error = email("not-an-email"); // ArkErrors: must be an email address
// Object types — looks like TypeScript
const User = type({
name: "string >= 2", // String with min length 2
email: "string.email",
age: "number.integer >= 13", // Integer, min 13
role: "'admin' | 'user'", // Literal union
"bio?": "string <= 500", // Optional, max 500 chars
});
// Infer the TypeScript type — no separate interface needed
type User = typeof User.infer;
// { name: string; email: string; age: number; role: "admin" | "user"; bio?: string }
// Validate
const valid = User({
name: "Kai",
email: "[email protected]",
age: 25,
role: "user",
});
if (valid instanceof type.errors) {
console.log(valid.summary); // Human-readable error message
} else {
console.log(valid.name); // Typed as User
}
// complex.ts — Complex nested types
import { type } from "arktype";
const Address = type({
street: "string",
city: "string",
zip: "string.numeric", // Numeric string
country: "string == 2", // Exactly 2 characters (ISO code)
});
const Order = type({
id: "string.uuid",
items: type({
productId: "string",
quantity: "number.integer > 0",
price: "number > 0",
}).array(), // Array of items
shippingAddress: Address,
total: "number > 0",
status: "'pending' | 'shipped' | 'delivered'",
createdAt: "Date",
});
type Order = typeof Order.infer;
// morphs.ts — Transform data during validation
import { type } from "arktype";
// Parse string to number
const numericString = type("string.numeric").pipe((s) => Number(s));
numericString("42"); // 42 (number)
// Parse and transform API input
const CreateUserInput = type({
name: "string.trim", // Auto-trim
email: type("string.email").pipe((e) => e.toLowerCase()), // Lowercase
age: type("string.numeric").pipe(Number), // String → number
tags: type("string").pipe((s) => s.split(",")), // "a,b,c" → ["a","b","c"]
});
// scope.ts — Define interconnected types
import { scope } from "arktype";
const types = scope({
user: {
id: "string.uuid",
name: "string >= 2",
email: "string.email",
posts: "post[]",
},
post: {
id: "string.uuid",
title: "string >= 1",
content: "string",
author: "user", // Recursive reference
tags: "string[]",
},
}).export();
const user = types.user(data);
User prompt: "Validate incoming POST requests in my Express API with clear error messages."
The agent will define ArkType schemas for each endpoint's body, create validation middleware, and return structured error responses.
User prompt: "My Zod validation is slow on large payloads. Switch to something faster."
The agent will translate Zod schemas to ArkType syntax, update validation middleware, and benchmark the improvement.
"string.email" not z.string().email()type.errors for error checking — result instanceof type.errors.infer for TypeScript type — no duplicate interface definitions.pipe() to transform during validationresult.summary for display? suffix for optional — "bio?": "string" makes bio optional"number >= 0 < 100" is a rangedevelopment
Expert guidance for Fireworks AI, the platform for running open-source LLMs (Llama, Mixtral, Qwen, etc.) with enterprise-grade speed and reliability. Helps developers integrate Fireworks' inference API, fine-tune models, and deploy custom model endpoints with function calling and structured output support.
development
Convert any website into clean, structured data with Firecrawl — API-first web scraping service. Use when someone asks to "turn a website into markdown", "scrape website for LLM", "Firecrawl", "extract website content as clean text", "crawl and convert to structured data", or "scrape website for RAG". Covers single-page scraping, full-site crawling, structured extraction, and LLM-ready output.
tools
Expert guidance for Firebase, Google's platform for building and scaling web and mobile applications. Helps developers set up authentication, Firestore/Realtime Database, Cloud Functions, hosting, storage, and analytics using Firebase's SDK and CLI.
development
When the user needs to build file upload functionality for a web application. Use when the user mentions "file upload," "image upload," "upload endpoint," "multipart upload," "presigned URL," "S3 upload," "file validation," "upload to cloud storage," or "accept user files." Handles upload endpoints, file validation (type, size, magic bytes), cloud storage integration, and upload status tracking. For image/video processing after upload, see media-transcoder.