staging-layer

Convert raw source tables into standardized dbt staging models with 1:1 mapping.

1|1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/nrakow/ae-skills-dev --skill staging-layer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: staging-layer
Source: https://github.com/nrakow/ae-skills-dev/tree/main/skills/staging-layer
Command: npx skills add https://github.com/nrakow/ae-skills-dev --skill staging-layer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build dbt staging models that convert raw source data into a clean, consistent staging layer with a 1:1 mapping.

Core Features & Use Cases

  • One staging model per source table with the naming convention stg_<source_name>__<table_name>.
  • Enforce 1:1 source-to-staging mapping and forbid joins or business logic in staging.
  • Read existing sources to avoid duplicates and use schema introspection for column stability.

Quick Start

Create a new staging model by inspecting the raw source with schema-introspect.js and naming it using stg_<source_name>__<table_name>, then run dbt compile and dbt test --select staging to validate.

Frequently Asked Questions about staging-layer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize raw data into dbt staging models?

To standardize raw data into dbt staging models, use schema introspection to inspect source tables and apply strict renaming and casting rules to generate stg_<source_name>__<table_name> SQL files with 1:1 source mapping.

What is the correct dbt staging model naming convention for raw source tables?

The correct dbt staging model naming convention is stg_<source_name>__<table_name>, ensuring a strict 1:1 mapping from each raw source table to its corresponding staging model without joins or business logic.

Can I use schema introspection to generate sources.yml and schema.yml for dbt?

Yes, schema introspection reads existing raw source columns to generate sources.yml and schema.yml outputs. This avoids duplicate source definitions and ensures column stability during dbt staging layer creation.

How do I validate dbt staging models after onboarding new data sources?

Validate dbt staging models after onboarding new data sources by running dbt compile to check SQL generation and dbt test --select staging to enforce data quality and transformation rules on the staging layer.

Should I add joins or business logic in dbt staging models?

No, you should not add joins or business logic in dbt staging models. The staging layer enforces a strict 1:1 source-to-staging mapping to reduce downstream transformation errors by only applying renaming and casting.

Does the staging layer approach work for auditing existing dbt transformations?

Yes, the staging layer approach works for auditing existing transformations by using schema introspection to verify column stability and strict renaming rules against current stg_<source_name>__<table_name> models and sources.yml definitions.