npx skills add ...
npx skills add google/skills --skill managed-airflow-dag-authoring
Provides guidance for authoring Apache Airflow DAGs in Managed Service for Apache Airflow (MSAA; formerly Cloud Composer). Covers environment context discovery, Airflow 2 vs 3 compatibility, authoring best practices, and local/remote validation processes. Use when creating or extending an Airflow DAG. Don't use when authoring Python code unrelated to Airflow DAGs.
npx skills add google/skills --skill managed-airflow-dag-authoring
This skill guides you through authoring and validating Apache Airflow DAGs for Managed Service for Apache Airflow (MSAA; formerly Cloud Composer) environments.
Before writing any DAG code, you MUST understand the constraints (e.g. version of Airflow) and capabilities of your target environment if user is willing to provide them.
Determine if you have direct access to the target Managed Airflow environment, local development environment or if you are working offline (only changing local files without validation).
gcloud to inspect the
environment (see Section 1.3).Determine if a local development environment is available.
composer-dev CLI is installed.airflow is available.Run the following commands to discover version constraints:
Get Airflow/Image Version:
Get Installed Packages (Versions):
Get DAGs GCS Bucket:
catchup=False in the DAG definition
unless historical backfilling is explicitly required.Variable.get() (with
deserialize_json=True if applicable) and BaseHook.get_connection().
Access variables via Jinja templates (e.g., {{ var.value.my_var }}) to
avoid database calls during DAG parsing.Use managed-airflow-migrations skill to navigate adjusting the code to specific target Airflow version.
You MUST validate DAGs before concluding your task.
Use ruff or pylint if available.
composer-dev)If the user has composer-dev configured:
Copy the DAG to the local directory with DAGs:
Verify parsing:
Only perform these steps if you have GCP access and are authorized to deploy to a target environment.
Upload the DAG to the target environment's GCS bucket:
Wait 1-2 minutes for the scheduler to parse the file, then run:
Check for Import Errors:
Pass Criteria: Output should be "No data found" or empty.
Verify DAG is Listed:
Check for runtime parsing errors in Cloud Logging: