zaggino/z-schema/custom-format-validators
- community
Checking that the SKILL.md file is still in the repository.
Registers and manages custom format validators in z-schema. Use when the user needs to add custom format validation, create sync or async format validators, register formats globally or per instance, validate emails or dates or phone numbers or custom business rules with format, configure formatAssertions for vocabulary-aware behavior, use customFormats option, list registered formats, handle async format timeouts, or understand how format validation differs across JSON Schema drafts.
Install
npx vskill@latest install zaggino/z-schema/custom-format-validatorsSKILL.md
Custom Format Validators in z-schema
JSON Schema format constrains string (or other) values beyond basic type checking. z-schema includes built-in validators and supports registering custom ones — both sync and async.
Built-in formats
z-schema ships with validators for all standard JSON Schema formats:
<!-- Keep this table in sync with the same table in docs/features.md. -->
| Format | Validates | |
|---|---|---|
date | RFC 3339 full-date (2024-01-15) | |
date-time | RFC 3339 date-time (2024-01-15T09:30:00Z) | |
time | RFC 3339 time (09:30:00Z) | |
email | RFC 5321 email address | |
idn-email | Internationalized email | |
hostname | RFC 1123 hostname | |
host-name | Alias for hostname | |
idn-hostname | Internationalized hostname | |
ipv4 | IPv4 address | |
ipv6 | IPv6 address | |
uri | RFC 3986 URI | |
strict-uri | RFC 3986 URI, validated strictly (also what strictUris: true swaps in for uri) | |
uri-reference | URI or relative reference | |
uri-template | RFC 6570 URI Template (full ABNF, Errata 6937) | |
iri | Internationalized URI | |
iri-reference | Internationalized URI reference | |
json-pointer | RFC 6901 JSON Pointer | |
relative-json-pointer | Relative JSON Pointer | |
regex | ECMA-262 regex | |
duration | ISO 8601 duration | |
uuid | RFC 4122 UUID |
Registering a sync format
A format validator is a function (input: unknown) => boolean. Return true if valid, false if invalid. Return true for non-applicable types (e.g., when input is not a string) — z-schema calls format validators for any value type.
Global registration (shared across all instances)
Instance-scoped registration
Instance formats override global formats with the same name.
Via options at creation time
Pass null to disable a built-in or globally registered format.
Registering an async format
Return Promise<boolean>. The validator must be created with { async: true }.
Timeout
Async format validators time out after asyncTimeout milliseconds (default: 2000). Increase for slow operations:
Timed-out validators produce an ASYNC_TIMEOUT error.
Format assertion behavior across drafts
The JSON Schema spec changed how format works in newer drafts:
| Draft | Default behavior | With formatAssertions: true | |
|---|---|---|---|
| draft-04/06/07 | Always asserts (fails on mismatch) | Always asserts | |
| draft-2019-09 | Always asserts (z-schema default) | Annotation-only unless vocabulary enabled | |
| draft-2020-12 | Always asserts (z-schema default) | Annotation-only unless vocabulary enabled |
z-schema defaults to formatAssertions: null (legacy — always assert). To respect the spec's vocabulary-aware behavior for modern drafts:
To disable all format assertions (annotation-only):
Unknown formats
By default, z-schema reports UNKNOWN_FORMAT for unrecognized format names in draft-04/06/07. Modern drafts (2019-09, 2020-12) always silently ignore unknown formats.
To suppress unknown format errors in older drafts:
Unregistering a format
Listing formats
Real-world patterns
Phone number validation
ISO 8601 date (strict)
Business rule: value from external list
Side-effect: prefill defaults
Format validators can mutate objects (use with caution):
Schema usage
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/custom-format-validators/SKILL.md
Popularity
- Repository stars
- 342
- Repository forks
- 91
- Repository npm downloads, 7 days
- 2,859,562
- 7-day trend score
- 62
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 7 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zaggino/z-schema/custom-format-validators)