agentleFS
agentsdanceagentsdance/agentskills/skills/etl-pipeline-builder/SKILL.md

etl-pipeline-builder

Skill3 starsChanged 11 months agoApache-2.0View on GitHub

Build ETL (Extract, Transform, Load) pipelines. Use when the user needs to process data between systems, create data workflows, or automate data transformations.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    Create data pipelines for extracting, transforming, and loading data.

    line 8

≈ “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

ETL Pipeline Builder

Create data pipelines for extracting, transforming, and loading data.

Node.js Pipeline

import { pipeline } from 'stream/promises';
import { createReadStream, createWriteStream } from 'fs';
import { Transform } from 'stream';

// Extract: Read from source
const extract = createReadStream('source.json');

// Transform: Process data
const transform = new Transform({
  objectMode: true,
  transform(chunk, encoding, callback) {
    try {
      const data = JSON.parse(chunk);
      const transformed = {
        id: data.id,
        name: data.name.toUpperCase(),
        processed_at: new Date().toISOString()
      };
      callback(null, JSON.stringify(transformed) + '\n');
    } catch (error) {
      callback(error);
    }
  }
});

// Load: Write to destination
const load = createWriteStream('output.json');

// Run pipeline
await pipeline(extract, transform, load);

Python ETL

import pandas as pd
from sqlalchemy import create_engine

class ETLPipeline:
    def __init__(self, source_config, dest_config):
        self.source_engine = create_engine(source_config)
        self.dest_engine = create_engine(dest_config)

    def extract(self, query):
        """Extract data from source."""
        return pd.read_sql(query, self.source_engine)

    def transform(self, df):
        """Transform the data."""
        # Clean data
        df = df.dropna(subset=['email'])
        df['email'] = df['email'].str.lower()

        # Add computed columns
        df['full_name'] = df['first_name'] + ' ' + df['last_name']

        # Aggregate
        df = df.groupby('region').agg({
            'amount': 'sum',
            'order_id': 'count'
        }).reset_index()

        return df

    def load(self, df, table_name):
        """Load data to destination."""
        df.to_sql(
            table_name,
            self.dest_engine,
            if_exists='replace',
            index=False
        )

    def run(self, query, table_name):
        """Execute the full pipeline."""
        print("Extracting...")
        df = self.extract(query)
        print(f"Extracted {len(df)} rows")

        print("Transforming...")
        df = self.transform(df)
        print(f"Transformed to {len(df)} rows")

        print("Loading...")
        self.load(df, table_name)
        print("Complete!")

Airflow DAG

from airflow import DAG
from airflow.operators.python import PythonOperator
from datetime import datetime

default_args = {
    'owner': 'data-team',
    'retries': 3,
    'retry_delay': timedelta(minutes=5),
}

with DAG(
    'daily_etl',
    default_args=default_args,
    schedule_interval='0 6 * * *',
    start_date=datetime(2024, 1, 1),
) as dag:

    extract_task = PythonOperator(
        task_id='extract',
        python_callable=extract_data
    )

    transform_task = PythonOperator(
        task_id='transform',
        python_callable=transform_data
    )

    load_task = PythonOperator(
        task_id='load',
        python_callable=load_data
    )

    extract_task >> transform_task >> load_task

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.