write-querylisted
Install: claude install-skill nota-america/forgecat-agent-profiles
# /write-query - Write Optimized SQL
> If you see unfamiliar placeholders or need to check which tools are connected, see [CONNECTORS.md](../../CONNECTORS.md).
Write a SQL query from a natural language description, optimized for your specific SQL dialect and following best practices.
## Usage
```
/write-query <description of what data you need>
```
## Workflow
### 1. Understand the Request
Parse the user's description to identify:
- **Output columns**: What fields should the result include?
- **Filters**: What conditions limit the data (time ranges, segments, statuses)?
- **Aggregations**: Are there GROUP BY operations, counts, sums, averages?
- **Joins**: Does this require combining multiple tables?
- **Ordering**: How should results be sorted?
- **Limits**: Is there a top-N or sample requirement?
### 2. Determine SQL Dialect
If the user's SQL dialect is not already known, ask which they use:
- **PostgreSQL** (including Aurora, RDS, Supabase, Neon)
- **Snowflake**
- **BigQuery** (Google Cloud)
- **Redshift** (Amazon)
- **Databricks SQL**
- **MySQL** (including Aurora MySQL, PlanetScale)
- **SQL Server** (Microsoft)
- **DuckDB**
- **SQLite**
- **Other** (ask for specifics)
Remember the dialect for future queries in the same session.
### 3. Discover Schema (If Warehouse Connected)
If a data warehouse MCP server is connected:
1. Search for relevant tables based on the user's description
2. Inspect column names, types, and relationships
3. Check for partitioning o