Loading...
Loading...
Workflow and best practices for writing Apache Airflow DAGs. Use when the user wants to create a new DAG, write pipeline code, or asks about DAG patterns and conventions. For testing and debugging DAGs, see the testing-dags skill.
npx skill4agent add astronomer/agents authoring-dagsFor testing and debugging DAGs, see the testing-dags skill which covers the full test → debug → fix → retest workflow.
STOP! Before running ANY Airflow-related command, read this.You MUST use MCP tools for ALL Airflow interactions. CLI commands like,astro dev run, or shell commands to read logs are FORBIDDEN.airflow dagsWhy? MCP tools provide structured, reliable output. CLI commands are fragile, produce unstructured text, and often fail silently.
| ❌ DO NOT USE | ✅ USE INSTEAD |
|---|---|
| |
| |
| |
| |
| |
| |
Any | Equivalent MCP tool |
Any | Equivalent MCP tool |
| |
| Read the JSON directly from MCP response |
lsfindcat/usr/local/airflow/...┌─────────────────────────────────────┐
│ 1. DISCOVER │
│ Understand codebase & environment│
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ 2. PLAN │
│ Propose structure, get approval │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ 3. IMPLEMENT │
│ Write DAG following patterns │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ 4. VALIDATE │
│ Check import errors, warnings │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ 5. TEST (with user consent) │
│ Trigger, monitor, check logs │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ 6. ITERATE │
│ Fix issues, re-validate │
└─────────────────────────────────────┘Glob**/dags/**/*.pyReadrequirements.txt| Tool | Purpose |
|---|---|
| What external systems are configured |
| What configuration values exist |
| What operator packages are installed |
| Version constraints and features |
| Existing DAGs and naming conventions |
| Resource pools for concurrency |
list_connectionsget_airflow_versionlist_providersrequirements.txtlist_import_errorsget_dag_details(dag_id="your_dag_id")list_dag_warningsexplore_dag(dag_id="your_dag_id")📘 See the testing-dags skill for comprehensive testing guidance.
trigger_dag_and_wait(dag_id, timeout=300)diagnose_dag_runget_task_logs# Ask user first, then:
trigger_dag_and_wait(dag_id="your_dag_id", timeout=300)list_import_errors| Phase | Tool | Purpose |
|---|---|---|
| Discover | | Available connections |
| Discover | | Configuration values |
| Discover | | Installed operators |
| Discover | | Version info |
| Validate | | Parse errors (check first!) |
| Validate | | Verify DAG config |
| Validate | | Configuration warnings |
| Validate | | Full DAG inspection |
Testing tools — See the testing-dags skill for,trigger_dag_and_wait,diagnose_dag_run, etc.get_task_logs