senrecep/tsentials/tsentials-validation
Claude Code and agent skill by senrecep/tsentials
- community
Checking that the SKILL.md file is still in the repository.
Use when validating a model with fluent, eager, Result-based rules — Validator.validate with rules.for('path').notEmpty().maxLength(), nested paths and forEach for collections, cascade modes, subclassable Validator<T>, validateAsync with mustAsync and AbortSignal, validateWith as a railway step.
Install
npx vskill@latest install senrecep/tsentials/tsentials-validationSKILL.md
tsentials/validation
Fluent model validation that returns Result<T>. Rules run eagerly; the success value is the validated instance. Subpath-only: not exported from the root tsentials entry.
Installation
Import
Inline validation
Error code format is <path>.<Rule>; all errors have type Validation.
Validator subclass
Cascade and null handling
- Default cascade is
Stop: the first failure on a chain skips the remaining rules of that chain. Use.cascade(CascadeMode.Continue)to accumulate. null/undefinedare skipped by every built-in rule exceptnotNull,notEmptyandequal. Guard optional values withnotEmpty()first.
Built-in rules (on rules.for(...))
| Group | Rules | |
|---|---|---|
| Presence | notNull, null, notEmpty | |
| String | maxLength, minLength, length, emailAddress, matches, contains, startsWith, endsWith | |
| Comparison | equal, notEqual, greaterThan, greaterThanOrEqualTo, lessThan, lessThanOrEqualTo, inclusiveBetween, exclusiveBetween | |
| Collection | minCount, maxCount, countBetween | |
| Enum | isDefinedEnum, isOneOf, hasOnlyDefinedFlags | |
| Custom | must(pred), must(pred, code, message), satisfies(rule), setValidator(v) |
rules.forEach(path, configure) validates each element; rules.self() validates the model itself; rules.addFailure(code, description) adds an error directly.
Async validation
Await every async rule (mustAsync, forEachAsync, setValidatorAsync, satisfiesAsync) inside the callback. validate() throws TypeError if configure returns a promise or leaves an async rule un-awaited.
Railway step
Patterns and pitfalls
- Import from
tsentials/validation— never from the roottsentialsentry. - AbortSignal convention: the caller's abort makes the promise reject with
signal.reason; it never becomes a validation error. An exception thrown by an async rule predicate or byconfigurerejects too (never a failure); usemustAsyncpredicates that returnfalsefor validation failures. - Subclasses implement
configure(rules)as a sync method; usevalidateAsyncwith anAsyncConfigurefor async rules. - Errors use
description, notmessage:r.errors[0]?.description. - A message argument may be a string or an
AppError.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.well-known/agent-skills/tsentials-validation/SKILL.md
Popularity
- Repository stars
- 59
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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/senrecep/tsentials/tsentials-validation)