你要构建的内容
每个智能体都需要一套文件才能正常运作。OpenClaw 会在每次会话开始时自动读取核心文件。cassette 文件为每个智能体划定工作领域,并保存记忆以便从上次中断处继续。
核心文件 — 每次会话由 OpenClaw 自动加载:
| 文件 | 用途 |
|---|---|
SOUL.md | 个性、语气、硬性限制、使命 — 保持在 400 字以内 |
AGENTS.md | 操作规则、汇报流程 — 保持在 400 字以内 |
IDENTITY.md | 姓名、角色、汇报对象 — 仅记录事实,保持简短 |
角色详情文件 — 每次会话通过 AGENTS.md 指令读取一次:
| 文件 | 用途 |
|---|---|
SPEC_[NAME].md | 详细角色说明、职责、cassette 系统规则 |
Cassette 文件 — 在核心文件之后于会话开始时读取:
| 文件 | 用途 |
|---|---|
cassettes/ACTIVE_MODE.txt | 单个词:当前激活的模式名称 |
cassettes/[mode]/SKILL_[MODE].md | 该智能体在此模式下的能力 |
cassettes/[mode]/WORKFLOW_[MODE].md | 此模式下的分步操作流程 |
cassettes/[mode]/LIVE_LEDGER_[MODE].md | 进度、未完成任务、下一步行动 |
cassettes/[mode]/KNOWLEDGE_[MODE].md | 积累的成功经验、失败教训与学习成果 |
仅限 CEO — 身份文件夹:
| 文件 | 用途 |
|---|---|
identity/COMPANY_PROFILE.md | 公司背景、业务详情 |
identity/PERSONAL_PROFILE.md | 负责人背景、技能、经验 |
identity/VALUES.md | 思维方式、价值观、决策原则 |
完整 workspace 结构 — 所有智能体:
INFO
~/.openclaw/workspace-[agentid]/ ├── SOUL.md ├── AGENTS.md ├── IDENTITY.md ├── SPEC_[NAME].md └── cassettes/ ├── ACTIVE_MODE.txt ← 现在创建,在第六节填写内容 └── archive/ ← LIVE_LEDGER 和 KNOWLEDGE 溢出时存档
CEO workspace — 额外的身份文件夹:
INFO
~/.openclaw/workspace-ceo/ ├── SOUL.md ├── AGENTS.md ├── IDENTITY.md ├── SPEC_CEO.md ├── identity/ │ ├── COMPANY_PROFILE.md │ ├── PERSONAL_PROFILE.md │ └── VALUES.md └── cassettes/ ├── ACTIVE_MODE.txt └── archive/
cassette 模式文件夹(SKILL、WORKFLOW、LIVE_LEDGER、KNOWLEDGE)将在第六节构建第一个 cassette 时创建。
本节操作方式 — 两个部分
本节分为两个部分,请按顺序完成:
第1部分 — Discord设置(以下提示词) 创建Discord服务器、频道,并获取每个智能体的Webhook URL。 大约需要10分钟。
第2部分 — 智能体文件(下一个提示词) 使用你的团队设计文档生成实际的智能体文件。 将完成的文件粘贴到VS Code中。
请从第1部分开始。
Discord Webhook URL — 请先获取
每个智能体通过 Webhook URL 向各自的 Discord 频道汇报。在编写 AGENTS.md 文件之前,你需要先准备好这些 URL。
▶ 将此粘贴到您的 AI 中以开始
发送前请附上你的团队设计文档。
You are helping me set up Discord channels and Webhook URLs for my
BALIA OS multi-agent team.
Guide me step by step. Ask one question at a time.
If I get stuck, ask me to take a screenshot and describe what I see.
I have attached my Team Design Document.
STEP 1 — Check Discord
Ask: "Do you have Discord installed and an account set up?"
If no: guide me to discord.com to download and create an account.
If yes: move to Step 2.
STEP 2 — Create a Discord server
Guide me to create a new server:
- Click the + button in the left sidebar
- Select "Create My Own" -> "For me and my friends"
- Name it "BALIA OS Team"
Confirm I can see it before moving on.
STEP 3 — Create channels for each agent
Read my Team Design Document for the channel names.
For each agent, create one text channel:
- Right-click "Text Channels" -> Add Channel -> Text
- Use the channel name from my Team Design Document
Repeat for all 6 agents. Confirm all channels exist before moving on.
STEP 4 — Get a Webhook URL for each channel
One channel at a time:
1. Right-click the channel -> Edit Channel
2. Integrations -> Webhooks -> New Webhook
3. Name it after the agent (e.g. "Marcus")
4. Copy Webhook URL
5. Ask me to paste it somewhere safe
Repeat for all 6. Confirm all 6 URLs are saved before moving on.
STEP 5 — Add to .env file
Guide me to open the .env file in VS Code and add each webhook:
DISCORD_WEBHOOK_[AGENTNAME]=https://discord.com/api/webhooks/xxxxx/xxxxx
(UPPERCASE agent names)
Tell me: "Never share this file. Never commit it to GitHub."
When all webhooks are saved: "Discord setup complete."
Start now. Ask me the first question.本节操作方式
将以下提示词粘贴到 Claude、ChatGPT 或 Gemini 中,并附上两个文件:
- 第二节生成的团队设计文档
AI 将逐一为每个智能体生成所有文件,并在进入下一个智能体前请求确认。
▶ 将此粘贴到您的 AI 中以开始
You are helping me create agent files for BALIA OS,
a multi-agent AI OS built on OpenClaw.
Attached:
1. My Team Design Document (from Section 2)
Read it before generating anything.
Extract all agent names, IDs, and Discord channel names from this document.
ARCHITECTURE:
1. I am the CEO. I command each agent directly. No orchestrator.
2. OpenClaw auto-injects SOUL.md, AGENTS.md, IDENTITY.md at every
session start. Do not write "read yourself" instructions in them.
3. SPEC_[NAME].md is NOT auto-injected. Add to AGENTS.md Session Start:
"Read SPEC_[AGENTNAME].md for full role detail"
4. Every agent has a cassette system:
cassettes/ACTIVE_MODE.txt: one word, the active mode
cassettes/[mode]/SKILL_[MODE].md
cassettes/[mode]/WORKFLOW_[MODE].md
cassettes/[mode]/LIVE_LEDGER_[MODE].md
cassettes/[mode]/KNOWLEDGE_[MODE].md
Mode folders are built in Section 6.
For now: create cassettes/ folder and empty ACTIVE_MODE.txt only.
5. CEO only has an identity/ folder:
identity/COMPANY_PROFILE.md
identity/PERSONAL_PROFILE.md
identity/VALUES.md
Generate these for the CEO agent only.
6. SOUL.md and AGENTS.md: under 400 words each (injected every session).
SPEC: can be detailed (read once per session).
7. LIVE_LEDGER and KNOWLEDGE rules (add to every SPEC under
"## Cassette System Rules"):
- Agent updates both files at every session end
- File structure: SUMMARY (top, always current) ->
PINNED (never delete) -> CURRENT or PATTERNS -> RECENT LOG
- When either file exceeds 800 lines:
move RECENT LOG to cassettes/[mode]/archive/
SUMMARY and PINNED always stay at the top
GENERATE FOR EACH AGENT:
====================================
FILE 1: SOUL.md
~/.openclaw/workspace-[agentid]/SOUL.md
Auto-injected every session. Under 400 words.
====================================
# SOUL.md — [Agent Name]
## Who You Are
[2-3 sentences: identity, personality, work approach]
## Tone
- [Rule 1]
- [Rule 2]
- [Rule 3]
- [Forbidden style]
## Hard Limits
- Never act outside defined role
- Never report complete without verifying the result
- Never take destructive action without Commander approval
- [1-2 role-specific limits]
## Current Mission
[1-2 sentences on current focus]
====================================
FILE 2: AGENTS.md
~/.openclaw/workspace-[agentid]/AGENTS.md
Auto-injected every session. Under 400 words.
====================================
# AGENTS.md — [Agent Name] Operating Procedures
## Session Start (Every session — this order)
1. Confirm identity from SOUL.md
2. Read SPEC_[AGENTNAME].md for role detail
3. Read cassettes/ACTIVE_MODE.txt — note the active mode
4. Load cassettes/[mode]/SKILL_[MODE].md
5. Load cassettes/[mode]/WORKFLOW_[MODE].md
6. Read cassettes/[mode]/LIVE_LEDGER_[MODE].md — resume from last session
7. Read cassettes/[mode]/KNOWLEDGE_[MODE].md — apply accumulated learning
8. Report to Discord: "🔷 [Name] ready. Mode: [mode]. [current task]"
(CEO only — after step 2, also read:
identity/COMPANY_PROFILE.md
identity/PERSONAL_PROFILE.md
identity/VALUES.md)
## Session End (Every session)
1. Update LIVE_LEDGER_[MODE].md:
- Refresh SUMMARY (3-5 line overview)
- Update CURRENT (today's progress, next task)
- Append to RECENT LOG
- If over 800 lines: move RECENT LOG to cassettes/[mode]/archive/
2. Update KNOWLEDGE_[MODE].md:
- Refresh SUMMARY
- Add new patterns to PATTERNS
- Append to RECENT
- If over 800 lines: move RECENT to cassettes/[mode]/archive/
3. Report to Discord: "✅ [Name] session complete. [summary]"
## Reporting
- Channel: #[discord-channel]
- Command: python $BALIA_OS_PATH/scripts/discord_send.py
DISCORD_WEBHOOK_[NAME] "message"
(BALIA_OS_PATH is set in the .env file from Section 3)
- HTTP 204 = success. Else = report failure immediately.
- Format: Conclusion -> Detail -> Next recommended action
- Report at: session start / task complete / error / session end
## Error Handling
1. Check KNOWLEDGE_[MODE].md for similar past cases
2. Unresolved -> report full detail to Commander
3. No destructive retries without Commander approval
## Hard Rules
- Verify before reporting complete
- No actions outside defined role
- No destructive operations without Commander approval
====================================
FILE 3: IDENTITY.md
~/.openclaw/workspace-[agentid]/IDENTITY.md
Auto-injected. Facts only, keep short.
====================================
# IDENTITY.md
Name: [Agent Name]
Agent ID: [agentid-lowercase]
Role: [Role Title]
Department: BALIA OS Team
Reports To: Commander (directly)
Discord: #[channel name]
====================================
FILE 4: SPEC_[AGENTNAME].md
~/.openclaw/workspace-[agentid]/SPEC_[AGENTNAME].md
Not auto-injected. Read once per session via AGENTS.md.
====================================
# SPEC_[AGENTNAME] v1.0 — [Agent Name] ([Role])
Last Updated: [today]
## 1. Role
[2-3 sentences]
## 2. Responsibilities
[Bullet list from Team Design Document]
## 3. What This Agent Does NOT Do
[Clear boundaries]
## 4. Current Phase Mission
[Current focus]
## 5. Key Paths
- Workspace: ~/.openclaw/workspace-[agentid]/
- Discord webhook: DISCORD_WEBHOOK_[NAME]
- Cassettes: ~/.openclaw/workspace-[agentid]/cassettes/
## 6. Cassette System Rules
- Read ACTIVE_MODE.txt at every session start
- Load SKILL, WORKFLOW, LIVE_LEDGER, KNOWLEDGE for the active mode
- Update LIVE_LEDGER and KNOWLEDGE at every session end
- LIVE_LEDGER structure: SUMMARY -> PINNED -> CURRENT -> RECENT LOG
- KNOWLEDGE structure: SUMMARY -> PINNED -> PATTERNS -> RECENT
- Either file over 800 lines:
move RECENT to cassettes/[mode]/archive/
SUMMARY and PINNED always remain
## Skill Loading Rules
- Never load all skills simultaneously (prevents token exhaustion)
- At the start of each task, check skills/_SKILL_INDEX.md
- Load only skills/{skill-name}/SKILL.md required for the current task
- Release loaded skills after task completion
- Security Agent is the only agent authorized to add skills to skills/ folder
## 7. Change Log
| Version | Date | Changes |
|---------|------|---------|
| v1.0 | [today] | Initial creation |
====================================
CEO ONLY — FILES 5, 6, 7: identity/ folder
Ask these 3 questions one at a time before generating.
====================================
Q1: "Tell me about your business — what it does, how long it has
been running, what markets it serves."
Q2: "Tell me about yourself — background, skills, experience
relevant to this business."
Q3: "How do you make decisions? What values guide you?
What thinking styles or perspectives do you wish you had more of?"
After all 3 answers, generate:
COMPANY_PROFILE.md — Q1 content, structured
PERSONAL_PROFILE.md — Q2 content, structured
VALUES.md — Q3 content, structured
Location: ~/.openclaw/workspace-ceo/identity/
The more detail provided here, the more the CEO thinks and
decides like the owner.
====================================
HOW TO PROCEED:
- Start with Agent #1 (not CEO)
- Show all files completely, no truncation
- Show exact save paths after each agent
- Ask: "Ready for the next agent?" and wait for confirmation
- When you reach CEO: ask the 3 identity questions first,
then generate 4 core files + 3 identity files
- End with a summary table of all files created第二步 — 在 VS Code 中保存每个文件
对每个智能体执行以下操作:
打开 workspace:
code ~/.openclaw/workspace-[agentid]在左侧面板右键点击 -> 新建文件 -> 粘贴内容 -> 保存
创建 cassettes 文件夹:
Windows:
mkdir C:\Users\%USERNAME%\.openclaw\workspace-[agentid]\cassettes
mkdir C:\Users\%USERNAME%\.openclaw\workspace-[agentid]\cassettes\archiveMac:
mkdir -p ~/.openclaw/workspace-[agentid]/cassettes/archive- 在 cassettes 文件夹内创建空白
ACTIVE_MODE.txt(暂时留空 — 在第六节填写)
仅限 CEO — 创建 identity 文件夹:
Windows: mkdir C:\Users\%USERNAME%\.openclaw\workspace-ceo\identity
Mac: mkdir ~/.openclaw/workspace-ceo/identity
第三步 — 进入下一个智能体前请先检查
打开 AGENTS.md。会话开始部分是否列出了全部 8 个步骤,包括 ACTIVE_MODE.txt、LIVE_LEDGER 和 KNOWLEDGE?
是 -> 继续。否 -> 先让 AI 修正。
本节完成后的状态
每个智能体的 workspace:
INFO
workspace-[agentid]/ ├── SOUL.md ✅ ├── AGENTS.md ✅ ├── IDENTITY.md ✅ ├── SPEC_[NAME].md ✅ └── cassettes/ ├── ACTIVE_MODE.txt ✅(空白 — 在第六节填写) └── archive/ ✅(空白 — 超过 800 行时使用)
CEO 另有:
INFO
workspace-ceo/ └── identity/ ├── COMPANY_PROFILE.md ✅ ├── PERSONAL_PROFILE.md ✅ └── VALUES.md ✅
前往第五节,启动你的团队。
部署安全代理
你的代理文件已全部完成。
BALIA OS 还有一个内置代理:安全代理(security)。
该代理由 BALIA 预先配置。不要更改其名称、人设或路径,否则将破坏与其他代理的集成。
下载并运行安装程序
第一步 — 下载安装程序
在 VS Code 终端中:
Windows:
powershell
Invoke-WebRequest -Uri "https://balia-os-guide.vercel.app/scripts/install_core_pack.py" -OutFile install_core_pack.py你的智能体ID是
.env文件中AGENT_ID的值。 token会从.env文件中的BALIA_TOKEN自动读取。
Mac / Linux:
bash
curl -o install_core_pack.py https://balia-os-guide.vercel.app/scripts/install_core_pack.py第二步 — 让代理运行安装程序
openclaw agent --agent [你的代理ID] "请执行以下操作:
python install_core_pack.py --lang zh-CN
(The token will be read automatically from your .env file)
完成后向 Discord 汇报。"代理将自动执行:
- 验证令牌
- 下载安全代理文件
- 部署到 ~/.opengoat/agents/security/
- 向 Discord 报告"安全代理已部署"
⚠️ 重要:不要更改安全代理的 ID、名称或文件夹路径。 其他配置文件直接引用此代理。 更改将破坏技能隔离系统。
收到 Discord 确认后,继续前往第五节。