outbound-side-effect-idempotency
/outbound-side-effect-idempotency
Code that performs an external side effect (email, SMS, payment, webhook) and then records its status must choose which failure harms the recipient less — lost or duplicated — and design for that. A read-then-write "already sent?" check is not a lock. Triggers when writing any send-then-record path or adding retry logic around an external send. Does not fire on internal batch retry loops with no external recipient — lock-at-the-chokepoint owns those.
- Author
- randommonicle ↗
- Repository
- claude-skills ↗
- Licence
- Apache-2.0
- Last repository change
- 25.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
Code that performs an external side effect (email, SMS, payment, webhook) and then records its status must choose which failure harms the recipient less — lost or duplicated — and design for that. A read-then-write "already sent?" check is not a lock. Triggers when writing any send-then-record path or adding retry logic around an external send. Does not fire on internal batch retry loops with no external recipient — lock-at-the-chokepoint owns those.
Triggers from the description
Original author description
Code that performs an external side effect (email, SMS, payment, webhook) and then records its status must choose which failure harms the recipient less — lost or duplicated — and design for that. A read-then-write "already sent?" check is not a lock. Triggers when writing any send-then-record path or adding retry logic around an external send. Does not fire on internal batch retry loops with no external recipient — lock-at-the-chokepoint owns those.
How it works
- The rules
- What this skill does not do
- Why
SKILL.md preview
--- name: outbound-side-effect-idempotency description: Code that performs an external side effect (email, SMS, payment, webhook) and then records its status must choose which failure harms the recipient less — lost or duplicated — and design for that. A read-then-write "already sent?" check is not a lock. Triggers when writing any send-then-record path or adding retry logic around an external send. Does not fire on internal batch retry loops with no external recipient — lock-at-the-chokepoint owns those. --- # Outbound side-effect idempotency The genuine distributed-systems tradeoff hiding in every send-then-record path: "never lose it" and "never duplicate it" cannot both be absolute. A review-request sender kept fail-closed semantics (mark sent only after the provider accepted) and then had to confront the race that design leaves open: two concurrent passes both reading "not sent", both sending. ## The rules - **Decide which failure harms the recipient less, and design for that.** A lost password reset is worse than a duplicate; a duplicate payment is worse than a retried one. The choice is per-path, explicit, and recorded. - **Fail-closed for never-lose-it**: mark sent only after the provider's 2xx. A pre-marked "sent" that then fails to send is a silent loss with a clean audit trail — the worst combination. - **A read-then-write pre-check is not a lock.** "Is it already sent? No → send" protects sequential retries only; concurrent callers both pass. True at-most-once needs an atomic claim: a `sending` state transition the row passes through, or a unique constraint the second sender violates. - **When both properties matter and the claim state is deferred, make the residual case detectable**: a conditional mark that records the race happened is the honest interim — you cannot yet prevent the double-send, but you will know about it instead of finding out from the recipient. ## What this skill does not do It does not govern internal retry loops with no external recipient (lock-at-the-chokepoint) and does not verify delivery (email-delivery-verification). It chooses and implements the failure semantics of the send itself. ## Why Every send-then-record path embodies this tradeoff whether or not its author noticed; the unexamined default is usually at-least-once with a silent-loss edge, which is the wrong choice for most recipient-facing sends. Evidence: ICC LESSONS_LEARNED L-021 and the reviewRequest fail-closed pattern; the same check-then-act race on an internal path in ASH LESSONS_LEARNED 2026-06-04 (shared evidence with lock-at-the-chokepoint).
Versions
The database has no other skills named outbound-side-effect-idempotency.
Database snapshot: 13.11.2026 · package version 6a43e29b6fa5 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90lock-at-the-chokepoint
Serialise shared operations at the single module-level chokepoint every caller passes through, never in per-instance state — and cap fan-out there too. A check-then-act idempotency guard protects sequential retries but loses the race under concurrency. Triggers when adding a… - 90email-delivery-verification
A 2xx from a transactional email API means accepted, not delivered. Verify actual delivery in the provider's dashboard or webhooks, check the account-level suppression list, verify every recipient leg of a multi-recipient flow, and confirm a mailbox exists before pointing a send… - 90idempotency-and-retries
Use when a ticket makes an operation safe to repeat or adds retries — payment or order creation that must not double-charge, a webhook handler that receives duplicates, a client retry policy, an outbound call to a flaky dependency — and the design must guarantee exactly-once… - 100idempotency-annotation
Mark which tools change state so a retry after a timeout cannot duplicate an action. Use when a tool writes to disk, sends a request or mutates a remote record - 90idempotency-and-retries
Make an operation safe to repeat — idempotency keys and their storage, what a replay returns, retry policy with backoff and jitter, and how to reconcile after a timeout whose outcome is unknown. Use when an operation has an external side effect (a charge, an email, a… - 100webhook-handling
Use when code receives callbacks from a payment processor, bank, PSP or any provider that reports money events. Covers signature verification on the raw body with timestamp tolerance, treating the payload as a notification and confirming state by API before acting, dedupe by…