at-most-once-publishing

Implements a durable send state machine preventing duplicate outward publishes across crashes and retries.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/joydai2026-del/skills --skill at-most-once-publishing-joydai2026-del
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: at-most-once-publishing
Source: https://github.com/joydai2026-del/skills/tree/main/at-most-once-publishing
Command: npx skills add https://github.com/joydai2026-del/skills --skill at-most-once-publishing-joydai2026-del

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Agents that publish outward (posts, messages, API writes) face an unsolvable ambiguity: when a request times out or the worker crashes, nobody knows whether the bytes landed. Naive retry logic then posts the same thing twice, and a duplicate side effect cannot be undone. This Skill provides a complete design for an at-most-once delivery system where unknown outcomes are reconciled by looking at the platform exactly once, never by blind resending. ## Core Features & Use Cases - Six-state delivery state machine: pending, authorized (in-flight with lease), published, failed (the only retryable state), indeterminate (never retryable), and parked (terminal, human-owned), with strict transition rules. - Separate intent and attempt rows: one durable delivery intent keyed by a stable delivery key, with append-only immutable attempt rows created only by a single begin() path. - Seven safety mechanisms: before-byte durable intent writes, final pre-send authorization, stale-worker fencing with sequence-backed generations, read-back verification, duplicate-text exclusion windows, and append-only audit history. - Idempotency identity rules: four separately named identities (source version, claim, delivery key, attempt token) with precise rules on what goes in each hash, including excluding timestamps and normalizing content before hashing. - Use Case: You are building an agent that auto-posts to social platforms. Use this Skill to design the publishing layer so a crash mid-send results in a reconcilable indeterminate state instead of a duplicate post. ## Quick Start Ask the agent to design or review the publishing layer of your agent using the at-most-once state machine so a crashed or timed-out send never produces a duplicate post.

Frequently Asked Questions about at-most-once-publishing

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

FAQPage Schema
How do I prevent duplicate posts when an API request times out?▼

Treat the unknown outcome as a distinct indeterminate state and reconcile it with exactly one lookup against the platform instead of retrying. Only a definitive not-sent result is retryable; an ambiguous result is never resent automatically.

What is the difference between at-most-once and at-least-once delivery?▼

At-most-once never resends an ambiguous request, accepting that a missing post can be recovered by a human. At-least-once retries on any non-success, which guarantees delivery but can produce duplicates that cannot be undone.

How should I design an idempotency key for publishing?▼

Build the delivery key from account id, action kind, target identity, and the canonical request projection, so zero-text actions like likes do not collide. Keep acquisition timestamps out of the hash and normalize content before hashing.

Why does my retry logic cause duplicate side effects after a crash?▼

A worker that was authorized but never returned may still be mid-flight, so auto-recovering it resends live bytes. Use a durable authorized state with a lease whose expiry moves the row to indeterminate, a state nothing resends from.

Can a lookup prove a request was never sent?▼

Usually not. Most platforms are eventually consistent and lack idempotency-keyed lookups, so a lookup that finds nothing resolves nothing. The row stays indeterminate and is eventually parked for a human rather than treated as not-sent.

When should I disable HTTP client automatic retries?▼

Always, in an at-most-once design. Transport libraries retry idempotent-looking requests below your state machine and invisibly to it, so the client may already have sent twice. Disable it explicitly and assert the behavior in a test.