Unordered Events logo

Unordered Events

Community
randommonicle
unordered-events

Webhooks, queues and retries do not arrive in the order the work happened, and a guard written for the state a handler expects lets the neighbouring states through. Write each handler's state machine down, guard every status write with the set of states it may move FROM, test every (event, current state) pair including each event arriving before the one it logically follows, and answer an event whose prerequisite has not landed retryably instead of acknowledging it. Triggers when writing or reviewing a webhook handler (Stripe, payment, email, calendar), a queue consumer, an event-sourced status column, or any handler that moves a row's status on an external signal. Does not fire on in-process calls made in a known order, or on the send-then-record half of an outbound call (outbound-side-effect-idempotency owns that).

Overview

Publisherrandommonicle
Repositoryclaude-skills
Skill nameunordered-events
Stars
27
Forks
3
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by randommonicle on GitHub. Read the source before you install it.

Installation

Install the Unordered Events AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/randommonicle/claude-skills/tree/main/unordered-events
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/randommonicle/claude-skills.git /tmp/claude-skills
mkdir -p .claude/skills
cp -r /tmp/claude-skills/unordered-events .claude/skills/unordered-events
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Unordered Events in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Unordered Events on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Unordered Events is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Unordered events

A provider that delivers at least once and in no promised order (Stripe says so of its webhooks) will, given enough traffic, deliver the refund before the payment, the finalised invoice after the paid one, and the dispute before the deposit's own paid event. Each handler then reads a row in a state its author never pictured, and either writes over a later state or acknowledges an event it could not apply, which the provider never sends again.

The rules

  1. Write the state machine down beside the handler: the row's states, which event moves which state to which. A handler whose machine is not written cannot be reviewed.
  2. Guard the FROM set, not the expected state. A status write is a compare-and-set naming every state it may move from (... where status in ('draft', 'open')), never only the one the author expected; a neighbouring state slipping through is the common defect.
  3. Test the pairs. For each event, a test per current state, including the states a later event would have produced and the state before the event's own prerequisite. A test of the happy order alone proves nothing about the unordered one.
  4. A missing prerequisite is retryable. When an event names something that has not landed yet (the payment it disputes, the invoice it pays), answer the provider with a retryable status (5xx) so it re-delivers, or look the link up from the provider's own record before acknowledging. A 200 for an event that changed nothing is final: the provider will not try again.
  5. Stamp from the event, not the clock. A time written from a re-delivered event takes the event's own creation time, so a late delivery lands in the period the money moved.
  6. One writer per field, or an ordering rule. A field that two event types write needs a rule for which wins (a later state never moved back by an earlier event).

Provenance

ICC L-059 (a compare-and-set on one row does not serialise a write to another), L-062 (Stripe does not order webhook deliveries), L-065 (a guard for one status let the neighbouring status through), L-082 (an event guarded to move drafts only was overtaken by an event for a later state), and GPT's review R11 of 22 October 2026 (a card dispute delivered before its deposit's paid event was acknowledged without the photo hold it should have placed). docs/SKILL_PROPOSALS_2026-10-22.md, Tier 1 item 2.

Frequently asked questions

What does the Unordered Events AI skill do?

Webhooks, queues and retries do not arrive in the order the work happened, and a guard written for the state a handler expects lets the neighbouring states through. Write each handler's state machine down, guard every status write with the set of states it may move FROM, test every (event, current state) pair including each event arriving before the one it logically follows, and answer an event whose prerequisite has not landed retryably instead of acknowledging it. Triggers when writing or reviewing a webhook handler (Stripe, payment, email, calendar), a queue consumer, an event-sourced st...

Why use Unordered Events on TypingMind?

Because you install it once and use it with any model. Unordered Events is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Unordered Events in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/randommonicle/claude-skills/tree/main/unordered-events. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Unordered Events?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Unordered Events?

As many as you like. As long as a model supports skills, you can use Unordered Events with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Unordered Events AI skill free?

Yes. It is published on GitHub by randommonicle under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