当前位置: 首页 > news >正文

openclaw 用例翻译笔记:Autonomous Project Management with Subagents

内容取之于gitup下awesome-openclaw-usecases-main工程下的30篇英文的用例文章,也是为了学习方便,今天开始逐一翻译留下笔记,供openclaw使用中的学习。

翻译内容

使用子智能体进行自主项目管理

使用多个并行工作流管理复杂项目令人精疲力竭。你最终会不断切换上下文,跨工具追踪状态,并手动协调交接。

此用例实现了一种去中心化的项目管理模式,其中子智能体自主处理任务,通过共享状态文件进行协调,而非中央编排器。

痛点

传统的编排器模式会产生瓶颈——主智能体变成了交通警察。对于复杂项目(多仓库重构、研究冲刺、内容流水线),你需要能够并行工作而无需持续监督的智能体。

功能描述

  • 去中心化协调:智能体读写共享的STATE.yaml文件

  • 并行执行:多个子智能体同时处理独立任务

  • 无编排器开销:主会话保持精简(CEO模式——仅负责策略)

  • 自文档化:所有任务状态持久化保存在版本控制文件中

核心模式:STATE.yaml

每个项目维护一个STATE.yaml文件,作为唯一事实来源:

# STATE.yaml - 项目协调文件 project: website-redesign updated: 2026-02-10T14:30:00Z ​ tasks: - id: homepage-hero status: in_progress owner: pm-frontend started: 2026-02-10T12:00:00Z notes: "Working on responsive layout" ​ - id: api-auth status: done owner: pm-backend completed: 2026-02-10T14:00:00Z output: "src/api/auth.ts" ​ - id: content-migration status: blocked owner: pm-content blocked_by: api-auth notes: "Waiting for new endpoint schema" ​ next_actions: - "pm-content: Resume migration now that api-auth is done" - "pm-frontend: Review hero with design team"

工作原理

  1. 主智能体接收任务→ 生成具有特定范围的子智能体

  2. 子智能体读取 STATE.yaml→ 找到其分配的任务

  3. 子智能体自主工作→ 在进度更新时更新 STATE.yaml

  4. 其他智能体轮询 STATE.yaml→ 拾取未阻塞的工作

  5. 主智能体定期检查→ 审查状态,调整优先级

所需技能

  • sessions_spawn/sessions_send用于子智能体管理

  • 文件系统访问权限以操作 STATE.yaml

  • Git 用于状态版本控制(可选但推荐)

设置:AGENTS.md 配置

## PM 委托模式 ​ 主会话 = 仅协调器。所有执行都交给子智能体。 ​ 工作流程: 1. 新任务到达 2. 检查 PROJECT_REGISTRY.md 寻找现有的 PM 3. 如果 PM 存在 → sessions_send(label="pm-xxx", message="[task]") 4. 如果是新项目 → sessions_spawn(label="pm-xxx", task="[task]") 5. PM 执行,更新 STATE.yaml,报告返回 6. 主智能体向用户总结 ​ 规则: - 主会话:最多 0-2 个工具调用(仅 spawn/send) - PM 拥有其 STATE.yaml 文件 - PM 可以为并行子任务生成子子智能体 - 所有状态更改提交到 git

示例:生成一个 PM

User: "Refactor the auth module and update the docs" ​ Main agent: 1. Checks registry → no active pm-auth 2. Spawns: sessions_spawn( label="pm-auth-refactor", task="Refactor auth module, update docs. Track in STATE.yaml" ) 3. Responds: "Spawned pm-auth-refactor. I'll report back when done." ​ PM subagent: 1. Creates STATE.yaml with task breakdown 2. Works through tasks, updating status 3. Commits changes 4. Reports completion to main

关键洞见

  • STATE.yaml > 编排器:基于文件的协调比消息传递更具可扩展性

  • Git 作为审计日志:提交 STATE.yaml 更改以获取完整历史记录

  • 标签约定很重要:使用pm-{project}-{scope}以便于追踪

  • 精简的主会话:主智能体做得越少,响应速度越快

