with one click
sql-query
Write a SQL query aware of the current project's database schema
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Write a SQL query aware of the current project's database schema
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | sql-query |
| description | Write a SQL query aware of the current project's database schema |
Write a SQL query for the current project. Before writing any query, discover the schema from the project.
Look for migrations in these locations (in order, stop when found):
migrations/
packages/db/migrations/
Read the migration files to understand table names, column names, and relationships.
Knex projects: relation/column names in code are camelCase, but actual database column names use underscores. Use the underscore form in SQL (e.g. user_id, not userId).
Rules:
SELECT *LIMIT at the end (default: 100)Ask the user if they want output to a file or printed directly.
query.sql in the current directory