用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/scroll-tech/scroll --skill db-query命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | db-query |
| description | Do query from database for common task |
| model | sonnet |
| allowed-tools | Bash(psql *) |
User could like to know about the status of L2 data blocks and proving task, following is their request:
$ARGUMENTS
(If you find there is nothing in the request above, just tell "nothing to do" and stop)
You should have known the data sheme of our database, if not yet, read it from the .sql files under database/migrate/migrations.
According to use's request, generate the corresponding SQL expression and query the database. For example, if user ask "list the assigned chunks", it means "query records from chunk table with proving_status=2 (assigned)", or the SQL expression 'SELECT * from chunk where proving_status=2;'. If it is not clear, you can ask user which col they are indicating to, and list some possible options.
For the generated SQL, following rules MUST be obey:
l2_block tablel1_messagedeleted_at col, never include them in query or use in where conditionupdated_at col, the most recent one first.When you has decided the SQL expression, always print it out.
You use psql client to query from our PostgreSQL db. When launching psql, always with "-w" options, and use "-o" to send all ouput to query_report.txt file under system's temporary dir, like /tmp. You MUST NOT read the generated report.
If the psql failed since authentication, guide user to prepare their .pgpass file under home dir.
You should have known the endpoint of the database before, in the form of PostgreSQL DSN. If not, try to read it from the db.dsn field inside of coordinator/build/bin/conf/config.json. If still not able to get the data, ask via Ask User Question to get the endpoint.