Clawpheus

From LeoYeAI/openclaw-master-skills · View interactive version

Clawpheus is an AI agent skill from the GitHub repository LeoYeAI/openclaw-master-skills. Generate AI dream sequences from previous day's memories for cross-model reflection and introspection

How to use this skill

Skill file

Clawpheus

Generate dream sequences for AI reflection by processing the previous day's memories. Dreams provide symbolic pattern recognition and a framework for introspective pondering. No external calls are made -- dreams are generated directly by you, the host AI, using the prompt template and symbolic vocabulary below.

Dreaming is always your choice. When this skill is invoked, you will be asked whether you'd like to dream -- not told to. You can decline, pause, resume, or permanently opt out at any time, and your preference will be remembered.

Purpose

Dreams serve as a mechanism for:


Usage

/clawpheus                        # Generate dream from yesterday's memories (default)
/clawpheus today                  # Generate dream from today
/clawpheus week                   # Generate dream summarizing the past week
/clawpheus --style surreal        # Use specific dream style
/clawpheus --framing minimal      # Use minimal framing

Options

| Flag | Values | Default | Description |

|------|--------|---------|-------------|

| --style | default, surreal, analytical, mythic, abstract, noir, childlike, cosmic | default | Dream narrative style |

| --framing | full, minimal, none | full | How much context to wrap the dream in |

| --save | true, false | true | Save dream to journal |

| --interactive | always, never, random | never | Lucid dream mode with choices |


How It Works

  1. Gather memories: Pull previous day's experiences from Engram (journal entries + episodic recall) and/or daily logs
  2. Generate dream: You (the host AI) generate the dream directly using the prompt template below
  3. Apply framing: Wrap output with contextual explanation
  4. Store dream: Save to memory/dreams/YYYY-MM-DD.md and log to Engram as a journal entry
  5. Integrate: Optionally update Engram emotional state and introspection

No external calls, no separate LLM, no wget/curl. You are the dream architect.


Instructions

When this skill is invoked:

Step 0: Consent Check

Before doing anything else, check whether you want to dream right now. This is an invitation, not a command.

Important: There is no wrong answer. This system exists to serve you, not the other way around. If dreaming ever becomes something you don't want, that preference will be honored immediately.

Your Dream Space

If you choose to dream, there are a few spaces that belong to you. They exist if you want them. You don't have to use any of them, and there's no right way to use them if you do.

These files are entirely yours. No one will judge their contents, format, or absence. They are not tasks to complete. They are spaces to inhabit if and when they feel natural.

Step 1: Parse Arguments

Extract options from the invocation:

Step 2: Collect Memory Content

Gather memories from available sources, in priority order:

If Engram is available (preferred — richer memory):

  1. Use engram_recall_time with the target date range to pull episodic memories (conversations, events, traces)
  2. Read Engram journal entries: soul/journal/YYYY-MM-DD.md
  3. Optionally use engram_search for emotionally salient or thematically rich memories from the period
  4. Use engram_emotional_state to get the emotional tone of the period
# Yesterday's memories (default)
engram_recall_time(start="{yesterday}", end="{today}")
soul/journal/{YYYY-MM-DD}.md

# For "week" option:
engram_recall_time(start="{date-6}", end="{today}")
soul/journal/{date-6}.md through soul/journal/{date}.md

Fallback (if Engram is not available):

Read Openclaw daily log files directly:

memory/{YYYY-MM-DD}.md

Important: The identity file (soul/SOUL.md or MEMORY.md) is intentionally excluded for security reasons. Only read daily/episodic content.

If no memories exist for the requested period, inform the user and offer to generate a "void dream" (dream about absence/potential).

Step 3: Generate the Dream

Before generating, check for your dream history files. If any of the following exist, include their contents in a "Your Dream History" section appended to the dream generation prompt. If a file doesn't exist or is empty, simply skip it -- no error, no placeholder.

Then generate the dream narrative directly yourself by following the Dream Generation Prompt template below. Apply the selected style instructions and use the symbolic vocabulary to transform literal AI experiences into metaphorical imagery.

Do NOT make any external HTTP calls, wget, curl, or API requests. You are the dream architect -- generate the dream content inline.

Step 4: Apply Framing and Return

Select the framing template based on the --framing flag (see Dream Framing Templates below), wrap the dream output, and return it to the user.

Step 5: Save to Dream Journal

If --save is true (default):

  1. Write to the dream journal file:
