Data write query

From frumu-ai/tandem · View interactive version

Data write query is an AI agent skill from the GitHub repository frumu-ai/tandem. Write optimized SQL for your dialect with best practices

How to use this skill

Skill file

Write SQL Queries

If you see unfamiliar placeholders or need to check which tools are connected, please ask about available integrations.

Write a SQL query from a natural language description, optimized for your specific SQL dialect and following best practices.

Usage

You can ask to write a SQL query (e.g., "Write a query to count orders" or "Get the top 10 users").

Arguments

Workflow

1. Understand the Request

Parse the user's description to identify:

2. Determine SQL Dialect

If the user's SQL dialect is not already known, ask which they use:

Remember the dialect for future queries in the same session.

3. Discover Schema (If Warehouse Connected)

If a data warehouse is connected:

  1. Search for relevant tables based on the user's description
  2. Inspect column names, types, and relationships
  3. Check for partitioning or clustering keys that affect performance
  4. Look for pre-built views or materialized views that might simplify the query

4. Write the Query

Follow these best practices:

Structure:

Performance:

Readability:

Dialect-specific optimizations:

5. Present the Query

Provide:

  1. The complete query in a SQL code block with syntax highlighting
  2. Brief explanation of what each CTE or section does
  3. Performance notes if relevant (expected cost, partition usage, potential bottlenecks)
  4. Modification suggestions -- how to adjust for common variations (different time range, different granularity, additional filters)

6. Offer to Execute

If a data warehouse is connected, offer to run the query and analyze the results. If the user wants to run it themselves, the query is ready to copy-paste.

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.