managed-airflow-dag-authoring

Author and validate Apache Airflow DAGs for Managed Service for Apache Airflow environments.

19.1k|1.5k|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/google/skills --skill managed-airflow-dag-authoring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: managed-airflow-dag-authoring
Source: https://github.com/google/skills/tree/main/skills/cloud/managed-airflow-dag-authoring
Command: npx skills add https://github.com/google/skills --skill managed-airflow-dag-authoring

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing Airflow DAGs for Managed Service for Apache Airflow (MSAA, formerly Cloud Composer) requires matching the target environment's Airflow version and installed packages, and undeployed DAGs often fail with import errors only discovered after deployment. This Skill guides environment discovery, version-aware authoring, and local and remote validation so DAGs parse correctly before and after deployment.

Core Features & Use Cases

  • Environment Context Discovery: Inspect the target MSAA environment with gcloud to retrieve the Airflow image version, installed PyPI packages, and the DAGs GCS bucket before writing code.
  • Best-Practice Authoring: Enforce idempotent tasks, no top-level code execution, explicit catchup settings, and Airflow Variables/Connections instead of hardcoded credentials, with Airflow 2 vs 3 compatibility guidance.
  • Local and Remote Validation: Lint with ruff or pylint, verify parsing with composer-dev, deploy to the GCS bucket, and confirm via Airflow CLI import-error checks and Cloud Logging queries.
  • Use Case: You need to add a new daily ETL DAG to an existing Cloud Composer environment. The Skill first discovers the environment runs Airflow 2 with specific provider packages, then helps you write a compatible DAG, lint it locally, deploy it to the DAGs bucket, and verify it appears with no import errors.

Quick Start

Help me author a new Airflow DAG for my Managed Airflow environment and validate that it parses without import errors.

Frequently Asked Questions about managed-airflow-dag-authoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I author an Airflow DAG for Cloud Composer?

Authoring a Cloud Composer DAG starts with discovering the target environment's Airflow version and installed PyPI packages using gcloud composer environments describe. Then write the DAG following best practices like idempotent tasks and no top-level code execution, and validate it before deployment.

How to validate an Airflow DAG before deploying to Cloud Composer?

Validate locally by linting with ruff or pylint and checking parsing with composer-dev run-airflow-cmd dags list-import-errors. After uploading to the DAGs GCS bucket, run gcloud composer environments run with dags list-import-errors to confirm no errors.

What is the difference between Airflow 2 and Airflow 3 for DAG authoring?

Airflow 2 and Airflow 3 differ in APIs and rulesets that affect DAG compatibility, so code must match the target environment's version. This Skill defers version-specific migration adjustments to the managed-airflow-migrations skill.

Why does my Airflow DAG fail with import errors after deployment?

Import errors usually come from top-level code execution, missing PyPI packages in the environment, or Airflow version mismatches. Check errors with gcloud composer environments run dags list-import-errors and review airflow-scheduler logs in Cloud Logging.

When should I not use this Airflow DAG authoring guidance?

Do not use it when writing Python code unrelated to Airflow DAGs. It is scoped specifically to creating or extending DAGs for Managed Service for Apache Airflow environments.