Agent skill

Database Inspector

by rongxinzy in rongxinzy/RongxinAI

探索 SQLite 或 PostgreSQL 数据库,执行安全只读查询,提供表列表、详细表结构(列/类型/约束/索引)、数据预览,并生成 Mermaid ER 图。当用户需要查看数据库架构、探索表关系、预览数据、执行只读查询,或提及 schema、ER 图、SQL 查询、数据预览、describe table、数据库探索等关键词时触发。

MITAuto-check passedDatabases

Install Database Inspector

skills CLI
$ npx skills add rongxinzy/RongxinAI --skill database-inspector -a claude-code

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

GitHub CLI
$ gh skill install rongxinzy/RongxinAI database-inspector --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/rongxinzy/RongxinAI.git skills-src && mkdir -p .claude/skills && cp -r skills-src/SKILLs/database-inspector .claude/skills/database-inspector && 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
database-inspector
GitHub stars
154
Token cost
~835 tokens
SKILL.md length
134 words
Files
6 (incl. scripts)
Skills in repo
94
Repo updated
First seen
Licence
MIT

At a glance

探索 SQLite 或 PostgreSQL 数据库,执行安全只读查询,提供表列表、详细表结构(列/类型/约束/索引)、数据预览,并生成 Mermaid ER 图。当用户需要查看数据库架构、探索表关系、预览数据、执行只读查询,或提及 schema、ER 图、SQL 查询、数据预览、describe table、数据库探索等关键词时触发。

  • Tasks that involve Diagrams
  • SKILL.md covers 能力概览, 安全机制, Quick Start and 详细用法, plus 2 more sections
  • Runs Python scripts from its folder; calls python3 and pip
  • Tasks that involve SQL

What it does

Database Inspector is an agent skill from rongxinzy/RongxinAI. 探索 SQLite 或 PostgreSQL 数据库,执行安全只读查询,提供表列表、详细表结构(列/类型/约束/索引)、数据预览,并生成 Mermaid ER 图。当用户需要查看数据库架构、探索表关系、预览数据、执行只读查询,或提及 schema、ER 图、SQL 查询、数据预览、describe table、数据库探索等关键词时触发。

Its SKILL.md is about 840 tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts (for example `scripts/db_explorer.py` and `zhiyuan/metadata.yaml`).

It sits in Databases, covering Diagrams and SQL. It works with PostgreSQL, Mermaid, SQLite and SQL. The repository describes itself as: An all-in-one local AI Agent workspace with a fully self-developed stack. The licence is MIT.

When your agent uses it

  • Tasks that involve Diagrams
  • Tasks that involve SQL

Example prompts

  • “/database-inspector”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit aa2b27b. 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

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • pip

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

  • Network

    No URLs in SKILL.md. Its commands use pip, 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

Database Inspector loads about 835 tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 134 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

The full file from rongxinzy/RongxinAI at commit aa2b27b, republished under its MIT licence (© rongxinzy). 134 words, ~835 tokens.

Download SKILL.mdSave it as .claude/skills/database-inspector/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
database-inspector
description
探索 SQLite 或 PostgreSQL 数据库,执行安全只读查询,提供表列表、详细表结构(列/类型/约束/索引)、数据预览,并生成 Mermaid ER 图。当用户需要查看数据库架构、探索表关系、预览数据、执行只读查询,或提及 schema、ER 图、SQL 查询、数据预览、describe table、数据库探索等关键词时触发。
license
MIT

db-explorer

SQLite / PostgreSQL 数据库只读探索工具 —— 查看表结构、预览数据、生成 ER 图、执行安全查询。

能力概览

功能说明
列出所有表显示数据库中的表和视图,含行数统计
查看表结构列名、类型、约束(PK/FK/NOT NULL)、索引、默认值
数据预览查看表的前 N 行数据
ER 图生成输出 Mermaid erDiagram 语法,可直接渲染
安全只读查询仅允许 SELECT/WITH/EXPLAIN,自动拦截写入操作

安全机制

  • 连接层只读:SQLite 使用 ?mode=ro URI 打开;PostgreSQL 使用 SET SESSION READ ONLY
  • SQL 白名单:仅允许 SELECT / WITH / EXPLAIN / PRAGMA / SHOW 开头
  • 危险关键字拦截:INSERT、UPDATE、DELETE、DROP、ALTER、CREATE 等 30+ 关键字被阻止
  • 多语句拦截:禁止分号分隔的多条 SQL(防止注入)
  • 标识符转义:表名使用双引号转义,防止 SQL 注入

