Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

dbt-test-gen

БесплатноБез исполняемых скриптовНе проверен

Generate dbt tests (seeds, schema tests, singular assertions) for ETL-to-Snowflake ETL dbt sub-projects. Scoped to dbt projects assigned to the current phase…

sfc-gh-dflippoот sfc-gh-dflippo★ 35 звёзд на GitHub

Об этом скилле

dbt Test Generator

Generate and run semantic test cases for dbt project models based on the original dataflow logic in the source definition file. Tests are generated BEFORE fixes are applied, serving as an independent oracle derived from the source-of-truth (the source definition file). All generated test artifacts are stored in <UNIT>/stabilization/tests/dbt/ to keep the original dbt project clean.

Autonomous mode: When spawned as a team agent, skip all interactive stopping points, make reasonable defaults for user-facing decisions, and document assumptions in the completion report. When done, send a send_message to main summarizing your results, and respond to any shutdown_request with send_message using type: "shutdown_response" and approve: true.

Main Mode (interactive / standalone use)

Tests follow the Arrange-Act-Assert (AAA) pattern: Arrange (dbt seeds), Act (build models), Assert (singular and schema tests). Tests are generated BEFORE fixes, derived from the source definition file — not the dbt model SQL.

Scope Filtering

Concurrent execution note: You may be spawned concurrently with other agents targeting different dbt projects in the same package. Each agent operates on its own project — do not access or modify files belonging to other dbt projects. Writing test/fix artifacts for another agent's project (even to be helpful) breaks that project's own validator lookup and causes a false missing-artifact failure at phase completion.

Read ROADMAP.md for current phase (authored by stabilization with package-specific reasoning). Process only the dbt project(s) assigned to this phase.

Input

This sub-skill expects:

  • session_status.json -- with source_file_path set, migration_object_path, and dbt projects in status pending or dbt-tested
  • The dbt project folder path (from dbt_projects in session status)
  • The source definition file path (from source_file_path in session status)

Prerequisites

  • dbt-snowflake installed and available on PATH
  • Active Snowflake connection with a warehouse configured in ~/.dbt/profiles.yml
  • The warehouse can use an empty dummy database -- no pre-populated data or tables are required
  • The source definition file must be accessible and readable

Output Location

All generated test artifacts go into the stabilization folder, NOT into the dbt project itself:

<UNIT>/stabilization/tests/dbt/<project_name>/
  seeds/
    <source_name>__<table_name>.csv
    ...
  tests/
    assert_<model_name>_<what>.sql
    ...
  stabilization_test_schema.yml
  stabilization_test_sources.yml
  dbt_project_patch.yml
  test_report.md

Before execution, these files are copied into the dbt project (Phase 4). After execution, only the report persists -- the copied files can be cleaned up or kept for re-runs.

Phase 0: Bootstrap Validation

Before analyzing models, validate that the dbt project's structure and document findings for the dbt-fixer. This phase is READ-ONLY — it identifies and documents blockers but does NOT fix anything. Fixing is exclusively the dbt-fixer's job.

Step 0.1: Validate dbt_project.yml

Read dbt_project.yml and check for:

  • Placeholder values (YOUR_PROJECT_NAME, YOUR_PROFILE_NAME) — note as bootstrap blocker
  • Missing or invalid profile key — note as bootstrap blocker
  • Missing model-paths — use default ["models"]

Step 0.2: Validate Macros

List all .sql files under macros/. For each:

  • Check for obvious syntax errors (unclosed {% macro %} / {% endmacro %} blocks)
  • Check for !!!RESOLVE EWI!!! markers — note as fixable by dbt-fixer

Step 0.3: Attempt dbt parse (quick validation)

dbt parse --project-dir <DBT_PROJECT_PATH> --profiles-dir ~/.dbt 2>&1

If this fails, record the error but DO NOT STOP. The error is documented in the test report and the dbt-fixer will resolve it. Proceed to Phase 1 (source analysis and test file generation do not require dbt parse to succeed).

Step 0.4: Document Bootstrap Status

Record findings in a bootstrap_status section of your test report:

  • Config valid: yes/no
  • Parse result: pass/fail (with error message if fail)
  • Macro issues: list
  • Blockers for dbt-fixer: list (these become fix targets)

Phase 1: Analyze Source Dataflow and dbt Models

Read source and dbt materials in parallel.

Step 1.1: Read the Source Dataflow

Read the source definition file and locate the dataflow task(s) matching the current dbt project. See {PLATFORM_DIR}/{transformation_guide} for source transformation analysis.

For each dataflow task: find DTS:Executable elements with DTS:ExecutableType="Microsoft.Pipeline" matching the dbt project name, extract pipeline component definitions and column definitions, trace data flow using pipeline:path elements.

Step 1.2: Read the dbt Models

  1. Read dbt_project.yml, models/sources.yml (source table definitions)
  2. List all .sql files under models/; for each: identif
Полный SKILL.md на GitHub

Установить dbt-test-gen в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл dbt-test-gen?

Generate dbt tests (seeds, schema tests, singular assertions) for ETL-to-Snowflake ETL dbt sub-projects. Scoped to dbt projects assigned to the current phase. Use when the stabilization skill invokes dbt test generation.

Как установить скилл dbt-test-gen?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл dbt-test-gen запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить dbt-test-gen с