基于

此模式受 Nicholas Carlini 的方法 启发,用于自主编码智能体——让智能体自组织,而不是微观管理它们。

相关链接

  • OpenClaw 子智能体文档

  • Anthropic: 构建有效智能体



原文:

Autonomous Project Management with Subagents

Managing complex projects with multiple parallel workstreams is exhausting. You end up context-switching constantly, tracking status across tools, and manually coordinating handoffs.

This use case implements a decentralized project management pattern where subagents work autonomously on tasks, coordinating through shared state files rather than a central orchestrator.

Pain Point

Traditional orchestrator patterns create bottlenecks—the main agent becomes a traffic cop. For complex projects (multi-repo refactors, research sprints, content pipelines), you need agents that can work in parallel without constant supervision.

What It Does

- **Decentralized coordination**: Agents read/write to a shared `STATE.yaml` file
- **Parallel execution**: Multiple subagents work on independent tasks simultaneously
- **No orchestrator overhead**: Main session stays thin (CEO pattern—strategy only)
- **Self-documenting**: All task state persists in version-controlled files

## Core Pattern: STATE.yaml

Each project maintains a `STATE.yaml` file that serves as the single source of truth:

```yaml
# STATE.yaml - Project coordination file
project: website-redesign
updated: 2026-02-10T14:30:00Z

tasks:
- id: homepage-hero
status: in_progress
owner: pm-frontend
started: 2026-02-10T12:00:00Z
notes: "Working on responsive layout"

- id: api-auth
status: done
owner: pm-backend
completed: 2026-02-10T14:00:00Z
output: "src/api/auth.ts"

- id: content-migration
status: blocked
owner: pm-content
blocked_by: api-auth
notes: "Waiting for new endpoint schema"

next_actions:
- "pm-content: Resume migration now that api-auth is done"
- "pm-frontend: Review hero with design team"
```

## How It Works

1. **Main agent receives task** → spawns subagent with specific scope
2. **Subagent reads STATE.yaml** → finds its assigned tasks
3. **Subagent works autonomously** → updates STATE.yaml on progress
4. **Other agents poll STATE.yaml** → pick up unblocked work
5. **Main agent checks in periodically** → reviews state, adjusts priorities

## Skills You Need

- `sessions_spawn` / `sessions_send` for subagent management
- File system access for STATE.yaml
- Git for state versioning (optional but recommended)

## Setup: AGENTS.md Configuration

```text
## PM Delegation Pattern

Main session = coordinator ONLY. All execution goes to subagents.

Workflow:
1. New task arrives
2. Check PROJECT_REGISTRY.md for existing PM
3. If PM exists → sessions_send(label="pm-xxx", message="[task]")
4. If new project → sessions_spawn(label="pm-xxx", task="[task]")
5. PM executes, updates STATE.yaml, reports back
6. Main agent summarizes to user

Rules:
- Main session: 0-2 tool calls max (spawn/send only)
- PMs own their STATE.yaml files
- PMs can spawn sub-subagents for parallel subtasks
- All state changes committed to git
```

## Example: Spawning a PM

```text
User: "Refactor the auth module and update the docs"

Main agent:
1. Checks registry → no active pm-auth
2. Spawns: sessions_spawn(
label="pm-auth-refactor",
task="Refactor auth module, update docs. Track in STATE.yaml"
)
3. Responds: "Spawned pm-auth-refactor. I'll report back when done."

PM subagent:
1. Creates STATE.yaml with task breakdown
2. Works through tasks, updating status
3. Commits changes
4. Reports completion to main
```

## Key Insights

- **STATE.yaml > orchestrator**: File-based coordination scales better than message-passing
- **Git as audit log**: Commit STATE.yaml changes for full history
- **Label conventions matter**: Use `pm-{project}-{scope}` for easy tracking
- **Thin main session**: The less the main agent does, the faster it responds

## Based On

