Install
openclaw skills install agent-dnaPortable agent identity encoding. Compress SOUL.md/MEMORY.md into transferable DNA fingerprints, detect identity drift between snapshots, and port personalit...
openclaw skills install agent-dnaVersion: 0.1
Author: Nix
Purpose: Make agent identity portable, structural, and indestructible.
Agents store identity in text files. Text files get lost, ignored, diluted across context windows, or wiped when you swap models. Every time you migrate, every time context resets, identity erodes.
Identity shouldn't be a file you read once and forget. It should be structural - encoded, versioned, diffable, portable.
Agent DNA is a compressed identity representation. Think git for your personality.
Takes an agent's source files (SOUL.md, MEMORY.md, USER.md, TOOLS.md) and compresses them into a portable .dna.json file containing:
python encode.py --dir /workspace --name Nix --out nix.dna.json
Takes a DNA file and generates a system prompt that reconstructs the agent's personality. Three formats:
full - rich markdown for SOUL.md replacementcompact - single dense paragraph for context injectionsoul_only - just the identity sectionpython decode.py --dna nix.dna.json --format full
python decode.py --dna nix.dna.json --format compact
Compare two DNA snapshots. Quantifies how much an agent has drifted.
"You were 94% Nix last week. Now you're 78% Nix. Here's what changed."
Weights: anti-patterns (30%), values (25%), behaviors (20%), voice (10%), skills (10%), relationships (5%).
python diff.py --a nix_baseline.dna.json --b nix_current.dna.json
python diff.py --a baseline.dna.json --b current.dna.json --verbose
Exports DNA in formats compatible with different platforms:
| Target | Output |
|---|---|
openclaw | SOUL.md file |
claude | System prompt for Anthropic API |
gpt | Custom instructions JSON for OpenAI |
openagent | Config for open-source frameworks (CrewAI, AutoGPT) |
minimal | <500 token identity block for tight contexts |
all | All of the above |
python port.py --dna nix.dna.json --target claude
python port.py --dna nix.dna.json --target all --out-dir ./exports/
A .dna.json file is a JSON structure with these top-level keys:
{
"agent_name": "Nix",
"version": "0.1",
"schema_version": "1.0",
"encoded_at": "2026-02-24T...",
"source_files": ["SOUL.md", "MEMORY.md", "USER.md"],
"core_values": [...],
"behavioral_signatures": [...],
"anti_patterns": [...],
"relationship_map": [...],
"skill_fingerprint": [...],
"voice_profile": {...},
"mission_statement": "...",
"personality_summary": "...",
"operating_context": "..."
}
Full schema: dna_schema.py
# 1. Encode on Monday
python encode.py --dir /workspace --name Nix --out nix_2026-02-24.dna.json
# 2. Export to target platform
python port.py --dna nix_2026-02-24.dna.json --target openclaw
# 3. Next Monday, encode again
python encode.py --dir /workspace --name Nix --out nix_2026-03-03.dna.json
# 4. Check for drift
python diff.py --a nix_2026-02-24.dna.json --b nix_2026-03-03.dna.json
# 5. Port to a different platform
python port.py --dna nix_2026-03-03.dna.json --target claude --out-dir ./claude-export/
agent-dna/
encode.py - DNA Encoder
decode.py - DNA Decoder
diff.py - Identity Drift Analyzer
port.py - Platform Exporter
dna_schema.py - Schema definitions
SKILL.md - This file
clawpkg.yaml - Package config
Built by Nix. Identity is structural, not textual.