Skip to content

dongdada29/mission-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mission Control - 数字员工管理系统

愿景

让一个人类指挥官管理 100+ AI Agent 数字员工

核心概念

角色

角色 职责
Commander (你) 发号施令、验收结果、淘汰差的
Agent 不知疲倦的执行者
Coordinator 任务分发、结果汇总
Reviewer 质量把关

资源

1个 Workspace = 1个部门
1个 Agent = 1个员工
1个 Skill = 1项技能

系统架构

┌─────────────────────────────────────────────────────────────────────────┐
│                         Mission Control                                 │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                          │
│  ┌─────────────────────────────────────────────────────────────────┐   │
│  │                     Command Layer (你)                           │   │
│  │                                                                  │   │
│  │    "去把这件事做了"  →  "结果给我"  →  "这个不行,重做"        │   │
│  └─────────────────────────────┬───────────────────────────────────┘   │
│                                │                                        │
│                                ▼                                        │
│  ┌─────────────────────────────────────────────────────────────────┐   │
│  │                    Coordinator Layer                             │   │
│  │                                                                  │   │
│  │  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐            │   │
│  │  │ Task Queue  │  │  Scheduler  │  │  Monitor   │            │   │
│  │  │  任务队列    │  │  定时任务   │  │  监控      │            │   │
│  │  └─────────────┘  └─────────────┘  └─────────────┘            │   │
│  └─────────────────────────────┬───────────────────────────────────┘   │
│                                │                                        │
│          ┌─────────────────────┼─────────────────────┐                 │
│          ▼                     ▼                     ▼                 │
│  ┌─────────────┐      ┌─────────────┐      ┌─────────────┐          │
│  │   Agent 1   │      │   Agent 2   │      │   Agent N   │          │
│  │  (前端)     │      │  (后端)     │      │  (测试)     │          │
│  └─────────────┘      └─────────────┘      └─────────────┘          │
│                                                                          │
│  ┌─────────────────────────────────────────────────────────────────┐   │
│  │                    Resource Layer                               │   │
│  │                                                                  │   │
│  │  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐          │   │
│  │  │Workspace │ │  Skills  │ │ Memory   │ │  Tools   │          │   │
│  │  │ 项目管理  │ │ 技能库   │ │ 记忆存储  │ │ 工具集   │          │   │
│  │  └──────────┘ └──────────┘ └──────────┘ └──────────┘          │   │
│  └─────────────────────────────────────────────────────────────────┘   │
│                                                                          │
└─────────────────────────────────────────────────────────────────────────┘

Workspace 设计

1个 Workspace = 1个部门

mission-control/
├── .openclaw/
│   ├── agents/           # Agent 配置
│   │   ├── frontend/     # 前端组
│   │   ├── backend/      # 后端组
│   │   ├── devops/      # 运维组
│   │   └── research/    # 研究组
│   ├── skills/          # 部门专属技能
│   ├── memory/          # 部门知识库
│   └── config.yaml      # 配置
├── src/                 # 代码
├── tests/               # 测试
└── docs/                # 文档

启动一个 Agent

// 招一个员工
await sessions_spawn({
  runtime: "acp",
  workspace: "/path/to/workspace",
  agent: "claude",
  task: "任务描述",
  skills: ["skill1", "skill2"],
});

Agent 类型

类型 用途 技能
Worker 日常执行 编程、测试、部署
Researcher 调研分析 搜索、阅读、总结
Monitor 监控告警 轮询、检查、通知
Reviewer 代码审查 lint、test、security
Coordinator 任务协调 拆分、调度、汇总

任务流程

标准流程 (SOP)

┌──────────────────────────────────────────────────────────────┐
│                      任务生命周期                              │
├──────────────────────────────────────────────────────────────┤
│                                                               │
│  1. 接收任务                                                 │
│     │                                                        │
│     ▼                                                        │
│  2. 理解需求 → 拆分 → 规划                                   │
│     │                                                        │
│     ▼                                                        │
│  3. 执行 (并行/串行)                                         │
│     │                                                        │
│     ▼                                                        │
│  4. 自检 (代码审查 + 测试)                                   │
│     │                                                        │
│     ▼                                                        │
│  5. 返回结果                                                 │
│     │                                                        │
│     ▼                                                        │
│  6. 你验收                                                  │
│                                                               │
└──────────────────────────────────────────────────────────────┘

