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

authoring-language-sdk-tasks — скилл для Claude Code: установка

Скилл authoring-language-sdk-tasks помогает писать задачи Apache Airflow на Go или Java, сохраняя описание DAG в Python. Пригодится при настройке заглушек @task.stub и обмена данными через XCom.

Apache-2.0 220 установок ★ 463 обновлён 2026-10-14

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

Что делает authoring-language-sdk-tasks

Скилл задаёт общую архитектуру для Airflow Language SDK. Сам DAG, расписание и зависимости остаются в Python, а вычисления запускаются в отдельном нативном процессе на Go, Java или Kotlin. Координатор Airflow поднимает изолированный подпроцесс ровно на один запуск задачи и сразу завершает его.

Обмен данными между Python и сторонним кодом идёт исключительно через XCom в формате JSON. Сложные структуры приводятся к базовым типам: строкам, числам, массивам и словарям. Заглушка @task.stub в коде DAG обязана иметь пустое тело с pass или многоточием — любые инструкции внутри вызовут ошибку проверки AST.

Имена функций-заглушек должны строго совпадать с идентификаторами нативных задач. Если допустить опечатку в ID, Airflow просто не свяжет запуск с кодом.

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

  • связать Python-декларацию DAG с кодом задачи на Go или Java
  • настроить передачу аргументов через XCom в формате JSON
  • объявить зависимости и очереди для координатора через @task.stub
  • избежать ошибок несовпадения идентификаторов между Python и нативным кодом

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

  • Покажи, как оформить DAG с заглушками @task.stub для воркера на Go
  • Как передать словарь через XCom из нативного Java-таска в Python?
  • Проверь stub-функции в DAG на совместимость с правилами Airflow SDK

Как установить authoring-language-sdk-tasks

1Через Skills CLI (Vercel)

npx skills add astronomer/agents --skill authoring-language-sdk-tasks -a claude-code

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

~/.claude/skills/authoring-language-sdk-tasks/SKILL.md

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

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

Вопросы об authoring-language-sdk-tasks

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

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

Что делает authoring-language-sdk-tasks?

Скилл объясняет базовые правила связки Python DAG с внешними задачами на JVM или Go, включая работу очереди и координатора.

Почему тело функции @task.stub должно быть пустым?

Проверка через AST отклоняет любую логику внутри заглушки кроме pass, docstring или npx skills add astronomer/agents --skill authoring-language-sdk-tasks -a claude-code, так как исполнение полностью передаётся нативному процессу.

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

SKILL.md · Apache-2.0
---
name: authoring-language-sdk-tasks
description: The language-neutral foundation for Airflow language SDKs — implement task logic in a non-Python language while the DAG stays in Python. Use when the user wants to run an Airflow task in another language (Java, Kotlin, Go, or other JVM/native languages), asks how the Python `@task.stub` pairs with native task code, how task/DAG IDs must match across the two sides, how data passes via XCom as JSON, or which language SDKs exist. This skill owns the shared Python-stub pattern and conceptual model; for a specific language's native API, build, and runtime, use that language's skill (e.g. authoring-java-sdk-tasks, authoring-go-sdk-tasks).
---

# Authoring Language SDK Tasks (Shared Foundation)

