kafka
Skill1 starsChanged 2 months agoMITView on GitHub
Design and operate Kafka / Amazon MSK correctly — topic and partition design, partition key choice and hot partitions, consumer groups and rebalancing, offset commit semantics, idempotent/transactional producers, retries and dead-letter topics, schema registry, and the pain of repartitioning. Use when adding a Kafka topic or consumer, reviewing Kafka code, or when asked about partitioning / consumer lag / ordering.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- navikt/copilottheir own version, first seen Sep 14, 2026
- anurag-azure/skillstheir own version, first seen Jun 27, 2026
- mjunaidca/mjs-agent-skillstheir own version, first seen Dec 21, 2025
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- navikt/copilot★ 61same name
- mjunaidca/mjs-agent-skills★ 27same name
- anurag-azure/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository73 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bigquery-analyticsSkill
- cache-invalidationSkill
- mongo-aggregationSkill
- mongo-modelingSkill
- postgres-aggregationSkill
- postgres-indexingSkill
- redis-coordinationSkill
- redis-patternsSkill
- review-querySkill
- code-migrationSkill
- cut-releaseSkill
- data-migrationSkill
- deploy-serviceSkill
- hotfixSkill
- rollbackSkill
- design-endpointSkill
- design-eventSkill
- design-schemaSkill
- evolve-contractSkill
- scaffold-nestjs-moduleSkill
- scaffold-projectSkill
- incident-responseSkill
- investigate-bugSkill
- on-callSkill
- postmortemSkill
- audit-skillsSkill
- distill-review-styleSkill
- write-skillSkill
- debug-with-tracesSkill
- define-alertsSkill
- instrument-serviceSkill
- evaluate-dependencySkill
- grillSkill
- handoffSkill
- orientSkill
- phased-deliverySkill
- spikeSkill
- to-questionnaireSkill
- write-adrSkill
- write-prdSkill
- devops-pr-reviewSkill
- go-backend-pr-reviewSkill
- nestjs-backend-pr-reviewSkill
- python-backend-pr-reviewSkill
- react-frontend-pr-reviewSkill
- bisectSkill
- break-couplingSkill
- dead-code-sweepSkill
- deslopifySkill
- extract-moduleSkill
- rebase-cleanSkill
- resolve-merge-conflictsSkill
- split-commitSkill
- tddSkill
- wait-whatSkill
- wide-renameSkill
- bullmqSkill
- sqs-consumerSkill
- audit-dependenciesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Start with a considered number (e.g.
- Distinctive: line 28
No key → round-robin (sticky per batch) — fine when order doesn't matter.
- Distinctive: line 48
dead-letter topic: after N attempts. On a terminal error, straight to the DLT.
- Very specific: line 55
Use a schema registry (Avro / Protobuf / JSON Schema) with compatibility checks.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Kafka / MSK
Topics & partitions
- A topic's partition count is the unit of consumer parallelism — at most one consumer in a group per partition. Size it for peak throughput plus headroom; increasing partitions later breaks key-ordering (a key can move to a new partition) and is disruptive.
- Start with a considered number (e.g. 6–12 for a busy topic), not 1 and not 100.
- Retention: time or size based; compacted topics for "latest value per key" (changelog / state).
- Replication factor ≥ 3 on MSK,
min.insync.replicas = 2, produceracks=all— otherwise a broker loss can lose data.
Partition key
- Ordering is guaranteed only within a partition, i.e. per key. Choose the key
so messages that must be ordered share it: all events for one
orderId→ key =orderId. - Hot partitions — a key with far more traffic than others (a whale tenant, a null key) overloads one partition/consumer. If you don't need ordering, use a null key (round-robin) or a composite key.
- No key → round-robin (sticky per batch) — fine when order doesn't matter.
Consumers
- Consumer group = the scaling and offset-tracking unit. Adding consumers up to the partition count adds parallelism; beyond that they idle.
- Rebalancing — a consumer join/leave/timeout pauses the group while
partitions are reassigned. Minimize: tune
session.timeout.ms/max.poll.interval.msso a slow handler doesn't get kicked; use the cooperative-sticky assignor to avoid stop-the-world. - Offset commit — commit after processing succeeds (at-least-once → idempotent handlers). Auto-commit commits on a timer regardless of success = message loss on crash. Prefer manual commit after the write.
max.poll.recordssmall enough that the batch processes withinmax.poll.interval.ms.
Retries & dead-letter
- Kafka has no built-in redelivery/DLQ. Pattern: on a retryable error, either pause + seek back, or publish to a retry topic (with a delay) and a dead-letter topic after N attempts. On a terminal error, straight to the DLT. Same terminal-vs-retryable discipline as SQS.
- A poison message that throws on every attempt will block the partition forever if you just keep retrying in place — that's why the DLT matters.
Schema
- Use a schema registry (Avro / Protobuf / JSON Schema) with compatibility
checks. Additive changes stay compatible; renames/removals break consumers
(
design/evolve-contract,design/design-event).
Operate
- Monitor consumer lag per group per partition — rising lag = consumers can't keep up (scale, or the handler is slow).
- Idempotent producer (
enable.idempotence=true) to avoid dupes on producer retry; transactions (transactional.id) only if you need exactly-once across produce+consume.
Anti-patterns
- ❌ 1 partition on a topic that needs throughput; or bumping partitions later on a keyed topic.
- ❌ Auto-commit with at-least-once expectations.
- ❌ A null/hot key causing one overloaded partition.
- ❌ Retrying a poison message in place forever (blocks the partition).
- ❌ No schema registry; renaming fields freely.
- ❌
acks=1/ RF<3 on data you can't lose. - ❌ Not monitoring consumer lag.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