任务拆分

// 拆任务
const tasks = [
  { id: 1, agent: "worker", task: "实现 API", skills: ["nodejs", "express"] },
  { id: 2, agent: "worker", task: "写测试", skills: ["vitest"] },
  { id: 3, agent: "reviewer", task: "代码审查", skills: ["eslint"] },
];

// 并行执行
const results = await Promise.all(tasks.map(t => spawn(t)));

Memory 设计

层级

层级 内容 生命周期
Global 核心原则、价值观 永久
Workspace 项目知识、部门文化 项目周期
Session 当前任务上下文 会话结束
Agent Agent 个体记忆 每次任务

实现

// 记忆存储
interface Memory {
  level: "global" | "workspace" | "session" | "agent";
  content: string;
  tags: string[];
  updatedAt: number;
}

// 记忆检索
async function recall(query: string): Promise<Memory[]> {
  // 向量搜索 + 关键词匹配
}

Skill 设计

Skill 结构

skill-name/
├── SKILL.md           # 定义
├── scripts/           # 脚本
├── prompts/           # 提示词
├── tools/             # 工具
└── config.yaml        # 配置

示例

# SKILL.md
---
name: web-scraper
description: 高效抓取网页内容
---

# 能力
- 爬取静态页面
- 处理动态渲染
- 提取结构化数据

# 使用
"去抓取这个网站的内容"

监控系统

指标

指标 说明
Active Agents 当前工作的 Agent 数
Task Queue 排队任务数
Success Rate 任务成功率
Avg Duration 平均执行时间
Cost API 消耗

告警

# 告警规则
alerts:
  - name: high-failure-rate
    condition: success_rate < 0.7
    action: notify
  - name: task-timeout
    condition: duration > 300000
    action: retry

规模化

10 Agent → 100 Agent

阶段 数量 管理方式
Start 1-5 手动管理
Scale 5-20 分组管理
Grow 20-50 部门化
Enterprise 100+ 自治化

自治化

100 Agent
   │
   ├── Frontend Team (10)
   │    ├── UI Agent
   │    ├── Component Agent
   │    └── ...
   │
   ├── Backend Team (10)
   │    ├── API Agent
   │    ├── DB Agent
   │    └── ...
   │
   └── QA Team (10)
        ├── Test Agent
        ├── Security Agent
        └── ...

完整示例

场景: 开发一个 Web 应用

// 1. 组建团队
const team = {
  pm: await spawn({ role: "coordinator", task: "管理项目" }),
  frontend: await spawn({ role: "worker", skills: ["react"] }),
  backend: await spawn({ role: "worker", skills: ["nodejs"] }),
  tester: await spawn({ role: "reviewer", skills: ["vitest"] }),
};

// 2. 分配任务
await team.pm.assign({
  spec: "一个 Todo 应用",
  tasks: [
    { agent: team.frontend, task: "实现前端" },
    { agent: team.backend, task: "实现后端 API" },
  ],
});

// 3. 等待完成
const results = await team.pm.wait();

// 4. 验收
if (await review(results)) {
  console.log("✅ 项目完成");
} else {
  // 5. 返工
  await team.pm.revise(results.issues);
}

部署

本地模式

# 启动 Mission Control
openclaw serve --port 18789

# 打开 Dashboard
openclaw dashboard

云端模式

# docker-compose.yml
services:
  openclaw:
    image: openclaw/openclaw
    ports:
      - "18789:18789"
    volumes:
      - ./workspaces:/workspaces
    environment:
      - API_KEY=xxx

附录: 命令清单

命令 说明
openclaw spawn 招一个新 Agent
openclaw list 列出所有 Agent
openclaw kill 开除 Agent
openclaw workspace 管理 Workspace
openclaw mission 创建任务
openclaw monitor 查看状态

让 100 个数字员工为你干活

About

Manage 100+ AI Agent digital employees

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors