Tdengine logo

Tdengine

Community
dkbnull
tdengine

TDengine开发专家助手。当用户需要进行TDengine时序数据库开发、IoT数据存储、时序查询优化、工业互联网场景或时序数据分析时调用。

Overview

Publisherdkbnull
Repositoryhello-skill
Skill nametdengine
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 Tdengine 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/database/skills/tdengine
  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/database/skills/tdengine .claude/skills/tdengine
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Tdengine 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 Tdengine 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 Tdengine 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.

TDengine 开发技能

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

技术栈强制约束

  • 使用 TDengine 3.x 版本,利用其高性能时序处理能力
  • 使用 RESTful API 或原生连接器连接数据库
  • 使用参数化查询防止 SQL 注入
  • 充分利用超级表 + 子表模型,禁止将时序数据当关系型数据使用

命名规范

  • 数据库名:snake_case(iot_data、monitor_system)
  • 超级表名:st_{业务描述}(st_temperature、st_voltage)
  • 子表名:t_{设备标识}_{超级表名}(t_sensor001_temperature)
  • 标签名:snake_case,与业务语义一致(device_id、location)
  • 列名(数据列):snake_case(temperature、voltage、current_value)
  • 命名语义化,禁止拼音、无意义缩写
  • 标签名与数据列名禁止重复

数据模型规范

  • 超级表设计:
    • 每类采集数据一张超级表,禁止将不同类型数据混在同一超级表
    • 超级表的数据列为时变测量值(温度、电压、压力等)
    • 超级表的标签为静态属性(设备ID、位置、型号等)
    • 标签数量不超过 128 个,数据列数量不超过 4096 个
    • 合理选择标签类型,常用过滤标签建索引(TSMA 或标签索引)
  • 子表创建:
    • 每个采集设备对应一张子表,通过标签区分
    • 子表必须属于某张超级表,禁止创建独立普通表存储时序数据
    • 使用自动建表语句简化子表创建:INSERT INTO t_dev001 USING st_temperature TAGS('dev001', 'beijing') VALUES (...)
    • 子表名应包含设备标识,便于定位和调试
  • 标签设计:
    • 高基数字段(设备ID)必须作为标签,不能作为普通数据列
    • 需要频繁过滤、分组的字段作为标签
    • 不变的属性作为标签,变化的量作为数据列
    • 标签值不宜过大,单个标签值建议不超过 256 字节

SQL 规范

  • 时序查询:
    • 查询必须带时间范围条件,禁止全表扫描:WHERE ts >= '2024-01-01 00:00:00' AND ts < '2024-01-02 00:00:00'
    • 使用 _rowts 伪列获取时间戳
    • 时间条件使用 ts 列(默认时间戳列名)
  • 降采样:
    • 使用 INTERVAL 子句进行降采样:SELECT AVG(temperature) FROM st_temperature INTERVAL(1h)
    • 降采样窗口必须结合时间范围使用,避免无限制聚合
    • 合理选择降采样粒度:秒(s)、分钟(m)、小时(h)、天(d)
  • 窗口查询:
    • 使用 SESSION WINDOW 处理会话窗口
    • 使用 STATE WINDOW 处理状态窗口
    • 使用 EVENT WINDOW 处理事件驱动窗口
    • 窗口查询必须指定时间范围
  • 聚合函数:
    • 优先使用内置聚合函数:AVG、MAX、MIN、SUM、COUNT、STDDEV
    • 使用 TWA 计算时间加权平均
    • 使用 DIFF 计算差值
    • 使用 IRATE / RATE 计算速率
    • 使用 LAST_ROW / FIRST 获取最新/最早值
  • 多表查询:
    • 使用超级表查询自动聚合所有子表数据
    • 按标签过滤:WHERE device_id = 'dev001'
    • 按标签分组:GROUP BY device_id

写入规范

  • 批量写入:
    • 单条写入性能极差,必须使用批量写入
    • 单次批量写入建议 1000 ~ 5000 条记录
    • 使用多线程并发写入提升吞吐
    • 使用自动建表语句(USING 语法)简化写入
  • 协议选择:
    • 高性能场景使用原生连接器(C / Java / Python)
    • 跨平台场景使用 RESTful API
    • 大规模批量导入使用 taosBenchmark 或 taosShell 导入
    • IoT 场景可使用 MQTT / Telegraf 等数据接入方式
  • 写入注意事项:
    • 时间戳精度必须一致,避免混用毫秒和微秒
    • 禁止写入重复时间戳数据(默认覆盖)
    • 写入频率建议不超过每秒每子表 1 条(聚合场景可更高)

注释规范

  • 每个超级表必须有中文 COMMENT
  • 每个标签和数据列必须有中文 COMMENT
  • 复杂时序查询必须添加中文注释说明业务意图
  • 禁止无意义注释

代码质量强制要求

  • 必须使用超级表 + 子表模型,禁止将时序数据存储在普通表
  • 查询必须带时间范围条件,禁止无时间限制的全表扫描
  • 写入必须批量操作,禁止单条循环写入
  • 标签与数据列职责分明,禁止混淆
  • 时间戳精度必须统一,禁止混用

性能优化

  • 查询优化:
    • 充分利用标签过滤,减少扫描子表数量
    • 合理使用 LIMIT 限制结果集大小
    • 降采样查询优先使用 INTERVAL 子句
    • 避免对大量子表进行无过滤的全量聚合
  • 写入优化:
    • 批量写入,单次提交足够多的记录
    • 多连接并发写入,充分利用集群资源
    • 合理设置 maxSQLLength 参数
  • 存储优化:
    • 合理设置数据保留策略(KEEP 参数)
    • 冷热数据分离,历史数据自动过期
    • 使用压缩减少存储空间

运维规范

  • 监控:
    • 使用 TDengine 内置监控数据库(log 库)查看集群状态
    • 关注关键指标:写入速率、查询延迟、磁盘使用率、Vnode 状态
    • 配置告警规则:节点宕机、磁盘告警、写入异常
  • 集群管理:
    • 多副本部署确保高可用,副本数至少 2
    • 使用 taosKeeper 采集监控指标
    • 定期检查数据一致性
  • 备份恢复:
    • 使用 taosdump 工具进行数据导出备份
    • 定期验证备份可恢复性
    • 生产环境按最小权限原则创建应用账号

最佳实践

  • 设备数据模型设计:一类设备一张超级表,一台设备一张子表
  • 使用标签过滤替代数据列过滤,提升查询性能
  • 利用降采样和预计算减少实时查询压力
  • 使用 taosAdapter 统一 RESTful 接入
  • 合理规划 KEEP 和 DURATION 参数管理数据生命周期

Frequently asked questions

What does the Tdengine AI skill do?

TDengine开发专家助手。当用户需要进行TDengine时序数据库开发、IoT数据存储、时序查询优化、工业互联网场景或时序数据分析时调用。

Why use Tdengine on TypingMind?

Because you install it once and use it with any model. Tdengine 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 Tdengine in TypingMind?

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

Which AI models can use Tdengine?

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 Tdengine?

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

Is the Tdengine 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 👇