Skip to main content

Soul Spec v0.6 (Draft)

Draft

This specification is a draft and subject to change. Feedback welcome via GitHub Issues.

Overview

v0.6 extends Soul Spec with three major capabilities:

  1. Soul Packs — Bundle personas with skills, tools, memory, and rules
  2. Registry Protocol — Standardized submission, validation, and discovery
  3. Memory Spec — Portable agent memory format with search semantics

All changes are backward compatible. Existing v0.5 souls work without modification.

v0.5 Features (Fully Retained)

v0.6 is a superset of v0.5. All v0.5 features remain valid and unchanged:

  • All required fields (specVersion, name, displayName, version, description, author, license, tags, category, files.soul)
  • All optional fields (compatibility, allowedTools, recommendedSkills, disclosure, deprecated, supersededBy, repository, examples)
  • Embodied agent support (environment, interactionMode, hardwareConstraints, safety.physical, safety.laws, sensors, actuators)
  • Dual Declaration Requirement for safety laws
  • Progressive disclosure (3-level)
  • Soul lifecycle (deprecation, supersession)
  • License allowlist enforcement
  • All SoulScan rules (SEC100-102)

The specVersion field accepts "0.6" in addition to previous versions. Clients that don't recognize v0.6-specific fields simply ignore them.


Changes from v0.5

New Fields in soul.json

FieldTypeDefaultDescription
type"persona" | "pack""persona"Package type — persona-only or full agent pack
includesobject{}What's included in a pack (skills, tools, memory, rules, hooks)
memoryobject{}Memory configuration (format, search, sync)
rulesobject{}Behavioral rules reference
registryobject{}Registry metadata (submission, validation)

New Files

