pcs-add-kafka-event

Add a Kafka event to a PCS microservice with topic naming and consumer-handler flow.

1|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/Benmore-Studio/Benmore-Meridian --skill pcs-add-kafka-event
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pcs-add-kafka-event
Source: https://github.com/Benmore-Studio/Benmore-Meridian/tree/main/skills/pcs/pcs-add-kafka-event
Command: npx skills add https://github.com/Benmore-Studio/Benmore-Meridian --skill pcs-add-kafka-event

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates adding a new Kafka event to a PCS microservice by defining topic naming, configuring an emitter, registering a consumer handler, and establishing cross-service contracts.

Core Features & Use Cases

  • Topic naming following the pcs.<domain>.<entity>.<action> convention and automatic inclusion in the event catalog.
  • Emitter function to publish events with required metadata (request_id, org_id, timestamp, source_service).
  • Handler registration and TenantScope context management to ensure proper tenant isolation.
  • Consumer setup and startup-order guarantees to avoid missing events.
  • Cross-service event contracts and payload schemas to ensure compatibility across PCS services.

Quick Start

Define a new PCS Kafka event by specifying the topic, implement the emitter, register the handler, and initialize the consumer before the service starts.

Frequently Asked Questions about pcs-add-kafka-event

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new Kafka event to a PCS microservice?

To add a new Kafka event, define the topic using the pcs.<domain>.<entity>.<action> convention, implement the emitter function, register the consumer handler, and initialize the consumer before the service starts.

What naming convention should I use for PCS Kafka topics?

PCS Kafka topics must follow the pcs.<domain>.<entity>.<action> format. This standardized naming ensures proper event catalog inclusion and cross-service contract compatibility within publish/subscribe scenarios.

How does TenantScope work when consuming Kafka events in PCS?

TenantScope provides context management for consumer handlers to ensure proper tenant isolation. It guards the handler execution flow so that event processing remains securely scoped to the correct tenant.

What metadata is required to publish a Kafka event in a PCS service?

Publishing a Kafka event requires an emitter function that includes specific metadata: request_id, org_id, timestamp, and source_service. This metadata ensures proper event tracing and cross-service contract fulfillment.

How do I prevent missing Kafka events during microservice startup?

To prevent missing Kafka events, you must guarantee startup-order by registering the consumer and completing pre-start registration before the service begins. This ensures the handler is active before events are emitted.

Can I make Kafka event consumers idempotent in PCS microservices?

Yes, the consumer setup establishes idempotent consumers to safely handle event retries. This prevents duplicate processing and maintains data consistency across cross-service domains during publish/subscribe operations.