skill-orchestrator-v1

Orchestrator that chains two or more "file-in, file-out" skills into a pipeline with ordered control, an observable checklist, and failure-degradation handling. Used when a user wants to compose existing skills into an automated flow, write orchestration scripts, build a skill pipeline, or link multiple agent skills. Trigger phrases include skill orchestration, orchestration script, chaining skills, skill pipeline, pipeline, connect A to B, and automated flow.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "skill-orchestrator-v1" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-2c68a70a12bd3f6436c8e967ab3e3bf30b0a1071e97c57facd5086b6f05f4621. Verify the upstream source and version against https://skillhub.cn/skills/user_58fad8c3/skill-orchestrator-v1 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Orchestrator that chains two or more "file-in, file-out" skills into a pipeline with ordered control, an observable checklist, and failure-degradation handling. Used when a user wants to compose existing skills into an automated flow, write orchestration scripts, build a skill pipeline, or link multiple agent skills. Trigger phrases include skill orchestration, orchestration script, chaining skills, skill pipeline, pipeline, connect A to B, and automated flow.

0 Downloads

Introduction source: third_party · user_58fad8c3 · 1.0.2 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Software, accounts and paid services
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: skill-orchestrator
agent_created: true
description: 把两个或多个"文件进、文件出"的技能串成一条带顺序控制、可观测清单、失败降级的流水线。当用户想把已有技能编排成自动化链路、写编排脚本、做 skill pipeline、串联多个 agent 技能产出时使用。触发词:技能编排、编排脚本、串联技能、skill pipeline、流水线、把A接B、自动化链路。

技能编排器(Skill Orchestrator)

把互相独立的技能,用 文件作为中间语言 串成可控的流水线。不 import 技能代码,用 subprocess 进程隔离调用,故障互不污染。

本技能自带一条已验证的示范链路 scripts/orchestrate_scan2report.py:把 scan-to-word(OCR 扫描件→可编辑 docx + Markdown 报告)的输出,自动接力给 ai-transformation-consultant 模块 C(md2docx,Markdown→精美 Word 报告)。它本身就是"通用编排范式"的范例,可照葫芦画瓢套到任意两个技能对。

何时用

  • 已有 2+ 个技能,各自"读文件→写文件",你想让它们自动接力。
  • 需要顺序控制 / 失败降级 / 运行可追溯(manifest)。

调用示范链路(scan-to-word → md2docx)

Stage B 需 python-docx,务必用已装依赖的 venv 解释器运行编排脚本:

PY="C:/Users/13301/.workbuddy/binaries/python/envs/default/Scripts/python.exe"
ORCH="C:/Users/13301/.workbuddy/skills/skill-orchestrator/scripts/orchestrate_scan2report.py"

# 1) 完整链路(需先装 Stage A 的 OCR 依赖;首次联网下载 OCR 模型)
"$PY" "$ORCH" --input 合同.png --mode high --out ./out

# 2) 仅 Stage B(Stage A 已在别处/分批跑完,报告已落盘到 --out)
"$PY" "$ORCH" --join --out ./out

# 3) 自测:样例报告 → Stage B → 断言产物非空 → 清理(只需 python-docx,无需 OCR 依赖)
"$PY" "$ORCH" --self-test

参数

参数 说明
--input <路径> 扫描件图片/PDF(完整链路必填)
--mode standard / high / batch(默认 standard)
--out <目录> 输出目录(默认 ./out)
--join 仅跑 Stage B,假定 *_OCR报告_*.md 已落盘在 --out
--self-test 自测编排逻辑(生成样例→Stage B→断言→清理)

路径(两个子技能均可用环境变量覆盖)

环境变量 默认指向 用途
SCAN_TO_WORD_SCRIPT 工作目录下 scan-to-word-skill/scripts/scan_to_word.py Stage A 脚本
MD2DOCX_SCRIPT 用户级 ai-transformation-consultant/scripts/md2docx.py Stage B 脚本

跨机器 / 跨工作目录时,用环境变量把两个子脚本指到你自己的路径即可,无需改代码。

子技能依赖(由运行编排器的解释器负责)

  • Stage A:rapidocr-onnxruntime, opencv-python-headless, pillow, python-docx, numpy, pymupdf
  • Stage B:python-docx

四原则(务必遵守)

  1. 顺序 > 并行:下游强依赖上游产物时必须串行。
  2. 可观测性优先:每阶段打印 [时间戳][级别] 状态;结束写 orchestration_manifest.json(run_at / stages.status / outputs)。
  3. 失败降级:上游失败则整体停;仅下游失败则上游产物保留,不连带损坏。
  4. 文件即中间语言:技能间通过约定的中间文件(如 *_OCR报告_*.md)解耦,互不感知实现。

通用编排骨架(套到其他技能对)

import subprocess, glob, os, json, datetime, sys
PY = sys.executable
SKILL_A = os.environ.get("SKILL_A", "a.py")
SKILL_B = os.environ.get("SKILL_B", "b.py")

def stage_a(inp, out):
    rc = subprocess.run([PY, SKILL_A, "--input", inp, "--out", out]).returncode
    if rc: raise RuntimeError(f"A 退出码 {rc}")
    out_files = sorted(glob.glob(os.path.join(out, "*.md")))
    return out_files[-1] if out_files else (_ for _ in ()).throw(RuntimeError("A 无产物"))

