🎼 DSH 工作流交响乐团 · dsh-workflow-symphony
A score library of multi-agent orchestration for DeepSeek Harness — write workflows like sheet music. 为 deepseek-ai/deepseek-harness(122k+ ⭐, "Everything is a Plugin") 生态打造的多智能体编排"乐谱"库。
✨ 亮点
- 开箱即用的五份"乐谱" — 每个乐谱 = meta.json + workflow.js 双文件, 内容直接粘贴进 DSH workflow 工具的 meta / script / args 三个参数即可演奏, 零依赖、零安装。
- 真正的多智能体分工 — 扇出并行调研、流水线分层编译、论证-攻击-裁决, 让每个 agent 各司其职, 告别"一个巨无霸 prompt 干所有事"。
- schema 强约束的可降级编排 — 关键 agent 输出均有 JSON Schema 校验; 子代理失败返回 null, 配合 .filter(Boolean) 显式降级, 单点失败不影响整体。
- 成本心智模型内置 — 文档给出 agent 调用数上界公式(≈ 项数 × 阶段数)与反模式清单, 防止无上限 fan-out 烧掉预算。
- 中文优先、随手可改 — 全部文档与乐谱中文撰写, 每份乐谱独立成目录, 按需裁剪即可变成你自己的编排。
💡 灵感来源
本仓库的编排设计借鉴了以下概念(均为思路启发, 不附路径):
- LLM编译式知识库 — 把资料当源码, 用"编译"式的渐进加工得到可用知识产物(progressive-compile 乐谱);
- 自我改进Agent — 论证-攻击-裁决的对抗式自检循环, 让结论在相互质疑中收敛(adversarial-audit 乐谱);
- 智能RAG选择性检索 — 按角度扇出、按需检索, 而非一次性灌入全部上下文(fan-out-research 乐谱);
- 知识库的代谢律 — 日报文摘让知识库保持"新陈代谢", 只沉淀值得行动的增量(daily-digest 乐谱);
- CAD自动化装配 — 多个专业角色像零件一样装配进同一道工序(code-review-orchestra 乐谱);
- MCP协议与CAD集成 — 标准化接口让不同工具/角色即插即用(乐谱的 schema 契约同源)。
🏛️ 架构一览
单 Agent 串行 vs 乐团并行
flowchart LR
subgraph Solo["🎻 单 Agent 串行"]
S1[读文件] --> S2[搜索] --> S3[思考] --> S4[写作] --> S5[复查]
end
subgraph Orch["🎼 乐团并行 · workflow"]
O0[指挥 phase] --> O1[第一提琴: 角度 1]
O0 --> O2[第二提琴: 角度 2]
O0 --> O3[中提琴: 角度 3]
O1 & O2 & O3 --> O4[汇总 agent]
O4 --> O5[(JSON 结果)]
end
乐谱如何被演奏
flowchart TB
subgraph Scores["scores/ 乐谱库"]
M1[fan-out-research]
M2[adversarial-audit]
M3[code-review-orchestra]
M4[progressive-compile]
M5[daily-digest]
end
subgraph Input["workflow 工具三参数"]
P1[meta = meta.json 内容]
P2[script = workflow.js 内容]
P3[args = 调用时传入的 JSON]
end
Scores --> Input --> WF[DSH workflow 引擎]
WF --> A1[子代理 1]
WF --> A2[子代理 2]
WF --> A3[子代理 N]
A1 & A2 & A3 --> R[(JSON 结果)]
📁 目录结构
dsh-workflow-symphony/
├── README.md # 本文件: 总览、亮点、快速开始
├── LICENSE # MIT(2026 ZF)
├── .gitignore
├── skills/ # DSH 技能 bundle(官方支持的 skills/<name>/SKILL.md 一层结构)
│ └── dsh-workflow-symphony/
│ └── SKILL.md # 技能定义: 含中文触发词与 whenToUse 路由说明
├── docs/
│ ├── 01-patterns.md # 编排模式: pipeline / parallel / 混合 + 成本心智模型
│ ├── 02-score-format.md # 乐谱双文件规范与写法禁区
│ └── 03-antipatterns.md # 反模式清单
├── scores/ # 五份乐谱, 每份 = meta.json + workflow.js
│ ├── fan-out-research/
│ ├── adversarial-audit/
│ ├── code-review-orchestra/
│ ├── progressive-compile/
│ └── daily-digest/
├── tools/
│ └── README.md # 乐谱运行手册
└── examples/
├── fan-out-research-sample.md
└── daily-digest-sample.md
🎵 乐谱清单
| 乐谱 | 用途 | 阶段数 | 建议 agent 数 | args |
|---|---|---|---|---|
| fan-out-research | 多角度并行调研 + 综合成稿 | 2 | 3~7 | {topic, angles[2-6], locale} |
| adversarial-audit | 论证-攻击-裁决三段式质检 | 3 | 3 | {claim, locale} |
| code-review-orchestra | 四角色并行代码评审 + 优先级汇总 | 2 | 5 | {paths[], language} |
| progressive-compile | 摘要→概念→审视→综述流水线编译 | 4 | ≤ 4 × 资料数 | {sources[]} |
| daily-digest | 收集→分类→生成日报文摘 | 3 | 3 | {since, scope[]} |
🚀 快速开始
前提: 安装 Node.js, 并能启动 DSH:
npx @deepseek-ai/dsh web
安装技能(可选但推荐): 把 skills/dsh-workflow-symphony/SKILL.md 复制到以下任一技能目录(推荐项目级 .dsh/skills):
- /skills/dsh-workflow-symphony/SKILL.md(Windows 默认 dshHome 即 DSH 的 data 目录);
- /.dsh/skills/dsh-workflow-symphony/SKILL.md(推荐);
- /.agents/skills/dsh-workflow-symphony/SKILL.md。
之后 agent 在"编排 / 乐谱 / 工作流 / 交响"等场景会自动加载本库用法。注意: 官方技能发现不支持递归 **/SKILL.md, 请保持 skills//SKILL.md 一层结构。
演奏一份乐谱(以 fan-out-research 为例), 三步:
- meta 参数 — 把 scores/fan-out-research/fan-out-research.meta.json 的内容(纯 JSON)粘贴为 workflow 工具的 meta 参数:
{
"name": "fan-out-research",
"description": "Fan out one research topic into parallel angle reports, then synthesize consensus, disagreements, references and open questions.",
"whenToUse": "需要从多个角度并行调研一个主题并汇总结论时",
"phases": [
{ "title": "并行调研", "detail": "每个角度一个 agent, 各自检索并综合" },
{ "title": "综合成稿", "detail": "汇总角度报告, 产出共识/分歧/参考/开放问题" }
]
}
script 参数 — 把 scores/fan-out-research/fan-out-research.workflow.js 的内容(纯 JS 脚本体)粘贴为 workflow 工具的 script 参数。注意: 脚本体是纯 JS, 严禁出现 import / export / require 语句, 也不要尝试在其中读写文件或访问网络——文件读写由子代理完成。
args 参数 — 在 args 传入 JSON:
{
"topic": "DeepSeek Harness 插件生态",
"angles": ["官方核心能力", "社区插件与扩展", "与 MCP 生态的关系"],
"locale": "zh-CN"
}
运行后, workflow 引擎会并行启动 3 个调研子代理, 再由 1 个综合子代理产出 {topic, angleReports[], synthesis}。更多操作细节见 tools/README.md。
📄 文件清单
| 路径 | 用途 |
|---|---|
| README.md | 项目总览、亮点、架构、快速开始 |
| LICENSE | MIT 许可证(Copyright (c) 2026 ZF) |
| .gitignore | 忽略 node_modules、日志、缓存、数据目录等 |
| skills/dsh-workflow-symphony/SKILL.md | DSH 技能定义(含中文触发词与 whenToUse), 让 agent 学会使用本库 |
| docs/01-patterns.md | 三种编排原语、schema 价值、成本心智模型 |
| docs/02-score-format.md | 乐谱双文件规范、脚本禁区、自检清单 |
| docs/03-antipatterns.md | 六条反模式与修复方法 |
| scores//.meta.json | 五份乐谱的元数据 |
| scores//.workflow.js | 五份乐谱的编排脚本 |
| tools/README.md | 乐谱运行手册(参数映射、操作步骤、FAQ) |
| examples/fan-out-research-sample.md | fan-out-research 示例输出 |
| examples/daily-digest-sample.md | daily-digest 示例文摘 |
| examples/audit-demo-20260816.md | adversarial-audit 真实运行输出 |
| docs/verification.md | 真实运行验证报告(adversarial-audit 已实跑) |
📚 文档
English Overview
This repository is a "score library" for multi-agent orchestration on DeepSeek Harness. Each score is a pair of files: a meta.json (name, description, when-to-use, phases) and a workflow.js (pure-JS orchestration script). To play a score, paste the content of meta.json into the meta parameter of the workflow tool, the content of workflow.js into the script parameter, and pass your JSON as args. Five ready-to-play scores are included: fan-out research, adversarial audit, code-review orchestra, progressive compile and daily digest. Orchestration scripts only coordinate subagents; file I/O, web search and other real work are done by the subagents.
⚖️ License
MIT License — Copyright (c) 2026 ZF. 详见 LICENSE。
🔗 相关项目
- dsh-knowledge-forge — LLM 编译式知识库
- dsh-cad-copilot — CAD 智能副驾驶
- dsh-self-evolving-agent — 自我改进 Agent
- dsh-workflow-symphony — 本仓库: 工作流交响乐团
No comments yet. Be the first to write one.