data-flow

Enforce a four-stage API pipeline with typed error handling.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/murphyjoseph/dojo-kit --skill data-flow-murphyjoseph
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-flow
Source: https://github.com/murphyjoseph/dojo-kit/tree/main/skills/data-flow
Command: npx skills add https://github.com/murphyjoseph/dojo-kit --skill data-flow-murphyjoseph

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Error handling and API integration can become brittle as systems scale. This skill provides a principled approach to structuring failing operations, API responses, and data flow with explicit Result patterns and a four-stage pipeline.

Core Features & Use Cases

  • Four-stage API pipeline: Define, Unpack, Factory, Consume, plus a gateway abstraction for transport and a centralized error model.
  • Typed errors and discriminated responses: ensures explicit handling of success, validation, and network errors.
  • Reusable patterns across REST/GraphQL endpoints and UI layers, with guidance for testing and composition.

Quick Start

Implement the API pipeline for a new feature by introducing the four stages and wiring them to a gateway.

Frequently Asked Questions about data-flow

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

FAQPage Schema
What is a structured pipeline for API error handling in TypeScript?

A structured API error handling pipeline uses a four-stage process: Define, Unpack, Factory, and Consume. It enforces typed errors and discriminated responses to ensure explicit handling of success, validation, and network failures across frontend and backend layers.

How do I structure failing API responses and data flow in TypeScript?

You structure failing API responses by applying a Define → Unpack → Factory → Consume pipeline. This pattern uses a gateway to abstract transport, explicit error types for known variants, and a centralized catch-all Unpack for unknown failures.

Can I use this API pipeline pattern for both REST and GraphQL endpoints?

Yes, the four-stage pipeline is reusable across both REST and GraphQL endpoints. It provides a centralized error model and gateway abstraction that standardizes data flow and error handling regardless of the underlying transport protocol.

What is the best way to handle unknown API error variants in a data flow pipeline?

The best way to handle unknown API error variants is through a catch-all Unpack stage. This stage sits within the Define → Unpack → Factory → Consume pipeline to ensure unanticipated failure modes are explicitly processed rather than crashing the application.

Why does my TypeScript API integration break when handling network and validation errors?

TypeScript API integration breaks without explicit Result patterns because errors lack structured typing. Implementing a factory stage with typed errors and discriminated responses enforces explicit handling of validation and network failures before data reaches the consumer.

Does the data-flow pipeline require specific transport libraries to abstract API calls?

No, the pipeline uses a gateway abstraction to decouple transport from data flow. This means you can wire the Define, Unpack, Factory, and Consume stages to any transport layer without hard dependencies on specific API client libraries.