agent-dna
Portable agent identity encoding. Compress SOUL.md/MEMORY.md into transferable DNA fingerprints, detect identity drift between snapshots, and port personality across platforms (OpenClaw, Claude, GPT, CrewAI). Pure Python, zero dependencies. Use when migrating agents between platforms, detecting personality drift, or backing up agent identity.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/cassh100k/agent-dnaAgent DNA - Identity Encoder/Decoder Skill
Version: 0.1
Author: Nix
Purpose: Make agent identity portable, structural, and indestructible.
The Problem
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.
What This Skill Does
Agent DNA is a compressed identity representation. Think git for your personality.
encode.py - Identity Compression
Takes an agent's source files (SOUL.md, MEMORY.md, USER.md, TOOLS.md) and compresses them into a portable .dna.json file containing:
- Core values - ranked by weight, with evidence
- Behavioral signatures - what makes this agent unique (response patterns, decision tendencies)
- Anti-patterns - hard rules the agent must never break
- Relationship map - key people, roles, trust levels
- Skill fingerprint - what tools/capabilities this agent has
- Voice profile - sentence style, tone markers, forbidden phrases
python encode.py --dir /workspace --name Nix --out nix.dna.json
decode.py - Identity Reconstruction
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 section
python decode.py --dna nix.dna.json --format full
python decode.py --dna nix.dna.json --format compact
diff.py - Identity Drift Detection
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
port.py - Platform Export
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/
DNA File Format
A .dna.json file is a JSON structure with these top-level keys:
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-cassh100k-agent-dna": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
compound-mind
Experience distillation engine that turns raw daily memory logs into compounding intelligence. Extracts patterns, generates briefings, tracks growth metrics, and builds a searchable experience index. Agents get permanently smarter - each interaction compounds into wisdom. Use when you want agents that learn from their history instead of starting fresh every session.
Nix Memory
Skill by cassh100k
polymarket-whale-copier
Copy trade winning Polymarket wallets automatically. Track whale wallets, mirror their bets at configurable percentages, with built-in risk management. No API keys needed.
Memory Guard
Skill by cassh100k
image-nuke
Nuclear-grade image metadata cleanser. Strip ALL EXIF/GPS/camera data, re-encode with noise injection. Forensically untraceable, reverse image search resistant.