airflow-dag-patterns
하는 일
이 도구는 Apache Airflow용 자동화 워크플로(DAG라고 부름)를 만드는 데 도움을 줍니다. 작업을 정리하고, 올바르게 실행되도록 하며, 쉽게 관리할 수 있도록 하는 모범 사례를 가르칩니다.
사용하는 경우
- ✓데이터를 옮기거나 처리하는 자동 과정을 만들 때.
- ✓특정 순서로 실행되어야 하는 작업 묶음이 필요할 때.
- ✓정해진 시간에 반복되어야 하는 작업을 설정하는 경우.
스킬 링크
https://github.com/wshobson/agents/blob/main/plugins/data-engineering/skills/airflow-dag-patterns/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“매일 오전 6시에 파일을 내려받고 그다음 처리하는 워크플로를 어떻게 만들 수 있을까요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 도구는 작업, 그 의존성, 중요한 설정을 정의하는 방법을 보여 주는 템플릿과 코드 예시를 제공합니다. 작업을 여러 번 실행해도 문제가 없도록 하는 '멱등성(idempotence)'과, 각 작업이 명확한 결과를 가지도록 하는 '원자성(atomic)' 같은 원칙을 따릅니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Apache Airflow DAG Patterns
Production-ready patterns for Apache Airflow including DAG design, operators, sensors, testing, and deployment strategies.
When to Use This Skill
- Creating data pipeline orchestration with Airflow
- Designing DAG structures and dependencies
- Implementing custom operators and sensors
- Testing Airflow DAGs locally
- Setting up Airflow in production
- Debugging failed DAG runs
Core Concepts
1. DAG Design Principles
| Principle | Description |
|---|---|
| Idempotent | Running twice produces same result |
| Atomic | Tasks succeed or fail completely |
| Incremental | Process only new/changed data |
| Observable | Logs, metrics, alerts at every step |
2. Task Dependencies
# Linear
task1 >> task2 >> task3
# Fan-out
task1 >> [task2, task3, task4]
# Fan-in
[task1, task2, task3] >> task4
# Complex
task1 >> task2 >> task4
task1 >> task3 >> task4
Quick Start
# dags/example_dag.py
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.python import PythonOperator
from airflow.operators.empty import EmptyOperator
default_args = {
'owner': 'data-team',
'depends_on_past': False,
'email_on_failure': True,
'email_on_retry': False,
'retries': 3,
'retry_delay': timedelta(minutes=5),
'retry_exponential_backoff': True,
'max_retry_delay': timedelta(hours=1),
}
with DAG(
dag_id='example_etl',
default_args=default_args,
description='Example ETL pipeline',
schedule='0 6 * * *', # Daily at 6 AM
start_date=datetime(2024, 1, 1),
catchup=False,
tags=['etl', 'example'],
max_active_runs=1,
) as dag:
start = EmptyOperator(task_id='start')
def extract_data(**context):
execution_date = context['ds']
# Extract logic here
return {'records': 1000}
extract = PythonOperator(
task_id='extract',
python_callable=extract_data,
)
end = EmptyOperator(task_id='end')
start >> extract >> end
Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Best Practices
Do's
- Use TaskFlow API - Cleaner code, automatic XCom
- Set timeouts - Prevent zombie tasks
- Use
mode='reschedule'- For sensors, free up workers - Test DAGs - Unit tests and integration tests
- Idempotent tasks - Safe to retry
Don'ts
- Don't use
depends_on_past=True- Creates bottlenecks - Don't hardcode dates - Use
{{ ds }}macros - Don't use global state - Tasks should be stateless
- Don't skip catchup blindly - Understand implications
- Don't put heavy logic in DAG file - Import from modules
자주 묻는 질문
DAG란 무엇인가요?
'Directed Acyclic Graph(방향성 비순환 그래프)'의 약자입니다. 해야 할 작업과 그 순서를 보여 주는 지도로 생각하면 되며, 루프가 없습니다. 즉 시작점으로 되돌아가지 않습니다.
작업이 '멱등성'을 가져야 하는 이유는 무엇인가요?
멱등성은 작업을 여러 번 연속 실행해도 한 번 실행한 것과 같은 결과가 나온다는 뜻입니다. 작업이 실패해 다시 시작해도 최종 결과가 바뀌지 않으므로 신뢰성에 매우 중요합니다.
'연산자(operators)'와 '센서(sensors)'란 무엇인가요?
연산자는 DAG의 기본 구성 요소로, 파이썬 스크립트 실행처럼 수행할 동작을 나타냅니다. 센서는 무언가 일어나기를 기다린 뒤 진행하는 특별한 종류의 연산자입니다(예: 파일이 도착하기를 기다림).
상세 정보
작성자의 원본 설명
Build production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling batch jobs.
repo: wshobson/agents
인기도
- GitHub 스타
- 41k
- 순위
- #6669
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
screen-reader-testing
41k에이전트가 스크린 리더로 웹사이트를 테스트해 접근성을 확인하도록 돕습니다.
wcag-audit-patterns
41k에이전트가 WCAG 지침에 따라 웹사이트의 접근성을 감사하고 문제를 고치도록 돕습니다.
multi-reviewer-patterns
41k에이전트가 병렬 코드 리뷰를 조율하고, 중복된 발견 사항을 정리하며, 보고서를 통합하도록 돕습니다.
parallel-debugging
41k에이전트가 병렬 조사와 근본 원인 분석으로 복잡한 문제를 디버그하도록 돕습니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.