关于 retool-query
retool-query 是用于查询版主 PostgreSQL 数据库的命令行技能,涵盖 Retool 时代的审核表和 xguard-lab 表。它面向排查审核数据的开发者;写入默认受阻,须先取得用户许可再启用。
主要功能
- 01使用 SQL 查询 PostgreSQL
- 02默认仅允许读取
- 03写入前须取得许可
- 04设置超时并输出 JSON
- 05从文件读取 SQL
适用场景
- 01检查 UserNotes 表结构
- 02查找用户的审核备注
- 03排查 Retool 时代的审核数据
- 04经许可添加审核备注
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ civitai/ civitai --skill retool-query安装后在 Claude Code 中输入/retool-query确认已加载。
附带文件.env.examplequery.mjs
详细介绍
Moderator Database Query
查询版主 PostgreSQL 数据库——MODERATOR_DATABASE_URL。自 2026-08-21 整合以来,该数据库仅有一个实例,其中包含 Retool 时代的审核表(UserNotes、UserStrikes、ReToolActions 等)以及 xguard-lab 表。
运行查询
node .claude/skills/retool-query/query.mjs "SELECT * FROM \"UserNotes\" LIMIT 5"
选项
| 标志 | 说明 |
|---|---|
--writable | 允许写入操作(需要用户许可) |
--timeout <s>、-t | 查询超时时间,单位为秒(默认:30) |
--file、-f | 从文件读取查询 |
--json | 以 JSON 格式输出结果 |
--quiet、-q | 精简输出,仅显示结果 |
示例
# List tables
node .claude/skills/retool-query/query.mjs "SELECT tablename FROM pg_tables WHERE schemaname = 'public'"
# View UserNotes schema
node .claude/skills/retool-query/query.mjs "SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_name = 'UserNotes'"
# Look up notes for a user
node .claude/skills/retool-query/query.mjs "SELECT * FROM \"UserNotes\" WHERE \"userId\" = 12345 ORDER BY created_at DESC LIMIT 10"
# JSON output
node .claude/skills/retool-query/query.mjs --json "SELECT * FROM \"UserNotes\" LIMIT 3"
安全功能
- 默认只读:除非使用
--writable标志,否则会阻止写入操作 - 需要明确许可:使用
--writable前,必须征求用户许可 - 超时保护:默认超时时间为 30 秒
适用场景
- 探索
UserNotes表的架构 - 查询特定用户的审核备注
- 撰写新的审核备注(使用
--writable) - 调查 Retool 时代的审核数据
评论
支持 Markdown