How to Build a Fully Automated Content Production Team with OpenClaw and 4 AI Agents
This guide shows how to use OpenClaw to create a four‑agent AI team—Content Lead, Topic Researcher, Content Writer, and Content Editor—connected by an Orchestrator‑Worker architecture, passing file paths, returning standardized JSON, and handling configuration, troubleshooting, and cost‑optimisation for end‑to‑end content automation.
1. Four AI Employees: Roles and Responsibilities
The core of the system is an Orchestrator‑Worker architecture consisting of one main Agent (Content Lead) and three sub‑Agents:
Content Lead (Content Lead) : receives user requests via Feishu, breaks tasks into subtasks, invokes sub‑Agents, validates returned file paths, and assembles the final article. It never performs concrete work such as research or writing.
Topic Researcher : performs multi‑round web searches, gathers industry hotspots, competitor analysis, and saves a structured report to articles/research/. It uses the question, sessions_send, read, webfetch, bash, and write tools. Example call:
sessions_send(
agentId: "topic-researcher",
message: {
"theme": "AI Agent 技术文章",
"rounds": 3,
"special_requirements": "聚焦多 Agent 架构"
}
)The Agent returns JSON such as:
{
"status": "success",
"file_path": "articles/research/research-01.md",
"summary": {"rounds":3,"source_count":15,"word_count":6500}
}Content Writer : reads the research report and six style documents, writes a 3000‑5000‑word article, saves it to articles/drafts/, and returns JSON with title, word count, and section count.
sessions_send(
agentId: "content-writer",
message: {
"research_file_path": "articles/research/research-01.md",
"theme": "AI Agent 技术文章",
"role": "tech"
}
)Content Editor : validates length, structure, forbidden words, AI‑flavor, generates a check report saved to articles/reports/, and returns JSON indicating quality.
{
"status": "success",
"file_path": "articles/reports/check-01.md",
"summary": {"word_count":4200,"violations":[],"ai_flavor_score":"low","quality":"pass"}
}2. Collaboration Logic
The agents communicate by exchanging file paths rather than large text blobs, which saves tokens, provides traceability, enables checkpoint‑resume, and allows manual intervention.
Typical workflow (illustrated in the article’s Fig. 3):
Step 1 – Demand collection (2‑5 min) : User @mentions the Content Lead in a Feishu group with a request such as "出一篇关于 AI Agent 的技术文章". The Lead uses the question tool to gather details (style, platform, special requirements).
Step 2 – Research (15‑30 min) : The Lead calls the Topic Researcher via sessions_send. The Researcher performs three search rounds, saves research-01.md, and returns success JSON.
Step 3 – Writing (30‑60 min) : The Lead invokes the Content Writer, which reads the research file, follows six style guidelines, writes the draft, saves draft-01.md, and returns JSON.
Step 4 – Review (5‑10 min) : The Lead calls the Content Editor, which checks word count, structure, forbidden words, AI‑flavor, and produces check-01.md with a pass/warning/fail rating.
Step 5 – Assembly (5 min) : The Lead reads the draft, adds header/footer, saves the final article to articles/output/, and notifies the user in Feishu.
3. Configuration Tutorial (Step‑by‑Step)
Create the directory ~/.openclaw/ with the following structure (Fig. 4):
~/.openclaw/
├── openclaw.json # main config
├── agents/
│ ├── content-lead/
│ │ ├── agent/ # SOUL.md, AGENTS.md
│ │ └── sessions/
│ ├── topic-researcher/
│ │ ├── agent/
│ │ └── sessions/
│ ├── content-writer/
│ │ ├── agent/
│ │ └── sessions/
│ └── content-editor/
│ ├── agent/
│ └── sessions/
├── workspace-lead/
├── workspace-researcher/
├── workspace-writer/
└── workspace-editor/Edit ~/.openclaw/openclaw.json to define gateway, agents, default sub‑agent settings, and Feishu bindings. Example excerpt:
{
"gateway": {"port":8080,"providers":["feishu"]},
"agents": {
"list": [
{"id":"content-lead","default":true,"name":"内容总监","workspace":"~/.openclaw/workspace-lead","model":"zhipuai-coding-plan/glm-5"},
{"id":"topic-researcher","name":"选题调研员","workspace":"~/.openclaw/workspace-researcher","model":"zhipuai-coding-plan/glm-5","tools":{"allow":["read","webfetch","bash","write"],"deny":["exec","edit","apply_patch"]}},
{"id":"content-writer","name":"内容创作师","workspace":"~/.openclaw/workspace-writer","model":"zhipuai-coding-plan/glm-5","tools":{"allow":["read","write","bash"]}},
{"id":"content-editor","name":"审核编辑","workspace":"~/.openclaw/workspace-editor","model":"zhipuai-coding-plan/glm-5","tools":{"allow":["read","bash"]}}
],
"defaults":{...}
},
"bindings":[{"agentId":"content-lead","match":{"channel":"feishu"}}],
"providers":{"feishu":{"appId":"${FEISHU_APP_ID}","appSecret":"${FEISHU_APP_SECRET}","domain":"China"}}
}Each agent’s SOUL.md defines its role, core duties, tool whitelist, and JSON response format. The article provides the full content of these files.
4. Quality Rating
pass : meets all six style rules and has no violations.
warning : minor issues but acceptable.
fail : serious problems requiring rewrite.
5. Common Issues and Troubleshooting
Issue 1 – Sub‑Agent does not return JSON : Ensure the SOUL file enforces JSON output and add tolerant parsing in the main Agent.
if echo "$response" | jq -e . >/dev/null; then
echo "✅ JSON format correct"
else
echo "❌ JSON format error, please retry"
fiIssue 2 – Session context mixing : Set the correct dmScope (e.g., per-channel-peer for multi‑user chat).
Issue 3 – Over‑permissive tools : Apply the principle of minimal tool permissions per agent (read‑only for editors, read/write for writers, etc.).
Issue 4 – File‑save failure : Verify file existence and non‑emptiness before returning success JSON.
if [ -f "$file_path" ] && [ -s "$file_path" ]; then
echo "✅ File saved"
else
echo "❌ File save failed"
exit 1
fiIssue 5 – Feishu integration not responding : Check that required permissions ( im:message, im:message.p2p_msg:readonly, im:message.group_at_msg:readonly, im:message:send_as_bot) are granted and that event subscription includes im.message.receive_v1. Verify App ID/Secret and view gateway logs via openclaw gateway logs.
6. Advanced Usage
Parallel sub‑Agent calls for multi‑platform output using Promise.all.
// Simultaneous writers
await Promise.all([
sessions_send({agentId:"wechat-writer",message:{...}}),
sessions_send({agentId:"zhihu-writer",message:{...}}),
sessions_send({agentId:"xiaohongshu-writer",message:{...}})
]);Checkpoint‑resume : Inspect articles/research/ and articles/drafts/ for existing files and resume from the missing step.
Cost optimisation : Use lightweight models (e.g., GLM‑4/Haiku) for the Content Editor while keeping GLM‑5 for coordination, research, and writing. The table in the article shows recommended models per agent.
7. Summary
The essential takeaways are:
Architecture : Orchestrator‑Worker pattern with a single coordinating Agent and specialised worker Agents.
Data passing : File‑path based exchange with standardized JSON responses ensures low token usage and easy debugging.
Permission control : Minimal tool sets per Agent improve security and predictability.
Quality control : Six style documents, factual checklists, and automated editor enforce content standards.
When deployed, the pipeline reduces a week‑long manual content creation process to roughly 20 minutes, achieving a ten‑fold efficiency gain.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Shuge Unlimited
Formerly "Ops with Skill", now officially upgraded. Fully dedicated to AI, we share both the why (fundamental insights) and the how (practical implementation). From technical operations to breakthrough thinking, we help you understand AI's transformation and master the core abilities needed to shape the future. ShugeX: boundless exploration, skillful execution.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
