Skip to content
Back to skills

Dagster Code Location Structure

ASecurity

Structure and organize Dagster code locations using dg. Use this skill when creating or migrating code locations, placing assets or sensors in the correct location, scaffolding new dg projects, or setting up the dg_projects/ workspace layout.

  • 5 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
devopsgobashdockerkubernetes

Security analysis

A100/100

Scanned October 4, 2026

npx -y skills add mitodl/agent-kit --skill dagster-code-location-structure --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dagster Code Location Structure?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dagster Code Location Structure
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mitodl-dagster-code-location-structure/badge)](https://www.skillsdirectory.com/skills/mitodl-dagster-code-location-structure)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dagster-code-location-structure
description: >
  Structure and organize Dagster code locations using dg. Use this skill when
  creating or migrating code locations, placing assets or sensors in the correct
  location, scaffolding new dg projects, or setting up the dg_projects/ workspace
  layout.
license: BSD-3-Clause
metadata:
  category: dagster
---

# Dagster Code Location Structure

## Project layout

Code locations live under `dg_projects/` as separate subdirectories, each managed
by `dg`. Shared code (base classes, utilities, sensors used by multiple locations)
lives in `packages/ol-orchestrate-lib/`.

```text
dg_projects/
  <code_location_name>/
    pyproject.toml
    src/
      <code_location_name>/
        assets/
        sensors/
        ...
packages/
  ol-orchestrate-lib/
    ...
```

## Scaffolding new code locations

Use the `create-dagster` tool to scaffold new code locations — **not** `dg scaffold`:

```bash
create-dagster <code_location_name>
```

## Asset and sensor placement

Assets and sensors must be placed in the code location that owns them. Do not
accidentally include an asset or sensor from one code location in another.
When migrating or moving definitions, double-check `defs.py` / `__init__.py`
imports in *each* code location.

## Migration sequencing

When migrating multiple code locations (e.g., from EC2/docker-compose to
Kubernetes), **do one code location at a time**. The first location becomes the
validated template. Never try to migrate all locations in a single PR.

## Shared OAuth / base classes

The `oauth` module inside `ol-orchestrate-lib` is used as a base class by
multiple code locations. It must remain in the library even if it looks unused
from a single code location's perspective.

## Checking partitions

Static partitions with hardcoded values are the *old* approach. Prefer
dynamic/time-based partitions when an up-to-date implementation already exists
in another code location — copy that pattern rather than the older one.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in devops →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.