agentleFS
egeominottiegeominotti/bunqueue/.agents/skills/bunqueue-dev/SKILL.md

bunqueue-dev

Skill601 starsChanged 16 days agoMITView on GitHub

Orientation map of the bunqueue repository for contributors. Use when asked how bunqueue works internally or where code lives (request flow of PUSH, PULL and ACK, shards, lock order, embedded versus TCP mode, Workflow Engine files), when planning or reviewing a feature or a refactor of the source, or when unsure which bunqueue skill or reference page covers a task. Load it before searching the source. Skip it for a bug fix, a gate, a Machine run, a release or a session: load the bunqueue-* skill that owns the task instead. Not for applications that use bunqueue as a library.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every code change updates /docs and the changelog in the same change-set.

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

bunqueue development guide

bunqueue is a high-performance job queue for Bun with SQLite persistence. The mandatory rules are in CLAUDE.md (Claude Code) and AGENTS.md (Codex); read the one for your agent completely before changing anything. This skill is a map: what the code looks like and where each procedure lives.

Which skill or page

TaskGo to
Start, resume, track or hand off a session; edit feature_list.json or progress.mdbunqueue-working-sessions (skill)
A bug, regression or failing behavior to fixbunqueue-fixing-bugs (skill)
Which gates to run, reading sandbox artifacts, a failing gate, a post-gate change, watching CI after a pushbunqueue-running-gates (skill)
Ubuntu and Debian OrbStack Machine evidencebunqueue-running-machine-gates (skill)
A release the user explicitly asked forbunqueue-releasing (skill)
Working through the work items unattended, when the user explicitly asked for itbunqueue-working-autonomously (skill)
Architecture, env vars, TCP commands, CLI, schemadocs/agents/project-reference.md
Simple Mode, Workflow Engine, Client SDK optionsdocs/agents/client-reference.md
Debug endpoints, CPU and heap profilingdocs/agents/debugging.md
Test isolation, the gates and their rationaledocs/testing.md
Engineering reference (authoritative)docs/README.md, docs/architecture.md, docs/data-model.md

Architecture

A sharded priority-queue broker:

  • Shards: auto-detected from CPU cores (power of 2, max 64); a queue maps to fnv1aHash(queue) & SHARD_MASK.
  • Persistence: SQLite in WAL mode behind a 10 ms WriteBuffer that batches writes; durable: true bypasses it.
  • Transport: TCP (msgpack) on port 6789, HTTP on port 6790, native TLS on both when TLS_CERT_FILE and TLS_KEY_FILE are set.
  • Two modes: embedded (in-process) and TCP (client-server).

Request flow:

  1. PUSH: Client -> TcpPool -> TcpServer -> QueueManager -> Shard -> PriorityQueue -> WriteBuffer -> SQLite
  2. PULL: Client -> TcpServer -> QueueManager -> Shard -> PriorityQueue.pop()
  3. ACK: Client -> TcpServer -> AckBatcher -> Shard.complete() -> jobResults (LRU)
  4. FAIL: Client -> TcpServer -> Shard.fail() -> retry (backoff) or DLQ

Source layout

src/
  cli/              CLI interface
  client/           SDK: Queue, Worker, FlowProducer, Bunqueue (Simple Mode)
    queue/          Queue with DLQ, stall detection
    worker/         Worker with heartbeat, ack batching
    tcp/            connection pool, reconnection
    workflow/       Workflow Engine: Workflow DSL, Engine, Executor, Store
  domain/           pure business logic
    queue/          Shard, PriorityQueue, DlqShard, UniqueKeyManager
  application/      use cases and managers
    operations/     push, pull, ack, query, queueControl
  infrastructure/   persistence, server, scheduler, backup
  shared/           utilities: hash, lock, lru, skipList, minHeap

The Workflow Engine in src/client/workflow/ is a pure consumer of the queue (no core changes): workflow.ts is the fluent DSL (.step(), .branch(), .path(), .waitFor()), engine.ts the public facade, executor.ts step execution, branching, compensation and signals, store.ts the SQLite execution state, types.ts the shared types. It is exported as bunqueue/workflow.

Code conventions

  • At most 300 lines per source file; split instead of growing one. One concern per file, export only what is needed.
  • Lock hierarchy: jobIndex -> completedJobs -> shards[N] -> processingShards[N]; read first, then lock, release in finally, and never await inside a shard's synchronous critical section.
  • Queue invariants (heap membership, jobIndex, processing maps, counters, temporal indexes, group ownership, concurrency slots) transition exactly once.
  • Type check with bun check and format with bun fmt only, through the package scripts.

Gotchas

  • .claude/skills/<name> are relative symlinks into .agents/skills/. On Windows Git checks symlinks out as plain text files unless symlinks are enabled, and Claude Code then finds no skill: clone with git clone -c core.symlinks=true (symlinks need Windows Developer Mode or an elevated shell). A clone made without it needs a fresh clone with the setting; the canonical .agents/skills/ is unaffected.
  • The repository root also holds skills/bunqueue/ and agents/: the Claude Code plugin for people who use bunqueue in their applications. They are product documentation, not contributor instructions; contributor skills live in .agents/skills/.
  • The reference pages under docs/agents/ are summaries. When one disagrees with the engineering reference or the code, the code and docs/ win, and the summary is fixed in the same change.
  • Every code change updates /docs and the changelog in the same change-set; a change is not complete while its documentation is stale.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.