/harness-claude:events-saga-choreographyfrom harness-claude
Coordinates distributed workflows through event chains and compensation events without an orchestrator. Useful for multi-step business transactions across services.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /harness-claude:events-saga-choreography still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Coordinate distributed workflows through event chains and compensation events without an orchestrator.
Order fulfillment saga (choreography):
ORDER CREATED
→ Payment Service: charge card
→ PAYMENT_PROCESSED
→ Inventory Service: reserve stock
→ INVENTORY_RESERVED
→ Shipping Service: create shipment
→ SHIPMENT_CREATED → done
On failure at any step → emit compensation event → previous steps compensate:
PAYMENT_FAILED → saga ends (nothing to compensate)
INVENTORY_FAILED → emit PAYMENT_REFUND_REQUESTED → Payment Service refunds
SHIPPING_FAILED → emit INVENTORY_RELEASE_REQUESTED + PAYMENT_REFUND_REQUESTED
Order service — publishes the saga trigger:
// 1. Create order and publish triggering event
async function createOrder(data: CreateOrderInput): Promise<Order> {
return prisma.$transaction(async (tx) => {
const order = await tx.order.create({
data: { ...data, status: 'AWAITING_PAYMENT' },
});
await tx.outbox.create({
data: {
eventType: 'order.created',
aggregateId: order.id,
payload: {
eventId: crypto.randomUUID(),
orderId: order.id,
userId: order.userId,
amount: order.total,
items: order.items,
},
},
});
return order;
});
}
// Listen for saga completion/failure events
consumer.on('order.saga.completed', async ({ orderId }) => {
await db.order.update({ where: { id: orderId }, data: { status: 'CONFIRMED' } });
});
consumer.on('order.saga.failed', async ({ orderId, reason }) => {
await db.order.update({
where: { id: orderId },
data: { status: 'FAILED', failureReason: reason },
});
});
Payment service — listens and reacts:
consumer.on('order.created', async (event) => {
const { orderId, userId, amount } = event;
try {
const charge = await stripe.charges.create({
amount: Math.round(amount * 100),
currency: 'usd',
customer: await getStripeCustomerId(userId),
});
// Success → publish next saga event
await publish('payment.processed', {
eventId: crypto.randomUUID(),
orderId,
chargeId: charge.id,
amount,
});
} catch (err) {
// Failure → publish compensation event
await publish('payment.failed', {
eventId: crypto.randomUUID(),
orderId,
reason: (err as Error).message,
});
}
});
// Compensation — triggered by downstream failure
consumer.on('payment.refund.requested', async ({ orderId, chargeId }) => {
await stripe.refunds.create({ charge: chargeId });
await publish('payment.refunded', { eventId: crypto.randomUUID(), orderId, chargeId });
});
Inventory service:
consumer.on('payment.processed', async ({ orderId, chargeId, items }) => {
try {
await reserveInventory(items);
await publish('inventory.reserved', { eventId: crypto.randomUUID(), orderId, chargeId });
} catch (err) {
// Cannot reserve → trigger payment compensation
await publish('inventory.reservation.failed', {
eventId: crypto.randomUUID(),
orderId,
chargeId,
reason: (err as Error).message,
});
// Payment service listens to this and refunds
}
});
consumer.on('inventory.release.requested', async ({ orderId, items }) => {
await releaseInventory(items);
await publish('inventory.released', { eventId: crypto.randomUUID(), orderId });
});
Choreography vs. Orchestration:
| Choreography | Orchestration | |
|---|---|---|
| Control | Distributed (each service reacts) | Centralized (saga orchestrator commands) |
| Coupling | Low — services share events | Higher — orchestrator knows all steps |
| Visibility | Hard — no single view of progress | Easy — orchestrator tracks state |
| Complexity | Simple flows | Complex flows, conditional branches |
Idempotency is mandatory: Each saga step must be idempotent — events can be redelivered. Use event IDs and the processed_events table (see events-idempotency skill).
Anti-patterns:
Observability challenge: With pure choreography, no single place shows the full saga state. Solutions:
sagaId across all events)sagaId field for log aggregation queriesmicroservices.io/patterns/data/saga.html
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeRead when SKILL.md points to them.
793 skills in this plugin
/a11y-aria-patternsARIA Patterns> Apply ARIA roles, states, and properties correctly to enhance assistive technology support for custom widgets/a11y-color-contrastColor Contrast and Color Independence> Ensure sufficient color contrast ratios and never use color as the sole means of conveying information/a11y-form-patternsAccessible Form Patterns> Build accessible forms with proper labeling, grouped controls, inline validation, and clear error communicationOther plugins' skills for the same job