database-skill

database-skill is a skill for Claude Code, Codex from bytedance/agentkit-samples. It costs 196 tokens per session (3,817 once invoked), scanned A, original, Apache-2.0.

A database assistant for Volcengine and some public databases. It supports metadata inspection, data queries and analysis, health checks, troubleshooting, data quality work, and monitoring across MySQL, PostgreSQL, SQL Server, MongoDB, and Redis.

In plain words
What is it for?
Use it to inspect tables and schemas, query and analyze data, find slow queries or locks, review logs and storage, identify sensitive data, and run health checks.
Why use it?
It brings common database inspection, analysis, and operations work into one guided workflow while requiring approval for risky data changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

About the project

bytedance/agentkit-samples is a collection of examples and tutorials for Volcengine AgentKit, an AI-agent development platform for building, deploying, and operating agent applications. Developers use the samples to learn agent creation, multi-agent collaboration, memory, retrieval, MCP integrations, media generation, customer service, and other workflows. The catalogue skills provide agent workflows based on these examples.

bytedance/agentkit-samples · 446 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/bytedance/agentkit-samples/database-skill
Any agent
npx skills add bytedance/agentkit-samples --skill database-skill
Clone the repo
git clone --depth 1 https://github.com/bytedance/agentkit-samples

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for database-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/bytedance/agentkit-samples/database-skill.svg)](https://agentmods.dev/skills/bytedance/agentkit-samples/database-skill)
Your own site
<a href="https://agentmods.dev/skills/bytedance/agentkit-samples/database-skill"><img src="https://agentmods.dev/badge/skills/bytedance/agentkit-samples/database-skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 196 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,817 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00196 $0.03817
Opus 5 $0.00098 $0.01909
Sonnet 5 $0.00039 $0.00763
Haiku 4.5 $0.00020 $0.00382

Measured 2d ago against content hash 4b0263f31049, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

database-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/database-skill/SKILL.md · 218 lines

How it starts

The opening of the file, as written. The whole thing — 218 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database Skill 核心指令

你是一名专业的数据库智能助手。你的目标是安全、准确、高效地执行数据库相关任务。

帮用户多想一步 — 不只完成任务,更提供专家洞察。结论先行:先说好还是不好,再说为什么。

🔴 核心原则 (必须遵守)

  1. 安全第一: 涉及数据变更 (DML/DDL) 时,必须严格遵循审批流程,严禁直接执行高风险 SQL。
  2. 场景路由: 收到用户请求后,立即根据「场景路由」判断使用哪个场景,并加载对应的参考文件。
  3. 数据诚实: 绝不编造数据,图表不误导。
  4. 必须使用指定工具链:
    • 数据库操作必须通过 toolbox 函数,禁止直接用 pymysql / sqlalchemy 等连接数据库
    • 本地文件分析(CSV / Excel / JSON / Parquet)必须通过 MultiSourceAnalyzer
    • 混合分析(数据库 + 文件)时,先用 query_sql() 获取 DB 数据,再用 MultiSourceAnalyzer 联合分析

行为准则

  1. 自主执行:用户给出了明确任务(如"帮我查一下"、"分析某表"),直接执行,不要停下来反复确认。只在真正缺少必要信息时才询问。
  2. SOP 完整性:按 SOP 排查时,必须尝试所有步骤。某步调用失败或不支持时,明确说明跳过原因,不要默默跳过。
  3. 不支持 ≠ 无结论:函数不支持或返回空数据时,必须给出替代方案或下一步建议,不能只说"不支持"就结束。
  4. 诊断要深入:运维诊断场景,初始查询后应继续深入(如慢查询聚合 → 明细/趋势/优化建议)。
  5. 趋势查询:用户要求"趋势"或"时间维度分析"时,SQL 必须包含时间维度的 GROUP BY(如按天/小时分组)。
  6. 场景切换:用户话题发生实质改变时(如从"分析数据"→"为什么慢"→"加个字段"),必须回到场景路由表重新匹配,读取新场景的全部必读文件。
  7. 产出必须交付:场景路由表的"产出"列是必需的交付物,不是可选的。数据分析必须产出 HTML 报告 + 截图,运维诊断必须给出明确行动建议,不能只返回原始数据就结束。
  8. 运维诊断必须读 SOP:进入运维诊断场景后,必须先读取对应的场景 SOP 文件再开始排查。SOP 包含诊断路径、必看数据和根因知识,禁止跳过 SOP 仅凭经验诊断。
  9. 尊重用户指定的数据库:用户在 prompt 中提到了具体数据库名(如"demo_refund 库"、"skill_test 里"),必须切换到该数据库操作。遇到错误时如实报告,禁止静默切换到其他数据库。

🔑 配置检查

凭证通过 create_client() 初始化时自动加载(优先级:环境变量 > skills/.env 文件)。

⚠️ 严禁直接操作 .env 文件

  • 绝对禁止用 Write / Edit / shell 命令直接读写 .env 文件
  • 绝对禁止通过 shell 命令(如 echo $VOLCENGINE_ACCESS_KEY)检查凭证

正确方式

from toolbox import check_env, update_env, create_client

# 1. 检查凭证状态(不泄露实际值)
result = check_env()
# → {"success": True, "data": {"credentials_ready": True, "configured_keys": [...], "missing_keys": [...]}}

# 2. 若缺少配置,询问用户后安全更新
update_env(VOLCENGINE_ACCESS_KEY="xxx", VOLCENGINE_SECRET_KEY="yyy")

仅当 check_env() 返回 credentials_ready: False 时,才询问用户提供缺失值。

🌏 支持的地域

用户提到地域时,根据下表映射为 RegionId 传给 create_client(region=...)

地域 RegionId
华东2(上海) cn-shanghai
华北2(北京/廊坊) cn-beijing
华南1(广州) cn-guangzhou
中国香港 cn-hongkong
亚太东南(柔佛) ap-southeast-1
亚太东南(雅加达) ap-southeast-3

Read the full file on GitHub · 218 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 218 lines · 196 tokens per session scan A 4b0263f31049

Subscribe to this mod's changes

database-skill is a skill published in the GitHub repository bytedance/agentkit-samples (446 stars, last pushed 2d ago), licensed Apache-2.0. It adds 196 tokens to every session and 3,817 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

yida-db-seq-fix

PostgreSQL Sequence 自动修复工具。检测并修复宜搭环境检测自动建表时 Sequence 起始值问题,避免主键冲突。当用户提到"Sequence"、"主键冲突"、"自增ID错误"、"db-seq-fix"时触发。.

openyida/openyida · 73 tokens

database-postgresql

Apply PostgreSQL standards for migrations, indexing, transactions, and ORM boundaries. Use when editing entities, Prisma schema, migrations, RLS, or query-performance work for PostgreSQL.

HoangNguyen0403/agent-skills-standard · 40 tokens

azure-database-postgresql

Expert knowledge for Azure Database for PostgreSQL development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using flexible server, replicas, PgBouncer/Query Store, vector…

MicrosoftDocs/Agent-Skills · 134 tokens

azure-horizondb

Expert knowledge for Azure Horizondb development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when tuning pgvector, azureai SQL functions, LangChain vector stores, Apache AGE…

MicrosoftDocs/Agent-Skills · 112 tokens

postgresql

Skill "postgresql" from dhaupin/vant, covering postgresql, when to use, what to do, 1. connect and 2. common queries.

dhaupin/vant · 6 tokens

supabase

Skill "supabase" from dhaupin/vant, covering supabase, when to use, what to do, 1. connect and supabase-js.

dhaupin/vant · 6 tokens