К основному содержанию
скилл CX Codex

authoring-dags — скилл для Claude Code: что делает и как установить

Помогает создавать и проверять DAG в Apache Airflow по шестиэтапному циклу. Пригодится при написании новых пайплайнов или добавлении задач в существующие графы.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add astronomer/agents --skill authoring-dags -a claude-code
Открыть на GitHub

Что делает authoring-dags

Скилл выстраивает работу над Apache Airflow DAG вокруг цикла из шести шагов: исследование окружения, планирование структуры, написание кода, валидация, запуск теста и доработка. Перед созданием файла агент проверяет доступные провайдеры, переменные и конфигурации через утилиту af. Это исключает ситуации, когда пайплайн опирается на отсутствующие операторы или ненастроенные подключения.

Для валидации используются команды af dags errors, af dags get и af dags explore, а на Astro локальный разбор выполняется через astro dev parse. Скилл требует обязательного одобрения пользователя перед утверждением структуры пайплайна и перед пробным запуском DAG через af runs trigger-wait.

Инструмент опирается на интерфейс af, поэтому перед началом нужна утилита в системном PATH. Её получают через astro otto или ставят отдельно командой uv tool install astro-airflow-mcp. Глубокую отладку сбоев этот скилл на себя не берёт, перенаправляя пользователя на смежный скилл testing-dags.

Какие задачи решает

  • спланировать структуру DAG с учётом доступных провайдеров и подключений
  • найти ошибки импорта и синтаксиса в файлах DAG через af dags errors
  • добавить downstream-задачу в существующий пайплайн Airflow
  • проверить метаданные и граф зависимостей с помощью af dags explore

Примеры запросов агенту

  • Создай DAG с именем daily_sales_sync для выгрузки данных из Snowflake в S3
  • Добавь задачу проверки качества данных, которая запускается после extract_data
  • Проверь файл DAG на ошибки парсинга и покажи структуру графа через af

Как установить authoring-dags

1Через Skills CLI (Vercel)

npx skills add astronomer/agents --skill authoring-dags -a claude-code

2Вручную: положить файлы

~/.claude/skills/authoring-dags/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/authoring-dags/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о authoring-dags

Как установить authoring-dags в Claude Code?

Выполните команду npx skills add astronomer/agents --skill authoring-dags -a claude-code.

Для чего нужен скилл authoring-dags?

Он задаёт пошаговый процесс создания и валидации DAG в Apache Airflow, помогая планировать зависимости, проверять синтаксис и вызывать валидацию через CLI af.

Что требуется для работы команд валидации в authoring-dags?

Нужна утилита af в системном PATH. Её можно запустить через astro otto или установить отдельно с помощью команды uv tool install astro-airflow-mcp.

Исходный текст

SKILL.md · Apache-2.0
---
name: authoring-dags
description: Workflow and best practices for writing Apache Airflow DAGs. Use when creating a new DAG, write pipeline code, handling questions about DAG patterns and conventions or extending an existing DAG with a follow-up/downstream task. ANY request shaped like 'add a DAG named X', 'write a pipeline', 'add a task that runs after Y', or 'extend the DAG'. For testing and debugging DAGs, see the testing-dags skill.
hooks:
  Stop:
    - hooks:
        - type: command
          command: "echo 'Remember to test your DAG with the testing-dags skill'"
---

# 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:

| Command | Purpose |
|---------|---------|
| `af config connections` | What external systems are configured |
| `af config variables` | What configuration values exist |
| `af config providers` | What operator packages are installed |
| `af config version` | Version constraints and features |
| `af dags list` | Existing DAGs and naming conventions |
| `af config pools` | Resource 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):

```bash
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

```bash
af dags get <dag_id>
```

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

### Step 3: Check Warnings

```bash
af dags warnings
```

Look for deprecation warnings or configuration issues.

### Step 4: Explore DAG Structure

```bash
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)

```bash
# 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

| Phase | Command | Purpose |
|-------|---------|---------|
| Discover | `af config connections` | Available connections |
| Discover | `af config variables` | Configuration values |
| Discover | `af config providers` | Installed operators |
| Discover | `af config version` | Version info |
| Validate | `af dags errors` | Parse errors (check first!) |
| Validate | `af dags get <dag_id>` | Verify DAG config |
| Validate | `af dags warnings` | Configuration warnings |
| Validate | `af 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

© astronomer · Apache-2.0 · astronomer/agents

Похожие скиллы

Все скиллы по теме «Данные и базы» →
managed-airflow-dag-authoring официальный google Помогает создавать и проверять DAG Apache Airflow для Managed Service for Apache Airflow. Нужен при разработке или расширении DAG. CX Codex 4 100установок apache-airflow-orchestration reason-machines Скилл даёт агенту знания по Apache Airflow: сборка DAG, расписания, операторы, сенсоры, разбор падений задач. CX Codex +1 2 400установок airflow-dag-patterns Seth Hobson Скилл помогает проектировать DAG в Apache Airflow, связывать задачи и проверять пайплайны. Подойдёт для ETL, пакетных заданий и отладки запусков. CX Codex 11 000установок managed-airflow-dag-troubleshooting официальный google Разбирает сбои DAG run и task instance в Managed Service for Apache Airflow по логам, состояниям задач и исходному коду DAG. CX Codex 3 500установок turbo-builder goldsky-io Проведёт по шагам от постановки задачи до задеплоенного YAML-пайплайна Goldsky Turbo: выбор датасета, источники, трансформы, приёмники. CX Codex +1 3 600установок authoring-log-alerts PostHog Помогает настроить алерты по логам в проекте PostHog: выбирает сервисы, считает базовую линию и подбирает порог, чтобы алерт срабатывал 0–3 раза в неделю. CX Codex +1 356установок

Из того же набора23

airflow Скилл для работы с Apache Airflow через CLI af: список и запуск DAG, чтение логов задач, разбор ошибок импорта и парсинга. CX Codex +1 1 500установок analyzing-data Отвечает на бизнес-вопросы по данным: считает метрики, строит тренды, джойнит таблицы и кеширует найденные схемы. CX Codex +1 1 400установок managing-astro-local-env Управляет локальным окружением Airflow через Astro CLI в Docker и standalone-режимах. Помогает запускать сервисы, читать логи и слать запросы к Airflow API прямо из диалога с агентом. CX Codex +1 1 400установок testing-dags Гоняет Airflow DAG, ждёт завершения и разбирает падение по логам. Нужен, когда тест и починка идут циклами. CX Codex +1 1 200установок setting-up-astro-project Скилл проводит агента через создание проекта Airflow на Astro CLI: структура каталогов, зависимости, подключения и переменные. CX Codex +1 1 100установок migrating-airflow-2-to-3 Помогает перевести код DAG с Airflow 2.x на 3.x: импорты, операторы, хуки, работа с метаданными. Пригодится, когда проект пора обновлять, а вручную искать все breaking changes лень. CX Codex +1 1 100установок checking-freshness Скилл смотрит, когда таблица обновлялась в последний раз, и говорит, можно ли на этих данных строить отчёт. CX Codex +1 1 000установок tracing-downstream-lineage Скилл находит всё, что зависит от таблицы или DAG, и показывает, что сломается при изменении. Пригодится перед правкой схемы. CX Codex +1 1 000установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой