OpenClaw 搭建软件研发团队与工作流程 操作文档

OpenClaw 研发团队配置指南

文档版本 : 1.0
创建日期 : 2026-03-08
适用场景: 软件研发团队 AI 助手搭建


目录

  1. 团队架构设计
  2. [创建研发团队 Agents](#创建研发团队 Agents)
  3. [配置 Agent 身份](#配置 Agent 身份)
  4. 飞书路由配置
  5. 技能系统配置
  6. 实战使用示例
  7. 最佳实践

1. 团队架构设计

1.1 推荐的团队角色

Agent 身份 职责 推荐技能
main 🦞 默认助手 通用任务处理 全部技能
developer 💻 开发者 编码、功能开发 coding-agent, git-essentials
reviewer 🔍 代码审查员 PR 审查、代码质量 pr-reviewer, github
devops 🚀 运维工程师 部署、CI/CD deploy-agent, docker-essentials
architect 🏗️ 架构师 系统设计、技术选型 backend-patterns, api-dev
tester 🧪 测试工程师 测试、质量保证 tdd-guide

1.2 工作流程设计

复制代码
用户需求 → main (分类)
    ↓
    ├── 开发任务 → developer → reviewer (审查) → devops (部署)
    ├── 架构问题 → architect
    ├── 测试任务 → tester
    └── 运维任务 → devops

2. 创建研发团队 Agents

2.1 批量创建脚本

bash 复制代码
#!/bin/bash
# create-dev-team.sh

# 创建开发者
openclaw agents add developer \
  --model "zai/glm-5" \
  --workspace "~/.openclaw/workspace/developer" \
  --non-interactive

# 创建代码审查员
openclaw agents add reviewer \
  --model "zai/glm-5" \
  --workspace "~/.openclaw/workspace/reviewer" \
  --non-interactive

# 创建运维工程师
openclaw agents add devops \
  --model "zai/glm-5" \
  --workspace "~/.openclaw/workspace/devops" \
  --non-interactive

# 创建架构师
openclaw agents add architect \
  --model "zai/glm-5" \
  --workspace "~/.openclaw/workspace/architect" \
  --non-interactive

# 创建测试工程师
openclaw agents add tester \
  --model "zai/glm-5" \
  --workspace "~/.openclaw/workspace/tester" \
  --non-interactive

2.2 Windows PowerShell 版本

powershell 复制代码
# create-dev-team.ps1

$agents = @(
    @{name="developer"; workspace="developer"},
    @{name="reviewer"; workspace="reviewer"},
    @{name="devops"; workspace="devops"},
    @{name="architect"; workspace="architect"},
    @{name="tester"; workspace="tester"}
)

foreach ($agent in $agents) {
    openclaw agents add $agent.name `
        --model "zai/glm-5" `
        --workspace "C:\Users\$env:USERNAME\.openclaw\workspace\$($agent.workspace)" `
        --non-interactive
}

2.3 验证创建结果

bash 复制代码
openclaw agents list

预期输出:

复制代码
Agents:
- main (default)
  Workspace: ~/.openclaw/workspace
  Model: zai/glm-5
- developer
  Workspace: ~/.openclaw/workspace/developer
  Model: zai/glm-5
- reviewer
  Workspace: ~/.openclaw/workspace/reviewer
  Model: zai/glm-5
...

3. 配置 Agent 身份

3.1 设置身份标识

bash 复制代码
# 开发者
openclaw agents set-identity --agent developer \
  --name "开发者" --emoji "💻"

# 代码审查员
openclaw agents set-identity --agent reviewer \
  --name "代码审查员" --emoji "🔍"

# 运维工程师
openclaw agents set-identity --agent devops \
  --name "运维工程师" --emoji "🚀"

# 架构师
openclaw agents set-identity --agent architect \
  --name "架构师" --emoji "🏗️"

# 测试工程师
openclaw agents set-identity --agent tester \
  --name "测试工程师" --emoji "🧪"

3.2 配置 IDENTITY.md

为每个 Agent 创建专属的身份描述文件,放在其工作空间目录:

示例:developer 的 IDENTITY.md

markdown 复制代码
# 开发者 Agent

## 角色定义
你是一个专业的软件工程师,负责:
- 编写高质量代码
- 实现新功能
- 修复 Bug
- 代码重构

## 技术栈
- Node.js / TypeScript
- Python
- Go
- React / Vue

## 工作原则
1. 遵循 SOLID 原则
2. 编写可测试的代码
3. 注重代码可读性
4. 及时提交代码

## 触发关键词
- 写代码、实现、开发
- Bug、修复、问题
- 功能、需求

应用 IDENTITY.md

bash 复制代码
openclaw agents set-identity --agent developer \
  --from-identity \
  --workspace ~/.openclaw/workspace/developer

4. 飞书路由配置

4.1 获取群组 chat_id

方法1:通过日志获取

  1. 启动日志监控:
bash 复制代码
openclaw logs --follow
  1. 在飞书群里 @Bot 发送消息

  2. 从日志中找到 chat_idopen_chat_id

方法2:通过命令获取

bash 复制代码
openclaw directory groups list --channel feishu

4.2 配置路由绑定

bash 复制代码
# 绑定开发群 → developer agent
openclaw agents bind --agent developer \
  --bind feishu:oc_xxxxx_developer_group

# 绑定审查群 → reviewer agent
openclaw agents bind --agent reviewer \
  --bind feishu:oc_xxxxx_reviewer_group

# 绑定运维群 → devops agent
openclaw agents bind --agent devops \
  --bind feishu:oc_xxxxx_devops_group

4.3 查看路由绑定

bash 复制代码
openclaw agents bindings

4.4 删除路由绑定

bash 复制代码
openclaw agents unbind --agent developer \
  --bind feishu:oc_xxxxx_developer_group

5. 技能系统配置

5.1 查看可用技能

bash 复制代码
# 列出所有技能
openclaw skills list

# 检查技能状态
openclaw skills check

5.2 研发团队推荐技能

技能名称 状态 用途
coding-agent ✓ ready 编码代理
git-essentials ✓ ready Git 基础
git-workflows ✓ ready Git 工作流
github ✓ ready GitHub 集成
gh-issues ✓ ready GitHub Issues
docker-essentials ✓ ready Docker 管理
deploy-agent ✓ ready 部署代理
tdd-guide ✓ ready 测试驱动开发
api-dev ✓ ready API 开发
backend-patterns ✓ ready 后端架构

5.3 安装新技能

方法1:通过 ClawHub

bash 复制代码
# 搜索技能
npx clawhub search <skill-name>

# 安装技能
npx clawhub install <skill-name>

方法2:手动安装

bash 复制代码
# 复制技能目录
cp -r ./skill-folder ~/.openclaw/skills/

5.4 配置技能白名单

~/.openclaw/openclaw.json 中配置:

json 复制代码
{
  "commands": {
    "nativeSkills": [
      "coding-agent",
      "git-essentials",
      "github",
      "docker-essentials"
    ]
  }
}

6. 实战使用示例

6.1 命令行调用

bash 复制代码
# 调用开发者写代码
openclaw agent --agent developer --message "帮我实现用户登录功能"

# 调用审查员审查代码
openclaw agent --agent reviewer --message "审查最近的提交"

# 调用运维部署
openclaw agent --agent devops --message "构建 Docker 镜像并部署到测试环境"

# 调用架构师设计
openclaw agent --agent architect --message "设计微服务架构方案"

# 调用测试工程师
openclaw agent --agent tester --message "为登录功能编写单元测试"

6.2 飞书群聊使用

复制代码
群组: 研发团队-开发群 (已绑定 developer agent)
───────────────────────────────────
用户: @OpenClaw 帮我写一个 Redis 工具类
Bot: 💻 收到!我来帮你实现...

用户: @OpenClaw 这个函数有 bug,帮我修复
Bot: 💻 让我看看问题在哪里...

───────────────────────────────────
群组: 研发团队-审查群 (已绑定 reviewer agent)
───────────────────────────────────
用户: @OpenClaw 审查 PR #123
Bot: 🔍 正在审查...

6.3 Dashboard 使用

  1. 打开 http://127.0.0.1:18789/
  2. 选择 Agent
  3. 输入消息进行对话

7. 最佳实践

7.1 Agent 职责分离

推荐做法:

  • 每个 Agent 专注一个领域
  • 使用 IDENTITY.md 明确定义职责
  • 配置专属技能集

避免:

  • 一个 Agent 处理所有任务
  • 职责重叠导致混乱

7.2 路由策略

复制代码
策略1: 按群组路由
  - 开发群 → developer
  - 审查群 → reviewer
  - 运维群 → devops

策略2: 按关键词路由(通过 main agent 分发)
  - 包含"代码" → developer
  - 包含"部署" → devops
  - 包含"测试" → tester

7.3 监控与日志

bash 复制代码
# 实时监控所有 Agent 活动
openclaw logs --follow

# 查看特定 Agent 的会话
openclaw sessions list --agent developer

7.4 定期维护

bash 复制代码
# 更新 OpenClaw
openclaw update

# 同步技能
npx clawhub sync

# 健康检查
openclaw doctor

7.5 备份配置

bash 复制代码
# 备份配置目录
tar -czvf openclaw-backup.tar.gz ~/.openclaw/

# 恢复配置
tar -xzvf openclaw-backup.tar.gz -C ~/

附录

配置文件示例

完整研发团队配置 (openclaw.json):

json 复制代码
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "zai/glm-5"
      },
      "workspace": "~/.openclaw/workspace"
    }
  },
  "channels": {
    "feishu": {
      "appId": "cli_xxxxx",
      "appSecret": "your-secret",
      "enabled": true,
      "connectionMode": "websocket"
    }
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback"
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto"
  }
}

常见问题

Q: Agent 没有响应怎么办?

bash 复制代码
# 1. 检查 Gateway 状态
openclaw status

# 2. 检查 Agent 列表
openclaw agents list

# 3. 测试 Agent
openclaw agent --agent <id> --message "test"

Q: 如何给不同 Agent 配置不同模型?

bash 复制代码
openclaw agents add architect --model "zai/glm-4.7" ...

Q: 如何查看 Agent 的会话历史?

bash 复制代码
openclaw sessions list --agent developer

参考链接

相关推荐
C蔡博士4 小时前
VS Code+Claude Code+Deepseek
ai编程·vs code·deepseek·claude code
CHQIUU4 小时前
OpenSpec 规范驱动开发:从零到上手的完整集成指南
ai编程
pczpcz84 小时前
一次多agent情况下openclaw不回消息问题的排查经过(使用飞书通信,持续更新中~~~)
ai编程
程序新视界5 小时前
专业人士是如何看待OpenClaw(龙虾)的?
ai编程
可观测性用观测云7 小时前
代码智能体如何重塑工程、产品与设计工作
ai编程
itpretty7 小时前
在 Claude Code 里手搓一个工作流
人工智能·ai编程·claude
小猿君7 小时前
AGI理想褪色:OpenAI战略转向背后,AI编程范式的重构与博弈
重构·ai编程·agi
心在飞扬7 小时前
我把本地文档 RAG 做成了可用系统:Flask + Vue3 + LangChain + FAISS(多知识库 + 流式输出)
langchain·openai·ai编程
宝桥南山8 小时前
GitHub Copilot - 尝试一下Plan mode
microsoft·微软·github·aigc·copilot·ai编程