hieudoanm/hieudoanm.github.io/apache-airflow
Claude Code and agent skill by hieudoanm/hieudoanm.github.io
- community
Checking that the SKILL.md file is still in the repository.
Best practices for workflow orchestration with Apache Airflow — the DAG/task conventions for scheduled data pipelines. Use when writing, structuring, or reviewing Airflow — covers DAG structure, tasks, dependencies, retries, scheduling, secrets, and CI.
Install
npx vskill@latest install hieudoanm/hieudoanm.github.io/apache-airflowSKILL.md
The same SKILL.md was published earlier as hieudoanm/hieudoanm.github.io/apache-airflow.
Apache Airflow Best Practices
Airflow runs DAGs = DAGs of tasks as code — each task is a Python operator wired by dependencies; the scheduler launches them on schedules. Practical Airflow leans on DAG-as-code with clear task structure (`@task` decorators / TaskGroups), idempotent tasks with retries, scheduling expressed declared (cron/interval with static start_date), and secrets/hooks (Connections & Variables) never inline — "the DAG is a directed specification; each operator is a unit that can rerun alone."
1. DAG Structure
- One DAG per pipeline; graph dependencies expressed, not hidden:
- `schedule` + `catchup` + `start_date` declared (with catchup=False default in modern).
- `TaskGroup` for sub-flows; `@task` dataset freshness vs full DAG.
- Keep DAGs file-light: shared logic in plugins/libs, not re-copied in the DAG file.
2. Tasks & Dependencies
- One responsibility per task; data passed via XCom only in small paths (retries refetch):
- `>>`-chains and `[a, b] >> c` for fan-in/fan-out; branch (`@task.branch`) explicitly.
- Large intermediate state → object storage (S3/DB), not XCom (size limits).
- `DAG.timeout`/`sla` for SLA checks; trigger rules (`all_success`, `one_failed`) explicit where diverging from default.
3. Retries & Idempotency
- Every task idempotent — rerunning a task the same result, no duplicate side effects:
- Retries tuned per operator (network tasks more, pure transforms zero).
- Task-level `retry_*` where the failure is transient; `max_active_runs`/`concurrency` to avoid stampedes.
4. Scheduling & Backfills
- `catchup=False` for daily jobs unless a backfill is intentional; schedule expressed as cron/Preset.
- Backfills run explicitly (`airflow dags backfill`) — never default catch-up on a long-start DAG.
- Timezone/DST: `timezone` set on DAG; cron semantics documented; static `start_date` (not relative).
5. Secrets & Connections
- Connections/Variables via the Airflow metadata (NOT inline):
- Secrets backend (Vault/SSM) for production; never hardcode tokens in the DAG.
- `Connection` (HTTP/Postgres/etc.) used via hooks (`PostgresHook.get_conn()`) — no hand-rolled creds.
6. CI & Testing
- DAG validity CI: `python -c "from airflow.models import DAG; import glob; dag files import"` gate.
- Unit-test tasks with mocked hooks/APIs; run operator locally (`airflow tasks test dag task date`) for golden checks.
- Staging/schedule tests against the same Airflow version (`airflow==x.y.z` pinned in requirements).
- Pipeline changes reviewed as PRs; DAG id + params versioned; deploy via packaged DAGs/hooks.
General Rules of Thumb
- DAG-as-code with `@task`/`TaskGroup`; dependencies explicit.
- Idempotent tasks with tuned retries; XCom for small flows only.
- Schedule declared (`schedule_start/catchup`), static start_date, backfills explicit.
- Secrets via backend/Connections; never inline.
- CI import-gate + mocked task tests; Airflow version pinned.
Quick-Start Checklist
- [ ]
@dagwithschedule/catchup/staticstart_date; one DAG per pipeline - [ ]
@tasksingle-responsibility; explicit dependencies (>>, branches) - [ ] Idempotent tasks; retries tuned; no duplicate side effects on rerun
- [ ] XCom small only; large state in object storage
- [ ] Secrets via Variables/Connections/backend; none inline
- [ ] CI import-gate + task unit tests; version pinned; PR-reviewed changelog
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.skills/programming/languages/python/data/engineer/apache-airflow/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hieudoanm/hieudoanm.github.io/apache-airflow)