Senior data engineer

From borghei/Claude-Skills · View interactive version

Senior data engineer is an AI agent skill from the GitHub repository borghei/Claude-Skills. Data engineering for batch and streaming pipelines with Airflow, dbt, Spark, and Kafka. Use when designing data architectures, building pipelines, adding data-quality checks, optimizing ETL/ELT, or troubleshooting pipeline failures.

How to use this skill

Skill file

Senior Data Engineer

Generate pipeline configurations (Airflow, Prefect, Dagster), validate data quality with profiling and anomaly detection, and optimize SQL/Spark performance with actionable recommendations.

Core Capabilities

When to Use

Clarify First

Before generating pipelines, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

Quick Start

# Generate an Airflow DAG for incremental PostgreSQL -> Snowflake. Targets Airflow 3 (`airflow.sdk`,
# current 3.4) with import fallbacks for 2.7+; --output creates missing parent folders
python scripts/pipeline_orchestrator.py generate \
  --type airflow --source postgres --destination snowflake \
  --tables orders,customers --mode incremental --schedule "0 5 * * *" --output dags/orders_etl.py

# Validate data against a schema (sample schema and data ship in assets/)
python scripts/data_quality_validator.py validate assets/sample_orders_flawed.csv \
  --schema assets/sample_schema.json --detect-anomalies

# Draft a schema from existing data, then tighten it by hand
python scripts/data_quality_validator.py schema assets/sample_orders_clean.csv --output schema.json

# Review a SQL query (static analysis; read the warehouse's query profile for ground truth)
python scripts/etl_performance_optimizer.py analyze-sql assets/sample_query.sql --warehouse snowflake

Schema file format (--schema): a JSON object with name, version, optional

primary_key (list of columns), row_count_min/row_count_max, and columns, each with

name, type (string, integer, float, boolean, date, datetime, email, uuid),

and optional nullable, unique, min_value, max_value, min_length, max_length,

pattern (regex) and allowed_values. See assets/sample_schema.json. A schema generated

by the schema subcommand only records types and observed ranges, so validating the same

data against it finds nothing by construction; add the real business rules before using it

as a gate. The report's check counts list failed checks, so a clean run shows 0.

Exit codes: 0 ok; 1 validate/contract found error-severity failures, or

pipeline_orchestrator.py validate found issues; 2 bad input (missing file, invalid JSON

or schema). assets/sample_orders_clean.csv validates clean (exit 0);

assets/sample_orders_flawed.csv has a duplicate key, a null and a malformed email, a

negative amount, an unknown status and a bad date (exit 1).

Tools

| Tool | Subcommands | Purpose |

|------|-------------|---------|

| pipeline_orchestrator.py | generate, validate, template | Generate Airflow/Prefect/Dagster pipeline code, validate DAGs |

| data_quality_validator.py | validate, profile, generate-suite, contract, schema | Schema validation, profiling, anomaly detection, Great Expectations |

| etl_performance_optimizer.py | analyze-sql, analyze-spark, optimize-partition, estimate-cost, template | SQL/Spark optimization, partition strategy, cost estimation |

--json is available on data_quality_validator.py validate, profile and contract and on the four etl_performance_optimizer.py analysis subcommands (analyze-sql, analyze-spark, optimize-partition, estimate-cost). pipeline_orchestrator.py has no --json flag: generate and template print pipeline code, and validate always prints its result as JSON. Every subcommand except pipeline_orchestrator.py validate takes --output to write to a file.

References

Load the reference that matches the task — keep this file lean and pull detail on demand:

Scope & Limitations

In Scope:

Out of Scope:

Important Caveats:

Anti-Patterns

Validating Against an Inferred Schema

Mistake: Generating a schema from today's data with schema, then gating tomorrow's loads on it.

Why it happens: It is one command and the first run passes.

Instead: An inferred schema encodes whatever the data already is, including its errors. Add the business rules (keys, allowed values, ranges) by hand and review them with the data owner.

Non-Idempotent Loads

Mistake: Appending each run's rows without a merge key, so retries and backfills duplicate data.

Why it happens: Appends are simpler and work on the happy path.

Instead: Load by partition or MERGE on a business key so re-running any date gives the same result; test by running the same date twice.

Relative Start Dates in DAGs

Mistake: start_date=days_ago(1) or datetime.now() in a DAG.

Why it happens: Older tutorials used it.

Instead: A fixed, timezone-aware start_date with catchup set deliberately. Relative dates shift every parse, break backfills, and the helper is gone in Airflow 3.

Files

| File | Purpose |

|------|---------|

| scripts/pipeline_orchestrator.py | Airflow / Prefect / Dagster code generation and DAG validation |

| scripts/data_quality_validator.py | Schema validation, profiling, anomalies, contracts, schema inference, GE suites |

| scripts/etl_performance_optimizer.py | SQL and Spark analysis, partition strategy, cost estimates |

| assets/sample_schema.json | Schema with keys, types, ranges and allowed values |

| assets/sample_orders_clean.csv | Data that passes the schema (exit 0) |

| assets/sample_orders_flawed.csv | Data with six rule violations (exit 1) |

| assets/sample_query.sql | Query for analyze-sql (SELECT *, function on a filter column, ORDER BY without LIMIT) |

| references/*.md | Worked pipelines, decisions and troubleshooting, architecture, modeling, DataOps |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.