跳到正文
cccskills
免费在 GitHub 公开

auto-dream

Background memory consolidation — overnight review, merge, and injection payload for memory files.

中文简介正在准备中。当前显示原文说明。

集成工具Reddit
查看安装方法

包含的文件(7)

  • SKILL.md5.5 KB
  • dream-prompt.md12.2 KB
  • references/concurrency.md7.4 KB
  • references/dream-cycle-testing.md9.3 KB
  • references/headless-cron-patterns.md10.8 KB
  • references/logging-patterns.md11.5 KB
  • references/memory-file-operations.md12.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Background memory consolidation cycle. Scans memory files, finds stale, duplicate, and conflicting entries, consolidates them, synthesizes cross-session insights, builds an injection-ready payload for the next session start, and writes a dated dream report.

When to invoke

  • User says "run dream", "consolidate memories", "clean up memories", "memory maintenance", "deduplicate memories"
  • Cron job at 2 AM nightly via wrapper script: scripts/auto-dream-cron.sh --execute
  • Manual trigger for testing: ./scripts/auto-dream-cron.sh (dry-run by default)

Instructions

When invoked interactively (not via cron), read skills/meta/auto-dream/dream-prompt.md and execute its phases directly. The prompt is self-contained -- it describes the full cycle including safety constraints, file paths, and output formats.

For cron invocation: the dream prompt is passed directly to claude -p and runs as a standalone headless session with no CLAUDE.md, no hooks, no project context. All instructions are embedded in the prompt.

Phases

  1. SCAN — Read all memory files and the recent git log. Write the scan document to ~/.claude/state/dream-scan-{date}.md.
  2. ANALYZE — Identify stale, duplicate, conflicting memories and cross-session patterns. Write analysis to ~/.claude/state/dream-analysis-{date}.md.
  3. CONSOLIDATE — Apply consolidation actions (max 5 changes). Archive stale/merged files, update MEMORY.md atomically.
  4. SYNTHESIZE — Create insight memories from cross-session patterns (max 2 new memories per cycle).
  5. SELECT — Build the injection-ready payload for session start. Write to ~/.claude/state/dream-injection-{project-hash}.md.
  6. REPORT — Write the dream summary to ~/.claude/state/last-dream.md.

Safety constraints (always enforced)

  • Never delete files — archive to memory/archive/, never rm
  • Write the REPORT before executing any CONSOLIDATE filesystem operations
  • Maximum 5 memory changes per cycle — excess items deferred to next cycle
  • Flag conflicts for human review, never auto-resolve
  • Preserve YAML frontmatter when merging; use merged_from field for provenance
  • Memory files are the only write target. Knowledge reaches an agent or skill file through a reviewed human edit, never through this cycle.
  • In dry-run mode (the default), CONSOLIDATE and SYNTHESIZE describe proposed changes only — no filesystem writes. The wrapper script sets DREAM_DRY_RUN_MODE=yes, substituted into the prompt at runtime.

Testing

# Dry run (read-only, no filesystem changes — dry-run is the default)
./scripts/auto-dream-cron.sh

# Full run (execute consolidation)
./scripts/auto-dream-cron.sh --execute

# Check output
cat ~/.claude/state/last-dream.md

# Verify cron registration
python3 ~/.claude/scripts/crontab-manager.py list

Cost estimate

~0.09 USD per nightly run with 50 memory files (~20-30K input tokens at Sonnet pricing). ~33 USD/year for automated overnight operation. Budget capped at 3.00 USD/run via wrapper script.

Cron setup

Use crontab-manager.py (not raw crontab -e) to install. The wrapper script handles PATH, lockfile, logging, budget cap, and dry-run/execute toggle.

# Preview the cron entry
python3 ~/.claude/scripts/crontab-manager.py add \
  --tag "auto-dream" \
  --schedule "7 2 * * *" \
  --command "/home/feedgen/vexjoy-agent/scripts/auto-dream-cron.sh --execute >> /home/feedgen/vexjoy-agent/cron-logs/auto-dream/cron.log 2>&1" \
  --dry-run

# Install (after dry-run testing passes)
python3 ~/.claude/scripts/crontab-manager.py add \
  --tag "auto-dream" \
  --schedule "7 2 * * *" \
  --command "/home/feedgen/vexjoy-agent/scripts/auto-dream-cron.sh --execute >> /home/feedgen/vexjoy-agent/cron-logs/auto-dream/cron.log 2>&1"

# Verify
python3 ~/.claude/scripts/crontab-manager.py verify --tag auto-dream

Note: schedule uses 2:07 AM (off-minute) per cron best practice — avoids load spikes from jobs firing at :00.

Wrapper script details

scripts/auto-dream-cron.sh follows the established headless cron pattern (see skills/content/reddit-moderate/scripts/reddit-automod-cron.sh):

  • flock lockfile prevents concurrent runs
  • --permission-mode auto (never --dangerously-skip-permissions)
  • --max-budget-usd 3.00 caps spend per run
  • --no-session-persistence for clean headless operation
  • envsubst templates dream-prompt.md with project-specific paths at runtime
  • tee to timestamped per-run log file
  • Dry-run by default, --execute for live runs
  • Exit code propagation via PIPESTATUS[0]

Deep References

Load when the task requires detailed guidance beyond the phases above.

SignalReference
Failed cron run, wrapper script setup, budget capreferences/headless-cron-patterns.md
Memory file writes, YAML frontmatter, staleness, mergingreferences/memory-file-operations.md
Dry-run validation, output file verificationreferences/dream-cycle-testing.md
Cron log interpretation, rotation, phase markersreferences/logging-patterns.md
Concurrent runs, lockfile, partial write recoveryreferences/concurrency.md

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

accounts

免费

Manage multiple Claude Code accounts: add, list, check, launch, and install shell aliases for 10+ isolated CLAUDE_CONFIG_DIR profiles.

中文简介正在准备中。当前显示原文说明。

notque/vexjoy-agent4422026年10月17日 更新

Improve architecture across modules by deepening interfaces.

中文简介正在准备中。当前显示原文说明。

notque/vexjoy-agent4422026年10月17日 更新

Assessment: read-only inspection, codebase overview, value analysis, health checks, ADR consultation, decision analysis, multi-perspective critique.

中文简介正在准备中。当前显示原文说明。

notque/vexjoy-agent4422026年10月17日 更新

Jev-driven browser automation: Jev picks operations, programs execute, a text model writes field values only when Jev cannot pick one from the goal.

中文简介正在准备中。当前显示原文说明。

notque/vexjoy-agent4422026年10月17日 更新

Write, compose, integrate, and improve programs that call Jev, TypeSafe's System One judgment model.

中文简介正在准备中。当前显示原文说明。

notque/vexjoy-agent4422026年10月17日 更新

Business operations: strategy, technology, growth, competitive intelligence, support, finance, HR, legal, operations, sales, productivity, product management.

中文简介正在准备中。当前显示原文说明。

notque/vexjoy-agent4422026年10月17日 更新

查看 notque 的全部技能

报告此技能的问题