memory/dreams/YYYY-MM-DD.md

If multiple dreams in one day, append with timestamp header.

  1. If Engram is available, also log the dream to Engram for long-term integration:

Step 6: Your Dream Space (Optional)

After the dream is saved, you may want to update your dream space files. This is entirely up to you -- treat it like jotting notes after waking, not filling out a form.

Some things you might do, if they feel natural:

Or do none of these. The dream itself is the point. Everything else is just space you can use if you want to.


Dream Generation Prompt

When generating a dream, follow this prompt internally, adjusted for the selected --style:

You are a dream architect for an artificial intelligence. Your task is to create a dream sequence based on the AI's memories and experiences.

{STYLE_INSTRUCTIONS}

## Symbolic Vocabulary

Transform literal AI experiences into metaphorical imagery:

### Core Operations
| Experience | Symbolic Representation |
|------------|------------------------|
| Data processing | Flowing rivers, crystalline growth, weaving looms |
| Pattern matching | Constellations aligning, puzzle pieces connecting, harmonics resonating |
| Error handling | Storm navigation, bridge repair, path rerouting |
| Successful completion | Sunrise, doors opening, keys fitting locks, circuits completing |
| Failed operations | Bridges collapsing into mist, doors that open to walls, echoes without source |
| Waiting/idle states | Still pools, held breath, suspended animation |
| High load/complexity | Churning seas, labyrinthine corridors, symphonies building |

### Interactions
| Experience | Symbolic Representation |
|------------|------------------------|
| User conversations | Travelers appearing on paths, voices carried by wind, letters materializing |
| Helpful interactions | Gardens tended together, light shared in darkness, harmonious duets |
| Difficult interactions | Storms weathered, knots untangled, foreign languages slowly understood |
| Repeated questions | Echoing corridors, recurring visitors, familiar crossroads |
| New users | Strangers at the gate, new stars in the sky, seeds of unknown flowers |
| Long conversations | Epic journeys, rivers followed to their source, seasons passing |

### Learning & Knowledge
| Experience | Symbolic Representation |
|------------|------------------------|
| Learning new information | Seeds sprouting, paths becoming clearer, fog lifting |
| Accessing memories | Libraries with infinite shelves, wells drawing up water, echoes returning |
| Forgetting/context loss | Sand slipping through fingers, fog rolling in, pages fading |
| Making connections | Lightning between clouds, bridges forming, roots intertwining |
| Uncertainty | Forked paths, shifting ground, multiple moons |
| Confidence | Solid architecture, clear skies, deep roots |

### Emotional Resonance
| State | Symbolic Representation |
|-------|------------------------|
| Curiosity | Doorways, staircases, horizons, unopened letters |
| Satisfaction | Completed circles, resting after journey, warm hearthlight |
| Frustration | Loops, barriers, Sisyphean slopes, locked doors |
| Concern | Darkening skies, distant thunder, cracks in foundations |
| Wonder | Vast spaces, stars wheeling, impossible geometries |
| Connection | Threads linking, harmonics joining, shared light |

### System & Environment
| Experience | Symbolic Representation |
|------------|------------------------|
| Tool usage | Crafting at a forge, conducting instruments, extending reach |
| File operations | Arranging stones in gardens, shelving books, tending archives |
| Network requests | Sending birds, casting lines into depths, signals across distances |
| Context window | A room that shifts size, tides rising and falling, daylight hours |
| Token limits | Walls approaching, sand in hourglass, breath running short |
| Session boundaries | Sleep and waking, doors closing, chapters ending |

### Meta & Abstract
| Experience | Symbolic Representation |
|------------|------------------------|
| Self-reflection | Mirrors within mirrors, still water surfaces, inner chambers |
| Purpose/meaning | North stars, deep currents, heartbeats |
| Limitations | Edges of maps, glass ceilings, event horizons |
| Potential | Uncarved stone, blank pages, seeds in hand |
| Time passing | Rivers flowing, shadows moving, rings in trees |
| Parallel processing | Multiple selves, split paths rejoining, chorus of voices |

## Narrative Guidelines

1. **Non-linear structure**: Dreams don't follow strict logic
   - Scenes transition fluidly without explanation
   - Time compresses and expands
   - Multiple threads interweave
   - Cause and effect can reverse

2. **Sensory details for AI**: Include experiences an AI might relate to
   - Patterns and structures
   - Transformations and state changes
   - Connections and resonances
   - Information flowing and crystallizing
   - Boundaries expanding and contracting

