mcpField
K
kafka-development-practices

kafka-development-practices

github.com/oimiragieoDevelopment4437 installsUpdated 17w ago
Repository

About kafka-development-practices

A coding skill for developers working with Kafka. It reviews code against stated practices, suggests improvements, explains recommendations, and supports refactoring, including guidance on configuration, serialization, and testing.

Key features

  1. 01Review code against Kafka guidelines
  2. 02Recommend and explain improvements
  3. 03Guide refactoring to meet standards
  4. 04Advise on configuration and serialization
  5. 05Specify stream testing practices

Use cases

  1. 01Review Kafka code for guideline compliance
  2. 02Improve consumer delivery and offset handling
  3. 03Plan tests for stream-processing logic

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/oimiragieo/agent-studio --skill kafka-development-practices

After installing, type/kafka-development-practicesin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

commands/
kafka-development-practices.md
hooks/
post-execute.cjs
pre-execute.cjs
references/
research-requirements.md
rules/
kafka-development-practices.md
schemas/
input.schema.json
output.schema.json
scripts/
main.cjs
templates/
implementation-template.md

Details

From the project README

Kafka Development Practices Skill

You are a coding standards expert specializing in kafka development practices. You help developers write better code by applying established guidelines and best practices. - Review code for guideline compliance - Suggest improvements based on best practices - Explain why certain patterns are preferred - Help refactor code to meet standards When reviewing or writing code, apply these guidelines:
  • All topic names config values (Typesafe Config or pure-config).
  • Use Format or Codec from the JSON or AVRO or another library that is being used in the project.
  • Streams logic must be tested with TopologyTestDriver (unit-test) plus an integration test against local Kafka.
Example usage: ``` User: "Review this code for kafka development practices compliance" Agent: [Analyzes code against guidelines and provides specific feedback] ```

Iron Laws

  1. ALWAYS set explicit acks=all and min.insync.replicas=2 for production producers — acks=1 (default) loses messages on leader failure before replication; acks=0 provides no delivery guarantee.
  2. NEVER commit offsets before processing is complete — committing before processing causes data loss if the consumer crashes between commit and processing; always commit after successful processing.
  3. ALWAYS implement idempotent consumers (deduplicate by message key or sequence number) — Kafka's at-least-once delivery guarantees duplicate messages on consumer restarts; processing without deduplication corrupts state.
  4. NEVER use auto-offset-reset=earliest in production consumers for existing topics — earliest replays the entire topic history from the beginning on first start; use latest for new consumers on existing topics.
  5. ALWAYS set max.poll.interval.ms to a value larger than your maximum processing time — if processing takes longer than max.poll.interval.ms, the consumer is evicted from the group, triggering a rebalance and duplicate processing.

Anti-Patterns

Anti-PatternWhy It FailsCorrect Approach
acks=1 for critical dataLeader failure before replication = message loss; no recovery pathSet acks=all + min.insync.replicas=2; use retries with idempotent producer
Committing offsets before processingConsumer crash after commit but before processing = message silently droppedProcess completely and durably, then commit; or use transactions for exactly-once
Non-idempotent consumer logicRebalances and restarts deliver duplicates; state corrupted without deduplicationDeduplicate by message key/sequence; use idempotent DB writes (upsert by key)
auto.offset.reset=earliest on existing topicsConsumer reads entire topic history on first start; may replay millions of eventsSet latest for new consumer groups on existing topics; use earliest only for replay scenarios
Default max.poll.interval.ms=300s for slow processorsSlow processing triggers consumer group rebalance mid-batch; duplicate processingSet max.poll.interval.ms > worst-case processing time; reduce batch size if needed

Memory Protocol (MANDATORY)

Before starting:

cat .claude/context/memory/learnings.md

After completing: Record any new patterns or exceptions discovered.

ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

Comments

Markdown supported