agentleFS
meyverickmeyverick/agentic/skills/scalability/SKILL.md

scalability

Skill0 starsChanged 13 days agoISCView on GitHub

Design and implement language-agnostic queue-worker architectures, hub-and-spoke state coordination, backpressure controls, and real-time event streaming via SSE, WebSockets, and pub/sub channels. Use when designing background job processing, worker topologies, push pipelines, or event-driven control loops in any language or project.

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use albert-dm, cost-reducer and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • yawningwhaleAISkill

    albert-dm

    Reply to DMs and messages the way Albert would. Use when the user asks "how would Albert reply to this", pastes a conversation and wants an Albert-style response, or asks you to draft/write a DM in Albert's voice. Albert sells AI voice agents / automations to local service businesses (Go High Level, lead follow-up, bookings).

    Also in 5 projects that use this

  • huyvpSkill

    cost-reducer

    Reduce cloud, infrastructure, and operational costs while maintaining performance. Use when writing database queries, configuring cloud resources, optimizing bundles, setting up caching, choosing between services, sizing instances, configuring CDN, managing storage, or reviewing code for cost inefficiencies. Covers AWS/GCP/Vercel pricing, database optimization, serverless tuning, image pipelines, observability costs, and FinOps practices.

    Also in 10 projects that use this

  • yawningwhaleAISkill

    new-client-system

    Scaffold a new client's full stack — Next.js 16 frontend dashboard + Trigger.dev backend worker — from the Shiney automations template. Use when the user says "new client", "onboard a client", "scaffold a client system", "set up <client-name>", or wants to start a fresh frontend+backend project styled and structured like the Shiney automations dashboard. Produces structure only; no automations are scaffolded — those are added later.

    Also in 5 projects that use this

  • xfstudioSkill

    trigger-dev

    Trigger.dev expert for background jobs, AI workflows, and reliable async execution with excellent developer experience and TypeScript-first design. Use when: trigger.dev, trigger dev, background task, ai background job, long running task.

    Also in 10 projects that use this

  • RoxenRobloxSkill

    youtube-broll-maker

    Generate 10-second B-roll footage of yourself doing an action using the Higgsfield MCP (Seedance 2.0). Upload one photo of yourself, describe the action ("typing on laptop", "walking at night"), pick from 5 cinematography style presets, get an MP4. Use when the user wants B-roll, cutaway footage, "me doing X" video, YouTube B-roll, or any image-to-video of themselves performing an action.

    Also in 3 projects that use this

  • RoxenRobloxSkill

    youtube-popup-graphic

    Generate stunning Adobe-Premiere-Pro-style UI popup motion graphics for YouTube videos using the Higgsfield MCP. The user uploads a style reference image (any UI mockup, dashboard, glass card, design they love), names one skill/feature/item, and the skill produces an MP4 of a single card popping in styled to match the reference. Use when the user wants a "popup graphic", "popup animation", "card popup", "skill popup", "AE/Premiere-style animation", "stunning UI animation for YouTube", or says "make me a popup for <skill/feature/item> styled like <reference>".

    Also in 3 projects that use this

  • +4 more from yawningwhaleAI

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 2

    Distinctive

    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
  1. Very specific:

    Inter-Service & Worker RPC: Use strongly typed binary or schema-validated wire contracts (e.g., gRPC/Protobuf, IPC queues, or transactional …

    line 20
  2. Distinctive:

    Synchronous Heavy Work: Never execute intensive CPU math, cryptographic hashing, ML inference, or bulk I/O inside incoming HTTP/WS request …

    line 35
  3. Very specific:

    Per-Client Database Listeners: Never spawn a dedicated database LISTEN connection per connected SSE/WebSocket client.

    line 36
  4. Distinctive:

    Cron as Workflow Orchestration: Never chain dependent pipeline stages via wall-clock cron schedules.

    line 38

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “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

Scalability & Realtime Doctrine

Summary

Universal execution blueprints for non-blocking asynchronous work, hub-and-spoke worker coordination, explicit backpressure, and push-based real-time transport across any programming language or runtime stack.

Core Mental Model

  • Coordinator Authority: A single authoritative service or persistence tier owns the primary job state machine (queued -> running -> succeeded | failed | cancelled) with stable unique IDs, idempotency keys, and actor scoping.
  • Stateless Workers: Disposable, horizontally scalable workers pull or receive leased jobs, emit heartbeats, and report progress or terminal results. Expired leases trigger idempotent re-queuing.
  • Hub-and-Spoke Topology: Enforce strict coordinator-to-worker orchestration. Emergent peer-to-peer worker meshes and cyclic inter-worker dependencies are forbidden.
  • Deterministic State Transitions: State reducers execute as pure functions over events (delta(State, Event) -> State) with zero side effects and zero hardware clock calls (Instant::now(), Date.now(), time.monotonic()); logical timestamps and UUIDs arrive inside the ingress event payload.
  • Reactor Protection: Synchronous request paths validate input, persist or enqueue intent, and return a task receipt immediately. Heavy CPU, bulk I/O, and long-running workflows always execute off the request thread/reactor.

Real-Time & Transport Layer

  • Live Push Default: Stream state transitions to connected clients over Server-Sent Events (SSE) or WebSockets (WSS) driven by database pub/sub or in-process broadcast fan-out. Client interval polling is prohibited.
  • Inter-Service & Worker RPC: Use strongly typed binary or schema-validated wire contracts (e.g., gRPC/Protobuf, IPC queues, or transactional DB leases) without cross-service filesystem traversal (../).
  • Event-Driven Control Loops: Trigger downstream stages strictly on discrete state transition events or threshold crossings, never blind cron or sleep loops.
  • Constrained Polling Fallback: Poll external third-party APIs only when webhooks or streaming endpoints do not exist; enforce the coarsest acceptable interval, single-flight coalescing, bounded timeouts, and jittered exponential backoff.

Implementation & Ecosystem Matrix

MechanismArchitectural Pattern & GuaranteesRecommended Ecosystem Specificities
Transactional Job QueueAt-least-once delivery, lease timeouts, dead-letter routing, and idempotency keys.PostgreSQL: FOR UPDATE SKIP LOCKED queue tables. Dedicated Brokers: Redis Streams, NATS JetStream, RabbitMQ.
Compute OffloadingIsolate CPU-bound work from async I/O event loops to prevent reactor starvation.Rust: Tokio spawn_blocking / Rayon pools. Go: bounded goroutine worker pools. TS/Bun/Node: Worker threads. Python: ProcessPoolExecutor.
Real-Time Client PushMultiplex a single backend event listener into a fan-out broadcast channel feeding active client streams.PostgreSQL + SSE/WSS: LISTEN/NOTIFY (PgListener) -> broadcast channel -> SSE (e.g., Datastar PatchElements/PatchSignals) or WebSockets.
Internal RPCSchema-first, low-overhead inter-process communication with deadline propagation.Rust: tonic (gRPC) / Postcard. Go/Polyglot: gRPC, Connect-RPC, or Cap'n Proto.
Backpressure & Flow ControlBounded memory buffers, concurrency semaphores, tenant rate limits, and load shedding (HTTP 429/503).Rust: bounded tokio::sync::mpsc & Semaphore. Go: buffered chan + x/time/rate. Web/Edge: ReadableStream backpressure.

Anti-Patterns & Operational Guardrails

  • Synchronous Heavy Work: Never execute intensive CPU math, cryptographic hashing, ML inference, or bulk I/O inside incoming HTTP/WS request handlers.
  • Per-Client Database Listeners: Never spawn a dedicated database LISTEN connection per connected SSE/WebSocket client; multiplex one listener into an in-memory broadcast fan-out channel.
  • Stateful Workers: Workers must remain disposable; local in-memory state must never be required to recover a failed job.
  • Cron as Workflow Orchestration: Never chain dependent pipeline stages via wall-clock cron schedules; trigger subsequent stages directly from completion events.
  • Unbounded Fan-Out & Queues: Reject unbounded channels (unbounded_channel, unthrottled Promise.all over dynamic inputs) on network-facing paths.

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.