用 AI 多智能体团队自动生成企业官网:从零搭建 ClawTeam 实战指南
如果你曾经为一家企业做过官网,你会知道这件事有多繁琐——整理资料、想关键词、写文案、写代码、检查链接……每一步都要花时间,而且很难同时推进。
ClawTeam 想解决的就是这个问题:让多个 AI Agent 自动分工,像一个真实团队一样并行完成任务。本文记录的是在 Windows 环境下从零开始搭建 ClawTeam,并用它自动生成一个静态企业官网的完整过程。
ClawTeam 是什么
ClawTeam 是香港大学数据智能实验室(HKUDS)开发的一个命令行工具,核心思路是:让一个 Leader AI Agent 自动组建子 Agent 团队,分配任务,监控进度,协调结果。
你只需要给出目标,Agent 团队负责完成剩下的事。
它支持 Claude Code、Codex、OpenClaw、nanobot 等主流 CLI Agent,通过 Git Worktree 为每个 Agent 提供独立的工作空间,避免并行冲突。
Windows 用户必须知道的一件事
ClawTeam 依赖 tmux 和 Linux 系统调用(如 fcntl),无法直接在 Windows 原生环境运行。
如果你在 PowerShell 里直接跑,会看到这个错误:
ModuleNotFoundError: No module named 'fcntl'
这不是 bug,是设计如此。解决办法只有一个:在 WSL2(Windows Subsystem for Linux)里运行。
环境搭建:分步操作
第一步:检查 WSL 状态
打开 PowerShell,查看已安装的 WSL 发行版:
wsl --list --verbose
如果只有 docker-desktop,说明还没有可用的 Linux 环境,需要安装 Ubuntu。
第二步:安装 Ubuntu(装到非 C 盘)
C 盘空间有限,建议直接装到其他盘:
# 安装 Ubuntu
wsl --install -d Ubuntu --no-launch
# 导出到目标盘
mkdir F:\WSL\Ubuntu
wsl --export Ubuntu F:\WSL\Ubuntu.tar
wsl --unregister Ubuntu
wsl --import Ubuntu F:\WSL\Ubuntu F:\WSL\Ubuntu.tar
进入 Ubuntu:
wsl -d Ubuntu
第三步:安装 tmux
进入 WSL 后:
sudo apt-get update && sudo apt-get install -y tmux
tmux -V # 显示 tmux 3.x 即成功
第四步:安装 Node.js 和 Claude Code
# 安装 nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
# 安装 Node.js LTS
nvm install --lts
node --version # 确认安装成功
# 安装 Claude Code
npm install -g @anthropic-ai/claude-code
claude --version # 显示版本号即成功
第五步:安装 ClawTeam
cd /mnt/f/python_workspace/ClawTeam # 替换为你的项目路径
pip install -e . --break-system-packages --ignore-installed
# 验证
clawteam --help
如果看到完整的命令列表,说明安装成功。
解决常见坑
坑一:WSL 磁盘空间不足
Alpine Linux 默认只分配约 130MB,很容易装满。解决办法是换 Ubuntu,或者清理缓存:
rm -rf /var/cache/apk/*
坑二:tmux 会话瞬间消失
这是 Claude Code 遇到”是否信任此文件夹”交互提示时无人响应导致的。解决方法:
提前手动信任目录:
mkdir -p /root/.clawteam/workspaces/seo-site/parser
cd /root/.clawteam/workspaces/seo-site/parser
claude # 手动进入,确认信任提示
修复 settings.json 权限配置:
cat > ~/.claude/settings.json << 'EOF'
{
"permissions": {
"allow": [
"Bash(*)",
"Read(*)",
"Write(*)",
"Edit(*)"
]
}
}
EOF
坑三:Windows 的 Claude Code 无法在 WSL 里调用
即使你在 Windows 上已经安装了 Claude Code,WSL 也无法直接复用,因为 Windows 的 Node.js 无法正确处理 WSL 路径。最稳妥的做法是在 WSL 里单独安装一套 Node.js 和 Claude Code,互不干扰。
坑四:git worktree 分支已存在
如果之前的 Agent 没清理干净,重新 spawn 时会报错:
fatal: a branch named 'clawteam/seo-site/parser' already exists
清理方法:
git -C /你的项目路径 branch -D clawteam/seo-site/parser
实战案例:用 AI 团队生成企业静态官网
任务目标
输入:企业资料文件(PDF / Word / Excel / TXT 混合)
输出:符合搜索引擎收录规范的英文静态官网(HTML)
团队分工设计
企业资料文件(input/)
↓
Parser Agent → 提取结构化企业信息 → company_data.json
↓
SEO Agent → 关键词策略、页面标题、内链规划 → seo_strategy.json
GEO Agent → JSON-LD Schema、FAQ问答对 → geo_assets.json(与SEO并行)
↓
Writer Agent → 生成各页面英文文案 → page_copy.json
↓
Frontend Agent → 整合所有内容,输出完整 HTML 网站
↓
Auditor Agent → 检查 meta 标签、Schema、链接、图片 alt 等
执行步骤
准备目录:
mkdir -p /mnt/f/python_workspace/seo-project/input
mkdir -p /mnt/f/python_workspace/seo-project/output
# 将企业资料文件放入 input/ 目录
创建团队:
clawteam team spawn-team seo-site \
-d "Generate SEO/GEO optimized static HTML website from company files" \
-n leader
启动 Parser Agent:
clawteam spawn tmux claude --team seo-site --agent-name parser \
--task "Read ALL files in /mnt/f/python_workspace/seo-project/input/. \
Extract: company name, tagline, products/services, USPs, team info, \
contact details, certifications, case studies. \
Output structured JSON to /mnt/f/python_workspace/seo-project/company_data.json"
等 company_data.json 生成后,并行启动 SEO 和 GEO Agent:
clawteam spawn tmux claude --team seo-site --agent-name seo \
--task "Read company_data.json. Create SEO strategy: keywords, title tags, \
meta descriptions, H1/H2/H3 structure, internal linking plan, URL slugs. \
Output to seo_strategy.json"
clawteam spawn tmux claude --team seo-site --agent-name geo \
--task "Read company_data.json. Generate GEO assets: JSON-LD schema \
(Organization/Product/FAQ/BreadcrumbList), 20+ FAQ pairs optimized for \
AI citation, entity definitions. Output to geo_assets.json"
启动 Writer Agent:
clawteam spawn tmux claude --team seo-site --agent-name writer \
--task "Read company_data.json and seo_strategy.json. Write English copy \
for 5 pages: index/about/services/faq/contact. Each page needs H1, H2/H3, \
body copy, CTA. Tone: professional, conversion-focused. Output to page_copy.json"
启动 Frontend Agent:
clawteam spawn tmux claude --team seo-site --agent-name frontend \
--task "Read all JSON files in seo-project/. Build complete static HTML \
website in output/. Requirements: responsive design (CSS Grid/Flexbox), \
embed JSON-LD in <head>, meta tags + Open Graph, Core Web Vitals optimized, \
generate sitemap.xml and robots.txt. All 5 pages interlinked."
启动 Auditor Agent:
clawteam spawn tmux claude --team seo-site --agent-name auditor \
--task "Audit website in output/. Check: unique title/meta/H1 per page, \
valid JSON-LD, working internal links, image alt text, mobile viewport, \
no duplicate content. Output audit_report.md and fix issues found."
监控进度:
# 终端看板
clawteam board show seo-site
# 或者 Web 仪表板
clawteam board serve --port 8080
# 浏览器打开 http://localhost:8080
最终输出结构
output/
├── index.html # 首页
├── about.html # 关于我们
├── services.html # 产品与服务
├── faq.html # 常见问题(GEO 核心页)
├── contact.html # 联系我们
├── sitemap.xml # 站点地图
├── robots.txt # 爬虫规则
└── assets/
└── style.css # 样式文件
ClawTeam 与其他多 Agent 框架的区别
| 对比维度 | ClawTeam | 其他框架 |
|---|---|---|
| 使用者 | AI Agent 自身调用 | 人类编写编排代码 |
| 环境要求 | 文件系统 + tmux | Redis、消息队列、数据库 |
| Agent 支持 | 任意 CLI Agent | 通常仅限特定框架 |
| 隔离机制 | Git Worktree(真实分支) | 容器或虚拟环境 |
| 上手成本 | pip install + 一句提示词 | Docker + YAML + 云配置 |
常见问题
Q:不会写代码可以用 ClawTeam 吗?
基本命令都是复制粘贴级别,跟着文档操作即可。真正需要理解的是整体流程,而不是代码细节。
Q:Agent 之间怎么传递信息?
通过文件系统共享 JSON 文件,或者使用内置的收件箱命令 clawteam inbox send。每个 Agent 有独立身份标识,可以互相发消息。
Q:任务失败了怎么办?
可以单独重启某个 Agent,不影响其他已完成的工作。ClawTeam 支持任务状态跟踪(pending / in_progress / completed / blocked)。
Q:生成的网站需要手动修改吗?
Auditor Agent 会自动检查并修复常见问题。如果有特定需求(如品牌色、字体),可以在 Frontend Agent 的任务描述里提前说明。
Q:支持中文网站吗?
支持。在各 Agent 的任务描述里把语言要求改为中文即可,Framework 本身没有语言限制。
小结
ClawTeam 的核心价值不是”更快地生成内容”,而是把一个需要多人协作的复杂任务,拆解成可以并行执行的自动化流程。
对于需要频繁制作企业官网、落地页或内容站的团队来说,这套流程一旦跑通,可以显著降低重复劳动。前期的环境配置确实繁琐(尤其是 Windows 上的 WSL 问题),但配置好之后的使用体验是流畅的。
如果你在搭建过程中遇到问题,ClawTeam 的 GitHub Issues 和 Discussions 页面都比较活跃,也可以参考本文记录的排错过程逐一对照。
