← 返回 Skills 市场
jhuckobey

Daydreamer

作者 Huck · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ⚠ suspicious
113
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install daydreamer
功能描述
Use this skill when the user says "daydream", "start daydreaming", "force a daydream", "run daydream cycles", or when a scheduled daydream is triggered. Also...
使用说明 (SKILL.md)

Daydreamer Skill

This skill emulates the human act of daydreaming. A Python conductor script (daydream.py, bundled with this skill) handles all mechanical work — cycle counting, random number generation, memory parsing, and state tracking. The agent handles only the creative work: semantic matching, hypothetical reasoning, web searches, analytical questioning, and final synthesis.

Architecture: Script as conductor, agent as musician.

Each cycle's prompt contains the full accumulated context from every previous cycle. The script reads the agent's response after each step, folds it into the running context, and generates the next prompt with everything included. The agent never has to reconstruct state or re-read old files.


Files

The conductor script (daydream.py) is bundled in this skill's directory. All other files are created in the current working directory (workspace root):

File Purpose
Daydreams.MD Numbered list of daily memories. Each line is one memory entry.
Daydreamlog.MD Chronological log of completed daydream sessions and their outcomes.
daydreamer-config.json Persisted configuration (frequency, cycles per session, default daydream type).
ideas/NNN-title.md Standalone idea files — one per daydream session. Auto-numbered.
.daydream-session/ Temporary directory for script↔agent JSON exchange during a session. Cleaned up after finalization.

Prerequisites

  • Python 3.8+ must be installed and available.

Locating the Script

The conductor script daydream.py is in the same directory as this SKILL.md file. To find it at runtime, resolve the path relative to this skill's installation directory. For example:

# If the skill is installed at ~/.claude/skills/daydreamer/
python ~/.claude/skills/daydreamer/daydream.py status

Throughout this document, $SCRIPT refers to the full path to daydream.py in this skill's directory. When executing commands, replace $SCRIPT with the actual resolved path.


Daydream Types

Type Name Output
full Full Daydream Open-ended — can produce an idea, recommendation, question, observation, warning, analogy, or anything else that emerges naturally. No constraints.
idea Idea Generation Focused on producing a novel, actionable idea — something that could be built, implemented, or pursued.

The default type is set in daydreamer-config.json (default_daydream_type). The user can override it per-session.

The traversal mechanics (modes 1–4) are identical for both types. The difference is entirely in the synthesis step — the synthesis prompt includes type-specific instructions telling the agent what kind of output to produce.


First Install

On first use, check whether daydreamer-config.json exists in the workspace root. If it does not exist, perform first-install setup:

  1. Run the init command to create the files:

    python $SCRIPT init
    
  2. Ask about daydream type (this is its own question — do not bundle with other settings):

    "What kind of daydreams would you like as your default?

    • Full — open-ended. Each session can produce anything: an idea, a recommendation, a question, an observation, or something unexpected.
    • Idea — focused. Each session is specifically aimed at generating a novel, actionable idea.

    You can always run the other kind on demand — this just sets what happens by default."

  3. Wait for the user's answer. Update daydreamer-config.json with their choice:

    # For idea mode:
    # Set "default_daydream_type": "idea" in daydreamer-config.json
    # For full mode (already the default):
    # No change needed
    
  4. Ask about schedule and cycles:

    "How often should I daydream, and how many cycles per session?

    Defaults: Once per day, 10 cycles per session. Reply with default to accept, or specify your preferences (e.g., 'twice a day, 15 cycles')."

  5. Wait for the user's answer. Update daydreamer-config.json if they specified custom values.

  6. Confirm setup to the user and explain:

    • Memories will be written here each day as you work.
    • A daydream session can be triggered at any time with /daydream.
    • Automated sessions will run on the configured schedule.
    • To run a different type than the default, say /daydream idea or /daydream full.
  7. Seed starter memories (only when Daydreams.MD is empty or has fewer than 2 entries):

    python $SCRIPT seed-memories
    

    The script outputs a list of Claude Code session log files (JSONL) and how many memories are needed. Read each file and extract meaningful events — decisions made, things built, bugs fixed, requests fulfilled, insights gained. Skip heartbeat checks, empty status polls, and trivial exchanges.

    Write each event as a memory (aim for 50 total):

    python $SCRIPT add-memory "\x3Cmemory text>"
    

    What counts as a meaningful event:

    • A feature or tool the user asked to build
    • A bug diagnosed or fixed
    • A design decision or trade-off made
    • A configuration or workflow set up
    • An insight or pattern observed during the session

    Read log files in reverse-chronological order (most recent first). Stop when you have 50 memories or have exhausted the logs. Tell the user how many memories were seeded.


Slash Command: /daydream

