Skip to content

您正在建立的內容

每位代理人需要一組檔案才能正常運作。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

~/.opengoat/workspace-[agentid]/ ├── SOUL.md ├── AGENTS.md ├── IDENTITY.md ├── SPEC_[NAME].md └── cassettes/ ├── ACTIVE_MODE.txt ← 現在建立,於第六節填入內容 └── archive/ ← LIVE_LEDGER 和 KNOWLEDGE 的溢出存檔

CEO workspace — 額外的身份資料夾:

INFO

~/.opengoat/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 時一併建立。


Discord Webhook 網址 — 請先取得這些資訊

每位代理人透過 Webhook 網址向其專屬的 Discord 頻道回報。在撰寫 AGENTS.md 檔案之前,您需要先備妥這些網址。

▶ 貼上此內容到你的 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,並附上兩份檔案:

  1. 您在第二節建立的團隊設計文件

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
~/.opengoat/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
~/.opengoat/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
~/.opengoat/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
~/.opengoat/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: ~/.opengoat/workspace-[agentid]/
- Discord webhook: DISCORD_WEBHOOK_[NAME]
- Cassettes: ~/.opengoat/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: ~/.opengoat/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 中儲存每個檔案

針對每位代理人:

  1. 開啟 workspace:code ~/.opengoat/workspace-[agentid]

  2. 在左側面板按右鍵 -> 新增檔案 -> 貼上內容 -> 儲存

  3. 建立 cassettes 資料夾:

Windows:

mkdir C:\Users\%USERNAME%\.opengoat\workspace-[agentid]\cassettes
mkdir C:\Users\%USERNAME%\.opengoat\workspace-[agentid]\cassettes\archive

Mac:

mkdir -p ~/.opengoat/workspace-[agentid]/cassettes/archive
  1. 在 cassettes 資料夾內建立空白的 ACTIVE_MODE.txt(暫時留空 — 於第六節填入內容)

僅限 CEO — 建立 identity 資料夾:

Windows: mkdir C:\Users\%USERNAME%\.opengoat\workspace-ceo\identity

Mac: mkdir ~/.opengoat/workspace-ceo/identity


步驟三 — 進入下一位代理人前先進行確認

開啟 AGENTS.md。工作階段開始(Session Start)區段是否列出了全部 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-TW
(The token will be read automatically from your .env file)
完成後向 Discord 回報。"

代理人將自動執行:

  1. 驗證令牌
  2. 下載安全代理人檔案
  3. 部署到 ~/.opengoat/agents/security/
  4. 向 Discord 回報「安全代理人已部署」

⚠️ 重要:不要更改安全代理人的 ID、名稱或資料夾路徑。 其他設定檔直接引用此代理人。 更改將破壞技能隔離系統。

收到 Discord 確認後,繼續前往第五節。