bunqueue / sdk
CLAUDE.md569 starsChanged 4 months agoMITView on GitHub
This directory contains every official bunqueue client and the machinery that keeps them honest. Language-specific rules live in each SDK's own CLAUDE.md; the rules here apply to ALL of them and to any new language. 1. docs/protocol.md is the wire contract. Before writing or changing ANY SDK — and especially before starting a new language — read it end to end. Every field name, response shape, clamp, and semantic rule an SDK implements MUST come from that spec (which in…
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- bunqueue-devSkill
- bunqueueSkill
The file
We split this CLAUDE.md into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 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.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
docs/protocol.mdis the wire contract: Before writing or changing ANY SDK — and especially before starting a new language — read it end … - Very specific: line 37
Read docs/protocol.md in full.
- Very specific: line 52
Every public method needs an e2e test against a real spawned server, in the SDK's own suite (mirror php/tests/ if starting fresh).
- Very specific: line 54
Write the conformance driver (100-200 lines, references in conformance/drivers/) and iterate until 18/18.
- Distinctive: line 64
No silently dropped options: If an SDK's public API accepts an option, it MUST reach the wire (with the exact spec name) or the API must …
- Very specific: line 76
Every official SDK keeps bounded race/idempotency, generated-property, malformed-input fuzz, crash/reconnect, and spike coverage in its …
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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
bunqueue SDKs — umbrella development guide
This directory contains every official bunqueue client and the machinery
that keeps them honest. Language-specific rules live in each SDK's own
CLAUDE.md; the rules here apply to ALL of them and to any new language.
sdk/
├── typescript/ bunqueue-client (npm) — Node, Bun, Deno, Cloudflare Workers
├── python/ bunqueue-client (PyPI) — sync + threads
├── php/ bunqueue/client (Composer) — sync + sequential worker
├── go/ github.com/egeominotti/bunqueue/sdk/go — goroutine worker
├── rust/ bunqueue-client — bounded threaded worker + rustls
├── elixir/ bunqueue_client — BEAM processes + OTP TCP/SSL
└── conformance/ the conformance suite: runner + one driver per SDKThe two sources of truth (non-negotiable)
docs/protocol.mdis the wire contract. Before writing or changing ANY SDK — and especially before starting a new language — read it end to end. Every field name, response shape, clamp, and semantic rule an SDK implements MUST come from that spec (which in turn defers tosrc/domain/types/command.tsand the server handlers). Never guess a field from another SDK's code without checking the spec: bugs replicate that way. If you discover wire behavior the spec does not cover, the fix is a spec PR in the same change-set — the spec never lags the code.sdk/conformance/is the certification gate. An SDK is not done, and a change to an SDK is not shippable, until its driver passes the suite:cd sdk/conformance && bun runner.ts --driver "<cmd>"→VERDICT: CONFORMANT. All official drivers must stay green; a new language becomes "official" by adding a driver and passing, nothing else.
Writing an SDK for a new language — the checklist
- Read
docs/protocol.mdin full. Twice. The int64 rule (§4), the name-inside-data contract (§5), the response wrapping table (§6.8) and the worker semantics (§6.3) are where every past client bug lived. - Copy the structure of the closest existing SDK:
python/for sync runtimes,typescript//go/for concurrent ones,php/for request-scoped runtimes. One concern per file, ≤300 lines per file, single msgpack runtime dependency. - Implement the
jsSafeguard FIRST (ints outside int32 → float64, applied recursively to every outgoing frame) and configure the msgpack library for smallest-form integers and ext-0 tolerance (§1, §4). This is not optional and it is not removable. - Mirror the reference clamps at the SDK surface:
batchSize → [1, 1000], poll timeout ≤ 30000,waitForJob → [0, 600000], heartbeat interval<= 0(or non-finite) = disabled. Clamp with finite-guards in languages where NaN exists. - Every public method needs an e2e test against a real spawned server, in
the SDK's own suite (mirror
php/tests/if starting fresh). - Write the conformance driver (100-200 lines, references in
conformance/drivers/) and iterate until 18/18. - Docs: SDK README with the standard header (logo, badges, link row),
SDK-local
CLAUDE.md, a section indocs/src/content/docs/guide/sdks.mdx.
Cross-SDK rules
- Core is untouchable. SDK work never modifies
src/— if the server looks wrong, verify against the spec and file/fix it as a separate core change with its own tests. - No silently dropped options. If an SDK's public API accepts an option, it MUST reach the wire (with the exact spec name) or the API must reject it loudly. The "client drops a wire-supported field" class (#111) is the most common SDK bug; the conformance suite checks the known cases.
- Parity by contract, not by copying. SDKs may diverge in idiom (concurrency model, naming case) but never in wire behavior. When one SDK fixes a wire bug, check the same site in every other SDK in the same session — the bug class list in each SDK's CLAUDE.md exists for this.
- Version bumps are per-SDK (independent semver, 0.x patch bumps),
changelogs in each SDK's
CHANGELOG.md. The core package version never bumps for SDK-only changes. - Everything (code, comments, docs, commit fragments) in English.
- Every official SDK keeps bounded race/idempotency, generated-property,
malformed-input fuzz, crash/reconnect, and spike coverage in its native
suite. Each also exposes an opt-in
BUNQUEUE_SDK_SOAK_SECONDSprofile. Database disk-full, WAL/power-loss and schema-migration injection stay in the broker suite; SDKs assert only the observable durable/reconnect contract.
Gate before any SDK commit
- The SDK's own e2e suite green (every supported runtime for TS).
bun runner.ts --driver ...→ CONFORMANT for every SDK you touched.- Lint/format clean (
bun run check/php -l/go vet+gofmt). bun run test:sandbox:sdkpasses every official SDK in isolated containers; reviewartifacts/test-sandbox-sdk/<timestamp>/summary.md, not only the exit code.- The repository-wide
bun run test:sandboxgate is also green. - Skeptic agent review (repo rule — no exceptions).
Does 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.