def stage_b(md):
    rc = subprocess.run([PY, SKILL_B, md]).returncode
    if rc: raise RuntimeError(f"B 退出码 {rc}")
    docx = md[:-3] + ".docx"
    if not os.path.exists(docx): raise RuntimeError("B 无产物")
    return docx

# main: 捕获每阶段异常 → 写 manifest → 打印 status
  • 完整链路:stage_a → stage_b → manifest
  • --join:仅跑下游,假定上游产物已落盘(长作业/分布式跑上游时收尾装配)
  • --self-test:生成样例中间文件 → 跑下游 → 断言产物非空 → 清理(无需上游重依赖即可验证编排逻辑)

实现坑(已踩并修复)

  • Windows venv 路径:解释器在 envs\<名>\Scripts\python.exe,不是 envs\<名>\python.exe。
  • stdout 编码:日志含中文/emoji 时,给 stdout/stderr 加 reconfigure(encoding="utf-8", errors="replace") 防 GBK 控制台炸。
  • 子脚本路径不要相对 _HERE:技能被移到 ~/.workbuddy/skills/ 后,_HERE 变了会找不到相邻的子技能目录,统一用环境变量 + 绝对路径默认更稳。

多技能 DAG 编排(链路口 > 3 或存在分支/汇合时)

当技能链路不止 A→B,而是有分支、汇合、或 4+ 节点时,用 scripts/orchestrate_dag.py(纯 stdlib,灵感来自 LangGraph 的「图 + 节点 + 边」,但用 subprocess 实现,不引入重依赖)。它把 orchestrate_scan2report.py 的两阶段线性编排泛化为任意 DAG。

配置(JSON)

{
  "name": "my-dag",
  "vars": { "MD2DOCX": "C:/.../md2docx.py" },
  "nodes": {
    "gen":     { "cmd": ["python","-c","..."], "deps": [], "outputs": ["report.md"] },
    "report":  { "cmd": ["python","{MD2DOCX}","{OUT}/report.md"], "deps": ["gen"], "outputs": ["report.docx"] },
    "summary": { "cmd": ["python","-c","..."], "deps": ["gen"], "outputs": ["summary.md"] },
    "archive": { "cmd": ["python","-c","..."], "deps": ["report"], "outputs": ["archive/report.docx"] }
  }
}
  • 节点 = 一次 subprocess 调用;deps = 依赖的节点 id(即边)。
  • 变量:{OUT}=共享工作目录(自动转正斜杠,避免 Windows \U 转义坑),{INPUT}=顶层输入,vars=自定义(如子脚本路径)。
  • 引擎:拓扑排序(Kahn)+ 并发无依赖节点(上例 report 与 summary 并行)+ 失败降级。

运行

"$PY" "$ORCH/scripts/orchestrate_dag.py" --config "$ORCH/examples/dag_demo.json" --out ./out
"$PY" "$ORCH/scripts/orchestrate_dag.py" --self-test          # 内置 DAG 自测(需 python-docx 的 venv)
  • 失败策略:默认 skip_downstream(失败节点下游全 skipped,已完成产物保留);--fail-fast 立即中断。
  • 结束输出 dag_manifest_<日期>.json(每节点 status / duration_s / outputs,可观测)。
  • --max-workers 控制并发度(默认 4)。

实测结论(本环境,venv python)

  • 示范 DAG 4 节点全 ok:gen → (report ∥ summary) → archive,report.docx 37KB,archive 复制成功,并发生效。
  • 失败用例:report 故意失败 → archive 自动 skipped;summary(并行、不依赖 report)仍 ok。降级符合预期。

选型建议:2 节点线性用 orchestrate_scan2report.py;>3 节点或有分支/汇合用 orchestrate_dag.py。真要复杂状态机/条件分支再考虑引入 LangGraph。

衔接

  • 配合 skill-inventory:先治理后编排——资产理清后再把技能串成流水线。
  • 治理产出的 json 可直接作为编排器的技能目录清单输入。

Current listing version

1.0.2

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 提供高价值的技能编排能力,解决用户将多个文件处理技能串联成自动化流水线的核心痛点
  • 自带已验证的示范链路和通用编排骨架,显著降低用户使用门槛
  • 支持顺序控制、可观测清单、失败降级,具备生产级可靠性
Trigger Precision95/100

Highlights

  • 触发词覆盖全面且边界清晰,能有效区分同类工具
  • description 位置正确,内容完整无截断
Structure and Standards85/100

Areas to improve

  • 文档过长 Reported severity: Minor

    主文档内容详尽但篇幅较长(约1800字),可能影响用户快速获取关键信息

    Recommendation: 建议将 DAG 编排等进阶内容拆分为独立文档或通过锚点跳转,提升可读性

Highlights

  • Phase/步骤清晰,包含完整端到端示例和自测机制
  • frontmatter 完整,结构规范良好
Execution Reliability90/100

Highlights

  • 使用 subprocess 进程隔离调用,故障互不污染
  • 覆盖主要异常场景(上游失败停、下游失败降级)
  • 环境变量解耦路径依赖,支持跨机器部署
Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Translation pending; see source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.