Quick Start

bash
# 列出 SQLite 数据库中的所有表
python3 scripts/db_explorer.py --db-path data.db list-tables

# 查看表结构
python3 scripts/db_explorer.py --db-path data.db describe users

# 预览数据(默认 20 行)
python3 scripts/db_explorer.py --db-path data.db preview orders --limit 10

# 生成 Mermaid ER 图
python3 scripts/db_explorer.py --db-path data.db er-diagram

# 执行只读查询
python3 scripts/db_explorer.py --db-path data.db query "SELECT name, age FROM users WHERE age > 18 LIMIT 10"
PostgreSQL
bash
# 连接 PostgreSQL
python3 scripts/db_explorer.py --db-type postgres --dsn "host=localhost dbname=mydb user=reader" list-tables

# 查看表结构
python3 scripts/db_explorer.py --db-type postgres --dsn "host=localhost dbname=mydb user=reader" describe orders

详细用法

参数说明
参数必填默认值说明
--db-type否sqlite数据库类型:sqlite 或 postgres
--db-pathSQLite 时必填—SQLite 数据库文件路径
--dsnPostgreSQL 时必填—PostgreSQL 连接串
子命令
命令说明示例
list-tables列出所有表/视图list-tables
describe <table>查看表结构详情describe users
preview <table> [--limit N / -n N]预览前 N 行数据preview orders --limit 5
er-diagram生成 Mermaid ER 图er-diagram
query "<sql>"执行只读 SQLquery "SELECT count(*) FROM users"

输出示例

