airflow-adapter
This Claude Code skill implements an adapter pattern that automatically detects the Airflow version at startup and routes API calls to either the v2 (`/api/v1`) or v3 (`/api/v2`) adapter. Use it when building tools that need to work seamlessly across Airflow 2.x and 3.x environments without requiring manual version specification.
git clone --depth 1 https://github.com/astronomer/agents /tmp/airflow-adapter && cp -r /tmp/airflow-adapter/astro-airflow-mcp/.claude/skills/airflow-adapter ~/.claude/skills/airflow-adapterSKILL.md
# Airflow Adapter Pattern
Enables compatibility with both Airflow 2.x (`/api/v1`) and 3.x (`/api/v2`).
## Architecture
```
MCP Tool → _get_adapter() → AirflowV2Adapter or AirflowV3Adapter → Airflow API
```
Version is auto-detected at startup.
## Key Files
- `adapters/base.py` - Abstract interface
- `adapters/airflow_v2.py` - Airflow 2.x (`/api/v1`)
- `adapters/airflow_v3.py` - Airflow 3.x (`/api/v2`)
## Related Files
- @api-differences.md - V2 vs V3 field/endpoint differences
- @patterns.md - Implementation patterns
## Quick Reference
```python
adapter = _get_adapter()
dags = adapter.list_dags(limit=100)
run = adapter.trigger_dag_run("my_dag", conf={"key": "value"})
```Add a new method to both Airflow adapters
Add a new MCP tool to server.py
Verify code works with both Airflow 2.x and 3.x
Use when the user needs human-in-the-loop workflows in Airflow (approval/reject, form input, or human-driven branching). Covers ApprovalOperator, HITLOperator, HITLBranchOperator, HITLEntryOperator, HITLTrigger. Requires Airflow 3.1+. Does not cover AI/LLM calls (see airflow-ai).
Build Airflow 3.1+ plugins that embed FastAPI apps, custom UI pages, React components, middleware, macros, and operator links directly into the Airflow UI. Use this skill whenever the user wants to create an Airflow plugin, add a custom UI page or nav entry to Airflow, build FastAPI-backed endpoints inside Airflow, serve static assets from a plugin, embed a React app in the Airflow UI, add middleware to the Airflow API server, create custom operator extra links, or call the Airflow REST API from inside a plugin. Also trigger when the user mentions AirflowPlugin, fastapi_apps, external_views, react_apps, plugin registration, or embedding a web app in Airflow 3.1+. If someone is building anything custom inside Airflow 3.1+ that involves Python and a browser-facing interface, this skill almost certainly applies.
Queries, manages, and troubleshoots Apache Airflow using the af CLI. Covers listing DAGs, triggering runs, reading task logs, diagnosing failures, debugging DAG import errors, checking connections, variables, pools, and monitoring health. Also routes to sub-skills for writing DAGs, debugging, deploying, and migrating Airflow 2 to 3. Use when user mentions "Airflow", "DAG", "DAG run", "task log", "import error", "parse error", "broken DAG", or asks to "trigger a pipeline", "debug import errors", "check Airflow health", "list connections", "retry a run", or any Airflow operation. Do NOT use for warehouse/SQL analytics on Airflow metadata tables — use analyzing-data instead.
Queries data warehouse and answers business questions about data. Handles questions requiring database/warehouse queries including "who uses X", "how many Y", "show me Z", "find customers", "what is the count", data lookups, metrics, trends, or SQL analysis.
Annotate Airflow tasks with data lineage using inlets and outlets. Use when the user wants to add lineage metadata to tasks, specify input/output datasets, or enable lineage tracking for operators without built-in OpenLineage extraction.