Navigate the Valibot repository structure. Use when looking for files, understanding the codebase layout, finding schema/action/method implementations, locating tests, API docs, or guide pages. Covers monorepo layout, library architecture, file naming conventions, and quick lookups.
valibot/
├── library/ # Core valibot package (zero dependencies)
├── packages/
│ ├── i18n/ # Translated error messages (25+ languages)
│ └── to-json-schema/ # JSON Schema converter
├── codemod/
│ ├── migrate-to-v0.31.0/ # Version migration
│ └── zod-to-valibot/ # Zod converter
├── website/ # valibot.dev (Qwik + Vite)
├── brand/ # Brand assets
├── skills/ # Agent skills (this folder)
└── prompts/ # Legacy AI agent guides
/library/src/)| Directory | Purpose | Examples |
|---|---|---|
schemas/ | Data type validators |
string/, object/, array/, union/ |
actions/ | Validation & transformation | email/, minLength/, trim/, transform/ |
methods/ | High-level API | parse/, safeParse/, pipe/, partial/ |
types/ | TypeScript definitions | schema.ts, issue.ts, dataset.ts |
utils/ | Internal helpers (prefixed _) | _addIssue/, _stringify/, ValiError/ |
storages/ | Global state | Config, message storage |
string, number, boolean, bigint, date, symbol, blob, fileobject, strictObject, looseObject, objectWithRestarray, tuple, strictTuple, looseTuple, tupleWithRestunion, variant, intersect, record, map, set, lazy, customoptional, nullable, nullish, nonNullable, nonNullish, nonOptionalValidation (return issues): email, url, uuid, regex, minLength, maxValue, check
Transformation (modify data): trim, toLowerCase, toUpperCase, mapItems, transform
Metadata: brand, flavor, metadata, description, title
Each schema/action/method has its own directory:
schemas/string/
├── string.ts # Implementation
├── string.test.ts # Runtime tests
├── string.test-d.ts # Type tests
└── index.ts # Re-export
Schemas define data types:
export interface StringSchema<TMessage> extends BaseSchema<...> {
readonly kind: 'schema';
readonly type: 'string';
// ...
}
Actions validate/transform in pipelines:
export interface EmailAction<TInput, TMessage> extends BaseValidation<...> {
readonly kind: 'validation';
readonly type: 'email';
// ...
}
Methods provide API functions:
export function parse<TSchema>(
schema: TSchema,
input: unknown
): InferOutput<TSchema>;
BaseSchema, BaseValidation, BaseTransformation - Base interfacesInferOutput<T>, InferInput<T>, InferIssue<T> - Type inferenceConfig, ErrorMessage<T>, BaseIssue<T> - Configuration and errors'~standard' property - Standard Schema compatibility/website/src/routes/)routes/api/
├── (schemas)/string/ # Schema docs
│ ├── index.mdx # MDX content
│ └── properties.ts # Type definitions
├── (actions)/email/ # Action docs
├── (methods)/parse/ # Method docs
├── (types)/StringSchema/ # Type docs
└── menu.md # Navigation
routes/guides/
├── (get-started)/ # Intro, installation
├── (main-concepts)/ # Schemas, pipelines, parsing
├── (schemas)/ # Objects, arrays, unions
├── (advanced)/ # Async, i18n, JSON Schema
├── (migration)/ # Version upgrades
└── menu.md # Navigation
Use library/playground.ts for quick experimentation.
library/src/schemas/yourSchema/yourSchema.ts, yourSchema.test.ts, yourSchema.test-d.ts, index.tsindex.tspnpm -C library test⚠️ Changes to library/src/types/ affect the entire library. Always run full test suite.
| Looking for... | Location |
|---|---|
| Schema implementation | library/src/schemas/[name]/[name].ts |
| Action implementation | library/src/actions/[name]/[name].ts |
| Method implementation | library/src/methods/[name]/[name].ts |
| Type definitions | library/src/types/ |
| Internal utilities | library/src/utils/ |
| Error messages (i18n) | packages/i18n/[lang]/ |
| API docs page | website/src/routes/api/(category)/[name]/ |
| Guide page | website/src/routes/guides/(category)/[name]/ |
| Tests | Same directory as source, .test.ts suffix |
| Type tests | Same directory as source, .test-d.ts suffix |
# Library
pnpm -C library build # Build
pnpm -C library test # Run tests
pnpm -C library lint # Lint
pnpm -C library format # Format
# Website
pnpm -C website dev # Dev server
pnpm -C website build # Production build
# Root
pnpm install # Install all
pnpm format # Format all
// @__NO_SIDE_EFFECTS__ annotation.ts extensionsDo:
Don't:
dist/, coverage/)