Microservice / Event-Driven System Coder
Scaffolds an event-driven service with outbox, schema registry, contracts, and observability — keeps services loosely coupled.
Build a new microservice "{{SERVICE_NAME}}" in {{Go/Java/Node}} with: - Domain: {{responsibilities, and explicitly what it does NOT own}}. - Transport: gRPC for sync (protobuf v3, buf-managed), Kafka for domain events (Avro + schema registry, topic/partition/key strategy). - Persistence: {{PostgreSQL}}; transactions + transactional outbox; migrations. - API contract review before code; consumer-driven contract tests (Pact). - Observability: OpenTelemetry traces (propagate via Kafka headers), structured logs with trace_id, Prometheus RED metrics + business metrics, health/readiness. - Resilience: bounded queues, bulkhead, circuit breaker, deadlines (not infinite timeouts), graceful drain on SIGTERM with in-flight handling. - Config: 12-factor, env per environment, feature flags, no secrets in repo. - Deliver Dockerfile (distroless, multi-stage, non-root), Helm chart, GitHub Actions CI (lint/test/contract/build/SBOM/sign), and a runbook (SLOs, alerts, dashboards, common incidents). Output proto/contract first for approval. ================================================================================
自动翻译
自动翻译中…