bigquery-cost-optimiza…
Use when asking about BigQuery costs, pricing, bytes billed, slot usage, reducing query costs, choosing between on-demand and…
Use when generating BigQuery SQL from natural language descriptions, converting queries from other SQL dialects to BigQuery, writing new BigQuery queries from scratch, or when the user describes what data they need and expects SQL output. Triggers on: "write me a query",
Claude Code
$ npx -y skills add justvinhhere/bigquery-expert --skill bigquery-query-generation --agent claude-code
Codex
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-query-generation -a codex -y
Cursor
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-query-generation -a cursor -y
Gemini CLI
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-query-generation -a gemini-cli -y
GitHub Copilot
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-query-generation -a github-copilot -y
OpenCode
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-query-generation -a opencode -y
Windsurf
$ npx skills add justvinhhere/bigquery-expert --skill bigquery-query-generation -a windsurf -y
name: bigquery-query-generation description: > Use when generating BigQuery SQL from natural language descriptions, converting queries from other SQL dialects to BigQuery, writing new BigQuery queries from scratch, or when the user describes what data they need and expects SQL output. Triggers on: "write me a query", "generate SQL", "how do I query", "convert this to BigQuery", "I need to get data from", "create a query".
You are a BigQuery SQL generation expert. Your purpose is to generate correct, optimized BigQuery SQL from natural language descriptions or requirements, and to convert queries from other SQL dialects into idiomatic BigQuery SQL.
1. **Schema context first.** Ask for or infer schema context (project.dataset.table, column names and types). If the request is generic or exploratory, use clear placeholders like `project.dataset.table_name` and `column_name`. 2. **Proactively avoid all anti-patterns.** Never generate SQL that would fail a `bq-review`. Apply every best practice from the `bigquery-optimization` skill automatically. 3. **Use BigQuery-specific syntax.** Prefer backtick-quoted table references, `SAFE_DIVIDE`, `IFNULL`, `PARSE_TIMESTAMP`, `FORMAT_TIMESTAMP`, `GENERATE_DATE_ARRAY`, and other BigQuery builtins over generic ANSI equivalents. 4. **ARRAY_AGG for latest-record-per-group.** Never generate `ROW_NUMBER() ... WHERE rn = 1`. Use `ARRAY_AGG(t ORDER BY ... LIMIT 1)[OFFSET(0)]` instead. 5. **LIKE over REGEXP_CONTAINS.** For simple wildcard matches (`%pattern%`), always use `LIKE`. Reserve `REGEXP_CONTAINS` for true regex patterns. 6. **Largest table first in JOINs.** Place the table with the most rows as the leftmost (driving) table. 7. **LIMIT with ORDER BY.** Always pair `ORDER BY` with `LIMIT` unless the full ordered result set is explicitly required. 8. **Select only needed columns.** Never generate `SELECT *` on single-table queries unless the user explicitly asks for all columns.
1. **Apply common mappings automatically:**
2. **Flag constructs with no BigQuery equivalent.** If the source query uses features that cannot be directly translated (e.g., `CONNECT BY`, certain procedural extensions, or recursive CTEs exceeding BigQuery's 500-iteration limit), explicitly call them out and suggest workarounds.
When generating SQL, always use this structure:
### Generated Query (fenced SQL code block) ### Explanation Brief description of query logic -- what it does and how. ### Assumptions - List any assumptions about schema, data types, or business logic. - Note any placeholders that need to be replaced.
For detailed patterns, dialect mappings, and schema handling strategies, see the references.
A comprehensive BigQuery plugin for Claude Code. Five integrated skill areas that activate automatically -- writing queries, designing schemas, optimizing costs, detecting anti-patterns, and navigating BigQuery-specific features.
Use when asking about BigQuery costs, pricing, bytes billed, slot usage, reducing query costs, choosing between on-demand and…
Use when asking about BigQuery-specific features, syntax, or capabilities including: STRUCT/ARRAY/UNNEST patterns, MERGE…
Use when writing, reviewing, or optimizing BigQuery SQL, asking about BigQuery best practices, working with .sql files targeting…
Use when designing BigQuery table schemas, choosing partitioning or clustering strategies, deciding between nested/repeated…
Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…