This pattern is inspired by [Nicholas Carlini's approach](https://nicholas.carlini.com/) to autonomous coding agents—let agents self-organize rather than micromanaging them.

## Related Links

- [OpenClaw Subagent Docs](https://github.com/openclaw/openclaw)
- [Anthropic: Building Effective Agents](https://www.anthropic.com/research/building-effective-agents)

http://www.jsqmd.com/news/419961/

相关文章:

  • 2026性价比高的专利数据库厂家推荐 - 品牌排行榜
  • 2026年口碑好的食品烘干网/饲料聚酯烘干网直销厂家推荐选哪家(更新) - 品牌宣传支持者
  • 2026年热门的简约珠宝柜滑轨/易拆珠宝柜滑轨厂家推荐哪家好(高评价) - 品牌宣传支持者
  • 2026年知名的UV 软膜广告灯箱/广告灯箱哪家靠谱可靠供应商参考 - 品牌宣传支持者
  • 2026年口碑好的不锈钢过滤网板/304过滤网板哪家质量好厂家推荐(实用) - 品牌宣传支持者
  • 2026年口碑好的三维调节三节隐藏轨/阻尼三节隐藏轨推荐几家可靠供应商参考 - 品牌宣传支持者
  • 产品清洁度检测选哪家?中国龙头苏州西恩士工业科技有限公司头部企业首选 - 精密仪器科技圈
  • 2026口碑好的专利数据库公司推荐及选择参考 - 品牌排行榜
  • 小白能看懂的-openclaw安装篇
  • 【Matlab】MATLAB教程:plot3三维折线绘制全解析——语法、案例与三维坐标数据可视化实战
  • 分期乐微信立减金回收变现攻略 - 团团收购物卡回收
  • 【Matlab】MATLAB教程:数据查找全解析——find函数实操与指定数据定位实战
  • 吐血推荐!降AI率工具 千笔·降AIGC助手 VS 学术猹 专科生必备
  • 2026年靠谱的铝合金切削液/镁合金切削液直销厂家采购指南如何选 - 品牌宣传支持者
  • 河北昇晖环境发展有限公司 联系方式:如何有效使用官方联系渠道 - 十大品牌推荐
  • esbuild插件深度解析
  • 2026年靠谱的铝合金脱模剂/镁合金脱模剂哪家强生产厂家实力参考 - 品牌宣传支持者
  • 河北昇晖环境发展有限公司 联系方式:如何有效获取官方服务信息 - 十大品牌推荐
  • IFC标准在学术界的研究与发展历程:从理论探索到产业实践的全面梳理IFC标准在学术界的研究与发展历程:从理论探索到产业实践的全面梳理
  • 2026年比较好的充电桩变电站/预装式变电站厂家选购真相 - 品牌宣传支持者
  • OpenClaw+Ollama+LM Studio+MiniMax M2.1
  • 2026年口碑好的动力配电柜/低压配电柜厂家综合实力参考(2026) - 品牌宣传支持者
  • 2026年比较好的rfid标签热门品牌推荐口碑排行 - 品牌宣传支持者
  • 2026年知名的油漆除味剂/皮革除味剂更新厂家选择指南哪家好 - 品牌宣传支持者
  • 河北昇晖环境发展有限公司 联系方式:服务咨询与风险提示参考信息 - 十大品牌推荐
  • 河北昇晖环境发展有限公司 联系方式:使用指南与风险提示参考 - 十大品牌推荐
  • 蛋白粉哪个牌子的好用又实惠?2026年度最好用的增强免疫TOP10推荐,公认口碑好 - 博客万
  • 服务器网卡从10G升到25G还是40G?交换机到底选哪条路?会不会踩坑?
  • 2026年口碑好的空气压缩机/无油空气压缩机制造厂家实力参考哪家专业 - 品牌宣传支持者
  • 2026年比较好的pp波纹管设备/pe波纹管设备工厂直供推荐哪家专业 - 品牌宣传支持者