agentleFS
rainoftimerainoftime/pl-skills/message-passing-system/SKILL.md

message-passing-system

Skill17 starsChanged 9 months agoApache-2.0View on GitHub

Implement message passing concurrency models like actors and CSP channels.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Channel Implementation: Create typed message channels

    line 25
  2. Distinctive:

    Select/Alt: Wait on multiple channels

    line 27
  3. Distinctive:

    Message Ordering: Ensure message ordering guarantees

    line 29
  4. Distinctive:

    Use buffered channels for throughput

    line 43
  5. Distinctive:

    Use unbuffered for synchronization

    line 44
  6. Distinctive:

    Consider message delivery guarantees

    line 47
  7. Distinctive:

    When shared memory is simpler

    line 85

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

Message Passing System

Message passing is a concurrency model where processes/actors communicate by sending messages rather than sharing memory. It avoids many concurrency bugs by design.

When to Use This Skill

  • Building distributed systems
  • Avoiding shared-state concurrency bugs
  • Implementing actor-based architectures
  • Event-driven systems
  • Microservices communication

What This Skill Does

  1. Channel Implementation: Create typed message channels
  2. Actor Model: Implement actors with mailboxes
  3. Select/Alt: Wait on multiple channels
  4. Backpressure: Handle slow consumers
  5. Message Ordering: Ensure message ordering guarantees

Key Concepts

ConceptDescription
ChannelTyped conduit for messages
ActorEntity with mailbox and behavior
SelectWait on multiple channels
BackpressureHandle slow consumers
RendezvousSynchronous message passing

Tips

  • Use buffered channels for throughput
  • Use unbuffered for synchronization
  • Implement graceful shutdown
  • Handle message ordering carefully
  • Consider message delivery guarantees

Common Use Cases

  • Actor-based systems (Akka, Orleans)
  • Microservices communication
  • Event streaming
  • Pipeline processing
  • GUI event handling

Related Skills

  • actor-model-implementer - Actor foundations
  • lock-free-data-structure - Alternative model
  • session-type-checker - Type-safe messaging
  • concurrency-verifier - Verify correctness

Canonical References

ReferenceWhy It Matters
Hoare "Communicating Sequential Processes" (1978)CSP foundation
Hewitt, Bishop, Steiger "A Universal Modular ACTOR Formalism for Artificial Intelligence" (IJCAI 1973)Original actor paper
Pike "Newsqueak" and Go channelsPractical implementation

Tradeoffs and Limitations

Approach Tradeoffs

ApproachProsCons
CSP channelsSimple, composableManual routing
ActorsScalable, location transparentMore complex
Publish/SubscribeDecoupledNo reply semantics

When NOT to Use This Skill

  • Single-threaded applications
  • When shared memory is simpler
  • High-frequency trading (latency)

Limitations

  • Message ordering across actors
  • Distributed failures
  • Backpressure handling

Assessment Criteria

A high-quality implementation should have:

CriterionWhat to Look For
CorrectnessMessages delivered
FairnessNo starvation
PerformanceScales with cores
SafetyNo data races

Quality Indicators

✅ Good: Type-safe, handles backpressure, graceful shutdown ⚠️ Warning: Works but can deadlock ❌ Bad: Message loss, data races

Research Tools & Artifacts

Real-world message passing systems:

ToolWhy It Matters
AkkaActor system for Scala/Java
Erlang/OTPOriginal actor language
** Orleans**Microsoft actor framework
Go channelsCSP in Go
CAFC++ actor framework

Key Systems

  • Erlang/OTP: Production message passing
  • Akka: JVM actor system

Research Frontiers

Current message passing research:

DirectionKey PapersChallenge
Typed actors"Typed Actors" (2018)Type safety
Distribution"Distributed Actors"Scale
Failure"Actor Failure"Fault tolerance

Hot Topics

  1. Wasm actors: WebAssembly actors
  2. Serverless: Functions as actors

Implementation Pitfalls

Common message passing bugs:

PitfallReal ExamplePrevention
DeadlockCyclic waitsAvoid cycles
Lost messagesBuffer overflowBackpressure
StarvationUnfair schedulingFair queues

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.

Reviews can't be read right now.

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.