Users can trigger a forced daydream session with /daydream. Parse arguments flexibly:

  • /daydream → default type and cycles
  • /daydream 5 → 5 cycles, default type
  • /daydream idea → default cycles, idea type
  • /daydream idea 5 → 5 cycles, idea type
  • /daydream full 20 → 20 cycles, full type

Recognize full and idea as type keywords. Any number is the cycle count.

When triggered via /daydream, always pass --forced to both start and finalize. This ensures the daily schedule is not affected.


Writing Memories

Memory writing happens once per calendar day (tracked via last_memory_write_date in config).

What to write

Write a memory entry for each meaningful event that occurred during the session. A memory is a single, self-contained observation, experience, decision, or insight.

Memory format

Each memory should be 1–2 sentences capturing WHO, WHAT (the action or request), and WHY (if clear). No timestamps, no verbose detail.

Format: [WHO] [WHAT]. [WHY if clear.]

Good examples:

  • User asked Claude to debug an off-by-one error in the pagination logic; root cause was 0-indexed vs 1-indexed page numbers.
  • User and Claude designed the Daydreamer skill's conductor/musician architecture to separate randomness from creativity.
  • Claude refactored the payment pipeline into smaller services at user's request to improve testability.
  • User asked for database query optimization for large result sets; Claude suggested index-based pagination over OFFSET.
  • Claude observed that the team prefers explicit error types over generic exceptions based on PR review patterns.

Aim for: one clear subject (who), one clear verb (what they did or asked), and context that would help connect this memory to others.

What NOT to write

Do not write entries for:

  • Heartbeat checks that returned no work.
  • Polling loops with no result.
  • Empty status checks.
  • Duplicate or trivially similar entries already in the list.

How to write

Use the conductor script:

python $SCRIPT add-memory "User asked Claude to debug an off-by-one error in the pagination logic; root cause was 0-indexed vs 1-indexed page numbers."

The script handles numbering, dating, and appending automatically.


Daydream Procedure

A daydream session is a conversation between the conductor script and the agent, one cycle at a time. Each cycle builds on the full accumulated context of every previous cycle.

Flow Diagram

Agent                          Script
  |                              |
  |  start --cycles 10           |
  |----------------------------->|  Picks seed, rolls mode 1
  |  prompt_cycle_001.json       |  Writes prompt with seed context
  |\x3C-----------------------------|
  |                              |
  |  [does creative work]        |
  |  response_cycle_001.json     |
  |----------------------------->|
  |                              |
  |  next-cycle                  |
  |----------------------------->|  Reads response 1
  |                              |  Folds into context: seed + cycle 1
  |                              |  Rolls mode 2
  |  prompt_cycle_002.json       |  Writes prompt with FULL context
  |\x3C-----------------------------|
  |                              |
  |  [does creative work]        |
  |  response_cycle_002.json     |
  |----------------------------->|
  |                              |
  |  next-cycle                  |
  |----------------------------->|  Reads response 2
  |                              |  Context: seed + cycle 1 + cycle 2
  |          ...                 |  ...repeats...
  |                              |
  |  next-cycle (after last)     |
  |----------------------------->|  All cycles done
  |  prompt_synthesis.json       |  Writes synthesis with EVERYTHING
  |\x3C-----------------------------|
  |                              |
  |  [writes synthesis]          |
  |  response_synthesis.json     |
  |----------------------------->|
  |                              |
  |  finalize                    |
  |----------------------------->|  Writes log, updates config, cleans up
  |\x3C-----------------------------|

Step 1 — Start the session

python $SCRIPT start --cycles 10

To specify a type:

python $SCRIPT start --cycles 10 --type idea
python $SCRIPT start --cycles 10 --type full

