Agent skill
sqlmesh
SQLMesh patterns for data transformation with column-level lineage and virtual environments. Use when building data pipelines that need advanced features like automatic DAG inference and efficient incremental processing.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/sqlmesh
SKILL.md
SQLMesh Skill
This skill provides SQLMesh patterns for data transformation.
Project Structure
sqlmesh_project/
├── config.yaml
├── models/
│ ├── staging/
│ │ └── stg_customers.sql
│ └── marts/
│ └── dim_customers.sql
├── macros/
├── seeds/
├── audits/
└── tests/
Model Definition
-- models/staging/stg_customers.sql
MODEL (
name staging.stg_customers,
kind INCREMENTAL_BY_TIME_RANGE (
time_column created_at
),
cron '@daily'
);
SELECT
id AS customer_id,
LOWER(email) AS email,
created_at
FROM raw.customers
WHERE created_at BETWEEN @start_ds AND @end_ds
Model Kinds
| Kind | Use Case |
|---|---|
FULL |
Complete refresh each run |
INCREMENTAL_BY_TIME_RANGE |
Time-based incremental |
INCREMENTAL_BY_UNIQUE_KEY |
Key-based merge |
VIEW |
Virtual table |
SEED |
Static CSV data |
Virtual Environments
# Create a virtual environment for testing
sqlmesh plan dev
# Apply to production
sqlmesh plan prod
Audits
-- audits/no_nulls.sql
AUDIT (
name assert_no_null_customer_id,
model staging.stg_customers
);
SELECT * FROM staging.stg_customers
WHERE customer_id IS NULL
Best Practices
- Use column-level lineage for impact analysis
- Leverage virtual environments for testing
- Define audits for data quality
- Use incremental models for efficiency
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?