Back to Skills

saga-patterns

verified

Distributed transaction patterns using orchestration and choreography

View on GitHub

Marketplace

melodic-software

melodic-software/claude-code-plugins

Plugin

event-modeling

Repository
Verified Org

melodic-software/claude-code-plugins
13stars

plugins/event-modeling/skills/saga-patterns/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/melodic-software/claude-code-plugins/blob/main/plugins/event-modeling/skills/saga-patterns/SKILL.md -a claude-code --skill saga-patterns

Installation paths:

Claude
.claude/skills/saga-patterns/
Powered by add-skill CLI

Instructions

# Saga Patterns Skill

## When to Use This Skill

Use this skill when:

- **Saga Patterns tasks** - Working on distributed transaction patterns using orchestration and choreography
- **Planning or design** - Need guidance on Saga Patterns approaches
- **Best practices** - Want to follow established patterns and standards

## Overview

Design distributed transaction patterns using orchestration and choreography for microservices.

## MANDATORY: Documentation-First Approach

Before designing sagas:

1. **Invoke `docs-management` skill** for saga patterns
2. **Verify patterns** via MCP servers (perplexity, context7)
3. **Base guidance on established microservices patterns**

## Saga Fundamentals

```text
Why Sagas?

PROBLEM:
Distributed transactions across services are complex.
Traditional 2PC (Two-Phase Commit) doesn't scale.

SOLUTION:
Saga = Sequence of local transactions
Each step has a compensating action
Eventual consistency instead of ACID

┌─────────┐    ┌─────────┐    ┌─────────┐
│ Step 1  │───►│ Step 2  │───►│ Step 3  │
│ Tx + Cx │    │ Tx + Cx │    │ Tx + Cx │
└─────────┘    └─────────┘    └─────────┘
     │              │              │
     ▼              ▼              ▼
   Local         Local          Local
 Transaction  Transaction    Transaction

Tx = Forward Transaction
Cx = Compensating Transaction
```

## Saga Coordination Styles

### Choreography (Event-Driven)

```text
Choreography Pattern:

Services communicate through events.
No central coordinator.
Each service knows what to do next.

┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│   Order     │    │  Payment    │    │  Inventory  │
│   Service   │    │  Service    │    │  Service    │
└──────┬──────┘    └──────┬──────┘    └──────┬──────┘
       │                  │                  │
       │ OrderCreated     │                  │
       │─────────────────►│                  │
       │                  │ PaymentProcessed │
       │                  │─────────────────►│
       │         

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
10969 chars