Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
astronomer avatar

Authoring Dags

  • 991 installs
  • 412 repo stars
  • Updated July 27, 2026
  • astronomer/agents

authoring-dags is an Astronomer agent skill that creates production-grade Apache Airflow DAGs following official patterns for developers who need review-ready pipeline code.

About

authoring-dags is an official skill from astronomer/agents that walks developers through writing and validating Apache Airflow DAGs using best practices and the af CLI. The skill activates when users create new DAGs, write pipeline code, or ask about DAG patterns and conventions, and it references the companion testing-dags skill for test-debug-fix-retest workflows. A Stop hook reminds developers to test DAGs with testing-dags after authoring. authoring-dags fits data engineers standardizing task dependencies, operators, and project layout so pipelines pass code review before scheduling. It bridges DAG design and the Astronomer CLI commands needed to validate structure during development.

  • 3-step workflow: Discover → Plan → Implement with explicit approval gates
  • Uses `af` CLI commands for DAG scaffolding and validation
  • Enforces Airflow best practices and common DAG patterns
  • Includes hard-gate reminder to invoke testing-dags skill before deployment
  • Works with Astro CLI or standalone astro-airflow-mcp installation

Authoring Dags by the numbers

  • 991 all-time installs (skills.sh)
  • +22 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #282 of 2,742 Automation & Workflows skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/astronomer/agents --skill authoring-dags

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs991
repo stars412
Security audit3 / 3 scanners passed
Last updatedJuly 27, 2026
Repositoryastronomer/agents

How do you write production Airflow DAGs correctly?

Create production-grade Apache Airflow DAGs that follow official patterns and pass code review.

Who is it for?

Data engineers creating or refactoring Apache Airflow DAGs who want Astronomer-reviewed patterns and CLI-guided validation.

Skip if: Developers who only need DAG testing/debugging without new authoring work, or teams not using Apache Airflow.

When should I use this skill?

The user wants to create a new Airflow DAG, write pipeline code, or learn DAG patterns and af CLI conventions.

What you get

Review-ready Airflow DAG Python files, af CLI validation steps, and DAGs aligned to Astronomer authoring conventions.

  • Airflow DAG Python files
  • af CLI validation commands
  • Review-ready pipeline structure

Files

SKILL.mdMarkdownGitHub ↗

DAG Authoring Skill

This skill guides you through creating and validating Airflow DAGs using best practices and af CLI commands.

For testing and debugging DAGs, see the testing-dags skill which covers the full test -> debug -> fix -> retest workflow.

---

Running the CLI

These commands assume af is on PATH. Run via astro otto to get it automatically, or install standalone with uv tool install astro-airflow-mcp.

---

Workflow Overview

+-----------------------------------------+
| 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              |
+-----------------------------------------+

---

Phase 1: Discover

Before writing code, understand the context.

Explore the Codebase

Use file tools to find existing patterns:

  • Glob for **/dags/**/*.py to find existing DAGs
  • Read similar DAGs to understand conventions
  • Check requirements.txt for available packages

Query the Airflow Environment

Use af CLI commands to understand what's available:

CommandPurpose
af config connectionsWhat external systems are configured
af config variablesWhat configuration values exist
af config providersWhat operator packages are installed
af config versionVersion constraints and features
af dags listExisting DAGs and naming conventions
af config poolsResource pools for concurrency

Example discovery questions:

  • "Is there a Snowflake connection?" -> af config connections
  • "What Airflow version?" -> af config version
  • "Are S3 operators available?" -> af config providers

---

Phase 2: Plan

Based on discovery, propose:

1. DAG structure - Tasks, dependencies, schedule 2. Operators to use - Based on available providers 3. Connections needed - Existing or to be created 4. Variables needed - Existing or to be created 5. Packages needed - Additions to requirements.txt

Get user approval before implementing.

---

Phase 3: Implement

Write the DAG following best practices (see below). Key steps:

1. Create DAG file in appropriate location 2. Update requirements.txt if needed 3. Save the file

---

Phase 4: Validate

Use `af` CLI as a feedback loop to validate your DAG.

Step 1: Check Import Errors

After saving, check for parse errors (Airflow will have already parsed the file):

af dags errors
  • If your file appears -> fix and retry
  • If no errors -> continue

Common causes: missing imports, syntax errors, missing packages.

Step 2: Verify DAG Exists

af dags get <dag_id>

Check: DAG exists, schedule correct, tags set, paused status.

Step 3: Check Warnings

af dags warnings

Look for deprecation warnings or configuration issues.

Step 4: Explore DAG Structure

af dags explore <dag_id>

Returns in one call: metadata, tasks, dependencies, source code.

On Astro

If you're running on Astro, you can also validate locally before deploying:

  • Parse check: Run astro dev parse to catch import errors and DAG-level issues without starting a full Airflow environment
  • DAG-only deploy: Once validated, use astro deploy --dags for fast DAG-only deploys that skip the Docker image build — ideal for iterating on DAG code

---

Phase 5: Test

See the testing-dags skill for comprehensive testing guidance.

Once validation passes, test the DAG using the workflow in the testing-dags skill:

1. Get user consent -- Always ask before triggering 2. Trigger and wait -- af runs trigger-wait <dag_id> --timeout 300 3. Analyze results -- Check success/failure status 4. Debug if needed -- af runs diagnose <dag_id> <run_id> and af tasks logs <dag_id> <run_id> <task_id>

Quick Test (Minimal)

# Ask user first, then:
af runs trigger-wait <dag_id> --timeout 300

For the full test -> debug -> fix -> retest loop, see testing-dags.

---

Phase 6: Iterate

If issues found: 1. Fix the code 2. Check for import errors: af dags errors 3. Re-validate (Phase 4) 4. Re-test using the testing-dags skill workflow (Phase 5)

---

CLI Quick Reference

PhaseCommandPurpose
Discoveraf config connectionsAvailable connections
Discoveraf config variablesConfiguration values
Discoveraf config providersInstalled operators
Discoveraf config versionVersion info
Validateaf dags errorsParse errors (check first!)
Validateaf dags get <dag_id>Verify DAG config
Validateaf dags warningsConfiguration warnings
Validateaf dags explore <dag_id>Full DAG inspection
Testing commands -- See the testing-dags skill for af runs trigger-wait, af runs diagnose, af tasks logs, etc.

---

Best Practices & Anti-Patterns

For code patterns and anti-patterns, see [reference/best-practices.md](reference/best-practices.md).

Read this reference when writing new DAGs or reviewing existing ones. It covers what patterns are correct (including Airflow 3-specific behavior) and what to avoid.

---

Related Skills

  • testing-dags: For testing DAGs, debugging failures, and the test -> fix -> retest loop
  • debugging-dags: For troubleshooting failed DAGs
  • deploying-airflow: For deploying DAGs to production (Astro or open-source)
  • migrating-airflow-2-to-3: For migrating DAGs to Airflow 3

Related skills

How it compares

Use authoring-dags to write new DAGs; switch to testing-dags when the priority is debugging and validating existing pipeline code.

FAQ

When should I use authoring-dags versus testing-dags?

authoring-dags covers creating new Apache Airflow DAGs and conventions with the af CLI, while testing-dags handles the full test, debug, fix, and retest workflow after DAG code exists.

What CLI does authoring-dags use?

authoring-dags guides developers through Apache Airflow DAG creation and validation using Astronomer af CLI commands alongside official DAG pattern recommendations.

Is Authoring Dags safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Automation & Workflowsautomationagents

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.