list-tables
json
[
  {"name": "users", "type": "table", "row_count": 1500},
  {"name": "orders", "type": "table", "row_count": 8200},
  {"name": "user_stats", "type": "view", "row_count": 1500}
]
describe
json
{
  "table": "orders",
  "row_count": 8200,
  "columns": [
    {"cid": 0, "name": "id", "type": "INTEGER", "notnull": true, "default": null, "primary_key": true},
    {"cid": 1, "name": "user_id", "type": "INTEGER", "notnull": true, "default": null, "primary_key": false},
    {"cid": 2, "name": "amount", "type": "REAL", "notnull": false, "default": "0.0", "primary_key": false}
  ],
  "foreign_keys": [
    {"from": "user_id", "to_table": "users", "to_column": "id"}
  ],
  "indexes": [
    {"name": "idx_orders_user_id", "unique": false, "columns": ["user_id"]}
  ]
}
er-diagram (Mermaid)
mermaid
erDiagram
    users {
        INTEGER id PK
        TEXT name
        TEXT email
        INTEGER age
    }
    orders {
        INTEGER id PK
        INTEGER user_id FK
        REAL amount
        TEXT created_at
    }
    users ||--o{ orders : "user_id"

依赖

  • Python 3.8+(sqlite3 为内置模块)
  • PostgreSQL 支持需安装:pip install psycopg2-binary

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

Files

SKILL.md and 5 other files (scripts) in SKILLs/database-inspector of rongxinzy/RongxinAI.

  • SKILL.md
  • LICENSE
  • requirements.txt
  • scripts/db_explorer.py
  • zhiyuan/icon.png
  • zhiyuan/metadata.yaml

Open the folder on GitHubat commit aa2b27b

Compare with similar skills

Database Inspector 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.

Database Inspector compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Database Inspector this skillrongxinzy/RongxinAI154—~835Automated safety check: PassMIT
Database Scoutzebbern/claude-code-guide4.7k—~1.1kAutomated safety check: PassMIT
Import ExportAHS12/thoth-blueprint625—~499Automated safety check: PassGPL-3.0
SQL Database Support for pRESTprest/prest4.6k—~1.6kAutomated safety check: PassMIT
Sql2erystemsrx/sql_to_ER188—~1.1kAutomated safety check: PassAGPL-3.0
Squixeduardofuncao/squix273—~784Automated safety check: PassMIT

Similar skills

  • Database Scout

    zebbern/claude-code-guide

    Explore SQLite and PostgreSQL databases: list tables, inspect schemas (columns/types/constraints), preview data, generate Mermaid ER diagrams, and run safe read-only queries.

    4.7k GitHub stars~1.1k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Import Export

    AHS12/thoth-blueprint

    Change SQL, SQLite worker, DBML, JSON, Mermaid, SVG, or database export/import flows while preserving diagram semantics and round trips.

    625 GitHub stars~499 tokensUpdated 1 mo ago
    DatabasesAuto-check passed
  • Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.

    4.6k GitHub stars~1.6k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Sql2er

    ystemsrx/sql_to_ER

    A skill your agent uses when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview…

    188 GitHub stars~1.1k tokensUpdated 9 days ago
    DatabasesAuto-check passed
  • Squix

    eduardofuncao/squix

    Run SQL queries across databases (Postgres, MySQL, SQLite, etc.) via the squix CLI.

    273 GitHub stars~784 tokensUpdated 17 days ago
    DatabasesAuto-check passed
  • Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…

    241 GitHub starsUsed in 2 repos~2.9k tokens
    DatabasesAuto-check passed

More from rongxinzy/RongxinAI

All 94 skills in this repo
  • SaaS Metrics Coach

    rongxinzy/RongxinAI

    SaaS financial health advisor. An agent skill from rongxinzy/RongxinAI.

    154 GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check passed
  • Churn Prevention

    rongxinzy/RongxinAI

    Reduce voluntary and involuntary churn through cancel flow design, save offers, exit surveys, and dunning sequences.

    154 GitHub starsUsed in 3 repos~2.6k tokens
    Auto-check passed
  • Presentation Studio

    rongxinzy/RongxinAI

    The only skill for creating a new PowerPoint deck. An agent skill from rongxinzy/RongxinAI.

    154 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Zhiyuan Expert Manager

    rongxinzy/RongxinAI

    ZhiYuan Agent expert package lifecycle manager for the pi engine.

    154 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Ziwei Doushu

    rongxinzy/RongxinAI

    Professional Ziwei Doushu consultation skill with an offline calculation engine.

    154 GitHub stars~746 tokensUpdated today
    Auto-check passed
  • Lark Mail

    rongxinzy/RongxinAI

    飞书邮箱:Use when user mentions 起草邮件、写邮件、草稿、发送/回复/转发邮件、查阅邮件、看邮件、搜索邮件、邮件文件夹、邮件标签、邮件联系人、监听新邮件、邮件收信规则等;use for mail/email intent only.

    154 GitHub starsUsed in 3 repos~4.1k tokens
    Auto-check: warnings

Categories

Questions about Database Inspector

What does Database Inspector do?

探索 SQLite 或 PostgreSQL 数据库,执行安全只读查询,提供表列表、详细表结构(列/类型/约束/索引)、数据预览,并生成 Mermaid ER 图。当用户需要查看数据库架构、探索表关系、预览数据、执行只读查询,或提及 schema、ER 图、SQL 查询、数据预览、describe table、数据库探索等关键词时触发。. Database Inspector is an agent skill from rongxinzy/RongxinAI.

When should I use Database Inspector?

Database Inspector fits situations like: tasks that involve Diagrams; tasks that involve SQL.

How do I install Database Inspector in Claude Code?

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

How do I install Database Inspector in Codex?

Run `npx skills add rongxinzy/RongxinAI --skill database-inspector -a codex`. Or copy the skill folder (SKILLs/database-inspector in rongxinzy/RongxinAI) into .agents/skills/database-inspector in your project. Codex loads it when a task matches its description.

Can I use Database Inspector 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 rongxinzy/RongxinAI --skill database-inspector -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/database-inspector, .gemini/skills/database-inspector, .github/skills/database-inspector and .opencode/skills/database-inspector in your project.

What does Database Inspector need to run?

Going by SKILL.md and its folder, Database Inspector needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and pip). Our summary lists: Python 3.

Does Database Inspector access the network?

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

Is Database Inspector 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Database Inspector use?

Database Inspector is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Database Inspector use?

About 835 tokens (SKILL.md is roughly 3.3k 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 Database Inspector?

Skills that share tags, products or a category with Database Inspector: Database Scout (zebbern/claude-code-guide, 4.7k stars), Import Export (AHS12/thoth-blueprint, 625 stars), SQL Database Support for pREST (prest/prest, 4.6k stars) and Sql2er (ystemsrx/sql_to_ER, 188 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Database Inspector?

rongxinzy (a GitHub organization) maintains it in rongxinzy/RongxinAI, which has 154 GitHub stars. The repository holds 94 skills in this directory. The repository was last updated on October 9, 2026.

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