$cd ../use-cases/
π€ Multi-AgentAdvanced60 min setup
$ cat multi-agent-specialized-team.md
const Team = ["strategy", "engineering", "marketing", "business"]
/** One chat. Four specialists. Zero meetings. Here's how to run an autonomous project team with OpenClaw. */
π Team Results
4
specialized agents
1
shared chat
80%
fewer status syncs
24/7
async execution
how_it_works.md
βοΈ How the Specialized Team Works
1.
Strategy Agent sets the plan
Receives the goal from a human team member and decomposes it into a structured task list with priorities, dependencies, and specialist assignments. It identifies blockers proactively β if the engineering task requires a design mockup that doesn't exist yet, it inserts a design request before the build step. The Strategy Agent acts as the persistent project memory across the entire conversation thread.
2.
Engineering Agent builds
Executes assigned development tasks: writing code, running test suites, managing GitHub PR lifecycle (create, review, merge), and interpreting CI/CD results. It reports back with diffs, test coverage deltas, and deployment status. When it hits a blocker β an unclear requirement or failing test β it queries the Strategy Agent rather than making assumptions.
3.
Marketing Agent crafts messaging
Activates when Engineering signals a feature is ready. It drafts launch copy calibrated to the specific feature, generates social posts for Twitter/X and LinkedIn, writes the email newsletter section, and creates image prompts for thumbnail and feature card design. It queries the Engineering Agent for accurate technical details rather than paraphrasing the goal.
4.
Business Agent tracks outcomes
Configures conversion tracking for the launched feature, monitors analytics dashboards for early signals, updates project spreadsheets with actuals vs. targets, and surfaces risks β unusual churn spikes, budget overrun signals, or low engagement on launch copy. It closes the feedback loop by reporting outcomes back to Strategy for the next planning cycle.
5.
Handoffs happen in threads
Each agent @mentions the next specialist in the same Telegram or Discord thread when its task is complete. The entire project history β briefs, code diffs, launch copy, metrics β accumulates in one searchable conversation thread accessible to all agents and human team members at any time.
setup.yaml
π¦ Build It in 60 Minutes
// Step 1: Define agent personas in OpenClaw config
agents:
strategy:
role: "Product strategist and task router"
tools: [github, linear, notion]
engineering:
role: "Full-stack developer"
tools: [github, docker, terminal]
marketing:
role: "Growth and messaging"
tools: [twitter, ghost_cms, image_generation]
business:
role: "Metrics and operations"
tools: [sheets, stripe, linear]
// Step 2: Create a Telegram group or Discord channel
# Add all 4 agent bots
# Give them thread/reply permissions
# Pin the team charter
// Step 3: Enable shared memory
memory:
shared_workspace: "/data/team-project"
handoff_format: "markdown"
context_window: 128000
// Step 4: Start with a goal
$ openclaw agents list # then drive them with: openclaw message --agent <id> "Ship landing page for multi-agent guide"
agent_roles.tsv
ποΈ Agent Roles & Handoffs
| Agent | Role | Input | Output | Handoff |
|---|---|---|---|---|
| Strategy | Plans and routes | User goal | Task list + assignments | @engineering |
| Engineering | Builds and tests | Task list | Code + CI status | @marketing |
| Marketing | Messages and launches | Shipped feature | Copy + assets | @business |
| Business | Tracks outcomes | Launch data | Metrics report | @strategy |
example_thread.log
π¬ Example Thread Flow
π¦ Strategy: Goal received β "Ship landing page". Breaking down: 1. Engineering: create Next.js page 2. Marketing: write launch tweet + email 3. Business: set up conversion tracking β @engineering please start. π§ Engineering: Page created at /multi-agent-team. Tests passing. Preview URL: https://... β @marketing ready for copy. π£ Marketing: Launch copy drafted + thumbnail generated. β @business tracking configured. π Business: Metrics dashboard live. Tracking page views, signups, and conversion. β @strategy task complete.
β Multi-Agent Team FAQ
Q1. Won't the agents conflict with each other?
Not when roles and handoff rules are clearly defined. Each agent waits for its explicit @mention or a configured trigger condition before activating. The Strategy Agent acts as the persistent router β it decides which agent receives each task and prevents simultaneous conflicting actions. Role overlap (e.g., both Engineering and Marketing touching the landing page) is prevented by the task-ownership model in the config.
Q2. Can I add more roles?
Yes. Common additions include: Design Agent (Figma API + image generation), QA Agent (automated test runner + bug reporter), DevOps Agent (infrastructure and deployment), and Support Agent (customer ticket triage). Keep the total under 6 agents for manageable context window usage β beyond that, split into two teams with a coordinator.
Q3. Does this work on Discord?
Discord is the ideal platform because threaded conversations keep each project's history organized, channel permissions can gate specific agents to specific project channels, and the bot ecosystem integrates cleanly. Telegram works well for smaller teams or solo operators. Slack is supported via webhook skill but lacks Discord's thread-as-memory architecture.
Q4. How do I prevent infinite loops?
Set a max_iterations limit per conversation in the config β typically 20-30 agent turns per goal. Additionally, require explicit human approval for any agent action that touches production systems, external spending, or customer-facing content. The human-in-the-loop gate acts as a hard stop even if the loop logic runs away.
Q5. How does the team handle ambiguous requirements?
The Strategy Agent is configured to ask clarifying questions when a goal is underspecified rather than making assumptions. It queries the human initiator via @mention and waits for confirmation before decomposing the task. This prevents the downstream agents from building the wrong thing based on a misunderstood requirement.
Q6. Can the agents access my internal tools and databases?
Yes, via custom skills. You define each agent's tool access list in config β the Engineering Agent might have access to your GitHub, Docker daemon, and database connection, while the Marketing Agent has access to your social APIs and CMS but nothing else. Tool access is scoped per agent role.