kafka-design

Helps an Agent design Kafka topics, partitioning and consumer-group strategies, manage schemas, and provides scenario-based usage and deployment guidance. Triggered when designing message queues, event streams, or data pipelines.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "kafka-design" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-af6eccaac826cd6cf7171c45b5e2c463c0b0ed46a26e6f1347e6c69a3a3ff0bc. Verify the upstream source and version against https://skillhub.cn/skills/user_3651d062/kafka-design before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Helps an Agent design Kafka topics, partitioning and consumer-group strategies, manage schemas, and provides scenario-based usage and deployment guidance. Triggered when designing message queues, event streams, or data pipelines.

0 Downloads

Introduction source: third_party · user_3651d062 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: kafka-design
description: 帮助Agent为项目进行Kafka Topic设计、分区策略、消费者组设计、Schema管理,并提供场景化使用指南。当用户需要设计消息队列、事件流、数据管道时触发。
version: 1.0.0
metadata:
  clawdbot:
    emoji: "🪨"
    requires:
      anyBins: ["kafka-topics"]
    os: ["linux", "darwin"]

Kafka 设计与使用助手

触发条件

当用户出现以下意图时激活本 Skill:

  • 设计 Kafka Topic / 分区策略
  • 消费者组设计 / 消费模型
  • Schema 管理 / 序列化方案
  • 消息可靠性 / 幂等 / 事务
  • 事件溯源 / CDC 数据管道
  • "如何设计 xxx 的 Topic"

设计流程(Agent 执行路径)

0. 版本检查 → 加载 references/version-major.md 对比用户版本,识别废弃项和重大变更。同时加载所有 version-X.Y.md(X.Y ≤ 用户目标版本),后续设计过程中 Agent 从已加载的上下文中自主匹配深度特性
1. 需求分析 → 理解消息流、吞吐量、延迟要求、消息大小
2. Topic 设计 → 命名规范、分区数、副本因子、保留策略
3. 消息设计 → Key 策略、序列化格式(Avro/Protobuf/JSON)、Schema Registry
4. 消费者组设计 → 分区分配策略、偏移量管理、重平衡处理
5. 可靠性设计 → ACK 策略、幂等生产者、事务、Exactly-Once
6. 使用指引 → 加载 references/usage-guide.md,给出场景化操作
7. 生产建议 → 加载 references/best-practices.md,给出集群/监控/运维建议
8. 模板参考 → 加载 references/patterns.md,匹配业务消息模型模板

快速参考

Topic 命名铁律

规则 正例 反例
格式:<业务域>.<数据类型>.<事件名> order.checkout.completed order_events
小写+点号分隔 user.profile.updated User.Profile.Updated
事件名用动词过去式 payment.refund.processed payment.refund.request
不带版本号和日期 inventory.stock.changed inventory.v2.stock.changed
不超过 249 字符 — —

分区设计速查

场景 分区策略 Key 设计
有序消费(同实体) 按实体 ID 哈希 user_id 或 order_id
负载均衡 Round-Robin(null key) 不设 Key
多租户隔离 按租户 ID 分区 tenant_id
顺序性+并行 按聚合根 ID aggregate_id
热点规避 复合 Key 或 Salt hot_key + salt(n)

消息语义速查

语义 Producer 配置 Consumer 配置 适用场景
At-Most-Once acks=0 enable.auto.commit=true 日志/指标(允许丢)
At-Least-Once acks=all 先处理后提交 订单/支付(默认)
Exactly-Once transactional.id + acks=all isolation.level=read_committed 金融/转账

生产者关键参数

参数 推荐值 说明
acks all 强一致性;允许丢用 1
compression.type lz4 或 zstd lz4 快/zstd 高压缩率
linger.ms 5-10 微批次,平衡延迟和吞吐
batch.size 16384 (16KB, 默认) 高吞吐场景可调至 65536 (64KB)
max.in.flight.requests.per.connection 5 (幂等时默认 5,可适当调高) 非幂等时设为 1 保序
enable.idempotence true 默认开启,防止重复

