$npx -y skills add astronomer/agents --skill setting-up-astro-projectInitialize and configure Astro/Airflow projects. Use when the user wants to create a new project, set up dependencies, configure connections/variables, or understand project structure. For running the local environment, see managing-astro-local-env.
| 1 | # Astro Project Setup |
| 2 | |
| 3 | This skill helps you initialize and configure Airflow projects using the Astro CLI. |
| 4 | |
| 5 | > **To run the local environment**, see the **managing-astro-local-env** skill. |
| 6 | > **To write DAGs**, see the **authoring-dags** skill. |
| 7 | > **Open-source alternative:** If the user isn't on Astro, guide them to Apache Airflow's Docker Compose quickstart for local dev and the Helm chart for production. For deployment strategies, use the `deploying-airflow` skill. |
| 8 | |
| 9 | --- |
| 10 | |
| 11 | ## Initialize a New Project |
| 12 | |
| 13 | ```bash |
| 14 | astro dev init |
| 15 | ``` |
| 16 | |
| 17 | > **Don't pass `--airflow-version` or `--runtime-version` unless the user explicitly asks for a specific pin.** Plain `astro dev init` resolves to the latest Astro Runtime — that's the right default. Specifying a version risks pinning to a stale value from training data. If the user wants to know what was installed, read the generated `Dockerfile` afterward instead of guessing. |
| 18 | |
| 19 | Creates this structure: |
| 20 | ``` |
| 21 | project/ |
| 22 | ├── dags/ # DAG files |
| 23 | ├── include/ # SQL, configs, supporting files |
| 24 | ├── plugins/ # Custom Airflow plugins |
| 25 | ├── tests/ # Unit tests |
| 26 | ├── Dockerfile # Image customization |
| 27 | ├── packages.txt # OS-level packages |
| 28 | ├── requirements.txt # Python packages |
| 29 | └── airflow_settings.yaml # Connections, variables, pools |
| 30 | ``` |
| 31 | |
| 32 | --- |
| 33 | |
| 34 | ## Adding Dependencies |
| 35 | |
| 36 | ### Python Packages (requirements.txt) |
| 37 | |
| 38 | ``` |
| 39 | apache-airflow-providers-snowflake==5.3.0 |
| 40 | pandas==2.1.0 |
| 41 | requests>=2.28.0 |
| 42 | ``` |
| 43 | |
| 44 | ### OS Packages (packages.txt) |
| 45 | |
| 46 | ``` |
| 47 | gcc |
| 48 | libpq-dev |
| 49 | ``` |
| 50 | |
| 51 | ### Custom Dockerfile |
| 52 | |
| 53 | For complex setups (private PyPI, custom scripts): |
| 54 | |
| 55 | ```dockerfile |
| 56 | FROM quay.io/astronomer/astro-runtime:12.4.0 |
| 57 | |
| 58 | RUN pip install --extra-index-url https://pypi.example.com/simple my-package |
| 59 | ``` |
| 60 | |
| 61 | **After modifying dependencies:** Run `astro dev restart` |
| 62 | |
| 63 | --- |
| 64 | |
| 65 | ## Configuring Connections & Variables |
| 66 | |
| 67 | ### airflow_settings.yaml |
| 68 | |
| 69 | Loaded automatically on environment start: |
| 70 | |
| 71 | ```yaml |
| 72 | airflow: |
| 73 | connections: |
| 74 | - conn_id: my_postgres |
| 75 | conn_type: postgres |
| 76 | host: host.docker.internal |
| 77 | port: 5432 |
| 78 | login: user |
| 79 | password: pass |
| 80 | schema: mydb |
| 81 | |
| 82 | variables: |
| 83 | - variable_name: env |
| 84 | variable_value: dev |
| 85 | |
| 86 | pools: |
| 87 | - pool_name: limited_pool |
| 88 | pool_slot: 5 |
| 89 | ``` |
| 90 | |
| 91 | ### Export/Import |
| 92 | |
| 93 | ```bash |
| 94 | # Export from running environment |
| 95 | astro dev object export --connections --file connections.yaml |
| 96 | |
| 97 | # Import to environment |
| 98 | astro dev object import --connections --file connections.yaml |
| 99 | ``` |
| 100 | |
| 101 | --- |
| 102 | |
| 103 | ## Validate Before Running |
| 104 | |
| 105 | Parse DAGs to catch errors without starting the full environment: |
| 106 | |
| 107 | ```bash |
| 108 | astro dev parse |
| 109 | ``` |
| 110 | |
| 111 | --- |
| 112 | |
| 113 | ## Related Skills |
| 114 | |
| 115 | - **managing-astro-local-env**: Start, stop, and troubleshoot the local environment |
| 116 | - **authoring-dags**: Write and validate DAGs (uses MCP tools) |
| 117 | - **testing-dags**: Test DAGs (uses MCP tools) |
| 118 | - **deploying-airflow**: Deploy DAGs to production (Astro, Docker Compose, Kubernetes) |