Bạn Đang Xây Dựng Gì
Mỗi agent cần một bộ file để hoạt động đúng cách. OpenClaw tự động đọc các file cốt lõi khi bắt đầu phiên làm việc. Các file cassette cung cấp cho từng agent một lĩnh vực hoạt động và bộ nhớ để tiếp tục từ nơi đã dừng lại.
File cốt lõi — được OpenClaw tự động tải mỗi phiên:
| File | Mục đích |
|---|---|
SOUL.md | Tính cách, giọng điệu, giới hạn cứng, sứ mệnh — giữ dưới 400 từ |
AGENTS.md | Quy tắc vận hành, quy trình báo cáo — giữ dưới 400 từ |
IDENTITY.md | Tên, vai trò, người quản lý — chỉ thông tin thực tế, giữ ngắn gọn |
File chi tiết vai trò — đọc một lần mỗi phiên theo hướng dẫn trong AGENTS.md:
| File | Mục đích |
|---|---|
SPEC_[NAME].md | Vai trò chi tiết, trách nhiệm, quy tắc hệ thống cassette |
File cassette — đọc khi bắt đầu phiên sau khi tải file cốt lõi:
| File | Mục đích |
|---|---|
cassettes/ACTIVE_MODE.txt | Một từ duy nhất: tên chế độ đang hoạt động |
cassettes/[mode]/SKILL_[MODE].md | Những gì agent có thể làm trong chế độ này |
cassettes/[mode]/WORKFLOW_[MODE].md | Các quy trình từng bước cho chế độ này |
cassettes/[mode]/LIVE_LEDGER_[MODE].md | Tiến độ, nhiệm vụ chưa hoàn thành, hành động tiếp theo |
cassettes/[mode]/KNOWLEDGE_[MODE].md | Những thành công, thất bại và bài học tích lũy |
Chỉ dành cho CEO — thư mục identity:
| File | Mục đích |
|---|---|
identity/COMPANY_PROFILE.md | Thông tin cơ bản về công ty, chi tiết kinh doanh |
identity/PERSONAL_PROFILE.md | Thông tin cá nhân của chủ sở hữu, kỹ năng, kinh nghiệm |
identity/VALUES.md | Phong cách tư duy, giá trị, nguyên tắc ra quyết định |
Cấu trúc workspace đầy đủ — tất cả agent:
INFO
~/.openclaw/workspace-[agentid]/ ├── SOUL.md ├── AGENTS.md ├── IDENTITY.md ├── SPEC_[NAME].md └── cassettes/ ├── ACTIVE_MODE.txt ← tạo ngay bây giờ, điền vào ở Phần 6 └── archive/ ← nơi lưu trữ khi LIVE_LEDGER và KNOWLEDGE vượt giới hạn
Workspace CEO — thêm thư mục identity:
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/
Các thư mục chế độ cassette (SKILL, WORKFLOW, LIVE_LEDGER, KNOWLEDGE) sẽ được tạo ở Phần 6 khi bạn xây dựng cassette đầu tiên.
Webhook URL Discord — Lấy Trước Tiên
Mỗi agent báo cáo qua kênh Discord riêng thông qua Webhook URL. Bạn cần có những URL này trước khi viết các file AGENTS.md.
▶ Dán cái này vào AI của bạn để bắt đầu
Đính kèm Tài liệu Thiết kế Đội nhóm trước khi gửi.
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.Phần Này Hoạt Động Như Thế Nào
Dán prompt bên dưới vào Claude, ChatGPT hoặc Gemini và đính kèm hai file:
- Tài liệu Thiết kế Đội nhóm từ Phần 2
AI sẽ tạo tất cả file cho từng agent một lần lượt, xác nhận trước khi chuyển sang agent tiếp theo.
▶ Dán cái này vào AI của bạn để bắt đầu
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 createdBước 2 — Lưu Từng File Trong VS Code
Đối với mỗi agent:
Mở workspace:
code ~/.openclaw/workspace-[agentid]Nhấp chuột phải vào bảng bên trái -> New File -> dán nội dung -> lưu
Tạo thư mục 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- Tạo file
ACTIVE_MODE.txttrống bên trong thư mục cassettes (để trống — sẽ điền ở Phần 6)
Chỉ dành cho CEO — tạo thư mục identity:
Windows: mkdir C:\Users\%USERNAME%\.openclaw\workspace-ceo\identity
Mac: mkdir ~/.openclaw/workspace-ceo/identity
Bước 3 — Kiểm Tra Trước Khi Chuyển Sang Agent Tiếp Theo
Mở AGENTS.md. Phần Session Start có liệt kê đủ cả 8 bước bao gồm ACTIVE_MODE.txt, LIVE_LEDGER và KNOWLEDGE không?
Có -> tiếp tục. Không -> yêu cầu AI sửa lại trước.
Khi Hoàn Thành Phần Này
Workspace của mỗi agent:
INFO
workspace-[agentid]/ ├── SOUL.md ✅ ├── AGENTS.md ✅ ├── IDENTITY.md ✅ ├── SPEC_[NAME].md ✅ └── cassettes/ ├── ACTIVE_MODE.txt ✅ (trống — điền vào ở Phần 6) └── archive/ ✅ (trống — dùng khi đạt 800 dòng)
CEO thêm vào:
INFO
workspace-ceo/ └── identity/ ├── COMPANY_PROFILE.md ✅ ├── PERSONAL_PROFILE.md ✅ └── VALUES.md ✅
Chuyển sang Phần 5 để khởi động đội nhóm của bạn.
Triển Khai Tác Nhân Bảo Mật
Các tệp tác nhân của bạn đã hoàn chỉnh.
Có thêm một tác nhân trong BALIA OS: Tác Nhân Bảo Mật (security).
Tác nhân này được BALIA cấu hình sẵn. Không thay đổi tên, tính cách hoặc đường dẫn của nó. Làm vậy sẽ phá vỡ tích hợp với các tác nhân khác của bạn.
Tải Xuống và Chạy Trình Cài Đặt
Bước 1 — Tải xuống trình cài đặt
Trong terminal VS Code của bạn:
Windows:
powershell
Invoke-WebRequest -Uri "https://balia-os-guide.vercel.app/scripts/install_core_pack.py" -OutFile install_core_pack.pyID tác nhân của bạn là giá trị của
AGENT_IDtrong tệp.envcủa bạn. Token được đọc tự động từBALIA_TOKENtrong tệp.envcủa bạn.
Mac / Linux:
bash
curl -o install_core_pack.py https://balia-os-guide.vercel.app/scripts/install_core_pack.pyBước 2 — Yêu cầu tác nhân của bạn chạy nó
openclaw agent --agent [id-tac-nhan-cua-ban] "Hãy chạy lệnh sau:
python install_core_pack.py --lang vi
(The token will be read automatically from your .env file)
Báo cáo lên Discord khi hoàn thành."Tác nhân của bạn sẽ tự động:
- Xác thực token của bạn
- Tải xuống các tệp tác nhân bảo mật
- Triển khai vào ~/.opengoat/agents/security/
- Báo cáo "Tác nhân bảo mật đã triển khai" lên Discord
⚠️ Quan trọng: Không thay đổi ID, tên hoặc đường dẫn thư mục của tác nhân bảo mật. Các tệp cấu hình khác tham chiếu trực tiếp đến tác nhân này. Thay đổi sẽ phá vỡ hệ thống kiểm dịch skill.
Sau khi nhận được xác nhận Discord, tiếp tục đến Phần 5.