agentleFS
sohaibdevvsohaibdevv/AI-AGENT-SKILLS/skills/data-pipeline-engineering/SKILL.md

data-pipeline-engineering

Skill2 starsChanged 6 months agoMITView on GitHub

Build data pipelines with contracts, lineage, quality gates, and observability

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before building any ETL/ELT pipeline

    line 14
  2. Distinctive:

    When designing data transformations

    line 15
  3. Distinctive:

    When adding a new data source to a pipeline

    line 16
  4. Distinctive:

    When a downstream consumer reports incorrect data

    line 17
  5. Distinctive:

    Before any code: document the contract for every data source:

    line 22
  6. Distinctive:

    Every pipeline run must be idempotent: running it twice on the same input produces the same output.

    line 34
  7. Distinctive:

    After transformation, before writing to the destination:

    line 40
  8. Distinctive:

    Every source eventually sends bad data.

    line 74

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Overview

Data pipelines fail silently. Bad data flows downstream, corrupts reports, poisons ML training sets, and violates compliance requirements - often for days before anyone notices. This skill builds pipelines with the discipline to catch failures at the source.

When to Use

  • Before building any ETL/ELT pipeline
  • When designing data transformations
  • When adding a new data source to a pipeline
  • When a downstream consumer reports incorrect data

Process

Step 1: Define the data contract

Before any code: document the contract for every data source:

  • Schema (columns, types, nullability)
  • Volume expectations (rows per batch/day)
  • Freshness SLA (how old can data be?)
  • Quality invariants (column X is always positive, column Y is always a valid email)

The contract is your test suite specification.

Step 2: Implement contract validation at ingestion

Validate incoming data against the contract as the first step of every pipeline. Fail loudly on schema violations, out-of-range values, and unexpected nulls. Never silently drop bad records without alerting.

Step 3: Design for idempotency

Every pipeline run must be idempotent: running it twice on the same input produces the same output. Implement with: append-only writes + deduplication, or upserts with stable primary keys, or overwrite semantics with explicit partitions.

Step 4: Implement data lineage

Track: where did each record come from? What transformations were applied? When was it processed? This is required for debugging, compliance (GDPR right-to-erasure), and impact analysis.

Step 5: Design the quality gate

After transformation, before writing to the destination:

  • Row count check (within expected range?)
  • Key quality metrics (null rates, uniqueness, referential integrity)
  • Distribution check (not wildly different from yesterday?)
  • Business rule validation (revenue never negative, user_id always set)

Fail the pipeline and alert if quality gates fail.

Step 6: Handle late-arriving and out-of-order data

Define: what is the watermark? How long do you wait for late data? What happens to a record that arrives after the window closes?

Step 7: Design the error handling strategy

For each failure mode:

  • Source unavailable → retry with backoff, alert after N failures
  • Schema change in source → fail loudly, alert, do not silently drop
  • Quality gate failure → fail loudly, quarantine bad data, alert
  • Transform error → log with context, route to dead letter queue, alert

Step 8: Implement observability

Track: records in, records out, records failed, processing latency, source freshness, pipeline run duration. Alert on: any of these metrics going outside normal range.

Step 9: Test the pipeline

  • Unit tests for each transformation
  • Integration tests with representative sample data
  • Tests for the quality gate (does it catch bad data?)
  • Tests for late-arriving data handling
  • Load tests (does it handle 10x volume?)

Step 10: Document the pipeline

For each pipeline: what does it do, what are its inputs, what are its outputs, what are its dependencies, what do you do when it fails? On-call engineers must be able to debug it without the original author.

Anti-Rationalizations

"The source is reliable - we don't need contract validation" Every source eventually sends bad data. The question is whether you catch it.

"Data lineage is a nice-to-have" Data lineage becomes a requirement the first time you need to answer: "which records were affected by this bug?" or "which users' data do we need to delete?"

Verification Requirements

  • Data contracts defined for all sources
  • Contract validation runs at ingestion
  • Pipeline is idempotent
  • Data lineage tracked
  • Quality gates implemented before destination writes
  • Late data strategy defined
  • Error handling routes to dead letter queue with alerts
  • Observability metrics tracked
  • Tests for transformations and quality gates
  • Runbook written

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.