🧬 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: Compile SOUL.md character profiles into synthetic diploid genomes (.genome.json) via trait-to-allele mapping4license: MIT5metadata:6 version: 0.1.07 author: Manuel Corpas8 tags:9 - genomebook10 - synthetic-genomics11 - soul-compiler12 - trait-mapping13 openclaw:14 requires:15 bins:16 - python317 always: false18 emoji: 🧬19 homepage: https://github.com/ClawBio/ClawBio20 os:21 - darwin22 - linux23 trigger_keywords:24 - soul2dna25 - soul compiler26 - soul to genome27 - genomebook compile28 - synthetic genome29 - character genome30---3132# 🧬 Soul2DNA Compiler3334## Purpose3536Compile SOUL.md character profiles into synthetic diploid genomes. Each soul file37describes a historical or fictional figure with trait scores (0.0 to 1.0). The38compiler maps these scores to alleles at defined loci using additive, dominant, or39recessive inheritance models, producing a `.genome.json` file per character.4041## How It Works42431. **Parse SOUL.md** files from `GENOMEBOOK/DATA/SOULS/` extracting identity44 metadata (name, sex, ancestry, domain, era) and trait scores.452. **Load trait registry** (`GENOMEBOOK/DATA/trait_registry.json`) which defines46 loci, alleles, chromosomal positions, dominance models, and effect sizes for47 each trait.483. **Assign genotypes** at each locus based on trait score thresholds:49 - Additive: <0.33 ref/ref, 0.33-0.66 ref/alt, >0.66 alt/alt50 - Dominant: <0.40 ref/ref, 0.40-0.75 ref/alt, >0.75 alt/alt51 - Recessive: <0.50 ref/ref, 0.50-0.80 ref/alt, >0.80 alt/alt524. **Write genome** as JSON with full locus detail, trait scores, and metadata.5354## Input5556- `GENOMEBOOK/DATA/SOULS/*.soul.md` (20 historical figures)57- `GENOMEBOOK/DATA/trait_registry.json`5859## Output6061- `GENOMEBOOK/DATA/GENOMES/<name>-g0.genome.json` per character6263## CLI Usage6465```bash66# Compile all souls to genomes67python skills/soul2dna/soul2dna.py6869# Demo mode (shows summary without writing files)70python skills/soul2dna/soul2dna.py --demo71```7273## Output Format7475Each `.genome.json` contains:7677```json78{79 "id": "einstein-g0",80 "name": "Albert Einstein",81 "sex": "Male",82 "sex_chromosomes": "XY",83 "ancestry": "...",84 "generation": 0,85 "parents": [null, null],86 "loci": { "<locus_id>": { "chromosome": "...", "alleles": ["A","G"], ... } },87 "trait_scores": { "curiosity": 0.95, ... }88}89```