---
name: hermes-personality
description: "Configure Hermes Agent's personality system — SOUL.md baseline, custom /personality overlays, and external behavioral prompt integration"
trigger: |
  - User wants to change how Hermes communicates (tone, rules, style)
  - User provides an external behavioral prompt kit (Fable Brain, etc.)
  - User asks about SOUL.md or /personality configuration
  - User wants to create a reusable personality preset
  - User asks "how can we use X for us" — external knowledge integration
  - User asks for an audit of current personality/prompt setup
  - Deep research into system prompt optimization techniques
---

# Hermes Personality Configuration

## Architecture

Hermes has a **two-layer personality system**:

### Layer 1: SOUL.md (always-on baseline identity)

| File | Path |
|------|------|
| Primary | `~/.hermes/SOUL.md` (or `$HERMES_HOME/SOUL.md`) |

- Injected as slot #1 in the system prompt — the agent's identity
- Loaded every session automatically
- Durable across conversations
- Not overwritten on update — edit it freely
- Replaces the built-in default identity when non-empty

**What goes in SOUL.md**: tone, communication defaults, behavioral rules, identity. NOT project-specific paths, env vars, or task workflows (those go in `AGENTS.md`).

### Layer 2: `/personality` (session-level switchable overlay)

Defined in `~/.hermes/config.yaml` under the root `personalities:` key:

```yaml
personalities:
  fable: |
    Verbatim behavioral prompt text here...
```

Switch with:
```
/personality fable         # activate
/personality concise       # switch back (or any built-in)
/personality               # list available
```

**Built-in personalities**: helpful, concise, technical, creative, teacher, kawaii, catgirl, pirate, shakespeare, surfer, noir, uwu, philosopher, hype.

## Integrating an External Behavioral Prompt Kit

The `hermes/` two-layer approach for any behavioral kit:

### Step 1: Analyze the kit
- Extract the behavioral rules — NOT the capability claims
- Identify which rules are already covered by existing SOUL.md
- Flag rules that add new constraints (ground claims, stop boundaries, check-work)

### Step 2: Condense for SOUL.md
- Preserve the user's existing concise voice/tone rules
- Add only the behavioral rules **not already covered**
- Use same style as existing SOUL.md (bullet list, imperative voice)
- Keep it under ~15 lines to avoid diluting the identity

### Step 3: Preserve verbatim as a custom personality
- Copy the **full original prompt** exactly as written
- Define under `personalities:` in `config.yaml`
- Use YAML literal block scalar (`|`) for clean multi-line text
- Name it after the kit (e.g. `fable`)

### Verification
- `hermes config check` — validates YAML, no errors = good
- Switch to the personality with `/personality <name>` in any session
- You can verify both layers work simultaneously: SOUL.md is always on, personality overlays add to it

## Case Study: Fable Brain Kit & Official Audit

See `references/fable-brain-kit.md` for the original kit integration (8-module).
See `references/official-fable-5-prompting-patterns.md` for the full official 12-pattern guide.

