dmx
Configuration

Shared Sources

Shared sources let an engineering organization define its loops, skills, and validators once, in a dedicated git repository, and have every app repo build on them. Teams can layer their own shared repo on top, and each repo can still override what it needs. Without them, teams copy the same .dmx/loops/ and validators/ files into each repo and watch them drift.

Shared skills are discoverable: developers ask their agent what's available, and it lists matches from every source. See Custom Skills.

For how to structure org-wide and team-level config, see Team Setup.

How resolution works

A shared source adds a tier between your repo's own files and the defaults bundled with dmx:

  1. 1Your repo
    Repo overrides

    App repo

    .dmx/loops/.dmx/skills/validators/
  2. 2team-frontend
    Team layer

    Shared source, declared first

    locked commit, fetched into .dmx/.cache/
  3. 3org-wide
    Organization baseline

    Shared source, declared second

    locked commit, fetched into .dmx/.cache/
  4. 4Bundled with dmx
    Defaults

    Ships with the dmx package

    spec, plan, dev, validate, release loops and /dmx/* skills
dmx uses the first layer that has the file. It overrides the same file in every layer below.

The repo always wins. A file at .dmx/loops/dev.yaml overrides a shared dev.yaml, which overrides the bundled Dev Loop. Among several shared sources, the first one declared wins. An override replaces the whole file; dmx doesn't merge YAML or skill content across layers.

A repo with no .dmx/shared-sources.yaml resolves exactly as before: app repo, then bundled.

Locked, not copied

Your repo commits only a lock file, .dmx/shared-sources.lock, the way npm commits package-lock.json and Go commits go.sum. For each source it records the exact commit and a sha256 hash of its tree:

# Written by /dmx/update-shared-sources. Commit this file; do not edit it by hand.
# dmx fetches each source at its commit into .dmx/.cache/ (git-ignored).
shared_sources:
  org-wide:
    source: git::https://github.com/acme/dmx-shared.git//?ref=v1.4.0
    commit: 9f2c1e7b4a0d...
    hash: sha256:3b8f...

The content itself is fetched the first time a loop, list_skills, or get_skill_definition needs it, into .dmx/.cache/<repo>@<commit>/. That folder ignores itself, so it never gets committed. dmx keeps one bare git mirror per remote in ~/.cache/dmx/git/ (or $XDG_CACHE_HOME/dmx/git/), so a second repo using the same source fetches only what's new, and two sources naming the same repo at one commit share one tree.

dmx checks every fetched tree against the hash in the lock, and again whenever its files change. A tree that doesn't match is fetched again, and refused if the fresh copy still differs.

Declaring sources

Declare sources in .dmx/shared-sources.yaml:

shared_sources:
  - name: team-frontend
    source: "git::https://github.com/acme/dmx-frontend.git//?ref=v2.1.0"
  - name: org-wide
    source: "git::https://github.com/acme/dmx-shared.git//?ref=v1.4.0"

Order matters: the first source listed wins when two define the same name. List the most specific source first, so a team's config takes precedence over the organization's baseline.

Each entry has two fields:

FieldDescription
nameShort identifier for the source, used in the lock. Must be a plain slug: letters, digits, _, and -, not starting with -. Must be unique.
sourceGit address of the source, pinned to a ref.

The source address uses the same git:: convention Terraform uses for module sources:

git::<url>[//<subdir>]?ref=<tag|branch|sha>
  • <url>: any URL git clone accepts: HTTPS or SSH, on GitHub, GitHub Enterprise, GitLab, or any other git host.
  • //<subdir>: optional. A path within the source repo where loops/, skills/, and validators/ live, if they aren't at its root. Must be relative, and can't contain a .. segment.
  • ?ref=: required. A tag, branch, or commit SHA. There's no default-branch fallback — every source has to pin something. The lock records the commit the ref pointed to, so even a branch ref stays put until you update it.

This file is kept separate from .dmx/config.md on purpose. config.md is loaded into every prompt; shared-source config is only needed when resolving a loop, skill, or validator.

Shaping a shared source repo

A shared source is a plain git repository with any of these top-level directories (or under the //<subdir> you point at):

dmx-shared/
├── loops/
│   └── hotfix.yaml
├── skills/
│   ├── deploy-preview.md          # flat skill
│   └── security-review/           # folder-shaped skill
│       ├── SKILL.md
│       ├── scripts/
│       └── references/
└── validators/
    └── security_scan.py

Each directory follows the same rules as its counterpart in an app repo: loops are loop configs, validators follow the validator contract, and skills are Markdown files with frontmatter.

At least one of loops/, skills/, or validators/ must exist, or /dmx/update-shared-sources rejects the source.

Skill shapes

Skills can take either of two shapes:

  • Flat: skills/{name}.md, dmx's own format.
  • Folder: skills/{name}/SKILL.md, the agentskills.io / Claude Code / Cursor convention, with optional scripts/, references/, and assets/ folders next to it.

This means you can point a shared source at an existing standards-shaped skills repo without restructuring it for dmx. If both shapes exist for the same name, the flat file wins.

When a folder-shaped skill runs, dmx tells the agent the skill's root directory (in .dmx/.cache/) so it can resolve the scripts/, references/, and assets/ paths the skill mentions. If the skill's frontmatter declares dependencies:, dmx surfaces them to the agent as an explicit note. dmx doesn't install them for you.

Every entry under skills/ must be one of these two shapes. A stray file, or a folder without a SKILL.md, fails the update for that source. Hidden entries like .gitkeep and .DS_Store are ignored.

Both shapes work in every tier, not just shared sources: your repo's own .dmx/skills/ and dmx's bundled skills resolve them the same way.

Updating with /dmx/update-shared-sources

/dmx/update-shared-sources looks up each source's ref, fetches the tree, checks its shape, hashes it, and writes the lock:

/dmx/update-shared-sources

By default it only looks up sources that are new or whose address changed in shared-sources.yaml. Every other source keeps its locked commit, so a floating ?ref=main never moves by surprise. To move one anyway, name it; to move all of them, pass all:

/dmx/update-shared-sources org-wide
/dmx/update-shared-sources all

Then it commits the lock and shared-sources.yaml, pushes the branch, and gives you a summary for the PR description: each source's old and new commit with a GitHub compare link, and the skills, loops, and validators added, removed, or changed. Loops and validators are marked as code to review, because they run as code in every loop.

/dmx/sync still works in 0.6 and 0.7 as an alias.

Run it on a branch

/dmx/update-shared-sources produces a commit, so it's blocked on your integration branch (branch_base in .dmx/config.md), the same way other dmx write paths are. Create a branch first, for example git checkout -b chore/update-shared-sources, then run it again.

When a source fails

If .dmx/shared-sources.yaml itself is invalid (bad YAML, a missing ?ref=, an invalid or duplicate name, or a bad subdir), nothing is updated and the command shows the error.

Otherwise each source is updated on its own, and a failure names its cause:

CauseWhat it means
Fetch failedThe URL is wrong, or this machine's git credentials can't reach it. The error names the source, the commit, and how to fix access.
Ref not foundThe ref doesn't exist — it may have been deleted, renamed, or force-pushed
Subdir not foundThe //<subdir> in the address doesn't exist at that ref
Not a shared sourceNone of loops/, skills/, or validators/ exist at the resolved path
Malformed skillsAn entry under skills/ is neither {name}.md nor {name}/SKILL.md

A failed source keeps its previous lock entry. If some sources fail and others succeed, the command tells you which failed and why, and asks whether to commit the ones that worked or stop and fix the config first.

Collisions

After locking, the command checks loops, skills, and validators for the same name defined in more than one place: two sources that both define spec.yaml, say, or a local skill that shadows an org-wide one. Skills are compared by logical name, so review.md in one source collides with review/SKILL.md in another.

A collision is a warning, not a failure, and the warning names the winner:

`spec.yaml` exists both locally (`.dmx/loops/`) and in `org-wide` — the local copy wins
and it is fully shadowed. If this local file isn't meant to be a deliberate override,
remove it.

To fix one, delete or rename the file that shouldn't win, or reorder shared_sources.

When shared-sources.yaml and the lock disagree

The lock is the source of truth. If you edit a source's address in shared-sources.yaml and don't run the update, dmx keeps resolving the locked address at its locked commit, and dmx check reports the mismatch. A source with no lock entry at all falls back to a 0.5 vendored copy in .dmx/vendor/{name}/ if one is still there, so an upgrade never leaves a repo without its loops.

CI and fresh clones

Loops fetch what they need on first use, so a developer's fresh clone just works. CI that runs shared validators needs two things:

  1. Read access to every shared-source repo. dmx runs plain git, so give CI a read token or deploy key the way you would for any private dependency.

  2. Fetch before the tests:

    dmx fetch-shared-sources

    It fetches exactly what the lock says, repo-wide and per component, without changing it, and exits non-zero if a source is missing from the lock or can't be fetched.

Per-component sources

In a monorepo with components, a component can declare its own sources in .dmx/components/<id>/shared-sources.yaml. They're locked in .dmx/components/<id>/shared-sources.lock, so the component's team bumps them without touching the repo-wide lock:

/dmx/update-shared-sources ledger

Their skills and loops are named ledger/<name>, and a component's own files win over its sources. The cache is shared, so two components on the same source at the same commit use one copy. To have your platform team approve every component bump anyway, add this line to CODEOWNERS; the trade-off is that they then approve skill-only bumps too:

/.dmx/components/*/shared-sources.lock  @acme/platform

Credentials and private repositories

Network access and git credentials are needed when a source is first fetched: by /dmx/update-shared-sources, by dmx fetch-shared-sources, or by the first loop that uses a source on a machine. After that, loops read the cached tree.

dmx runs plain git, so it uses whatever credentials your environment's git already has: an SSH agent, gh auth, or a CI deploy key or machine-user token. There's nothing dmx-specific to configure, and private repositories on GitHub Enterprise, GitLab, or any other host work the same way.

Tips

Pin to tags. A tag gives every repo the same content and reads well in a PR. The lock pins the exact commit either way.

Keep overrides deliberate. Your repo's own files always win, so a leftover .dmx/loops/dev.yaml silently replaces the org-wide version. Read the collision warnings after each update.

Review the summary. An update PR's summary lists exactly what changed in the shared loops, skills, and validators, with a compare link. Review it like any other dependency bump — validators in particular run as code on every loop.

On this page