firm-orchestration
This skill implements the A2A (Agent-to-Agent) pyramid pattern for OpenClaw.
Architecture
CODEBLOCK0
Usage
Send this to your OpenClaw session to trigger a full firm orchestration run:
CODEBLOCK1
Tools activated
| Tool | Purpose |
|---|
| INLINECODE0 | Discover active department/service sessions |
| INLINECODE1 |
Spawn missing sessions per pyramid level |
|
sessions_send | Delegate objectives down the hierarchy |
|
sessions_history | Collect results from child sessions |
Handoff contract
Each delegation payload follows this schema:
CODEBLOCK2
Merge strategy
Results from all departments are:
- 1. Collected via
sessions_history with a 30-second deadline - Deduplicated by INLINECODE5
- Merged in dependency order (Strategy → Engineering → Quality → Ops)
- Formatted according to INLINECODE6
Operating Protocol (Anthropic-style)
Based on real Anthropic team practices — "How Anthropic teams use Claude Code"
Phase 1 — Parallel dispatch (never sequential)
Fan-out simultaneously to all departments via
sessions_send. Never wait for one department
before launching the next. Each session receives the full handoff contract and maintains its
own complete context. Store all
reply_session refs for convergence.
CODEBLOCK3
Phase 2 — Iterative loop on blockers
If a department returns
status: blocked, do NOT resolve it yourself. Spawn a joint
resolution session with the two conflicting departments and let them iterate:
CODEBLOCK4
Maximum 2 re-delegation cycles before escalating to CEO with explicit blocker report.
Phase 3 — Convergence with partial acceptance
30-second hard deadline. After deadline: accept partial results, mark missing department
outputs as
status: timeout, include them in final report as open items.
Never block delivery on a single department.
Phase 4 — Validate before merge
Before merging each department output into the final deliverable:
- 1. Check output satisfies its INLINECODE11
- If DoD not met: flag as
quality: partial — do not silently drop - Merge in dependency order only: Strategy → Engineering → Quality → Ops
Phase 5 — Deliver + document
After every completed orchestration, automatically append:
- 1. Run summary (1 paragraph)
- Departments that delivered / timed out / were blocked
- Architecture/process decisions made
- Suggestions for improving the next similar run
All final outputs carry the mandatory disclaimer:
⚠️ Contenu généré par IA — validation humaine requise avant utilisation en production.
Phase 6 — Git checkpoints (when Engineering is involved)
Require Engineering to commit after each sub-task — not only at end of run.
Reject PRs that are not draft + labelled
needs-review.
Never allow direct merge to
main.
Security
- - All inter-session calls use
reply_session: "main" to avoid orphaned sessions - INLINECODE16 is rate-limited: max 20 spawns per orchestration run
- Payloads are validated against the handoff schema before dispatch
- No external network calls — pure Gateway WebSocket routing
Example prompt
CODEBLOCK5
💎 Support
Si ce skill vous est utile, vous pouvez soutenir le développement :
Dogecoin : INLINECODE17
firm-orchestration
该技能为OpenClaw实现了A2A(智能体间)金字塔模式。
架构
CEO智能体(编排器)
├── 战略部门
│ └── 服务规划 → 员工分析师
├── 工程部门
│ └── 服务后端 → 员工实施者
├── 质量部门
│ └── 服务测试 → 员工审计员
└── 运营部门
└── 服务发布 → 员工协调员
使用方法
向您的OpenClaw会话发送以下内容以触发完整的公司编排运行:
@firm-orchestration run
objective: 构建一个支付API
departments: [engineering, quality]
deliveryformat: githubpr
已激活工具
| 工具 | 用途 |
|---|
| sessionslist | 发现活跃的部门/服务会话 |
| sessionsspawn |
按金字塔层级生成缺失的会话 |
| sessions_send | 向下级委派目标 |
| sessions_history | 从子会话收集结果 |
交接合约
每个委派负载遵循以下模式:
json
{
from: ceo,
to: department:engineering,
objective: ...,
constraints: [..., ...],
definitionofdone: ...,
context_ref: memory:delivery/latest,
reply_session: main
}
合并策略
所有部门的结果:
- 1. 通过sessionshistory收集,截止时间为30秒
- 按objectivekey去重
- 按依赖顺序合并(战略 → 工程 → 质量 → 运营)
- 根据delivery_format格式化
操作协议(Anthropic风格)
基于真实的Anthropic团队实践——Anthropic团队如何使用Claude Code
阶段1 — 并行分发(绝不串行)
通过sessions
send同时向所有部门展开。绝不等待一个部门完成后再启动下一个。每个会话接收完整的交接合约并维护自己的完整上下文。存储所有replysession引用以便汇聚。
目标接收 →
sessionssend(engineering) ‖ sessionssend(quality) ‖ sessionssend(ops) ‖ sessionssend(strategy)
→ wait(deadline=30s)
→ collect via sessions_history
阶段2 — 阻塞项迭代循环
如果某个部门返回status: blocked,不要自行解决。与两个冲突部门一起生成一个联合解决会话,让它们迭代:
engineering blocked by legal →
sessionsspawn(participants=[engineering, legal], objective=resolveblocker) →
wait(max_iterations=2) →
collect resolution
最多2次重新委派循环,之后升级到CEO并附上明确的阻塞报告。
阶段3 — 部分接受的汇聚
30秒硬性截止时间。截止后:接受部分结果,将缺失的部门输出标记为status: timeout,将其作为未完成项包含在最终报告中。绝不因单个部门而阻塞交付。
阶段4 — 合并前验证
在将每个部门输出合并到最终交付物之前:
- 1. 检查输出是否满足其definitionofdone
- 如果DoD未满足:标记为quality: partial — 不要静默丢弃
- 仅按依赖顺序合并:战略 → 工程 → 质量 → 运营
阶段5 — 交付与文档
每次完成编排后,自动附加:
- 1. 运行摘要(1段)
- 已交付/超时/被阻塞的部门
- 所做的架构/流程决策
- 改进下一次类似运行的建议
所有最终输出都带有强制性免责声明:
⚠️ 由AI生成的内容 — 在生产环境中使用前需要人工验证。
阶段6 — Git检查点(当涉及工程部门时)
要求工程部门在每个子任务后提交,而不仅仅在运行结束时。拒绝不是草稿且未标记needs-review的PR。绝不允许直接合并到main分支。
安全性
- - 所有会话间调用使用replysession: main以避免孤立会话
- sessionsspawn有速率限制:每次编排运行最多生成20个会话
- 负载在分发前根据交接模式进行验证
- 无外部网络调用 — 纯网关WebSocket路由
示例提示
使用firm-orchestration技能:
objective: 审计认证模块
departments: [quality, engineering]
constraints: [仅限只读访问, 不进行生产环境变更]
definitionofdone: 包含CVSS评分和修复建议的安全报告
deliveryformat: markdownreport
💎 支持
如果此技能对您有帮助,您可以支持开发:
狗狗币:DQBggqFNWsRNTPb6kkiwppnMo1Hm8edfWq