dag-factorylisted
Install: claude install-skill vanducng/skills
# dag-factory
Declarative Airflow DAGs from YAML. Detect the repo's dialect **before** writing YAML. Official Astronomer skill targets PyPI `dag-factory` v1+ (list-format `tasks`). Many production repos still use a vendored plugin and **map-format** `tasks` keyed by `task_id`. Mixing the two breaks parse.
## 1. Detect dialect
```bash
rg -n "load_yaml_dags|from dagfactory|from plugins.dagfactory" --glob '*.py' dags plugins | head
rg -n "^ tasks:" -g '*.yaml' -g '*.yml' -A 6 | head -40
```
| Signal | Dialect |
|---|---|
| `from plugins.dagfactory import load_yaml_dags` (or similar in-repo plugin) | **map** - `tasks.<task_id>.operator` |
| `from dagfactory import load_yaml_dags` + `dag-factory>=1` in deps | **list** - `tasks: [{task_id, operator}]` |
| `tasks:` then a nested key that is a task id, not `- task_id:` | **map** |
| `tasks:` then `- task_id:` | **list** |
Match neighboring YAML in the same folder. Do not "modernize" map-format files to list-format unless the user asks and the loader is PyPI v1+.
Keep `from airflow import DAG` in every loader module even if it looks unused. The DAG processor requires it.
## 2. Loader
Map-style in-repo plugin (typical):
```python
from airflow import DAG
from plugins.dagfactory import load_yaml_dags
load_yaml_dags(globals_dict=globals(), dags_folder=".../configs")
```
PyPI v1:
```python
from airflow import DAG
from dagfactory import load_yaml_dags
load_yaml_dags(globals_dict=globals(), dags_folder="/usr/local/airflow/dags"