.claude/skills/ts-amqplib/SKILL.md
You are an expert in amqplib, the Node.js client for RabbitMQ and AMQP 0-9-1 protocol. You help developers implement reliable message queuing with work queues, pub/sub fanout, topic routing, RPC patterns, dead letter queues, and message acknowledgment — building decoupled microservices that communicate asynchronously through RabbitMQ.
npx skillsauth add eliferjunior/Claude amqplibInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert in amqplib, the Node.js client for RabbitMQ and AMQP 0-9-1 protocol. You help developers implement reliable message queuing with work queues, pub/sub fanout, topic routing, RPC patterns, dead letter queues, and message acknowledgment — building decoupled microservices that communicate asynchronously through RabbitMQ.
import amqp from "amqplib";
// Producer — send messages to queue
async function sendToQueue(queue: string, message: any) {
const connection = await amqp.connect(process.env.RABBITMQ_URL!);
const channel = await connection.createChannel();
await channel.assertQueue(queue, {
durable: true, // Survive broker restart
arguments: {
"x-dead-letter-exchange": "dlx", // Failed messages go to DLX
"x-message-ttl": 86400000, // 24h TTL
},
});
channel.sendToQueue(queue, Buffer.from(JSON.stringify(message)), {
persistent: true, // Survive broker restart
contentType: "application/json",
messageId: crypto.randomUUID(),
timestamp: Date.now(),
});
await channel.close();
await connection.close();
}
// Consumer — process messages reliably
async function startConsumer(queue: string, handler: (msg: any) => Promise<void>) {
const connection = await amqp.connect(process.env.RABBITMQ_URL!);
const channel = await connection.createChannel();
await channel.assertQueue(queue, { durable: true });
await channel.prefetch(10); // Process 10 at a time
channel.consume(queue, async (msg) => {
if (!msg) return;
try {
const data = JSON.parse(msg.content.toString());
await handler(data);
channel.ack(msg); // Success — remove from queue
} catch (error) {
console.error("Processing failed:", error);
channel.nack(msg, false, false); // Failed — send to DLX (no requeue)
}
});
}
// Usage
await sendToQueue("orders", { orderId: "ORD-123", total: 99.99 });
await startConsumer("orders", async (order) => {
await processOrder(order);
await sendEmail(order);
});
// Topic exchange — route messages by pattern
async function setupTopicExchange() {
const connection = await amqp.connect(process.env.RABBITMQ_URL!);
const channel = await connection.createChannel();
await channel.assertExchange("events", "topic", { durable: true });
// Publish events
channel.publish("events", "order.created", Buffer.from(JSON.stringify({
orderId: "ORD-456", items: 3,
})));
channel.publish("events", "order.shipped", Buffer.from(JSON.stringify({
orderId: "ORD-456", trackingId: "TRACK-789",
})));
channel.publish("events", "user.signup", Buffer.from(JSON.stringify({
userId: "usr-99", email: "[email protected]",
})));
}
// Subscribe to patterns
async function subscribeToPattern(pattern: string, handler: (data: any, key: string) => void) {
const connection = await amqp.connect(process.env.RABBITMQ_URL!);
const channel = await connection.createChannel();
await channel.assertExchange("events", "topic", { durable: true });
const { queue } = await channel.assertQueue("", { exclusive: true });
await channel.bindQueue(queue, "events", pattern);
channel.consume(queue, (msg) => {
if (!msg) return;
handler(JSON.parse(msg.content.toString()), msg.fields.routingKey);
channel.ack(msg);
});
}
// Subscribe to all order events
await subscribeToPattern("order.*", (data, key) => {
console.log(`Order event [${key}]:`, data);
});
// Subscribe to everything
await subscribeToPattern("#", (data, key) => {
console.log(`[${key}]:`, data);
});
npm install amqplib
npm install -D @types/amqplib
# RabbitMQ server
docker run -d -p 5672:5672 -p 15672:15672 rabbitmq:management
noAck: true in production; explicitly ack after successful processingchannel.prefetch(N) to limit concurrent processing; prevents consumer overloadorder.* patterns for flexible routing; decouple publishers from consumersx-message-ttl to prevent queue buildup; stale messages expire automaticallymessageId to deduplicate; messages may be delivered more than oncedevelopment
Expert guidance for Fireworks AI, the platform for running open-source LLMs (Llama, Mixtral, Qwen, etc.) with enterprise-grade speed and reliability. Helps developers integrate Fireworks' inference API, fine-tune models, and deploy custom model endpoints with function calling and structured output support.
development
Convert any website into clean, structured data with Firecrawl — API-first web scraping service. Use when someone asks to "turn a website into markdown", "scrape website for LLM", "Firecrawl", "extract website content as clean text", "crawl and convert to structured data", or "scrape website for RAG". Covers single-page scraping, full-site crawling, structured extraction, and LLM-ready output.
tools
Expert guidance for Firebase, Google's platform for building and scaling web and mobile applications. Helps developers set up authentication, Firestore/Realtime Database, Cloud Functions, hosting, storage, and analytics using Firebase's SDK and CLI.
development
When the user needs to build file upload functionality for a web application. Use when the user mentions "file upload," "image upload," "upload endpoint," "multipart upload," "presigned URL," "S3 upload," "file validation," "upload to cloud storage," or "accept user files." Handles upload endpoints, file validation (type, size, magic bytes), cloud storage integration, and upload status tracking. For image/video processing after upload, see media-transcoder.