用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/zrt-ai-lab/opencode-skills --skill smart-query命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Use when Codex needs native image generation, editing, or engineered multi-image composition, especially sets, material kits, grids, storyboards, carousels, presentations, panoramas, masked composites, long images, or other deliverables requiring consistent independent assets and deterministic post-processing.
Use when a request asks for a Chinese-first AI video script with shot plans, image prompts, narration, subtitles, or handoff contracts for scene generation, image generation, video assembly, or WeChat draft preparation.
Skill 开发指南。当用户需要创建新 Skill 或更新已有 Skill 时触发,提供标准化模板、目录规范和最佳实践。
基于 SOC 职业分类
正在显示 SKILL.md
| name | smart-query |
| description | 智能数据库查询技能。通过SSH隧道连接线上数据库,支持自然语言转SQL、执行查询、表结构探索。当用户需要查询数据库、问数据、看表结构时使用此技能。 |
通过 SSH 隧道安全连接线上数据库,支持自然语言查询和 SQL 执行。
python .opencode/skills/smart-query/scripts/db_connector.py
python .opencode/skills/smart-query/scripts/query.py "SELECT * FROM table_name LIMIT 10"
python .opencode/skills/smart-query/scripts/query.py "SHOW TABLES"
python .opencode/skills/smart-query/scripts/query.py "DESC table_name"
参数:
-n 50:限制返回行数-f json:JSON格式输出--raw:输出原始结果(含元信息)python .opencode/skills/smart-query/scripts/schema_loader.py
生成 references/schema.md,包含所有表结构信息。
references/schema.md 了解表结构query.py 执行配置文件:config/settings.json
{
"ssh": {
"host": "SSH跳板机地址",
"port": 22,
"username": "用户名",
"password": "密码",
"key_file": null
},
"database": {
"type": "mysql",
"host": "数据库内网地址",
"port": 3306,
"database": "库名",
"username": "数据库用户",
"password": "数据库密码"
}
}
smart-query/ 目录config/settings.json.example 为 settings.jsonpip install paramiko sshtunnel pymysqlconfig/settings.json 包含敏感信息,不要提交到 Gitconfig/settings.json 加入 .gitignorepip install paramiko sshtunnel pymysql
| 脚本 | 用途 |
|---|---|
scripts/db_connector.py | SSH隧道+数据库连接,可单独运行测试连接 |
scripts/query.py | 执行SQL查询,支持表格/JSON输出 |
scripts/schema_loader.py | 加载表结构,生成 schema.md |
| 文档 | 说明 |
|---|---|
references/schema.md | 数据库表结构(运行 schema_loader.py 生成) |