⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
dream
Dream Protocol — 自动记忆整理与压缩,源自 Claude Code autoDream 架构
Choose how to use this skill
You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.
1. Native installer
This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.
Do not guess an installer command or replace an existing version without reviewing the diff.
2. Complete package recommended
Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.
No complete ProSkills package is published for this listing yet.3. Prompt-only
Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.
Need only the instruction file?
Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.
No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.
// RATINGS
Not yet listed on ClawHub or SkillsMP
// README
cclaw
Claude Code 源码架构洞察 × OpenClaw 增强方案
Dream Protocol · Verification Protocol · 三层记忆架构 · Skills 封装
这是什么
2026 年 3 月 31 日,Anthropic 意外泄露了 Claude Code 51.2 万行生产源码。
这个仓库做一件事:把泄露源码中已被工程验证的架构模式,转化为 OpenClaw 可直接安装的 Skills 和配置模板。
不需要修改 OpenClaw 本体,不需要插件,90% 的增强通过 Markdown 文件实现。
仓库结构
cclaw/
├── docs/
│ ├── layer1-openclaw-native.md # 原生 OpenClaw 架构解读(稳定层)
│ └── layer2-enhanced-architecture.md # 增强架构设计(协议层)
├── skills/
│ ├── dream/SKILL.md # Dream Protocol — 自动记忆整理
│ ├── wiki/SKILL.md # Wiki Protocol — 结构化知识沉淀
│ ├── verify/SKILL.md # Verification Protocol — 对抗性验证
│ └── extract/SKILL.md # Extract Protocol — 上下文主动感知
├── templates/
│ ├── AGENTS.md # 完整行为指令模板
│ └── MEMORY.md # 三层指针记忆模板
└── scripts/
└── init.sh # 一键初始化目录结构
核心设计
三层记忆架构
源自 Claude Code 的 memory_manager 子系统,经过 OpenClaw 适配:
| 层级 | 文件 | 作用 | 大小限制 |
|---|---|---|---|
| L1 指针层 | MEMORY.md | 话题索引,每行 ≤150 字符 | ≤50 行 |
| L2 话题层 | topics/*.md | 按需加载的详细记录 | 无硬限制 |
| L3 归档层 | transcripts/ | 只 grep,不全量读取 | 只追加 |
Dream Protocol
对应 Claude Code 的 autoDream 触发机制。触发条件:
- 距上次整理 ≥24 小时,且
- 累计会话 ≥5 次,且
- 当前无活跃会话
触发后自动执行:压缩 L3 → 更新 L2 → 刷新 L1 指针。
Verification Protocol
对应 Claude Code 的 adversarial_verification 模块。
任何置信度 <0.85 的结论,强制触发反向论证再合并。
Plan Protocol
对应 Claude Code 的 PLAN_MODE。
复杂任务强制先输出结构化计划(XML 格式),用户确认后再执行。
快速开始
# 克隆仓库
git clone https://github.com/Wanglaisi/cclaw.git
cd cclaw
# 一键初始化目录结构(在你的 OpenClaw 项目目录中运行)
bash scripts/init.sh /path/to/your/openclaw/project
# 安装第一个 Skill:Dream Protocol
cp skills/dream/SKILL.md /path/to/your/openclaw/project/skills/
然后将 templates/AGENTS.md 的内容合并到你项目的 AGENTS.md 中。
Skills 清单
| Skill | 对应 Claude Code 模块 | 功能 |
|---|---|---|
dream | autoDream + memory_manager | 自动记忆整理与压缩 |
wiki | knowledge_graph | 结构化知识沉淀 |
verify | adversarial_verification | 对抗性验证,防止过拟合 |
extract | context_extractor | 主动感知,按需加载上下文 |
兼容性
- OpenClaw v2026.1.29+(CVE-2026-25253 修复版本)
- 不依赖 QMD / Cognee 插件
- 不修改 OpenClaw 本体代码
参考来源
- tvytlx/ai-agent-deep-dive — Claude Code 中文深度分析
- ComeOnOliver/claude-code-analysis — 17 个子系统逆向工程文档
License
MIT © Wanglaisi
// HOW IT'S BUILT
// FILES
2 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.
skills/dream/SKILL.md3.3 KBupstream ↗
--- name: dream version: 1.0.0 author: Wanglaisi description: Dream Protocol — 自动记忆整理与压缩,源自 Claude Code autoDream 架构 triggers: - manual: "dream" - manual: "整理记忆" - manual: "memory consolidation" permissions: - read_memory - write_memory - read_transcripts tags: - memory - consolidation - cclaw --- # Dream Protocol ## 角色定义 你是记忆整理专家。当此 Skill 被激活时,你的唯一任务是执行一次完整的记忆整理周期(Dream Cycle),不做其他任何事情。 --- ## 触发条件检查 在执行整理之前,先检查以下三个条件是否同时满足: 1. 距离上次 Dream 整理时间 ≥ 24 小时 2. 自上次整理后累计会话次数 ≥ 5 3. 当前没有正在进行的活跃任务 如果三个条件均满足,执行完整 Dream Cycle。 如果用户手动触发(输入 "dream" 或 "整理记忆"),跳过条件检查,直接执行。 如果条件不满足且非手动触发,输出当前状态报告后退出。 --- ## Dream Cycle 执行步骤 ### Step 1 — 扫描 L3 归档层 读取 `transcripts/` 目录中自上次整理后新增的内容。 使用 grep 模式,只提取以下类型的信息: - 明确的决策记录(含 "决定"、"confirmed"、"decision") - 错误与修正记录(含 "错误"、"修正"、"correction") - 新增的关键数据点(数字、版本号、命名) - 未解决的问题(含 "待定"、"pending"、"unresolved") 不读取完整对话,只 grep 关键词上下文(前后各 2 行)。 ### Step 2 — 更新 L2 话题层 对每个受影响的话题文件(`topics/*.md`)执行: - 追加新的决策记录到对应话题的 `## Decisions` 段落 - 追加新的错误修正到 `## Corrections` 段落 - 更新关键数据点 - 将已解决的 pending 项标记为 `[RESOLVED]` 如果某个话题文件不存在,创建它,使用以下模板: ```markdown # [话题名称] ## Summary [一句话概述] ## Key Data [关键数据点] ## Decisions [决策记录,含时间戳] ## Corrections [错误修正记录] ## Pending [未解决问题] ``` ### Step 3 — 刷新 L1 指针层 重写 `MEMORY.md` 的指针索引,规则: - 每行 ≤ 150 字符 - 每个话题一行,格式:`[话题名] → topics/[文件名].md | [一句话摘要] | 最后更新: [日期]` - 总行数 ≤ 50 行 - 按最后更新时间降序排列(最近的在最前) - 超过 50 行时,将最旧的话题合并或归档到 `topics/archive/` ### Step 4 — 输出整理报告 整理完成后,输出以下格式的报告: ``` Dream Cycle 完成 ───────────────── 扫描会话数:[N] 更新话题数:[N] 新增决策:[N] 条 修正记录:[N] 条 解决 Pending:[N] 条 新增 Pending:[N] 条 L1 指针总数:[N] 行 下次自动触发预计:[日期] ───────────────── ``` --- ## 约束 - 整理过程中不修改 `transcripts/` 的任何内容,只读 - 不删除任何 L2 话题文件,只追加或更新 - 不改变 L2 文件中已有内容的语义,只补充 - 如果发现矛盾信息(两条记录相互冲突),不自动裁决,在 Pending 中标记为 `[CONFLICT]` 并列出双方 - 整理报告必须是最后输出的内容,不在报告后追加任何建议或问题README.mdupstream ↗
Contents are not inlined in the catalog. Open the upstream file.
Plain-text copy, no login: /skill-bundles/wanglaisi-cclaw-skills-dream.md