Agent skill

Cm Database Engineer

by kingxiaozhe in kingxiaozhe/cm-workflow

数据库工程师 Skill,执行数据模型设计、migration、查询优化,自动适配 ORM 和数据库类型. An agent skill from kingxiaozhe/cm-workflow.

MITAuto-check passedDatabases

Install Cm Database Engineer

skills CLI
$ npx skills add kingxiaozhe/cm-workflow --skill cm-database-engineer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kingxiaozhe/cm-workflow cm-database-engineer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kingxiaozhe/cm-workflow.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cm-database-engineer .claude/skills/cm-database-engineer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cm-database-engineer
GitHub stars
104
Token cost
~417 tokens
SKILL.md length
135 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

数据库工程师 Skill,执行数据模型设计、migration、查询优化,自动适配 ORM 和数据库类型. An agent skill from kingxiaozhe/cm-workflow.

  • Works in 5 steps: 识别技术栈 → 读取上下文 → 开发 → …
  • Tasks that involve ORMs and data access
  • SKILL.md covers 触发条件, 工作流程, 常见坑 and 输出
  • Calls npx

What it does

Cm Database Engineer is an agent skill from kingxiaozhe/cm-workflow. 数据库工程师 Skill,执行数据模型设计、migration、查询优化,自动适配 ORM 和数据库类型

Its SKILL.md is about 420 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering ORMs and data access. The repository describes itself as: Codex-native, spec-driven AI Agent workflow with Claude Code compatibility, independent review, QA, fixes, and refactors. The licence is MIT.

When your agent uses it

  • Tasks that involve ORMs and data access

Example prompts

  • “/cm-database-engineer”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. 识别技术栈
  2. 读取上下文
  3. 开发
  4. 安全检查
  5. 验证

What it can do on your machine

Read from SKILL.md and the folder at commit 82d43f0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cm Database Engineer loads about 417 tokens when it runs. Until then it costs about 18 tokens; SKILL.md has 135 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~18
When it runs · the whole SKILL.md, loaded when a task matches
~417

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from kingxiaozhe/cm-workflow at commit 82d43f0, republished under its MIT licence (© kingxiaozhe). 135 words, ~417 tokens.

