From code-like-prompt
Erlang-style message passing via /tmp file system. Use when simulating actor model with actual message synchronization between processes. Provides send/receive primitives with blocking and pattern matching.
How this skill is triggered — by the user, by Claude, or both
Slash command
/code-like-prompt:erlang-message-syncThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Provides Erlang-style message passing primitives using `/tmp` file system as a message transport layer.
Provides Erlang-style message passing primitives using /tmp file system as a message transport layer.
This skill enables true message-passing semantics between simulated Erlang processes:
Messages are stored as JSON files in /tmp/erlang-messages/<to-pid>/:
/tmp/erlang-messages/
├── main/
│ ├── worker_1-1704067200000000000.json
│ └── worker_2-1704067201000000000.json
├── worker_1/
│ └── main-1704067199000000000.json
└── coordinator/
├── worker_1-1704067202000000000.json
└── worker_2-1704067203000000000.json
Send a message from one process to another (non-blocking):
# Get the plugin installation path
PLUGIN_PATH="$HOME/.claude/plugins/marketplaces/kokuyouwind-plugins/plugins/code-like-prompt"
# Send message: main -> worker_1
bash "${PLUGIN_PATH}/skills/erlang-message-sync/scripts/send-message.sh" \
main \
worker_1 \
'{"type":"request","from":"main","data":"hello"}'
Output:
Message sent from main to worker_1
Message file: /tmp/erlang-messages/worker_1/main-1704067200000000000.json
Message content: {"type":"request","from":"main","data":"hello"}
Receive a message (blocking until message arrives or timeout):
# Receive any message for worker_1 (30s timeout default)
MESSAGE=$(bash "${PLUGIN_PATH}/skills/erlang-message-sync/scripts/receive-message.sh" worker_1)
echo "Received: ${MESSAGE}"
# Receive only from 'main' with 5s timeout
MESSAGE=$(bash "${PLUGIN_PATH}/skills/erlang-message-sync/scripts/receive-message.sh" \
worker_1 \
main \
5)
Output:
Waiting for message to worker_1 from main (timeout: 5s)...
Received message at worker_1 from main
Message content: {"type":"request","from":"main","data":"hello"}
{"type":"request","from":"main","data":"hello"}
Syntax:
send-message.sh <from-pid> <to-pid> <message-json>
Arguments:
from-pid: Sender's process identifierto-pid: Recipient's process identifiermessage-json: Message content as JSON stringBehavior:
/tmp/erlang-messages/<to-pid> if needed<to-pid>/<from-pid>-<timestamp>.jsonExample:
bash send-message.sh coordinator worker_1 '{"task":"process","value":42}'
Syntax:
receive-message.sh <pid> [from-pid-pattern] [timeout-seconds]
Arguments:
pid: Receiving process identifierfrom-pid-pattern (optional): Filter by sender (glob pattern, default: *)timeout-seconds (optional): Maximum wait time (default: 30)Behavior:
/tmp/erlang-messages/<pid>/ every 100msExamples:
# Receive any message
MESSAGE=$(bash receive-message.sh main)
# Receive only from worker_1
MESSAGE=$(bash receive-message.sh coordinator worker_1)
# Receive from worker_1 with 10s timeout
MESSAGE=$(bash receive-message.sh coordinator worker_1 10)
# Sender (main process)
bash send-message.sh main worker_1 '{"type":"request","data":"compute"}'
RESPONSE=$(bash receive-message.sh main worker_1 10)
echo "Got response: ${RESPONSE}"
# Receiver (worker_1 process)
REQUEST=$(bash receive-message.sh worker_1 main)
# ... process request ...
bash send-message.sh worker_1 main '{"type":"response","result":"done"}'
# Main spawns two workers
bash send-message.sh main worker_1 '{"task":"A"}' &
bash send-message.sh main worker_2 '{"task":"B"}' &
# Workers send results to coordinator
# (In worker_1)
RESULT_1=$(bash receive-message.sh worker_1 main)
bash send-message.sh worker_1 coordinator '{"result":"A_done"}'
# (In worker_2)
RESULT_2=$(bash receive-message.sh worker_2 main)
bash send-message.sh worker_2 coordinator '{"result":"B_done"}'
# Coordinator collects both results
RESULT_A=$(bash receive-message.sh coordinator worker_1)
RESULT_B=$(bash receive-message.sh coordinator worker_2)
bash send-message.sh coordinator main '{"combined":"A_done,B_done"}'
# Receive only 'done' messages from any worker
MESSAGE=$(bash receive-message.sh coordinator "worker_*")
# Receive specifically from worker_1
MESSAGE=$(bash receive-message.sh coordinator worker_1)
Messages are automatically deleted when received. To manually clean up:
rm -rf /tmp/erlang-messages
if MESSAGE=$(bash receive-message.sh main worker_1 5); then
echo "Received: ${MESSAGE}"
else
echo "Timeout or error"
fi
The scripts are located at:
$HOME/.claude/plugins/marketplaces/kokuyouwind-plugins/plugins/code-like-prompt/skills/erlang-message-sync/scripts/
When using in commands, always resolve the full path or set a variable:
SKILL_DIR="$HOME/.claude/plugins/marketplaces/kokuyouwind-plugins/plugins/code-like-prompt/skills/erlang-message-sync"
bash "${SKILL_DIR}/scripts/send-message.sh" main worker_1 '{"msg":"hi"}'
bash "${SKILL_DIR}/scripts/receive-message.sh" worker_1
&Use this skill when:
Do not use when:
npx claudepluginhub kokuyouwind/claude-plugins --plugin code-like-promptProvides patterns and examples for Erlang concurrency: lightweight processes, spawning/linking/monitoring, message passing, selective receive, process pools, and scalable BEAM VM systems.
Implements OTP actor patterns in Gleam: processes, message passing, GenServer, supervisors, fault tolerance, state management for concurrent apps on Erlang VM.
Guides implementation of OTP behaviors (GenServer, Supervisor), supervision trees, and fault-tolerant concurrent systems in Elixir.