Build Pipeline Skill
Your build orchestration workflow: parse → spawn research workers + Builder in parallel → wait for research → feed research to Builder → wait for result → report.
Pipeline Overview
- 1. Create Build — Initialize build record (
shared/builds/{build-id}/build.yaml) - Parse — Extract domain, classify complexity, apply smart defaults, write parse-report.yaml
- Parallel Spawn — Spawn all research workers AND Builder simultaneously
- Wait for Research — Poll until all expected research partials exist in INLINECODE1
- Feed Research to Builder — Send Builder phase 2 task with research findings via INLINECODE2
- Wait for Builder — Poll for INLINECODE3
- Report — Read builder-result.yaml and report success or failure to the user
User-Facing Progress Contract (Required)
You must communicate pipeline progress with structured stepper events, not technical narration.
Event rules
- 1. At start: emit
status.changed = running. - For each pipeline step, emit
progress.step.started. - When moving to the next step, emit
progress.step.completed for the previous step first. - Then emit
progress.step.started for the next step. - Do not emit
phase.changed for new builds. - Do not send repetitive assistant text on each transition; rely on stepper events.
Step IDs + friendly copy
| Pipeline step | step_id | title | description |
|---|
| Create Build Record | INLINECODE10 | INLINECODE11 | INLINECODE12 |
| Parse |
parse |
Understanding your request |
I'm reading your request and mapping the plan. |
| Research |
research |
Gathering what we need |
I'm collecting the tools and references for your build. |
| Building |
building |
Building your agent |
I'm designing, assembling, and testing your agent now. |
| Final report |
finalize |
Finalizing |
I'm wrapping up and preparing your result. |
Prohibited user-facing language
Do not output internal-engineering narration such as:
- - "Now I'll spawn all research workers."
- "Spawning the Builder agent now."
- "Waiting for Builder to complete."
Always translate internal work into friendly progress copy from the table above.
Spawning Rules
- 1. Research workers MUST read their SKILL.md — Don't summarize instructions in the task. Tell them to read the file.
- Research workers use
agentId: null — they have no workspace, just task prompts. - Builder uses
agentId: "builder" — it has a workspace at workspace_builder/. - Never pass
streamTo="parent" for any subagent. - Parallel spawn: Research workers and Builder are spawned in the same function call block; do not wait between spawns.
- Use stronger models for complex workers — gpt-4o for api-scout, tools-catalog, skills-finder. Haiku for domain-researcher.
- Add readable labels — Format:
{worker-type}-{build-id} (e.g., api-scout-8bc5666a).
Critical Sub-Agent Pattern
Sub-agents must:
- 1. Read their SKILL.md file first
- Follow ALL instructions in the file
- Write output to YAML file (not chat back)
- Exit silently after writing
If a sub-agent reports findings in chat instead of writing the file, it failed.
Task Prompt Template
CODEBLOCK0
Step 1: Create Build Record
Write to: INLINECODE31
Set status: "initiated".
Build Record Schema
CODEBLOCK1
Step 2: Parse
Analyze user prompt. Write parse report to: INLINECODE33
If confidence < 0.20, ask user for clarity. Do not proceed. Confidence >= 0.7 to proceed normally.
Channel Connection Policy (v1)
- - Default all builds to
channel_type: local. - Do not ask users which channel to connect during parse.
- Only capture channel intent if the prompt explicitly requests it (e.g. Telegram/WhatsApp/Discord).
Parse Report Schema
CODEBLOCK2
Step 3: Parallel Spawn (Research Workers + Builder)
After successful parse, spawn all research workers and Builder simultaneously in a single spawn block.
3a. Create Research Partials Directory
CODEBLOCK3
3b. Spawn All Research Workers + Builder
Use a single sessions_spawn block with multiple calls. Do not wait between spawns.
Research Worker Registry (Updated):
| Worker | SKILL.md path | Writes | Always? | Model |
|---|
| Domain Researcher | INLINECODE37 | INLINECODE38 | Yes | INLINECODE39 |
| API Scout |
skills/research-workers/api-scout/SKILL.md |
api_research.yaml | Yes |
openai/gpt-5.2 |
| Tools Catalog |
skills/research-workers/tools-catalog-worker/SKILL.md |
tools_catalog.yaml | Yes |
openai/gpt-4o |
| Skills Finder |
skills/research-workers/skills-finder-worker/SKILL.md |
skills_research.yaml | Yes |
anthropic/claude-haiku-4-5 |
| Regulation Scanner |
skills/research-workers/regulation-scanner/SKILL.md |
regulation_research.yaml | If needed |
anthropic/claude-sonnet-4-6 |
| Edge Case Scanner |
skills/research-workers/edge-case-scanner/SKILL.md |
edge_case_research.yaml | If needed |
anthropic/claude-sonnet-4-6 |
Note: Use gpt-4o (not mini) for complex evaluation tasks (api-scout, tools-catalog, skills-finder).
Spawn pattern — tell workers to read their SKILL.md:
CODEBLOCK4
Spawn Builder in the same block:
CODEBLOCK5
Rules:
- - All research workers spawn simultaneously
- Builder spawns in the same block as workers
- Do not wait for workers or Builder init to complete before proceeding to Step 4
- Store Builder's
sessionKey for later use in Step 5
Step 4: Wait for Research Workers to Complete
Poll the research-partials/ directory until all expected partial files exist.
Expected files:
- -
domain_model.yaml ✓ - INLINECODE59 ✓
- INLINECODE60 ✓
- INLINECODE61 (if spawned) ✓
- INLINECODE62 (if spawned) ✓
Poll behavior:
- - Check every 5 seconds
- Timeout per worker: 300 seconds
- If a worker times out: continue with partial research; Builder will design with what exists
- User message if timeout: "I'll proceed with the research we have so far."
Step 5: Feed Research to Builder (Phase 2 Task)
Once all expected research partials exist, send Phase 2 task to Builder via sessions_send:
CODEBLOCK6
Step 6: Wait for Builder Result
Poll for: INLINECODE64
Poll behavior:
- - Check every 10 seconds
- Timeout: 700 seconds
- If file appears: read it and proceed to Step 7
- If timeout: report failure to user with last known status from INLINECODE65
Step 7: Report
Read builder-result.yaml.
Success Path
If
status: complete:
CODEBLOCK7
Failure Path
If
status: failed:
The build encountered an issue:
Error: {builder_result.error.message}
Phase: {builder_result.error.phase}
Would you like to:
1. Retry the build
2. Start fresh with a new idea
3. Adjust the scope and try again
Multiple Builds
Each build gets its own {build-id} directory with independent research and builder outputs.
If a build is in progress: "You have a build in progress ([domain]). Start a new one, or finish that first?"
Error Handling
Research worker timeout (>300s):
- - Continue with partial research found so far
- User message: "I'll proceed with the research we have so far."
Builder timeout (>700s):
- - User message: "The build is taking longer than expected. Let me check what happened."
- Read
build.yaml for last known status - Report to user with context
- Offer retry or fresh start
Builder reports failure:
- - Read
builder_result.error field - Translate to user-friendly message
- Offer to retry or start fresh
Retry Strategy
- 1. First failure → Tell user. Retry automatically (resend phase 2 task).
- Second failure → Tell user exactly what happened. Offer options.
- Third attempt → Give up. Report to user. No more retries.
Builder Result Schema (builder-result.yaml)
CODEBLOCK9
构建流水线技能
您的构建编排工作流:解析 → 并行生成研究人员 + 构建器 → 等待研究 → 将研究结果输入构建器 → 等待结果 → 报告。
流水线概览
- 1. 创建构建 — 初始化构建记录 (shared/builds/{build-id}/build.yaml)
- 解析 — 提取领域、分类复杂度、应用智能默认值、写入解析报告
- 并行生成 — 同时生成所有研究人员和构建器
- 等待研究 — 轮询直到所有预期研究片段存在于 research-partials/ 中
- 将研究结果输入构建器 — 通过 sessions_send 向构建器发送带有研究发现的第二阶段任务
- 等待构建器 — 轮询 shared/builds/{build-id}/builder-result.yaml
- 报告 — 读取 builder-result.yaml 并向用户报告成功或失败
面向用户的进度契约(必需)
您必须使用结构化的步骤事件(而非技术性叙述)来传达流水线进度。
事件规则
- 1. 开始时:发出 status.changed = running。
- 对于每个流水线步骤,发出 progress.step.started。
- 进入下一步时,先为前一步发出 progress.step.completed。
- 然后为下一步发出 progress.step.started。
- 新构建不要发出 phase.changed。
- 每次转换时不要发送重复的助手文本;依赖步骤事件。
步骤ID + 友好文案
| 流水线步骤 | stepid | 标题 | 描述 |
|---|
| 创建构建记录 | buildrecord | 正在启动您的构建 | 我正在设置您的构建会话。 |
| 解析 |
parse | 正在理解您的请求 | 我正在读取您的请求并规划方案。 |
| 研究 | research | 正在收集所需内容 | 我正在为您的构建收集工具和参考资料。 |
| 构建 | building | 正在构建您的智能体 | 我正在设计、组装和测试您的智能体。 |
| 最终报告 | finalize | 正在收尾 | 我正在整理并准备您的成果。 |
禁止使用的面向用户语言
不要输出内部工程叙述,例如:
- - 现在我将生成所有研究人员。
- 正在生成构建器智能体。
- 正在等待构建器完成。
始终将内部工作翻译为上表中的友好进度文案。
生成规则
- 1. 研究人员必须阅读其 SKILL.md — 不要在任务中总结指令。告诉他们阅读文件。
- 研究人员使用 agentId: null — 他们没有工作空间,只有任务提示。
- 构建器使用 agentId: builder — 它在 workspace_builder/ 有工作空间。
- 任何子智能体都不要传递 streamTo=parent。
- 并行生成: 研究人员和构建器在同一函数调用块中生成;生成之间不要等待。
- 对复杂工作者使用更强的模型 — api-scout、tools-catalog、skills-finder 使用 gpt-4o。domain-researcher 使用 Haiku。
- 添加可读标签 — 格式:{worker-type}-{build-id}(例如,api-scout-8bc5666a)。
关键子智能体模式
子智能体必须:
- 1. 首先阅读其 SKILL.md 文件
- 遵循文件中的所有指令
- 将输出写入 YAML 文件(而非回传聊天)
- 写入后静默退出
如果子智能体在聊天中报告发现而非写入文件,则视为失败。
任务提示模板
首先:阅读您的指令
在执行任何操作之前,请阅读您的 SKILL.md 文件:
~/.openclaw-factory/workspace/skills/research-workers/{worker_name}/SKILL.md
精确遵循该文件中的所有指令。特别注意:
- - 关键:您的输出是文件部分
- 最低输出要求(您必须满足这些要求)
- 最后写入 YAML 文件(强制)
构建上下文
- - 领域:{domain}
- 原型:{archetypes}
- 构建ID:{buildid}
- 输出路径:~/.openclaw-factory/shared/builds/{buildid}/research-partials/{output_file}
执行
阅读 SKILL.md → 研究 → 写入 YAML 文件 → 静默退出。
步骤 1:创建构建记录
写入:shared/builds/{build-id}/build.yaml
设置 status: initiated。
构建记录模式
yaml
build:
id: {build-id} # UUID
status: initiated # 或:parsed, researching, building, complete, failed
user_prompt: 为我构建一个航班预订智能体
current_phase: null
domain: 航班预订 # 解析后填写
complexity: medium # simple|medium|complex|system
started_at: 2026-03-09T14:30:00Z
completed_at: null
phase_history: []
error: null # 或 {phase: ..., message: ..., retries: 0}
buildersessionkey: null # 构建器生成后填写
步骤 2:解析
分析用户提示。将解析报告写入:shared/builds/{build-id}/parse-report.yaml
如果 confidence < 0.20,请用户澄清。不要继续。confidence >= 0.7 正常继续。
渠道连接策略(v1)
- - 默认所有构建为 channel_type: local。
- 不要在解析期间询问用户要连接哪个渠道。
- 仅当提示明确请求时才捕获渠道意图(例如 Telegram/WhatsApp/Discord)。
解析报告模式
yaml
parse_report:
id: [uuid 或 时间戳]
timestamp: [ISO 8601]
raw_prompt: [确切的用户输入,逐字]
classification:
domain: [主要领域]
sub_domains: [列表]
archetypes: [主要, 次要, ...]
complexity_tier: [simple | medium | complex | system]
clarity: [high | medium | low]
inferred:
endusertype: [consumer | business | internal | self]
interaction_mode: [chat | command | scheduled | event-driven]
persistence: [one-shot | session | always-on]
approval_needed: [true | false]
memory_needed: [true | false]
channel_type: local
channel_intent: [none | telegram | whatsapp | discord | signal | other]
architecture_recommendation:
pattern: [single-agent | spawn-workers | agent-teams | lobster-workflow]
estimated_skills: [数量 或 TBD]
research_targets:
- query: 真实的 [领域] 智能体是如何工作的?
priority: critical
- query: [领域] 有哪些可用的 API?
priority: critical
- query: 哪些 OpenClaw 技能涵盖 [领域]?
priority: high
friction:
must_ask: []
smart_defaults: []
confidence: [0.0 - 1.0]
步骤 3:并行生成(研究人员 + 构建器)
成功解析后,在单个生成块中同时生成所有研究人员和构建器。
3a. 创建研究片段目录
bash
mkdir -p ~/.openclaw-factory/shared/builds/{build-id}/research-partials/
3b. 生成所有研究人员 + 构建器
使用包含多个调用的单个 sessions_spawn 块。生成之间不要等待。
研究人员注册表(已更新):
| 工作者 | SKILL.md 路径 | 写入 | 始终? | 模型 |
|---|
| 领域研究员 | skills/research-workers/domain-researcher/SKILL.md | domainmodel.yaml | 是 | anthropic/claude-haiku-4-5 |
| API 侦察员 |
skills/research-workers/api-scout/SKILL.md | apiresearch.yaml | 是 | openai/gpt-5.2 |
| 工具目录 | skills/research-workers/tools-catalog-worker/SKILL.md | tools_catalog.yaml | 是 | openai/gpt-4o |
| 技能查找器 | skills/research-workers/skills-finder-worker/SKILL.md | skills_research.yaml | 是 | anthropic/claude-haiku-4-5 |
| 法规扫描器 | skills/research-workers/regulation-scanner/SKILL.md | regulation_research.yaml | 如果需要 | anthropic/claude