Agent skill

Smart Query

by zrt-ai-lab in zrt-ai-lab/opencode-skills

智能数据库查询技能。通过SSH隧道连接线上数据库,支持自然语言转SQL、执行查询、表结构探索。当用户需要查询数据库、问数据、看表结构时使用此技能。

No licenceAuto-check passedDatabases

Install Smart Query

skills CLI
$ npx skills add zrt-ai-lab/opencode-skills --skill smart-query -a claude-code

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

GitHub CLI
$ gh skill install zrt-ai-lab/opencode-skills smart-query --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/zrt-ai-lab/opencode-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/smart-query .claude/skills/smart-query && 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
smart-query
GitHub stars
287
Token cost
~484 tokens
SKILL.md length
95 words
Files
9 (incl. scripts, references, assets)
Skills in repo
26
Repo updated
First seen
Licence
None found

At a glance

智能数据库查询技能。通过SSH隧道连接线上数据库,支持自然语言转SQL、执行查询、表结构探索。当用户需要查询数据库、问数据、看表结构时使用此技能。

  • Works in 3 steps: 测试连接 → 执行SQL查询 → 生成表结构文档
  • Tasks that involve SQL
  • SKILL.md covers 触发场景, 快速使用, 自然语言查询流程 and 配置说明, plus 5 more sections
  • Runs Python scripts from its folder; calls python and pip

What it does

Smart Query is an agent skill from zrt-ai-lab/opencode-skills. 智能数据库查询技能。通过SSH隧道连接线上数据库,支持自然语言转SQL、执行查询、表结构探索。当用户需要查询数据库、问数据、看表结构时使用此技能。

Its SKILL.md is about 480 tokens, which your agent loads only when the skill is triggered. The skill folder holds 12 other files, including scripts, reference files and assets (for example `README.md`, `config/settings.json` and `references/schema.md`).

It sits in Databases, covering SQL. It works with SQL. The repository describes itself as: OpenCode/Claude Code 技能库 。特色技能:视频生成、图片生成、AI Agent 互联、智能问数等等各场景,持续开发更新中.

When your agent uses it

  • Tasks that involve SQL

Example prompts

  • “/smart-query”

Requirements

  • Python 3

Workflow steps

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

  1. 测试连接
  2. 执行SQL查询
  3. 生成表结构文档

What it can do on your machine

Read from SKILL.md and the folder at commit d38536f. 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 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • 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

Smart Query loads about 484 tokens when it runs, and up to ~504 if it reads all its reference files. Until then it costs about 21 tokens; SKILL.md has 95 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~21
When it runs · the whole SKILL.md, loaded when a task matches
~484
With references · SKILL.md plus every file in references/, read only if the agent opens them
~504

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

Without a licence we can't republish the file, so here is its outline and opening line. It has 95 words (~484 tokens).

name
smart-query

Read the full SKILL.md on GitHub

Files

SKILL.md and 8 other files (scripts, references, assets) in smart-query of zrt-ai-lab/opencode-skills.

  • SKILL.md
  • README.md
  • assets/.gitkeep
  • config/settings.json
  • config/settings.json.example
  • references/schema.md
  • scripts/db_connector.py
  • scripts/query.py
  • scripts/schema_loader.py

Open the folder on GitHubat commit d38536f

Compare with similar skills

Smart Query 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.

Smart Query compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Smart Query this skillzrt-ai-lab/opencode-skills287—~484Automated safety check: PassNone
Evolving The Data ModelTriliumNext/Trilium38k—~2.1kAutomated safety check: PassAGPL-3.0
Orchardcore Data MigrationOrchardCMS/OrchardCore8.2k—~1.7kAutomated safety check: PassBSD-3-Clause
SQL Optimization Patternsynulihao/AgentSkillOS61711 repos~3.3kAutomated safety check: PassNone
SQL PortabilityHL7/sql-on-fhir150—~512Automated safety check: PassCustom licence
StmoSAP/project-foxhound1802 repos~1.8kAutomated safety check: PassGPL-3.0

