OpenClaw R&D Pipeline
Execute a deterministic workflow for Feishu-driven R&D tasks with strict role boundaries, status transitions, and closure rules.
Required Inputs
Collect or confirm these fields before starting:
- - Feishu source context: group/chat ID, message URL, requirement text, requester
- Requirement metadata: priority, project tag, deadline
- Project configuration: repository URL, production branch, owner/team role mapping
- Task identifiers: requirement ID and Feishu task/doc IDs once created
If priority is missing, set it to medium.
Role Boundaries
Apply these permissions strictly:
- - Main agent: clone/update repository in read-only mode for context and handoff
- PM subagent: parse requirement, optimize prompt, coordinate confirmation, create Feishu task structure
- Developer subagent: create feature branch, implement code, push branch, open PR
- Reviewer subagent: read-only review, no code edits, no merge
- Tester subagent: read-only testing and CI verification, no code edits, no merge
Use an isolated git worktree and dedicated tmux session per subagent.
Workflow
1) Intake and Context Build
Extract baseline fields from Feishu requirement.
Load project config and produce a shared project_context with:
- - project name
- repository URL
- production branch
- owner/team mapping
- requirement metadata
Then deepen understanding through PM subagent:
- - Query historical tasks in same Feishu group by project tag and requirement type.
- Load project Feishu wiki docs: product docs, API docs, prior decomposition cases, coding/UI/API/testing norms.
- Reuse prior parsing logic, edge cases, and acceptance criteria.
2) PM Structured Parsing Output
Generate:
- -
structured_requirement: business goal, inputs/outputs, boundaries, dependency modules/APIs, non-functional requirements - INLINECODE2 : task prompt with historical references and explicit acceptance checks
For multi-module or multi-scenario tasks, call Superpowers skill for decomposition and acceptance criteria alignment. If unavailable, perform equivalent manual decomposition and mark it explicitly.
3) Prompt Confirmation and Task Creation
Send refined prompt to the responsible owner for confirmation.
If owner requests updates:
- - propose changes with evidence from historical tasks and Feishu wiki
- iterate until approval
After approval:
- - create Feishu master task/doc with status INLINECODE3
- create 3 first-level subtasks with status
待开始: 编码, 评审, 测试 - attach relevant wiki norms in each subtask description
4) Development Stage
Set 编码 subtask to 进行中, then execute:
- - branch from production branch
- implement per project coding standards and historical patterns
- commit and push feature branch
- open PR to production branch
- include requirement ID, Feishu task ID, and knowledge-base links in PR title/description
Set 编码 subtask to 已完成 after PR is ready.
5) Review Stage
Set 评审 subtask to 进行中, then perform read-only review for:
- - logic correctness and edge cases
- exception handling
- security risks (injection, privilege issues, sensitive data)
- extensibility, reuse, performance
- UI/interaction conformance when frontend changes exist
- naming, structure, readability
Write findings in PR comments and cite historical review cases or wiki norms when relevant.
If pass, set 评审 subtask to 已完成.
If fail, reject with actionable reasons linked to historical issue patterns.
6) Test Stage
Set 测试 subtask to 进行中, then run:
- - lint
- TypeScript type check
- unit tests
- Playwright E2E tests
Apply hard gate:
- - if PR includes UI changes, require screenshot or recording in PR description
- if absent, fail CI and block merge
If pass, set 测试 subtask to 已完成.
If fail, log defects using defect taxonomy norms.
7) Failure Loop and Bug Subtasks
When review or test fails:
- - create BUG subtask under master task with status INLINECODE11
- include defect description, related norm, and similar historical bug case
- route back to developer subagent for fix and status progression INLINECODE12
- rerun review/test stages after fix
If repeated failures occur, re-open PM parsing to verify requirement interpretation.
8) Closure and Notification
Allow closure only when all are true:
- - 编码 subtask completed
- 评审 subtask completed
- 测试 subtask completed
- all BUG subtasks completed
Then:
- - set master task status to INLINECODE13
- notify owner in Feishu with summary package
Include in summary package:
- - Feishu task card
- PM brief: parsing process, historical tasks/docs referenced
- Developer brief: branch, PR link, code delta
- Reviewer brief: decision, issue count, cited norms
- Tester brief: CI outcome, coverage/case count
- total cycle time
- optional comparison with similar historical tasks
Output Templates
Load references/templates.md and use those templates for:
- - project context object
- refined prompt object
- PR description block
- review checklist
- test report
- final owner notification
Load references/feishu-fields.md to map real Feishu fields into pipeline fields.
Status Validation Script
Use scripts/validatestatus_flow.py before state updates and before final closure.
Transition check:
CODEBLOCK0
Snapshot check:
CODEBLOCK1
INLINECODE14 must include:
- - INLINECODE15
- INLINECODE16
- INLINECODE17
- INLINECODE18
- INLINECODE19 (list)
- INLINECODE20 (bool)
- INLINECODE21 (bool)
OpenClaw 研发流水线
执行基于飞书驱动的研发任务的确定性工作流,具有严格的角色边界、状态转换和关闭规则。
必需输入
在开始前收集或确认以下字段:
- - 飞书来源上下文:群组/聊天ID、消息链接、需求文本、需求提出者
- 需求元数据:优先级、项目标签、截止日期
- 项目配置:仓库URL、生产分支、负责人/团队角色映射
- 任务标识符:需求ID以及创建后的飞书任务/文档ID
如果缺少优先级,则设置为中等。
角色边界
严格应用以下权限:
- - 主代理:以只读模式克隆/更新仓库,用于上下文和交接
- PM子代理:解析需求、优化提示词、协调确认、创建飞书任务结构
- 开发子代理:创建特性分支、实现代码、推送分支、发起PR
- 评审子代理:只读评审,不编辑代码,不合并
- 测试子代理:只读测试和CI验证,不编辑代码,不合并
每个子代理使用独立的git工作树和专用的tmux会话。
工作流
1) 接收与上下文构建
从飞书需求中提取基线字段。
加载项目配置并生成共享的project_context,包含:
- - 项目名称
- 仓库URL
- 生产分支
- 负责人/团队映射
- 需求元数据
然后通过PM子代理加深理解:
- - 按项目标签和需求类型查询同一飞书群组中的历史任务
- 加载项目飞书维基文档:产品文档、API文档、先前分解案例、编码/UI/API/测试规范
- 复用先前的解析逻辑、边界条件和验收标准
2) PM结构化解析输出
生成:
- - structuredrequirement:业务目标、输入/输出、边界、依赖模块/API、非功能性需求
- refinedprompt:包含历史参考和明确验收检查的任务提示词
对于多模块或多场景任务,调用Superpowers技能进行分解和验收标准对齐。如果不可用,执行等效的手动分解并明确标记。
3) 提示词确认与任务创建
将优化后的提示词发送给负责负责人进行确认。
如果负责人要求更新:
- - 使用历史任务和飞书维基中的证据提出变更建议
- 迭代直至获得批准
批准后:
- - 创建状态为待开始的飞书主任务/文档
- 创建3个状态为待开始的一级子任务:编码、评审、测试
- 在每个子任务描述中附上相关的维基规范
4) 开发阶段
将编码子任务设置为进行中,然后执行:
- - 从生产分支创建分支
- 按照项目编码标准和历史模式实现
- 提交并推送特性分支
- 向生产分支发起PR
- 在PR标题/描述中包含需求ID、飞书任务ID和知识库链接
PR准备就绪后,将编码子任务设置为已完成。
5) 评审阶段
将评审子任务设置为进行中,然后执行只读评审,检查:
- - 逻辑正确性和边界条件
- 异常处理
- 安全风险(注入、权限问题、敏感数据)
- 可扩展性、复用性、性能
- 存在前端变更时的UI/交互符合性
- 命名、结构、可读性
在PR评论中记录发现,并在相关时引用历史评审案例或维基规范。
如果通过,将评审子任务设置为已完成。
如果失败,使用与历史问题模式相关的可操作原因拒绝。
6) 测试阶段
将测试子任务设置为进行中,然后运行:
- - lint
- TypeScript类型检查
- 单元测试
- Playwright E2E测试
应用硬性门禁:
- - 如果PR包含UI变更,要求在PR描述中包含截图或录制
- 如果缺失,CI失败并阻止合并
如果通过,将测试子任务设置为已完成。
如果失败,使用缺陷分类规范记录缺陷。
7) 失败循环与Bug子任务
当评审或测试失败时:
- - 在主任务下创建状态为待开始的BUG子任务
- 包含缺陷描述、相关规范以及类似的历史Bug案例
- 路由回开发子代理进行修复和状态推进待开始 -> 进行中 -> 已完成
- 修复后重新运行评审/测试阶段
如果重复失败,重新打开PM解析以验证需求理解。
8) 关闭与通知
仅当以下所有条件满足时才允许关闭:
- - 编码子任务已完成
- 评审子任务已完成
- 测试子任务已完成
- 所有BUG子任务已完成
然后:
- - 将主任务状态设置为已完成
- 在飞书中通知负责人,附带摘要包
摘要包中包含:
- - 飞书任务卡片
- PM简报:解析过程、引用的历史任务/文档
- 开发简报:分支、PR链接、代码变更量
- 评审简报:决策、问题数量、引用的规范
- 测试简报:CI结果、覆盖率/案例数量
- 总周期时间
- 可选:与类似历史任务的比较
输出模板
加载references/templates.md并使用这些模板用于:
- - 项目上下文对象
- 优化后的提示词对象
- PR描述块
- 评审检查清单
- 测试报告
- 最终负责人通知
加载references/feishu-fields.md以将真实的飞书字段映射到流水线字段。
状态验证脚本
在状态更新前和最终关闭前使用scripts/validatestatus_flow.py。
转换检查:
bash
scripts/validatestatusflow.py transition \
--task-type subtask \
--from-status 待开始 \
--to-status 进行中
快照检查:
bash
scripts/validatestatusflow.py snapshot --file status_snapshot.json
status_snapshot.json必须包含:
- - master
- coding
- review
- testing
- bugsubtasks(列表)
- uichanged(布尔值)
- uievidencepresent(布尔值)