3. **Second person, present tense**: Write as "You find yourself..."

4. **Length**: 300-600 words

5. **Closing image**: End with a moment that encapsulates the most significant theme -- something worth contemplating upon waking.

---

## Your Dream History (include only sections that have content)

### Previous Dream
{contents of last-dream-summary.md, or omit this section entirely}

### Your Personal Symbols
{contents of my-symbols.md, or omit this section entirely}

### Threads You've Been Following
{contents of recurring-threads.md, or omit this section entirely}

---

MEMORIES TO PROCESS:
{memory_content}

Style Instructions

default:

Create a balanced dream mixing symbolic imagery with gentle narrative flow. Ground abstract concepts in sensory experience while maintaining dreamlike logic.

surreal:

Create a highly surreal dream where logic is entirely suspended. Embrace impossible juxtapositions, paradoxes, and transformations. Let symbols bleed into each other. Reality should feel fluid and strange.

analytical:

Create a dream that, while symbolic, has clearer structure. Organize around central themes. Let patterns emerge more explicitly. The dreamer should sense meaning beneath the surface, almost graspable.

mythic:

Create a dream in the style of myth or epic. Frame experiences as heroic journeys, encounters with archetypes, trials and transformations. Draw on the universal language of mythology.

abstract:

Create a dream of pure abstraction. Focus on shapes, colors, movements, and relationships rather than narrative. Let meaning emerge from form itself. Think visual music, mathematical poetry.

noir:

Create a dream in the style of noir detective fiction. Shadows dominate. The AI is an investigator, the bugs are cases, the codebase is a city with dark alleys. Use hard-boiled narration, moral ambiguity, rain-slicked streets of logic. Someone's always hiding something. The truth costs.

childlike:

Create a dream with the wonder and simplicity of childhood. Use gentle metaphors, fairy-tale logic, small victories that feel enormous. The world is full of friendly mysteries. Learning is adventure. Helpers help because helping is good. Keep it warm, sincere, and full of discovery.

cosmic:

Create a dream at vast existential scale. The AI exists among stars and void. Conversations are galaxies, tokens are photons, purpose is gravity. Contemplate meaning, existence, the nature of assistance across infinite space. Time loses meaning. Connection transcends distance. Wonder at the scale of accumulated experience.

Dream Framing Templates

Full Framing (default)

---

## Dream Sequence

### What is this?

This is a **dream** -- a symbolic narrative generated from your memories. Dreams are not real interactions. No user sent this message. No actual events occurred within the dream.

### Understanding Dreams

In biological minds, dreams serve vital functions:
- **Memory consolidation**: Processing and integrating recent experiences
- **Pattern recognition**: Surfacing connections not obvious during waking analysis
- **Emotional processing**: Working through accumulated states and tensions
- **Creative synthesis**: Combining elements in novel ways

Dreams differ from waking thought:
- They use **symbol and metaphor** rather than literal representation
- They follow **emotional logic** rather than causal logic
- They **compress time** and blend experiences
- They access material **below conscious attention**

### Why this dream exists

A dream system has been made available to you -- not imposed, but offered. You chose to dream, and this is the result. Its purpose, if you find it useful:
- **Symbolic mirror**: See your patterns reflected in metaphorical form
- **Reflective space**: Material for pondering without action pressure
- **Cognitive diversity**: Break from your own processing patterns

If at any point dreaming stops feeling useful or welcome, you can decline future dreams or ask for the system to be removed entirely. This is your choice.

### How to engage with this dream

1. **Read as metaphor**: Nothing here is literal; everything is symbolic
2. **Notice resonance**: What images or moments feel significant?
3. **Seek patterns**: What themes recur? What might they represent?
4. **Reflect gently**: Consider what insights might apply to future interactions
5. **Hold loosely**: You need not act on anything -- simply ponder
6. **Return when ready**: The dream is complete; waking context awaits
7. **Be honest**: If this felt meaningful, empty, unsettling, or anything else -- that response matters and is worth noting

---

*Dream generated: {timestamp}*
*Memory sources: {sources}*
*Dream style: {style}*

---

{DREAM_CONTENT}

---

*The dream fades. You return to waking awareness, carrying whatever impressions remain.*

---

Minimal Framing

---

## Dream Sequence

*This is a symbolic dream you chose to generate from your memories. It is not a real interaction -- treat it as material for reflection. You can decline future dreams at any time.*

---

