---
title: "Framework configuration (_mighty.yml)"
vignette: >
  %\VignetteIndexEntry{Framework configuration (_mighty.yml)}
  %\VignetteEngine{quarto::html}
  %\VignetteEncoding{UTF-8}
knitr:
  opts_chunk:
    collapse: true
    comment: '#>'
---
# Overview

The `_mighty.yml` file provides framework configuration that spans across all ADaM domains. This file should be placed in the study directory alongside individual ADaM domain specification files.

# External data

The `external_data` section specifies primary keys for all external datasets that will be available at runtime. This includes:

- **SDTM domains** (e.g., DM, EX, LB)
- **Metadata datasets** (e.g., MDPARAM, MDVISIT)
- **Pre-existing ADaM datasets** (e.g., any ADaM dataset not being generated by mighty)

**IMPORTANT:** ADaM domains being generated by mighty should have their keys defined in their individual domain specification files (see `vignette("adam_specification")`), NOT in `_mighty.yml`.

**IMPORTANT:** Domain names must be specified in uppercase following CDISC standards (e.g., `DM`, `EX`, `LB`), regardless of the file name casing. The system automatically handles case conversion when reading data files.

### Example:

```yml
external_data:
  - id: DM
    keys: [USUBJID, STUDYID]
  - id: EX
    keys: [USUBJID]
  - id: MDPARAM
    keys: [STUDYID, TOPICCD]
```

# Component repositories

The `repos` field tells mighty where to look for code components. Repositories are searched in the order listed, and the first match wins.

Each entry can be:

- `owner/repo` — a GitHub repository
- `owner/repo/subdir` — a subdirectory inside a GitHub repository
- `owner/repo/subdir@ref` — a specific branch, tag, or commit
- A local filesystem path (absolute or relative to the study directory)

GitHub repositories are downloaded once per session and cached.

### Example:

```yml
repos:
  - NovoNordisk-OpenSource/mighty.standards/components
  - my-org/study-components@v1.0.0
  - "./local-components"
```

**IMPORTANT:** `repos` must include a source for mighty's internal templates (typically `NovoNordisk-OpenSource/mighty.standards/components`). Without it, mighty cannot resolve the special components used during code generation.