消费者关键参数

参数 推荐值 说明
enable.auto.commit false 手动提交,精确控制
auto.offset.reset earliest(新组)/ 显式指定 新消费者组首次启动默认 latest 会跳过存量消息,需根据业务语义明确指定
max.poll.records 500 按消息大小调整
max.poll.interval.ms 300000(5min) 处理超时,需大于业务耗时
session.timeout.ms 45000 心跳超时,影响再平衡速度

渐进式加载

详细内容按需加载 references/:

主题 文件 何时加载
Topic/分区/命名/消息设计规范 references/design-spec.md Step 2-3 Topic 和消息设计
场景化操作(创建/生产/消费/管理Topic/迁移) references/usage-guide.md Step 6 使用指引
最佳实践(分区/可靠性/集群/监控/运维) references/best-practices.md Step 7 生产建议
业务消息模型模板(6类业务完整设计) references/patterns.md Step 8 模板参考
重大版本特性(废弃/依赖变更/新模块) references/version-major.md Step 0 版本检查(模块激活时即加载)
深度版本特性 — 4.x(Share Groups/队列/Streams DLQ/服务端重平衡) references/version-4.0.md Step 0 版本检查时自动加载(版本 ≤ 用户目标版本时)
深度版本特性 — 3.x(KRaft/Tiered Storage/新消费者协议/Connect增强) references/version-3.0.md Step 0 版本检查时自动加载(版本 ≤ 用户目标版本时)

版本参考文档启用规则

  1. 模块激活时 — 始终加载 references/version-major.md,Agent 需主动对比用户使用的 Kafka 版本,若存在废弃项或重大变更,立即提示用户
  2. 深度特性 Step 0 自动加载 — 版本检查时加载所有 version-X.Y.md(X.Y ≤ 用户目标版本)。设计过程中 Agent 从已加载的上下文中自主检索匹配相关特性,用户无需指定版本号
  3. 深度特性按大版本拆分,小版本持续追加 — 如 version-4.0.md 包含该大版本下所有小版本的设计级特性。更新时在文件中新增 ## X.Y.Z 版本节即可,不单开文件

硬规则

  1. 设计规范内容来自权威资料(Apache Kafka 官方文档/Confluent 最佳实践),不编造
  2. 必须明确消息语义(At-Least-Once / Exactly-Once),不同场景不可混用
  3. 分区数必须提前规划,事后只能增加不能减少
  4. 需要顺序的消息必须使用相同 Key 路由到同一分区
  5. 消费者组 ID 必须稳定且有业务含义,不可随机生成
  6. 必须设置保留策略(时间/大小),Topic 不是永久存储
  7. 禁止依赖 ZooKeeper(3.5 起标记弃用,4.0 完全删除。新集群必须使用 KRaft 模式)

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供 Kafka Topic 设计、分区策略、消费者组设计、Schema 管理、消息可靠性设计等完整能力
  • 覆盖多种业务场景(订单、支付、日志、指标等),具有广泛实用价值
Trigger Precision80/100

Areas to improve

  • 触发词覆盖不全 Reported severity: Minor

    触发词覆盖 Kafka 设计相关场景,但缺少部分变体(如“Kafka 架构设计”)

    Recommendation: 补充更多触发词变体,如“Kafka 架构设计”、“消息队列设计”、“事件流设计”等

Highlights

  • 触发词边界清晰,覆盖 Kafka Topic 设计、分区策略、消费者组设计等核心场景
Structure and Standards90/100

Highlights

  • Phase/步骤清晰,有出口条件,含端到端示例
  • frontmatter 完整,单文件 ≤500 行,结构规范
Execution Reliability90/100

Highlights

  • 工具来源明确(Apache Kafka 官方文档/Confluent 最佳实践),参数正确
  • 覆盖主要异常,不可逆操作有确认机制
Evidence Verifiability (mean of the first four)86/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.