gcp-managed-airflow-dag-authoring

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

Updated Aug 26, 2026
One-click install
npx skills add https://github.com/Lathika-laa/Recipe_Box --skill gcp-managed-airflow-dag-authoring-lathika-laa
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gcp-managed-airflow-dag-authoring
Source: https://github.com/Lathika-laa/Recipe_Box/tree/main/.github/.gemini/skills/gcp-managed-airflow-dag-authoring
Command: npx skills add https://github.com/Lathika-laa/Recipe_Box --skill gcp-managed-airflow-dag-authoring-lathika-laa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Airflow DAGs for Managed Service for Apache Airflow (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: Uses gcloud commands to inspect the target environment's Airflow image version, installed PyPI packages, and DAGs GCS bucket before writing code. - Best-Practice Authoring: Enforces 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: Runs ruff linting, composer-dev import-error checks, GCS deployment, and Airflow CLI verification against the target environment. - Use Case: When asked to create a new DAG for a Cloud Composer environment, the Skill first discovers the environment's Airflow version, writes compatible DAG code, then deploys it to the GCS bucket and confirms there are no import errors. ## Quick Start Ask the AI to create and validate a new Airflow DAG for your Managed Airflow environment, providing the environment name and GCP region.

Frequently Asked Questions about gcp-managed-airflow-dag-authoring

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

FAQPage Schema
How do I create an Airflow DAG for Google Cloud Composer?▼

First discover the target environment's Airflow version and installed packages using gcloud composer environments describe, then write the DAG following best practices like idempotency and no top-level code execution. Finally validate it locally or deploy it to the environment's GCS bucket and check for import errors.

How do I validate an Airflow DAG before deploying to Cloud Composer?▼

Run ruff or pylint for static analysis, then use composer-dev run-airflow-cmd with dags list-import-errors to verify parsing in a local environment. This catches syntax and import errors before uploading to the target environment's GCS bucket.

How do I check Airflow DAG import errors in Cloud Composer?▼

Run gcloud composer environments run with the dags list-import-errors command against your environment after uploading the DAG to its GCS bucket. A passing result shows no data found, and you can also check Cloud Logging for scheduler errors mentioning the DAG file.

Does Airflow 3 code work on Airflow 2 Cloud Composer environments?▼

No, Airflow 2 and Airflow 3 have breaking differences, so DAG code must match the target environment's version. Check the environment's image version with gcloud composer environments describe and adjust the code accordingly before deployment.

Why should Airflow DAGs avoid top-level code execution?▼

Top-level code in a DAG file runs every few seconds during scheduler parsing, so database queries or API calls there degrade performance. Move such logic inside tasks and access configuration through Jinja-templated Airflow Variables instead.