Harness data pipeline

From Intense-Visions/harness-engineering · View interactive version

Harness data pipeline is an AI agent skill from the GitHub repository Intense-Visions/harness-engineering. > Verify ETL/ELT pipeline quality, data contracts, idempotency, and test coverage. Analyzes DAG structure, transformation logic, and data quality checks across dbt, Airflow, Dagster, and Prefect pipel

How to use this skill

Skill file

Harness Data Pipeline

Verify ETL/ELT pipeline quality, data contracts, idempotency, and test coverage. Analyzes DAG structure, transformation logic, and data quality checks across dbt, Airflow, Dagster, and Prefect pipelines.

When to Use

Process

Phase 1: DETECT -- Identify Pipeline Framework and Structure

  1. Resolve project root. Use provided path or cwd.
  1. Detect pipeline framework. Scan for framework indicators:
  1. Map DAG structure. For the detected framework:
  1. Identify data sources and sinks. Catalog:
  1. Detect configuration. Read pipeline configuration for:
  1. Report detection summary:

```

Framework: dbt 1.7 + Airflow 2.8

Models: 45 dbt models (12 staging, 18 intermediate, 15 mart)

DAGs: 3 Airflow DAGs (daily-etl, hourly-metrics, weekly-reports)

Sources: 2 PostgreSQL databases, 1 S3 bucket, 1 Stripe API

Sinks: BigQuery (analytics warehouse)

```


Phase 2: ANALYZE -- Evaluate Pipeline Patterns

  1. Check idempotency. For each pipeline/model:
  1. Check error handling. Evaluate:
  1. Check data contracts. Verify schema enforcement:
  1. Check pipeline dependencies. Analyze the DAG for:
  1. Check freshness and SLAs. Evaluate:
  1. Classify findings by severity:

Phase 3: VALIDATE -- Check Data Quality and Test Coverage

  1. Audit existing data tests. For each framework:
  1. Calculate test coverage. Measure:
  1. Check for missing critical tests. Flag models that should have specific tests:
  1. Validate pipeline testability. Assess:
  1. Check for data quality patterns:

Phase 4: DOCUMENT -- Generate Pipeline Documentation

  1. Generate pipeline lineage report. Produce a text-based lineage visualization:

```

source.stripe.payments

-> stg_payments (staging, view)

-> int_payments_enriched (intermediate, table)

-> mart_revenue_daily (mart, incremental)

-> [exposed to: Looker dashboard, finance API]

```

  1. Generate quality check report. Summarize test coverage and findings:

```

Pipeline Quality Report: [PASS/NEEDS_ATTENTION/FAIL]

Models: 45 total

Test coverage: 78% (35/45 models have tests)

Critical gaps: 3 models with zero tests (mart_revenue_daily, stg_users, int_orders)

Data contracts: 12/15 mart models have contracts

Freshness checks: 4/6 sources have freshness monitoring

ERRORS:

[DP-ERR-001] models/marts/mart_revenue_daily.sql

Non-idempotent: uses INSERT without MERGE or DELETE+INSERT pattern

[DP-ERR-002] dags/daily_etl.py

No retry policy: tasks will not retry on transient failures

WARNINGS:

[DP-WARN-001] models/staging/stg_users.sql

Zero tests: no data quality checks on user staging model

[DP-WARN-002] sources.yml

Missing freshness: stripe.payments source has no freshness check

```

  1. Generate missing documentation. For undocumented models:
  1. Produce remediation checklist. Prioritized list of actions:

```

Priority 1 (errors):

[ ] Fix mart_revenue_daily to use MERGE for idempotency

[ ] Add retry policy to daily_etl DAG tasks

Priority 2 (warnings):

[ ] Add not_null and unique tests to stg_users

[ ] Add freshness check to stripe.payments source

Priority 3 (info):

[ ] Add column descriptions to 12 undocumented models

[ ] Document the weekly-reports DAG purpose and schedule

```


Harness Integration

Success Criteria

Examples

Example: dbt Project with BigQuery Warehouse

Phase 1: DETECT
  Framework: dbt 1.7.4 (dbt-bigquery adapter)
  Models: 52 (15 staging, 22 intermediate, 15 mart)
  Sources: 3 (PostgreSQL replica, Stripe API via Fivetran, Google Sheets)
  Target: BigQuery dataset `analytics`

Phase 2: ANALYZE
  [DP-ERR-001] models/marts/mart_subscriptions.sql
    Incremental model missing unique_key -- will create duplicates on re-run
  [DP-WARN-001] 4 sources missing freshness checks
  [DP-WARN-002] No retry configuration in dbt Cloud job settings

Phase 3: VALIDATE
  Test coverage: 71% (37/52 models)
  Critical gaps: mart_revenue (no tests), mart_subscriptions (no uniqueness test)
  Primary key coverage: 80% (missing on 3 intermediate models)

Phase 4: DOCUMENT
  Generated: lineage report for all 52 models
  Generated: schema.yml stubs for 8 undocumented models
  Quality Report: NEEDS_ATTENTION (1 error, 4 warnings)

Example: Airflow DAGs with S3-to-Snowflake Pipeline

Phase 1: DETECT
  Framework: Apache Airflow 2.8.1
  DAGs: 5 (s3_ingest_daily, transform_orders, aggregate_metrics, export_reports, cleanup)
  Sources: S3 buckets (raw-events, partner-feeds), PostgreSQL
  Sinks: Snowflake (ANALYTICS schema), S3 (processed-exports)

Phase 2: ANALYZE
  [DP-ERR-001] dags/s3_ingest_daily.py
    S3KeySensor has no timeout -- will block the scheduler indefinitely
  [DP-ERR-002] dags/transform_orders.py
    PythonOperator writes to Snowflake without transaction -- partial writes on failure
  [DP-WARN-001] dags/cleanup.py
    No SLA defined -- cleanup failures could go unnoticed for days
  [DP-INFO-001] All DAGs use default_args but 2 override retries to 0

Phase 3: VALIDATE
  DAG validation: all 5 parse without errors
  Data validation tasks: present in 3/5 DAGs
  Missing: no validation in s3_ingest_daily (raw data accepted without checks)

Phase 4: DOCUMENT
  Generated: DAG dependency diagram
  Generated: runbook for each DAG with schedule, dependencies, and failure recovery
  Quality Report: FAIL (2 errors requiring immediate attention)

Rationalizations to Reject

| Rationalization | Reality |

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

| "The pipeline failed halfway through — we'll just re-run it and it'll pick up where it left off." | A non-idempotent pipeline that is re-run from the middle writes duplicate records for the portion that succeeded before failure. The correct fix is to make the pipeline idempotent (MERGE, upsert, or delete-then-insert) so re-runs are always safe, not to assume partial re-runs are harmless. |

| "The model has no dbt tests yet, but it's only used in one dashboard — low risk." | Every untested model is a silent data quality failure waiting to reach a stakeholder. Revenue and user-facing models require test coverage regardless of how few consumers they have today. The number of consumers grows; the coverage does not add itself retroactively. |

| "We're still figuring out the schema — we'll add data contracts once the model stabilizes." | Contracts are most valuable during schema evolution, not after it. An unstable schema without a contract lets breaking changes propagate undetected to downstream consumers. Add the contract as the model is defined; update it explicitly as the schema changes. That explicitness is the value. |

| "Circular dependency detection is handled by the orchestrator — I don't need to check for it during design." | Orchestrators detect circular dependencies at runtime, after the DAG has been deployed. Static analysis during design catches them before deployment, before the pipeline fails at 3am, and before engineers have to diagnose a graph cycle under pressure. Detect them early. |

| "The freshness check is too strict — it keeps alerting because the upstream source is occasionally delayed. I'll just remove it." | A freshness check that fires too often has the wrong threshold. Removing it means stale data reaches analysts silently. Adjust the warn_after and error_after thresholds to match the source's actual SLA, and escalate if the source cannot meet its own SLA. |

Gates

Escalation

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.