Similar skills

  • Evolving The Data Model

    TriliumNext/Trilium

    A skill your agent uses when adding a DB migration or a new column/field to a Becca entity in Trilium ("add a migration", "new column on notes/attributes", "ALTER TABLE", "add a field to…

    38k GitHub stars~2.1k tokensUpdated today
    DatabasesAuto-check passed
  • Orchardcore Data Migration

    OrchardCMS/OrchardCore

    Creates and updates OrchardCore data migrations (DataMigration classes with CreateAsync/UpdateFromX).

    8.2k GitHub stars~1.7k tokensUpdated today
    DatabasesAuto-check passed
  • SQL Optimization Patterns

    ynulihao/AgentSkillOS

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.

    617 GitHub starsUsed in 11 repos~3.3k tokens
    DatabasesAuto-check passed
  • SQL Portability

    HL7/sql-on-fhir

    Analyse whether a SQL query is portable across database implementations using sqlglot transpilation.

    150 GitHub stars~512 tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Stmo

    SAP/project-foxhound

    Official

    Manage Redash queries and dashboards on Mozilla's STMO (sql.telemetry.mozilla.org) using stmo-cli.

    180 GitHub starsUsed in 2 repos~1.8k tokens
    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 zrt-ai-lab/opencode-skills

All 26 skills in this repo
  • Wechat Publisher

    zrt-ai-lab/opencode-skills

    This skill should be used when preparing Markdown articles for a WeChat Official Account draft box, selecting wenyan-cli themes, processing article images, or troubleshooting authentication and…

    287 GitHub stars~465 tokensUpdated 2 mo ago
    Auto-check passed
  • Codex Image Service

    zrt-ai-lab/opencode-skills

    A skill your agent uses when Codex needs native image generation, editing, or engineered multi-image composition, especially sets, material kits, grids, storyboards, carousels, presentations…

    287 GitHub stars~2k tokensUpdated 2 mo ago
    Auto-check passed
  • Video Creator

    zrt-ai-lab/opencode-skills

    视频创作技能。图片+音频合成视频,支持TTS配音、淡入淡出转场、字幕、片尾、BGM。当用户提到「生成视频」「做视频」「教学视频」「图文转视频」「做视频号」「配音视频」「图文结合视频」「古诗视频」「故事视频」时触发。内含生图→配音→合成全流程,无需单独调用image-service。

    287 GitHub stars~3.3k tokensUpdated 2 mo ago
    Auto-check passed
  • Searchnews

    zrt-ai-lab/opencode-skills

    当用户要求"搜索新闻"、"查询AI新闻"、"整理新闻"、"获取某天的新闻",或提到需要搜索、整理、汇总指定日期的AI行业新闻时,应使用此技能。

    287 GitHub stars~1.8k tokensUpdated 2 mo ago
    Auto-check passed
  • Skill Scanner

    zrt-ai-lab/opencode-skills

    A skill your agent uses when reviewing an agent Skill before sharing, installing, or executing it and when checking a Skill bundle for credentials, dangerous commands, suspicious network behavior…

    287 GitHub stars~317 tokensUpdated 2 mo ago
    Auto-check passed
  • Xhs Note Creator

    zrt-ai-lab/opencode-skills

    小红书笔记素材创作技能。当用户需要创建小红书笔记素材时使用这个技能。技能包含:根据用户的需求和提供的资料,撰写小红书笔记内容(标题+正文),生成图片卡片(封面+正文卡片),以及发布小红书笔记。

    287 GitHub stars~956 tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Smart Query

What does Smart Query do?

智能数据库查询技能。通过SSH隧道连接线上数据库,支持自然语言转SQL、执行查询、表结构探索。当用户需要查询数据库、问数据、看表结构时使用此技能。. Smart Query is an agent skill from zrt-ai-lab/opencode-skills.

When should I use Smart Query?

Smart Query fits situations like: tasks that involve SQL.

How do I install Smart Query in Claude Code?

Run `npx skills add zrt-ai-lab/opencode-skills --skill smart-query -a claude-code`. Or copy the skill folder (smart-query in zrt-ai-lab/opencode-skills) into .claude/skills/smart-query in your project. Claude Code loads it when a task matches its description.

How do I install Smart Query in Codex?

Run `npx skills add zrt-ai-lab/opencode-skills --skill smart-query -a codex`. Or copy the skill folder (smart-query in zrt-ai-lab/opencode-skills) into .agents/skills/smart-query in your project. Codex loads it when a task matches its description.

Can I use Smart Query 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 zrt-ai-lab/opencode-skills --skill smart-query -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/smart-query, .gemini/skills/smart-query, .github/skills/smart-query and .opencode/skills/smart-query in your project.

What does Smart Query need to run?

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

Does Smart Query 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 Smart Query 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 Smart Query use?

No licence was found for Smart Query or its repository. Without one, default copyright applies: ask the author before reusing or redistributing it.

How many tokens does Smart Query use?

About 484 tokens (SKILL.md is roughly 1.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 20 tokens, read only when the agent opens those files.

What are the alternatives to Smart Query?

Skills that share tags, products or a category with Smart Query: Evolving The Data Model (TriliumNext/Trilium, 38k stars), Orchardcore Data Migration (OrchardCMS/OrchardCore, 8.2k stars), SQL Optimization Patterns (ynulihao/AgentSkillOS, 617 stars) and SQL Portability (HL7/sql-on-fhir, 150 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Smart Query?

zrt-ai-lab (a GitHub user) maintains it in zrt-ai-lab/opencode-skills, which has 287 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on July 22, 2026.

Source: zrt-ai-lab/opencode-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.