Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add resonatehq/resonate-skills --skill resonate-saga-pattern-rustgit clone --depth 1 https://github.com/resonatehq/resonate-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-saga-pattern-rust)<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-saga-pattern-rust"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-saga-pattern-rust/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-saga-pattern-rust"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-saga-pattern-rust.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00074 | $0.01463 |
| Opus 5 | $0.00037 | $0.00732 |
| Sonnet 5 | $0.00015 | $0.00293 |
| Haiku 4.5 | $0.00007 | $0.00146 |
Grade A, and why
resonate-saga-pattern-rust scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Resonate Saga Pattern — Rust
SDK note (0.6.0). The Rust SDK is in active development. The saga pattern below uses only documented surface (
ctx.run,Result<T>,?propagation). Verify against the current SDK source before shipping.
Overview
A saga is a long-running transaction split into smaller steps, each with a compensating action. Forward steps run top-to-bottom; on failure, compensations run bottom-to-top. Rust expresses this naturally via Result<T> + ? for forward propagation and a tracked "completed" list for compensation dispatch.
For the language-agnostic mental model, see resonate-saga-pattern-typescript.
When to use
- Multi-step workflow where intermediate state is visible to other systems
- Each step is idempotent or inexpensive to retry individually
- Compensation logic exists for every committed step
- You need "all or nothing" consistency without a distributed transaction
Basic shape
use resonate::prelude::*;
use serde::{Serialize, Deserialize};
#[derive(Clone, Serialize, Deserialize)]
enum Step { Inventory, Payment, Shipment }
#[derive(Clone, Serialize, Deserialize)]
struct SagaResult {
status: String,
order_id: String,
compensated: Vec<String>,
}
#[resonate::function]
async fn place_order(ctx: &Context, order_id: String) -> Result<SagaResult> {
let mut completed: Vec<Step> = Vec::new();
// attempt the forward path
let result = try_forward(ctx, &order_id, &mut completed).await;
match result {
Ok(()) => Ok(SagaResult {
status: "success".into(),
order_id,
compensated: vec![],
}),
Err(_err) => {
// compensate in reverse order
let mut comp_names = Vec::new();
for step in completed.iter().rev() {
ctx.run(compensate, (step.clone(), order_id.clone()))
.await?;
comp_names.push(format!("{:?}", step));
}
Ok(SagaResult {
status: "failed".into(),
order_id,
compensated: comp_names,
})
}
}
}
async fn try_forward(
ctx: &Context,
order_id: &str,
completed: &mut Vec<Step>,
) -> Result<()> {
ctx.run(reserve_inventory, order_id.to_string()).await?;
completed.push(Step::Inventory);
ctx.run(charge_payment, order_id.to_string()).await?;
completed.push(Step::Payment);
ctx.run(create_shipment, order_id.to_string()).await?;
completed.push(Step::Shipment);
Ok(())
}
#[resonate::function]
async fn compensate((step, order_id): (Step, String)) -> Result<()> {
match step {
Step::Shipment => { /* cancel_shipment(&order_id) */ Ok(()) }
Step::Payment => { /* refund_payment(&order_id) */ Ok(()) }
Step::Inventory => { /* release_inventory(&order_id) */ Ok(()) }
}
}
#[resonate::function]
async fn reserve_inventory(order_id: String) -> Result<()> { Ok(()) }
#[resonate::function]
async fn charge_payment(order_id: String) -> Result<()> { Ok(()) }
#[resonate::function]
async fn create_shipment(order_id: String) -> Result<()> { Ok(()) }
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 167 lines · 74 tokens per session scan A 233decae57e6
resonate-saga-pattern-rust is a skill published in the GitHub repository resonatehq/resonate-skills (6 stars, last pushed 20d ago), licensed Apache-2.0. It adds 74 tokens to every session and 1,463 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
golem-make-http-request-rust
Making outgoing HTTP requests from a Rust Golem agent. Use when the user asks to call an external API, make HTTP requests, use an HTTP client, or send HTTP requests from agent code.
golem-add-http-endpoint-rust
Exposing a Rust Golem agent over HTTP. Use when the user asks to add HTTP endpoints, mount an agent to a URL path, or expose agent methods as a REST API.
golem-add-webhook-rust
Using webhooks in a Rust Golem agent. Use when the user asks to create webhooks, receive webhook callbacks, integrate with webhook-driven external APIs, or generate temporary callback URLs for external services.
golem-add-transactions-rust
Adding saga-pattern transactions with compensation to a Rust Golem agent. Use when the user asks about transactions, sagas, compensation, rollback, or multi-step operations that need undo logic.
azure-eventhub-rust
Azure Event Hubs library for Rust. Send and receive events for streaming data ingestion and batch processing. Triggers: "event hubs rust", "ProducerClient rust", "ConsumerClient rust", "send event rust", "streaming rust", "eventhub rust".
rust-engineer
Writes, reviews, and debugs idiomatic Rust code with memory safety and zero-cost abstractions. Implements ownership patterns, manages lifetimes, designs trait hierarchies, builds async applications with tokio, and structures error handling with Result/Option. Use when building Rust applications, solving ownership or…