Skill 系列(05):Skill 工作流串联——4 种模式实测,并发加速 1.5x
单个 Skill 的上限单个 Skill 天生职责单一。一个"写技术文章"的 Skill 做不到"先搜索竞品信息再分析再写报告",这需要多步骤、多专业能力的协同。串联把单个 Skill 组合成工作流,突破单一上下文的边界。4 种串联模式模式 1:顺序链(Sequential Chain)A → B → C 每个 Skill 的输出是下一个 Skill 的输入最简单,适合线性任务。关键约束:一步失败,整条链中断。模式 2:并发 Fan-out→ B1 → A → split → B2 → merge → C → B3 →多个 Skill 并发执行,最后汇总。理论加速比 = 分支数,实际取决于 merge 步骤的时延。模式 3:条件路由A → Router → [type=technical] → tech-writer [type=marketing] → marketing-writer [default] → general-writerRouter Skill 输出枚举类型,工作流根据结果跳转。关键:Router 必须输出明确的枚举值,不能是模糊文本。模式 4:反馈循环A → Evaluator → [score ≥ 7] → 输出 ↓ [score 7] → 携带 feedback → A(重试,max 3)质量门:输出不达标则携带评审意见重写。必须设最大重试次数,防止死循环。Demo 设计4 种模式各用真实 LLM 调用实现:模式实现测量顺序链LangGraph 3 节点图:keywords → outline → write端到端时延并发 fan-outThreadPoolExecutor× 3 → mergefan-out 时延、总时延、加速比条件路由LLM 分类输入类型 → 路由到 3 种 writer路由准确率、输出风格对比反馈循环写 → 质量评分(1-10)→ 带 feedback 重写,max 3 轮迭代次数、每轮评分运行结果Pattern 1:顺序链(keyword → outline → write)Topic: Python async/await: from coroutines to production-ready patterns Keywords: async programming, coroutines, await, production-ready patterns Outline: - Introduction to Async Programming in Python - Understanding Coroutines and the `async` Key