Database Design logo

Database Design

OrganizationPopular
TencentBlueKing
database-design

设计 BK-CI 数据库表、DDL 脚本、索引、分表或数据归档策略时使用。当用户提到表结构、字段设计、索引优化、SQL 脚本命名、分片、归档迁移时优先使用。

Overview

PublisherTencentBlueKing
Repositorybk-ci
Skill namedatabase-design
Stars
2.5K
Forks
524
Bundled files
2
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.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Database Design 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.
  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/TencentBlueKing/bk-ci.git /tmp/bk-ci
mkdir -p .claude/skills
cp -r /tmp/bk-ci/ai/skills/database-design .claude/skills/database-design
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Database Design 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 Database Design 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 Database Design 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.

BK-CI 数据库设计

适用场景

  • 新增或调整表结构
  • 编写 DDL、DML 或增量更新脚本
  • 设计索引、唯一约束、查询路径
  • 评估是否需要分表、归档或冷热分层
  • 审查某个数据模型是否适合当前服务边界

不适用场景

  • 只是写一条临时查询 SQL 排查数据
  • 只是改业务代码,不涉及持久化模型和表结构
  • 需求本质是 API 设计、模块归属或权限模型,不是数据库设计

快速指导

  1. 先确认数据归属到哪个服务。BK-CI 采用微服务拆分,禁止因为方便查询而跨服务共用数据库。
  2. 先决定表的角色,再决定字段和索引:
    • 主实体表:存核心业务状态
    • 关系表:表达多对多或映射关系
    • 汇总表:承载聚合读模型
    • 历史表:承载高频追加或归档数据
  3. 先按查询路径设计索引,不要先堆字段。最常用查询条件、排序字段、唯一约束字段优先进入索引设计。
  4. DDL 变更必须走脚本管理,不要直接在数据库里手工改线上结构。
  5. 变更前先考虑兼容性:
    • 老字段是否仍被旧版本代码读取
    • 新字段是否需要默认值
    • 是否需要分阶段发布
  6. 大表问题优先判断是索引、归档、冷热分层还是分表,不要默认直接分片。
  7. 对 JSON、大文本、状态快照类字段,要明确为什么不能拆表,避免把主表做成“万能存储”。

高信号规则

  • 脚本命名和版本目录要保持统一,详细规则见 reference/1-script-management.md
  • 分表与路由策略的细节见 reference/2-sharding.md
  • 表结构设计要服务于服务边界和查询模式,而不是追求理论上的“最全字段”
  • 能用代码层聚合解决的问题,不优先通过跨服务数据库耦合解决

关键陷阱

  • 只看写入模型,不看读路径,最后索引完全不匹配真实查询
  • 先建“超大宽表”,后续再靠补丁式字段堆积解决一切问题
  • 为了省事直接复用别的服务数据库,导致服务边界失效
  • 把分表当成性能优化默认选项,忽略归档、汇总和冷热拆分
  • 只改 DDL 不评估回滚、兼容和灰度发布路径

延伸阅读

  • 脚本管理:reference/1-script-management.md
  • 分表策略:reference/2-sharding.md
  • 如果需求同时涉及模块归属,先看 00-bkci-global-architecture

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Database Design AI skill do?

设计 BK-CI 数据库表、DDL 脚本、索引、分表或数据归档策略时使用。当用户提到表结构、字段设计、索引优化、SQL 脚本命名、分片、归档迁移时优先使用。

Why use Database Design on TypingMind?

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

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/TencentBlueKing/bk-ci/tree/master/ai/skills/database-design. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Database Design?

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 Database Design?

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

Is the Database Design AI skill free?

It is published on GitHub by TencentBlueKing. Check the repository for licensing terms. 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 👇