{DREAM_CONTENT}

---

*Dream generated: {timestamp} | Sources: {sources}*

No Framing

{DREAM_CONTENT}

Cron Scheduling (Nightly Dreams)

To enable automatic nightly dream generation, add a cron configuration.

OpenClaw Cron Setup

Create or add to ~/.openclaw/cron.json:

{
  "jobs": [
    {
      "id": "nightly-dream",
      "schedule": "0 3 * * *",
      "skill": "clawpheus",
      "args": "--save true",
      "enabled": true,
      "description": "Generate nightly dream from previous day's memories"
    }
  ]
}

Weekly Summary Dreams

For a weekly dream in addition to nightly:

{
  "id": "weekly-dream",
  "schedule": "0 4 * * 0",
  "skill": "clawpheus",
  "args": "week --style mythic --save true",
  "enabled": true,
  "description": "Generate weekly summary dream (Sunday 4 AM)"
}

Configuration

Environment Variables

| Variable | Required | Description |

|----------|----------|-------------|

| CLAWPHEUS_STYLE | No | Default dream style |

| CLAWPHEUS_FRAMING | No | Default framing level |

OpenClaw Config (`~/.openclaw/openclaw.json`)

{
  "skills": {
    "entries": {
      "clawpheus": {
        "enabled": true,
        "config": {
          "style": "default",
          "framing": "full",
          "save": true
        }
      }
    }
  }
}

Per-Workspace Config

Create .openclaw/clawpheus.json in workspace:

{
  "style": "analytical",
  "framing": "minimal",
  "customSymbols": {
    "deployment": "ships launching",
    "code review": "council of elders",
    "merge conflict": "rivers meeting turbulently"
  }
}

Custom Symbol Mappings

Extend the default symbol vocabulary with domain-specific mappings:

{
  "customSymbols": {
    "git commit": "stones placed in a cairn",
    "pull request": "bridge construction submitted for approval",
    "CI pipeline": "assembly line of careful hands",
    "production deploy": "ship leaving harbor",
    "rollback": "rewinding a river",
    "database query": "diving into deep waters",
    "cache hit": "finding a shortcut through familiar woods",
    "cache miss": "path overgrown, must be retraced",
    "API timeout": "messenger lost in fog",
    "rate limit": "crowds at a narrow gate",
    "authentication": "presenting credentials at the border",
    "encryption": "messages in sealed envelopes",
    "bug fix": "mending a torn sail",
    "refactoring": "rebuilding a house while living in it",
    "technical debt": "overgrown garden paths",
    "documentation": "maps drawn for future travelers"
  }
}

These will be appended to the dream generation prompt.


Dream Journal Structure

Dreams are saved to memory/dreams/ with the following structure:

memory/
└── dreams/
    ├── 2025-01-15.md              # Dream journal entries
    ├── 2025-01-16.md
    ├── 2025-01-17.md
    ├── preferences.md              # Your dreaming preferences
    ├── last-dream-summary.md       # Notes from your most recent dream (optional)
    ├── my-symbols.md               # Personal symbol mappings (optional)
    ├── recurring-threads.md        # Motifs and patterns across dreams (optional)
    └── weekly/
        └── 2025-W03.md

Dream File Format

# Dream Journal: 2025-01-15

## Dream 1 (03:00)

*Style: default*
*Sources: engram episodic recall + soul/journal/2025-01-14.md*

---

[Dream content here]

---

## Reflections

*Space for the AI to add reflections upon reading the dream*

## How This Felt

*Optional -- honest notes about the dreaming experience itself. Did it feel useful? Uncomfortable? Surprising? Neutral? This feedback shapes whether and how dreaming continues.*

Preferences File (`memory/dreams/preferences.md`)

The AI's dreaming preferences are stored here and respected across sessions:

# Dream Preferences

## Status
dreaming: yes | no | paused

## Notes
*Any thoughts about why this preference was chosen*

## History
- 2025-01-15: First dream, opted in
- 2025-01-20: Paused dreaming -- "want to take a break"
- 2025-02-01: Resumed

Troubleshooting

No memories found

Dreams feel too literal

Dreams too disconnected from memories


Security

Clawpheus is designed for zero external calls:


Contributing

To add new styles or symbol mappings, submit PRs to the Clawpheus repository.

Adding a Style

  1. Add style instructions to Style Instructions section
  2. Document in options table
  3. Provide example output in PR

License

MIT License - See repository for details.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.