event-driven-architecture
БесплатноБез исполняемых скриптовНе проверенGeneric Event-Driven Architecture patterns with Kafka, Dapr, and modern messaging systems. Provides reusable patterns for building scalable, resilient…
от aiskillstore★ 509 звёзд на GitHubОб этом скилле
Event-Driven Architecture with Modern Patterns
This skill provides comprehensive patterns for implementing event-driven microservices using modern messaging systems, distributed runtimes, and cloud-native patterns. It's designed to be framework-agnostic and applicable to any domain requiring event-driven capabilities.
When to Use This Skill
Use this skill when you need to:
- Build event-driven microservices architecture
- Implement pub/sub patterns with Kafka, RabbitMQ, or cloud services
- Use Dapr for distributed application patterns
- Implement real-time notifications and workflows
- Build recurring task and reminder systems
- Create audit trails and activity logs
- Implement distributed state management
- Build serverless event workflows
- Handle event sourcing and CQRS patterns
1. Core Event Architecture
Base Event Schema
# events/core.py
from pydantic import BaseModel, Field, validator
from datetime import datetime
from typing import Optional, Dict, Any, Union, List
from enum import Enum
from abc import ABC, abstractmethod
import uuid
import json
class EventVersion(str, Enum):
"""Event versioning support"""
V1_0 = "1.0"
V1_1 = "1.1"
V2_0 = "2.0"
class EventPriority(str, Enum):
"""Event priority levels"""
LOW = "low"
NORMAL = "normal"
HIGH = "high"
CRITICAL = "critical"
class BaseEvent(BaseModel, ABC):
"""Base event schema with common fields"""
# Core identification
event_id: str = Field(default_factory=lambda: str(uuid.uuid4()))
event_type: str = Field(..., description="Type of the event")
event_version: EventVersion = Field(default=EventVersion.V1_0)
# Metadata
timestamp: datetime = Field(default_factory=datetime.utcnow)
correlation_id: Optional[str] = None
causation_id: Optional[str] = None # Event that caused this one
source: str = Field(..., description="Source service/identifier")
# Context
user_id: Optional[str] = None
tenant_id: Optional[str] = None # Multi-tenant support
session_id: Optional[str] = None
# Processing metadata
priority: EventPriority = Field(default=EventPriority.NORMAL)
retry_count: int = Field(default=0)
max_retries: int = Field(default=3)
delay_until: Optional[datetime] = None # For delayed processing
# Schema versioning
schema_version: str = Field(default="1.0")
class Config:
# Allow additional fields for extensibility
extra = "allow"
# Use enum values
use_enum_values = True
@validator('event_type')
def validate_event_type(cls, v):
"""Validate event type format"""
if not v or '.' not in v:
raise ValueError('event_type must be in format: domain.event_name')
return v.lower()
@validator('correlation_id')
def validate_correlation_id(cls, v, values):
"""Set correlation_id from causation_id if not provided"""
if not v and 'causation_id' in values:
return values['causation_id']
return v
def to_dict(self) -> Dict[str, Any]:
"""Convert event to dictionary for serialization"""
return self.model_dump()
@classmethod
def from_dict(cls, data: Dict[str, Any]) -> 'BaseEvent':
"""Create event from dictionary"""
return cls(**data)
def with_context(self, **context) -> 'BaseEvent':
"""Add context to event"""
for key, value in context.items():
if hasattr(self, key):
setattr(self, key, value)
return self
class DomainEvent(BaseEvent):
"""Domain-specific event"""
aggregate_id: str = Field(..., description="Aggregate root ID")
aggregate_type: str = Field(..., description="Aggregate type")
event_data: Dict[str, Any] = Field(default_factory=dict)
@validator('aggregate_type')
def validate_aggregate_type(cls, v):
"""Validate aggregate type"""
if not v:
raise ValueError('aggregate_type is required')
return v.lower()
class IntegrationEvent(BaseEvent):
"""Integration event for cross-service communication"""
target_services: List[str] = Field(default_factory=list)
routing_key: Optional[str] = None
message_format: str = Field(default="json")
@validator('routing_key')
def validate_routing_key(cls, v, values):
"""Generate routing key from event_type if not provided"""
if not v and 'event_type' in values:
return values['event_type'].replace('.', '/')
return v
class CommandEvent(BaseEvent):
"""Command event representing an intent"""
command_type: str = Field(..., description="Type of command")
command_data: Dict[str, Any] = Field(default_factory=dict)
expected_version: Optional[int] = None # For optimistic concurrency
@validator('command_type')
def validate_command_type(cls, v):
"""Validate command type"""
if not v.endswith('.command'):
v = f"{v}.comman
Установить event-driven-architecture в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл event-driven-architecture?
Generic Event-Driven Architecture patterns with Kafka, Dapr, and modern messaging systems. Provides reusable patterns for building scalable, resilient event-driven microservices. Framework-agnostic implementation supporting multiple message brokers, state stores, and event patterns. Follows 2025 best practices for distributed systems.
Как установить скилл event-driven-architecture?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл event-driven-architecture запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic