🧬 Soul2DNA Compiler
Purpose
Compile SOUL.md character profiles into synthetic diploid genomes. Each soul file
describes a historical or fictional figure with trait scores (0.0 to 1.0). The
compiler maps these scores to alleles at defined loci using additive, dominant, or
recessive inheritance models, producing a .genome.json file per character.
How It Works
- Parse SOUL.md files from
GENOMEBOOK/DATA/SOULS/ extracting identity
metadata (name, sex, ancestry, domain, era) and trait scores.
- Load trait registry (
GENOMEBOOK/DATA/trait_registry.json) which defines
loci, alleles, chromosomal positions, dominance models, and effect sizes for
each trait.
- Assign genotypes at each locus based on trait score thresholds:
- Additive: <0.33 ref/ref, 0.33-0.66 ref/alt, >0.66 alt/alt
- Dominant: <0.40 ref/ref, 0.40-0.75 ref/alt, >0.75 alt/alt
- Recessive: <0.50 ref/ref, 0.50-0.80 ref/alt, >0.80 alt/alt
- Write genome as JSON with full locus detail, trait scores, and metadata.
Input
GENOMEBOOK/DATA/SOULS/*.soul.md (20 historical figures)
GENOMEBOOK/DATA/trait_registry.json
Output
GENOMEBOOK/DATA/GENOMES/<name>-g0.genome.json per character
CLI Usage
# Compile all souls to genomes
python skills/soul2dna/soul2dna.py
# Demo mode (shows summary without writing files)
python skills/soul2dna/soul2dna.py --demo
Output Format
Each .genome.json contains:
{
"id": "einstein-g0",
"name": "Albert Einstein",
"sex": "Male",
"sex_chromosomes": "XY",
"ancestry": "...",
"generation": 0,
"parents": [null, null],
"loci": { "<locus_id>": { "chromosome": "...", "alleles": ["A","G"], ... } },
"trait_scores": { "curiosity": 0.95, ... }
}
1---2name: soul2dna3description: Compiles SOUL.md character profiles into synthetic diploid genomes by mapping trait scores to alleles at defined loci, producing .genome.json files.4license: MIT5---67# 🧬 Soul2DNA Compiler89## Purpose1011Compile SOUL.md character profiles into synthetic diploid genomes. Each soul file12describes a historical or fictional figure with trait scores (0.0 to 1.0). The13compiler maps these scores to alleles at defined loci using additive, dominant, or14recessive inheritance models, producing a `.genome.json` file per character.1516## How It Works17181. **Parse SOUL.md** files from `GENOMEBOOK/DATA/SOULS/` extracting identity19 metadata (name, sex, ancestry, domain, era) and trait scores.202. **Load trait registry** (`GENOMEBOOK/DATA/trait_registry.json`) which defines21 loci, alleles, chromosomal positions, dominance models, and effect sizes for22 each trait.233. **Assign genotypes** at each locus based on trait score thresholds:24 - Additive: <0.33 ref/ref, 0.33-0.66 ref/alt, >0.66 alt/alt25 - Dominant: <0.40 ref/ref, 0.40-0.75 ref/alt, >0.75 alt/alt26 - Recessive: <0.50 ref/ref, 0.50-0.80 ref/alt, >0.80 alt/alt274. **Write genome** as JSON with full locus detail, trait scores, and metadata.2829## Input3031- `GENOMEBOOK/DATA/SOULS/*.soul.md` (20 historical figures)32- `GENOMEBOOK/DATA/trait_registry.json`3334## Output3536- `GENOMEBOOK/DATA/GENOMES/<name>-g0.genome.json` per character3738## CLI Usage3940```bash41# Compile all souls to genomes42python skills/soul2dna/soul2dna.py4344# Demo mode (shows summary without writing files)45python skills/soul2dna/soul2dna.py --demo46```4748## Output Format4950Each `.genome.json` contains:5152```json53{54 "id": "einstein-g0",55 "name": "Albert Einstein",56 "sex": "Male",57 "sex_chromosomes": "XY",58 "ancestry": "...",59 "generation": 0,60 "parents": [null, null],61 "loci": { "<locus_id>": { "chromosome": "...", "alleles": ["A","G"], ... } },62 "trait_scores": { "curiosity": 0.95, ... }63}64```65