standard-schema
Skill1 starsChanged 31 days agoMITView on GitHub
Standard Schema v1: accept any validator via ~standard, and implement or consume the @standard-schema/spec interfaces (StandardSchemaV1, StandardJSONSchemaV1, StandardTypedV1). Use when writing a library, framework, form, router, RPC or MCP tool that accepts user schemas from Zod, Valibot, ArkType, Effect Schema or any compliant validator; when making a schema library spec-compliant; when handling the validate result ({ value } or { issues }) and sync or async validation; when inferring types with InferInput and InferOutput; or when generating JSON Schema (draft-2020-12, draft-07, openapi-3.0) from a schema with Standard JSON Schema. Triggers: standard schema, ~standard, @standard-schema/spec, StandardSchemaV1, validator-agnostic, schema adapter, issues path, jsonSchema.input, jsonSchema.output.
Files
Standard Schema
Standard Schema is a family of TypeScript interfaces, designed by the creators of Zod, Valibot and ArkType, that let tools accept user-defined schemas from any compliant library without per-library adapters. The types are published as @standard-schema/spec. With this skill the agent consumes or implements StandardSchemaV1 (validation) and StandardJSONSchemaV1 (JSON Schema conversion), both built on StandardTypedV1.
Follow the workflow below step by step. Every rule here comes from a source in Sources. The spec has no numbered sections, so citations name the interface member in @standard-schema/spec 1.1.0 (for example StandardSchemaV1.SuccessResult) or the FAQ question on the spec page. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Inputs (fill in, or ask before starting)
- Role: consumer (a tool that accepts schemas), implementer (a schema library), or both.
- Interfaces:
StandardSchemaV1(validate),StandardJSONSchemaV1(convert to JSON Schema), or both. - Sync or async: whether the consumer can await validation.
- Revision: the pinned package version in Sources, unless the user names another.
- Sources: when refreshing this skill or when a rule looks out of date, re-read every URL in Sources first, check the npm registry for a newer
@standard-schema/specversion and the repository tags for a new release, and update the pins.
Invariants
- One namespaced property. The whole interface lives under the
~standardproperty, withversion: 1and avendorstring naming the library (StandardTypedV1.Props; design goals "Avoid API conflicts"). validatetakesunknown.~standard.validate(value, options?)returns aResultor aPromiseof one (StandardSchemaV1.Props.validate).options.libraryOptionscarries vendor-specific parameters (StandardSchemaV1.Options).- The result shape decides success. Success is
{ value }withissuesundefined; a falsyissuesmeans success. Failure is{ issues }, an array ofIssue(StandardSchemaV1.SuccessResult,StandardSchemaV1.FailureResult). - Issues have a message and an optional path.
messageis a string;pathis an array whose segments are aPropertyKeyor an object{ key }(StandardSchemaV1.Issue,StandardSchemaV1.PathSegment). - Async is allowed but discouraged. A consumer that only accepts synchronous validation throws when
validatereturns aPromise; libraries are encouraged to validate synchronously whenever possible (FAQ "How to only allow synchronous validation?"). - Types are type-level only.
typesis optional and exists for inference; read it withInferInputandInferOutput(StandardTypedV1.Types,StandardTypedV1.InferInput,StandardTypedV1.InferOutput). - The package is optional and types-only. Copy the types or depend on
@standard-schema/specand import withimport type. If the interface is part of your public API, it is a regular dependency, never a dev dependency (FAQ "Do I need to add@standard-schema/specas a dependency?", "Can I add it as a dev dependency?"). - JSON Schema conversion may throw.
~standard.jsonSchema.input(options)and.output(options)return a JSON Schema object for atarget; implementers should throw for unsupported targets, and consumers should account for a throw (StandardJSONSchemaV1.Converter,StandardJSONSchemaV1.Options; Standard JSON Schema FAQ "What about error handling?"). - The two specs are orthogonal.
StandardJSONSchemaV1has no validation; an object may implement either or both (Standard JSON Schema FAQ "What's the relationship between this and Standard Schema?").
Workflow
- Add the types. Depend on
@standard-schema/specat the pinned version as a regular dependency, or copy the interfaces verbatim. ->references/interface.md✓ The types match the pinnedsrc/index.ts, and nothing imports them as values. - Consume schemas. Accept a generic
T extends StandardSchemaV1, call~standard.validate, handle aPromise(await it or reject it), branch onissues, and normalize issue paths. ->references/consuming.md✓ Input and output types come fromInferInputandInferOutput, and no code depends on a specificvendor. - Implement the interface (schema library authors). Add
~standardto every schema object, returning{ value }or{ issues }from your existing validation code. ->references/implementing.md✓ The schema satisfiesStandardSchemaV1<Input, Output>withsatisfiesorimplements, and validates synchronously where possible. - Generate JSON Schema where needed. Call
jsonSchema.inputor.outputwith atarget; implementers supportdraft-2020-12anddraft-07at least. ->references/json-schema.md✓ Unsupported targets throw in the implementer and are caught in the consumer, and input and output schemas are chosen deliberately. - Check which libraries qualify. Confirm the minimum version of each validator your users bring.
->
references/libraries.md✓ Documentation names minimum versions from the spec pages, and notes libraries that need an adapter.
Verify before done
- Each implemented schema satisfies the pinned interface:
versionis1,vendoris set,validatereturns{ value }or{ issues }. - Consumers test
result.issuesfor truthiness, as the officialintegrate.tsexample does, rather than testingvalue. - A consumer that cannot await rejects a
Promiseresult with a clear error, as in the spec FAQ. - Issue paths are normalized from both segment forms before display or serialization.
@standard-schema/specis independencies(or the types are copied), never only indevDependencies, when it appears in your public types.- JSON Schema calls pass an explicit
targetand handle a thrown error. - Code compiles against the official examples in the repository's
packages/examplesat the pinned tag.
Reference index
references/interface.md: the full v1 interfaces with each member explained. Load for step 1.references/consuming.md: generic validation helpers, sync-only handling, path normalization, and turning issues into an HTTP error body. Load for step 2.references/implementing.md: adding~standardto a schema library, with the official example. Load for step 3.references/json-schema.md:StandardJSONSchemaV1, targets, input versus output, combining withStandardSchemaV1. Load for step 4.references/libraries.md: implementers and minimum versions for both specs, as listed on 2026-10-02. Load for step 5.
Related skills
openapifor placing Standard JSON Schema output (for example theopenapi-3.0ordraft-2020-12target) into an OpenAPI document:npx skills add ScaleDockHQ/scaledock-skills --skill openapi.problem-detailsfor returning validation issues as an RFC 9457 response:npx skills add ScaleDockHQ/scaledock-skills --skill problem-details.
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
- Standard Schema specification: Released, v1 in
@standard-schema/spec1.1.0, checked 2026-10-02. - Standard JSON Schema specification: Released, v1 in
@standard-schema/spec1.1.0, checked 2026-10-02. - Standard Schema project overview: Released,
@standard-schema/spec1.1.0 (addsStandardTypedV1), checked 2026-10-02. @standard-schema/specsource at tag v1.1.0: Released, tag v1.1.0, checked 2026-10-02.@standard-schema/specon the npm registry: Released, 1.1.0 (latest dist-tag, published 2025-12-15), checked 2026-10-02.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- find-skillsSkill
- a2aSkill
- ag-uiSkill
- ap2Skill
- asyncapiSkill
- authzenSkill
- cedarSkill
- cloudeventsSkill
- eu-ai-actSkill
- fapiSkill
- gnapSkill
- jwtSkill
- mcp-authorizationSkill
- oauthSkill
- ocsfSkill
- openapi-arazzoSkill
- openapi-overlaySkill
- openapiSkill
- openfeatureSkill
- openid4vcSkill
- openid-connectSkill
- openid-federationSkill
- openidSkill
- opentelemetry-genaiSkill
- owasp-agenticSkill
- problem-detailsSkill
- ratelimit-headersSkill
- scaledock-agent-permissionsSkill
- scaledock-enterprise-identitySkill
- scaledock-http-apiSkill
- scaledock-mcp-serverSkill
- scaledock-repo-standardSkill
- scimSkill
- shared-signalsSkill
- spiffeSkill
- typespecSkill
- web-bot-authSkill
- webmcpSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

