shadow-concurrency
Skill1 starsChanged yesterdayMITView on GitHub
Asynchronous & Distributed Workflow Correctness. Use when designing or fixing message queues, retries, transactional outbox/inbox, idempotency keys, optimistic/pessimistic locks, DLQ poison messages, or crash-before-ack recovery. Do NOT use for third-party API HTTP client setup (shadow-integrate), WebSocket/SSE client reconnect UX (shadow-realtime), or standalone SQL schema design (shadow-data/shadow-db).
In this repository51 other files it gives its agents.
- antislop-codeSkill
- antislop-copywritingSkill
- antislop-humanSkill
- antislop-layoutmobileSkill
- antislopSkill
- antislop-uiSkill
- context7Skill
- handoffSkill
- shadow-accessibilitySkill
- shadow-apiSkill
- shadow-architectSkill
- shadow-authSkill
- shadow-bootstrapSkill
- shadow-browserSkill
- shadow-cacheSkill
- shadow-compatSkill
- shadow-dataSkill
- shadow-dbSkill
- shadow-debugSkill
- shadow-designSkill
- shadow-discoverySkill
- shadow-docSkill
- shadow-domainSkill
- shadow-eaSkill
- shadow-evalSkill
- shadow-finopsSkill
- shadow-gitSkill
- shadow-grcSkill
- shadow-handoverSkill
- shadow-integrateSkill
- shadow-maintainSkill
- shadow-mobileSkill
- shadow-modernizeSkill
- shadow-monarchSkill
- shadow-observeSkill
- shadow-opsSkill
- shadow-perfSkill
- shadow-planSkill
- shadow-pmoSkill
- shadow-presalesSkill
- shadow-privacySkill
- shadow-qualitySkill
- shadow-realtimeSkill
- shadow-refactorSkill
- shadow-releaseSkill
- shadow-resilienceSkill
- shadow-searchSkill
- shadow-secSkill
- shadow-supplychainSkill
- shadow-testSkill
- shadow-uatSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Durable State Before Ack: Never acknowledge a queue job or commit an external trigger before persisting durable DB state / Transactional …
- Very specific: line 16
Read methodologies/DURABLE-ASYNC-OUTBOX-AND-IDEMPOTENCY.md and playbooks/STATE-MACHINE-AND-FAILURE-MATRIX.md:
- Distinctive: line 20
Atomic Persistence & Outbox: Write domain mutation + outbox/inbox row in the same ACID DB transaction.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/shadow-concurrency — Asynchronous & Distributed Workflow Correctness
- Owner: Consistency, ordering, locking, idempotency, retry budgets, DLQ, and crash-safe asynchronous execution.
- Boundaries: HTTP/HMAC provider adapters (
shadow-integrate), WebSocket/SSE connection resume (shadow-realtime), SQL migration scripts (shadow-data/shadow-db).
1. Preconditions, Non-Claims & Safety Rules
- No False Exactly-Once Claims: External side effects (SMTP email, payment webhook, third-party API) cannot be guaranteed "exactly-once" without receiver idempotency or two-phase protocols; design for at-least-once delivery + idempotent deduplication.
- Durable State Before Ack: Never acknowledge a queue job or commit an external trigger before persisting durable DB state / Transactional Outbox row (
commit -> outbox -> dispatch -> ack).
2. 8-Step Concurrency & Durability Playbook
Read methodologies/DURABLE-ASYNC-OUTBOX-AND-IDEMPOTENCY.md and playbooks/STATE-MACHINE-AND-FAILURE-MATRIX.md:
- Map State Transitions & Failure Boundaries: Identify DB commit vs queue ack vs external API boundaries.
- Select Delivery & Consistency Semantics: At-least-once + idempotency key vs at-most-once; choose CAS / optimistic version (
version = version + 1) vs pessimistic row lock (SELECT ... FOR UPDATE SKIP LOCKED). - Write Invariants: Single logical side effect per
idempotency_key; monotonic state transitions; bounded retry attempts. - Atomic Persistence & Outbox: Write domain mutation + outbox/inbox row in the same ACID DB transaction.
- Retry-Safe Dispatch, Backoff & Poison DLQ: Bounded exponential backoff + jitter; route poison messages past
max_attemptsto Dead-Letter Queue (DLQ) with replay runbook. - Failure Injection & Replay Verification: Simulate DB-commit-succeeds/ack-fails, double-claim by 2 workers, out-of-order events, and downstream outage.
- Verify Backpressure & Queue Retention: Enforce queue bounds, worker concurrency caps, and DLQ alert thresholds.
- Emit Contract & Runbook: Output state machine, failure matrix, delivery guarantee statement, and replay recovery steps.
3. Examples & Deterministic Checker
- Happy Path: Worker claims job with
UPDATE ... WHERE status='PENDING' RETURNING *, checksinbox_dedup(idempotency_key)before SMTP send, retries on 503, routes to DLQ after 5 fails. - Adversarial / Must-Reject: Handler sends email and deletes/acks job without durable outbox or claims "guaranteed exactly-once external email" -> BLOCKED by
concurrency_invariant_checker.py.
python "shadow-concurrency/scripts/concurrency_invariant_checker.py" --self-test
python "shadow-concurrency/scripts/concurrency_invariant_checker.py" --verify-workflow path/to/workflow.jsonDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

