write-query

Translate natural-language data needs into dialect-specific SQL for Snowflake, BigQuery, and Postgres.

704|58|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/openyak/desktop --skill write-query-openyak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-query
Source: https://github.com/openyak/desktop/tree/main/backend/app/data/plugins/data/skills/write-query
Command: npx skills add https://github.com/openyak/desktop --skill write-query-openyak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Translate natural-language data needs into optimized SQL across dialects, enabling consistent, high-performance queries without manual dialect tuning.

Core Features & Use Cases

  • Dialect-aware SQL generation that adapts to Snowflake, BigQuery, Postgres, Redshift, and more
  • Support for multi-CTE queries with joins and aggregations
  • Guidance for optimal query structure and performance on large partitioned tables
  • Use cases include translating business questions into SQL, refactoring legacy queries for performance, and generating ready-to-run templates for data teams

Quick Start

Describe your data requirement in natural language and invoke the /write-query command with that description.

Frequently Asked Questions about write-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate optimized SQL from natural language for Snowflake or BigQuery?

Generate optimized SQL by translating natural-language data requirements into dialect-specific syntax for engines like Snowflake, BigQuery, and Postgres. This ensures high-performance, production-ready queries with correct dialect awareness without manual tuning.

What is the best way to write multi-CTE queries with joins and aggregations?

The best way to write multi-CTE queries is to describe your data needs in natural language, which translates the request into structured query designs with joins and aggregations. This produces robust, ready-to-run SQL templates for data teams.

Can I optimize SQL queries for large partitioned tables without manual dialect tuning?

Yes, you can optimize SQL for large partitioned tables without manual tuning. The process provides guidance for optimal query structure and performance, adapting automatically to the specific SQL dialect to ensure efficient data retrieval.

Does this approach support SQL generation for Postgres and Redshift dialects?

Yes, dialect-aware SQL generation supports Postgres, Redshift, BigQuery, and Snowflake. It adapts the syntax to the target engine, ensuring the generated queries are production-ready and syntactically correct for the specified environment.

Why should I use natural language to refactor legacy SQL queries for performance?

Use natural language to refactor legacy SQL queries because it enforces structured query design and dialect awareness. This translates business questions into optimized SQL, replacing inefficient legacy code with high-performance, ready-to-run templates.

What are the limitations of generating SQL from natural language descriptions?

Limitations of generating SQL from natural language include relying entirely on the accuracy of your input description. While it handles multi-CTE queries and partitioned table optimization, complex or ambiguous business logic requires precise natural-language constraints to produce accurate results.