For forced daydreams (won't update schedule):

python $SCRIPT start --cycles 10 --forced
python $SCRIPT start --cycles 5 --type idea --forced

The script outputs JSON with the seed memory, cycle 1's mode, and file paths.

Step 2 — Process cycle 1

Read .daydream-session/prompt_cycle_001.json. It contains:

  • mode / mode_name: Which mode to execute (1–4)
  • accumulated_context: The seed memory text
  • visited_memory_indices: Which memories have been visited
  • all_memories: The full memory bank
  • For Mode 3: target_result_rank (which web search result to use)

Execute the mode (see mode descriptions below). Write a response file:

{
  "selected_memory_index": 15,
  "text": "Brief description of what was found/thought and the memory content",
  "log_entry": "[Cycle 1 | Mode 2] Hypothetical: \"What if X?\" → memory #15"
}

Step 3 — Advance to next cycle

python $SCRIPT next-cycle

The script:

  1. Reads your response for the current cycle
  2. Folds it into the accumulated context
  3. Rolls a new random mode
  4. Writes the next prompt with the full accumulated context from all previous cycles

Read the new prompt and repeat Step 2.

Step 4 — Synthesis

After the last cycle, next-cycle writes prompt_synthesis.json instead of another cycle prompt. This contains the complete accumulated context from every cycle.

Review everything. Think creatively:

  • What unexpected connections emerge between the memories visited?
  • Does the combination suggest a solution, idea, pattern, or question?
  • Consider the original context of each memory — why did it matter?

The synthesis prompt includes a synthesis_instructions field that tells you what kind of output to produce based on the daydream type:

  • Full: Output is unconstrained — report whatever emerged honestly.
  • Idea: Focus on producing a specific, actionable idea.

Follow those instructions when writing your synthesis.

Write .daydream-session/response_synthesis.json:

{
  "synthesis": "2–5 sentences. Content depends on daydream type.",
  "status": "Complete"
}

Use "Inconclusive" if no clear output emerged — describe recurring themes instead.

Step 5 — Finalize

python $SCRIPT finalize

For forced daydreams:

python $SCRIPT finalize --forced

This:

  1. Writes the session report to Daydreamlog.MD
  2. Writes a standalone idea file to ideas/NNN-title.md with the synthesis, memory trail, and cycle log
  3. Updates last_daydream_date (unless forced)
  4. Cleans up .daydream-session/

The finalize output includes an idea_file path pointing to the new idea file.

Step 6 — Present results to the user

This is the most important step. After finalizing, tell the user what you concluded. Present the synthesis directly and conversationally — not as a log entry, but as an idea worth thinking about. Example:

Daydream complete (10 cycles).

Starting from a memory about [seed topic], I wandered through [brief path description]
and arrived at this:

[Synthesis — the actual idea, stated clearly in 2–4 sentences]

Full details saved to ideas/001-the-idea-slug.md and logged in Daydreamlog.MD.

If the session was inconclusive, say so honestly and describe what themes kept recurring — these may be worth exploring deliberately.


Mode Descriptions

Mode 1 — Semantic Association

  • Review the accumulated_context from the prompt.
  • Create a short semantic search query from the most salient concepts.
  • Scan all_memories for the entry most conceptually similar.
  • Prefer memories not in visited_memory_indices.
  • Write response with the matched memory index, text, and log entry.

Mode 2 — Hypothetical Exploration

  • Generate a brief "what if" question inspired by the accumulated context.
  • Think through the hypothetical, drawing on 2–3 thematically related memories from the memory bank.
  • Select the memory most relevant to your conclusion.
  • Write response with the hypothetical, reasoning, selected memory, and log entry.

Mode 3 — Web Search Excursion

  • Construct a focused web search query from the core themes of accumulated context.
  • Perform the search using WebSearch.
  • The prompt includes target_result_rank — use the search result at that position.
  • Summarize the key insight from that result.
  • Find the memory in the bank that most closely matches the web insight.
  • Write response with the search query, insight, selected memory, and log entry.
  • If web search is unavailable: Write a skip response. Note it in the log.

Mode 4 — Analytical Question

  • Formulate a direct, analytical question about the accumulated context. Not a "what if" (that's Mode 2) — instead, ask something that interrogates what's already there: "How does X actually work?", "Does X apply in this context?", "Why did X lead to Y?", "What's the mechanism behind X?"
  • Think through the answer carefully, drawing on the accumulated context and related memories from the memory bank.
  • The answer becomes part of the accumulated context — it deepens understanding rather than branching to new territory.
  • Select the memory most relevant to the answer you arrived at.
  • Write response with the question, your answer, the selected memory, and log entry formatted as: [Cycle N | Mode 4] Question: "{question}" → memory #{index}

Forced Daydream

The user may trigger a daydream at any time with /daydream or "force a daydream". Optional cycle count and type:

/daydream              → default cycles and type
/daydream 5            → 5 cycles, default type
/daydream idea         → default cycles, idea type
/daydream idea 5       → 5 cycles, idea type
/daydream full 20      → 20 cycles, full type

Always pass --forced to both start and finalize.


Scheduled Daydream

Check the schedule:

python $SCRIPT status

If "Daydream is DUE", run a full session (without --forced).

Value Meaning
once_daily One session per calendar day
twice_daily Two sessions per day
every_N_hours Every N hours
manual Only on explicit user request

Utility Commands

python $SCRIPT status                  # Check status
python $SCRIPT add-memory "Description" # Add a memory (WHO + WHAT + WHY format)
python $SCRIPT init                     # First-time setup
python $SCRIPT seed-memories            # Populate starter memories from session logs

Edge Cases

  • Fewer than 2 memories: The script returns an error. Tell the user more memories are needed.
  • Web search unavailable (Mode 3): Write a skip response for the cycle.
  • Same memory selected twice: Accept it — note the repetition in the log.
  • Gaps in memory numbering: The script handles this automatically.
  • Python not installed: Inform the user Python 3.8+ is required.
安全使用建议
This skill appears to do what it says — iteratively 'daydreaming' over stored memories — but it explicitly asks the agent to read session log files and to persist extracted events and the full accumulated context into files. Before installing or enabling it: 1) Review daydream.py (especially the seed-memories and any file-search code) to confirm which filesystem paths it will read and that it does not walk outside a safe workspace. 2) Run the skill only in a dedicated directory that contains non-sensitive logs (set DAYDREAM_WORKSPACE to an isolated folder). 3) Be aware that the skill will write Daydreams.MD, Daydreamlog.MD, ideas/, and .daydream-session; these may contain excerpts of conversations or secrets unless you limit the input files. 4) If you do not want prior conversation logs parsed, do not run the seed step or remove/inspect the Claude Code JSONL files beforehand. 5) If you need higher assurance, request the full daydream.py source (the file is bundled) and check for any code that reads paths outside the workspace, transmits data externally, or executes downloaded code. The medium confidence reflects that parts of the script were truncated in the provided text — reviewing the full script (seed/search behavior) would raise confidence and could move this to 'benign' if it only touches the workspace as stated.
能力评估
Purpose & Capability
The name/description, bundled Python conductor, and use of WebSearch + file Read/Write align with a 'daydream' memory-traversal feature. Requesting no external credentials and only Python 3.8+ is proportionate. However, the skill explicitly instructs the agent to read Claude Code session log JSONL files to 'seed' memories — that capability (reading prior session logs) is consistent with generating memories but is broader than a naive 'idea generator' and should be explicit to users.
Instruction Scope
SKILL.md instructs the script/agent to parse all accumulated memories and (on first install/seed) to identify and read Claude Code session log files, extract 'meaningful events', and write them into Daydreams.MD. It also specifies that each cycle's prompt contains the full accumulated context from every previous cycle. These instructions give the agent wide latitude to read conversation logs and persist potentially sensitive content into new files without tight, automated consent checks.
Install Mechanism
No install spec — instruction-only plus a bundled script. No network downloads or package installs were requested, which is low risk from an install/execution standpoint.
Credentials
No required environment variables or external credentials are declared (which is appropriate). The skill will read and write files under the workspace root, and uses DAYDREAM_WORKSPACE if provided. The risk is not from credentials but from scope: the skill asks to read session log files (which may contain sensitive conversations) and store extracted text in persistent files (Daydreams.MD, Daydreamlog.MD, ideas/), which can leak or permanently store sensitive content.
Persistence & Privilege
always is false and the skill does not request system-wide changes. It creates files and a .daydream-session exchange directory in the workspace and persists session_state.json. That local persistence is expected, but because state and logs accumulate full-context prompts/responses, the skill can cause long-term storage of conversation content in the user's workspace.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install daydreamer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /daydreamer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
Daydreamer 1.0.3 Changelog - Added support for the DAYDREAM_WORKSPACE environment variable to specify the workspace root location for data files. - If DAYDREAM_WORKSPACE is not set, defaults to the current working directory as before. - No other changes to skill functionality or features.
v1.0.2
No user-visible changes in this release. - Internal version bump to 1.0.2. - No changes to functionality, files, or documentation.
v1.0.1
**Changelog for daydreamer v1.0.1** - Added new Python conductor script: `daydream.py` (bundled with the skill, not in `scripts/`). - SKILL.md updated to reference and document the new bundled `daydream.py` location and usage. - Revised instructions to clarify locating and invoking the script from the skill's installation directory. - Added section on resolving `$SCRIPT` path for runtime usage. - No changes to user-facing commands or session logic; documentation only updated for path clarity.
v1.0.0
Daydreamer skill v2.2.0 introduces a rich, documented architecture and detailed user onboarding. - Adds full SKILL.md with architecture overview, file explanations, and guided first-install setup. - Defines two daydream types: 'full' (open-ended) and 'idea' (focused generation). - Introduces persistent config (`daydreamer-config.json`) for schedule, cycles, and type defaults. - Outlines memory writing rules and automation process via a Python conductor script. - Documents how each daydream session cycles through accumulating context and creative synthesis. - Clarifies usage, file locations, and separation of creative (agent) vs. mechanical (script) responsibilities.
元数据
Slug daydreamer
版本 1.0.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

Daydreamer 是什么?

Use this skill when the user says "daydream", "start daydreaming", "force a daydream", "run daydream cycles", or when a scheduled daydream is triggered. Also... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 113 次。

如何安装 Daydreamer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install daydreamer」即可一键安装,无需额外配置。

Daydreamer 是免费的吗?

是的,Daydreamer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Daydreamer 支持哪些平台?

Daydreamer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Daydreamer?

由 Huck(@jhuckobey)开发并维护,当前版本 v1.0.3。

💬 留言讨论