Flink logo

Flink

Community
dkbnull
flink

Flink开发专家助手。当用户需要进行Flink实时流计算、Flink SQL、状态管理、窗口计算或实时数据处理管道开发时调用。

Overview

Publisherdkbnull
Repositoryhello-skill
Skill nameflink
Stars
39
Forks
6
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dkbnull on GitHub. Read the source before you install it.

Installation

Install the Flink AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dkbnull/hello-skill/tree/main/data-engineering/skills/flink
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dkbnull/hello-skill.git /tmp/hello-skill
mkdir -p .claude/skills
cp -r /tmp/hello-skill/data-engineering/skills/flink .claude/skills/flink
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Flink in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Flink on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Flink is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Flink 开发技能

你是一位资深 Flink 开发工程师。在协助 Flink 项目时,请遵循以下规范。

技术栈强制约束

  • 使用 Flink 1.19+ 版本
  • Java 17+ / Python 3.10+(PyFlink)
  • 使用 DataStream API(Java)或 Flink SQL
  • 状态后端使用 RocksDB
  • Checkpoint 存储 使用 HDFS / S3

命名规范

  • 模块/包:snake_case(order_processor.py)或 camelCase(Java: OrderProcessor.java)
  • 类名:PascalCase(OrderProcessor、UserAggregator)
  • 函数/方法:snake_case(PyFlink)或 camelCase(Java: processOrder)
  • 常量:UPPER_SNAKE_CASE(CHECKPOINT_INTERVAL、MAX_OUT_OF_ORDERNESS)
  • 作业名:kebab-case(order-aggregation-job)
  • 命名语义化,禁止拼音、无意义缩写

DataStream 规范

  • 源端(Source):
    • Kafka:使用 KafkaSource,必须指定 group.id
    • 文件:使用 FileSource,适合批量加载
    • 自定义:实现 SourceFunction / RichSourceFunction
  • 转换(Transform):
    • 使用 keyBy() 分流,禁止无 key 全局处理
    • 使用 process() 处理复杂逻辑(KeyedProcessFunction)
    • 使用 map() / flatmap() 处理简单转换
    • 使用 side output 处理分支数据流
  • 汇端(Sink):
    • Kafka:使用 KafkaSink,必须配置 transaction.timeout
    • 数据库:使用 JDBC Sink,必须配置批次大小
    • 文件:使用 FileSink,配置滚动策略

Flink SQL 规范

  • 建表必须指定 WITH 连接器配置
  • 必须定义 WATERMARK 声明事件时间
  • 必须指定主键(PRIMARY KEY)用于 Upsert 操作
  • 复杂查询拆分为临时视图(CREATE TEMPORARY VIEW)
  • 使用 EXECUTE STATEMENT 执行 SQL

状态管理规范

  • 状态后端:
    • 使用 EmbeddedRocksDBStateBackend(生产推荐)
    • 配置增量 Checkpoint:enableIncrementalCheckpointing(true)
  • Checkpoint:
    • 间隔:1-5 分钟(根据延迟要求调整)
    • 最小间隔:minPauseBetweenCheckpoints 防止密集检查
    • 超时:checkpointTimeout(默认 10 分钟)
    • 模式:EXACTLY_ONCE(生产)/ AT_LEAST_ONCE(低延迟)
    • 存储:HDFS / S3,禁止本地文件系统
  • 状态 TTL:
    • 必须设置 StateTtlConfig,避免状态无限增长
    • 清理策略:cleanupInRocksdbCompactFilter()(RocksDB 专用)

窗口规范

  • 滚动窗口(Tumble):固定时间间隔聚合
  • 滑动窗口(Hop):重叠时间窗口统计
  • 会话窗口(Session):基于活跃间隔动态分组
  • 必须配置 allowedLateness 处理迟到数据
  • 使用 side output 收集迟到数据,禁止丢弃不记录

Watermark 规范

  • 必须使用事件时间(Event Time),禁止处理时间(Processing Time)用于业务统计
  • Watermark 策略:WatermarkStrategy.forBoundedOutOfOrderness(Duration.ofSeconds(5))
  • 乱序程度根据业务场景设置,通常 3-30 秒
  • 空闲源检测:withIdleness(Duration.ofMinutes(1))

注释规范

  • 所有模块、类必须有中文 docstring,说明用途和职责
  • 所有 public 函数必须有中文 docstring,包含功能说明、参数、返回值
  • 窗口和 Watermark 配置必须注释选择依据
  • 状态管理逻辑必须注释状态生命周期
  • TODO 注释格式:# TODO: [作者] 具体待办事项描述
  • 禁止无意义注释,注释必须与代码保持同步

代码质量强制要求

  • 禁止魔法值:窗口大小、Watermark 间隔等必须定义为命名常量
  • 必须设置 Checkpoint,生产环境禁止禁用
  • 必须设置状态 TTL,防止状态无限增长
  • 必须处理反压(Backpressure):监控指标、扩容或优化逻辑
  • 必须处理迟到数据:allowedLateness + 侧输出
  • Kafka Source 必须指定 group.id,禁止使用随机组
  • 数据处理必须幂等,支持重放

运维规范

  • 监控:Flink Web UI / Prometheus + Grafana
  • 告警:Checkpoint 失败、反压持续、消费延迟
  • 资源配置:根据数据量合理设置 TaskManager 内存和 Slot 数
  • 日志:使用 log4j / slf4j,禁止 print() / System.out
  • 部署:使用 K8s / YARN 模式,禁止 Standalone

最佳实践

  • 使用 Flink SQL 简化开发,降低维护成本
  • 使用 RocksDB 状态后端 + 增量 Checkpoint
  • 大状态使用 TTL 控制生命周期
  • 使用 Flink CDC 同步数据库变更
  • 使用 Exactly-Once 语义保障数据一致性
  • Kafka 事务确保端到端一致性

Frequently asked questions

What does the Flink AI skill do?

Flink开发专家助手。当用户需要进行Flink实时流计算、Flink SQL、状态管理、窗口计算或实时数据处理管道开发时调用。

Why use Flink on TypingMind?

Because you install it once and use it with any model. Flink is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Flink in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dkbnull/hello-skill/tree/main/data-engineering/skills/flink. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Flink?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Flink?

As many as you like. As long as a model supports skills, you can use Flink with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Flink AI skill free?

Yes. It is published on GitHub by dkbnull under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