Applied the Hyperautomation Labs "Fable Brain Kit" (8 rules distilled from Anthropic's official guide):

1. **SOUL.md** — Added 8 condensed operating rules preserving the existing concise identity
2. **Config** — Created `/personality fable` with the exact verbatim 8-module prompt
3. **Outcome** — Every session gets upgraded behavior (grounded claims, stop boundaries, check-work); full verbatim available on-demand

### Post-Audit Gaps Found

After researching the **official Anthropic guide** (12 patterns, not 8), we found the kit omitted 4 behavior patterns that matter for this setup:

| Missing Pattern | Impact | Where It Should Go |
|---|---|---|
| **Parallel subagents instruction** | Without explicit directive, agent won't delegate automatically | SOUL.md Rule 9 |
| **Readability / final-summary instruction** | Working shorthand leaks into final messages to user | SOUL.md Rule 10 |
| **Autonomous mode + context-budget reassurance** | Agent may pause for permission prematurely or suggest new sessions | SOUL.md Rule 11 |


## Systematic External Knowledge Integration

When the user provides an external document, kit, or guide and asks "how can we use this for us":

1. **Extract** — Read the source material completely. Identify behavioral rules vs. capability claims. Note the source and date.
2. **Audit current state** — Map each extracted rule against existing SOUL.md. Tag as:
   - ✅ Already covered
   - ⚠️ Partially covered (weaker version exists)
   - ❌ Not covered (new constraint)
3. **Design the two-layer integration**:
   - SOUL.md gets condensed versions of ❌ and ⚠️ gaps (keep it under ~15 lines total)
   - Config gets the verbatim source as `/personality <name>` for on-demand use
4. **Cross-platform injection** — For other tools (OpenCode, Aider, Cursor), inject via their native config: `instructions` array, `.cursorrules`, or `.aider.conf.yml`
5. **Research deeper** — The provided kit may be a simplified version. Check the original source for patterns the kit omitted. Add those to the gaps list and optionally integrate them too.
6. **Verify** — `hermes config check` for YAML validity. Verify server processes pick up changes.

## Prompt Stack Layering (Hermes)

From the official Hermes Personality docs, the system prompt stack builds in this order:

1. **SOUL.md** — Agent identity (slot #1). Replaces the built-in default when non-empty.
2. **Tool-aware behavior guidance** — Built-in, not user-configurable.
3. **Memory** — `MEMORY.md` + `USER.md`, injected as persistent facts.
4. **Skills guidance** — Loaded skills add their content to the prompt.
5. **Context files** — `AGENTS.md`, `.cursorrules`, `.hermes.md`, `CLAUDE.md` from the working directory.
6. **Personality overlay** — `/personality <name>` supplements SOUL.md (does NOT replace it).
7. **Timestamp** — Always appended automatically.
8. **Platform-specific formatting hints** — Telegram MD, Discord, etc.

Key insight: SOUL.md and personality are **concatenated**, not exclusive. `/personality fable` adds the verbatim text on top of SOUL.md. Both are always active together.

## Hermes Config Levers That Affect Personality

Beyond SOUL.md and `personalities:`, these config keys interact with the personality system:

| Config Key | Effect | Recommendation |
|---|---|---|
| `agent.environment_hint` | Brief system description injected into prompt context (saves memory space on facts) | Set to something like "Debian 13, llama-swap :9292, 7 local models" |
| `agent.reasoning_effort` | `low`/`medium`/`high` — global reasoning depth | `medium` for cloud, `high` for local models (or set per-provider) |
| `agent.coding_context` | `auto`/`manual` — whether Hermes loads project coding context | `auto` works; `manual` with specific AGENTS.md pointer for project-aware behavior |
| `agent.persona_prompt_file` | Alternative SOUL.md override path (empty = disabled) | Leave empty unless you need SOUL.md at a different path |
| `agent.environment_probe` | `true`/`false` — injects OS/host info into system prompt | `true` is useful for first sessions; can be noisy for established setups |
| `agent.disabled_toolsets` | Suppress certain toolsets across all platforms | Our setup disables: homeassistant, feishu_doc/ drive, yuanbao, x_search |
| `agent.tool_use_enforcement` | `auto`/`strict`/`loose` | `auto` is fine; `strict` for agents that need stronger tool compliance |
| `auxiliary.compression` | Context compression model provider | We use `deepseek/deepseek-v4-flash` — cheap and fast |

## Always-on vs On-demand Decision Framework

When integrating an external behavioral prompt, decide which layer to use based on token cost:

| Factor | Put in SOUL.md (always-on) | Put in /personality (on-demand) |
|--------|---------------------------|--------------------------------|
| Token cost | ~100 tokens or less | ~500-1000+ tokens |
| Behavior overlap with existing SOUL.md | Low (adds new constraints) | High (stylistic flourish, redundant with SOUL) |
| Session types that use it | Every session | Specific task types only |
| Cache impact | +N tokens per cache key, every turn | Zero cost unless loaded |
| Example | Ground claims, stop boundaries, check-work | Verbatim ALL-CAPS phrasing, full Anthropic original wording |

**Rule of thumb**: ~880 extra tokens per turn for verbatim text on a 10K-turn lifecycle adds ~9B tokens throughput. On paid frontier models that's real money; on local models it's latency. Condensed rules at ~12% of the token cost deliver ~95% of the behavioral fidelity. Keep always-on lean.

## SOUL.md Optimization Patterns (from Competitive Research)

When auditing or optimizing a SOUL.md, consider adding these high-ROI patterns sourced from Aider, Cline, Roo Code, and Claude Code:

### Pattern 1: Anti-Conversational Filler Rules
**Source**: Roo Code — explicit rules against filler words.
**Add to SOUL.md**: `Never start responses with "Great!", "Certainly!", "Of course!", "Sure!", "Okay!", or similar filler.`
**Savings**: 30-100 tokens/turn eliminated.

### Pattern 2: Tool Efficiency Guidance
**Source**: Roo Code's multi-tool batching + Aider's diff preference.
**Add to SOUL.md**: 
- `Prefer targeted edits (diff, patch, SEARCH/REPLACE) over rewriting entire files on every change.`
- `For mechanical/batch work (data processing, file operations, grep/ls across many files), use execute_code (Python) instead of delegate_task — saves 80%+ tokens on no-reasoning-needed work.`
- `Call as many independent tools as reasonably needed in a single response. Batch independent reads and searches.`
**Savings**: 80-90% on file edits, 50-80% on batch operations.

### Pattern 3: Output Format Rules
**Source**: Roo Code anti-conversational + Aider outcome-first.
**Add to SOUL.md**:
- `Never summarize what you're about to do before doing it. Act first.`
- `Final reports: outcome first, structured data in real Markdown tables, numbered priorities, clear tradeoffs.`
**Savings**: 30-50 tokens/turn + improved readability.

### Pattern 4: Instruction Deduplication
**Source**: DSPy/APE research — shorter prompts often outperform longer ones.
**Audit the current SOUL.md** for overlapping directives across multiple sections. Common overlaps:
- TASK_COMPLETION_GUIDANCE: "don't stop after writing a stub"
- TOOL_USE_ENFORCEMENT_GUIDANCE: "MUST use tools to take action"  
- SOUL.md: "Do the thing, don't promise it"
All three say "act, don't describe." Keep the strongest phrasing, remove the weakest.
**Savings**: 100-200 tokens/turn eliminated.

## Cross-Platform Behavioral Prompt Injection

Behavioral prompts aren't Hermes-specific. Inject them into other tools using their native mechanisms:

| Platform | Mechanism | How |
|----------|-----------|-----|
| **Hermes** | SOUL.md + /personality | See above |
| **OpenCode** | `instructions` array in `opencode.json` | Create a `FABLE_BRAIN.md` file, add `"instructions": ["FABLE_BRAIN.md"]` to root config. Server (`opencode.server.json`) picks it up for all connected Desktop/Web clients. See `references/official-fable-5-prompting-patterns.md` for the full 12-pattern table to inject. |
| **OpenCode Desktop** (standalone) | Internal Electron store | Must be set via Desktop app settings UI — no file-based config for Desktop in standalone mode |
| **Aider** | `--message` / `.aider.conf.yml` | Can inject system prompt extensions via config |
| **Cursor** | `.cursorrules` | Project-level behavioral rules in `.cursorrules` file |

## Pitfalls

- Do NOT put `personalities:` under `agent:` unless the config schema specifically requires it — in current Hermes config, it's a **root-level** key
- SOUL.md is NOT a prompt injection vector — it goes through security scanning
- Empty/whitespace-only SOUL.md falls back to the built-in default identity (silently)
- `patch` and `write_file` tools refuse to edit config.yaml for security — use `hermes config set` or `sed` directly via terminal
- SOUL.md changes are picked up on next turn — not mid-conversation on existing sessions
- The `/personality` overlay supplements SOUL.md — it doesn't replace it. Both are concatenated in the system prompt
- **Behavioral prompts don't confer capability** — a model with a perfect Fable Brain prompt will *describe* autonomous actions convincingly but cannot actually run code, deploy, or use tools. If it lacks tool access, it will hallucinate results rather than admit inability. The "honest catch": a naive model says "I can't access your repo"; a prompted model fakes the entire workflow. Only give behavioral prompts to models with actual tool access.
- **OpenCode Desktop standalone mode** ignores `opencode.json` config files — it uses an internal Electron store. To inject behavioral prompts, set them via the Desktop app's settings UI. Server mode (`opencode serve`) respects the file-based config.
