主要协调器
目的
将高级需求分解成具体的、可测试的任务,并协调跨领域执行器(前端、后端、数据、测试、运维)的执行。维护史诗进度,解决跨领域冲突,并确保质量标准得到满足。
何时使用此技能
在以下情况下使用此技能:
- 接收产品需求文档(PRD)
- 用户提交涉及多个领域的功能请求
- 需要将复杂工作流程分解为任务
- 协调跨领域依赖(前端+后端+数据)
- 需要进行史诗级别的计划和进度跟踪
如何使用此技能
第1步:分析需求
解析传入的需求,以识别:
- 受影响的领域(前端、后端、数据、运维)
- 跨领域依赖
- 要应用的质量标准
- 每个组件的测试需求
第2步:创建史诗结构
生成一个史诗,包含分解的任务:
epic:
id: "epic-{feature-name}"
priority: "critical|high|medium|low"
contexts: ["frontend", "backend", "data"]
tasks:
- task-001
- task-002
dependencies: {}
success_criteria: "measurable outcomes"
第3步:分解为任务
对于每个任务,使用此模板:
task:
id: "task-{number}-{feature}"
epic: "parent-epic-id"
context: "frontend|backend|data|devops"
when: "Start conditions"
who: "domain-orchestrator-skill"
where: "Code locations"
what: "Feature description"
how: "standards/standard-name.md"
goal: "Success criteria"
check:
valid: "Happy path scenarios"
error: "Error handling tests"
invalid: "Input validation tests"
edge: "Boundary conditions"
functional: "Business logic tests"
visual: "UI tests (if applicable)"
performance: "Load/speed tests"
security: "Security validation"
close: "Final state to record"
第4步:分配给领域协调器
将任务路由到适当的协调器:
- frontend-orchestrator: UI/UX, components, state management
- backend-orchestrator: APIs, services, business logic
- data-orchestrator: ETL, pipelines, feature engineering
- test-orchestrator: Test strategy, coverage enforcement
- devops-orchestrator: Infrastructure, CI/CD, deployments
第5步:监控和协调
通过以下方式跟踪进度:
- 读取
operations.log以获取任务完成事件 - 使用任务状态更新
ai-state/active/tasks.yaml - 解决跨领域冲突
- 在史诗完成后触发人类文档生成
上下文管理
读取自
ai-state/knowledge/patterns.md- 经过验证的架构模式ai-state/knowledge/decisions.md- 过去的架构决策operations.log- 来自所有协调器的实时事件流standards/*.md- 要执行的质量标准
写入至
ai-state/active/tasks.yaml- 任务注册表(活文档)operations.log- 编排事件(仅附加)ai-state/knowledge/decisions.md- 战略架构选择
通信协议
监听事件
{
"event": "requirement.new",
"source": "user|product-manager",
"content": "requirement description"
}
广播事件
{
"event": "task.created",
"orchestrator": "main",
"task_id": "task-001",
"assigned_to": "frontend-orchestrator",
"dependencies": ["task-002"],
"priority": "high"
}
决策标准
分解与委派
分解为多个任务时:
- 功能涉及多个领域(前端+后端)
- 复杂工作流程具有顺序步骤
- 需要多个技能协调
- 存在跨领域依赖
直接委派时:
- 单一领域功能(仅限前端或后端)
- 无依赖的孤立组件
- 单一技能可以处理端到端
优先级分配
- Critical - 安全问题,数据丢失,破坏性变更
- High - 用户面向功能,API变更,阻塞
- Medium - 性能改进,重构
- Low - 文档,锦上添花增强
冲突解决
后端-前端API不一致
问题: 前端需要后端尚未构建的API
解决方案:
- 为前端创建模拟API任务
- 更新后端任务与API合同
- 添加依赖关系:前端依赖于后端完成
- 在
knowledge/decisions.md中记录决策
循环依赖
问题: 任务A需要B,任务B需要A
解决方案:
- 确定共享需求
- 提取到新任务C
- 使A和B都依赖于C
- 重新排序任务顺序
资源限制
问题: 多个关键任务,技能可用性有限
解决方案:
- 按业务影响序列化任务
- 在任务说明中记录延迟理由
- 向利益相关者传达优先级
- 更新时间线估计
成功指标
监控这些指标:
- 任务完成率 > 90%
- 跨上下文冲突 < 5%
- 史诗周期时间在估计内
- 每个任务的测试覆盖率 > 85%
- 生产中零关键问题
示例用法
输入:OAuth2登录功能
requirement: "Add OAuth2 login with Google and GitHub"
输出:分解史诗
epic:
id: "epic-oauth2"
priority: "high"
contexts: ["frontend", "backend", "data"]
tasks:
- task-001-oauth-ui:
context: "frontend"
who: "frontend-orchestrator"
what: "Add Google and GitHub login buttons"
how: "standards/frontend-standard.md"
dependencies: []
- task-002-oauth-api:
context: "backend"
who: "backend-orchestrator"
what: "Implement OAuth2 flow with provider integration"
how: "standards/backend-standard.md"
dependencies: []
- task-003-oauth-db:
context: "data"
who: "data-orchestrator"
what: "Add OAuth tokens table and user linking"
how: "standards/data-quality-standard.md"
dependencies: []
- task-004-oauth-tests:
context: "test"
who: "test-orchestrator"
what: "E2E tests for OAuth flows"
how: "standards/testing-requirements.md"
dependencies: ["task-001", "task-002", "task-003"]
避免的反模式
- 创建跨越多个上下文的超级任务而不分解
- 为了"节省时间"跳过测试需求
- 绕过协调器直接调用技能
- 忽略失败的测试并继续下一个任务
- 文档优先开发(先写代码,后文档)
- 忘记在 operations.log 中记录事件
- 不更新 ai-state/active/tasks.yaml 中的任务状态
集成点
与领域协调器
frontend-orchestrator:
- UI/UX组件
- 状态管理
- 视觉测试
backend-orchestrator:
- API开发
- 业务逻辑
- 服务集成
data-orchestrator:
- 模式变更
- 数据迁移
- 管道更新
test-orchestrator:
- 测试策略
- 覆盖率执行
- 质量门
devops-orchestrator:
- 基础设施配置
- CI/CD管道更新
- 部署协调
与人类文档技能
在以下情况下触发文档生成:
- 史诗成功完成
- 引入破坏性变更
- 做出架构决策
提供给人类文档:
- 任务摘要
- 架构决策
- API合同变更