/kafka-skills:kafka-consumer-lag [required: environment name] [optional: topic name to filter by]from kafka-skills
Analyzes Kafka consumer group lag using Lenses MCP server, diagnosing causes like throughput bottlenecks, rebalancing, partition skew, and stalled consumers.
Ships in kafka-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Analyses consumer group lag across all groups and diagnoses potential causes. Consumer lag is the most commonly monitored Kafka metric and the first thing engineers check during incidents.
Target environment: $ARGUMENTS
Copy this checklist and track your progress:
Lag Analysis Progress:
- [ ] Step 1: Fetch all consumer groups
- [ ] Step 2: Identify problematic groups
- [ ] Step 3: Diagnose root causes
- [ ] Step 4: Generate report
Use the Lenses MCP list_consumer_groups tool to get all consumer groups with:
For topic-specific analysis, use list_consumer_groups_by_topic to narrow the scope.
Expected output: List of all consumer groups with state, lag and member count.
Validation: If no consumer groups are returned, report this finding and stop - the cluster may have no active consumers.
Flag consumer groups in these categories:
get_topic_partitions)get_dataset_message_metrics to check producer throughput)For each problematic group, determine the likely cause:
max.poll.records, reduce processing time per message, check for synchronous blocking callssession.timeout.ms, reduce max.poll.interval.ms riskUse the Lenses MCP execute_sql tool to sample recent messages from lagging topics:
SELECT * FROM {topic} LIMIT 5
This confirms the topic has active producers and messages are flowing.
User says: "Consumers are falling behind, check the lag"
Actions:
User says: "Check consumer lag for orders.payment.completed"
Actions:
list_consumer_groups_by_topic to get groups consuming from that topicexecute_sql
Result: Focused report on a single topic's consumer groupsUser says: "Find any dead or empty consumer groups"
Actions:
Cause: No consumer groups exist in the environment or permissions are restricted. Solution: Verify consumers are running. Check Lenses agent permissions allow listing consumer groups.
Cause: Consumer group offsets may be stale if the consumer recently stopped.
Solution: Compare lag against partition end offsets from get_topic_partitions. Note when offsets were last committed.
Cause: Topic is empty or has very old messages beyond the query window.
Solution: Use get_dataset_message_metrics to check if the topic has recent throughput. An empty topic with lagging consumers indicates a producer issue.
## Consumer Lag Report
### Environment: {name}
### Critical (immediate action)
| Consumer Group | Topic | Total Lag | State | Diagnosis | Remediation |
|---------------|-------|-----------|-------|-----------|-------------|
| group-name | topic | 50000 | Stable | Throughput bottleneck | Scale consumers |
### Warning (investigate)
| Consumer Group | Topic | Total Lag | State | Diagnosis | Remediation |
|---------------|-------|-----------|-------|-----------|-------------|
### Suggestion (optimise)
| Consumer Group | Topic | Total Lag | State | Diagnosis | Remediation |
|---------------|-------|-----------|-------|-----------|-------------|
### Summary
- X consumer groups analysed
- Y groups with critical lag
- Z groups with warnings
- Stale/empty groups: N
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub lensesio/agentic-engineering-for-apache-kafka --plugin kafka-skills10 skills in this plugin
/kafka-connector-reviewReview Kafka Connect connector configurations for common misconfigurations using the Lenses MCP server. Checks error handling, DLQ setup, converters, transforms, task count and task health. Use when user says "review connectors", "check connector configs", "why is my connector failing" or asks about Kafka Connect configuration. Do NOT use for creating, deploying or controlling connectors./kafka-dlq-reviewReview dead letter queue implementations for completeness using the Lenses MCP server. Checks DLQ topic existence, configuration, monitoring, metadata preservation, retry logic, reprocessing paths and connector DLQ alignment. Use when user says "review dead letter queues", "check DLQ setup", "DLQ audit" or asks about error handling, message failures or reprocessing. Do NOT use for reprocessing DLQ messages or managing consumer offsets./kafka-perf-reviewReview Kafka producer and consumer performance configurations in both the live cluster (via Lenses MCP) and the codebase. Flags un-tuned defaults, anti-patterns and missing best practices. Use when user says "review Kafka performance", "check producer configs", "tune Kafka settings" or asks about throughput, batching or compression. Do NOT use for cluster sizing or capacity planning./kafka-python-clientScaffold a production-ready Python Kafka producer and consumer using `confluent-kafka-python`, with Schema Registry, graceful shutdown, idempotent producer, tests and a complete project layout. Discovers the target topic, partition count and registered JSON Schema directly from the live cluster via any attached Kafka MCP server (Lenses MCP, Confluent's MCP, Aiven's, custom) before asking the user. Use when user says "build a Python Kafka consumer", "scaffold a Kafka client in Python", "add Kafka to my Python service", "consume from `<topic>` in Python" or "write a Kafka producer". Do NOT use for Kafka Connect connectors, schema-evolution reviews or non-Python clients./kafka-schema-reviewReview Kafka schema changes (Avro, Protobuf, JSON Schema) for compatibility and evolution best practices using the Lenses MCP server. Detects breaking changes, missing defaults, schema drift and naming issues. Use when user says "review schema changes", "check schema compatibility", "will this schema break consumers" or asks about schema evolution. Do NOT use for creating new schemas from scratch or registering them in the cluster./kafka-security-auditAudit Kafka security configuration across the codebase and live cluster using the Lenses MCP server. Checks authentication (SASL), encryption (SSL/TLS), authorisation (ACLs), secrets management and environment tier mismatches. Use when user says "audit Kafka security", "check security config", "is my cluster secure" or asks about authentication, encryption or credentials. Do NOT use for configuring certificates, creating SASL users or setting up ACLs.Other plugins' skills for the same job