Your AI executive team on Discord. 7 specialized agents — Engineering, Finance, Marketing, DevOps, Legal, Management, Chief of Staff. One-click setup on any free-tier server. Built on Clawdbot.
中文说明 | 🏛️ 中文朝廷版 AI Court (Chinese)
🏢 Become CEO — Your AI Executive Team on Discord
5-Minute Setup · 7 AI Agents · Zero Code · Modern Management × AI Automation
One server + OpenClaw = a 7-person executive team that works 24/7.
You're the CEO. Your AI C-suite handles the rest.
Ship features. Track spend. Write content. Run standup. Deploy to prod. Type one message in Discord — your team handles the rest.
TL;DR — Run bash <(curl -fsSL https://raw.githubusercontent.com/wanikua/become-ceo/main/setup.sh) on any Linux server. 5 minutes later you have 7 AI agents on Discord: Engineering, Finance, Marketing, DevOps, Legal, Management, and a Chief of Staff that coordinates them all. They remember context, use real tools (GitHub, Notion, browser, cron), and work 24/7 on autopilot. Cost: ~$15–30/month in API calls.
>
🍎 macOS?bash <(curl -fsSL https://raw.githubusercontent.com/wanikua/become-ceo/main/install-mac.sh)· Already have OpenClaw?bash <(curl -fsSL https://raw.githubusercontent.com/wanikua/become-ceo/main/install-lite.sh)
See it in action
You: @Engineering build me a user auth API with JWT
Engineering: On it. [opens thread, writes code, pushes to GitHub]
You: @Finance how much did our API calls cost this month? Finance: $47.23 — up 30% from last month. Want me to find where the spike is?
You: @everyone Monday standup. What's everyone working on? Everyone: [Each agent reports in with their status]
What you get in 5 minutes
- 🤖 7 specialized AI agents, each with their own Discord bot, personality, and expertise
- 🧠 Persistent memory — agents remember your codebase, your budget, your preferences
- 🛠️ 60+ real tools — GitHub, Notion, browser, cron, TTS, + hundreds more on ClawdHub
- ⏰ 24/7 autonomous operation — scheduled tasks run while you sleep
- 💰 Smart cost control — strong models for heavy work, fast models for everything else
- 🔒 Sandboxed execution — optional Docker isolation for safe code execution
📌 About Originality — This project is the English adaptation of AI Court Tutorial (first commit 2026-02-22), the original implementation of "ancient governance systems as AI multi-agent orchestration." We noticed cft0808/edict (first commit 2026-02-23, ~21 hours later) shares highly similar framework choices, SOUL.md personality files, deployment methods, and competitor comparison tables — see Issue #55.>
Redistribution welcome — please credit the source.
Why This Setup?
| | ChatGPT / Web UIs | AutoGPT / CrewAI / MetaGPT | Become CEO ✅ | |---|---|---|---| | Multi-agent collab | ❌ Single generalist | ⚠️ Python orchestration required | ✅ Config file — zero code | | Independent memory | ❌ Forgets between sessions | ⚠️ Roll your own vector DB | ✅ Each agent has its own workspace + persistent files | | Tool integrations | ⚠️ Limited plugins | ⚠️ Build them yourself | ✅ 60+ built-in (GitHub, Notion, browser, cron…) | | Interface | Web browser only | CLI / custom UI | ✅ Discord — phone, tablet, desktop | | Setup time | None (SaaS) | Hours of Docker + coding | ✅ 5 minutes, one script | | Always-on | ❌ Manual conversations | ⚠️ Requires setup | ✅ Cron tasks + heartbeat self-checks | | Cost control | ❌ Fixed subscription | ⚠️ Manual | ✅ Per-agent model tiers (save ~5×) |
The core difference: this isn't a framework — it's a finished product. Run one script, get a working team. @mention anyone, they respond.
Table of Contents
- Discord as Your Company HQ — Channel architecture, voice control, TTS config, bot setup
- Multi-Agent Collaboration Deep-Dive — Delegation, error handling, monitoring, escalation, workflow templates
- Notion Integration — Auto-archiving, daily/weekly reports, knowledge graph, relations & rollups, executive dashboard, incident post-mortems, backup & sync
- GitHub Integration — Issue triage, PR management, code review, CI/CD automation, repo analytics, branch protection, release automation, multi-repo management, GitHub Projects, workflow templates, security scanning, conventional commits, GitHub Discussions
- Browser Automation — Web scraping, social media management, screenshot verification, form automation, competitive analysis, multi-step workflows, browser profiles, error recovery, responsive testing, accessibility testing, PDF generation, cron integration, capability matrix, automation recipes
- Cron & Scheduled Tasks — Daily reports, monitoring & alerting, auto-archiving to Notion, cron chains, event-driven cron, self-adjusting schedules, observability, cost management, migration guide, dependency graph, full integration map, troubleshooting
- Recommended Skills from ClawdHub — 12 curated skills (email, calendar, weather, GitHub trending, HN, Docker, RSS, Slack bridge, AI image gen, system monitor, screenshot diff, automation workflows), skill combinations & synergies, build your own skills, governance & security, version management, auditing
- Architecture — How it works under the hood
- Your Team — The 7 agents and their roles
- Core Capabilities — What makes this different
- Prerequisites — What you need before starting
- Quick Start — Get running in 5 minutes
- What It Looks Like — Real usage examples
- Config Deep-Dive — Customize everything
- Growing Your Team — Add new specialists
- Personalizing Your Workspace — 30 scenario templates across 6 files, one-page QUICKSTART.md cheat sheet, 5 getting-started combos, growth guide
- Built-In Skills (60+) — Full skill category breakdown
- FAQ — Common questions answered
- Troubleshooting — Fix common issues fast
Discord as Your Company HQ
Your Discord server isn't just a chat room — it's your entire company headquarters. Here's how to structure it:
Recommended Channel Layout
🏢 YOUR COMPANY
├── 📋 GENERAL
│ ├── #lobby — casual chat, ask anyone anything
│ ├── #announcements — company-wide updates
│ └── #standup — daily automated standups (cron → here)
│
├── ⚔️ ENGINEERING
│ ├── #dev-general — architecture discussions, code questions
│ ├── #code-review — @Engineering reviews PRs here
│ ├── #bugs — bug reports, @Engineering triages
│ └── #deployments — release notes, deploy status
│
├── 💰 FINANCE
│ ├── #budget — cost tracking, spend reports
│ └── #billing-alerts — automated cost spike notifications
│
├── 🎭 MARKETING
│ ├── #content — blog drafts, social media posts
│ ├── #brand — design feedback, brand guidelines
│ └── #analytics — engagement metrics, campaign results
│
├── 🔧 DEVOPS
│ ├── #infrastructure — server status, scaling decisions
│ ├── #monitoring — automated alerts, uptime checks
│ └── #incidents — postmortems, incident response
│
├── 👔 MANAGEMENT
│ ├── #projects — project tracking, milestones
│ ├── #hiring — job descriptions, candidate pipeline
│ └── #meetings — meeting notes, agendas
│
├── ⚖️ LEGAL
│ ├── #compliance — policy reviews, regulatory updates
│ └── #contracts — contract drafts, NDA tracking
│
└── 🤖 META
├── #bot-logs — agent activity logs
└── #bot-config — configuration discussions
Why This Structure Works
- Department isolation — Engineering discussions don't clutter Finance's view
- Focused context — when you
@Engineeringin#code-review, the agent has channel context about what's being reviewed - Auto-threading — complex tasks spawn threads automatically, keeping channels clean
- Cron targeting — schedule daily standups to post in
#standup, cost alerts to#billing-alerts - Onboarding — new team members instantly see the org structure and know where to go
Channel Permissions Tip
Restrict each bot's write permissions to relevant channels only. Engineering doesn't need to post in #compliance. This keeps things organized and prevents cross-talk:
#code-review → @Engineering bot: Send Messages ✅
#budget → @Finance bot: Send Messages ✅
#content → @Marketing bot: Send Messages ✅
💡 All bots should have Read access everywhere so they understand company context when asked cross-functional questions. Just restrict write access to keep channels focused.
Voice Channels — Command Your Team by Voice
Discord voice channels open up a powerful workflow: talk to your AI team instead of typing.
🏢 YOUR COMPANY
├── 🔊 VOICE
│ ├── 🔊 war-room — voice-to-text → all agents listen
│ ├── 🔊 engineering-sync — voice standup with Engineering
│ └── 🔊 brainstorm — creative sessions with Marketing
How it works:
- Join a voice channel and speak
- Discord's built-in voice-to-text transcribes your speech
- The transcription appears as a text message → agents pick it up and respond
- Agents can respond with TTS (text-to-speech) for a full voice conversation
You (voice): "Engineering, what's the status on the API refactor?" Engineering: 🔊 "Three endpoints done, two remaining. The auth middleware is the bottleneck — should be wrapped up by end of day."
You (voice): "Finance, are we still under budget this month?" Finance: 🔊 "Yes, $38 spent against a $50 budget. Engineering's strong model usage is 60% of that."
💡 TTS is a built-in OpenClaw skill — agents can respond with voice automatically. Configure it in your agent's identity to enable voice responses in voice channels.
Running a Team Meeting by Voice
Discord voice channels let you run a full executive meeting — speak your agenda, and each agent responds in turn:
You (voice): "Alright team, let's do a quick sync. Engineering, go first."
Engineering (TTS): "Auth refactor is 80% done. Blocked on the OAuth provider
docs being outdated. I worked around it — PR is up for review."
You (voice): "Good. Finance, any budget concerns this week?" Finance (TTS): "We're at $34 of $50 budget. Engineering's strong model usage spiked Tuesday during the refactor — I'd recommend switching to fast model for code review tasks to save about $8/week."
You (voice): "Marketing, what's the content pipeline look like?" Marketing (TTS): "Two blog posts drafted. SEO analysis shows we should target 'AI automation' keywords — I'll adjust the headlines. Want me to post the first one today?"
You (voice): "Yes, publish it. DevOps, are we good on infrastructure?" DevOps (TTS): "All green. SSL cert renews in 12 days — I'll handle it automatically. Uptime is 99.97% this month."
The entire meeting happens hands-free. You don't touch a keyboard.
Voice Notification Routing
Configure agents to proactively speak up when something urgent happens — even if you didn't ask:
# Finance detects a cost anomaly via scheduled cron check
Finance (TTS): "⚠️ Heads up — API spend jumped 40% in the last 2 hours.
Looks like Engineering's coding agent is in a loop.
Want me to flag Engineering to investigate?"
You (voice): "Yes, do it." Finance: → spawns task to Engineering Engineering (TTS): "Found it — the retry logic had no backoff. Fixing now."
This turns Discord into a real-time operations center where your AI team monitors, reports, and escalates — all by voice.
Combining Text + Voice Workflows
You don't have to pick one or the other. The most effective workflow combines both:
| Task | Best Channel | |------|-------------| | Quick status checks | 🔊 Voice — fastest way to get updates | | Detailed code review | 💬 Text — you want to see the code | | Brainstorming | 🔊 Voice — faster back-and-forth, less typing | | Complex instructions | 💬 Text — precise, referenceable, can include links/code | | Meeting summaries | 💬 Text — agents auto-post written summaries after voice meetings | | Urgent alerts | 🔊 Voice — grabs your attention immediately |
💡 Pro tip: After a voice meeting, ask the Chief of Staff to "summarize what we just discussed and post it to #standup." You get the speed of voice with the permanence of text.
Enabling TTS for Your Agents
To make an agent respond with voice, enable TTS in their identity configuration:
{
"id": "engineering",
"identity": {
"name": "Engineering",
"theme": "You are the Engineering lead. Direct, working solutions.",
"emoji": "⚔️"
},
"tts": {
"enabled": true,
"voice": "alloy"
}
}
Each agent can have a different voice — give Engineering a deep, authoritative tone and Marketing something more upbeat. Your team literally sounds different, making it easy to know who's talking in a voice channel.
💡 OpenClaw's built-in tts skill converts text to speech on the fly. For advanced voice options (custom voices, multilingual), check out the ElevenLabs TTS integration on ClawdHub.
Discord Bot Threads — Auto-Organized Work
When an agent works on a complex task, OpenClaw automatically creates a Discord thread to keep the main channel clean:
#dev-general
├── 💬 You: @Engineering refactor the auth module
│ └── 🧵 Thread: "Auth Module Refactor"
│ ├── Engineering: Here's my plan...
│ ├── Engineering: PR ready — github.com/you/app/pull/42
│ └── Engineering: ✅ Merged. Auth module now uses refresh tokens.
│
├── 💬 You: @Engineering set up rate limiting on the API
│ └── 🧵 Thread: "API Rate Limiting"
│ └── Engineering: Working on it...
Threads keep your channels scannable. You see the high-level request in the channel; the detailed work lives in the thread. No more scrolling through 50 messages of code output to find the next conversation.
Bot Status & Presence
Your bots show as "online" in Discord's member list, making your AI team feel like real coworkers. You can customize their status to show what they're working on or their current availability:
👥 ONLINE — 8
⚡ Chief of Staff — Watching the team
⚔️ Engineering — Coding
💰 Finance — Reviewing spend
🎭 Marketing — Drafting content
🔧 DevOps — Systems nominal
👔 Management — Tracking projects
⚖️ Legal — Reviewing contracts
👤 You — Being the CEO
Creating 7 Discord Bots — Step by Step
This is the most time-consuming part of setup (~10 minutes). Here's the exact process:
For each of the 7 roles (Chief of Staff, Engineering, Finance, Marketing, DevOps, Management, Legal):
- Go to discord.com/developers/applications
- Click "New Application" → name it (e.g., "Engineering")
- Go to Bot tab → click "Add Bot"
- Under Privileged Gateway Intents, enable:
@everyone to work)
- Click "Reset Token" → copy the token → paste into
openclaw.json - Go to OAuth2 → URL Generator:
bot, applications.commands
- Bot Permissions: Send Messages, Read Message History, View Channels, Create Public Threads, Send Messages in Threads, Use Slash Commands
- Copy the generated URL → open it → select your server → authorize
💡 Naming tip: Name each application exactly like its role (Engineering, Finance, etc.) so you can tell them apart in the Developer Portal. Upload a unique avatar for each bot to make your Discord server feel alive.
⚠️ Common mistake: Forgetting to enable Message Content Intent. Without it, your bot connects to Discord but receives empty messages — it looks online but never responds. This is Discord's privacy restriction, not an OpenClaw bug.
Multi-Agent Collaboration Deep-Dive
Your agents aren't just individual bots — they can delegate work to each other. This is the core mechanism that turns 7 independent agents into a coordinated team.
How Sub-Agent Delegation Works
When an agent needs help from another specialist, it uses sessions_spawn to create a background task assigned to that specialist. The spawned agent works independently and reports back when done.
┌──────────────────────────────────────────────────────────────┐
│ You: @Chief of Staff "Launch the new product page" │
└──────────────┬───────────────────────────────────────────────┘
▼
┌──────────────────────────────────────┐
│ Chief of Staff (orchestrator) │
│ Breaks task into sub-tasks: │
│ │
│ sessions_spawn → Engineering │
│ "Build landing page with Next.js" │
│ │
│ sessions_spawn → Marketing │
│ "Write hero copy + CTA text" │
│ │
│ sessions_spawn → DevOps │
│ "Set up Vercel deployment" │
└──────┬───────────┬───────────┬───────┘
▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐
│ Eng │ │ Mktg │ │ DevOps │ ← work in parallel
│ (Code) │ │ (Copy) │ │(Deploy)│
└───┬────┘ └───┬────┘ └───┬────┘
└───────────┴───────────┘
▼
┌──────────────────────────────────────┐
│ Chief of Staff collects results │
│ Posts combined update to Discord │
└──────────────────────────────────────┘
Each spawned sub-agent runs in its own isolated session — they don't interfere with each other, and each has full access to the skill layer (GitHub, Notion, browser, etc.).
Configuring Sub-Agent Permissions
Not every agent should be able to spawn every other agent. Use subagents.allowAgents to define who can delegate to whom:
{
"id": "main",
"identity": { "name": "Chief of Staff", "emoji": "⚡" },
"subagents": {
"allowAgents": ["engineering", "finance", "marketing", "devops", "management", "legal"],
"maxConcurrent": 8
}
}
| Config Key | What It Does | |------------|-------------| | allowAgents | Whitelist of agent IDs this agent can spawn tasks for | | maxConcurrent | Max number of sub-agent sessions running at the same time |
Recommended permission structure:
| Agent | Can Delegate To | Why | |-------|----------------|-----| | Chief of Staff | Everyone | Central coordinator — needs full access | | Engineering | DevOps | Needs to trigger deployments after code changes | | Finance | — | Doesn't need to spawn others | | Marketing | — | Works independently | | DevOps | Engineering | May need code fixes for infra issues | | Management | Everyone | Project coordination requires cross-team access | | Legal | — | Works independently |
To give Engineering delegation access to DevOps, add:
{
"id": "engineering",
"subagents": {
"allowAgents": ["devops"]
}
}
Real Example: Chain of Delegation
Here's what happens when you ask Chief of Staff to handle a complex, cross-functional task:
You: @Chief of Staff We got a security vulnerability report.
Handle it end to end.
Chief of Staff: Understood. Triaging now. Here's the plan:
→ Spawning Engineering: review the CVE, patch the affected code, write tests → Spawning Legal: assess disclosure obligations and timeline → Spawning DevOps: prepare hotfix deployment pipeline
[Engineering works in background — reads the codebase, writes patch, pushes PR] [Legal works in background — checks compliance requirements] [DevOps works in background — sets up fast-track deploy]
Chief of Staff: ✅ All teams reported back: • Engineering: patch merged (PR #87), tests passing • Legal: no mandatory disclosure required for this severity, but recommends a changelog entry • DevOps: hotfix deployed to production, rollback ready
Shall I have Marketing draft a security update blog post?
The CEO gave one command. Three agents worked in parallel. Chief of Staff orchestrated everything and reported a unified result.
Direct Agent-to-Agent Messaging
Beyond spawning sub-tasks, agents can also send messages to each other's active sessions using sessions_send. This is useful for real-time coordination:
# Engineering finishes a feature and notifies DevOps directly
Engineering → sessions_send(agentId: "devops"):
"Feature branch auth-v2 is ready. Please deploy to staging."
DevOps: "Deploying auth-v2 to staging... Done. Staging URL: https://staging.example.com — running smoke tests now."
The difference:
sessions_spawn— creates a new isolated session for a specific task (fire-and-forget)sessions_send— sends a message into an existing session (real-time coordination)
Supervisor / Watchdog Pattern
You can configure an agent to act as a supervisor that monitors other agents' work. Add a cron job that periodically checks on active sessions:
# Every 2 hours, Management reviews what everyone is working on
openclaw cron add \
--name "team-check-in" --agent management \
--cron "0 /2 " \
--message "Check all active agent sessions. Report: who's working on what, anything stuck or idle for >1 hour, any tasks that need escalation." \
--session isolated --token <your-token>
Management becomes a project oversight layer — catching stuck tasks, flagging blockers, and keeping you informed without you having to ask.
Error Handling & Resilience
Real work fails sometimes. Sub-agents can time out, hit API errors, or produce bad results. Here's how to handle it:
Timeouts: Set runTimeoutSeconds on sessions_spawn to prevent runaway tasks:
Chief of Staff:
sessions_spawn(
agentId: "engineering",
task: "Refactor the payment module",
runTimeoutSeconds: 300 ← kills the task after 5 minutes
)
What happens when a sub-agent fails:
| Failure | What Happens | Recovery | |---------|-------------|----------| | Timeout | Task is killed, spawner gets a timeout notification | Retry with simpler scope, or escalate to CEO | | API error | OpenClaw retries automatically (3×) | If persistent, the agent reports the failure back | | Bad output | Spawner receives the result and can judge quality | Re-spawn with more specific instructions | | Agent unavailable | Spawn fails immediately | Spawner falls back or reports to CEO |
Building resilient delegation chains:
# Chief of Staff's approach to a complex task:
- Spawn Engineering with timeout: 300s
- If Engineering succeeds → spawn DevOps for deployment
- If Engineering fails/times out → report to CEO with error details
- Never silently swallow failures — always surface them
💡 Pro tip: Include "If you encounter errors, report them clearly rather than guessing" in your agent's identity.theme. This prevents agents from hallucinating success when something actually broke.
Monitoring Multi-Agent Work
When you have 7 agents working, you need visibility. OpenClaw provides built-in tools to see what's happening:
List active sessions:
# See all running sessions — who's working on what openclaw sessions list --active
Active Sessions:
engineering │ session_abc │ "Refactoring auth module" │ 3m 22s
devops │ session_def │ "Setting up staging deploy" │ 1m 45s
marketing │ session_ghi │ "Drafting launch blog post" │ 5m 10s
Check a specific agent's work:
# Pull the last 10 messages from Engineering's session openclaw sessions history --session session_abc --limit 10
In Discord — ask Chief of Staff to monitor:
You: @Chief of Staff what's everyone working on right now?
Chief of Staff: 📊 Team Status: • Engineering: refactoring auth (3 min in, active) • DevOps: staging deploy (almost done) • Marketing: blog draft (needs review) • Finance, Legal, Management: idle
This is exactly how a real Chief of Staff works — they maintain situational awareness so you don't have to ask each person individually.
Escalation Patterns
Not everything should reach the CEO. Configure your agents to handle what they can and escalate what they can't:
┌──────────────────────────────────────────────┐
│ Escalation Pyramid │
│ │
│ 👑 CEO │
│ (You — Discord) │
│ "Only bother me for big stuff" │
│ ▲ │
│ escalate if: │
│ - budget > $100 impact │
│ - production is down │
│ - legal/compliance risk │
│ - conflicting priorities │
│ │ │
│ ⚡ Chief of Staff │
│ (Coordinator — handles most) │
│ - routes tasks between agents │
│ - resolves minor conflicts │
│ - consolidates status updates │
│ ▲ │
│ escalate if: │
│ - cross-team dependency │
│ - task blocked > 10 min │
│ - unclear ownership │
│ │ │
│ ⚔️ Eng 💰 Fin 🎭 Mktg 🔧 DevOps │
│ (Specialists — handle own domain) │
│ - do the actual work │
│ - report results up │
│ - flag blockers immediately │
└──────────────────────────────────────────────┘
Encoding escalation behavior in agent themes:
{
"id": "engineering",
"identity": {
"theme": "You are the Engineering lead. Handle coding tasks independently. Escalate to Chief of Staff if: (1) you need input from another department, (2) a task will take more than 30 minutes, or (3) you find a security issue. Never silently fail — always report back."
}
}
This creates a self-managing team where most issues resolve without your involvement. You only hear about the important stuff.
Ready-to-Use Workflow Templates
Copy these patterns for common multi-agent scenarios:
🚀 Feature Launch (5 agents)
You → Chief of Staff: "Launch user dashboard feature"
Chief of Staff orchestrates: 1. Engineering: build the feature (spawn, strong model) 2. Marketing: write announcement copy (spawn, fast model) 3. DevOps: prepare deployment pipeline (spawn, fast model) 4. [waits for all 3] 5. DevOps: deploy to production (spawn) 6. Marketing: publish announcement (spawn) 7. Finance: log infrastructure cost change (send)
Result: Feature built, deployed, and announced — one command from you.
🐛 Bug Triage (3 agents)
You → Engineering: "Users report 500 errors on /api/checkout"
Engineering handles: 1. Investigates logs, identifies root cause 2. Writes fix, pushes PR 3. send → DevOps: "Hotfix PR #92 ready, deploy ASAP" 4. DevOps deploys, confirms fix 5. Engineering → send → Chief of Staff: "Resolved. Root cause: null pointer in payment handler."
You get one update: "Fixed."
📊 Monthly Report (4 agents)
Cron triggers Chief of Staff: "Generate monthly report"
Chief of Staff orchestrates: 1. Finance: "Pull this month's spend data and trends" (spawn) 2. Engineering: "List all PRs merged, features shipped" (spawn) 3. Marketing: "Summarize content performance metrics" (spawn) 4. [waits for all 3] 5. Chief of Staff compiles into unified report 6. Posts to #announcements on Discord
Zero human involvement — runs automatically on the 1st of each month.
🔐 Security Incident Response (4 agents, parallel + sequential)
Alert → Chief of Staff: "Possible data breach detected"
Phase 1 — Parallel (immediate): spawn → Engineering: "Audit access logs for unauthorized access" spawn → DevOps: "Isolate affected service, rotate credentials" spawn → Legal: "Assess disclosure obligations"
Phase 2 — Sequential (after Phase 1): send → Engineering: "Patch the vulnerability" send → DevOps: "Deploy fix and restore service" spawn → Marketing: "Draft incident communication for users"
Phase 3 — Cleanup: Chief of Staff compiles incident report Posts to #incidents channel Schedules post-mortem meeting
Anti-Patterns to Avoid
| ❌ Don't | ✅ Do Instead | |----------|--------------| | Let every agent spawn every other agent | Use allowAgents to restrict — prevent circular delegation | | Spawn sub-agents for trivial tasks | Only delegate when the task genuinely requires another specialist | | Chain 5+ levels of delegation | Keep delegation to 2 levels max (CEO → Chief of Staff → Specialist) | | Let agents spawn themselves | This creates infinite loops — allowAgents should never include the agent's own ID | | Ignore sub-agent failures silently | Always surface errors — add "report failures clearly" to agent themes | | Skip timeouts on spawned tasks | Set runTimeoutSeconds — prevent runaway tasks from burning budget |
Notion Integration — Your Company's Knowledge Base
Your AI team doesn't just chat — it documents everything to Notion automatically. Meeting notes, daily reports, project wikis, financial records — all organized in databases your whole team can search.
Why Notion?
Discord is great for real-time work. But conversations scroll away. Notion is where knowledge persists:
- 📅 Daily reports — auto-generated standup summaries, archived forever
- 📊 Weekly/monthly reviews — trend analysis with actual data
- 📝 Project documentation — specs, decisions, postmortems
- 💰 Financial records — cost tracking in structured databases
- 🗂️ Knowledge base — SOPs, onboarding docs, technical references
Recommended Notion Structure
Set up your Notion workspace to mirror your company departments:
🏢 Company HQ (parent page)
├── 📅 Daily Reports ← database: auto-filled by Chief of Staff via cron
│ ├── 2026-03-07 Standup
│ ├── 2026-03-06 Standup
│ └── ...
│
├── 📊 Weekly Reports ← database: auto-generated every Monday
│ ├── Week 10 Review
│ └── ...
│
├── 💰 Financial Records ← database: cost tracking per day/week
│ ├── March API Spend
│ └── ...
│
├── 🖥️ Engineering Wiki ← database: architecture docs, ADRs, runbooks
│ ├── Auth Module Design
│ ├── API Rate Limiting
│ └── ...
│
├── 📢 Marketing Hub ← database: content calendar, campaign results
│ ├── Blog Post Pipeline
│ └── ...
│
├── 🗂️ Project Archives ← database: per-project decision logs
│ ├── Project Alpha
│ └── ...
│
└── 📖 SOPs & Playbooks ← pages: how we do things
├── Incident Response
├── Deploy Checklist
└── ...
Setting Up Notion Access
- Go to notion.so/my-integrations
- Create a new integration → copy the token
- Share your Notion pages with the integration (click "..." → "Add connections")
- Add the token to your agent config or workspace:
# Store in your workspace's TOOLS.md or environment
NOTIONTOKEN=ntnyourtokenhere
💡 OpenClaw's built-in Notion skill handles all API calls — agents can create pages, query databases, and update records using natural language. No code required.
Auto-Archiving Daily Reports to Notion
The killer workflow: your Chief of Staff generates a daily standup and automatically writes it to Notion:
# Daily at 10 PM — generate report and save to Notion
openclaw cron add \
--name "daily-notion-report" --agent main \
--cron "0 22 *" --tz "America/New_York" \
--message "Generate today's standup report. Include: what each agent worked on, key decisions made, blockers. Post to Discord #standup AND create a new page in the Daily Reports Notion database." \
--session isolated --token <your-token>
What the agent does:
- Reviews the day's Discord conversations
- Summarizes each agent's contributions
- Posts a summary to
#standupon Discord - Creates a structured Notion page in the Daily Reports database with:
# Example Notion page created automatically:
📅 2026-03-07 Daily Report ━━━━━━━━━━━━━━━━━━━━━━━━━ ⚔️ Engineering • Merged PR #42: auth module refactor • Started rate limiting implementation • Blocked: waiting on DevOps for staging env
💰 Finance • API spend today: $4.20 (within budget) • Flagged 15% increase in Engineering model usage
🎭 Marketing • Published blog post: "Why AI Teams Work" • Drafted social media calendar for next week
🔧 DevOps • SSL cert renewed (auto) • Uptime: 99.98%
📋 Action Items • [ ] Engineering: finish rate limiting • [ ] DevOps: provision staging environment • [ ] Marketing: review SEO keywords
Weekly & Monthly Summaries to Notion
Scale the same pattern for longer-term reports:
# Weekly — every Monday at 9 AM
openclaw cron add \
--name "weekly-notion-summary" --agent main \
--cron "0 9 1" --tz "America/New_York" \
--message "Create a weekly summary in the Weekly Reports Notion database. Review the past 7 daily reports, synthesize trends, highlight wins, flag risks. Include cost trends from Finance." \
--session isolated --token <your-token>
Monthly — 1st of each month at 9 AM
openclaw cron add \
--name "monthly-notion-review" --agent main \
--cron "0 9 1 " --tz "America/New_York" \
--message "Create a monthly review in Notion. Aggregate weekly summaries, show month-over-month trends, project ROI analysis, team performance metrics." \
--session isolated --token <your-token>
This creates a self-documenting company — reports generate themselves, archive to Notion, and build a searchable history over time.
Engineering → Notion: Auto-Document Technical Decisions
When Engineering makes architecture decisions, capture them in Notion automatically:
You: @Engineering We need to decide: PostgreSQL or MongoDB for the
new user service. Analyze and decide.
Engineering: After analysis: • PostgreSQL wins for our use case — relational data, ACID compliance needed for user accounts • MongoDB would only make sense for unstructured logs
✅ Decision: PostgreSQL 📝 Documenting to Engineering Wiki on Notion...
→ Created: "ADR-003: Database Selection for User Service" in Engineering Wiki database
Now every technical decision is findable in Notion months later, not buried in Discord scroll-back.
Finance → Notion: Structured Cost Tracking
Finance can maintain a live cost database in Notion:
You: @Finance log this month's costs to Notion
Finance: 📊 March 2026 cost data written to Financial Records:
| Category | Amount | vs Last Month | |---------------|---------|---------------| | Strong Model | $28.50 | +12% | | Fast Model | $8.20 | -5% | | Server | $0.00 | — | | Total | $36.70 | +8% |
→ Notion page created with full breakdown and trend chart data. → Tagged: March 2026, Q1, API Costs
The Financial Records database becomes your single source of truth for cost tracking — queryable, filterable, and always up to date.
Querying Notion from Discord
Your agents can also read from Notion to answer questions:
You: @Chief of Staff what did we decide about the database last month?
Chief of Staff: Let me check the Engineering Wiki on Notion...
Found: ADR-003 (Feb 15, 2026) Decision: PostgreSQL for User Service Rationale: ACID compliance, relational data model, team familiarity Status: Implemented (PR #38)
Notion becomes your team's institutional memory — even if agents' conversation context resets, the knowledge persists in structured databases.
Notion Database Properties Template
When setting up your Notion databases, use these property schemas for best results:
📅 Daily Reports Database: | Property | Type | Purpose | |----------|------|---------| | Title | Title | Report date + title | | Date | Date | Report date (for calendar view) | | Status | Select | Draft / Published | | Departments | Multi-select | Which teams reported | | Highlights | Rich text | Key achievements | | Blockers | Rich text | Issues needing attention | | Cost Today | Number | API spend for the day |
💰 Financial Records Database: | Property | Type | Purpose | |----------|------|---------| | Title | Title | Period label (e.g., "March 2026") | | Period | Date | Date range | | Total Spend | Number | Total cost | | Strong Model | Number | Strong model costs | | Fast Model | Number | Fast model costs | | Trend | Select | Up / Down / Flat | | Notes | Rich text | Anomalies and recommendations |
💡 Pro tip: Create Notion database templates for each report type. When agents create new pages, they follow the template structure automatically — consistent, clean, every time. See references/notion-templates.md for ready-to-use schemas.
Cross-Agent Knowledge Sharing via Notion
The real power of Notion integration isn't individual agents writing docs — it's agents reading each other's work. Notion becomes the shared brain your team builds together:
┌─────────────────────────────────────────────────────────┐
│ Notion (Shared Brain) │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Eng Wiki │ │ Fin Recs │ │ Mktg Hub │ ... │
│ │ ADR-001 │ │ Mar Cost │ │ Blog #5 │ │
│ │ ADR-002 │ │ Apr Cost │ │ Campaign │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ │ │ │
│ └──────────────┼──────────────┘ │
│ ▼ │
│ ┌────────────────────────┐ │
│ │ Cross-references & │ │
│ │ linked databases │ │
│ └────────────────────────┘ │
└───────────┬──────────┬──────────┬───────────────────────┘
▼ ▼ ▼
⚔️ Eng 💰 Fin 🎭 Mktg (read + write)
Example: Marketing uses Engineering's decision log
You: @Marketing write a blog post about our new database architecture
Marketing: Let me check what Engineering documented on Notion...
Found: ADR-003 — "PostgreSQL for User Service" Context: ACID compliance, relational model, team familiarity
📝 Blog draft: "Why We Chose PostgreSQL (and What We Learned)" → Created in Marketing Hub database on Notion → Tagged: Technical, Architecture, Blog Post → Cross-linked to ADR-003 in Engineering Wiki
Marketing didn't hallucinate technical details — it pulled from Engineering's actual documentation.
Example: Finance audits Engineering's spend
Finance (cron): Weekly cost review complete.
📊 Findings from cross-referencing: • Engineering used Strong Model for 23 tasks this week • 8 of those were simple formatting tasks (should use Fast Model) • Estimated savings if switched: $6.40/week ($27.50/month)
→ Updated Financial Records on Notion with recommendations → Linked to Engineering's task log for traceability
Finance doesn't just report numbers — it correlates cost data with what agents actually did.
Notion as Executive Dashboard
Configure your Chief of Staff or Management agent to aggregate data across all Notion databases for a unified view:
You: @Management give me the executive dashboard
Management: 📊 Executive Dashboard — March 7, 2026
═══ Engineering ═══ • 12 ADRs documented (3 new this month) • 47 PRs merged, 2 open • Tech debt score: improving (4 items resolved)
═══ Finance ═══ • MTD spend: $36.70 (budget: $50) • Runway: 14 days at current rate • Top cost: Engineering Strong Model ($28.50)
═══ Marketing ═══ • 5 blog posts published, 2 in draft • Best performer: "AI Teams" (2.3k views) • Content pipeline: 3 weeks ahead of schedule
═══ Infrastructure ═══ • Uptime: 99.97% (SLA: 99.9% ✅) • 0 open incidents (1 resolved this week) • SSL certs: all valid, next renewal in 12 days
═══ Projects ═══ • Active: 3 | Completed: 1 | At risk: 0 • Next milestone: Auth v2 launch (Mar 12)
Full data: [Notion Dashboard Link]
This is exactly what a CEO sees in a real company — one page that synthesizes everything.
Incident Post-Mortem to Notion
When something breaks, your team documents the full incident lifecycle to Notion automatically:
DevOps (alert): ⚠️ API latency spike detected — p99 at 3.2s (threshold: 500ms)
Chief of Staff: Initiating incident response. → Created INC-007 in Incident Log on Notion → Status: Investigating → Spawning Engineering to diagnose
Engineering: Root cause: database connection pool exhausted. Fix: increased pool size from 10 to 50. → PR #94 merged, deploying now. → Updated INC-007: Root Cause filled
DevOps: Fix deployed. Latency back to 120ms. → Updated INC-007: Status → Resolved, Duration: 14 minutes
Chief of Staff: Post-mortem: → Updated INC-007 with action items: 1. Add connection pool monitoring alert 2. Set auto-scaling threshold for DB connections 3. Update runbook with pool tuning steps → Status → Post-mortem Done → Linked to ADR-004: "Connection Pool Sizing"
Every incident is documented, searchable, and linked to the fix. Next time a similar issue occurs, agents can find the previous incident and apply the same solution.
Notion Relations & Rollups — Connecting Your Data
Individual databases are useful. Connected databases are powerful. Use Notion's Relations and Rollups to build a knowledge graph your agents can traverse:
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ 🗂️ Projects │──────▶│ 💰 Fin Recs │◀──────│ 📅 Daily Reps │
│ │ │ │ │ │
│ "Auth v2" │ │ Mar API Spend │ │ 2026-03-07 │
│ Budget: $120 │ │ Total: $36.70 │ │ Cost: $4.20 │
│ Status: Active│ │ ↕ Rollup: sum │ │ Project: Auth │
└───────┬───────┘ └───────────────┘ └───────────────┘
│
▼
┌───────────────┐ ┌───────────────┐
│ 🖥️ Eng Wiki │──────▶│ 🔒 Incidents │
│ │ │ │
│ ADR-003: PG │ │ INC-007: Pool │
│ Project: Auth │ │ Related ADR: │
│ Status: Done │ │ ADR-004 │
└───────────────┘ └───────────────┘
Key relation patterns:
| Relation | From → To | Why | |----------|-----------|-----| | Project ↔ Costs | Projects → Financial Records | Track budget burn per project | | Daily → Weekly | Daily Reports → Weekly Reports | Roll up daily data into weekly | | ADR ↔ Incident | Engineering Wiki → Incident Log | Link fixes to root-cause decisions | | ADR ↔ Project | Engineering Wiki → Projects | Track which decisions belong to which project | | Incident → Daily | Incident Log → Daily Reports | Include incidents in daily summaries | | Content → Project | Marketing Hub → Projects | Track content per project/launch |
Using Rollups for automatic aggregation:
# In the Projects database, add:
Relation: "Daily Costs" → Daily Reports database
Rollup: "Total Cost" → sum of "Cost Today" from related Daily Reports
#
Now each project page auto-calculates its total spend!
You: @Management what's the total spend on Project Alpha?
Management: Checking Notion... Project Alpha — Total Spend (rollup): $142.30 Budget: $200 | Remaining: $57.70 | Burn rate: $4.70/day At current rate, budget runs out in ~12 days.
💡 Set up Relations in Notion UI — the API can create relation properties, but it's easier to configure them visually in Notion. Once set up, agents can read and write related records via the API.
Notion ↔ Workspace Backup
Discord conversations vanish into scroll-back. Notion could go down. Your workspace files are the last line of defense. Configure periodic backups from Notion to your workspace:
# Weekly — back up critical Notion data to workspace files
openclaw cron add \
--name "notion-backup" --agent main \
--cron "0 3 0" --tz "America/New_York" \
--message "Export the last 7 days of Notion data to workspace. Query Daily Reports, Financial Records, and Incident Log databases. Write summaries to memory/notion-backup/YYYY-MM-DD.md. This is our disaster recovery copy." \
--session isolated --token <your-token>
What gets backed up:
~/clawd/
└── memory/
└── notion-backup/
├── 2026-03-07.md ← daily reports, incidents, costs
├── 2026-02-28.md
└── ...
This gives you a local, searchable archive of everything your team documented in Notion. If Notion is ever unreachable, agents can still reference the backup files.
💡 Two-way sync: Agents can also restore to Notion from workspace files. If you accidentally delete a Notion page, ask your Chief of Staff to recreate it from the backup in memory/notion-backup/.
Notion Quick-Reference Card
Here's everything you need for Notion integration at a glance:
| Step | What to Do | |------|-----------| | 1. Create integration | notion.so/my-integrations → New → copy token | | 2. Share pages | Open each Notion page → "..." → Add connections → your integration | | 3. Store token | Add NOTIONTOKEN=ntn... to your workspace env or TOOLS.md | | 4. Create databases | Use schemas from references/notion-templates.md | | 5. Set up relations | Connect databases in Notion UI (Projects ↔ Costs, ADRs ↔ Incidents) | | 6. Add cron jobs | Daily reports, weekly summaries, monthly reviews (see examples above) | | 7. Set up backup | Weekly Notion → workspace export cron (disaster recovery) |
Databases to create (recommended order):
- 📅 Daily Reports — your foundation, everything flows from here
- 💰 Financial Records — cost tracking, budget monitoring
- 🖥️ Engineering Wiki — ADRs, technical decisions
- 🔒 Incident Log — outage tracking, post-mortems
- 📊 Weekly Reports — aggregate dailies (add relation to Daily Reports)
- 🌙 Monthly Reports — aggregate weeklies
- 📢 Marketing Hub — content calendar
- 🗂️ Project Archives — project-level view with cost rollups
💡 Start with just #1 and #2. You can always add more databases later. The daily report + cost tracking combo alone gives you 80% of the value.
GitHub Integration — Your Engineering Pipeline
Your AI team doesn't just talk about code — it manages your entire GitHub workflow. Issues, PRs, code reviews, CI/CD pipelines — all driven by natural language commands on Discord.
Why GitHub Integration Matters
Discord is where you give orders. Notion is where knowledge persists. GitHub is where the work actually ships. With OpenClaw's built-in GitHub skill, your agents can:
- 🐛 Triage issues — auto-label, assign, and prioritize incoming bug reports
- 🔀 Manage PRs — create, review, approve, merge, and close pull requests
- 🚀 Trigger CI/CD — kick off builds, check run status, re-run failed workflows
- 📋 Create issues — turn Discord conversations into trackable GitHub issues
- 🔍 Code review — Engineering reads diffs, spots bugs, suggests improvements
- 📊 Repository analytics — PR merge times, issue velocity, contributor stats
Setting Up GitHub Access
Your agents use the gh CLI (GitHub CLI) under the hood. Set it up once:
# On your server, authenticate with GitHub
gh auth login
Verify it works
gh auth status
💡 TheghCLI is installed automatically by thesetup.shscript. If you're adding GitHub integration to an existing setup, just runsudo apt install ghand authenticate.
For organization-level access, use a GitHub App or fine-grained personal access token with these permissions:
- Issues: Read & Write
- Pull Requests: Read & Write
- Actions: Read & Write (for CI/CD)
- Contents: Read & Write (for code operations)
Issue Management — From Bug Report to Resolution
Turn your Discord channels into a fully automated issue tracker:
# A user reports a bug in Discord
User: @Engineering the checkout page throws a 500 error
when the cart has more than 10 items
Engineering: Investigating. Creating a GitHub issue to track this.
→ Created: wanikua/myapp#142 Title: "Checkout 500 error with 10+ cart items" Labels: bug, priority-high, checkout Assignee: Engineering bot
I'll look at the code now...
Auto-triage incoming issues with a cron job:
# Every hour, Engineering checks for new untriaged issues
openclaw cron add \
--name "issue-triage" --agent engineering \
--cron "0 " \
--message "Check for new GitHub issues in wanikua/myapp without labels. For each: read the issue, add appropriate labels (bug/feature/docs/question), set priority (critical/high/medium/low), and post a comment with your initial assessment. If it's critical, notify Chief of Staff." \
--session isolated --token <your-token>
What auto-triage looks like:
Engineering (cron): 📋 Issue Triage — 3 new issues processed:
#143 "Login fails on Safari" → Labels: bug, browser-compat, priority-high → Comment: "Likely a WebKit cookie handling issue. Will investigate SameSite attribute."
#144 "Add dark mode support" → Labels: feature, ui, priority-medium → Comment: "Feature request noted. Would require CSS variable refactor. Estimated 2-3 days."
#145 "Typo in API docs" → Labels: docs, priority-low, good-first-issue → Comment: "Quick fix. Opening a PR now." → PR #89 created with the fix ✅
Notice: simple issues get fixed immediately without human involvement. The agent triages, creates a PR, and moves on.
Pull Request Workflows
Your Engineering agent handles the full PR lifecycle:
Creating PRs from Discord:
You: @Engineering add rate limiting to the /api/search endpoint.
Max 100 requests per minute per API key.
Engineering: Working on it. [reads codebase, writes implementation, writes tests]
✅ Done. PR created: → wanikua/myapp#90 "Add rate limiting to /api/search" • Added express-rate-limit middleware • 100 req/min per API key (configurable) • Tests: 4 new test cases, all passing • CI status: ✅ green
Ready for your review, or I can merge it.
Automated code review:
You: @Engineering review PR #91
Engineering: Reviewing wanikua/myapp#91...
📝 Code Review — PR #91: "Refactor user authentication"
✅ Good: • Clean separation of auth middleware • Proper error handling on token expiry • Tests cover happy path + edge cases
⚠️ Suggestions: 1. Line 42: jwt.verify() should use algorithms: ['HS256'] to prevent algorithm switching attacks 2. Line 78: Missing rate limit on /auth/refresh — could be abused for token farming 3. Line 103: Consider using httpOnly flag on the cookie
🔴 Blocker: • No input validation on the redirect_uri parameter (potential open redirect vulnerability)
Recommend: fix the blocker, address suggestions, then merge. Want me to push fixes directly?
Cross-agent PR coordination:
# Engineering finishes code, needs DevOps to deploy
Engineering: PR #92 merged. @DevOps — ready for staging deployment.
DevOps: Deploying PR #92 to staging... → Triggered workflow: deploy-staging.yml → Build: ✅ passed (2m 14s) → Staging URL: https://staging.example.com → Running smoke tests... → All 12 smoke tests passed ✅
Staging is live. Want me to promote to production?
CI/CD Pipeline Control
Your agents can trigger, monitor, and manage GitHub Actions workflows directly:
Checking CI status:
You: @DevOps what's the CI status on our main repos?
DevOps: 📊 CI Status Overview:
wanikua/myapp (main) └── Last run: ✅ passed (3m 22s) — 2 hours ago Tests: 142/142 passing Coverage: 87%
wanikua/api-gateway (main) └── Last run: ❌ failed (1m 45s) — 6 hours ago Failure: testratelimiting (timeout) → This has failed 3 times this week
wanikua/landing-page (main) └── Last run: ✅ passed (45s) — 1 day ago
⚠️ api-gateway needs attention — flaky test detected. Want me to investigate?
Re-running failed workflows:
You: @DevOps re-run the failed CI on api-gateway
DevOps: Re-running workflow on wanikua/api-gateway... → Triggered: ci.yml (run #487) → Status: running... → ✅ Passed this time (2m 01s)
The testratelimiting failure was intermittent. Recommend: add retry logic or increase timeout. Want Engineering to fix the flaky test?
Automated deploy pipeline (cron-driven):
# Auto-deploy to staging every day at midnight (if tests pass)
openclaw cron add \
--name "nightly-staging-deploy" --agent devops \
--cron "0 0 *" \
--message "Check if there are new merged PRs on wanikua/myapp since last deploy. If yes: trigger the deploy-staging workflow, wait for completion, run smoke tests, and report results. If anything fails, notify Engineering and Chief of Staff." \
--session isolated --token <your-token>
Issue-to-PR Pipeline — Full Automation
The ultimate workflow: an issue comes in, gets triaged, fixed, reviewed, and deployed — all automatically:
``` ┌──────────────────────────────────────────────────────────────┐ │ New Issue: #150 "API returns wrong timezone for UTC users" │ └──────────────┬───────────────────────────────────────────────┘ ▼ ┌──────────────────────────────────────┐ │ Engineering (cron: hourly triage) │ │ 1. Labels: bug, priority-high, api │ │ 2. Reads code, identifies the fix │ │ 3. Creates branch: fix/issue-150 │ │ 4. Pushes code + tests │ │ 5. Opens PR #95 linked to #150 │ └──────────────┬───────────────────────┘ ▼ ┌──────────────────────────────────────┐ │ CI/CD (GitHub Actions) │ │ • Tests: ✅ 143/143 passing │ │ • Lint: ✅ clean │ │ • Coverage: 88% (+1%) │ └──────────────┬───────────────────────┘ ▼ ┌──────────────────────────────────────┐ │ Engineering (self-review) │ │ • Reviews own PR for quality │ │ • Merges PR #95 │ │ • Issue #150 auto-closed │ └──────────────┬───────────────────────┘ ▼ ┌──────────────────────────────────────┐ │ DevOps (nightly deploy cron) │ │ • Detects merged PR │ │ • Deploys to staging │ │ • Smoke tests pass │ │ • Reports to Discord │ └──────────────────────────────────────┘
Zero human involvement. Issue → Fix → Deploy.
README truncated. View on GitHub