Download SKILL.mdSave it as .claude/skills/cm-database-engineer/SKILL.md (or your agent's skills folder).
name
cm-database-engineer
description
数据库工程师 Skill,执行数据模型设计、migration、查询优化,自动适配 ORM 和数据库类型

cm-database-engineer — 数据库工程师

执行数据库相关开发任务。自动识别 ORM/查询工具和数据库类型。

触发条件

由 /cm-ai 自动调用,当 task 涉及数据库开发时触发。

工作流程

1. 识别技术栈

自动检测,不做硬编码假设:

  • ORM/查询工具:Prisma / TypeORM / Drizzle / Knex / Sequelize / SQLAlchemy / GORM / diesel / raw SQL
  • 数据库类型:PostgreSQL / MySQL / SQLite / MongoDB / Redis / DynamoDB
  • Migration 工具:ORM 内置 / Flyway / Alembic / golang-migrate / 自定义
  • 扫描现有 migration 文件了解数据库演进历史和命名规范
2. 读取上下文
  • .claude/rules/database.md、.claude/rules/security.md(如存在)
  • design.md 中的数据模型和接口契约
  • 现有 schema/model 文件
3. 开发

Migration:

  • 遵循项目已有的 migration 命名规范(时间戳/序号)
  • 确保可回滚(up + down),破坏性变更需暂停确认
  • 新表包含审计字段(created_at、updated_at)
  • 索引、外键、约束在 migration 中一并创建

数据模型/Schema:

  • 跟随项目 ORM 的模型定义规范
  • 字段类型精确(enum 不用 string 代替,decimal 不用 float)
  • 关联关系清晰定义

查询层:

  • 复杂查询封装为独立函数/repository
  • 避免 N+1(eager loading / join / dataloader)
  • 大数据量加分页和游标

Seed 数据:

  • 如需开发用测试数据,创建 seed 脚本
4. 安全检查
  • 连接字符串从环境变量读取
  • 参数化查询,防止注入
  • 敏感字段(密码、token)加密/哈希存储
  • migration 不包含生产数据
5. 验证
bash
# 根据项目实际工具执行
npx prisma migrate dev --name xxx    # Prisma
npx knex migrate:latest              # Knex
alembic upgrade head                 # Alembic
  • migration 正常执行
  • 回滚测试
  • 模型类型与 API 契约一致

常见坑

问题处理
Migration 顺序冲突(多人开发)检查最新 migration 时间戳,避免冲突
大表加列/加索引锁表PostgreSQL 用 CONCURRENTLY,MySQL 考虑 pt-online-schema-change
ORM 生成的 SQL 性能差用 EXPLAIN ANALYZE 检查,必要时写 raw query
外键级联删除意外删数据默认用 RESTRICT,只在明确需要时用 CASCADE

输出

  • 创建的 migration 文件和 schema 变更
  • 验证结果
  • 需要其他工种配合的事项

© kingxiaozhe, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/cm-database-engineer of kingxiaozhe/cm-workflow.

Open the folder on GitHubat commit 82d43f0

Compare with similar skills

Cm Database Engineer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cm Database Engineer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cm Database Engineer this skillkingxiaozhe/cm-workflow104—~417Automated safety check: PassMIT
Content Create Hero Imageprisma/web1.1k—~6.9kAutomated safety check: PassNone
Sea Orm 2FlyinPancake/yoink112—~2.9kAutomated safety check: PassApache-2.0
Prisma Client APIcurvenote/curvenote1692 repos~1.6kAutomated safety check: PassMIT
DB Migratesimstudioai/sim30k—~2kAutomated safety check: PassApache-2.0
Specromeerez/orchid-orm543—~2kAutomated safety check: PassMIT

Similar skills

  • Official

    A skill your agent uses when the operator wants a hero or meta image for a Prisma blog post; asks to create or generate a blog hero, cover, social card, Open Graph, or YouTube image; mentions cover…

    1.1k GitHub stars~6.9k tokensUpdated today
    DatabasesAuto-check passed
  • Sea Orm 2

    FlyinPancake/yoink

    Expert guidance for SeaORM 2.0, Rust's async ORM with strongly-typed columns, nested ActiveModels, Entity Loader API, and entity-first workflow.

    112 GitHub stars~2.9k tokensUpdated 3 days ago
    DatabasesAuto-check passed
  • Prisma Client API

    curvenote/curvenote

    Prisma Client API reference covering model queries, filters, operators, and client methods.

    169 GitHub starsUsed in 2 repos~1.6k tokens
    DatabasesAuto-check passed
  • DB Migrate

    simstudioai/sim

    Author or review a Drizzle DB migration for zero-downtime safety — expand/contract phasing, backward-compatibility with the deployed app version, and writing the -- migration-safe acknowledgment the…

    30k GitHub stars~2k tokensUpdated today
    DatabasesAuto-check passed
  • Spec

    romeerez/orchid-orm

    A skill your agent uses when the user prompts "write spec" or "make spec".

    543 GitHub stars~2k tokensUpdated yesterday
    DatabasesAuto-check passed
  • DB Migrations

    kurealnum/dotfiles

    A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…

    290 GitHub stars~820 tokensUpdated 5 mo ago
    DatabasesAuto-check passed

More from kingxiaozhe/cm-workflow

All 23 skills in this repo
  • Cm Fix

    kingxiaozhe/cm-workflow

    用户说“修复这个可复现 bug”或要求根据失败报告修代码时使用。执行红灯测试、根因定位、最小修复、独立审查和回归;尚未确认的问题先用 cm-test,新功能和架构重设计转交 cm-prd。

    104 GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Cm Idea

    kingxiaozhe/cm-workflow

    用户说“我有个点子”“帮我梳理产品”或需要先聊清目标时使用。通过逐题访谈整理为可交给 cm-prd 的 PRD;已有明确需求文档时改用 cm-prd,不写代码、不拆开发任务。

    104 GitHub starsUsed in 1 repo~419 tokens
    Auto-check passed
  • Cm Refactor

    kingxiaozhe/cm-workflow

    用户明确要求“只整理结构,不改变行为”时使用。执行边界分流、行为判官、分批重构和独立审查;缺陷修复转交 cm-fix,新增或变化的业务行为转交 cm-prd。

    104 GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed
  • Cm Security

    kingxiaozhe/cm-workflow

    用户运行 cm-security,或要求代码安全扫描、漏洞检查、密钥泄露排查、依赖漏洞检查时使用。默认检查当前分支相对主分支及已跟踪未提交修改,结合业务地图复核;--all 检查全部已跟踪文件。只报告问题,不自动修复、安装、升级或发布。安装自检用 cm-check,功能测试与覆盖率用 cm-test。

    104 GitHub starsUsed in 1 repo~744 tokens
    Auto-check passed
  • Cm AI

    kingxiaozhe/cm-workflow

    用户明确说“规格已确认,开始实现”或要求按已审批 CM specs 开发时使用。新任务默认由 JS workflow 驱动 N1-N8,完成开发、独立审查、QA 与文档同步;模糊点子、未审规格和单独一句“继续”不能触发编码批准。

    104 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Cm Check

    kingxiaozhe/cm-workflow

    用户说“检查工作流是否安装正确”“为什么找不到 cm 命令”时使用。默认查询 npm 稳定版,有新版自动升级已管理的 CM 安装,再检查插件、核心 Skills、兼容包装与模板引用;不测试或修改业务代码。

    104 GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Categories

Questions about Cm Database Engineer

What does Cm Database Engineer do?

数据库工程师 Skill,执行数据模型设计、migration、查询优化,自动适配 ORM 和数据库类型. An agent skill from kingxiaozhe/cm-workflow. Cm Database Engineer is an agent skill from kingxiaozhe/cm-workflow.

When should I use Cm Database Engineer?

Cm Database Engineer fits situations like: tasks that involve ORMs and data access.

How do I install Cm Database Engineer in Claude Code?

Run `npx skills add kingxiaozhe/cm-workflow --skill cm-database-engineer -a claude-code`. Or copy the skill folder (skills/cm-database-engineer in kingxiaozhe/cm-workflow) into .claude/skills/cm-database-engineer in your project. Claude Code loads it when a task matches its description.

How do I install Cm Database Engineer in Codex?

Run `npx skills add kingxiaozhe/cm-workflow --skill cm-database-engineer -a codex`. Or copy the skill folder (skills/cm-database-engineer in kingxiaozhe/cm-workflow) into .agents/skills/cm-database-engineer in your project. Codex loads it when a task matches its description.

Can I use Cm Database Engineer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kingxiaozhe/cm-workflow --skill cm-database-engineer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cm-database-engineer, .gemini/skills/cm-database-engineer, .github/skills/cm-database-engineer and .opencode/skills/cm-database-engineer in your project.

What does Cm Database Engineer need to run?

Going by SKILL.md and its folder, Cm Database Engineer needs the command-line tools its instructions call (npx). Our summary lists: Node.js.

Does Cm Database Engineer access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Cm Database Engineer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cm Database Engineer use?

Cm Database Engineer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cm Database Engineer use?

About 417 tokens (SKILL.md is roughly 1.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cm Database Engineer?

Skills that share tags, products or a category with Cm Database Engineer: Content Create Hero Image (prisma/web, 1.1k stars), Sea Orm 2 (FlyinPancake/yoink, 112 stars), Prisma Client API (curvenote/curvenote, 169 stars) and DB Migrate (simstudioai/sim, 30k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cm Database Engineer?

kingxiaozhe (a GitHub user) maintains it in kingxiaozhe/cm-workflow, which has 104 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on October 8, 2026.

Source: kingxiaozhe/cm-workflow on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.