Kafka perf review
Skill lensesio/agentic-engineering-for-apache-kafka/skills/kafka-perf-review
Review 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.From its SKILL.md
npx -y skills add lensesio/agentic-engineering-for-apache-kafka --skill kafka-perf-reviewAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- runs commandsInstructs the agent to run 2 commands, including `Run `check_environment_health` first` and 1 more.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
7.1 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
Kafka Performance Configuration Review
Reviews producer and consumer configurations in both the live cluster and the codebase for performance anti-patterns. These settings are the same across all Kafka client libraries (they're Kafka protocol properties).
Target environment and path: $ARGUMENTS (defaults to src/ for codebase scan if path not specified)
Workflow
Copy this checklist and track your progress:
Performance Review Progress:
- [ ] Step 1: Inspect live cluster configs
- [ ] Step 2: Scan codebase for producer/consumer configs
- [ ] Step 3: Audit producer configs
- [ ] Step 4: Audit consumer configs
- [ ] Step 5: Cross-reference cluster and code configs
- [ ] Step 6: Generate report
- Inspect live cluster configs via Lenses MCP
- Scan codebase for producer/consumer config properties (see
references/producer-defaults.mdandreferences/consumer-defaults.md) - Audit producer configs against recommended values
- Audit consumer configs against recommended values
- Cross-reference cluster and code configs
- Report findings with current values, recommended values and trade-off explanations
Step 1: Live Cluster Inspection
Use Lenses MCP tools to check cluster-side performance configs:
get_topic- topic-level configs affecting performance (min.insync.replicas,compression.type,max.message.bytes)get_topic_broker_configs- broker-level configs (message.max.bytes,replica.fetch.max.bytes,num.io.threads)get_topic_partitions- message distribution across partitions (detect skew where one partition has significantly more bytes than others)get_dataset_message_metrics- message throughput over time to identify bottlenecks or capacity headroom
Expected output: Topic-level performance configs, partition distribution and throughput metrics.
Validation: If MCP calls fail, proceed with codebase-only analysis and note the limitation in the report.
Step 2: Codebase Inspection
Search the codebase for Kafka producer and consumer configuration properties. Consult references/producer-defaults.md for the full list of producer properties and references/consumer-defaults.md for consumer properties.
Also search for anti-patterns listed in references/producer-defaults.md:
- Synchronous produce calls (
.get(),.result(),flush()after every send) - Missing delivery callbacks / error handlers
- Missing graceful shutdown / rebalance listeners
Step 3: Audit Producer Configs
Compare found producer configs against the recommended values in references/producer-defaults.md. Key areas: acks, batch.size, linger.ms, compression.type, enable.idempotence and retries.
Step 4: Audit Consumer Configs
Compare found consumer configs against the recommended values in references/consumer-defaults.md. Key areas: max.poll.records, max.poll.interval.ms, auto.offset.reset, enable.auto.commit and fetch.min.bytes.
Success Criteria
Quantitative
- Triggers on 90% of performance-related queries (test with 10-20 varied phrasings)
- Completes review in under 15 tool calls (MCP + codebase search)
- 0 failed MCP calls per run
Qualitative
- Every finding shows current value, recommended value and trade-off explanation
- Anti-patterns are identified with file and line references
- Estimated throughput impact (low/medium/high) is consistently calibrated
Examples
Example 1: Routine performance review
User says: "Review Kafka performance configs for staging"
Actions:
- Inspect cluster-side configs for all topics in staging
- Scan
src/for producer/consumer property definitions - Cross-reference code configs against reference tables Result: Report with per-property findings and throughput impact estimates
Example 2: Investigating slow consumers
User says: "Why are my consumers slow? Check the performance settings."
Actions:
- Focus on consumer config properties in the codebase
- Check
max.poll.records,fetch.min.bytesandenable.auto.commit - Look for anti-patterns like synchronous processing Result: Targeted report on consumer-side bottlenecks with remediation steps
Example 3: Scoped codebase review
User says: "Check Kafka configs in src/kafka/ for the production environment"
Actions:
- Scan only
src/kafka/for producer and consumer configs - Cross-reference with live production cluster settings Result: Focused report on a specific directory's Kafka configurations
Troubleshooting
No Kafka config properties found in codebase
Cause: The codebase may use a framework or wrapper that hides raw Kafka properties.
Solution: Search for framework-specific config patterns (e.g., Spring Boot application.yml, Django settings). Report the framework used and suggest manual review.
Lenses MCP returns no topic data
Cause: Environment name is incorrect or Lenses agent is offline.
Solution: Run check_environment_health first. Verify the environment name matches what list_environments returns.
Partition skew detection is inconclusive
Cause: Topic has very low throughput so byte counts are similar across partitions. Solution: Note that skew detection requires meaningful throughput. For low-volume topics, skip the skew check and note it in the report.
Output Format
## Performance Review Report
### Cluster-Side Findings
- [topic-name] {property}: {current value}
Recommendation: {recommended value} - {explanation}
### Codebase Findings (Producers)
- [file:line] {property} = {current value}
Recommendation: {recommended value} - {explanation}
### Codebase Findings (Consumers)
- [file:line] {property} = {current value}
Recommendation: {recommended value} - {explanation}
### Anti-Patterns
- [file:line] Description of the anti-pattern
Recommendation: How to fix it
### Summary
- X producer issues found
- Y consumer issues found
- Z anti-patterns found
- Estimated throughput impact: low/medium/high
What ships with it: 3 files
4.7 KB alongside SKILL.md
references/
- consumer-defaults.md1.2 KB
- producer-defaults.md1.4 KB
- test-cases.md2.0 KB
Gives 0 of the 12 instructions most review quality skills give in ~1.3k tokens
Counted across 1,273 of the 2,403 authors here whose files we hold, read 2026-09-06
- Ask one question at a timein 63 of 1273, across 62 files
- Provide a recommended answer for each questionin 47 of 1273, across 45 files
- Rank findings by severityin 44 of 1273
- Use parameterized queries for database accessin 38 of 1273, across 20 files
- Validate all user input with schemasin 33 of 1273, across 15 files
- Store secrets in environment variablesin 32 of 1273, across 14 files
- Explore the codebase to answer questionsin 31 of 1273, across 29 files
- Store tokens in httpOnly cookiesin 30 of 1273, across 12 files
- Implement rate limiting on API endpointsin 30 of 1273, across 12 files
- Sanitize user-provided HTMLin 29 of 1273, across 11 files
- Return generic error messages to usersin 28 of 1273, across 10 files
- Cite file and line for every findingin 28 of 1273, across 25 files
Said here and by no other author read
- Inspect live cluster configurations via Lenses MCP
- Scan codebase for producer and consumer properties
- Audit producer configurations against recommended values
- Cross-reference cluster and code configurations
- Report findings with current and recommended values
- Estimate throughput impact for each finding
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.