원클릭으로
planforge-new-event-handler
Scaffold domain event types, handlers, and a MediatR-based publish/subscribe pipeline.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Scaffold domain event types, handlers, and a MediatR-based publish/subscribe pipeline.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Run a comprehensive code review across architecture, security, testing, naming, and patterns. Invokes relevant reviewer agents in sequence. Use before merging features or at the end of a phase. With --quorum, dispatches multi-model analysis for higher confidence.
Audit UI components for WCAG 2.2 compliance, semantic HTML, ARIA labels, keyboard navigation, color contrast, and responsive design.
Audit API endpoints for backward compatibility, versioning, OpenAPI compliance, pagination, rate limiting, and RFC 9457 error responses.
Review code for architecture violations: layer separation, sync-over-async, missing CancellationToken, improper DI. Use for PR reviews or code audits.
Fix a bug using TDD: reproduce with a failing test first, then implement the fix, then verify. Prevents regressions.
Review CI/CD pipelines for best practices: environment promotion, secrets management, rollback strategies, build caching, and deployment safety.
| name | planforge-new-event-handler |
| description | Scaffold domain event types, handlers, and a MediatR-based publish/subscribe pipeline. |
| metadata | {"author":"plan-forge","source":".github/prompts/new-event-handler.prompt.md"} |
Scaffold domain events with typed handlers using MediatR notifications.
// Marker interface for domain events
public interface IDomainEvent : INotification
{
Guid EventId { get; }
DateTime OccurredAt { get; }
}
// Base record for convenience
public abstract record DomainEvent : IDomainEvent
{
public Guid EventId { get; } = Guid.NewGuid();
public DateTime OccurredAt { get; } = DateTime.UtcNow;
}
// Concrete event
public record OrderPlacedEvent(
Guid OrderId,
Guid CustomerId,
decimal TotalAmount) : DomainEvent;
public class OrderPlacedHandler : INotificationHandler<OrderPlacedEvent>
{
private readonly IEmailService _emailService;
private readonly ILogger<OrderPlacedHandler> _logger;
public OrderPlacedHandler(IEmailService emailService, ILogger<OrderPlacedHandler> logger)
{
_emailService = emailService;
_logger = logger;
}
public async Task Handle(OrderPlacedEvent notification, CancellationToken ct)
{
_logger.LogInformation("Handling OrderPlaced: {OrderId}", notification.OrderId);
await _emailService.SendOrderConfirmationAsync(notification.OrderId, ct);
}
}
public class OrderService
{
private readonly IMediator _mediator;
public async Task<Order> PlaceOrderAsync(CreateOrderRequest request, CancellationToken ct)
{
var order = new Order(request.CustomerId, request.Items);
await _repository.AddAsync(order, ct);
await _mediator.Publish(new OrderPlacedEvent(
order.Id, order.CustomerId, order.TotalAmount), ct);
return order;
}
}
// MediatR publishes to ALL registered handlers for an event
public class OrderPlacedAuditHandler : INotificationHandler<OrderPlacedEvent>
{
public async Task Handle(OrderPlacedEvent notification, CancellationToken ct)
{
// Write to audit log — runs independently of email handler
}
}
builder.Services.AddMediatR(cfg =>
cfg.RegisterServicesFromAssemblyContaining<Program>());
Events/ folder, handlers in EventHandlers/CancellationToken in all async handler methods