zagora

Return structured { ok, data, error } results from TypeScript functions.

9|1|Updated Aug 12, 2025
One-click install
npx skills add https://github.com/tunnckoCore/zagora --skill zagora
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: zagora
Source: https://github.com/tunnckoCore/zagora/tree/main/skills/zagora
Command: npx skills add https://github.com/tunnckoCore/zagora --skill zagora

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Zagora provides a runtime validation and structured error handling layer for TypeScript functions, ensuring no exceptions are thrown and results are always typed as { ok, data, error }.

Core Features & Use Cases

  • Full type inference across inputs, outputs, errors, and context for library APIs and SDKs.
  • Never-throw execution with predictable result shapes and typed errors.
  • Support for multiple arguments via schema tuples, environment variables, and per-call overrides; built for libraries and internal tooling.

Quick Start

Install Zagora, define a procedure with an input schema and a handler, then call .callable() to obtain a ZagoraResult.

Frequently Asked Questions about zagora

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

FAQPage Schema
How do I handle runtime validation errors in TypeScript without throwing exceptions?

You can handle runtime validation errors without throwing by using a never-throwing pattern that returns a structured { ok, data, error } result. This provides predictable, type-safe error handling for TypeScript functions instead of relying on exceptions.

What is a never-throwing TypeScript function and when do I need it?

A never-throwing TypeScript function is a function that returns a structured result object instead of throwing exceptions. You need it when building library APIs or SDKs to ensure predictable execution, full type inference for errors, and consistent result shapes across sync or async calls.

How do I add type-safe input and output validation to a TypeScript SDK?

Add type-safe validation by defining a procedure with an input schema and a handler, then calling .callable(). This provides full type inference across inputs, outputs, errors, and context for TypeScript SDKs without throwing exceptions.

Can I use environment variables and context for runtime validation in TypeScript libraries?

Yes, TypeScript runtime validation can cover environment variables and context alongside inputs and outputs. It supports per-call overrides for sync or async library usage while maintaining full type inference and a never-throwing result shape.

Does TypeScript type inference work with structured error handling for async functions?

Yes, TypeScript type inference fully supports structured error handling for async functions. It provides complete type safety across inputs, outputs, errors, and context, returning a typed { ok, data, error } result instead of throwing exceptions during async library execution.