Airflow language SDKs let you implement task logic in a language other than Python while the DAG and its scheduling stay in Python. This skill describes the parts that are identical across every language SDK. Each language has its own companion skill for the native API, build tooling, and runtime — see [Per-language skills](#per-language-skills).

> **Experimental.** The language SDKs are in preview. APIs and artifact coordinates may change.

---

## The model

A DAG is authored in Python as usual. Tasks that should run in another language are declared as **stubs** routed to a dedicated queue. At runtime, Airflow hands a stub task to a **coordinator** that launches a short-lived **native subprocess** for that one task instance, runs your compiled/native code, and shuts the subprocess down.

Consequences that hold for every language SDK:

- **One subprocess per task instance** — there is no shared in-process state between task instances. Pass data via XCom or an external store.
- **The DAG, schedule, retries, and queue routing live in Python.** The native side only implements task logic.
- **Data crossing the boundary is JSON.** See [The XCom-as-JSON contract](#the-xcom-as-json-contract).

---

## The two-sided model

Every task has two halves that must agree:

1. A **Python stub** in a normal DAG file — no logic; it declares the task, its queue, the dependency graph, and retry policy.
2. A **native implementation** (Java, Go, etc.) whose IDs match the Python side and where the work happens.

### Python side (scheduling)

The example below uses the Go SDK to be concrete, but the Python side is **identical for every language SDK**. The queue name (`"golang"` here) is an arbitrary label you choose — it just has to match a key in `queue_to_coordinator` (see **configuring-airflow-language-sdks**). Pick whatever name fits the SDK you're routing to.

```python
from datetime import timedelta
from airflow.sdk import dag, task


@dag
def sales_pipeline():
    @task.stub(queue="golang")          # queue selects the coordinator (see configuring-airflow-language-sdks)
    def extract(): ...

    @task.stub(queue="golang")
    def transform(extracted): ...        # arg only declares the dependency

    @task.stub(queue="golang", retries=1, retry_delay=timedelta(seconds=5))
    def load(transformed): ...

    @task()                              # an ordinary Python task can sit downstream
    def report(loaded):
        print(f"done: {loaded}")

    report(load(transform(extract())))


sales_pipeline()
```

Rules that apply regardless of language:

- The **stub function name is the task ID** and the `@dag` name (or `dag_id=`) is the DAG ID. The native side must use these exact IDs.
- An upstream argument on a stub (e.g. `transform(extracted)`) exists **only to declare the dependency** in Python. The value itself is fetched on the native side via XCom — passing it in Python does not hand it to the native code.
- **Queue, retries, and other task arguments are set on the stub**, not in the native code. A native task that fails is reported back to Airflow, which then applies the stub's retry policy.
- The `queue` value is what routes the task to a coordinator; the same string must appear in `queue_to_coordinator` (see **configuring-airflow-language-sdks**).

---

## The XCom-as-JSON contract

XCom values are stored as JSON in Airflow's metadata database, so the boundary between Python and any native language is JSON. The Python/JSON side is the same for every SDK:

| Python type | JSON |
|-------------|------|
| `int` | number (integer) |
| `float` | number (decimal) |
| `str` | string |
| `bool` | boolean |
| `None` | null |
| `list` | array |
| `dict` | object |

Each language SDK maps these JSON types onto its own native types (e.g. a JSON integer becomes a Java `Long`). The native-type mapping lives in that language's skill. The key portability rule: a value pushed by one task is read by another **as JSON**, so the consuming side must expect a type compatible with what was stored.

---

## What is language-specific (and lives elsewhere)

This skill deliberately stops at the shared concepts. The following differ per language and are documented in each language's companion skills:

- **Native task API** — how you declare tasks, read connections/variables/XComs, and push results (annotations, interfaces, function registration, etc.).
- **Native type mapping** — the native column of the JSON table above.
- **Build and packaging** — how the artifact is compiled and bundled.
- **Runtime prerequisite** — what must be present on the worker (a language runtime for some SDKs, e.g. a JRE for the Java SDK; none for the Go SDK's self-contained bundles).

The Airflow-side wiring (which coordinator runs which queue) is shared in structure but has per-coordinator options; it lives in **configuring-airflow-language-sdks**.

---

## Language-agnostic pitfalls

- **IDs must match exactly** across the Python stub function name and the native task ID, and across `@dag`/`dag_id` and the native DAG ID. Mismatches surface as "no DAGs" or missing-XCom errors.
- **Both sides need the upstream reference.** Python declares the dependency by passing the upstream call; the native code retrieves the value via XCom.
- **Set queue and retries on the stub**, never in the native code.
- **Stub bodies must be empty.** An AST check enforces it — only `pass`, `...`, or a docstring is allowed in the body; any real logic is rejected.
- **`retry_policy` is rejected on stubs** (`@task.stub` raises `ValueError`). Use `retries`/`retry_delay` instead — a retry-policy callable runs Python in-process and would never fire for a task executing in a native subprocess.
- Assets, deferral, and some other Airflow features have limited or no support in the language SDKs today.

---

## Per-language skills

- **authoring-java-sdk-tasks**: Java/Kotlin/JVM native API, type mapping, and logging.
- **authoring-go-sdk-tasks**: Go native API — task registration, dependency injection by parameter type, and client access.
- *(Future language SDKs each add their own `authoring-<lang>-sdk-tasks` skill that builds on this one.)*

## Related Skills

- **configuring-airflow-language-sdks**: Route a queue to a coordinator and set runtime options.
- **authoring-dags**: General Airflow DAG authoring (the Python side lives here too).
- **deploying-java-sdk-bundles**: Build and ship the Java artifact.
- **deploying-go-sdk-bundles**: Build, pack, and ship the Go bundle (per-language deploy skills follow the same shape).

© astronomer · Apache-2.0 · astronomer/agents

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

Все скиллы по теме «Данные и базы» →
managed-airflow-dag-authoring официальный google Скилл managed-airflow-dag-authoring помогает создавать и проверять DAG Apache Airflow для Managed Service for Apache Airflow. Нужен при разработке или расширении DAG. CX Codex +1 4 100установок copilot-sdk официальный github Помогает встраивать сценарии Microsoft Copilot SDK в приложения на TypeScript, Python, Go и .NET. Запускается при настройке сессий, стриминга ответов и подключении MCP-серверов. CX Codex +1 9 395установок iii-sdk-reference iii-hq Скилл iii-sdk-reference для Claude Code: справочник iii SDK для Node.js, Python, Rust, Go и браузера. Регистрация воркеров, вызов функций, наблюдатели, каналы, логирование, OpenTelemetry с примерами для каждого языка. CX Codex +1 4 900установок catalyst-sdk catalystbyzoho Подставляет паттерны инициализации и методы Catalyst SDK для семи языков и сред, от Node.js до Flutter. CX Codex +1 1 200установок airflow-dag-patterns Seth Hobson Скилл airflow-dag-patterns для Claude Code помогает проектировать DAG в Apache Airflow, связывать задачи и проверять пайплайны. Используется при работе с ETL, пакетными заданиями и отладкой запусков. CX Codex +1 11 000установок apache-airflow-orchestration reason-machines Скилл apache-airflow-orchestration даёт агенту знания по Apache Airflow: сборка DAG, расписания, операторы, сенсоры, разбор падений задач. CX Codex +1 2 400установок

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

Весь набор →
dag-factory Описывает DAG в Airflow через YAML dag-factory вместо Python-кода. Быстро собирает и правит декларативные пайплайны. CX Codex +1 438установок migrating-ai-sdk-to-common-ai Скилл migrating-ai-sdk-to-common-ai для Claude Code переводит Airflow-проекты с airflow-ai-sdk на apache-airflow-providers-common-ai 0.4.0+. Перестраивает импорты, декораторы и конфигурацию моделей под соединения. CX Codex +1 394установок delegating-to-otto Скилл delegating-to-otto учит агента вызывать astro otto как субагента для задач Airflow, dbt и дата-инженерии. Полезен, когда нужен разбор миграции на Airflow 3 или аудит репозитория. CX Codex +1 371установок airflow-state-store Скилл airflow-state-store помогает сохранять состояние задач и ассетов между повторами и запусками DAG в Airflow 3.3+, используя хранилища ключ-значение и crash-safe миксин для операторов, которые отправляют задачи во внешние системы. CX Codex +1 239установок configuring-airflow-language-sdks Скилл configuring-airflow-language-sdks для Claude Code настраивает маршрутизацию задач Airflow к Java- и Go-координаторам через очереди. Настраивает запуск native-задач, которые не стартуют или не подхватываются. CX Codex +1 219установок deploying-go-sdk-bundles Скилл deploying-go-sdk-bundles помогает собрать Go-бандл для Airflow, упаковать его и развернуть там, где его найдёт ExecutableCoordinator. Пригодится при настройке Go-задач и их доставки на воркеры. CX Codex +1 217установок authoring-go-sdk-tasks Скилл authoring-go-sdk-tasks для Claude Code помогает писать задачи Apache Airflow на Go через Airflow Go SDK. Выносит тяжёлую логику из Python в нативные скомпилированные бандлы. CX Codex +1 217установок migrating-dagster-to-airflow Скилл migrating-dagster-to-airflow для Claude Code ведёт пошаговый перенос проектов Dagster и Dagster+ на Apache Airflow 3 и Astro Runtime через манифест и проверку ассетов. CX Codex +1 207установок

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

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