xiaohongshu
xiaohongshu
dbt-transformations
ALWAYS USE when working with dbt models, SQL transformations, tests, snapshots, or macros. Use IMMEDIATELY when editing dbt_project.yml, profiles.yml, or creating SQL models. MUST be loaded before any transform-layer work. Enforces dbt owns SQL principle - never parse, validate, or transform SQL ...
Full skill instructions
This skill enforces project principles:
This skill does NOT prescribe specific SQL patterns or dbt project structures. Instead, it guides you to:
CRITICAL: dbt owns SQL. Never parse, validate, or transform SQL in Python. Let dbt handle all SQL dialect translation and execution.
ALWAYS run this first:
dbt --version
python -c "import dbt.version; print(f'dbt-core {dbt.version.__version__}')"
Critical Questions to Answer:
When to research: If you encounter unfamiliar dbt features or need to validate patterns
Research queries (use WebSearch):
Official documentation: https://docs.getdbt.com
Key documentation sections:
BEFORE creating new dbt resources, search for existing implementations:
# Find dbt project directories
find . -name "dbt_project.yml"
# Find existing models
find . -path "*/models/*.sql" -o -path "*/models/*.py"
# Find existing tests
find . -path "*/tests/*.sql"
# Find macros
find . -path "*/macros/*.sql"
# Check profiles.yml location
echo $DBT_PROFILES_DIR
find . -name "profiles.yml"
Key questions:
Check architecture docs for integration requirements:
/docs/ for CompiledArtifacts contract (dbt paths, profiles)meta)Core concept: dbt projects organize transformations into models, tests, snapshots, seeds, and macros
Research questions:
SDK features to research:
dbt_project.yml: Project configurationprofiles.yml: Connection profiles for compute targetsmodels/staging/, models/marts/analysis-paths, test-paths, macro-pathsCore concept: Models are SELECT statements that create tables/views in the data warehouse
Research questions:
{{ ref('model_name') }}){{ source('source_name', 'table_name') }})SDK features to research:
.sql files with Jinja templating.py files with dbt.ref() and dbt.source(){{ config(materialized='table') }}is_incremental(), incremental strategiesCore concept: Tests assert data quality on models, sources, seeds, and snapshots
Research questions:
SDK features to research:
unique, not_null, accepted_values, relationshipstests/ directorymacros/ with {% test %}severity, error_if, warn_ifCore concept: Snapshots capture Type 2 slowly changing dimensions (historical records)
Research questions:
SDK features to research:
timestamp, checksnapshot_meta_column_names: Customize dbt_valid_from, dbt_valid_tohard_deletes: ignore, invalidate, new_recordCore concept: Sources represent raw tables in external systems
Research questions:
SDK features to research:
sources.yml: Source definitions{{ source('source_name', 'table_name') }}: Referencing sourcesloaded_at_field, freshness checksCore concept: Macros are reusable SQL snippets (Jinja templates)
Research questions:
SDK features to research:
{% macro name(args) %}{{ return() }}: Returning values from macrosadapter.dispatch()dbt_utils, custom packagesCore concept: dbtRunner allows calling dbt commands from Python (for Dagster integration)
Research questions:
SDK features to research:
dbtRunner: Entry point for programmatic invocationdbtRunnerResult: Return object with results and exceptions.invoke(cli_args): Execute dbt commandsCRITICAL: dbt-core does NOT support safe parallel execution in the same process
{{ ref() }}, {{ source() }})meta for governance (classifications)dbt debug to verify connectiondbt compile to verify SQL generationdbt run --select model_name to test modeldbt test to validate data qualitytarget/manifest.json for metadataWhen this skill is invoked, you should:
Verify runtime state (don't assume):
dbt --version
dbt debug # Verify connection to target
Discover existing patterns (don't invent):
find . -name "dbt_project.yml"
find . -path "*/models/*.sql"
Research when uncertain (don't guess):
Validate against architecture (don't assume requirements):
/docs/NEVER parse SQL (dbt owns SQL):
Use these WebSearch queries when encountering specific needs:
Key question: How does CompiledArtifacts generate profiles.yml?
Research areas:
Key question: How are dbt models represented as Dagster assets?
Research areas:
dagster-dbt library usageload_assets_from_dbt_manifest() vs load_assets_from_dbt_project()Key question: How do dbt models write to Iceberg tables?
Research areas:
Key question: How should classifications be tagged in dbt models?
Research areas:
# Install dbt with adapter
pip install dbt-core dbt-duckdb
# Verify installation
dbt --version
# Initialize project (if needed)
dbt init my_project
# Verify connection
dbt debug
# Compile models (generate SQL)
dbt compile
# Run models
dbt run
# Run specific model
dbt run --select my_model
# Test data quality
dbt test
# Generate documentation
dbt docs generate
dbt docs serve # View at localhost:8080
from dbt.cli.main import dbtRunner, dbtRunnerResult
# Initialize runner
dbt = dbtRunner()
# Run dbt command
cli_args = ["run", "--select", "tag:daily"]
res: dbtRunnerResult = dbt.invoke(cli_args)
# Check results
if res.success:
for r in res.result:
print(f"{r.node.name}: {r.status}")
else:
print(f"Error: {res.exception}")
Remember: This skill provides research guidance, NOT prescriptive SQL patterns. Always:
dbt run and dbt test before considering completexiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience