tsentials-rules

Compose typed sync or async business validation rules for TypeScript.

49|Updated May 12, 2026
One-click install
npx skills add https://github.com/senrecep/tsentials --skill tsentials-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsentials-rules
Source: https://github.com/senrecep/tsentials/tree/main/.well-known/agent-skills/tsentials-rules
Command: npx skills add https://github.com/senrecep/tsentials --skill tsentials-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you express business validation as small, typed predicates and combine them into reliable rule sets, avoiding tangled conditionals and inconsistent error handling.

Core Features & Use Cases

  • Composable Rule Engine: Build validation logic from sync and async rules and combine them with and/or/linear/if patterns.
  • Typed and Untyped Rule Variants: Use Rule<TContext>/AsyncRule<TContext> for void outcomes, and TypedRule/TypedAsyncRule when you need a success value (Result<TResult>).
  • Deterministic Evaluation Modes: Choose between collecting all failures (and*) or stopping at the first failure (linear*), and support conditional branching via if*.
  • Context-Aware Errors: Create rules from predicates with fixed or factory-based error providers.

Quick Start

Use the tsentials-rules skill to evaluate an and-composed registration rule for a user context and return all validation errors at once.

Frequently Asked Questions about tsentials-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compose TypeScript validation rules that mix async and sync checks?

To compose TypeScript validation rules mixing sync and async checks, use a rule engine that separates Rule and AsyncRule types, then combine them using and, or, and linear combinators in an async pipeline to aggregate results.

What is the best way to handle business logic validation without tangled conditionals in TypeScript?

Handling business logic validation without tangled conditionals involves expressing rules as small typed predicates and combining them into reliable rule sets, using deterministic evaluation modes like collecting all failures or stopping at the first failure.

Can I get a success value instead of a void result from a TypeScript rule engine?

Yes, you can get a success value instead of a void result by using TypedRule and TypedAsyncRule variants, which return a Result<TResult> containing the success value when evaluating your TypeScript business validation rules.

Does TypeScript rule evaluation support conditional workflow guards?

TypeScript rule evaluation supports conditional workflow guards through if patterns, allowing you to branch rule execution based on context. You can use if combinators alongside and or linear evaluation modes for sync and async pipelines.

How do I return all validation errors at once instead of stopping at the first failure?

To return all validation errors at once instead of stopping at the first failure, use the and composed evaluation mode. This collects all failures across your TypeScript business validation rules and aggregates them using VoidResult semantics.

What is railway oriented programming in TypeScript validation pipelines?

Railway oriented programming in TypeScript validation pipelines is a pattern where rules act as typed predicates that either pass successfully or return specific errors. Combinators route execution through the pipeline, ensuring deterministic failure aggregation.