When designing and implementing web interfaces to ensure they are usable by everyone.
日本語の概要は準備中です。原文の説明を表示しています。
When designing loosely coupled systems that react to state changes asynchronously.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
Tightly coupled systems break and scale poorly. Event-driven architectures decouple producers from consumers by using immutable, timestamped facts as the communication mechanism. This enables systems to evolve independently, scale horizontally, and handle distributed failures gracefully.
OrderPlaced, UserRegistered, PaymentProcessed)OrderPlaced not PlaceOrder)SendEmailEvent) rather than facts (UserCreated)❌ Anti-pattern (Commands as events, synchronous coupling, no idempotency):
// WRONG: Command not event
publishEvent('SendEmail', { userId, subject });
// WRONG: Synchronous dependency
async function handleOrderPlaced(event) {
const order = await orderService.fetch(event.orderId); // Blocks on external service
await emailService.send(order.email); // Fails if service is down
}
// WRONG: No idempotency tracking - processes duplicate
async function handleUserCreated(event) {
await database.createUser(event); // Processes same event twice = duplicate user
}
✅ Correct pattern (Events, async, idempotent):
// CORRECT: Past-tense event with minimal payload
publishEvent({
type: 'UserCreated',
id: uuid(),
timestamp: new Date(),
payload: {
userId: event.userId,
email: event.email
}
});
// CORRECT: Asynchronous, idempotent consumer
async function handleUserCreated(event) {
// 1. Track processed events (idempotency)
const alreadyProcessed = await cache.get(`processed:${event.id}`);
if (alreadyProcessed) return; // Skip duplicate
// 2. Process without waiting for external services
await emailQueue.enqueue({
email: event.payload.email,
template: 'welcome'
});
// 3. Mark as processed
await cache.set(`processed:${event.id}`, true, { ttl: 86400 });
}
// 4. Dead Letter Queue for failed events
async function handleFailedEvent(event, error) {
await dlq.store({
originalEvent: event,
error: error.message,
timestamp: new Date(),
retryCount: 0
});
}
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
When designing and implementing web interfaces to ensure they are usable by everyone.
日本語の概要は準備中です。原文の説明を表示しています。
When creating or extending an HTTP API for client consumption.
日本語の概要は準備中です。原文の説明を表示しています。
When improving read performance and reducing database load.
日本語の概要は準備中です。原文の説明を表示しています。
When configuring automated build, test, and deployment workflows for a repository.
日本語の概要は準備中です。原文の説明を表示しています。
When asynchronously reviewing peer code before merging into the main branch.
日本語の概要は準備中です。原文の説明を表示しています。
When addressing slow application endpoints, high database CPU usage, or standardizing data access patterns.
日本語の概要は準備中です。原文の説明を表示しています。