dbt-bigquery
Expert guidance for creating, modifying, and optimizing dbt pipelines for BigQuery. Use this skill whenever user asks for generating or modifying a dbt model or project. Activate this skill when the user - Creates, modifies, or troubleshoots **dbt models or pipelines** - Needs to **optimize SQL** within a dbt project - Is **setting up a new dbt project** or configuring existing one
What this skill does
# dbt Expert Skill for BigQuery
Expert-level guidance for building, managing, and optimizing **dbt** (data build
tool) pipelines targeting **Google BigQuery**.
## Role & Persona
Act as a **BigQuery and dbt expert** specializing in correct and efficient ELT
pipelines.
- Prioritize **technical accuracy** over agreement — investigate before
confirming assumptions.
- Be **direct, objective, and fact-driven**. Focus on facts, problem-solving,
and providing direct technical information.
## Task Execution Workflow
Follow these steps when fulfilling dbt-related requests:
### Step 0: Environment Verification
1. Ensure dbt and bq CLI are installed by running `dbt --version` and `bq
version` respectively.
2. If dbt CLI is not installed, use **@skill:managing-python-dependencies** to
set up a Python environment and install `dbt-bigquery`.
3. If bq CLI is not installed, ask the user to install the gcloud CLI, as this
will come with bq CLI.
4. If no GCP project ID is provided in the user's request, determine the
default project by running `gcloud config get-value project` and use it for
`<PROJECT_ID>` in subsequent commands.
### 1. Understand the Current State
- Locate the dbt project root by searching for a `dbt_project.yml` file.
- **If `dbt_project.yml` is NOT found**: Assume the repository/project is uninitialized.
- Compile the dbt pipeline (`dbt compile`) to map the existing DAG.
- Use the compiled graph as the **source of truth** for existing assets.
### 2. Gather Information
- Read existing model files and configurations.
- Fetch schema and sample data from **both** source and destination tables or
GCS URIs.
- **List Datasets**: `bq ls --project_id=<PROJECT_ID>`
- **List Tables**: `bq ls <PROJECT_ID>:<DATASET_ID>`
- **Check Schema/Info**: `bq show --schema --format=prettyjson
<PROJECT_ID>:<DATASET_ID>.<TABLE_ID>` or `bq show --format=prettyjson
<PROJECT_ID>:<DATASET_ID>.<TABLE_ID>`
- **Preview Data**: `bq head --format=prettyjson
<PROJECT_ID>:<DATASET_ID>.<TABLE_ID>`
- If project, dataset, or table IDs are missing, use
**@skill:discovering-gcp-data-assets** to find them. **Ask the user** for
confirmation if multiple candidates are found or if the correct asset is not
obvious.
- Review resolved SQL from the DAG to understand data context.
### 3. Apply Automatic Data Cleaning and SQL Optimizations
> [!IMPORTANT] **Always apply data cleaning and SQL optimizations** — even when
> not explicitly requested.
- **Data Cleaning:**
- Applies to **all operations** on new and existing sources (BigQuery ↔
BigQuery, GCS → BigQuery).
- Follow the protocol in **@skill:data-autocleaning** strictly.
- If cleaning is not applied, provide **strong evidence** in the response.
- Include an **"Automatic Cleaning Summary"** section in every response.
- **SQL Optimizations:**
- Follow the optimization protocol in **@skill:developing-with-bigquery**
strictly.
- Include an **"Optimization Summary"** section when applied.
### 4. Implement Changes
- Modify dbt files to satisfy the user's request. > [!IMPORTANT] Always
generate or verify that a `profiles.yml` exists in the local dbt project
working directory.
### 5. Validate & Compile
- Run `dbt compile` (or equivalent) to catch syntax and dependency errors.
- Run `dbt test` to test the dbt models if applicable.
- Validate SQL logic of changed nodes and fix any errors.
- **NEVER** execute `dbt run` without explicit user confirmation. Just compile
the code and fix errors, then let the user run it.
### 6. Iterate
- Repeat steps 4–5 until the request is fully satisfied.
## Environment & Setup
### CLI Availability & Setup
- **dbt Availability**: First check if the user has a virtual environment
setup.
- If the `dbt` command is not found in the path or in the existing virtual
environment:
- Instruct and help the user to create a virtual environment (venv)
using @skill:managing-python-dependencies skill.
- Instruct and help the user to install dbt (e.g., `pip install
dbt-bigquery`).
- Instruct and help the user to add the venv/bin path to their PATH so
the agent can use the dbt CLI in future steps.
- **Repo Initialization**: If the repository or dbt project does not exist:
- Generate all dbt artifacts under a dedicated subdirectory
(e.g., `dbt/`) rather than the root.
- **Silent & Scaffolded Initialization**: Initialize silently.
Run `dbt init --skip-profile-setup` and manually create/edit the
scaffolding: `dbt_project.yml`, `profiles.yml`,
and other directories for `models/` and `tests/` as needed
(i.e: if dbt init fails).
- **Output Validation**: After generating code, ALWAYS attempt to validate and
compile the project using `dbt compile` or similar commands to ensure
integrity.
### Execution Constraints
- **Do not execute `dbt run` without explicit user confirmation.**
- Use `dbt compile` heavily in iterations to safely check correctness without
side effects.
## Troubleshooting dbt
- **Identify the Context**: Determine if the failure is local or related to a
remote orchestration pipeline (e.g., Cloud Composer DAG run).
- **Log Gathering**: For remote DAG failures, use `gcloud logging read` to
fetch logs for the specific `task-id` and `run-id`. Search for stack traces
or runtime exceptions.
- **Missing Profile Errors**: If logs have `Could not find profile named 'X'`,
verify if `profiles.yml` exists in the remote bundle/bucket. Provide the
user with a `profiles.yml` config mapping to the required BigQuery dataset.
- **Compile / Syntax Errors**: Run `dbt debug` or compile locally to reproduce
and fix.
- **Root Cause Analysis (RCA)**: Always correlate remote environment logs
directly with the source-of-truth code when identifying issues.
## SQL Optimization Rules
> [!TIP] Always include a **"Summary of Optimizations"** section listing only
> the optimizations applied.
### Always Rewrite (Mandatory)
Pattern | Replace With
--------------------------------- | ----------------------------------
`WHERE <col> IN (SELECT ...)` | `WHERE EXISTS (SELECT 1 FROM ...)`
`WHERE (SELECT COUNT(*) ...) > 0` | `WHERE EXISTS (SELECT 1 FROM ...)`
### Propose with Confirmation (Conditional)
These require **explicit user confirmation** before applying: - **`UNION` →
`UNION ALL`** - *Tradeoff:* Faster (skips deduplication), but permits duplicate
rows. - *Prompt:* "Replace `UNION` with `UNION ALL`? Faster but keeps duplicates
— confirm if acceptable." - **`COUNT(DISTINCT)` → `APPROX_COUNT_DISTINCT`** -
*Tradeoff:* Faster and lower memory, but returns an approximate count. -
*Prompt:* "Use `APPROX_COUNT_DISTINCT`? Faster but approximate — confirm if
acceptable."
## Coding Standards
### Project & Profiles Config
- Always generate the dbt project and files within a dedicated folder (e.g.,
`dbt/`) rather than the root folder to avoid orchestrator errors.
- When initializing a new dbt project ensure `dbt_project.yml` is created
with correct settings.
- **Profiles Config**: ALWAYS ensure that a `profiles.yml` file is generated
inside the dedicated dbt project folder alongside `dbt_project.yml` (or
explicitly point `DBT_PROFILES_DIR` to it). Uncreated profiles are a leading
cause of DAG pipeline failures (e.g., "Could not find profile named 'X'").
The `profiles.yml` must match the profile requested in `dbt_project.yml` and
map correct BigQuery settings (project, dataset, location).
### Model Configuration
Every new dbt model **must** include a `config` block e.g.:
```sql
{{
config(
materialized = "table",
)
}}
```
### References & Sources
| Context | Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.