Apache Kafka — topics, partitions and keys for ordering, replication and acks, idempotent and transactional producers, consumer groups and offset management, rebalancing, retention and compaction, schema registry, lag monitoring, exactly-once semantics limits. Use for Kafka producers, consumers and topic design (Kafka, partitions, consumer group, offsets, compaction, schema registry).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Kafka?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-kafka)
---
name: kafka
description: Apache Kafka — topics, partitions and keys for ordering, replication and acks, idempotent and transactional producers, consumer groups and offset management, rebalancing, retention and compaction, schema registry, lag monitoring, exactly-once semantics limits. Use for Kafka producers, consumers and topic design (Kafka, partitions, consumer group, offsets, compaction, schema registry).
metadata:
category: messaging
---
# Kafka
## Purpose
Use Kafka for ordered, replayable event streams with correct delivery semantics.
**Use when:** event streaming and integration via Kafka.
**Not for:** simple task queues.
## Inputs
- Event flows, ordering and throughput needs.
## Outputs
- Topic design, producer/consumer configs, monitoring.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "kafka"` for prior decisions, patterns and anti-patterns.
## Steps
1. **Topics.** Partition key preserves required order; partition count from throughput.
Done when ordering needs met.
2. **Producers.** `acks=all`, idempotence on, outbox for DB consistency.
Done when no lost or duplicate publishes from retries.
3. **Consumers.** Commit offsets after processing; idempotent handlers; DLQ topic.
Done when reprocessing is safe.
4. **Operate.** Monitor lag, set retention/compaction, schema compatibility mode.
Done when lag alerts exist.
## Best practices
- Schema registry with backward compatibility.
- Avoid too many partitions per broker.
## Common mistakes
- Auto-commit before processing.
- Hot partitions from skewed keys.
## Example
`orders` topic keyed by orderId, 12 partitions, compacted `order-state`, consumer lag alert at 5 minutes.
## Reusable prompt
```text
Apply the Kafka skill (.agents/skills/kafka/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Design topics, keys, producer and consumer settings, DLQ and monitoring for the event flow.
Return: Topic design, producer/consumer configs, monitoring..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```