52 lines
2.9 KiB
Markdown
52 lines
2.9 KiB
Markdown
---
|
||
title: "万字讲透OpenClaw Workspace深度解析"
|
||
type: source
|
||
tags: [OpenClaw, Agent, Workspace, 架构]
|
||
date: 2026-03-21
|
||
---
|
||
|
||
## Source File
|
||
- raw/Agent/万字讲透OpenClaw-Workspace深度解析-2026-03-21.md
|
||
|
||
## Summary
|
||
- 核心主题:OpenClaw workspace 文件体系(AGENTS.md/SOUL.md/USER.md/TOOLS.md/IDENTITY.md/BOOTSTRAP.md)职责划分与最佳实践
|
||
- 问题域:如何通过 workspace 文件让 Agent 从"能工作"变为"好用了",消除每次会话的重复 onboarding
|
||
- 方法/机制:workspace 文件分工(职责定义、性格叙事、用户偏好、工具规范、身份元数据、初始化引导)
|
||
- 结论/价值:7 个核心文件配合构建 Agent 的可预期性,一致性建立信任,信任带来深度协作
|
||
|
||
## Key Claims
|
||
- AGENTS.md = 岗位说明书(功能),SOUL.md = 性格档案(人格),两者必须分离
|
||
- AGENTS.md 最佳长度为 300-500 字,过长反而冲淡重点
|
||
- SOUL.md 是叙事性角色设定,IDENTITY.md 是结构化元数据,两者分工明确
|
||
- TOOLS.md 核心价值在于"什么时候不用"比"什么时候用"更重要
|
||
- memory/ 目录是 Agent 真正的长期记忆载体,Markdown 文件本身是最终存储
|
||
- BOOTSTRAP.md 是一次性初始化引导,完成后必须删除
|
||
|
||
## Key Quotes
|
||
> "一边的人,每次跟 Agent 说话都像重新 onboarding;另一边的人,Agent 已经知道自己是谁、该怎么说话、用户讨厌什么,也记得上次积累下来的东西。" — workspace 价值所在
|
||
> "workspace 是 Agent 的工作台,agentDir 是 openclaw.json 里的配置字段,sessions 是工作日志。三者职责不同,不要混为一谈。" — 核心区分
|
||
|
||
## Key Concepts
|
||
- [[Workspace]]:OpenClaw 中 Agent 的工作台目录(~/.openclaw/workspace/),决定 Agent 怎么工作
|
||
- AGENTS.md:Agent 岗位职责说明书,定义职责边界、场景触发、多 Agent 协调
|
||
- SOUL.md:Agent 性格档案,叙事性角色设定,定义说话风格和价值观
|
||
- USER.md:用户偏好固化文件,减少重复交代
|
||
- TOOLS.md:工具权限声明与使用规范,核心是"什么时候不用"
|
||
- IDENTITY.md:Agent 结构化身份元数据(Name/Creature/Vibe/Emoji/Avatar)
|
||
- BOOTSTRAP.md:一次性初始化引导,完成后删除
|
||
- [[长期记忆]]:memory/ 目录让 Agent 跨会话保留重要信息
|
||
- [[Agent 编排]]:多 Agent 协作通过 AGENTS.md 中的 spawn 规则实现
|
||
|
||
## Key Entities
|
||
- [[OpenClaw]]:AI Agent 框架,workspace 是其核心设计之一
|
||
- [[DracoVibeCoding]]:本文作者,公众号 Draco正在VibeCoding
|
||
|
||
## Connections
|
||
- [[OpenClaw]] ← 包含 ← [[Workspace]]
|
||
- [[Workspace]] ← 由 ← AGENTS.md + SOUL.md + USER.md + TOOLS.md + IDENTITY.md + BOOTSTRAP.md + [[长期记忆]]
|
||
- SOUL.md ← 与 ← IDENTITY.md ← 分工 ← 性格叙事 vs 结构化元数据
|
||
- AGENTS.md ← 协同 ← SOUL.md + USER.md
|
||
- [[长期记忆]] ← 支撑 ← [[Workspace]]
|
||
|
||
## Contradictions
|