ring:using-outbox

ring:using-outbox is a skill for Claude Code, Codex from LerianStudio/ring. It costs 98 tokens per session (6,045 once invoked), scanned A, original, Apache-2.0.

A guide to the transactional outbox pattern, which stores a database change and the event announcing it together before a separate process sends the event.

In plain words
What is it for?
Use it to find unreliable event publishing, connect database transactions to an outbox, and build or review the relay that sends stored events.
Why use it?
It prevents the database from recording a change while the matching message is lost or sent incorrectly.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Install

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.

agentmods
npx agentmods add skills/lerianstudio/ring/using-outbox
Any agent
npx skills add LerianStudio/ring --skill using-outbox
Clone the repo
git clone --depth 1 https://github.com/LerianStudio/ring

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for ring:using-outbox

README.md
[![agentmods](https://agentmods.dev/badge/skills/lerianstudio/ring/using-outbox.svg)](https://agentmods.dev/skills/lerianstudio/ring/using-outbox)
Your own site
<a href="https://agentmods.dev/skills/lerianstudio/ring/using-outbox"><img src="https://agentmods.dev/badge/skills/lerianstudio/ring/using-outbox.svg" alt="Measured on agentmods" height="20"></a>
Per session 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,045 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00098 $0.06045
Opus 5 $0.00049 $0.03023
Sonnet 5 $0.00020 $0.01209
Haiku 4.5 $0.00010 $0.00605

Measured 3d ago against content hash 2d7146e1595c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

ring:using-outbox 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 3d 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.

dev-team/skills/using-outbox/SKILL.md · 443 lines

How it starts

The opening of the file, as written. The whole thing — 443 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ring:using-outbox

When to use

Sweep mode:

  • "Sweep for transactional outbox violations"
  • "Find send-and-pray emits"
  • "Are we wrapping DB transactions with WithOutboxTx?"
  • "Migrate this service from DIY outbox to lib-streaming + lib-commons/outbox"
  • "Audit relay loops for hand-rolled poller patterns"

Reference mode:

  • "How does the transactional outbox pattern work?"
  • "Which writer interface do I implement for X?"
  • "What goes in OutboxEnvelope?"
  • "How do I wire the relay loop?"
  • "How does WithOutboxTx interact with MongoDB sessions?"

Skip when

  • Working on non-Go services
  • Service has no events to emit (pure read-side, BFF)
  • Working on frontend code

Parent surface: ring:using-lib-streaming (full streaming bus) Repository side: ring:using-lib-commons (lib-commons/outbox dispatcher, repository, handler registry) Adjacent: ring:instrumenting-streaming-events (eventable-point identification → emit wiring), ring:using-runtime (panic-safe relay loops), ring:using-assert (invariant checks on envelope decode)


The Pattern

The transactional outbox solves one operational invariant: business state and the event that announces it must commit atomically, or not at all. Without it, three failure modes are inevitable in production:

  1. Lost event. Business state commits, the producer calls broker.Emit, the broker is down or the network blips — the event vanishes. The ledger now believes a transaction happened that no downstream consumer ever heard about.
  2. Phantom event. Producer emits successfully, then the DB commit fails. Downstream consumers now act on a transaction that never happened.
  3. Send-and-pray. Code paths that emit on a best-effort basis "and we'll log it if it fails" — a polite name for systematic data loss under sustained broker outages.

The outbox pattern fixes this by writing the event to an outbox table inside the same database transaction as the business state. Commit is atomic: either both rows persist or neither does. A separate process — the relay (also called dispatcher or poller) — reads pending outbox rows and publishes them to the broker, marking each row PUBLISHED on success. Delivery becomes at-least-once: if the relay crashes between publish and mark, the row stays pending and the next cycle retries. Consumers must be idempotent — that is the cost of at-least-once.

Read the full file on GitHub · 443 lines

Changes

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.

  1. 3d ago First seen · 443 lines · 98 tokens per session scan A 2d7146e1595c

Subscribe to this mod's changes

ring:using-outbox is a skill published in the GitHub repository LerianStudio/ring (211 stars, last pushed 17d ago), licensed Apache-2.0. It adds 98 tokens to every session and 6,045 once invoked, about $0.0005 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-09-03.