composable-rust-sagas

Implement distributed sagas in Rust with CQRS/Event Sourcing and compensation.

Updated Nov 5, 2025
One-click install
npx skills add https://github.com/jonathanbelolo/composable-rust --skill composable-rust-sagas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: composable-rust-sagas
Source: https://github.com/jonathanbelolo/composable-rust/tree/main/.claude/skills/composable-rust-sagas
Command: npx skills add https://github.com/jonathanbelolo/composable-rust --skill composable-rust-sagas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides expert guidance for implementing distributed sagas in a Rust-based environment, enabling safe multi-aggregate coordination, compensation flows, and orchestration patterns across services.

Core Features & Use Cases

  • Saga pattern design: Reducer-style state machines that coordinate local transactions across aggregates.
  • Compensation & idempotency: Patterns to rollback or compensate when steps fail, with idempotent handling and retries.
  • Event-bus integration: Techniques for publish/subscribe communication (e.g., Redpanda/Kafka) between services and sagas.
  • Use Case: Orchestrate an Order → Payment → Inventory flow with centralized compensation in case of failures.

Quick Start

Start by outlining your saga state definitions and the events that drive transitions; then implement a reducer that updates state and emits next-step commands via an event bus.

Frequently Asked Questions about composable-rust-sagas

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

FAQPage Schema
How do I coordinate distributed sagas in Rust with reliable compensation?

Distributed sagas in Rust are coordinated using reducer-style state machines that manage local transactions across aggregates, ensuring reliable compensation flows and cross-service workflow orchestration when steps fail.

What is the best way to handle rollback logic in a Rust CQRS and Event Sourcing backend?

Rollback logic in a Rust CQRS backend is handled through saga compensation patterns, which execute reversing operations when steps fail, supported by idempotent handling and retries to maintain data consistency.

How do I publish and subscribe to saga events using Kafka or Redpanda in Rust?

Publish and subscribe semantics for saga events in Rust are achieved through EventBus integrations, enabling services to emit next-step commands and consume transition events via Redpanda or Kafka brokers.

Can I orchestrate an Order, Payment, and Inventory workflow with nested sagas in Rust?

Nested sagas can orchestrate complex workflows like Order, Payment, and Inventory in Rust by applying centralized compensation, timeouts, and idempotency across multiple service boundaries.

When do I need to use orchestration vs choreography patterns for distributed transactions?

Orchestration centralizes saga coordination for clear control over multi-aggregate flows, whereas choreography relies on event-driven reactions; the choice depends on your workflow complexity and visibility requirements.

How do I implement idempotency and timeouts for Rust saga reducers?

Idempotency and timeouts for Rust saga reducers are implemented by applying specific patterns that ensure safe retries and prevent hanging states during cross-service distributed transactions.