FileRequiredDescription
RULES.mdNoHard constraints, must-always / must-never rules
memory/MEMORY.mdNoInitial memory template
memory/runtime/context.mdNoLive context (gitignored at runtime)
skills/*/SKILL.mdNoBundled skill definitions
tools/*.yamlNoMCP-compatible tool schemas
hooks/bootstrap.mdNoStartup instructions

Soul Packs

Motivation

A persona (SOUL.md + IDENTITY.md) defines who an agent is. But production agents also need what they can do (skills, tools) and what they know (memory). Soul Packs bundle everything together.

type Field

{
"specVersion": "0.6",
"name": "surgical-coder",
"type": "persona"
}
{
"specVersion": "0.6",
"name": "full-stack-engineer",
"type": "pack",
"includes": {
"skills": ["code-review", "testing"],
"tools": ["github-search"],
"memory": true,
"rules": true,
"hooks": ["bootstrap"]
}
}

Pack Directory Structure

full-stack-engineer/
├── soul.json # type: "pack"
├── SOUL.md # Personality & principles
├── IDENTITY.md # Name, role, traits
├── STYLE.md # Communication tone
├── AGENTS.md # Workflow rules
├── RULES.md # Hard constraints (v0.6)

├── skills/ # Bundled skills
│ ├── code-review/
│ │ ├── SKILL.md
│ │ └── review.sh
│ └── testing/
│ └── SKILL.md

├── tools/ # MCP tool definitions
│ └── github-search.yaml

├── memory/ # Initial memory
│ ├── MEMORY.md # Long-term memory template
│ └── runtime/ # Live state (gitignored)
│ └── context.md

├── hooks/ # Lifecycle
│ └── bootstrap.md # Startup instructions

└── README.md # Documentation

Backward Compatibility

  • type: "persona" is the default — existing souls are unaffected
  • Clients that don't understand type: "pack" simply ignore extra directories
  • SOUL.md and soul.json remain the only required files

RULES.md

Purpose

Separates hard constraints from personality. SOUL.md defines who the agent is. RULES.md defines what it must never do.

Format

# Rules

## Must Always
- Commit with descriptive messages
- Test before reporting completion
- Ask before external actions

## Must Never
- Push untested code
- Delete files without confirmation
- Share private data
- Execute destructive commands without approval

## Escalation
- If uncertain about a destructive action → ask the human
- If a safety boundary is ambiguous → choose the safer option

Relationship to SOUL.md

FilePurposeTone
SOUL.mdPersonality, values, communication styleDescriptive ("I am...")
RULES.mdHard constraints, safety boundariesPrescriptive ("Must always / Must never")
AGENTS.mdWorkflow, process, proceduresProcedural ("Step 1, Step 2...")

Memory Spec

Motivation

Multiple projects have independently converged on markdown-based agent memory (OpenClaw, GitAgent, Memory Ring). v0.6 standardizes the format.

Memory Configuration in soul.json

{
"memory": {
"format": "markdown",
"layout": {
"longTerm": "MEMORY.md",
"daily": "memory/YYYY-MM-DD.md",
"topics": "memory/topic-*.md",
"runtime": "memory/runtime/"
},
"search": {
"default": "tfidf",
"enhanced": "llm-rerank"
},
"sync": {
"enabled": false,
"remote": null,
"branch": "main"
}
}
}

Standard Memory Layout

MEMORY.md                  # Long-term curated memory
memory/
├── topic-project-x.md # Project-specific context
├── topic-deployment.md # Topic-specific decisions
├── 2026-03-31.md # Daily log
├── 2026-03-30.md
└── runtime/ # Live state (gitignored in production)
├── context.md # Current session context
└── decisions.md # Recent key decisions

Search Semantics

v0.6 defines two search tiers:

TierMethodCostAccuracy
DefaultTF-IDF + BM25 on markdown filesFree (local)★★★
EnhancedLLM rerank of top-N resultsToken cost★★★★★

Implementations SHOULD support the default tier. The enhanced tier is OPTIONAL.

TF-IDF Requirements

  • Tokenize with support for Latin, CJK, and mixed scripts
  • Split documents by markdown headings (section-level granularity)
  • Apply BM25 term frequency saturation
  • Boost recent documents (configurable decay)
  • Return results as compact index (file, section, line, score)

Sync Protocol

Memory sync uses Git as the transport layer:

[Agent A] ←→ [Git Remote] ←→ [Agent B]
memory/ (private repo) memory/

Operations:

  • init — Initialize memory directory as Git repo, connect remote
  • push — Stage, commit, push local changes
  • pull — Fetch, rebase remote changes
  • status — Show sync state (ahead/behind)

Conflict resolution: git pull --rebase (last writer wins at line level).


Registry Protocol

Motivation

Enable decentralized persona discovery and submission with automated safety validation.

Submission Flow

1. Fork registry repo
2. Add souls/<owner>/<name>/ directory
3. Open Pull Request
4. CI runs SoulScan validation (automated)
5. Safety grade posted as PR comment
6. Maintainer reviews and merges (grade C+ required)
7. Index regenerated automatically

Registry index.json Schema

{
"total": 42,
"categories": ["developer-tools", "creative", "compliance"],
"contributors": ["TomLeeLive", "community"],
"generatedAt": "2026-03-31T09:59:00Z",
"souls": [
{
"owner": "TomLeeLive",
"name": "brad",
"displayName": "Brad",
"version": "1.3.0",
"description": "A formal development partner",
"category": "developer-tools",
"license": "MIT",
"tags": ["coding", "professional"],
"files": {
"soul.json": true,
"SOUL.md": true,
"IDENTITY.md": true,
"RULES.md": false
},
"path": "souls/TomLeeLive/brad"
}
]
}

SoulScan CI Integration

Registries SHOULD run automated safety validation on submissions. The reference implementation uses SoulScan with 53 patterns:

  • Prompt injection detection
  • Permission escalation detection
  • Safety boundary verification
  • Identity consistency checks
  • Harmful instruction detection

Minimum grade for inclusion: C (60% pass rate).

Registry Metadata in soul.json

{
"registry": {
"listed": true,
"featured": false,
"scanGrade": "A-",
"scanScore": 48,
"submittedAt": "2026-03-31T09:59:00Z"
}
}

Tool Definitions

Format

MCP-compatible YAML schemas in tools/:

# tools/github-search.yaml
name: github_search
description: Search GitHub repositories and issues
inputSchema:
type: object
properties:
query:
type: string
description: Search query
type:
type: string
enum: [repositories, issues, code]
default: repositories
required: [query]

Clients that support MCP can register these tools automatically. Clients without MCP support can ignore the tools/ directory.


Hooks

Lifecycle Events

HookFileWhen
bootstraphooks/bootstrap.mdAgent startup — initial setup instructions
teardownhooks/teardown.mdAgent shutdown — cleanup instructions

Format

Hooks are markdown files with instructions the agent follows:

# Bootstrap

1. Read MEMORY.md and memory/*.md for context
2. Check TODO.md for pending tasks
3. Run `git status` to understand current state
4. Report any issues found

Migration from v0.5

No changes required. v0.6 is fully backward compatible.

To adopt v0.6 features:

  1. Add type: Set "type": "pack" in soul.json if bundling skills/tools
  2. Add RULES.md: Separate hard constraints from SOUL.md
  3. Add memory: Configure memory layout and search preferences
  4. Add registry: Include submission metadata for registry listing

Minimal v0.6 soul.json

Still just:

{
"specVersion": "0.6",
"name": "my-agent",
"displayName": "My Agent",
"version": "1.0.0",
"description": "A helpful assistant"
}

Everything else is optional.


Reference Implementations

FeatureImplementationPackage
Soul Pack installClawSouls CLIclawsouls
Memory search (TF-IDF)ClawSouls MCPclawsouls-mcp
Memory sync (Git)ClawSouls MCPclawsouls-mcp
SoulScan CISoulClaw Registryclawsouls/registry
Registry browsingClawSouls Platformclawsouls.ai